/* ============================================================
   Mesterséges Intelligencia Központ — Warm Studio v5
   Direction: warm cream paper, soft cards, ChatGPT-style input pill,
   each agent has one calm hue. Mono used sparingly (only for code/files).
   Light is canonical; dark is preserved and re-toned warm.
   ============================================================ */

:root {
  /* Surface — warm light by default */
  --bg:        oklch(0.975 0.008 80);            /* cream paper */
  --bg-deep:   oklch(0.955 0.009 78);
  --paper:     oklch(1 0 0);                     /* pure card white */
  --paper-2:   oklch(0.985 0.006 80);
  --paper-3:   oklch(0.965 0.008 78);
  --ink:       oklch(0.205 0.015 60);            /* warm near-black */
  --ink-soft:  oklch(0.355 0.013 60);
  --mute:      oklch(0.55 0.012 60);
  --mute-2:    oklch(0.68 0.011 60);
  --line:      oklch(0.88 0.008 75);
  --line-soft: oklch(0.93 0.006 75);

  /* Single brand accent — calm sage, mature & friendly */
  --moss:       oklch(0.52 0.085 145);
  --moss-soft:  oklch(0.93 0.04 140);
  --moss-deep:  oklch(0.42 0.09 145);
  --moss-ink:   oklch(0.32 0.085 145);

  /* Per-agent identity colors — each a single calm hue, similar chroma */
  --ag-echo:    oklch(0.68 0.13 30);             /* warm coral, 01 marketing */
  --ag-iris:    oklch(0.7  0.11 60);             /* peach, 02 designer */
  --ag-atlas:   oklch(0.6  0.11 230);            /* sky-blue, 03 architect */
  --ag-forge:   oklch(0.55 0.11 320);            /* plum, 04 coder */
  --ag-codex:   oklch(0.7  0.11 85);             /* amber, 05 docs */
  --ag-ori:     oklch(0.6  0.085 180);           /* teal, 06 contact */

  --signal-live:  oklch(0.6  0.13 145);
  --signal-warn:  oklch(0.7  0.14 75);
  --signal-alert: oklch(0.62 0.18 25);

  /* KALÁCS mockup-app palette (DesignerCanvas) — var-driven so ECHO's
     restyle can retheme the in-progress app too */
  --mock-screen: #f5ecd9;   /* app screen background */
  --mock-frame:  #1a0f08;   /* device frame / notch */
  --mock-ink:    #2e1808;   /* app primary text */
  --mock-soft:   #6a3c18;   /* app secondary text */
  --mock-warm:   #b8753a;   /* hero gradient mid-tone */
  --mock-glow:   #e2b272;   /* highlight / active */
  --mock-font:   "Fraunces", "DM Serif Display", serif;

  /* Type — body sans dominant, serif italic for accents, mono only for code */
  --body-font:    "Geist", "Inter Tight", "Inter", -apple-system, system-ui, sans-serif;
  --display-font: "Instrument Serif", "Fraunces", Georgia, serif;
  --mono-font:    "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Geometry — soft, friendly radii */
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  20px;
  --radius-pill:9999px;
  --max-w:      1240px;
  --pad-x:      clamp(20px, 4vw, 56px);

  /* Shadows — warm, soft, layered (no harsh blacks) */
  --shadow-1: 0 1px 2px rgba(60, 40, 20, 0.05), 0 1px 1px rgba(60, 40, 20, 0.03);
  --shadow-2: 0 4px 14px -6px rgba(60, 40, 20, 0.10), 0 2px 4px rgba(60, 40, 20, 0.04);
  --shadow-3: 0 20px 40px -24px rgba(60, 40, 20, 0.18), 0 6px 16px -8px rgba(60, 40, 20, 0.08);
}

/* Dark theme — warm-toned, no phosphor */
:root[data-theme="dark"] {
  --bg:        oklch(0.18 0.013 70);
  --bg-deep:   oklch(0.135 0.013 70);
  --paper:     oklch(0.235 0.014 70);
  --paper-2:   oklch(0.215 0.013 70);
  --paper-3:   oklch(0.28 0.013 70);
  --ink:       oklch(0.97 0.008 80);
  --ink-soft:  oklch(0.82 0.012 80);
  --mute:      oklch(0.62 0.013 70);
  --mute-2:    oklch(0.48 0.013 70);
  --line:      oklch(0.32 0.013 70);
  --line-soft: oklch(0.26 0.013 70);

  --moss:       oklch(0.74 0.1 145);
  --moss-soft:  oklch(0.32 0.07 145);
  --moss-deep:  oklch(0.6 0.11 145);
  --moss-ink:   oklch(0.88 0.1 145);

  --ag-echo:   oklch(0.78 0.13 30);
  --ag-iris:   oklch(0.8  0.11 60);
  --ag-atlas:  oklch(0.74 0.11 230);
  --ag-forge:  oklch(0.7  0.12 320);
  --ag-codex:  oklch(0.82 0.12 85);
  --ag-ori:    oklch(0.74 0.085 180);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 4px 14px -6px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.15);
  --shadow-3: 0 20px 40px -24px rgba(0, 0, 0, 0.6), 0 6px 16px -8px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ── Custom scrollbars (whole site) ───────────────────────────────────
   Chromium/Safari: the styled ::-webkit pill below — thin, rounded, floating
   in a transparent track, darkening on hover. Firefox (no ::-webkit support):
   the standard thin/coloured bar in the @supports block. Deliberately NO
   scrollbar-color on `html` itself: it INHERITS and would disable ::-webkit on
   every nested panel, leaving them the chunky default bar. */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 10px;
  border: 3px solid transparent;        /* padding-box inset → a slim floating pill */
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--mute); }
::-webkit-scrollbar-corner { background: transparent; }

/* Agent chat panels — a slimmer pill for the smaller surface. */
.agent-log::-webkit-scrollbar,
.mik-bori-log::-webkit-scrollbar,
.mik-hero-chat::-webkit-scrollbar { width: 9px; }
.agent-log::-webkit-scrollbar-thumb,
.mik-bori-log::-webkit-scrollbar-thumb,
.mik-hero-chat::-webkit-scrollbar-thumb { border-width: 2.5px; }

@supports not selector(::-webkit-scrollbar) {
  html,
  .agent-log, .mik-bori-log, .mik-hero-chat {
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
  }
}
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--ink); }
/* App-shell: the document itself doesn't scroll — #mik-scroll does. This keeps
   the page scrollbar inside the content column, with the header + dock as
   full-width rails above/below it (no scrollbar beside the fixed chrome). */
body { overflow: hidden; }
#root { height: 100%; }
body {
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* A single, very subtle warm glow at the top — feels like morning light on paper */
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -10%,
      color-mix(in oklch, var(--ag-echo) 8%, transparent) 0%,
      transparent 65%);
  background-attachment: fixed;
}
:root[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -10%,
      color-mix(in oklch, var(--ag-echo) 14%, transparent) 0%,
      transparent 65%);
}

button { font: inherit; cursor: pointer; color: inherit; }
a { color: inherit; }
img, svg { max-width: 100%; }
::selection { background: color-mix(in oklch, var(--moss) 28%, transparent); }

/* ============================================================ */
/*  HEADER — soft sticky                                          */
/* ============================================================ */
.mik-header {
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;   /* app-shell rail — size to content, never shrink */
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 8px var(--pad-x);
  background: color-mix(in oklch, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
  min-height: 0;
}

.mik-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  padding: 0;
}
.mik-logo-words {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  white-space: nowrap;
  font-family: var(--body-font);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mik-logo-words span { display: block; }

/* Agent-ring mark — soft, calm, no neon glow */
.mik-mark { display: inline-block; position: relative; flex-shrink: 0; }
.mik-mark-orbit {
  position: absolute; inset: 0;
  border: 1.5px solid color-mix(in oklch, var(--moss) 75%, transparent);
  border-radius: 50%;
}
.mik-mark-center {
  position: absolute; left: 50%; top: 50%;
  width: 24%; height: 24%;
  transform: translate(-50%, -50%);
  background: var(--moss);
  border-radius: 50%;
}
.mik-mark-spin {
  position: absolute; inset: 0;
  animation: markSpin var(--spin, 8s) linear infinite;
}
.mik-mark-spin.a { --spin: 14s; }
.mik-mark-spin.b { --spin: 22s; animation-direction: reverse; }
.mik-mark-spin.c { --spin: 9s; }
.mik-mark-spin.paused { animation-play-state: paused; }
.mik-mark-node {
  position: absolute;
  width: 18%; height: 18%;
  border-radius: 50%;
  left: 50%; top: -6%;
  transform: translateX(-50%);
}
.mik-mark-spin.b .mik-mark-node { top: 50%; left: auto; right: -3%; transform: translateY(-50%); width: 14%; height: 14%; }
.mik-mark-spin.c .mik-mark-node { top: auto; bottom: -2%; left: 50%; transform: translateX(-50%); width: 12%; height: 12%; }
@keyframes markSpin { to { transform: rotate(360deg); } }

.mik-nav {
  display: flex;
  gap: 2px;
  justify-content: center;
}
.mik-nav a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--mute);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  transition: color 180ms, background 180ms;
}
.mik-nav a:hover {
  color: var(--ink);
  background: var(--paper-3);
}

.mik-header-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mik-lang {
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 2px;
}
.mik-lang-btn {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  color: var(--mute);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 160ms, background 160ms;
  letter-spacing: 0.04em;
}
.mik-lang-btn.on {
  background: var(--ink);
  color: var(--bg);
}
.mik-lang-btn:hover:not(.on) { color: var(--ink); }

.mik-theme-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 200ms, border-color 200ms;
  position: relative;
  overflow: hidden;
}
.mik-theme-btn:hover { background: var(--paper-3); }
.mik-theme-btn svg { width: 16px; height: 16px; display: block; }

.mik-theme-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
  transition: opacity 380ms cubic-bezier(0.2, 0.7, 0.2, 1), transform 380ms cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}
.mik-theme-icon.on {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.mik-theme-icon-sun { color: var(--signal-warn); }

/* Smooth page-wide theme transition */
html, body { transition: background-color 450ms ease, color 380ms ease; }
.mik-app, .agent-workspace, .mik-input-pill, .agent-msg-bubble,
.mik-marq-item, .mik-dock-inner, .mik-header, .mik-footer,
.dsg-card, .coder-canvas, .doc-pane, .agent-workspace-contact,
.aws-status, .mik-ops-tag, .mik-ops-project, .mik-ops-stat,
.mik-lang, .mik-theme-btn {
  transition:
    background-color 450ms ease,
    border-color 380ms ease,
    color 380ms ease,
    box-shadow 380ms ease;
}

/* ============================================================ */
/*  STUDIO STATUS STRIP — legacy hidden; replaced by bottom dock  */
/* ============================================================ */
.mik-ops-strip { display: none; }

/* ============================================================ */
/*  DECOR LAYER                                                   */
/* ============================================================ */
.mik-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.mik-decor-emoji .mik-emoji { position: absolute; display: inline-block; user-select: none; will-change: transform; }
.mik-emoji-float  { animation: mikFloat 10s ease-in-out infinite alternate; }
.mik-emoji-drift  { animation: mikDrift 14s ease-in-out infinite alternate; }
.mik-emoji-spin   { animation: mikSpin 8s linear infinite; }
.mik-emoji-jump   { animation: mikJump 1.6s cubic-bezier(.5,1.3,.4,1) infinite; }
@keyframes mikFloat { from { transform: translateY(0); } to { transform: translateY(-20px); } }
@keyframes mikDrift { 0% { transform: translate(0,0); } 50% { transform: translate(40px, -30px) rotate(20deg); } 100% { transform: translate(-30px, 20px) rotate(-15deg); } }
@keyframes mikSpin { to { transform: rotate(360deg); } }
@keyframes mikJump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-40px); } 60% { transform: translateY(-40px) scaleY(0.94) scaleX(1.08); } }

.mik-decor-blobs { opacity: 0; } /* default = no blobs; they only appear if user prompt triggers them */
.mik-decor-blobs .blob { position: absolute; width: 60vmin; height: 60vmin; filter: blur(60px); }
.mik-decor-blobs .blob-a { top: -10%; left: -10%; }
.mik-decor-blobs .blob-b { bottom: -20%; right: -10%; }
.mik-decor-blobs .blob-c { top: 40%; left: 60%; width: 40vmin; height: 40vmin; }
body[data-mode="default"] ~ * .mik-decor-blobs,
.mik-decor-blobs.show { opacity: 0.55; }

/* ============================================================ */
/*  APP / SECTIONS                                                */
/* ============================================================ */
.mik-app { position: relative; z-index: 1; height: 100%; }
.mik-main {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.mik-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;   /* no layout jump when a modal locks the scroll */
  scroll-behavior: smooth;
}
.agent-section {
  position: relative;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(56px, 6vw, 96px) var(--pad-x) clamp(36px, 5vw, 64px);
  box-sizing: border-box;
}
/* Every chat-frame child the section hosts must also fill its row, so the
   visual width never depends on how much text/canvas is inside it. */
.agent-section > .agent-workspace,
.agent-section > .agent-workspace-contact,
.agent-section > .mik-hero-prompt-stack,
.agent-section > .agent-workspace-head {
  width: 100%;
  box-sizing: border-box;
}

/* Section header — tag + description on one row */
.agent-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px 24px;
  margin: 0 0 28px;
}
.agent-section-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-transform: uppercase;
  margin: 0; /* tags render as <h2> for document structure — kill UA margins */
}
.agent-section-tag::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--agent-color, var(--moss));
}

/* Agent description sits on the same row as the section tag */
.mik-agent-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--mute);
  margin: 0;
  max-width: 64ch;
  font-weight: 400;
  letter-spacing: -0.005em;
  flex: 1 1 auto;
  min-width: 240px;
}
.mik-agent-desc strong { color: var(--ink); font-weight: 600; }

/* ============================================================ */
/*  HERO (Section 01 — ECHO, interactive)                         */
/* ============================================================ */
.mik-hero-section {
  padding-top: clamp(48px, 7vw, 96px);
  padding-bottom: clamp(40px, 5vw, 72px);
  max-width: var(--max-w);
  margin: 0 auto;
}
.mik-hero-headline {
  font-family: var(--display-font);
  font-weight: 400;
  font-size: clamp(44px, 6.5vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 22px;
  max-width: 20ch;
}
.mik-hero-headline-italic {
  font-style: italic;
  color: var(--ink);
}
.mik-hero-headline-accent {
  font-style: italic;
  color: var(--ag-echo);
}
/* Text-zones preview only: the intro motto rendered inline (the real splash is a
   fixed, animated overlay that the preview skips). */
.mik-tz-motto {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.05;
  text-align: center;
  max-width: 900px;
  margin: 28px auto 10px;
  padding: 0 20px;
}
.mik-hero-sub {
  font-family: var(--body-font);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 36px;
  letter-spacing: -0.005em;
}

/* Hero ChatGPT-style center stack — matches the agent-workspace width
   used by 02-05 (and by the contact panel) so the whole page reads as
   one column. */
.mik-hero-prompt-stack {
  width: 100%;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Small agent badge above the input (or below the headline) */
.mik-hero-agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  width: max-content;
  font-size: 12.5px;
  color: var(--ink-soft);
  box-shadow: var(--shadow-1);
}
.mik-hero-agent-badge-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ag-echo);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0;
}
.mik-hero-agent-badge strong { color: var(--ink); font-weight: 600; }
.mik-hero-agent-badge .dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--signal-live);
  margin-right: 4px;
  animation: dotPulse 1.6s ease-in-out infinite;
}

/* Hero chat — appears as soft messages */
.mik-hero-chat-wrap {
  display: flex;
  flex-direction: column;
  height: clamp(280px, 36vh, 380px);
  box-sizing: border-box;
}
.mik-hero-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 4px 16px;
  box-sizing: border-box;
}
.mik-hero-chat .agent-msg-bubble {
  font-size: 15.5px;
  line-height: 1.55;
  padding: 12px 16px;
  max-width: 60ch;
  animation: none !important;
  opacity: 1 !important;
  border-radius: var(--radius-lg);
  border-top-left-radius: 6px;
}
.mik-hero-chat .agent-msg { animation: none !important; opacity: 1 !important; }
.mik-hero-chat .agent-msg-you .agent-msg-bubble {
  border-radius: var(--radius-lg);
  border-top-right-radius: 6px;
}
.mik-hero-bubble-reply {
  background: color-mix(in oklch, var(--moss) 8%, var(--paper)) !important;
  border-color: color-mix(in oklch, var(--moss) 28%, var(--line)) !important;
  color: var(--ink) !important;
}

/* Markdown inside ECHO chat bubbles (streamed + final reply) */
/* Hard size ceiling: every child (headings, code) is sized in `em` relative to
   this, so one clamp bounds the whole subtree — a restyle can nudge the bubble
   font but can never blow the markdown up. Default (~15.5px) is unaffected. */
.mik-md { display: block; font-size: clamp(13px, 1em, 18px); }
.mik-md .md-p { margin: 0 0 0.55em; }
.mik-md .md-p:last-child { margin-bottom: 0; }
.mik-md .md-ul { margin: 0.3em 0 0.55em; padding-left: 1.25em; }
.mik-md .md-ul:last-child { margin-bottom: 0; }
.mik-md .md-ul li { margin: 0.15em 0; }
.mik-md .md-ul li::marker { color: var(--moss-deep); }
.mik-md .md-h { font-weight: 600; margin: 0.5em 0 0.3em; line-height: 1.3; }
.mik-md .md-h:first-child { margin-top: 0; }
.mik-md .md-h1 { font-size: 1.12em; }
.mik-md .md-h2 { font-size: 1.06em; }
.mik-md .md-h3 { font-size: 1em; color: var(--ink-soft); }
.mik-md strong { font-weight: 600; color: var(--ink); }
.mik-md em { font-style: italic; }
.mik-md .md-code {
  font-family: var(--mono-font);
  font-size: 0.86em;
  background: color-mix(in oklch, var(--moss) 14%, var(--paper));
  border: 1px solid color-mix(in oklch, var(--moss) 26%, var(--line));
  border-radius: 5px;
  padding: 0.5px 5px;
}
:root[data-theme="dark"] .mik-md .md-code { color: var(--moss-ink); }
.mik-hero-bubble-reply.is-refusal {
  background: color-mix(in oklch, var(--signal-alert) 8%, var(--paper)) !important;
  border-color: color-mix(in oklch, var(--signal-alert) 40%, var(--line)) !important;
}

/* ============================================================ */
/*  WORKSPACE HEADER STRIP — re-tuned for warm studio look       */
/* ============================================================ */
.agent-workspace-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  align-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  margin: 0 0 18px;
}
.aws-id-num {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--mute);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper-2);
}
.aws-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.aws-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 14px;
  color: white;
  letter-spacing: 0;
  position: relative;
  flex-shrink: 0;
}
.aws-meta { display: flex; flex-direction: column; gap: 2px; line-height: 1; min-width: 0; }
.aws-name {
  font-family: var(--body-font);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
}
.aws-role {
  font-family: var(--body-font);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--mute);
  letter-spacing: 0;
}
.aws-working {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--mute);
  margin-left: auto;
  min-width: 0;
}
.aws-working-k {
  color: var(--mute-2);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}
.aws-working-val {
  color: var(--ink);
  font-weight: 600;
  font-family: var(--mono-font);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.aws-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper-2);
}
.aws-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  animation: dotPulse 1.6s ease-in-out infinite;
}
.aws-status-text { color: var(--ink-soft); }
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.85); }
}
.aws-clock { display: none; }

@media (max-width: 720px) {
  .aws-working { margin-left: 0; flex-basis: 100%; }
  .aws-id-num { display: none; }
}

/* ============================================================ */
/*  CHATGPT-STYLE INPUT PILL                                      */
/* ============================================================ */
.mik-input-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 8px 8px 8px 8px;
  transition: border-color 220ms, box-shadow 220ms;
  position: relative;
  box-shadow: var(--shadow-2);
}
.mik-input-pill:focus-within {
  border-color: color-mix(in oklch, var(--ink) 60%, var(--line));
  box-shadow: var(--shadow-3);
}
.mik-input-pill input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--body-font);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
  padding: 13px 12px 13px 18px;
  letter-spacing: -0.005em;
}
.mik-input-pill input::placeholder { color: var(--mute); }
.mik-input-pill-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.mik-input-pill-send {
  background: var(--ink);
  color: var(--bg);
  border: 0;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
  transition: background 200ms, transform 160ms, opacity 200ms;
  flex-shrink: 0;
}
.mik-input-pill-send:hover:not(:disabled) {
  background: color-mix(in oklch, var(--ink) 80%, var(--moss));
  transform: scale(1.04);
}
.mik-input-pill-send:disabled {
  background: var(--paper-3);
  color: var(--mute-2);
  cursor: not-allowed;
}
.mik-input-pill-send-label {
  display: none;
}

.mik-btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mute);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 180ms, background 180ms;
}
.mik-btn-icon:hover {
  color: var(--ink);
  background: var(--paper-3);
}

.mik-mic-btn {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  outline: none;
  background: transparent !important;
  color: var(--mute) !important;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 200ms, color 200ms, box-shadow 200ms, transform 160ms;
  position: relative;
}
.mik-mic-btn:hover {
  background: var(--paper-3) !important;
  color: var(--ink) !important;
}
.mik-mic-btn:focus,
.mik-mic-btn:focus-visible,
.mik-mic-btn:active {
  outline: none !important;
  border: none !important;
}
.mik-mic-btn svg { display: block; width: 17px; height: 17px; }
.mik-mic-btn svg rect, .mik-mic-btn svg path, .mik-mic-btn svg line {
  stroke: currentColor;
  fill: none;
}

/* Recording state — red pulse + equalizer bars */
.mik-mic-recording {
  background: color-mix(in oklch, var(--signal-alert) 12%, var(--paper)) !important;
  color: var(--signal-alert) !important;
  box-shadow: 0 0 0 0 color-mix(in oklch, var(--signal-alert) 50%, transparent);
  animation: micPulse 1.2s ease-out infinite;
}
@keyframes micPulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklch, var(--signal-alert) 50%, transparent); }
  70%  { box-shadow: 0 0 0 10px color-mix(in oklch, var(--signal-alert) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--signal-alert) 0%, transparent); }
}
.mik-mic-bars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 18px;
}
.mik-mic-bar {
  display: inline-block;
  width: 2px;
  background: currentColor;
  border-radius: 1px;
  animation: micEq 0.9s ease-in-out infinite;
}
.mik-mic-bar:nth-child(1) { height: 6px;  animation-delay: 0ms;   }
.mik-mic-bar:nth-child(2) { height: 12px; animation-delay: 120ms; }
.mik-mic-bar:nth-child(3) { height: 16px; animation-delay: 240ms; }
.mik-mic-bar:nth-child(4) { height: 10px; animation-delay: 360ms; }
.mik-mic-bar:nth-child(5) { height: 6px;  animation-delay: 480ms; }
@keyframes micEq {
  0%, 100% { transform: scaleY(0.45); }
  50%      { transform: scaleY(1); }
}

/* Transcribing state — spinning loader, calm color */
.mik-mic-transcribing {
  background: color-mix(in oklch, var(--moss) 14%, var(--paper)) !important;
  color: var(--moss-deep) !important;
}
:root[data-theme="dark"] .mik-mic-transcribing { color: var(--moss-ink) !important; }
.mik-mic-spinner {
  animation: micSpin 900ms linear infinite;
}
@keyframes micSpin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .mik-input-pill { padding: 6px; }
  .mik-input-pill input { padding: 11px 8px 11px 14px; font-size: 15px; }
}

/* ============================================================ */
/*  EXAMPLES — suggestion chips (small, ChatGPT-like)             */
/* ============================================================ */
.mik-marq-wrap { padding: 22px 0 8px; background: transparent; }
.mik-marq-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 14px;
  flex-wrap: wrap;
}
.mik-marq-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--mute);
}
.mik-marq-counter {
  font-size: 12px;
  color: var(--mute);
  display: inline-flex; align-items: center; gap: 8px;
}
.mik-marq-counter::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--moss);
  animation: dotPulse 2s ease-in-out infinite;
}
.mik-counter-num { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.mik-marq {
  overflow: hidden;
  position: relative;
  cursor: grab;
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
          mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  user-select: none;
  touch-action: pan-y;
}
.mik-marq:active { cursor: grabbing; }
.mik-marq-track {
  display: flex; gap: 10px;
  width: max-content;
  padding: 6px 12px;
  will-change: transform;
}
.mik-marq-item {
  --pv-bg: var(--paper);
  --pv-ink: var(--ink);
  --pv-accent: var(--moss);
  --pv-font: var(--body-font);

  flex-shrink: 0;
  width: 260px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition:
    background 280ms ease, color 280ms ease, border-color 220ms ease,
    transform 200ms ease, box-shadow 240ms ease;
  user-select: none;
}
.mik-marq-prompt {
  font-size: 13.5px;
  line-height: 1.4;
  color: inherit;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 500;
  transition: font-family 280ms ease;
}
.mik-marq-preview {
  display: flex; align-items: center; gap: 10px;
  margin-top: auto;
  opacity: 0.7;
  transition: opacity 260ms ease;
}
.mik-marq-sample {
  font-family: var(--pv-font);
  font-size: 13px;
  color: inherit;
  letter-spacing: -0.005em;
  line-height: 1;
  font-weight: 600;
}
.mik-marq-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--pv-accent);
  margin-left: auto;
  border: 1px solid color-mix(in oklch, var(--pv-accent) 30%, transparent);
}
.mik-marq-item:hover {
  background: var(--pv-bg);
  color: var(--pv-ink);
  border-color: color-mix(in oklch, var(--pv-accent) 40%, var(--line));
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
}
.mik-marq-item:hover .mik-marq-preview { opacity: 1; }
@media (max-width: 720px) {
  .mik-marq-item { width: 220px; }
}

/* ============================================================ */
/*  AGENT WORKSPACE CARD (02-05) — soft studio panels             */
/* ============================================================ */
.agent-workspace {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-2);
}
.agent-workspace-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  height: 480px;
}
.agent-workspace-chat,
.agent-workspace-canvas { height: 100%; min-height: 0; overflow: hidden; }
.agent-workspace-chat .agent-log { max-height: 100%; }
@media (max-width: 880px) { .agent-workspace-body { grid-template-columns: 1fr; } }

.agent-workspace-chat {
  padding: 22px 22px 18px;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  position: relative;
}
@media (max-width: 880px) {
  .agent-workspace-chat { border-right: 0; border-bottom: 1px solid var(--line-soft); }
}

.agent-workspace-canvas {
  background: var(--paper-2);
  display: flex; flex-direction: column;
  position: relative;
  border-left: 0;
  height: 100%;
  min-height: 0;
}

.agent-workspace-foot {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--paper-2);
  font-size: 12px;
  color: var(--mute);
}
.aws-progress {
  height: 4px;
  background: var(--line-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}
.aws-progress-bar {
  height: 100%;
  background: var(--moss);
  transition: width 280ms ease, background 280ms ease;
  border-radius: var(--radius-pill);
}
.aws-progress-label { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 600; }
.aws-handoff {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--mute);
  white-space: nowrap;
}
.aws-handoff-name {
  color: var(--ink);
  font-weight: 600;
  font-family: var(--body-font);
}

/* ============================================================ */
/*  CHAT LOG (inside agent workspace)                             */
/* ============================================================ */
.agent-log {
  display: flex; flex-direction: column; gap: 12px;
  font-size: 14.5px; line-height: 1.55;
  overflow-y: auto;
  flex: 1;
  min-height: 360px;
  max-height: 460px;
  padding: 2px 2px 0;
}
.agent-msg {
  display: flex; gap: 10px;
  align-items: flex-start;
  animation: msgIn 280ms ease 0ms both;
}
@keyframes msgIn { from { opacity: 0.3; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.agent-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--body-font); font-weight: 700; font-size: 13px;
  color: white;
  flex-shrink: 0;
  margin-top: 2px;
}
.agent-msg-bubble {
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  border-top-left-radius: 6px;
  font-size: 14.5px; line-height: 1.55; color: var(--ink-soft);
  max-width: 56ch;
}
.agent-msg-sys {
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 500;
  color: var(--moss-deep);
  padding-left: 38px;
  display: flex; align-items: center; gap: 6px;
  letter-spacing: 0;
  opacity: 0.9;
}
:root[data-theme="dark"] .agent-msg-sys { color: var(--moss); }
.agent-msg-sys-text { white-space: pre-wrap; }
.agent-msg-you { flex-direction: row-reverse; }
.agent-msg-you .agent-msg-bubble {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  border-radius: var(--radius-lg);
  border-top-right-radius: 6px;
  font-weight: 500;
}
.agent-msg-final {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px;
  padding-left: 38px;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--moss-deep);
  letter-spacing: 0;
  background: transparent;
  border: 0;
}
:root[data-theme="dark"] .agent-msg-final { color: var(--moss-ink); }
.agent-msg-final-tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--moss);
  color: var(--paper);
  font-size: 10px;
  font-weight: 700;
}
.agent-cursor {
  display: inline-block; width: 2px; height: 1em;
  background: var(--ink);
  margin-left: 2px;
  animation: caret 900ms steps(1) infinite;
  vertical-align: text-bottom;
  border-radius: 1px;
}
.agent-cursor-sys { background: var(--moss); }
@keyframes caret { 50% { opacity: 0; } }
.agent-msg-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.agent-msg-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mute);
  animation: typingPulse 1.2s ease-in-out infinite;
}
.agent-msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.agent-msg-typing span:nth-child(3) { animation-delay: 0.3s; }
/* "Thinking" bubble with a live progress label — immediate feedback the moment
   the visitor sends, before ECHO's first token (label cycles in app code). */
.mik-hero-bubble-thinking { display: inline-flex; align-items: center; gap: 4px; }
.mik-thinking-dots { display: inline-flex; gap: 4px; margin-left: 6px; }
.mik-thinking-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--mute);
  animation: typingPulse 1.2s ease-in-out infinite;
}
.mik-thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.mik-thinking-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingPulse { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* ECHO live copy reveal — each retuned string flashes once as it lands, so the
   visitor watches the copy change top-to-bottom after the palette. A moss glow
   ring (+ faint tint) over box-shadow/background only: no layout shift, and it
   reverts cleanly even on elements that carry their own background. Driven from
   app.jsx, which toggles .mik-text-flash on the changed [data-tz] node. */
@keyframes mikTextFlash {
  0%   { box-shadow: 0 0 0 2.5px color-mix(in oklch, var(--moss) 50%, transparent),
                     0 0 16px 2px color-mix(in oklch, var(--moss) 34%, transparent);
         background-color: color-mix(in oklch, var(--moss) 16%, transparent); }
  70%  { box-shadow: 0 0 0 2px color-mix(in oklch, var(--moss) 22%, transparent),
                     0 0 10px 1px color-mix(in oklch, var(--moss) 14%, transparent);
         background-color: color-mix(in oklch, var(--moss) 6%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent;
         background-color: transparent; }
}
.mik-text-flash {
  border-radius: 4px;
  animation: mikTextFlash 0.9s ease-out;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
}
@media (prefers-reduced-motion: reduce) {
  .mik-text-flash { animation: none; }
}

/* ECHO restyle cross-fade: dissolve the whole page from the old look to the new
   one when the overlay swaps (driven by style-overlay.js via the View
   Transitions API). Browsers without the API just swap instantly. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.5s;
  animation-timing-function: ease;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

.mik-mood-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--moss-deep);
  font-weight: 500;
  font-style: italic;
  font-family: var(--display-font);
}
:root[data-theme="dark"] .mik-mood-tag { color: var(--moss-ink); }

/* ============================================================ */
/*  DESIGNER CANVAS — KALÁCS bakery home screen                    */
/* ============================================================ */
.dsg-canvas {
  height: 100%;
  display: flex; flex-direction: column;
  padding: 12px 24px 12px;
  gap: 12px;
}
.dsg-canvas-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px;
}
.dsg-pane-label {
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0;
  font-weight: 500;
}
.dsg-pane-label-mute { color: var(--mute); font-weight: 400; }
.dsg-canvas-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}

/* Phone — KALÁCS bakery brand inside */
.dsg-phone {
  position: relative;
  margin: 0 auto;
  width: 210px; height: 420px;
  background: var(--mock-screen);
  border: 9px solid var(--mock-frame);
  border-radius: 36px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 600ms, transform 600ms;
  box-shadow:
    0 24px 48px -28px rgba(50, 30, 10, 0.4),
    0 2px 0 1px rgba(0, 0, 0, 0.05) inset;
}
.dsg-phone.on { opacity: 1; transform: translateY(0); }
.dsg-phone-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 76px; height: 20px; background: var(--mock-frame); border-radius: 14px; z-index: 3; }
.dsg-phone-status { position: absolute; top: 10px; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 26px; font-family: var(--mono-font); font-size: 9px; color: var(--mock-soft); z-index: 2; }
.dsg-phone-hero {
  position: absolute; top: 36px; left: 14px; right: 14px; height: 138px;
  background:
    radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--mock-glow) 70%, transparent) 0%, transparent 60%),
    linear-gradient(155deg, var(--mock-warm) 0%, var(--mock-soft) 60%, var(--mock-ink) 100%);
  border-radius: 20px;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 500ms ease, transform 500ms ease;
  overflow: hidden;
}
.dsg-phone-hero.on { opacity: 1; transform: scale(1); }
.dsg-phone-hero::before {
  /* sketched bread loaf */
  content: "";
  position: absolute;
  inset: 24% 10% 18% 14%;
  background:
    radial-gradient(ellipse 56% 70% at 50% 60%, var(--mock-glow) 0%, color-mix(in srgb, var(--mock-warm) 70%, black) 60%, transparent 75%),
    radial-gradient(ellipse 28% 18% at 65% 35%, rgba(255, 240, 200, 0.6) 0%, transparent 60%);
  filter: blur(0.5px);
}
.dsg-phone-block { position: absolute; top: 188px; left: 18px; right: 18px; opacity: 0; transform: translateY(8px); transition: opacity 500ms, transform 500ms; }
.dsg-phone-block.on { opacity: 1; transform: translateY(0); }
.dsg-phone-eyebrow { font-family: var(--body-font); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mock-soft); margin-bottom: 6px; font-weight: 600; }
.dsg-phone-title { font-family: var(--mock-font); font-weight: 600; font-size: 30px; line-height: 0.94; color: var(--mock-ink); letter-spacing: -0.02em; }
.dsg-phone-title em { font-style: italic; font-weight: 400; color: var(--mock-soft); }
.dsg-phone-sub { font-family: var(--mock-font); font-size: 12px; color: var(--mock-soft); margin-top: 8px; }
.dsg-phone-ctas { position: absolute; left: 18px; right: 18px; bottom: 64px; display: flex; gap: 8px; opacity: 0; transform: translateY(8px); transition: opacity 500ms, transform 500ms; }
.dsg-phone-ctas.on { opacity: 1; transform: translateY(0); }
.dsg-phone-cta { flex: 1; border: 0; padding: 10px 8px; border-radius: 999px; font-size: 11px; font-family: var(--body-font); font-weight: 600; letter-spacing: 0; }
.dsg-phone-cta-primary { background: var(--mock-ink); color: var(--mock-screen); }
.dsg-phone-cta-ghost { background: var(--mock-screen); color: var(--mock-ink); border: 1px solid var(--mock-ink); }
.dsg-phone-nav { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; background: color-mix(in srgb, var(--mock-ink) 96%, transparent); display: flex; align-items: center; justify-content: space-around; padding: 0 18px; opacity: 0; transform: translateY(10px); transition: opacity 500ms, transform 500ms; }
.dsg-phone-nav.on { opacity: 1; transform: translateY(0); }
.dsg-phone-nav-item { font-size: 11px; color: color-mix(in srgb, var(--mock-screen) 50%, transparent); }
.dsg-phone-nav-item.active { color: var(--mock-glow); }

.dsg-aside { display: flex; flex-direction: column; gap: 12px; }
.dsg-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms, transform 500ms;
  box-shadow: var(--shadow-1);
}
.dsg-card.on { opacity: 1; transform: translateY(0); }
.dsg-card-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 10px;
}
.dsg-type-display { font-family: "Fraunces", serif; font-weight: 600; font-size: 52px; line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.dsg-type-name { font-size: 11px; color: var(--mute); letter-spacing: 0; margin-top: 6px; }
.dsg-type-body { font-family: "Fraunces", serif; font-size: 14px; color: var(--ink-soft); margin-top: 10px; line-height: 1.4; }
.dsg-palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dsg-swatch { height: 40px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.06); }
@media (max-width: 880px) { .dsg-canvas-body { grid-template-columns: 1fr; } .dsg-phone { margin-top: 18px; } }

/* ============================================================ */
/*  ARCHITECT CANVAS — node-link                                  */
/* ============================================================ */
.arch-canvas {
  height: 100%;
  display: flex; flex-direction: column;
  padding: 36px 24px 18px;
  gap: 16px;
  color: var(--ink-soft);
}
.arch-canvas-head, .arch-canvas-foot {
  display: flex; gap: 10px;
  font-family: var(--mono-font); font-size: 11px;
  font-weight: 500;
  color: var(--mute);
  letter-spacing: 0;
}
.arch-canvas-foot { color: var(--ink-soft); }
.arch-svg { flex: 1; width: 100%; min-height: 320px; color: var(--ag-atlas); padding-left: 28px; }

/* ============================================================ */
/*  CODER CANVAS — IDE                                            */
/* ============================================================ */
.coder-canvas {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
}
:root[data-theme="dark"] .coder-canvas { background: var(--bg-deep); }
.coder-pane {
  background: transparent;
  color: var(--ink);
  display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
  flex: 1;
}
.coder-pane-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono-font); font-size: 11px;
  font-weight: 500;
  color: var(--mute);
  letter-spacing: 0;
}
.coder-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.coder-pane-title { margin-left: 6px; color: var(--ink-soft); }
.coder-pre {
  margin: 0;
  padding: 14px 18px;
  font-family: var(--mono-font); font-size: 12.5px; line-height: 1.75;
  overflow: hidden; flex: 1;
}
.coder-line { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.coder-ln { color: var(--mute-2); user-select: none; text-align: right; font-size: 11px; }
.coder-tok { white-space: pre; }
.coder-kw  { color: var(--ag-forge); }
.coder-fn  { color: var(--ag-codex); }
.coder-tag { color: var(--ag-atlas); }
.coder-txt { color: var(--ink-soft); }
.coder-str { color: var(--moss); }
.coder-com { color: var(--mute); font-style: italic; }
.coder-caret { display: inline-block; width: 2px; height: 1em; background: var(--ink); animation: caret 800ms steps(1) infinite; vertical-align: text-bottom; }

/* ============================================================ */
/*  DOCUMENTER CANVAS                                             */
/* ============================================================ */
.doc-canvas {
  height: 100%;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1px;
  background: var(--line-soft);
  min-height: 380px;
}
.doc-pane { background: var(--bg-deep); display: flex; flex-direction: column; overflow: hidden; }
.doc-side { display: grid; grid-template-rows: 1fr; gap: 1px; background: var(--line-soft); min-width: 0; }
.doc-pane-head {
  padding: 12px 18px;
  font-family: var(--mono-font); font-size: 11px;
  font-weight: 500;
  color: var(--mute);
  letter-spacing: 0;
  border-bottom: 1px solid var(--line-soft);
}
.doc-md { padding: 16px 22px; font-size: 14px; line-height: 1.7; color: var(--ink-soft); overflow: hidden; flex: 1; }
.md-h1 { font-family: var(--display-font); font-size: 22px; font-weight: 600; margin: 0 0 10px; color: var(--ink); letter-spacing: -0.01em; }
.md-h2 { font-size: 14px; font-weight: 600; margin: 14px 0 6px; color: var(--ink); }
.md-p  { margin: 0 0 8px; color: var(--mute); }
.md-li { margin: 0 0 2px; color: var(--ink-soft); }
.md-code { background: var(--paper-3); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; font-family: var(--mono-font); font-size: 12px; color: var(--ink); margin: 6px 0 10px; }
/* Hard size ceiling for the SCRIBE doc-pane markdown. It's a tiny editor mockup,
   so the copy must stay small no matter how ECHO themes the page. Each block is
   pinned in absolute px with !important: an overlay can still re-colour / re-font
   the text, but can never blow its SIZE up past the pane. Absolute (not em) so a
   bumped container font-size can't cascade through; scoped to .doc-md (0,2,0) so
   it beats a stray .md-h1 / .doc-md overlay rule and leaves global .md-* alone. */
.doc-md          { font-size: 14px !important; }
.doc-md .md-h1   { font-size: 20px !important; }
.doc-md .md-h2   { font-size: 14px !important; }
.doc-md .md-p,
.doc-md .md-li   { font-size: 13px !important; }
.doc-md .md-code { font-size: 12px !important; }
.doc-caret { display: inline-block; width: 2px; height: 14px; background: var(--ink); vertical-align: text-bottom; animation: caret 800ms steps(1) infinite; }
.doc-tree { list-style: none; margin: 0; padding: 14px 18px; font-family: var(--mono-font); font-size: 12px; line-height: 1.9; color: var(--ink-soft); flex: 1; overflow: hidden; }
.doc-tree-item { animation: msgIn 280ms ease both; }
.doc-tree-dir { color: var(--ag-codex); font-weight: 600; }
.doc-tree-md  { color: var(--mute); }

/* ============================================================ */
/*  REMI CONTACT — same calm card frame                           */
/* ============================================================ */
.agent-workspace-contact {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-2);
  width: 100%;
}
.agent-workspace-contact .mik-bori-body {
  display: flex;
  flex-direction: column;
  min-height: 460px;
}
.mik-bori-log {
  flex: 1;
  padding: 24px 28px 14px;
  overflow-y: auto;
  min-height: 360px;
  /* Cap so REMI's card never grows taller than the other agents' (~526px). */
  max-height: 440px;
  background: var(--paper);
}
.mik-bori-body > .mik-input-pill {
  margin: 0 18px 18px;
}

/* ============================================================ */
/*  FOOTER                                                        */
/* ============================================================ */
.mik-footer {
  /* No border-top: the dock's full-width border-bottom is the seam. */
  padding: 64px var(--pad-x) 56px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.mik-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
@media (max-width: 720px) {
  .mik-footer-grid { grid-template-columns: 1fr; }
}
.mik-footer-brand { display: flex; flex-direction: column; gap: 18px; max-width: 44ch; }
.mik-footer-brand p { color: var(--mute); font-size: 14.5px; margin: 0; line-height: 1.55; }
.mik-footer-logo {
  display: flex; align-items: center; gap: 12px;
}
.mik-footer-section { display: flex; flex-direction: column; gap: 0; }
.mik-footer-contact { display: flex; flex-direction: column; gap: 0; }
.mik-footer-contact-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.mik-footer-contact-row:last-child { border-bottom: 0; }
.mik-footer-contact-k {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
}
.mik-footer-contact-v {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.005em;
}
a.mik-footer-contact-v:hover { color: var(--moss-deep); }
.mik-footer-contact-v.is-mute { color: var(--mute); font-weight: 400; }
.mik-footer-section-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 12px;
}
.mik-footer-link {
  display: block;
  width: 100%;
  padding: 7px 0;
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: color 200ms;
}
.mik-footer-link:hover { color: var(--moss-deep); }
:root[data-theme="dark"] .mik-footer-link:hover { color: var(--moss-ink); }
.mik-footer-link-mute {
  color: var(--mute);
  font-weight: 400;
  font-size: 13.5px;
}
.mik-footer-link-mute:hover { color: var(--ink); }
.mik-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--mute);
  flex-wrap: wrap;
}
.mik-footer-bottom-meta { line-height: 1.6; }
.mik-footer-bottom-legal { display: flex; gap: 18px; flex-wrap: wrap; }
.mik-footer-bottom-legal a {
  color: var(--mute);
  text-decoration: none;
  transition: color 200ms;
}
/* ============================================================ */
/*  LEGAL MODAL                                                    */
/* ============================================================ */
.mik-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in oklch, var(--ink) 35%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: modalOverlayIn 240ms ease forwards;
}
@keyframes modalOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.mik-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  /* Clip to the rounded corners; the inner .mik-modal-scroll does the scrolling
     so its scrollbar stays off the rounded top corner (18px top padding insets
     it past the 20px radius), and the fixed foot bar covers the bottom. */
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 0 0;
  box-shadow:
    0 1px 2px rgba(60, 40, 20, 0.06),
    0 40px 80px -32px rgba(60, 40, 20, 0.32),
    0 12px 32px -12px rgba(60, 40, 20, 0.15);
  animation: modalCardIn 360ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.mik-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 36px 14px; /* + the card's 18px top = 36 */
}
@keyframes modalCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.mik-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--mute);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 200ms, color 200ms;
}
.mik-modal-close:hover {
  background: var(--paper-3);
  color: var(--ink);
}
.mik-modal-eyebrow {
  font-family: var(--display-font);
  font-style: italic;
  font-size: 15px;
  color: var(--mute);
  letter-spacing: 0;
  margin-bottom: 4px;
}
.mik-modal-title {
  font-family: var(--display-font);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 24px;
}
.mik-modal-body p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 14px;
  letter-spacing: -0.005em;
}
.mik-modal-body p:last-child { margin-bottom: 0; }
/* Fixed footer bar — sits outside .mik-modal-scroll, pinned at the card bottom,
   so the dismiss / consent buttons stay visible no matter how long the notice. */
.mik-modal-foot {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 36px 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--paper);
}
.mik-modal-foot-meta {
  font-size: 12px;
  color: var(--mute);
  letter-spacing: 0;
}
.mik-modal-foot-btn {
  background: var(--ink);
  color: var(--bg);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 200ms, transform 160ms, box-shadow 200ms;
}
.mik-modal-foot-btn:hover {
  background: color-mix(in oklch, var(--ink) 80%, var(--moss));
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -10px color-mix(in oklch, var(--ink) 55%, transparent);
}
@media (max-width: 560px) {
  .mik-modal { padding: 16px; }
  .mik-modal-card { padding: 16px 0 0; }
  .mik-modal-scroll { padding: 12px 22px 10px; }
  .mik-modal-foot { padding: 12px 22px 14px; }
}

/* ---- Cookie notice: the bigger sibling of the legal modal ---- */
.mik-modal-card.is-big { width: min(760px, 100%); }
/* Reserve the scrollbar gutter so toggling overflow during the morph (and the
   scrollbar appearing once it lands) never reflows the content — no end flash. */
.mik-cookie-modal .mik-modal-scroll { scrollbar-gutter: stable; }
/* While morphing (privacy modal → or consent banner → cookie notice) the card's
   position+size are JS-driven; suppress modalCardIn and the inner scrollbar so
   the inline top/left/width/height transition is the only thing moving. */
.mik-modal-card.is-morphing { animation: none; }
.mik-modal-card.is-morphing .mik-modal-scroll { overflow: hidden; }
@keyframes cmFade { from { opacity: 0; } to { opacity: 1; } }
.mik-modal-card.is-morphing > *:not(.mik-modal-close) { animation: cmFade 440ms ease both; }

/* Consent buttons in the cookie-notice foot — shown when no choice is recorded
   yet (e.g. opened from the banner). Equal visual weight, per EDPB guidance. */
.mik-cm-consent-actions { display: flex; gap: 10px; align-items: center; }
.mik-cm-consent-btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in oklch, var(--ink) 26%, transparent);
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
  transition: background 200ms, border-color 200ms;
}
.mik-cm-consent-btn:hover {
  background: var(--paper-3);
  border-color: color-mix(in oklch, var(--ink) 40%, transparent);
}

/* Share-confirmation modal: the copied URL, shown as a selectable mono block. */
.mik-share-url {
  margin-top: 12px;
  padding: 10px 12px;
  font-family: var(--mono-font, ui-monospace, Consolas, monospace);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  background: var(--paper-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md, 12px);
  word-break: break-all;
  user-select: all;
}

.mik-cm-note {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.mik-cm-loading { font-size: 14px; color: var(--mute); margin: 0; }

/* The official cookie notice (fetched from /cookies.html) injected into the
   modal — restyle its plain markup to the modal's theme via the CSS vars. */
.mik-cm-legal { font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); }
.mik-cm-legal > :first-child { margin-top: 0; }
.mik-cm-legal h2 {
  font-family: var(--display-font);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 26px 0 8px;
}
.mik-cm-legal p,
.mik-cm-legal ul { margin: 9px 0; }
.mik-cm-legal ul { padding-left: 20px; }
.mik-cm-legal li { margin: 4px 0; }
.mik-cm-legal a { color: var(--moss); text-decoration: none; }
.mik-cm-legal a:hover { text-decoration: underline; }
.mik-cm-legal .box {
  background: var(--paper-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md, 12px);
  padding: 13px 15px;
  margin: 0 0 8px;
}
.mik-cm-legal .table-wrap { overflow-x: auto; margin: 12px 0; }
.mik-cm-legal table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
.mik-cm-legal th,
.mik-cm-legal td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
}
.mik-cm-legal th { font-weight: 600; color: var(--ink); white-space: nowrap; }
.mik-cm-legal code,
.mik-cm-legal td code {
  font-family: var(--mono-font, ui-monospace, Consolas, monospace);
  font-size: 12.5px;
  color: var(--ink);
  background: var(--paper-3);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 1px 5px;
  white-space: nowrap;
}
.mik-modal-more {
  display: inline-block;
  margin-top: 6px;
  font-size: 14px;
  color: var(--moss);
  text-decoration: none;
}
.mik-modal-more:hover { text-decoration: underline; }

.mik-footer-bottom-legal a:hover { color: var(--ink); }
@media (max-width: 880px) {
  .mik-footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .mik-footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================ */
/*  RESPONSIVE                                                    */
/* ============================================================ */
@media (max-width: 880px) {
  .mik-header { grid-template-columns: auto auto; gap: 12px; }
  .mik-nav { display: none; }
  .doc-canvas { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .mik-marq-item { width: 220px; }
}


/* ============================================================ */
/*  INTRO CHOREOGRAPHY                                           */
/* ============================================================ */
/*  The whole opening, organized into four logical units that play
 *  back-to-back. Every rule below is grouped and ordered by them:
 *
 *    ① ENTER   overlay fades in + logo pops        · mount (t=0)
 *    ② TYPE    line 1 → line 2 type out + caret     · mount + delay
 *    ③ EXIT    overlay fades out                    · mount + --exit-delay
 *    ④ REVEAL  hero + dock slide in (the handoff)   · on mik:lead-done
 *
 *      0 ──┬─ ENTER ─┬───── TYPE ─────┬── hold ──┬─ EXIT ─╮
 *          └ logo pop┘                └ caret ───┘        ╰─▶ ④ REVEAL
 *                                                             hero + dock
 *
 *  ONE calc()-chained source of timing: to retime globally, edit the
 *  ① variables below — every later delay derives from them (plus the
 *  per-line char counts React passes in as --n1/--n2). No magic numbers.
 *
 *  ── Tuning in DevTools (F12 → ⋮ → More tools → Animations) ──
 *  The panel shows this as TWO groups, one per real beat:
 *    • ①–③ all start at mount       → one group (the splash)
 *    • ④ starts on the lead-done evt → one group (the reveal)
 *  Press the dev-only "⟳ intro" button (bottom-left, localhost) to
 *  re-fire it without reloading and re-capture both groups; then drag
 *  keyframes / easings, or drop playback to 25% to study it slowly.
 */

/* ───── ① ENTER · overlay + logo pop — and the master timeline ───── */
.mik-intro {
  /* ▼▼ EDIT THESE — the whole intro retimes off them ▼▼ */
  --intro-overlay-in: 400ms;   /* overlay fade-in duration         */
  --intro-mark-in:    720ms;   /* logo scale-pop duration          */
  --intro-mark-delay: 120ms;   /* logo pop start                   */
  --intro-type-start: 560ms;   /* when line 1 begins typing        */
  --intro-type-speed:  52ms;   /* per-character typing speed       */
  --intro-line-gap:   300ms;   /* gap between line 1 and line 2    */
  --intro-hold:       820ms;   /* dwell after typing, before exit  */
  --intro-exit:       760ms;   /* overlay fade-out duration        */
  /* ▲▲ everything below is derived — leave it alone ▲▲ */
  --type-dur-1:  calc(var(--intro-type-speed) * var(--n1, 12));
  --type-dur-2:  calc(var(--intro-type-speed) * var(--n2, 10));
  --line1-delay: var(--intro-type-start);
  --line2-delay: calc(var(--line1-delay) + var(--type-dur-1) + var(--intro-line-gap));
  --type-end-2:  calc(var(--line2-delay) + var(--type-dur-2));
  --exit-delay:  calc(var(--type-end-2) + var(--intro-hold));

  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 6vw, 64px);
  box-sizing: border-box;
  /* fade in immediately, then auto fade-out once the sequence ends */
  animation:
    mikIntroOverlayIn  var(--intro-overlay-in) cubic-bezier(0.2, 0.7, 0.2, 1) both,
    mikIntroOverlayOut var(--intro-exit) cubic-bezier(0.65, 0, 0.35, 1) var(--exit-delay) forwards;
}
/* ③ EXIT — the overlay's fade-out is the 2nd half of the animation on
   .mik-intro above; it auto-starts at --exit-delay. JS adds .is-exiting
   on its animationstart so the page underneath is clickable as it goes. */
.mik-intro.is-exiting { pointer-events: none; }
@keyframes mikIntroOverlayIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes mikIntroOverlayOut { from { opacity: 1; } to { opacity: 0; } }

.mik-intro-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vw, 36px);
  text-align: center;
}
.mik-intro-mark {
  animation: mikIntroMarkIn var(--intro-mark-in) cubic-bezier(0.34, 1.56, 0.64, 1) var(--intro-mark-delay) both;
}
@keyframes mikIntroMarkIn {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}
.mik-intro-headline {
  font-family: var(--display-font);
  font-weight: 400;
  font-size: clamp(40px, 6.5vw, 88px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
}

/* ───── ② TYPE · line 1 → line 2 type out, then the caret blinks ───── */
/* The typewriter, in pure CSS. Each line is a max-content box (its
   natural text width); clip-path reveals it left→right in steps(), so
   the cut is always relative to the REAL rendered width — exact on any
   font, never clips a glyph, no `ch` guesswork on the serif display
   face. (A width-clip can't do this: width:0 collapses the parent's
   max-content to 0, so 0→100% would be 0→0.) */
.mik-intro-line {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}
.mik-intro-type {
  display: block;
  white-space: nowrap;
  /* Bleed the clip a touch past the text box on every side so script / italic
     faces whose glyphs overhang their advance width (swashes, the slant of the
     last letter, tall ascenders) aren't shaved at the edges. Only the RIGHT
     inset animates — the others stay bled so the reveal direction is unchanged. */
  clip-path: inset(-0.16em 100% -0.22em -0.16em); /* hidden from the right */
}
@keyframes mikIntroType { to { clip-path: inset(-0.16em -0.5em -0.22em -0.16em); } }
.mik-intro-line:nth-child(1) .mik-intro-type {
  animation: mikIntroType var(--type-dur-1) steps(var(--n1, 12)) var(--line1-delay) both;
}
.mik-intro-line:nth-child(2) .mik-intro-type {
  animation: mikIntroType var(--type-dur-2) steps(var(--n2, 10)) var(--line2-delay) both;
}
/* One caret: blinks at the end of line 2, and only appears once line 2
   has finished typing (hidden during the reveal via the start delay). */
.mik-intro-line:nth-child(2)::after {
  content: "";
  position: absolute;
  right: -0.12em;
  bottom: 0.14em;
  width: 0.05em;
  height: 0.74em;
  background: var(--ag-echo, currentColor);
  opacity: 0;
  animation: mikIntroCaret 800ms steps(1) var(--type-end-2) infinite;
}
@keyframes mikIntroCaret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ───── ④ REVEAL · the handoff — hero + dock slide in together ─────
   Fires on mik:lead-done (dispatched when the overlay starts its EXIT),
   so the page surfaces in the same beat the splash dissolves. Both stay
   hidden until then; a return visitor (data-skip="1") shows it at once. */
.mik-hero-stagger {
  --hero-reveal-duration: 1100ms;
  --hero-reveal-stagger:  120ms;
  --hero-reveal-from-y:   8vh;
}
.mik-hero-stagger > * {
  opacity: 0;
  transform: translateY(var(--hero-reveal-from-y, 8vh));
}
.mik-hero-stagger.is-revealing > * {
  animation: mikHeroIn var(--hero-reveal-duration, 1100ms) cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.mik-hero-stagger.is-revealing > .mik-hero-section-header { animation-delay: calc(var(--hero-reveal-stagger) * 0); }
.mik-hero-stagger.is-revealing > .mik-hero-head           { animation-delay: calc(var(--hero-reveal-stagger) * 1); }
.mik-hero-stagger.is-revealing > .mik-hero-prompt-stack   { animation-delay: calc(var(--hero-reveal-stagger) * 2); }
.mik-hero-stagger.is-revealing > .mik-marq-wrap           { animation-delay: calc(var(--hero-reveal-stagger) * 3); }
@keyframes mikHeroIn {
  to { opacity: 1; transform: translateY(0); }
}
/* Return visitor — no intro, so children must be visible immediately. */
.mik-hero-stagger[data-skip="1"] > * {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

/* Dock — same REVEAL beat as the hero, a touch later (--dock-reveal-delay)
   so the status bar settles in last. Base layout lives in STUDIO DOCK below. */
.mik-dock.is-revealing {
  animation: dockIn 700ms cubic-bezier(0.2, 0.7, 0.2, 1) var(--dock-reveal-delay, 220ms) forwards;
}
@keyframes dockIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mik-hero-headline { display: none; }
.mik-hero-agent-badge { display: none; }

/* Hero section — divider sits BELOW the hero-head now (see .mik-hero-head::after). */
.mik-hero-section {
  padding-top: clamp(16px, 3vw, 32px);
  padding-bottom: clamp(48px, 6vw, 88px);
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

/* Full-viewport-width divider directly under the agent identity row. */
.mik-hero-head {
  position: relative;
}
.mik-hero-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 1px;
  background: var(--line);
}

@media (max-width: 720px) {
  .mik-intro-headline { font-size: clamp(32px, 9vw, 56px); }
  .mik-intro-inner { gap: 18px; }
}

/* Dev-only replay button (MIKIntroReplay) — localhost/LAN only. Sits
   above the intro overlay (z 70 > 60) so you can re-fire it mid-capture. */
.mik-intro-replay {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 11px;
  color: var(--ink-soft, #777);
  background: color-mix(in oklch, var(--paper, #fff) 78%, transparent);
  border: 1px solid var(--line, #dcd5c7);
  border-radius: 999px;
  cursor: pointer;
  opacity: 0.5;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: opacity 150ms ease, transform 150ms ease;
}
.mik-intro-replay:hover { opacity: 1; transform: translateY(-1px); }
.mik-intro-replay:active { transform: translateY(0); }


/* ============================================================ */
/*  STUDIO DOCK — full-width status bar; sits flush above footer  */
/* ============================================================ */
.mik-dock {
  /* Pinned to the viewport bottom while scrolling; once the page is
     scrolled to its natural spot (flush above the footer), it parks there.
     z-index sits above content + mascot (20), below the sticky header (30). */
  position: sticky;
  bottom: 0;
  z-index: 25;
  flex-shrink: 0;   /* app-shell rail — size to content, never shrink */
  width: 100%;
  border-top: 1px solid var(--line-soft);
  /* Full-width seam against the footer below — without it the dock's bg
     (var(--bg) 82%) blends into the cream footer, since the footer's own
     border-top spans only the centered max-width. */
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  opacity: 0;
  box-sizing: border-box;
  margin: 0;
  /* Dock labels are i18n strings ECHO can rewrite arbitrarily long; several
     children are flex-shrink:0 + nowrap. Clip so an over-long restyle can
     never spill past the viewport and raise a horizontal scrollbar. */
  overflow: hidden;
}
/* The dock's reveal animation lives in INTRO CHOREOGRAPHY → ④ REVEAL,
   beside the hero reveal it's synchronized with. */
.mik-dock-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
  font-size: 12px;
  color: var(--ink-soft);
  min-width: 0;
  box-sizing: border-box;
}
.mik-dock-status {
  display: inline-flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.mik-dock-pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--moss);
  animation: dotPulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--moss) 22%, transparent);
}
.mik-dock-status-label {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
}
.mik-dock-status-live {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--moss-deep);
}
:root[data-theme="dark"] .mik-dock-status-live { color: var(--moss-ink); }
.mik-dock-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  flex-shrink: 0;
}
.mik-dock-project {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.mik-dock-project-name {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}
.mik-dock-k {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
  white-space: nowrap;
  flex-shrink: 0;
}
.mik-dock-stat {
  display: inline-flex; align-items: baseline; gap: 6px;
  flex-shrink: 0;
}
.mik-dock-stat-v {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.mik-dock-clock {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  flex-shrink: 0;
}
.mik-dock-spacer { flex: 0.5 1 8px; min-width: 0; }
.mik-dock .mik-lang { flex-shrink: 0; }
.mik-dock .mik-theme-btn { flex-shrink: 0; }

/* Reset-to-original button — shows in the dock project row once ECHO has
   restyled the page (cssApplied). Right-aligned via margin-left:auto; matches
   the lang/theme dock controls; collapses to a round icon button below 1000px. */
.mik-dock-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: background 200ms, border-color 200ms;
}
.mik-dock-reset:hover { background: var(--paper-3); }
.mik-dock-reset-icon { font-size: 15px; line-height: 1; flex-shrink: 0; }

@media (max-width: 1000px) {
  .mik-dock-reset { width: 32px; padding: 0; gap: 0; justify-content: center; }
  .mik-dock-reset-text { display: none; }
}

/* Hide header controls (now in the dock) */
.mik-header-controls { display: none; }
.mik-header { grid-template-columns: auto 1fr; }

@media (max-width: 880px) {
  .mik-dock-inner { padding: 8px var(--pad-x); gap: 10px; }
  /* Collapse the project label + name, but keep the reset button visible. */
  .mik-dock-project { flex: 0 0 auto; }
  .mik-dock-project > .mik-dock-k,
  .mik-dock-project > .mik-dock-project-name { display: none; }
  .mik-dock-sep:nth-of-type(1) { display: none; }
}
@media (max-width: 560px) {
  .mik-dock-stat, .mik-dock-clock, .mik-dock-sep { display: none; }
  .mik-dock-status-live { display: none; }
}

/* ============================================================ */
/*  UTILITIES                                                     */
/* ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================ */
/*  HERO BUBBLE ACTIONS — bridge CTA + error retry                */
/* ============================================================ */
.mik-bubble-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.mik-bridge-btn {
  background: var(--ink);
  color: var(--bg);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms, transform 160ms;
}
.mik-bridge-btn:hover {
  background: color-mix(in oklch, var(--ink) 80%, var(--moss));
  transform: scale(1.03);
}
.mik-retry-alt { font-size: 12.5px; color: var(--mute); text-decoration: none; }
.mik-retry-alt:hover { color: var(--ink); text-decoration: underline; }

/* Footer impresszum line under the copyright */
.mik-footer-legal-line { margin-top: 4px; font-size: 11.5px; color: var(--mute-2); }

/* ============================================================ */
/*  DECOR SCENE — anchored, scroll-driven per-visitor decor.      */
/*  One fixed layer; JS glues each actor to a real element's edge  */
/*  and drives transform/clip by scroll. z-index 6 sits above page */
/*  content (1) but below the dock (25) and header (30), so actors */
/*  near those tuck behind them; peek-behind content bars is done  */
/*  by clipping at the bar's top edge (see the engine).            */
/* ============================================================ */
.mik-decor-scene {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}
.mik-decor-actor {
  position: absolute;
  left: 0; top: 0;
  line-height: 1;
  will-change: transform, clip-path, opacity;
  transform-origin: center bottom;
}
.mik-decor-actor-in {
  display: inline-block;
  user-select: none;
  filter: drop-shadow(0 5px 9px rgba(40, 25, 10, 0.22));
}
.mik-decor-actor-text .mik-decor-actor-in {
  font-family: var(--display-font);
  font-style: italic;
  color: var(--ink);
  white-space: nowrap;
}
.mik-decor-actor-badge .mik-decor-actor-in {
  font-family: var(--body-font);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--moss);
  color: var(--paper);
  padding: 0.32em 0.8em;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-2);
  white-space: nowrap;
  font-size: 0.5em;
}
.mik-decor-actor-image .mik-decor-actor-in {
  height: auto;
  /* transparent icon cutouts — no frame; the parent drop-shadow gives depth. */
}
/* stamp actors may slowly spin around their center (decor.json: spin: true) */
.mik-decor-spin .mik-decor-actor-in {
  animation: mik-decor-spin 14s linear infinite;
  transform-origin: 50% 50%;
}
@keyframes mik-decor-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .mik-decor-spin .mik-decor-actor-in { animation: none; }
}

/* ============================================================ */
/*  TEXT-ZONES PREVIEW (?textzones)                               */
/*  The real page, with every ECHO-editable text outlined in red */
/*  and badged with its texts.json key. Toggled by a body class;  */
/*  the badge prefix (--tz-lang) tracks the current language.     */
/* ============================================================ */
.tz-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: #d83a2f; color: #fff;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}
.tz-banner code { background: rgba(255, 255, 255, 0.18); padding: 1px 5px; border-radius: 4px; font-family: var(--mono-font); font-size: 12px; }
.tz-banner a { margin-left: auto; color: #fff; font-weight: 700; text-decoration: underline; white-space: nowrap; }
.tz-banner .tz-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; flex-shrink: 0; }

body.tz-mode { padding-top: 38px; }            /* clear the fixed banner */
body.tz-mode .mik-header { top: 38px; }         /* sticky header sits below it */

body.tz-mode [data-tz] {
  outline: 1.6px dashed #d83a2f;
  outline-offset: 2px;
  position: relative;
}
body.tz-mode [data-tz]::before {
  content: var(--tz-lang, "hu.") attr(data-tz);
  position: absolute;
  left: 0; bottom: calc(100% + 3px);
  font-family: var(--mono-font);
  font-size: 10px; line-height: 1.3; font-weight: 600;
  background: #d83a2f; color: #fff;
  padding: 1px 5px; border-radius: 4px;
  white-space: nowrap; pointer-events: none; z-index: 150;
}
/* Let the key badges escape the containers that would otherwise clip them:
   the phone/canvas mockups AND the single-line strips with overflow:hidden +
   ellipsis (dock project name, the agent "working" value, marquee header). */
body.tz-mode .dsg-phone,
body.tz-mode .dsg-canvas,
body.tz-mode .agent-workspace-canvas,
body.tz-mode .mik-dock-project,
body.tz-mode .mik-dock-project-name,
body.tz-mode .aws-working,
body.tz-mode .aws-working-val,
body.tz-mode .mik-marq-header { overflow: visible; }

/* ============================================================ */
/*  COOKIE CONSENT BANNER (public/cookie-consent.js)             */
/*  Non-blocking bottom card. The two action buttons are          */
/*  intentionally identical in weight — EDPB cookie-banner        */
/*  guidance: rejecting must be as easy and as prominent as       */
/*  accepting. z-index 90: above page chrome (header 30), below   */
/*  the legal modal (100).                                        */
/* ============================================================ */
.mik-cookie-banner {
  position: fixed;
  z-index: 90;
  left: 16px;
  right: 16px;
  bottom: 16px;
  margin: 0 auto;
  max-width: 600px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid color-mix(in oklch, var(--ink) 16%, transparent);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 14px 44px color-mix(in oklch, var(--ink) 22%, transparent);
  font-size: 14px;
  line-height: 1.55;
}
.mik-cookie-text { margin: 0; }
.mik-cookie-status {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.mik-cookie-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.mik-cookie-btn {
  font: inherit;
  font-size: 13.5px;
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid color-mix(in oklch, var(--ink) 28%, transparent);
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
}
.mik-cookie-btn:hover { background: var(--paper-3); }
.mik-cookie-link {
  margin-left: auto;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mik-cookie-link:hover { color: var(--ink); }
@media (max-width: 560px) {
  .mik-cookie-link { margin-left: 0; }
}

/* ============================================================ */
/*  REDUCED MOTION — keep this block LAST so it wins the cascade  */
/*  Strategy: durations collapse to ~1ms (so animationstart/end   */
/*  events that drive the intro → reveal flow still fire), and    */
/*  purely decorative loops stop entirely. JS loops check         */
/*  window.mikReducedMotion() for their part.                     */
/* ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  /* Intro choreography compressed to a blink, event flow intact. */
  .mik-intro {
    --intro-overlay-in: 1ms;
    --intro-mark-in: 1ms;
    --intro-mark-delay: 0ms;
    --intro-type-start: 0ms;
    --intro-type-speed: 1ms;
    --intro-line-gap: 0ms;
    --intro-hold: 240ms;
    --intro-exit: 120ms;
  }
  .mik-intro-line:nth-child(2)::after { animation: none; opacity: 0; }
  .mik-hero-stagger {
    --hero-reveal-duration: 1ms;
    --hero-reveal-stagger: 0ms;
    --hero-reveal-from-y: 0px;
  }
  .mik-dock.is-revealing { animation-duration: 1ms; animation-delay: 0ms; }

  /* Decorative infinite loops off */
  .mik-mark-spin { animation: none; }
  .mik-dock-pulse,
  .aws-status-dot,
  .mik-marq-counter::before,
  .mik-hero-agent-badge .dot { animation: none; }
  .mik-emoji { animation: none !important; }
  .mik-mic-recording { animation: none; }
  /* decor scene: no emerge/hop animation; actors still follow their anchors */
  .mik-decor-actor[data-behavior="hop"] { transition: none; }
  .mik-decor-actor.is-mascot .mik-decor-actor-in { animation: none; }

  /* One-shot entrances land instantly */
  .agent-msg, .doc-tree-item, .doc-commit { animation-duration: 1ms; }
  @keyframes modalCardIn { from { opacity: 0; } to { opacity: 1; } }
  .mik-modal { animation-duration: 1ms; }
  .mik-modal-card { animation-duration: 1ms; }
  .mik-modal-card.is-morphing { transition-duration: 1ms !important; }

  /* Large transitions become immediate */
  html, body, .mik-app, .agent-workspace, .mik-input-pill, .agent-msg-bubble,
  .mik-marq-item, .mik-dock-inner, .mik-header, .mik-footer,
  .mik-pkg-card, .mik-theme-icon,
  .dsg-phone, .dsg-phone-hero, .dsg-phone-block, .dsg-phone-ctas,
  .dsg-phone-nav, .dsg-card {
    transition-duration: 1ms;
  }
}

/* Mic button transient notice (rate-limit / unavailable / failure). Floats
   above the mic button and auto-dismisses; aria role="status" announces it. */
.mik-mic-wrap {
  position: relative;
  display: inline-flex;
}
.mik-mic-notice {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  z-index: 20;
  max-width: 240px;
  width: max-content;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(20, 20, 24, 0.92);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  animation: mik-mic-notice-in 160ms ease-out;
}
@keyframes mik-mic-notice-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
