:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #f0f4f1;
  --ink: #17201d;
  --muted: #65706c;
  --line: #dfe7e2;
  --teal: #177a71;
  --teal-dark: #0f5e57;
  --green: #27834a;
  --green-soft: #eaf7ee;
  --amber: #b56a12;
  --amber-soft: #fff5e6;
  --red: #b83a3a;
  --red-soft: #fff0ef;
  --blue: #3268b8;
  --blue-soft: #edf4ff;
  --indigo: #4b58a7;
  --shadow: 0 10px 28px rgba(30, 41, 36, 0.06);
  --radius: 8px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-width: 320px;
  font-size: 14px;
  line-height: 1.45;
}

body[data-theme="dark"] {
  --bg: #0d1413;
  --surface: #141f1d;
  --surface-2: #1a2926;
  --ink: #eef7f4;
  --muted: #9fb2ad;
  --line: #2b3d39;
  --teal: #39a99f;
  --teal-dark: #66cfc6;
  --green: #57c77d;
  --amber: #e1a64c;
  --red: #e46d6d;
  --indigo: #96a2ff;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  color-scheme: dark;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a.button {
  border: 0;
  background: var(--teal);
  color: #fff;
  min-height: 36px;
  border-radius: var(--radius);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

button:hover,
a.button:hover {
  background: var(--teal-dark);
  box-shadow: 0 6px 18px rgba(22, 125, 117, 0.18);
}

button:active,
a.button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

button.subtle,
a.button.subtle {
  background: #e8efec;
  color: var(--ink);
}

button.subtle:hover,
a.button.subtle:hover {
  background: #dbe7e2;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

/* ── Shell ─────────────────────────────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  background: #0f1c19;
  color: #d6e9e5;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  border-right: 1px solid rgba(255,255,255,.05);
}

.sidebar::-webkit-scrollbar { display: none; }

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1b3d36;
  color: #5dd6c8;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  font-size: 0.88rem;
  color: #ecf6f3;
  white-space: nowrap;
}

.brand span {
  display: block;
  color: #6a8a84;
  font-size: 0.75rem;
  margin-top: 1px;
}

/* Active project pill */
.sidebar-project {
  margin: 0 10px 6px;
  border-radius: 8px;
  border: 1px solid rgba(93,214,200,.15);
  background: rgba(93,214,200,.06);
  flex-shrink: 0;
  min-height: 52px;
}

.sidebar-project-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-decoration: none;
  transition: background 120ms;
}

.sidebar-project-inner:hover { background: rgba(93,214,200,.1); }

.sidebar-project-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5dd6c8;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(93,214,200,.25);
}

.sidebar-project-text {
  flex: 1;
  min-width: 0;
}

.sidebar-project-text span {
  display: block;
  color: #c5ece8;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-project-text small {
  display: block;
  color: #4d7a74;
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-project-chevron {
  width: 13px;
  height: 13px;
  color: #4d7a74;
  flex: 0 0 auto;
}

/* Nav */
.nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 0;
  gap: 2px;
}

/* Home link */
.nav-home {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  color: #7da8a1;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: .01em;
  margin-bottom: 6px;
  transition: background 120ms, color 120ms;
}

.nav-home:hover { background: rgba(255,255,255,.06); color: #d6e9e5; }
.nav-home.active { background: rgba(93,214,200,.12); color: #5dd6c8; }

/* Groups */
.nav-group {
  margin-bottom: 4px;
}

.nav-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #4d6e68;
}

.nav-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #2a4e48;
  font-size: 0.6rem;
  font-weight: 900;
  color: #3d6e67;
  flex: 0 0 auto;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  color: #7da8a1;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 120ms, color 120ms;
}

.nav a svg { width: 15px; height: 15px; opacity: .7; flex: 0 0 auto; }
.nav a:hover { background: rgba(255,255,255,.06); color: #d6e9e5; }
.nav a:hover svg { opacity: 1; }

.nav a.active {
  background: rgba(93,214,200,.13);
  color: #7eeee5;
  font-weight: 700;
}
.nav a.active svg { opacity: 1; color: #5dd6c8; }

/* Featured checklist item */
.nav-featured {
  background: rgba(93,214,200,.07) !important;
  color: #9ef5ef !important;
  font-weight: 700 !important;
  border: 1px solid rgba(93,214,200,.12);
}
.nav-featured svg { opacity: 1 !important; color: #5dd6c8; }
.nav-featured:hover { background: rgba(93,214,200,.14) !important; }
.nav-featured.active {
  background: rgba(93,214,200,.2) !important;
  border-color: rgba(93,214,200,.25) !important;
}

/* Sidebar footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: auto;
}

.sidebar-footer .icon-button {
  background: transparent;
  color: #4d6e68;
  border: none;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 6px;
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: background 120ms, color 120ms;
}
.sidebar-footer .icon-button:hover { background: rgba(255,255,255,.07); color: #9ef5ef; box-shadow: none; }
.sidebar-footer .icon-button svg { width: 14px; height: 14px; }

/* ── Main content ──────────────────────────────────────────────────────────── */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ────────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left .eyebrow {
  margin-bottom: 2px;
  font-size: 0.7rem;
  letter-spacing: .06em;
}

.topbar-left h1 {
  font-size: 1.15rem;
  line-height: 1.2;
  margin: 0;
}

/* View area */
.view {
  flex: 1;
  padding: 22px 24px 40px;
}

/* Deprecated overrides kept for compat */
.sidebar-note { display: none; }
.topbar-actions { display: none; }

.client-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px;
}

.client-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

/* Legacy topbar override — real topbar is above in new styles */
.topbar {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 2px;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: .06em;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

h2 {
  font-size: 1rem;
  line-height: 1.25;
  margin-bottom: 8px;
}

h3 {
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.card-heading h3 {
  margin-bottom: 0;
}

.framework-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.copy-url {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.social-calendar {
  display: grid;
  gap: 14px;
}

.social-post-card {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.post-preview {
  min-height: 130px;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e7f4f0, #f7efe4);
  color: var(--teal-dark);
  display: grid;
  place-items: center;
  font-weight: 900;
  overflow: hidden;
  cursor: zoom-in;
  padding: 0;
}

.post-preview.story,
.post-preview.reel {
  aspect-ratio: 9 / 16;
}

.post-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #f8f4f0;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(6px);
}

.image-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(94vw, 920px);
  max-height: 94vh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.34);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.image-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-lightbox-header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-lightbox-panel img {
  width: 100%;
  max-height: calc(94vh - 92px);
  object-fit: contain;
  display: block;
  border-radius: calc(var(--radius) - 4px);
  background: #f8f4f0;
}

.post-body {
  min-width: 0;
}

.post-body details {
  margin: 10px 0;
}

.post-body summary {
  cursor: pointer;
  font-weight: 800;
}

.comment-stack {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.comment-stack div {
  border-left: 3px solid var(--teal);
  padding-left: 10px;
}

.comment-stack strong,
.comment-stack span {
  display: block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button {
  width: 36px;
  padding: 0;
}

.project-context {
  min-width: min(560px, 52vw);
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  box-shadow: var(--shadow);
}

.context-copy {
  min-width: 0;
}

.context-copy span,
.project-context-actions span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.context-copy strong,
.context-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-copy strong {
  font-size: 0.92rem;
}

.context-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}

.project-context-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-context-actions .button {
  min-height: 30px;
  padding-inline: 10px;
  font-size: 0.78rem;
}

.mini-stats,
.mini-services {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-stats span {
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.mini-services span {
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--teal-dark);
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.notice {
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #e6f4ee;
  border: 1px solid #bfdfd1;
  color: #18583d;
  margin-bottom: 18px;
  font-weight: 700;
}

.notice.error {
  background: #f8e6e6;
  border-color: #e7baba;
  color: #8d2727;
}

.view {
  display: grid;
  gap: 14px;
}

.loading-panel,
.panel,
.metric-card,
.module-card,
.project-card,
.insight-row,
.audit-card,
.brief-card,
.schedule-row,
.notification-row,
.citation-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
}

.loading-panel {
  padding: 60px 40px;
  color: var(--muted);
  text-align: center;
}

.panel {
  padding: 18px 20px;
}

.panel + .panel { margin-top: 16px; }

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header.tight {
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.panel-header p {
  color: var(--muted);
  margin-bottom: 0;
  font-size: 0.88rem;
  line-height: 1.55;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-metrics .metric-card {
  min-height: 112px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-home-grid,
.route-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-home-card {
  text-align: left;
  min-height: 138px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  gap: 12px;
  align-content: space-between;
  justify-content: initial;
  align-items: stretch;
  width: auto;
}

.project-home-card:hover {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(30, 41, 36, 0.08);
}

.project-home-card.good {
  border-color: #cce8d5;
}

.project-home-card.warning {
  border-color: #f0d7ae;
}

.project-home-card.danger {
  border-color: #efc1c1;
}

.project-home-card strong,
.project-home-card span,
.project-home-card small {
  display: block;
}

.project-home-card small {
  color: var(--muted);
  line-height: 1.45;
}

.route-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 108px;
  box-shadow: var(--shadow);
}

.route-tile strong,
.route-tile small,
.route-tile span {
  display: block;
}

.route-tile small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.route-tile span:last-child {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
}

.route-tile:hover {
  box-shadow: 0 14px 30px rgba(30, 41, 36, 0.08);
}

.route-tile.good {
  border-color: #cae7d4;
}

.route-tile.warning {
  border-color: #efd9b3;
}

.route-tile.danger {
  border-color: #efc5c5;
}

.project-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.project-strip strong,
.project-strip span {
  display: block;
}

.project-strip strong {
  font-size: 1.08rem;
}

.project-strip span:last-child {
  color: var(--muted);
  margin-top: 3px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.project-workspace {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.project-directory,
.project-editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.project-directory {
  padding: 12px;
  display: grid;
  gap: 12px;
  position: sticky;
  top: 20px;
}

.directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.directory-header span {
  color: var(--muted);
  font-size: 0.78rem;
}

.directory-list {
  display: grid;
  gap: 8px;
  max-height: 70vh;
  overflow: auto;
}

.directory-card {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 6px;
  box-shadow: none;
}

.directory-card span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.directory-card.active {
  border-color: rgba(23, 122, 113, 0.35);
  background: linear-gradient(135deg, #f6fbf8, #f4f8ff);
}

.project-editor {
  padding: 14px;
}

.editor-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.editor-header p {
  color: var(--muted);
  margin-bottom: 0;
}

.project-record-form textarea {
  min-height: 108px;
}

.project-card {
  padding: 14px;
  box-shadow: none;
  display: grid;
  gap: 14px;
}

.project-card.active {
  border-color: rgba(22, 125, 117, 0.5);
  background: var(--surface-2);
}

.project-card p {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.metric-card {
  padding: 14px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: none;
}

.metric-label {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.metric-value {
  font-size: clamp(1.35rem, 2.3vw, 1.9rem);
  font-weight: 900;
  line-height: 1;
  margin-top: 9px;
  overflow-wrap: anywhere;
}

.metric-detail {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  margin-top: 10px;
}

.scorebar {
  height: 8px;
  border-radius: 999px;
  background: #e3ebe7;
  overflow: hidden;
  margin-top: 12px;
}

.scorebar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
  width: var(--score);
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 4px 9px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip.ok {
  border-color: #b9dcc8;
  color: #1e6c39;
  background: var(--green-soft);
}

.chip.warn {
  border-color: #ead1a8;
  color: #87510e;
  background: var(--amber-soft);
}

.chip.fail {
  border-color: #e4b4b4;
  color: #8d2727;
  background: var(--red-soft);
}

.client-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 14px;
  align-items: stretch;
  background: linear-gradient(135deg, #ffffff 0%, #f2f7f2 58%, #eef6ff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.client-hero-main h2 {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  margin-bottom: 4px;
}

.client-hero-main p {
  color: var(--muted);
  margin-bottom: 12px;
}

.health-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
  background: #fff;
}

.health-tile span,
.health-tile small {
  color: var(--muted);
  font-weight: 800;
}

.health-tile strong {
  font-size: 2rem;
  line-height: 1;
}

.health-tile.good {
  border-color: #b9dcc8;
  background: var(--green-soft);
}

.health-tile.warning {
  border-color: #ead1a8;
  background: var(--amber-soft);
}

.health-tile.danger {
  border-color: #e4b4b4;
  background: var(--red-soft);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.service-card {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  text-decoration: none;
  box-shadow: none;
}

.service-card:hover {
  border-color: rgba(23, 122, 113, 0.45);
  box-shadow: 0 10px 26px rgba(23, 122, 113, 0.08);
}

.service-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.service-card span,
.service-card small {
  display: block;
  color: var(--muted);
}

.service-card span {
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.service-card strong {
  display: block;
  margin: 3px 0;
  font-size: 0.95rem;
}

.service-card small {
  line-height: 1.35;
}

.service-card b {
  color: var(--muted);
  font-size: 0.9rem;
}

.service-card.good .service-icon {
  background: var(--green-soft);
  color: var(--green);
}

.service-card.warning .service-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.service-card.not-enabled {
  opacity: 0.7;
  background: #fbfcfb;
}

.dashboard-split {
  align-items: start;
}

.focus-list,
.automation-card {
  display: grid;
  gap: 9px;
}

.focus-item,
.automation-card > div,
.area-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
}

.focus-item {
  display: grid;
  gap: 2px;
}

.focus-item span,
.focus-item small,
.automation-card span,
.area-card span {
  color: var(--muted);
}

.focus-item span {
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.focus-item.warning {
  border-color: #ead1a8;
  background: var(--amber-soft);
}

.focus-item.danger {
  border-color: #e4b4b4;
  background: var(--red-soft);
}

.focus-item.good {
  border-color: #b9dcc8;
  background: var(--green-soft);
}

.automation-card > div {
  display: grid;
  gap: 3px;
}

.area-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.area-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.area-card strong,
.area-card span {
  display: block;
}

.area-card b {
  font-size: 1.05rem;
}

.area-card .scorebar {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 12px;
}

.module-card {
  padding: 14px;
  box-shadow: none;
  min-height: 148px;
}

.module-card p {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 10px;
}

.growth-card {
  min-height: auto;
}

.compact-form {
  margin-top: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.module-card small {
  color: var(--teal-dark);
  font-weight: 800;
}

.module-card.muted-card {
  background: #f8faf9;
  color: var(--muted);
  box-shadow: none;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reference-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: none;
  display: grid;
}

.reference-card img,
.reference-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #edf2ef;
  color: var(--muted);
}

.reference-placeholder {
  display: grid;
  place-items: center;
  font-weight: 800;
}

.reference-card > div {
  padding: 14px;
}

.reference-card p {
  color: var(--muted);
  line-height: 1.45;
}

.reference-card a {
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration: none;
  margin-top: 10px;
  display: inline-flex;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.task-column {
  min-height: 260px;
}

.task-list,
.report-stack {
  display: grid;
  gap: 12px;
}

.task-card,
.asset-card,
.report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: none;
}

.task-card p,
.asset-card p,
.report-card p {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.asset-card {
  display: grid;
  gap: 12px;
  padding: 0;
  overflow: hidden;
}

.asset-card > div:not(.asset-preview) {
  padding: 0 14px 14px;
}

.asset-preview {
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  min-height: 160px;
  aspect-ratio: 1 / 1;
  background: #f8f4f0;
  display: grid;
  place-items: center;
  cursor: zoom-in;
  overflow: hidden;
}

.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.file-preview {
  color: var(--muted);
  font-weight: 900;
}

.report-card {
  display: grid;
  gap: 12px;
}

.report-card details,
.panel details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.report-card summary,
.panel summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
  list-style: none;
}

.report-card summary::-webkit-details-marker,
.panel summary::-webkit-details-marker {
  display: none;
}

.report-card details[open] summary,
.panel details[open] summary {
  margin-bottom: 12px;
}

.report-export {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.76rem;
}

.search-results {
  display: grid;
  gap: 10px;
}

.search-result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 12px;
  align-items: center;
}

.search-result strong,
.search-result p {
  display: block;
}

.search-result p {
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.attention-list,
.feature-module-stack {
  display: grid;
  gap: 12px;
}

.attention-card,
.feature-module,
.feature-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: none;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.feature-item p {
  color: var(--muted);
  line-height: 1.45;
  margin: 8px 0 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: #35433f;
  font-weight: 800;
  font-size: 0.86rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  min-height: 40px;
  padding: 10px 12px;
  outline: none;
}

.checkbox-field {
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
}

.checkbox-field span {
  order: 2;
}

.checkbox-field input {
  order: 1;
  width: 18px;
  height: 18px;
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 125, 117, 0.12);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Checklist tabs ─────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 30px;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.tab:hover { background: var(--line); color: var(--ink); }

.tab.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

/* ── Checklist rows ─────────────────────────────────────────────────────────── */
.check-list {
  display: grid;
  gap: 8px;
}

.check-row {
  box-shadow: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px minmax(140px, auto) 80px;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  transition: border-color 120ms;
}

.check-row:hover { border-color: var(--teal); }

.check-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-top: 5px;
  background: #bdc9c4;
  flex: 0 0 auto;
}

.status-dot.done {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.status-dot.warning {
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.status-dot.blocked {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.check-title strong {
  display: block;
  overflow-wrap: anywhere;
}

.check-title span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.priority {
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--muted);
}

.priority.critical {
  color: var(--red);
}

.priority.important {
  color: var(--amber);
}

.priority.nice-to-have {
  color: var(--indigo);
}

.audit-card,
.brief-card {
  box-shadow: none;
  padding: 14px;
}

.insight-row {
  box-shadow: none;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 12px;
  align-items: center;
}

.insight-row strong,
.insight-row span,
.insight-row small {
  display: block;
}

.insight-row strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.insight-row span,
.insight-row small {
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.textarea-tall {
  min-height: 160px;
}

.audit-list,
.brief-list {
  display: grid;
  gap: 8px;
}

.audit-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.audit-item:first-child {
  border-top: 0;
}

.audit-item strong {
  overflow-wrap: anywhere;
}

.audit-status {
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.audit-status.pass {
  color: var(--green);
}

.audit-status.warn {
  color: var(--amber);
}

.audit-status.fail {
  color: var(--red);
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 620px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.empty {
  color: var(--muted);
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.citation-row {
  box-shadow: none;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) 120px;
  gap: 10px;
}

.schedule-row,
.notification-row {
  box-shadow: none;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
  align-items: center;
}

.schedule-row span,
.notification-row span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.notification-row.unread {
  border-color: rgba(182, 107, 18, 0.42);
  background: #fffaf0;
}

.module-card a {
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration: none;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  background: #edf2ef;
  border-radius: 6px;
  padding: 2px 6px;
}

@media (max-width: 1400px) {
  .grid.metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-board,
  .asset-grid,
  .feature-grid,
  .area-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .grid.three,
  .reference-grid,
  .module-grid,
  .project-grid,
  .project-home-grid,
  .route-grid,
  .service-grid,
  .project-workspace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .project-context {
    order: 3;
    width: 100%;
    min-width: 100%;
  }

  .topbar-actions a[href="/api/export"] {
    display: none;
  }

  .check-row {
    grid-template-columns: minmax(0, 1fr) 130px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    padding: 16px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-section {
    grid-column: 1 / -1;
    margin-top: 12px;
  }

  .sidebar-note {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-context,
  .client-hero {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .grid.metrics,
  .grid.two,
  .grid.three,
  .reference-grid,
  .task-board,
    .asset-grid,
    .feature-grid,
    .module-grid,
    .project-grid,
    .project-home-grid,
    .route-grid,
    .service-grid,
    .area-grid,
    .project-workspace,
    .form-grid {
    grid-template-columns: 1fr;
  }

  .project-directory {
    position: static;
  }

  .check-row,
  .insight-row,
  .schedule-row,
  .notification-row,
  .search-result,
  .citation-row {
    grid-template-columns: 1fr;
  }

  .project-strip {
    align-items: stretch;
    flex-direction: column;
  }

  button,
  a.button {
    width: 100%;
  }

  .icon-button {
    width: 40px;
  }
}

/* Auto-check badges */
.auto-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #7c6ef7;
  background: rgba(124,110,247,.1);
  border: 1px solid rgba(124,110,247,.25);
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 4px;
}

.auto-detail {
  display: block;
  font-size: 11px;
  color: var(--text-muted, #6c746f);
  margin-top: 2px;
  font-style: italic;
}

.check-row-auto {
  border-left: 2px solid rgba(124,110,247,.4);
}

/* ── Claude Prompts Library ─────────────────────────────────────────────────── */
.claude-setup-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.82rem;
}

.claude-setup-item code {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  background: rgba(0,0,0,.07);
  padding: 1px 5px;
  border-radius: 4px;
}

.claude-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.claude-shortcut-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.claude-shortcut-card h3 {
  font-size: 0.9rem;
  margin: 0;
}

.claude-shortcut-card p {
  font-size: 0.83rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.shortcut-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shortcut-command {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--teal);
  background: rgba(23,122,113,.08);
  padding: 2px 8px;
  border-radius: 5px;
}

.shortcut-cadence {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}

.shortcut-setup {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 4px 8px;
  background: var(--surface-2);
  border-radius: 5px;
}

.shortcut-prompt-details summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--teal);
  font-weight: 600;
  margin-top: 4px;
  list-style: none;
}

.shortcut-prompt-details summary::-webkit-details-marker { display: none; }

.shortcut-prompt {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  margin: 8px 0 6px;
  overflow-x: auto;
}

.shortcut-copy {
  font-size: 0.78rem;
  min-height: 28px;
  padding: 0 10px;
}
