/* Mucurabwenge interface. Tokens match tailwind.config.js. */
:root {
  --muc-terracotta: #B0613E;
  --muc-terracotta-deep: #8C4A32;
  --muc-cream: #FBF7F2;
  --muc-charcoal: #24211F;
  --muc-sand: #EAD9CB;
  --ink: var(--muc-charcoal);
  --muted: #5c564f;
  --primary: var(--muc-terracotta-deep);
  --primary-dark: #6e3a26;
  --cream: var(--muc-cream);
  --line: #e4d8cc;
  --surface: #fff;
  --sidebar: #f6efe8;
  --radius: 14px;
  --shadow: 0 10px 28px rgba(36, 33, 31, .06);
  --focus: 2px solid var(--muc-terracotta-deep);
}
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
:focus-visible { outline: var(--focus); outline-offset: 2px; }
.skip-link { position: absolute; left: 12px; top: -40px; background: var(--ink); color: white; padding: 8px 12px; z-index: 20; }
.skip-link:focus { top: 12px; }
.site-header { height: auto; min-height: 64px; position: sticky; top: 0; background: color-mix(in srgb, var(--cream) 92%, white); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); z-index: 30; }
.site-nav { min-height: 64px; gap: 16px; min-width: 0; }
.site-nav .brand { min-width: 0; }
.desktop-nav { gap: 18px; }
.desktop-nav a[aria-current="page"] { color: var(--primary); }
.nav-actions { gap: 10px; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lang-switch button { border: 0; background: transparent; min-width: 40px; min-height: 36px; padding: 0 8px; color: var(--muted); font-weight: 700; }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: white; }
.mobile-nav { border-top: 1px solid var(--line); background: var(--cream); }
.mobile-nav nav { display: grid; padding: 8px 18px 16px; }
.mobile-nav a { padding: 12px 4px; font-weight: 700; border-bottom: 1px solid var(--line); }
.btn { border-radius: 10px; min-height: 44px; transform: none; }
.btn:hover { transform: none; }
.btn-primary { background: var(--primary); box-shadow: none; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: var(--surface); }
.btn-secondary { background: transparent; border-color: var(--line); color: var(--ink); }
.home-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 28px; align-items: end; padding: 28px 0 8px; }
.home-copy h1 { font-size: clamp(34px, 4vw, 52px); letter-spacing: -.04em; max-width: 16ch; }
.lede { margin-top: 12px; color: var(--muted); max-width: 46ch; }
.lede-quiet { margin-top: 6px; }
.ask-card, .prose-card, .action-card, .dash-card, .person-card, .service-card, .book-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ask-card { padding: 16px; }
.ask-card h2 { font-size: 20px; }
.ask-card textarea, .form-fields input, .form-fields select, .form-fields textarea, .history-search, #historySearch, .searchbar input, .searchbar select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; min-height: 44px; padding: 10px 12px; background: var(--surface); color: var(--ink);
}
.ask-card textarea { margin-top: 8px; resize: vertical; background: #f7f1eb; }
.ask-card textarea:disabled { opacity: 1; color: var(--muted); }
.ask-note, .callout { margin: 10px 0; padding: 10px 12px; background: #f6ebe4; border-radius: 10px; color: var(--ink); font-size: 14px; }
.task-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding-bottom: 18px; }
.task-chip, .task-pills a { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-height: 44px; }
.task-chip small, .meta-line, .quiet-count { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.task-chip strong { display: block; }
.task-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.task-pills a { align-items: center; font-weight: 700; font-size: 14px; }
.task-pills a[aria-current="true"] { background: var(--ink); color: white; border-color: var(--ink); }
.band, .split { padding: 28px 0; }
.section-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 16px; }
.section-head h2, .split h2, .page-hero h1, .detail-hero h1 { font-size: clamp(28px, 3vw, 40px); }
.section-head p, .page-hero p, .split p { color: var(--muted); max-width: 62ch; }
.tabs { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.tablist { display: grid; align-content: start; gap: 6px; }
.tablist button { text-align: left; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 10px 12px; min-height: 44px; font-weight: 700; }
.tablist button[aria-selected="true"] { background: var(--surface); border-color: var(--line); }
.tabpanel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.tabpanel p { margin-bottom: 14px; }
.service-grid, .book-grid, .people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.service-card, .book-card, .person-card { padding: 16px; min-height: 180px; }
.service-card h2, .book-card h2, .person-card h2 { font-size: 20px; margin: 8px 0; }
.service-card p, .book-body p { color: var(--muted); font-size: 14px; }
.service-icon, .avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: #f3e4da; color: var(--primary); }
.service-kicker, .eyebrow { color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; padding: 0; list-style: none; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 700; background: var(--sand); color: var(--ink); }
.badge-ok { background: #e5f0e6; color: #1f5134; }
.badge-warn { background: #f8e7c8; color: #6a4b12; }
.badge-muted { background: #f1ece7; color: #5c564f; }
.pattern-panel { min-height: 180px; border-radius: var(--radius); background: var(--muc-sand) url("../Mucurabwenge_Brand_Kit/patterns/weave-light.0bda9dfaad94.svg") center/180px repeat; }
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: center; }
.philosophy { grid-template-columns: 1fr 1fr; align-items: start; }
.page-hero { margin-bottom: 18px; }
.page-hero.compact h1, .detail-hero h1 { font-size: clamp(32px, 4vw, 48px); }
.searchbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.searchbar input { flex: 1 1 220px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .7fr); gap: 16px; margin: 16px 0 28px; }
.prose-card, .action-card { padding: 18px; }
.prose-card h2, .action-card h2 { font-size: 20px; margin: 16px 0 8px; }
.prose-card ol, .chapter-list { margin: 0; padding-left: 18px; }
.chapter-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.meta-grid, .meta-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.meta-list { grid-template-columns: 1fr; }
.meta-grid div, .meta-list div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.meta-grid dt, .meta-list dt { color: var(--muted); font-size: 12px; }
.book-card { display: grid; grid-template-columns: 74px 1fr; overflow: hidden; padding: 0; }
.book-spine { display: flex; align-items: flex-end; padding: 12px; color: white; background: var(--primary) url("../Mucurabwenge_Brand_Kit/patterns/weave-dark.7c90db671dbb.svg") center/80px repeat; }
.book-body { padding: 14px; display: grid; align-content: start; gap: 4px; }
.empty-state { grid-column: 1 / -1; padding: 28px 18px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface) url("../Mucurabwenge_Brand_Kit/patterns/diamond-grid.347ed06b97df.svg") right top/160px no-repeat; }
.empty-state h2, .empty-state h3 { font-size: 24px; }
.person-card .role-line { color: var(--primary); font-weight: 700; }
.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 80; display: grid; gap: 8px; width: min(360px, calc(100% - 24px)); }
.toast { position: relative; padding: 12px 36px 12px 12px; border-radius: 10px; background: #e7f3e8; color: #1d4d32; border: 1px solid #b7d8bc; }
.toast.error { background: #fdecea; color: #7a2e24; border-color: #f0c2bc; }
.toast button { position: absolute; right: 6px; top: 4px; border: 0; background: transparent; font-size: 20px; color: inherit; }
.auth-content { min-height: 100vh; }
.choice-set { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; margin: 0; }
.choice-set legend { font-weight: 700; font-size: 14px; padding: 0 4px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 8px; }
.choice span { min-width: 0; }
.choice strong, .choice small { display: block; }
.choice small { color: var(--muted); font-weight: 500; }
.form-fields .choice input[type="radio"],
.form-fields input[type="radio"],
.form-fields input[type="checkbox"] {
  width: 1.125rem; height: 1.125rem; min-height: 1.125rem; max-width: 1.125rem;
  padding: 0; margin: 0.2rem 0 0; flex: 0 0 auto; accent-color: var(--muc-terracotta-deep);
  box-shadow: none; border-radius: 50%;
}
.field-error, .form-alert { color: #7a2e24; font-weight: 650; }
.form-alert { background: #fdecea; border: 1px solid #f0c2bc; border-radius: 10px; padding: 10px 12px; }
.progress { margin-top: 8px; border-radius: 10px; background: var(--sand); color: var(--ink); padding: 10px 12px; font-size: 14px; font-weight: 650; }
.table-overflow { overflow-x: auto; }
.org-shell, .dashboard-shell { background: #f7f4f0; }
.org-shell { display: flex; min-height: 100vh; }
.org-sidebar .brand-lockup-light, .dashboard-page .dashboard-sidebar .brand-lockup-light { display: none; }
.org-sidebar .brand-lockup-dark, .dashboard-page .dashboard-sidebar .brand-lockup-dark { display: block; }
.org-sidebar { width: 230px; flex: none; background: var(--ink); color: #f6efe8; padding: 18px 12px; }
.org-sidebar a { color: #f6efe8; }
.org-sidebar .admin-links { display: grid; gap: 2px; }
.org-sidebar .admin-links a { padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 650; }
.org-sidebar .admin-links a:hover, .dashboard-sidebar .admin-links a.current { background: rgba(255,255,255,.08); }
.org-main { flex: 1; min-width: 0; }
.dashboard-page .dashboard-sidebar { background: var(--ink); color: #f6efe8; }
.dashboard-page .dashboard-sidebar a, .dashboard-page .admin-label, .dashboard-page .dashboard-side-footer, .dashboard-page .dashboard-side-footer small { color: #f3e7df; }
.dashboard-page .dashboard-content { padding: 20px; }
.dashboard-page .dash-welcome h1, .dashboard-page .page-top-row h1 { font-size: 28px; }
.dashboard-page .stat-card { min-height: 0; padding: 14px; }
.dashboard-page .stats-grid { margin: 12px 0; }
.plain-list { padding-left: 18px; }
.citation-panel { position: fixed; inset: 0; background: rgba(36, 33, 31, .35); display: grid; justify-content: end; z-index: 40; }
.citation-panel[hidden] { display: none; }
.citation-card { width: min(380px, 100%); background: var(--surface); padding: 18px; overflow: auto; }
dialog { border: 0; border-radius: 14px; padding: 18px; width: min(420px, calc(100% - 24px)); }
dialog::backdrop { background: rgba(36, 33, 31, .35); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.workspace-shell { background: var(--cream); }
.workspace-sidebar { background: #f3ebe3; }
.history-search, #historySearch { margin: 0 8px 10px; width: calc(100% - 16px); }
label.history-search { width: auto; min-height: 0; margin: 4px 12px 6px; padding: 0; border: 0; background: transparent; border-radius: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.chat-header { background: var(--cream); }
.chat-title { font-size: 16px; }
.welcome-screen { text-align: left; margin: 24px auto; }
.welcome-mark { width: 48px; height: 48px; }
.welcome-screen h2 { font-size: clamp(28px, 4vw, 40px); }
.suggestions { grid-template-columns: 1fr 1fr; }
.suggestions button { min-height: 72px; flex-direction: row; align-items: center; gap: 10px; text-align: left; }
.message-block { max-width: 760px; }
.learning-note { margin: 0 0 8px; padding: 8px 10px; background: #f6ebe4; border-radius: 10px; font-size: 13px; }
.gov-card, .referral-card { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fffdfb; }
.gov-card h3, .referral-card h2 { font-size: 16px; margin: 4px 0; }
.followups { width: min(760px, 100%); margin: 0 auto 12px; }
.followups p span, .composer-disclaimer { color: var(--muted); }
#followupList { display: flex; flex-wrap: wrap; gap: 8px; }
#followupList button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 12px; text-align: left; }
.composer-toolbar { gap: 8px; }
.composer-actions { display: flex; gap: 8px; align-items: center; }
.feedback-row { display: flex; gap: 4px; margin-top: 8px; }
.icon-button[aria-pressed="true"] { color: var(--primary); }
[data-theme="dark"] {
  --ink: #f6efe8; --muted: #d9cdc3; --cream: #241f1c; --surface: #312b27; --line: #4d4038; --sidebar: #2a2421;
}
[data-theme="dark"] .ask-card textarea, [data-theme="dark"] .service-card, [data-theme="dark"] .book-card, [data-theme="dark"] .tabpanel { background: var(--surface); color: var(--ink); }
@media (max-width: 1030px) {
  .home-hero, .tabs, .split, .philosophy, .detail-layout, .service-grid, .book-grid { grid-template-columns: 1fr 1fr; }
  .tabs { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
  .home-hero, .service-grid, .book-grid, .people-grid, .split, .philosophy, .detail-layout, .meta-grid, .task-row { grid-template-columns: 1fr; }
  .section-head { display: block; }
  .home-hero { padding-top: 12px; }
  .home-copy h1 { font-size: clamp(30px, 8vw, 42px); }
  .ask-card textarea { min-height: 72px; }
  .suggestions { grid-template-columns: 1fr; }
  .org-sidebar, .dashboard-sidebar { position: fixed; z-index: 60; }
  .chat-header { height: auto; min-height: 64px; flex-wrap: wrap; padding: 8px 12px; }
  .composer-container { width: calc(100% - 16px); }
  .public-page .nav-actions .btn-sm,
  .public-page .nav-actions .nav-text { display: none; }
  .public-page .brand-lockup { width: 128px; max-height: 34px; }
  .public-page .nav-actions { gap: 6px; }
  .public-page .lang-switch button { min-width: 36px; padding: 0 6px; }
  .public-page .site-header { height: auto; }
  .public-page .theme-toggle, .public-page .nav-toggle { width: 44px; height: 44px; }
  .auth-illustration { display: flex; min-height: 0; flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 16px; }
  .auth-quote { display: none; }
  .auth-content { min-height: 0; padding: 28px 18px 40px; }
  .auth-card h1 { font-size: 34px; }
}
@media (max-width: 420px) {
  .container-xl { width: calc(100% - 24px); }
  .nav-actions .btn-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
