:root {
  --ink: #251e28;
  --muted: #716876;
  --canvas: #f3f0f4;
  --surface: #fff;
  --plum: #481652;
  --orchid: #ad55bc;
  --orchid-soft: #f1e5f3;
  --green: #1e7659;
  --green-soft: #e3f2ec;
  --amber: #9a6414;
  --amber-soft: #fff0d2;
  --line: #e4dee5;
  --shadow: 0 9px 30px rgba(49, 32, 53, .07);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input { font: inherit; }
a { color: inherit; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 99; padding: 10px; background: #fff; }
.skip-link:focus { top: 12px; }
.prototype-bar { position: fixed; inset: 0 0 auto 0; z-index: 20; height: 26px; display: grid; place-items: center; color: #eaddff; background: #251e28; font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; }
.desk-shell { min-height: 100vh; display: grid; grid-template-columns: 224px 1fr; padding-top: 26px; }
.sidebar { position: sticky; top: 26px; height: calc(100vh - 26px); display: flex; flex-direction: column; padding: 24px 16px; color: #eee5f0; background: var(--plum); }
.brand { width: 70px; height: 58px; display: flex; flex-direction: column; justify-content: center; margin: 0 8px 28px; padding: 7px 9px; color: #fff; background: var(--orchid); text-decoration: none; box-shadow: 5px 5px 0 rgba(255,255,255,.15); }
.brand span { font-size: 1.4rem; line-height: .95; font-weight: 900; }
.brand small { margin-top: 4px; padding-top: 3px; border-top: 1px solid rgba(255,255,255,.8); font-size: .7rem; }
.sidebar nav, .sidebar__bottom { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a, .sidebar__bottom a { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 9px; padding: 10px 11px; border-radius: 6px; color: #d9cbdc; text-decoration: none; font-size: .78rem; font-weight: 650; }
.sidebar nav a:hover, .sidebar nav a.active, .sidebar__bottom a:hover { color: #fff; background: rgba(255,255,255,.1); }
.sidebar nav a.active { box-shadow: inset 3px 0 0 #ffd96a; }
.sidebar nav a > span, .sidebar__bottom a > span { text-align: center; color: #cf9bd8; font-size: 1rem; }
.sidebar nav em { min-width: 21px; padding: 2px 5px; border-radius: 99px; color: #fff; background: rgba(255,255,255,.15); text-align: center; font-size: .62rem; font-style: normal; }
.sidebar__bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14); }

#desk-main { min-width: 0; }
.topbar { position: sticky; top: 26px; z-index: 10; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 30px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.topbar > div:first-of-type { display: flex; flex-direction: column; }
.topbar > div:first-of-type span { font-weight: 850; }
.topbar > div:first-of-type small { color: var(--muted); font-size: .68rem; }
.topbar__actions { display: flex; align-items: center; gap: 9px; }
.primary-button, .quiet-button, .panel__header button { border: 0; border-radius: 5px; padding: 9px 12px; font-size: .72rem; font-weight: 800; cursor: pointer; }
.primary-button { color: #fff; background: var(--plum); }
.quiet-button, .panel__header button { color: var(--plum); background: #fff; border: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; margin-left: 4px; border-radius: 50%; color: #fff; background: var(--orchid); font-size: .65rem; font-weight: 900; }
.menu-button { display: none; }

.workspace { width: min(calc(100% - 56px), 1320px); margin-inline: auto; padding-block: 44px 70px; }
.page-heading { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; }
.eyebrow { margin: 0 0 7px; color: var(--orchid); font-size: .63rem; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.page-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 2.6rem; line-height: 1; }
.page-heading p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: .8rem; }
.environment { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: .68rem; font-weight: 750; }
.environment i { width: 7px; height: 7px; border-radius: 50%; background: #e2a625; }
.status-strip { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 28px; padding: 13px 18px; background: var(--green-soft); border: 1px solid #cbe5da; }
.status-strip > div { display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: center; }
.status-strip i { grid-row: 1 / 3; width: 9px; height: 9px; border-radius: 50%; background: #32a677; box-shadow: 0 0 0 4px rgba(50,166,119,.12); }
.status-strip strong { color: #174f3d; font-size: .8rem; }
.status-strip span { color: #557267; font-size: .66rem; }
.status-strip a { color: #174f3d; font-size: .7rem; font-weight: 850; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.metrics article { min-height: 120px; padding: 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.metrics p { margin: 0; color: var(--muted); font-size: .68rem; font-weight: 700; }
.metrics strong { display: block; margin-top: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; }
.metrics span { color: #9a919d; font-size: .62rem; }

.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; margin-top: 16px; }
.panel { min-width: 0; padding: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.panel__header h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; }
.panel__header a, .panel__header button { color: var(--plum); font-size: .66rem; font-weight: 850; }
.brief-status { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 18px 0 7px; padding: 13px; background: var(--orchid-soft); }
.brief-status > span { grid-row: 1 / 3; align-self: center; padding: 4px 7px; color: #fff; background: var(--orchid); font-size: .6rem; font-weight: 900; text-transform: uppercase; }
.brief-status strong { font-size: .76rem; }
.brief-status small { color: var(--muted); font-size: .62rem; }
.brief-queue, .feed-list, .checklist { margin: 0; padding: 0; list-style: none; }
.brief-queue li, .feed-list li { min-height: 62px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; border-bottom: 1px solid #eee9ef; }
.brief-queue .drag { color: #b8adb9; cursor: grab; }
.brief-queue div, .feed-list div { display: flex; flex-direction: column; }
.brief-queue strong, .feed-list strong { font-size: .72rem; }
.brief-queue small, .feed-list small { color: var(--muted); font-size: .61rem; }
.brief-queue em, .feed-list em { padding: 3px 6px; border-radius: 99px; font-size: .56rem; font-style: normal; font-weight: 850; }
.ready, .healthy { color: var(--green); background: var(--green-soft); }
.automatic { color: var(--plum); background: var(--orchid-soft); }
.attention, .move { color: var(--amber); background: var(--amber-soft); }
.editorial-panel footer { display: flex; justify-content: space-between; align-items: center; padding-top: 18px; }
.editorial-panel footer span { color: var(--muted); font-size: .62rem; }
.feed-icon { width: 32px; height: 32px; display: grid; place-items: center; color: var(--plum); background: var(--orchid-soft); font-family: Georgia, serif; font-weight: 900; }
.next-run { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding: 12px; background: #f6f3f6; font-size: .67rem; }
.next-run strong { color: var(--plum); }
.score { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--green); border: 4px solid #9ad8bf; font-size: .72rem; font-weight: 900; }
.search-preview { margin-top: 18px; padding: 16px; border: 1px solid var(--line); }
.search-preview small { color: var(--green); font-size: .55rem; }
.search-preview strong { display: block; margin: 5px 0; color: #2855a5; font-size: .8rem; }
.search-preview p { margin: 0; color: var(--muted); font-size: .62rem; }
.checklist { display: grid; gap: 8px; margin-block: 17px; }
.checklist li { position: relative; padding-left: 20px; color: var(--muted); font-size: .65rem; }
.checklist li::before { content: "○"; position: absolute; left: 0; color: #aaa0ac; }
.checklist li.done::before { content: "✓"; color: var(--green); font-weight: 900; }
.tier-row { display: grid; grid-template-columns: 55px 1fr auto; align-items: center; gap: 12px; min-height: 67px; border-bottom: 1px solid var(--line); }
.tier-row > span { width: max-content; padding: 4px 6px; color: var(--plum); background: var(--orchid-soft); font-size: .56rem; font-weight: 900; text-transform: uppercase; }
.tier-row--one > span { color: #58400d; background: #ffebb1; }
.tier-row div { display: flex; flex-direction: column; }
.tier-row strong { font-size: .72rem; }
.tier-row small { color: var(--muted); font-size: .6rem; }
.tier-row em { color: var(--green); font-size: .59rem; font-style: normal; font-weight: 850; }
.ad-rules { margin-top: 18px; padding: 12px; background: #f6f3f6; }
.ad-rules strong { font-size: .65rem; }
.ad-rules p { margin: 3px 0 0; color: var(--muted); font-size: .58rem; }

@media (max-width: 1050px) {
  .desk-shell { grid-template-columns: 76px 1fr; }
  .sidebar { padding-inline: 10px; }
  .brand { width: 50px; margin-inline: 3px; }
  .sidebar nav a, .sidebar__bottom a { grid-template-columns: 1fr; padding: 11px 6px; text-align: center; }
  .sidebar nav a > span, .sidebar__bottom a > span { font-size: 1.1rem; }
  .sidebar nav a { font-size: 0; }
  .sidebar nav em { display: none; }
  .sidebar__bottom a { font-size: 0; }
}

@media (max-width: 760px) {
  .desk-shell { display: block; }
  .sidebar { position: fixed; left: -240px; top: 26px; z-index: 30; width: 224px; transition: left .2s ease; }
  body.nav-open .sidebar { left: 0; }
  .sidebar nav a, .sidebar__bottom a { grid-template-columns: 22px 1fr auto; text-align: left; font-size: .78rem; }
  .sidebar__bottom a { font-size: .78rem; }
  .menu-button { display: block; border: 1px solid var(--line); background: #fff; padding: 8px 10px; font-size: .7rem; font-weight: 850; }
  .topbar { padding-inline: 15px; }
  .topbar > div:first-of-type { display: none; }
  .topbar__actions .quiet-button { display: none; }
  .workspace { width: min(calc(100% - 28px), 1320px); padding-top: 30px; }
  .page-heading { display: block; }
  .environment { margin-top: 18px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .metrics { grid-template-columns: 1fr; }
  .status-strip { align-items: flex-start; }
  .status-strip a { display: none; }
}
