/* ─────────────────────────────────────────────────────────────────────────────
   DEMO BRAND LAYER — served IN PLACE of the company brand layer, only on the
   demo (src/http/demoBrand.ts swaps the <link>). The console's layout is
   unchanged; the identity is Interactive Machines (interactivemachines.ai):
   warm paper, graphite ink, olive accent, serif wordmark.

   Palette (from the site, 2026-11-11):
     paper #f4f2ec · paper-dark #eae7de · ink #292d28 · muted #60665a
     line #cfcec3 · olive #5c6a4d · dark #202822
   ──────────────────────────────────────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=Manrope:wght@400;500;600;700&display=swap");

/* ── tokens: dark theme ──────────────────────────────────────────────────────── */
:root {
  --primary:           #a9b897;
  --primary-container: #5c6a4d;
  --primary-end:       #798869;   /* dark end of the primary button gradient: on-primary reads 4.5:1+ (MECH-441) */
  --primary-fixed:     #c9d3bb;
  --on-primary:        #141a15;
  --success:           #8fb07a;
  --warning:           #d6b26a;
  --idle:              #9aa392;
  --accent:            var(--primary);
}

/* ── tokens: light theme (the default look) ─────────────────────────────────── */
:root[data-theme="light"] {
  --primary:           #5c6a4d;
  --primary-container: #4b583e;
  --primary-fixed:     #a9b897;
  --on-primary:        #ffffff;
  --success:           #49703e;
  --warning:           #a7741f;
  --warning-text:      #875e19;   /* gold as text or icon: 4.5:1+ (MECH-434) */
  --danger:            #b2412f;
  --idle:              #62695a;
  --accent:            var(--primary);

  --surface-lowest:    #f4f2ec;
  --surface:           #fbfaf6;
  --surface-low:       #f0eee7;
  --surface-container: #fbfaf6;
  --surface-high:      #eae7de;
  --surface-variant:   #e3e0d5;
  --on-surface:        #292d28;
  --on-surface-variant:#60665a;
  --outline:           #65685d;   /* label grey: 4.5:1+ (MECH-434) */
  --outline-variant:   #cfcec3;

  --glass-border:      rgba(41, 45, 40, 0.09);
  --glass-border-hi:   rgba(41, 45, 40, 0.16);
  --hairline:          rgba(41, 45, 40, 0.11);
  --hairline-soft:     rgba(41, 45, 40, 0.06);
  --fill-1:            rgba(41, 45, 40, 0.04);
  --fill-2:            rgba(41, 45, 40, 0.08);
  --nav-bg:            rgba(251, 250, 246, 0.78);
  --sidebar-bg:        rgba(244, 242, 236, 0.72);
  --grid-line:         rgba(41, 45, 40, 0.045);
}

body { font-family: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif; }
::selection { background: #d8decc; color: #222a22; }

/* ── brand tile: the line-drawn mark on paper (dashboard + login) ─────────── */
.logo, .login-brand .logo {
  background: #f4f2ec;
  box-shadow: none;
  border: 1px solid #cfcec3;
}
.logo img, .login-brand .logo img {
  width: 36px; height: 36px; object-fit: contain; display: block;
}

/* ── wordmark: the site's stacked caps, period in olive ─────────────────────── */
.brand h1, .login-brand h1 {
  color: #292d28;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: 1.15;
}
.brand-period { color: #5c6a4d; }
.sidebar .brand p, .login-brand p {
  color: var(--on-surface-variant);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: var(--fs-md);
  letter-spacing: .2px;
}
:root:not([data-theme="light"]) .logo,
:root:not([data-theme="light"]) .login-brand .logo { background: #eeeede; border-color: #3a4036; }
:root:not([data-theme="light"]) .brand h1,
:root:not([data-theme="light"]) .login-brand h1 { color: #eeeede; }
:root:not([data-theme="light"]) .brand-period { color: #a9b897; }

/* ── headings borrow the site's editorial serif ─────────────────────────────── */
.login-card h2, .view-title, .page-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; letter-spacing: .2px; }

.brand-tagline { color: var(--primary); font-weight: 600; }

/* ── Company section (demo only, js/views/demo-company.js) ───────────────────── */
.co-wrap { display: flex; flex-direction: column; gap: 18px; }
.co-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 22px 26px; flex-wrap: wrap; }
.co-hero h2 { font-family: "Cormorant Garamond", serif; font-size: 30px; font-weight: 600; margin: 4px 0 2px; }
.co-hero p { margin: 0; max-width: 620px; }
.co-hero-stats { display: flex; gap: 22px; }
.co-hero-stats div { display: flex; flex-direction: column; align-items: center; }
.co-hero-stats b { font-size: 26px; font-family: "Cormorant Garamond", serif; }
.co-hero-stats span { font-size: var(--fs-sm); color: var(--outline); text-transform: uppercase; letter-spacing: .08em; }

.co-av { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; flex: none; width: 34px; height: 34px; }
.co-av .material-symbols-outlined { font-size: var(--fs-xl); }
.co-av--person { background: var(--surface-high); color: var(--on-surface); width: 34px; height: 34px; }
.co-av--model { background: var(--primary); color: var(--on-primary); width: 42px; height: 42px; }
.co-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; flex: none; }

.co-chat { display: grid; grid-template-columns: 210px 1fr; min-height: 560px; padding: 0; overflow: hidden; }
.co-rail { border-right: 1px solid var(--outline-variant); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-low); }
.co-chan { text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 8px; color: var(--on-surface-variant); cursor: pointer; font: inherit; }
.co-chan:hover { background: var(--surface-high); }
.co-chan.on { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.co-rail-agent { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: var(--fs-base); background: none; border: 0; border-radius: 8px; color: var(--on-surface); cursor: pointer; font-family: inherit; text-align: left; width: 100%; }
.co-rail-agent:hover { background: var(--surface-high); }
.co-rail-agent.on { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.co-rail-agent.on .co-dot { background: var(--on-primary); }
.co-rail-agent .co-av { width: 22px; height: 22px; }
.co-rail-agent .co-av .material-symbols-outlined { font-size: var(--fs-md); }
.co-rail-name { flex: 1; }
.co-main { display: flex; flex-direction: column; min-width: 0; }
.co-chan-head { display: flex; gap: 12px; align-items: baseline; padding: 14px 20px; border-bottom: 1px solid var(--outline-variant); flex-wrap: wrap; }
.co-msgs { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 520px; }
.co-msg { display: flex; gap: 12px; align-items: flex-start; }
.co-msg-body { min-width: 0; }
.co-msg-head { display: flex; gap: 8px; align-items: baseline; font-size: var(--fs-base); flex-wrap: wrap; }
.co-role { font-size: var(--fs-xs); padding: 1px 7px; border-radius: 10px; background: var(--surface-high); color: var(--on-surface-variant); }
.co-msg-text { margin-top: 2px; line-height: 1.5; overflow-wrap: anywhere; }
.co-mention { color: var(--primary); font-weight: 600; }
.co-empty { padding: 20px 0; }
.co-typing { display: flex; align-items: center; gap: 8px; color: var(--outline); font-size: var(--fs-md); }
.co-typing .co-av { width: 24px; height: 24px; }
.co-typing .co-av .material-symbols-outlined { font-size: var(--fs-base); }
.co-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--outline); animation: co-blink 1.2s infinite; }
.co-typing i:nth-of-type(2) { animation-delay: .2s; }
.co-typing i:nth-of-type(3) { animation-delay: .4s; }
@keyframes co-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .co-typing i { animation: none; } }
.co-compose { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--outline-variant); }
.co-compose .input { flex: 1; min-width: 0; }

.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.co-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.co-card p { margin: 0; line-height: 1.5; }
.co-card-head { display: flex; gap: 12px; align-items: center; }
.co-card-head > div { flex: 1; min-width: 0; }
.co-card-head h3 { margin: 0; font-size: var(--fs-xl); }
.co-card-head .co-av { width: 42px; height: 42px; }
.co-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--success); }
.co-does { margin: 0; padding-left: 18px; color: var(--on-surface-variant); font-size: var(--fs-base); }
.co-card-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--outline-variant); font-size: var(--fs-md); }
.co-who { display: inline-flex; align-items: center; gap: 6px; }
.co-who .co-av { width: 22px; height: 22px; }
.co-who .co-av .material-symbols-outlined { font-size: var(--fs-md); }

.co-steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0 4px; }
.co-step { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface-low); border: 1px solid var(--outline-variant); }
.co-step div { display: flex; flex-direction: column; }
.co-step span { font-size: var(--fs-md); color: var(--on-surface-variant); }
.co-step .co-av { width: 30px; height: 30px; }
.co-step--person { border-style: dashed; border-color: var(--primary); }
.co-arrow { color: var(--outline); }

/* direct chats and agent pages */
.co-name { color: inherit; font-weight: 700; text-decoration: none; }
.co-name:hover { color: var(--primary); text-decoration: underline; }
.co-dm-head { align-items: center; }
.co-dm-who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.co-dm-head .btn .material-symbols-outlined, .co-card-actions .material-symbols-outlined, .co-agent-hero .btn .material-symbols-outlined { font-size: var(--fs-lg); margin-right: 4px; vertical-align: -3px; }
.co-asks { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 20px 0; }
.co-ask { border: 1px solid var(--outline-variant); background: var(--surface-low); color: var(--on-surface-variant); border-radius: 16px; padding: 5px 12px; font: inherit; font-size: var(--fs-md); cursor: pointer; }
.co-ask:hover { border-color: var(--primary); color: var(--primary); }
.co-card-actions { display: flex; gap: 8px; justify-content: flex-end; }
.co-grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.co-card h3 { margin: 0; font-size: var(--fs-xl); }
.co-agent-id { display: flex; gap: 16px; align-items: center; flex: 1; min-width: 260px; }
.co-agent-id .co-av { width: 64px; height: 64px; }
.co-agent-id .co-av .material-symbols-outlined { font-size: 30px; }
.co-agent-id .label-caps a { color: inherit; }
.co-perm { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.co-perm li { display: flex; gap: 8px; align-items: center; font-size: var(--fs-base); }
.co-perm .material-symbols-outlined { font-size: var(--fs-xl); }
.co-perm--ok .material-symbols-outlined { color: var(--success); }
.co-perm--ask .material-symbols-outlined { color: var(--warning-text); }
.co-recent { display: flex; flex-direction: column; }
.co-recent-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--outline-variant); font-size: var(--fs-base); line-height: 1.45; }
.co-recent-row:last-child { border-bottom: 0; }

@media (max-width: 760px) {
  .co-chat { grid-template-columns: 1fr; }
  .co-rail { border-right: 0; border-bottom: 1px solid var(--outline-variant); flex-direction: row; flex-wrap: wrap; }
  .co-rail .label-caps { display: none; }
  .co-rail-agent { width: auto; }
}

/* The demo's product names are longer than the real ones ("Parametric Catastrophe Insurance"): let a sub link
   wrap onto a second line instead of being cut off in the left nav. */
#tabnav .tab-sub { white-space: normal; line-height: 1.3; }
