:root {
  --canvas: #f6f7f5;
  --surface: #ffffff;
  --surface-soft: #f2f4f1;
  --surface-strong: #e9ede9;
  --ink: #18201d;
  --ink-soft: #5d6863;
  --ink-faint: #88918d;
  --line: #e1e5e2;
  --line-strong: #cfd5d1;
  --sidebar: #ffffff;
  --sidebar-soft: #eef3f0;
  --sidebar-line: #e1e6e3;
  --accent: #178f69;
  --accent-strong: #0d654b;
  --accent-soft: #e4f3ed;
  --blue: #386fc8;
  --blue-soft: #edf3fc;
  --amber: #9a6818;
  --amber-soft: #fbf3df;
  --danger: #b84a4a;
  --danger-soft: #faecea;
  --shadow-sm: none;
  --shadow-md: 0 18px 48px rgb(26 35 31 / 12%);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 8px;
  --sidebar-width: 220px;
}

body { background: var(--canvas); font-size: 14px; }
h1, h2, h3 { letter-spacing: 0; }
h1 { font-size: 2rem; font-weight: 720; }
h2 { font-size: 1.05rem; }
:focus-visible { outline: 2px solid rgb(23 143 105 / 36%); outline-offset: 2px; }

/* Quiet application frame */
.sidebar,
.sidebar-lite {
  width: var(--sidebar-width);
  padding: 18px 12px 12px;
  color: var(--ink);
  background: #fff;
  border-right: 1px solid var(--line);
}
.sidebar-brand { padding: 0 8px 18px; }
.brand { gap: 9px; color: var(--ink); }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: #fff;
  background: #14372d;
  box-shadow: none;
  font-size: .85rem;
}
.brand-copy strong { color: var(--ink); font-size: .86rem; }
.brand-copy small,
.sidebar-lite .brand-copy small { margin-top: 1px; color: var(--ink-faint); font-size: .58rem; letter-spacing: .08em; }
.brand-context {
  margin: 0 0 14px;
  padding: 7px 8px;
  gap: 7px;
  border-color: var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}
.context-icon { width: 27px; height: 27px; border-radius: 5px; color: var(--accent-strong); background: #fff; }
.context-icon svg { width: 15px; }
.brand-context small { color: var(--ink-faint); font-size: .56rem; }
.brand-context select { color: var(--ink); font-size: .72rem; }
.context-apply { width: 26px; min-width: 26px; min-height: 26px; border: 0; color: var(--ink-faint); background: transparent; }
.context-apply:hover { color: var(--ink); background: #fff; }

.primary-nav,
.primary-nav-lite { gap: 1px; scrollbar-color: var(--line-strong) transparent; }
.nav-label,
.primary-nav-lite .nav-label { margin: 15px 9px 5px; color: #9aa29e; font-size: .53rem; letter-spacing: .1em; }
.primary-nav a,
.primary-nav-lite a {
  min-height: 36px;
  padding: 7px 9px;
  gap: 9px;
  border-radius: 6px;
  color: #68736e;
  font-size: .76rem;
  transition: color .14s ease, background .14s ease;
}
.primary-nav a:hover { color: var(--ink); background: #f5f6f4; transform: none; }
.primary-nav a[aria-current="page"] { color: #164a3b; background: #eaf2ee; box-shadow: none; font-weight: 720; }
.primary-nav a svg { width: 17px; height: 17px; }
.sidebar-footer { padding: 11px 4px 0; border-top: 1px solid var(--line); }
.sidebar-user { padding: 0; gap: 8px; }
.user-avatar { width: 29px; height: 29px; border: 0; border-radius: 6px; color: #21443a; background: #e5ede9; }
.user-copy strong { color: var(--ink); font-size: .69rem; }
.user-copy small { color: var(--ink-faint); font-size: .58rem; }
.icon-button { min-width: 28px; min-height: 28px; color: var(--ink-faint); }
.icon-button:hover { color: var(--ink); background: var(--surface-soft); }

.app-surface { margin-left: var(--sidebar-width); }
.app-topbar,
.app-topbar-lite {
  min-height: 58px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(12px);
}
.topbar-kicker { display: none; }
.topbar-title { font-size: .8rem; font-weight: 720; }
.topbar-brand-context {
  padding: 4px 7px;
  gap: 6px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-soft);
  box-shadow: none;
}
.topbar-brand-context.is-active { border: 0; background: var(--accent-soft); }
.topbar-brand-dot { width: 22px; height: 22px; border-radius: 5px; font-size: .57rem; }
.topbar-brand-context small { font-size: .46rem; }
.topbar-brand-context strong { max-width: 150px; font-size: .62rem; }

#main-content { width: min(1480px, calc(100% - 48px)); padding: 24px 0 48px; }
.eyebrow { color: var(--accent-strong); font-size: .58rem; letter-spacing: .1em; }
.hero,
.hero.compact { margin-bottom: 24px; align-items: start; }
.hero.compact h1 { margin: 4px 0 6px; font-size: 2rem; }
.hero > p { max-width: 520px; color: var(--ink-soft); font-size: .78rem; }

/* Shared surfaces */
.panel,
.metric-card,
.auth-card,
.calendar-summary article,
.inbox-summary article,
.lead-summary article,
.calendar-list-day,
.agent-grid-card,
.agent-grid-piece,
.week-piece-card {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none;
}
.panel { padding: 16px; }
button,
.button-link { min-height: 36px; padding: 8px 12px; border-radius: 6px; box-shadow: none; font-size: .7rem; }
button:hover,
.button-link:hover { box-shadow: none; transform: none; }
input,
select,
textarea { border-radius: 6px; box-shadow: none; }
.status-pill,
.panel-count { border-radius: 5px; }

/* Minimal dashboard */
.minimal-dashboard { display: grid; gap: 20px; }
.dashboard-heading { display: flex; min-height: 72px; align-items: flex-start; justify-content: space-between; gap: 24px; }
.dashboard-heading h1 { margin: 3px 0 3px; }
.dashboard-heading p:last-child { margin: 0; color: var(--ink-soft); font-size: .78rem; }
.dashboard-runtime { display: inline-flex; margin-top: 5px; padding: 6px 8px; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-soft); background: #fff; font-size: .62rem; font-weight: 700; }
.dashboard-runtime i { width: 6px; height: 6px; border-radius: 50%; background: #b98b40; }
.dashboard-runtime.is-connected i { background: var(--accent); }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.dashboard-metrics > * { display: grid; min-width: 0; padding: 14px 16px; gap: 1px; color: var(--ink); border-right: 1px solid var(--line); text-decoration: none; }
.dashboard-metrics > *:last-child { border-right: 0; }
.dashboard-metrics > a:hover { background: var(--surface-soft); }
.dashboard-metrics span { color: var(--ink-soft); font-size: .64rem; }
.dashboard-metrics strong { margin: 2px 0; font-size: 1.55rem; font-weight: 720; }
.dashboard-metrics small { color: var(--ink-faint); font-size: .58rem; }
.dashboard-actions { display: flex; align-items: center; gap: 8px; }
.dashboard-actions form { margin: 0; }
.dashboard-text-link { margin-left: 4px; color: var(--ink-soft); font-size: .68rem; font-weight: 700; text-decoration: none; }
.dashboard-text-link:hover { color: var(--accent-strong); }
.dashboard-notice { display: flex; padding: 10px 12px; align-items: center; gap: 9px; border: 1px solid #ead8ad; border-radius: 7px; background: var(--amber-soft); }
.dashboard-notice > span { width: 7px; height: 7px; border-radius: 50%; background: #b7872c; }
.dashboard-notice strong { font-size: .7rem; }
.dashboard-notice p { margin: 1px 0 0; color: #74603c; font-size: .64rem; }
.week-gallery { margin-top: 4px; }
.week-gallery > header { margin-bottom: 10px; align-items: end; }
.week-gallery > header h2 { margin: 0 0 2px; font-size: 1rem; letter-spacing: 0; }
.week-gallery > header p:last-child { font-size: .68rem; }
.week-gallery > header a { color: var(--ink-soft); font-size: .65rem; }
.week-gallery-grid { gap: 12px; }
.week-piece-card { border-radius: 8px; }
.week-piece-media { background: var(--surface-soft); }
.week-piece-body { padding: 11px; gap: 6px; }
.week-piece-body h3 { min-height: 0; font-size: .78rem; }
.week-piece-body > div span { font-size: .54rem; letter-spacing: .07em; }
.week-piece-body em { border-radius: 4px; font-size: .49rem; }
.week-gallery-empty { padding: 40px 20px; border-radius: 8px; }

/* Content and calendar become flatter, denser work surfaces */
.content-plan-queue-heading { margin-bottom: 12px; }
.agent-grid-list { gap: 8px; }
.agent-grid-card { box-shadow: none; }
.agent-grid-card > summary { min-height: 72px; padding: 10px 12px; }
.agent-grid-card > summary .content-plan-progress {
  justify-items: end;
  text-align: right;
}
.agent-grid-card > summary .content-plan-progress strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
}
.agent-grid-card[open] > summary { background: #f7faf8; }
.agent-grid-body { background: #f7f8f6; }
.agent-grid-pieces { padding: 12px; gap: 12px; }
.agent-grid-piece { padding: 10px; }
.agent-grid-assets a { border-width: 5px; border-radius: 18px; box-shadow: none; }
.agent-grid-approved-queue { border-radius: 7px; }
.agent-grid-review-tools {
  display: flex;
  min-height: 34px;
  margin-bottom: 10px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.agent-grid-review-tools > a {
  color: var(--ink-soft);
  font-size: .66rem;
  font-weight: 700;
}
.agent-grid-clear-state {
  display: flex;
  grid-column: 1 / -1;
  min-height: 78px;
  padding: 16px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--surface);
}
.agent-grid-clear-state > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--accent-soft);
}
.agent-grid-clear-state strong { color: var(--ink); font-size: .78rem; }
.agent-grid-clear-state p { margin: 2px 0 0; font-size: .66rem; }

.review-inbox { max-width: 1180px; margin: 0 auto; padding: 28px 24px 48px; }
.review-inbox-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.review-inbox-heading h1 { margin: 2px 0 4px; font-size: 1.8rem; }
.review-inbox-heading p { margin: 0; max-width: 620px; color: var(--muted); }
.review-inbox-list { padding-top: 24px; }
.review-inbox-batch { border: 0; background: transparent; box-shadow: none; }
.review-phone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
  justify-content: center;
  gap: 28px;
  padding: 0;
}
.review-phone-card { min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.review-phone-card > header { display: grid; gap: 3px; padding: 0 2px 10px; }
.review-phone-card > header span { color: var(--accent); font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.review-phone-card > header strong { font-size: .82rem; line-height: 1.35; }
.review-phone-screen {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  aspect-ratio: 9 / 16;
  border: 6px solid #173c33;
  border-radius: 24px;
  background: #eef2ef;
  scrollbar-width: thin;
}
.review-phone-screen a { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
.review-phone-screen img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.review-simple-actions { display: flex; align-items: start; gap: 8px; padding-top: 10px; }
.review-simple-actions .prompt-vote-controls { display: flex; gap: 8px; }
.review-simple-actions .prompt-vote-button,
.review-comment > summary {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.review-simple-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.review-comment { position: relative; }
.review-comment > summary { list-style: none; }
.review-comment > summary::-webkit-details-marker { display: none; }
.review-comment > summary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.review-comment[open] { flex: 1; }
.review-comment[open] > summary { margin-bottom: 8px; }
.review-comment form { display: grid; grid-template-columns: 1fr auto; gap: 8px; min-width: 220px; }
.review-comment textarea { grid-column: 1 / -1; min-height: 72px; resize: vertical; }
.review-comment button { min-height: 34px; padding: 7px 12px; }
.review-comment .prompt-comment-status { align-self: center; font-size: .68rem; color: var(--muted); }
.review-inbox-empty,
.review-inbox .agent-grid-clear-state {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 48px auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.review-inbox-empty > span,
.review-inbox .agent-grid-clear-state > span { color: var(--accent); font-size: 1.2rem; }
.review-inbox-empty p { margin: 3px 0 0; color: var(--muted); font-size: .76rem; }
.prompt-bank,
.agent-grid-safety { border-radius: 7px; }
.calendar-filter-deck { padding: 10px; border-radius: 8px; background: #fff; }
.calendar-period-control { border-radius: 8px; box-shadow: none; }
.calendar-summary { gap: 8px; }
.calendar-summary article { min-height: 78px; }
.calendar-day { border-radius: 8px; box-shadow: none; }
.calendar-zero-state,
.calendar-truth-rail { border-radius: 8px; }

.calendar-command-hero {
  display: block;
  min-height: 0;
  margin-bottom: 18px;
  padding: 8px 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}
.calendar-command-hero::before { display: none; }
.calendar-command-copy { position: static; }
.calendar-command-copy h1 {
  margin: 2px 0 4px;
  color: var(--ink);
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: 0;
}
.calendar-command-copy > p:not(.eyebrow) {
  max-width: none;
  margin: 0;
  color: var(--ink-soft);
  font-size: .78rem;
}
.calendar-command-badges { margin-top: 10px; }
.calendar-command-badges span {
  padding: 4px 7px;
  border-color: var(--line);
  border-radius: 5px;
  color: var(--ink-soft);
  background: var(--surface);
}
.content-composer:not([open]) { box-shadow: none; }
.content-composer-summary { min-height: 68px; }

@media (max-width: 900px) {
  .sidebar,
  .sidebar-lite { position: relative; width: 100%; padding: 10px 12px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { padding: 0 4px 8px; }
  .brand-copy small { display: none; }
  .brand-context { margin: 0 0 8px; }
  .primary-nav,
  .primary-nav-lite { display: flex; padding-bottom: 2px; overflow-x: auto; gap: 3px; }
  .primary-nav .nav-label { display: none; }
  .primary-nav a,
  .primary-nav-lite a { min-width: max-content; min-height: 34px; padding: 6px 9px; }
  .sidebar-footer { position: absolute; top: 9px; right: 10px; padding: 0; border: 0; }
  .user-copy { display: none; }
  .app-surface { margin-left: 0; }
  .app-topbar,
  .app-topbar-lite { min-height: 50px; padding: 0 12px; }
  #main-content { width: calc(100% - 24px); padding: 18px 0 36px; }
  .hero { display: grid; gap: 8px; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-metrics > *:nth-child(2) { border-right: 0; }
  .dashboard-metrics > *:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .week-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .review-inbox { padding: 20px 14px 40px; }
  .review-inbox-heading { align-items: start; }
  .review-inbox-heading p { font-size: .78rem; }
  .review-phone-grid { grid-template-columns: minmax(0, 340px); gap: 24px; }
  .topbar-brand-context small { display: none; }
  .topbar-brand-context strong { max-width: 105px; }
  .dashboard-heading { min-height: 0; flex-direction: column; gap: 8px; }
  .dashboard-runtime { margin: 0; }
  .dashboard-actions { align-items: stretch; flex-wrap: wrap; }
  .dashboard-actions form,
  .dashboard-actions button,
  .dashboard-actions .button-link { flex: 1 1 135px; }
  .dashboard-actions button,
  .dashboard-actions .button-link { width: 100%; justify-content: center; text-align: center; }
  .dashboard-text-link { width: 100%; margin: 4px 0 0; }
  .week-gallery-grid { grid-template-columns: 1fr; }
  .agent-grid-card > summary { grid-template-columns: 42px minmax(0, 1fr) 16px; }
  .content-plan-progress,
  .content-plan-state { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
