/*
 * Renly marketing kit (2026-10-07).
 *
 * One shared look for every marketing page, plus HTML/CSS illustrations of
 * the real product UI. The benchmark against claude.com and chatgpt.com found
 * the site had no product visuals at all and a different inline stylesheet on
 * every page; this file is the fix for both.
 *
 * Two layers:
 *   .mk-*  page furniture: type, buttons, sections, cards, tabs, FAQ, stats.
 *   .ui-*  product illustrations, built from the app's own labels and colours
 *          (frontend/src/lib/appNavigation.ts, ApprovalCard.tsx,
 *          EvidencePassportPanel.tsx, MyWorkflowsPage.tsx). Keep them honest:
 *          only draw what the product does.
 *
 * Animation lives in kit.js: an element with data-mk-scene plays its
 * data-at="<ms>" children in order when it scrolls into view. Without
 * JavaScript, or with reduced motion, every step simply shows.
 */

:root {
  --mk-bg: #FAFAF9;
  --mk-bg-2: #FFFFFF;
  --mk-bg-3: #F5F5F4;
  --mk-ink: #1C1917;
  --mk-text: #44403C;
  --mk-muted: #6B6764;
  --mk-line: #E7E5E4;
  --mk-line-2: #D6D3D1;
  --mk-accent: #4F46E5;
  --mk-accent-2: #4338CA;
  --mk-accent-soft: #EEF2FF;
  --mk-accent-ring: #C7D2FE;
  --mk-ok: #15803D;
  --mk-ok-btn: #16A34A;
  --mk-ok-soft: #F0FDF4;
  --mk-ok-line: #BBF7D0;
  --mk-warn: #B45309;
  --mk-warn-soft: #FFFBEB;
  --mk-warn-line: #FDE68A;
  --mk-danger: #DC2626;
  --mk-violet: #6D28D9;
  --mk-violet-soft: #F5F3FF;
  --mk-band: #0C0A09;
  --mk-band-text: #E7E5E4;
  --mk-radius: 12px;
  --mk-radius-lg: 16px;
  --mk-radius-xl: 24px;
  --mk-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 10px 30px -14px rgb(28 25 23 / .18);
  --mk-shadow-lg: 0 30px 70px -30px rgb(28 25 23 / .35), 0 2px 8px rgb(0 0 0 / .05);
  --mk-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mk-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mk-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mk-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;
  --mk-ease: cubic-bezier(.16, 1, .3, 1);
}

html[data-theme="dark"] {
  --mk-bg: #0b1120;
  --mk-bg-2: #0f1829;
  --mk-bg-3: #131c2e;
  --mk-ink: #f1f5f9;
  --mk-text: #cbd5e1;
  --mk-muted: #94a3b8;
  --mk-line: #1e3050;
  --mk-line-2: #2a3d5e;
  --mk-accent: #818cf8;
  --mk-accent-2: #a5b4fc;
  --mk-accent-soft: rgba(129, 140, 248, .14);
  --mk-accent-ring: rgba(129, 140, 248, .4);
  --mk-ok: #4ade80;
  --mk-ok-btn: #16A34A;
  --mk-ok-soft: rgba(34, 197, 94, .12);
  --mk-ok-line: rgba(34, 197, 94, .35);
  --mk-warn: #fbbf24;
  --mk-warn-soft: rgba(245, 158, 11, .1);
  --mk-warn-line: rgba(245, 158, 11, .35);
  --mk-violet: #c4b5fd;
  --mk-violet-soft: rgba(139, 92, 246, .15);
  --mk-band: #060a14;
  --mk-band-text: #cbd5e1;
  --mk-shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px -14px rgb(0 0 0 / .6);
  --mk-shadow-lg: 0 30px 70px -30px rgb(0 0 0 / .75), 0 2px 8px rgb(0 0 0 / .4);
}

/* ── Page base ──────────────────────────────────────────────────────────── */
.mk { font-family: var(--mk-sans); color: var(--mk-text); background: var(--mk-bg); -webkit-font-smoothing: antialiased; overflow-x: clip; }
.mk a { color: inherit; }
.mk ::selection { background: var(--mk-accent-ring); }
/* kit.js hides OS-specific elements with the hidden attribute; a class that
   sets display (.mk-store, .mk-btn) would otherwise override it. */
.mk [hidden] { display: none !important; }
.mk-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.mk-wrap--narrow { max-width: 860px; }
.mk-section { padding: clamp(72px, 9vw, 128px) 0; border-top: 1px solid var(--mk-line); background: var(--mk-bg); }
.mk-section--white { background: var(--mk-bg-2); }
.mk-section--flush { border-top: 0; }
.mk-section--tight { padding: clamp(48px, 6vw, 80px) 0; }

/* ── Type ───────────────────────────────────────────────────────────────── */
.mk-eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1 var(--mk-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--mk-accent-2); margin: 0 0 18px; }
html[data-theme="dark"] .mk-eyebrow { color: var(--mk-accent-2); }
.mk-eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--mk-accent); }
.mk-eyebrow--plain::before { display: none; }
.mk-h1 { font: 400 clamp(2.9rem, 6.6vw, 5.4rem)/1.0 var(--mk-serif); letter-spacing: -.025em; color: var(--mk-ink); margin: 0; text-wrap: balance; }
.mk-h1 em, .mk-h2 em { font-style: italic; color: var(--mk-accent); }
.mk-h2 { font: 400 clamp(2.1rem, 4.4vw, 3.5rem)/1.06 var(--mk-serif); letter-spacing: -.02em; color: var(--mk-ink); margin: 0 0 18px; text-wrap: balance; }
.mk-h3 { font: 600 1.3rem/1.3 var(--mk-sans); letter-spacing: -.01em; color: var(--mk-ink); margin: 0 0 10px; }
.mk-h4 { font: 600 1.02rem/1.35 var(--mk-sans); color: var(--mk-ink); margin: 0 0 6px; }
.mk-lede { font-size: clamp(1.06rem, 1.5vw, 1.22rem); line-height: 1.6; color: var(--mk-text); margin: 0; max-width: 640px; text-wrap: pretty; }
.mk-p { font-size: 1rem; line-height: 1.65; color: var(--mk-text); margin: 0 0 14px; }
.mk-small { font-size: .9rem; line-height: 1.55; color: var(--mk-muted); margin: 0; }
.mk-center { text-align: center; }
.mk-center .mk-lede { margin-left: auto; margin-right: auto; }
.mk-head { max-width: 760px; margin: 0 0 clamp(36px, 5vw, 56px); }
.mk-head.mk-center { margin-left: auto; margin-right: auto; }
.mk-link { color: var(--mk-accent); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.mk-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.mk-link svg { transition: transform .2s var(--mk-ease); }
.mk-link:hover svg { transform: translateX(3px); }
.mk-beta { display: inline-block; font: 600 10px/1 var(--mk-sans); letter-spacing: .05em; text-transform: uppercase; padding: 4px 6px; border-radius: 4px; background: var(--mk-accent-soft); color: var(--mk-accent-2); vertical-align: middle; margin-left: 6px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.mk-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 32px; }
.mk-center .mk-actions { justify-content: center; }
.mk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; font: 500 1rem/1 var(--mk-sans); text-decoration: none !important; cursor: pointer; border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s, transform .2s var(--mk-ease), box-shadow .2s; white-space: nowrap; }
.mk-btn--primary { background: var(--mk-ink); color: var(--mk-bg) !important; }
.mk-btn--primary:hover { background: var(--mk-accent); color: #fff !important; transform: translateY(-1px); box-shadow: 0 10px 28px -10px rgb(79 70 229 / .55); }
html[data-theme="dark"] .mk-btn--primary { background: #f1f5f9; color: #0b1120 !important; }
html[data-theme="dark"] .mk-btn--primary:hover { background: #818cf8; color: #fff !important; }
.mk-btn--ghost { background: transparent; color: var(--mk-ink) !important; border-color: var(--mk-line-2); }
.mk-btn--ghost:hover { border-color: var(--mk-accent); color: var(--mk-accent) !important; }
.mk-btn--sm { min-height: 38px; padding: 0 16px; font-size: .92rem; }
.mk-btn:focus-visible, .mk-tab:focus-visible, .mk-faq summary:focus-visible, .mk-store:focus-visible { outline: 2px solid var(--mk-accent); outline-offset: 3px; }
.mk-textlink { font-size: .95rem; color: var(--mk-text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 4px; }
.mk-textlink:hover { color: var(--mk-accent); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.mk-hero { position: relative; padding: clamp(56px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); background: var(--mk-bg); overflow: hidden; }
.mk-hero::before { content: ''; position: absolute; inset: -20% -10% auto; height: 760px; background: radial-gradient(50% 50% at 50% 40%, rgb(79 70 229 / .09), transparent 70%); pointer-events: none; }
html[data-theme="dark"] .mk-hero::before { background: radial-gradient(50% 50% at 50% 40%, rgb(129 140 248 / .14), transparent 70%); }
.mk-hero > .mk-wrap { position: relative; }
.mk-hero__copy { max-width: 900px; margin: 0 auto; text-align: center; }
.mk-hero__copy .mk-lede { margin: 26px auto 0; max-width: 680px; }
.mk-hero__copy .mk-actions { justify-content: center; }
.mk-hero__visual { margin-top: clamp(40px, 6vw, 72px); }
.mk-hero--split .mk-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.mk-hero--split .mk-hero__copy { text-align: left; margin: 0; }
.mk-hero--split .mk-hero__copy .mk-lede { margin-left: 0; }
.mk-hero--split .mk-hero__copy .mk-actions { justify-content: flex-start; }
.mk-hero--split .mk-hero__visual { margin-top: 0; }
.mk-hero__meta { margin-top: 18px; font-size: .88rem; color: var(--mk-muted); }

/* ── Grids, rows, cards ─────────────────────────────────────────────────── */
.mk-grid { display: grid; gap: 20px; }
.mk-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mk-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mk-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mk-card { background: var(--mk-bg-2); border: 1px solid var(--mk-line); border-radius: var(--mk-radius-lg); padding: 26px; }
.mk-card--link { text-decoration: none !important; display: flex; flex-direction: column; transition: border-color .2s, transform .25s var(--mk-ease), box-shadow .25s; }
.mk-card--link:hover { border-color: var(--mk-accent-ring); transform: translateY(-2px); box-shadow: var(--mk-shadow); }
.mk-card--link .mk-link { margin-top: auto; padding-top: 14px; }
.mk-card p { margin: 0; font-size: .96rem; line-height: 1.6; color: var(--mk-text); }
.mk-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--mk-accent-soft); color: var(--mk-accent); margin-bottom: 16px; }
.mk-icon svg { width: 20px; height: 20px; }

.mk-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.mk-row + .mk-row { margin-top: clamp(72px, 9vw, 120px); }
.mk-row--flip > :first-child { order: 2; }
.mk-row__copy { max-width: 500px; }
.mk-row__copy .mk-h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
.mk-bullets { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.mk-bullets li { position: relative; padding-left: 30px; font-size: .98rem; line-height: 1.55; color: var(--mk-text); }
.mk-bullets li::before { content: ''; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--mk-accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234F46E5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat; }
.mk-bullets strong { color: var(--mk-ink); font-weight: 600; }
.mk-row__copy .mk-link { margin-top: 24px; }

/* ── Stats ──────────────────────────────────────────────────────────────── */
.mk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--mk-line); border-radius: var(--mk-radius-lg); background: var(--mk-bg-2); overflow: hidden; }
.mk-stat { padding: 28px 26px; border-left: 1px solid var(--mk-line); }
.mk-stat:first-child { border-left: 0; }
.mk-stat__num { font: 400 clamp(2.4rem, 4vw, 3.2rem)/1 var(--mk-serif); color: var(--mk-ink); letter-spacing: -.02em; }
.mk-stat__label { margin-top: 10px; font-size: .92rem; line-height: 1.45; color: var(--mk-muted); }

/* ── Surfaces strip ─────────────────────────────────────────────────────── */
.mk-surfaces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mk-surface { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--mk-radius); background: var(--mk-bg-2); border: 1px solid var(--mk-line); text-decoration: none !important; transition: border-color .2s, transform .25s var(--mk-ease); }
.mk-surface:hover { border-color: var(--mk-accent-ring); transform: translateY(-2px); }
.mk-surface svg { width: 22px; height: 22px; color: var(--mk-ink); }
.mk-surface strong { font: 600 .98rem/1.3 var(--mk-sans); color: var(--mk-ink); }
.mk-surface span { font-size: .86rem; line-height: 1.45; color: var(--mk-muted); }

/* ── Connector wall ─────────────────────────────────────────────────────── */
.mk-wall { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.mk-chip { display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border: 1px solid var(--mk-line); border-radius: 999px; background: var(--mk-bg-2); font: 500 .94rem/1 var(--mk-sans); color: var(--mk-ink); }
.mk-chip i { width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--mk-accent)); flex: none; }
.mk-chip small { font: 600 10px/1 var(--mk-sans); letter-spacing: .05em; text-transform: uppercase; color: var(--mk-muted); }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.mk-tablist { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--mk-line); border-radius: 999px; background: var(--mk-bg-2); width: max-content; max-width: 100%; margin: 0 auto 32px; }
.mk-tab { appearance: none; border: 0; background: transparent; padding: 10px 18px; border-radius: 999px; font: 500 .95rem/1 var(--mk-sans); color: var(--mk-text); cursor: pointer; transition: background .2s, color .2s; }
.mk-tab:hover { color: var(--mk-ink); }
.mk-tab[aria-selected="true"] { background: var(--mk-ink); color: var(--mk-bg); }
html[data-theme="dark"] .mk-tab[aria-selected="true"] { background: #f1f5f9; color: #0b1120; }
.mk-tabpanel[hidden] { display: none; }
.mk-tabpanel { animation: mk-fade .35s var(--mk-ease); }
@keyframes mk-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.mk-faq { max-width: 860px; margin: 0 auto; border-top: 1px solid var(--mk-line); }
.mk-faq details { border-bottom: 1px solid var(--mk-line); }
.mk-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 4px; font: 500 1.08rem/1.4 var(--mk-sans); color: var(--mk-ink); }
.mk-faq summary::-webkit-details-marker { display: none; }
.mk-faq summary::after { content: ''; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--mk-line-2); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 12px no-repeat; transition: transform .25s var(--mk-ease); }
.mk-faq details[open] summary::after { transform: rotate(45deg); }
.mk-faq .mk-faq__a { padding: 0 4px 24px; font-size: 1rem; line-height: 1.7; color: var(--mk-text); max-width: 760px; }
.mk-faq .mk-faq__a p { margin: 0 0 10px; }
.mk-faq .mk-faq__a a { color: var(--mk-accent); }

/* ── Dark band (governance) ─────────────────────────────────────────────── */
.mk-band { background: var(--mk-band); color: var(--mk-band-text); padding: clamp(80px, 10vw, 136px) 0; position: relative; overflow: hidden; }
.mk-band::before { content: ''; position: absolute; inset: auto -20% -40% auto; width: 900px; height: 900px; background: radial-gradient(closest-side, rgb(99 102 241 / .22), transparent 70%); pointer-events: none; }
.mk-band .mk-h2, .mk-band .mk-h3, .mk-band .mk-h4 { color: #fafaf9; }
.mk-band .mk-h2 em { color: #a5b4fc; }
.mk-band .mk-lede, .mk-band .mk-p, .mk-band .mk-bullets li { color: #c9c5c1; }
.mk-band .mk-eyebrow { color: #a5b4fc; }
.mk-band .mk-eyebrow::before { background: #818cf8; }
.mk-band .mk-bullets strong { color: #fafaf9; }
.mk-band .mk-bullets li::before { background-color: rgb(129 140 248 / .2); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5b4fc' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E"); }
.mk-band .mk-link { color: #a5b4fc; }
.mk-band .mk-btn--ghost { color: #fafaf9 !important; border-color: rgb(255 255 255 / .22); }
.mk-band .mk-btn--ghost:hover { border-color: #a5b4fc; color: #a5b4fc !important; }

/* ── Final CTA ──────────────────────────────────────────────────────────── */
.mk-final { text-align: center; padding: clamp(80px, 10vw, 128px) 0; background: var(--mk-bg); border-top: 1px solid var(--mk-line); }
.mk-final .mk-h2 { font-size: clamp(2.4rem, 5vw, 4rem); }
.mk-final .mk-lede { margin: 0 auto; }

/* ── Store badges + download ────────────────────────────────────────────── */
.mk-stores { display: flex; flex-wrap: wrap; gap: 12px; }
.mk-center .mk-stores { justify-content: center; }
.mk-store { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 20px 8px 16px; border-radius: 12px; background: #0C0A09; color: #fff !important; text-decoration: none !important; border: 1px solid #0C0A09; transition: transform .2s var(--mk-ease), box-shadow .2s; }
.mk-store:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px rgb(0 0 0 / .5); }
html[data-theme="dark"] .mk-store { background: #000; border-color: rgb(255 255 255 / .2); }
.mk-store svg { width: 26px; height: 26px; flex: none; }
.mk-store span { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.mk-store small { font: 500 11px/1.2 var(--mk-sans); opacity: .8; }
.mk-store b { font: 600 17px/1.15 var(--mk-sans); letter-spacing: -.01em; }

/* ── Product illustration: shared ───────────────────────────────────────── */
.ui-figure { margin: 0; position: relative; }
.ui-figure figcaption { margin-top: 14px; font-size: .8rem; color: var(--mk-muted); text-align: center; }
.ui-stage { position: relative; padding: clamp(14px, 3vw, 36px); border-radius: var(--mk-radius-xl); background: linear-gradient(160deg, #EEF2FF 0%, #F5F3FF 45%, #FDF4FF 100%); border: 1px solid #E0E7FF; }
.ui-stage--warm { background: linear-gradient(160deg, #FFF7ED 0%, #FAFAF9 55%, #F5F5F4 100%); border-color: #F1E7DD; }
.ui-stage--plain { background: var(--mk-bg-3); border-color: var(--mk-line); }
html[data-theme="dark"] .ui-stage { background: linear-gradient(160deg, rgb(79 70 229 / .22), rgb(15 24 41 / .9) 60%); border-color: #1e3050; }

.ui { font-family: var(--mk-ui); font-size: 13px; line-height: 1.45; color: #292524; text-align: left; letter-spacing: -.003em; }
html[data-theme="dark"] .ui { color: #e2e8f0; }
.ui * { box-sizing: border-box; }
/* Safety net: an icon with no size of its own inside an illustration falls
   back to 300x150 (the SVG default) and swamps the mockup. Cap it. */
.ui svg:not([width]):not(.cv-diagram), .mk-cap__viz svg:not([width]):not(.cv-diagram) { max-width: 20px; max-height: 20px; }
.ui-window { container-type: inline-size; background: #fff; border: 1px solid #E7E5E4; border-radius: 14px; box-shadow: var(--mk-shadow-lg); overflow: hidden; }
html[data-theme="dark"] .ui-window { background: #0f1829; border-color: #22324f; }

/* Title bar: the desktop app's own borderless bar (back/forward, logo, Work | Code). */
.ui-titlebar { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 6px 0 12px; border-bottom: 1px solid #F0EFEE; background: #FAFAF9; }
html[data-theme="dark"] .ui-titlebar { background: #0c1424; border-color: #1b2a45; }
.ui-titlebar__nav { display: flex; gap: 2px; color: #A8A29E; }
.ui-titlebar__nav svg { width: 14px; height: 14px; }
.ui-titlebar__brand { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; color: #1C1917; }
html[data-theme="dark"] .ui-titlebar__brand { color: #f1f5f9; }
.ui-mark { width: 16px; height: 16px; background: #111113; -webkit-mask: url('/renly-mark.png') center / contain no-repeat; mask: url('/renly-mark.png') center / contain no-repeat; flex: none; }
html[data-theme="dark"] .ui-mark { background: #fff; }
.ui-seg { margin: 0 auto; display: inline-flex; padding: 2px; border-radius: 7px; background: #F0EFEE; font-size: 11.5px; font-weight: 500; }
html[data-theme="dark"] .ui-seg { background: #16233b; }
.ui-seg span { padding: 3px 12px; border-radius: 5px; color: #78716C; }
.ui-seg span.is-on { background: #fff; color: #1C1917; box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
html[data-theme="dark"] .ui-seg span.is-on { background: #22324f; color: #f1f5f9; }
.ui-winctl { display: flex; color: #A8A29E; }
.ui-winctl span { width: 34px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }
.ui-winctl svg { width: 11px; height: 11px; }
.ui-titlebar--browser .ui-url { margin: 0 auto; display: inline-flex; align-items: center; gap: 6px; min-width: 40%; justify-content: center; padding: 4px 14px; border-radius: 999px; background: #F0EFEE; color: #57534E; font-size: 11.5px; }
html[data-theme="dark"] .ui-titlebar--browser .ui-url { background: #16233b; color: #94a3b8; }
.ui-dots { display: flex; gap: 6px; }
.ui-dots i { width: 10px; height: 10px; border-radius: 50%; background: #E7E5E4; }

.ui-body { display: grid; grid-template-columns: 196px minmax(0, 1fr); min-height: 420px; }
.ui-body--noside { grid-template-columns: minmax(0, 1fr); }
/* .ui-window prefix: these must beat the .ui-side and .ui-body rules that
   come later in this file, or a phone gets the desktop sidebar. */
@container (max-width: 700px) { .ui-window .ui-body { grid-template-columns: minmax(0, 1fr); } .ui-window .ui-side { display: none; } }

/* Sidebar: the app's navigation (appNavigation.ts), in its order. */
.ui-side { border-right: 1px solid #F0EFEE; background: #FAFAF9; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
html[data-theme="dark"] .ui-side { background: #0c1424; border-color: #1b2a45; }
.ui-newchat { display: flex; align-items: center; gap: 7px; padding: 7px 10px; margin-bottom: 8px; border: 1px solid #E7E5E4; border-radius: 8px; background: #fff; font-weight: 500; color: #292524; }
html[data-theme="dark"] .ui-newchat { background: #131c2e; border-color: #22324f; color: #e2e8f0; }
.ui-newchat svg { width: 13px; height: 13px; }
.ui-nav { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 7px; color: #57534E; }
html[data-theme="dark"] .ui-nav { color: #94a3b8; }
.ui-nav svg { width: 14px; height: 14px; flex: none; }
.ui-nav.is-on { background: #EEF2FF; color: #4338CA; font-weight: 500; }
html[data-theme="dark"] .ui-nav.is-on { background: rgb(129 140 248 / .16); color: #c7d2fe; }
.ui-nav b { margin-left: auto; font: 600 9px/1 var(--mk-ui); letter-spacing: .04em; text-transform: uppercase; color: #A8A29E; }
.ui-side__label { margin: 14px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #A8A29E; }
.ui-recent { padding: 5px 10px; border-radius: 6px; color: #57534E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
html[data-theme="dark"] .ui-recent { color: #94a3b8; }
.ui-recent.is-on { background: #F0EFEE; color: #1C1917; }
html[data-theme="dark"] .ui-recent.is-on { background: #16233b; color: #e2e8f0; }

/* Main column */
.ui-main { display: flex; flex-direction: column; min-width: 0; background: #fff; }
html[data-theme="dark"] .ui-main { background: #0f1829; }
.ui-mainhead { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-bottom: 1px solid #F0EFEE; font-weight: 600; color: #1C1917; }
html[data-theme="dark"] .ui-mainhead { color: #f1f5f9; border-color: #1b2a45; }
.ui-mainhead small { font-weight: 400; color: #78716C; }
.ui-mainhead .ui-pill { margin-left: auto; }
.ui-thread { flex: 1; padding: 18px 20px 8px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
/* Anchored to the bottom like a live chat: new turns push older ones up and
   out of the frame instead of growing the illustration. */
.ui-thread--anchored { justify-content: flex-start; min-height: 0; }
/* margin-top:auto sits a short thread at the bottom; a long one is kept
   scrolled to its newest message by kit.js (flex-end alone lets Chrome clip
   the bottom once the thread overflows). */
.ui-thread--anchored > :first-child { margin-top: auto; }
.ui-body--hero { height: 560px; }
.ui-body--hero .ui-main { min-height: 0; }
.ui-body--md { height: 470px; }
@container (max-width: 700px) { .ui-body--hero { height: 520px; } }

.ui-msg-user { align-self: flex-end; max-width: 78%; padding: 9px 13px; border-radius: 14px 14px 4px 14px; background: #F5F5F4; color: #1C1917; }
html[data-theme="dark"] .ui-msg-user { background: #1b2a45; color: #f1f5f9; }
.ui-msg-agent { display: flex; gap: 10px; max-width: 100%; }
.ui-avatar { width: 26px; height: 26px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #6366F1, #8B5CF6); }
.ui-avatar--green { background: linear-gradient(135deg, #10B981, #059669); }
.ui-avatar--amber { background: linear-gradient(135deg, #F59E0B, #EA580C); }
.ui-avatar--blue { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.ui-msg-agent__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ui-who { font-size: 11.5px; font-weight: 600; color: #57534E; }
html[data-theme="dark"] .ui-who { color: #94a3b8; }
.ui-who span { font-weight: 400; color: #A8A29E; }
.ui-text { color: #292524; }
html[data-theme="dark"] .ui-text { color: #e2e8f0; }
.ui-text b { font-weight: 600; }

/* Work log: the agent's tool steps (MessageActivityTrail). */
.ui-log { border: 1px solid #F0EFEE; border-radius: 10px; background: #FAFAF9; padding: 6px 10px; display: flex; flex-direction: column; gap: 1px; }
html[data-theme="dark"] .ui-log { background: #0c1424; border-color: #1b2a45; }
.ui-step { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; color: #57534E; }
html[data-theme="dark"] .ui-step { color: #94a3b8; }
.ui-step__ico { width: 16px; height: 16px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #DCFCE7; color: #15803D; }
html[data-theme="dark"] .ui-step__ico { background: rgb(34 197 94 / .16); color: #4ade80; }
.ui-step__ico svg { width: 10px; height: 10px; }
.ui-step__ico--run { background: transparent; border: 2px solid #C7D2FE; border-top-color: #4F46E5; animation: ui-spin .9s linear infinite; }
.ui-step__ico--wait { background: #FEF3C7; color: #B45309; }
html[data-theme="dark"] .ui-step__ico--wait { background: rgb(245 158 11 / .16); color: #fbbf24; }
.ui-step__ico--fail { background: #FEE2E2; color: #B91C1C; }
.ui-step code { font-family: var(--mk-mono); font-size: 11px; color: #44403C; background: #F0EFEE; padding: 1px 5px; border-radius: 4px; }
html[data-theme="dark"] .ui-step code { background: #16233b; color: #cbd5e1; }
.ui-step em { font-style: normal; margin-left: auto; color: #A8A29E; font-size: 11px; white-space: nowrap; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* Approval card (ApprovalCard.tsx): amber container, white details, green Approve. */
.ui-approval { border: 1px solid #FDE68A; background: #FFFBEB; border-radius: 10px; padding: 12px; }
html[data-theme="dark"] .ui-approval { background: rgb(245 158 11 / .08); border-color: rgb(245 158 11 / .32); }
.ui-approval__head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; font-weight: 600; font-size: 12.5px; color: #B45309; }
html[data-theme="dark"] .ui-approval__head { color: #fcd34d; }
.ui-approval__head svg { width: 15px; height: 15px; color: #F59E0B; }
.ui-approval__head small { margin-left: auto; font-weight: 400; font-size: 11px; color: rgb(180 83 9 / .7); }
.ui-approval__box { background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
html[data-theme="dark"] .ui-approval__box { background: #131c2e; }
.ui-approval__title { display: flex; align-items: center; gap: 7px; font-weight: 600; color: #1C1917; margin-bottom: 6px; }
html[data-theme="dark"] .ui-approval__title { color: #f1f5f9; }
.ui-approval__title svg { width: 14px; height: 14px; color: #4F46E5; }
.ui-approval__reason { font-style: italic; color: #57534E; font-size: 12px; margin-bottom: 8px; }
html[data-theme="dark"] .ui-approval__reason { color: #94a3b8; }
.ui-email { border: 1px solid #E7E5E4; border-radius: 8px; overflow: hidden; }
html[data-theme="dark"] .ui-email { border-color: #22324f; }
.ui-email__row { display: flex; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #F0EFEE; font-size: 12px; }
html[data-theme="dark"] .ui-email__row { border-color: #1b2a45; }
.ui-email__row b { width: 48px; flex: none; font-weight: 500; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: #78716C; padding-top: 1px; }
.ui-email__row span { color: #1C1917; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-theme="dark"] .ui-email__row span { color: #f1f5f9; }
.ui-email__body { padding: 9px 10px; font-size: 12px; line-height: 1.55; color: #44403C; }
html[data-theme="dark"] .ui-email__body { color: #cbd5e1; }
.ui-email__body p { margin: 0 0 6px; }
.ui-email__body p:last-child { margin: 0; }
.ui-mark-ph { background: #FEF3C7; color: #92400E; border-radius: 3px; padding: 0 3px; }
html[data-theme="dark"] .ui-mark-ph { background: rgb(245 158 11 / .2); color: #fcd34d; }
.ui-diff { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; font-size: 12px; }
.ui-diff b { font-weight: 500; color: #57534E; }
html[data-theme="dark"] .ui-diff b { color: #94a3b8; }
.ui-old { color: #B91C1C; text-decoration: line-through; margin-right: 6px; }
.ui-new { background: #DCFCE7; color: #15803D; border-radius: 4px; padding: 0 5px; }
html[data-theme="dark"] .ui-new { background: rgb(34 197 94 / .16); color: #4ade80; }
html[data-theme="dark"] .ui-old { color: #f87171; }
.ui-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ui-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 6px; font-weight: 500; font-size: 12px; border: 1px solid transparent; transition: transform .15s, box-shadow .15s, background .15s; }
.ui-btn svg { width: 13px; height: 13px; }
.ui-btn--ok { background: #16A34A; color: #fff; }
.ui-btn--ok.is-pressed { background: #15803D; transform: scale(.96); box-shadow: 0 0 0 4px rgb(22 163 74 / .22); }
.ui-btn--edit { background: #DBEAFE; color: #1D4ED8; }
html[data-theme="dark"] .ui-btn--edit { background: rgb(59 130 246 / .18); color: #93c5fd; }
.ui-btn--line { border-color: #BBF7D0; color: #15803D; background: transparent; }
.ui-btn--no { background: #F5F5F4; color: #44403C; }
html[data-theme="dark"] .ui-btn--no { background: #1b2a45; color: #e2e8f0; }
.ui-btn--dark { background: #1C1917; color: #fff; }
.ui-btn--primary { background: #4F46E5; color: #fff; }
.ui-note { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #78716C; margin-top: 8px; }
.ui-note svg { width: 12px; height: 12px; flex: none; }

/* Outcome + sealed record chip (EvidencePassportPanel). */
.ui-done { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 9px; background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; font-size: 12px; font-weight: 500; }
html[data-theme="dark"] .ui-done { background: rgb(34 197 94 / .1); border-color: rgb(34 197 94 / .3); color: #86efac; }
.ui-done svg { width: 14px; height: 14px; flex: none; }
.ui-seal { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 8px; border-radius: 999px; background: #EEF2FF; border: 1px solid #C7D2FE; color: #3730A3; font-size: 11.5px; font-weight: 500; width: max-content; max-width: 100%; }
html[data-theme="dark"] .ui-seal { background: rgb(129 140 248 / .14); border-color: rgb(129 140 248 / .35); color: #c7d2fe; }
.ui-seal svg { width: 13px; height: 13px; flex: none; }
.ui-seal code { font-family: var(--mk-mono); font-size: 10.5px; opacity: .8; }

/* Artefact card in chat (a generated file). */
.ui-file { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid #E7E5E4; border-radius: 10px; background: #fff; max-width: 360px; }
html[data-theme="dark"] .ui-file { background: #131c2e; border-color: #22324f; }
.ui-file__ico { width: 30px; height: 34px; border-radius: 5px; flex: none; display: inline-flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; color: #fff; font-size: 8.5px; font-weight: 700; letter-spacing: .03em; }
.ui-file__ico--xlsx { background: #15803D; }
.ui-file__ico--pptx { background: #C2410C; }
.ui-file__ico--docx { background: #1D4ED8; }
.ui-file__ico--pdf { background: #B91C1C; }
.ui-file b { display: block; font-weight: 600; color: #1C1917; font-size: 12.5px; }
html[data-theme="dark"] .ui-file b { color: #f1f5f9; }
.ui-file span { font-size: 11px; color: #78716C; }

/* Composer */
.ui-composer { margin: 8px 16px 14px; border: 1px solid #E7E5E4; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .04); padding: 10px 12px 8px; }
html[data-theme="dark"] .ui-composer { background: #131c2e; border-color: #22324f; }
.ui-composer__text { min-height: 20px; color: #1C1917; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-theme="dark"] .ui-composer__text { color: #f1f5f9; }
.ui-composer__text:empty::before { content: attr(data-placeholder); color: #A8A29E; }
.ui-ph { color: #A8A29E; }
.ui-composer__bar { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: #78716C; font-size: 11.5px; }
.ui-composer__bar svg { width: 14px; height: 14px; }
.ui-composer__send { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; background: #1C1917; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
html[data-theme="dark"] .ui-composer__send { background: #f1f5f9; color: #0b1120; }
.ui-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; border: 1px solid #E7E5E4; background: #fff; font-size: 11px; color: #57534E; white-space: nowrap; }
html[data-theme="dark"] .ui-pill { background: #131c2e; border-color: #22324f; color: #94a3b8; }
.ui-pill svg { width: 11px; height: 11px; }
.ui-caret { display: inline-block; width: 1.5px; height: 14px; background: #4F46E5; vertical-align: -2px; margin-left: 1px; animation: ui-blink 1s step-start infinite; }
@keyframes ui-blink { 50% { opacity: 0; } }

/* Badges used across lists */
.ui-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 5px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.ui-badge--task { background: #ECFDF5; color: #047857; }
.ui-badge--workflow { background: #F5F3FF; color: #6D28D9; }
.ui-badge--objective { background: #EEF2FF; color: #4338CA; }
html[data-theme="dark"] .ui-badge--task { background: rgb(16 185 129 / .16); color: #6ee7b7; }
html[data-theme="dark"] .ui-badge--workflow { background: rgb(139 92 246 / .18); color: #c4b5fd; }
html[data-theme="dark"] .ui-badge--objective { background: rgb(99 102 241 / .2); color: #c7d2fe; }
.ui-badge--ok { background: #DCFCE7; color: #166534; }
.ui-badge--wait { background: #FEF3C7; color: #92400E; }
.ui-badge--muted { background: #F5F5F4; color: #57534E; }
.ui-badge--beta { background: #EEF2FF; color: #4338CA; font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
html[data-theme="dark"] .ui-badge--ok { background: rgb(34 197 94 / .16); color: #86efac; }
html[data-theme="dark"] .ui-badge--wait { background: rgb(245 158 11 / .16); color: #fcd34d; }
html[data-theme="dark"] .ui-badge--muted { background: #1b2a45; color: #94a3b8; }

/* Automations list (MyWorkflowsPage) */
.ui-list { padding: 8px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.ui-li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid #F0EFEE; border-radius: 10px; background: #fff; }
html[data-theme="dark"] .ui-li { background: #131c2e; border-color: #1b2a45; }
.ui-li__ico { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: #F5F5F4; color: #57534E; }
html[data-theme="dark"] .ui-li__ico { background: #1b2a45; color: #cbd5e1; }
.ui-li__ico svg { width: 15px; height: 15px; }
.ui-li b { display: flex; align-items: center; gap: 7px; font-weight: 600; color: #1C1917; font-size: 12.8px; }
html[data-theme="dark"] .ui-li b { color: #f1f5f9; }
.ui-li span { display: block; color: #78716C; font-size: 11.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-li__end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: #78716C; white-space: nowrap; }
.ui-li.is-hl { border-color: #C7D2FE; box-shadow: 0 0 0 3px rgb(99 102 241 / .1); }
.ui-tabs { display: flex; gap: 4px; padding: 10px 14px 4px; border-bottom: 1px solid #F0EFEE; }
html[data-theme="dark"] .ui-tabs { border-color: #1b2a45; }
.ui-tabs span { padding: 6px 10px 9px; color: #78716C; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ui-tabs span.is-on { color: #1C1917; border-color: #4F46E5; }
html[data-theme="dark"] .ui-tabs span.is-on { color: #f1f5f9; border-color: #818cf8; }

/* Run timeline */
.ui-run { padding: 14px 18px; display: flex; flex-direction: column; }
.ui-run__step { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; padding: 8px 0 14px; }
.ui-run__step::before { content: ''; position: absolute; left: 10px; top: 28px; bottom: -4px; width: 2px; background: #E7E5E4; }
html[data-theme="dark"] .ui-run__step::before { background: #22324f; }
.ui-run__step:last-child::before { display: none; }
.ui-run__dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #DCFCE7; color: #15803D; position: relative; z-index: 1; }
.ui-run__dot svg { width: 12px; height: 12px; }
.ui-run__dot--wait { background: #FEF3C7; color: #B45309; }
.ui-run__dot--run { background: #EEF2FF; color: #4F46E5; }
.ui-run__dot--todo { background: #F5F5F4; color: #A8A29E; }
html[data-theme="dark"] .ui-run__dot { background: rgb(34 197 94 / .16); color: #4ade80; }
html[data-theme="dark"] .ui-run__dot--wait { background: rgb(245 158 11 / .16); color: #fbbf24; }
html[data-theme="dark"] .ui-run__dot--run { background: rgb(129 140 248 / .2); color: #a5b4fc; }
html[data-theme="dark"] .ui-run__dot--todo { background: #1b2a45; color: #64748b; }
.ui-run__step b { display: block; font-weight: 600; color: #1C1917; }
html[data-theme="dark"] .ui-run__step b { color: #f1f5f9; }
.ui-run__step span { display: block; font-size: 11.8px; color: #78716C; margin-top: 2px; }
.ui-run__step em { font-style: normal; font-size: 11px; color: #A8A29E; white-space: nowrap; }

/* Evidence passport */
.ui-passport { border: 1px solid #E7E5E4; border-radius: 12px; background: #fff; overflow: hidden; }
html[data-theme="dark"] .ui-passport { background: #131c2e; border-color: #22324f; }
.ui-passport__head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid #F0EFEE; font-weight: 600; color: #1C1917; }
html[data-theme="dark"] .ui-passport__head { color: #f1f5f9; border-color: #1b2a45; }
.ui-passport__head svg { width: 15px; height: 15px; color: #4F46E5; }
.ui-passport__views { margin-left: auto; display: inline-flex; gap: 2px; font-size: 11px; font-weight: 500; }
.ui-passport__views span { padding: 3px 8px; border-radius: 5px; color: #78716C; }
.ui-passport__views span.is-on { background: #F5F5F4; color: #1C1917; }
html[data-theme="dark"] .ui-passport__views span.is-on { background: #1b2a45; color: #f1f5f9; }
.ui-kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 0; font-size: 12px; }
.ui-kv > div { padding: 7px 14px; border-bottom: 1px solid #F5F5F4; }
html[data-theme="dark"] .ui-kv > div { border-color: #1b2a45; }
.ui-kv > div:nth-child(odd) { color: #78716C; }
.ui-kv > div:nth-child(even) { color: #1C1917; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-theme="dark"] .ui-kv > div:nth-child(even) { color: #e2e8f0; }
.ui-kv code { font-family: var(--mk-mono); font-size: 11px; font-weight: 400; }
.ui-passport__foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #FAFAF9; font-size: 11.5px; color: #57534E; }
html[data-theme="dark"] .ui-passport__foot { background: #0c1424; color: #94a3b8; }
.ui-passport__foot .ui-btn { margin-left: auto; }
.ui-chain { display: flex; align-items: center; gap: 6px; padding: 12px 14px; overflow: hidden; }
.ui-chain i { flex: none; width: 34px; height: 24px; border-radius: 6px; border: 1px solid #C7D2FE; background: #EEF2FF; position: relative; }
.ui-chain i::after { content: ''; position: absolute; left: 100%; top: 50%; width: 6px; height: 2px; background: #C7D2FE; }
.ui-chain i:last-child::after { display: none; }
.ui-chain i.is-new { background: #4F46E5; border-color: #4F46E5; box-shadow: 0 0 0 4px rgb(79 70 229 / .18); }
html[data-theme="dark"] .ui-chain i { background: rgb(129 140 248 / .14); border-color: rgb(129 140 248 / .4); }

/* Desktop quick ask (Ctrl+Alt+R) */
.ui-quick { width: min(100%, 560px); margin: 0 auto; border-radius: 16px; background: rgb(255 255 255 / .92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgb(255 255 255 / .8); box-shadow: 0 30px 80px -24px rgb(28 25 23 / .45), 0 0 0 1px rgb(28 25 23 / .06); overflow: hidden; }
html[data-theme="dark"] .ui-quick { background: rgb(19 28 46 / .94); border-color: #22324f; box-shadow: 0 30px 80px -24px rgb(0 0 0 / .8); }
.ui-quick__in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-size: 14.5px; color: #1C1917; }
html[data-theme="dark"] .ui-quick__in { color: #f1f5f9; }
.ui-quick__in .ui-mark { width: 18px; height: 18px; }
.ui-quick__in .ui-pill { margin-left: auto; }
.ui-kbd { display: inline-flex; gap: 3px; }
.ui-kbd kbd { font: 500 10.5px/1 var(--mk-ui); padding: 3px 5px; border-radius: 4px; border: 1px solid #D6D3D1; border-bottom-width: 2px; background: #fff; color: #44403C; }
html[data-theme="dark"] .ui-kbd kbd { background: #1b2a45; border-color: #2a3d5e; color: #cbd5e1; }
.ui-quick__out { border-top: 1px solid #F0EFEE; padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
html[data-theme="dark"] .ui-quick__out { border-color: #1b2a45; }
.ui-desk { position: relative; border-radius: var(--mk-radius-xl); padding: clamp(28px, 6vw, 64px) clamp(14px, 4vw, 48px); background: radial-gradient(120% 100% at 0% 0%, #C7D2FE 0%, #EDE9FE 35%, #FCE7F3 70%, #FFEDD5 100%); overflow: hidden; }
html[data-theme="dark"] .ui-desk { background: radial-gradient(120% 100% at 0% 0%, #312E81 0%, #1E1B4B 40%, #0F172A 100%); }
.ui-desk__taskbar { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: flex; gap: 8px; padding: 6px 10px; border-radius: 10px 10px 0 0; background: rgb(255 255 255 / .55); backdrop-filter: blur(10px); }
html[data-theme="dark"] .ui-desk__taskbar { background: rgb(15 23 42 / .6); }
.ui-desk__taskbar i { width: 22px; height: 22px; border-radius: 6px; background: rgb(28 25 23 / .14); }
.ui-desk__taskbar i.is-on { background: #111113 url('/renly-mark-white.png') center / 14px no-repeat; }

/* Capability + consent cards (DesktopCapabilityCard) */
.ui-cap { border: 1px solid #E7E5E4; border-radius: 12px; background: #fff; padding: 14px; }
html[data-theme="dark"] .ui-cap { background: #131c2e; border-color: #22324f; }
.ui-cap h5 { margin: 0 0 10px; font: 600 13px/1.3 var(--mk-ui); color: #1C1917; }
html[data-theme="dark"] .ui-cap h5 { color: #f1f5f9; }
.ui-cap__row { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid #F5F5F4; }
html[data-theme="dark"] .ui-cap__row { border-color: #1b2a45; }
.ui-cap__row svg { width: 16px; height: 16px; color: #4F46E5; flex: none; margin-top: 1px; }
.ui-cap__row b { display: block; font-weight: 600; color: #1C1917; font-size: 12.5px; }
html[data-theme="dark"] .ui-cap__row b { color: #f1f5f9; }
.ui-cap__row span { display: block; color: #78716C; font-size: 11.8px; }
.ui-toggle { margin-left: auto; width: 30px; height: 17px; border-radius: 999px; background: #4F46E5; position: relative; flex: none; align-self: center; }
.ui-toggle::after { content: ''; position: absolute; right: 2px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; }
.ui-toggle--off { background: #D6D3D1; }
.ui-toggle--off::after { right: auto; left: 2px; }

/* Code session */
.ui-code { font-family: var(--mk-mono); font-size: 11.5px; line-height: 1.6; background: #0C0A09; color: #E7E5E4; border-radius: 10px; padding: 12px 14px; overflow: hidden; }
.ui-code .c-add { color: #86efac; }
.ui-code .c-del { color: #fca5a5; }
.ui-code .c-mut { color: #78716C; }
.ui-code .c-key { color: #c4b5fd; }
.ui-code .c-str { color: #fcd34d; }
.ui-changes { border: 1px solid #E7E5E4; border-radius: 10px; overflow: hidden; }
html[data-theme="dark"] .ui-changes { border-color: #22324f; }
.ui-changes__row { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-bottom: 1px solid #F5F5F4; font-size: 12px; }
html[data-theme="dark"] .ui-changes__row { border-color: #1b2a45; }
.ui-changes__row:last-child { border-bottom: 0; }
.ui-changes__row code { font-family: var(--mk-mono); font-size: 11.5px; color: #1C1917; }
html[data-theme="dark"] .ui-changes__row code { color: #e2e8f0; }
.ui-changes__row .ui-add { margin-left: auto; color: #15803D; font-family: var(--mk-mono); font-size: 11px; }
.ui-changes__row .ui-del { color: #B91C1C; font-family: var(--mk-mono); font-size: 11px; }
html[data-theme="dark"] .ui-changes__row .ui-add { color: #4ade80; }
html[data-theme="dark"] .ui-changes__row .ui-del { color: #f87171; }

/* Phone (Android) */
.ui-phone { width: 270px; max-width: 100%; margin: 0 auto; aspect-ratio: 9 / 19; border-radius: 38px; padding: 10px; background: #1C1917; box-shadow: var(--mk-shadow-lg), inset 0 0 0 2px #44403C; }
.ui-phone__screen { position: relative; height: 100%; border-radius: 29px; overflow: hidden; background: #FAFAF9; display: flex; flex-direction: column; }
html[data-theme="dark"] .ui-phone__screen { background: #0f1829; }
.ui-phone__status { display: flex; justify-content: space-between; padding: 10px 18px 4px; font-size: 10.5px; font-weight: 600; color: #1C1917; }
html[data-theme="dark"] .ui-phone__status { color: #f1f5f9; }
.ui-phone__notif { margin: 8px 10px; padding: 10px 12px; border-radius: 16px; background: #fff; box-shadow: 0 6px 20px -8px rgb(0 0 0 / .25); display: flex; gap: 10px; }
html[data-theme="dark"] .ui-phone__notif { background: #1b2a45; }
.ui-phone__notif .ui-avatar { width: 22px; height: 22px; border-radius: 6px; background: #111113 url('/renly-mark-white.png') center / 13px no-repeat; }
.ui-phone__notif b { display: block; font-size: 11.5px; color: #1C1917; }
html[data-theme="dark"] .ui-phone__notif b { color: #f1f5f9; }
.ui-phone__notif span { display: block; font-size: 11px; color: #57534E; line-height: 1.4; }
html[data-theme="dark"] .ui-phone__notif span { color: #94a3b8; }
.ui-phone__app { flex: 1; padding: 6px 10px 12px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.ui-phone .ui-approval { padding: 10px; }
.ui-phone .ui-btns .ui-btn { flex: 1; justify-content: center; }

/* Records board */
.ui-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 14px 16px; }
.ui-col { background: #FAFAF9; border: 1px solid #F0EFEE; border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 7px; }
html[data-theme="dark"] .ui-col { background: #0c1424; border-color: #1b2a45; }
.ui-col > b { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: #78716C; padding: 2px 4px; }
.ui-rec { background: #fff; border: 1px solid #E7E5E4; border-radius: 8px; padding: 8px 9px; }
html[data-theme="dark"] .ui-rec { background: #131c2e; border-color: #22324f; }
.ui-rec b { display: block; font-size: 12px; font-weight: 600; color: #1C1917; }
html[data-theme="dark"] .ui-rec b { color: #f1f5f9; }
.ui-rec span { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; font-size: 11px; color: #78716C; }
.ui-rec.is-new { border-color: #A5B4FC; box-shadow: 0 0 0 3px rgb(99 102 241 / .14); }

/* ── Comparison table ───────────────────────────────────────────────────── */
.mk-tablewrap { overflow-x: auto; border: 1px solid var(--mk-line); border-radius: var(--mk-radius-lg); background: var(--mk-bg-2); }
.mk-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .93rem; color: var(--mk-text); }
.mk-table th, .mk-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--mk-line); vertical-align: top; }
.mk-table thead th { position: sticky; top: 0; background: var(--mk-bg-2); font: 600 .95rem/1.3 var(--mk-sans); color: var(--mk-ink); }
.mk-table thead th small { display: block; font-weight: 400; color: var(--mk-muted); font-size: .82rem; margin-top: 2px; }
.mk-table tbody th { font-weight: 500; color: var(--mk-ink); width: 30%; }
.mk-table tbody tr.mk-table__group th { padding-top: 22px; font: 600 .78rem/1 var(--mk-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--mk-accent-2); background: transparent; border-bottom: 1px solid var(--mk-line); }
.mk-table td { width: 17.5%; }
.mk-table tbody tr:last-child th, .mk-table tbody tr:last-child td { border-bottom: 0; }
.mk-yes { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: var(--mk-ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803D' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat; vertical-align: -3px; }
.mk-no { display: inline-block; width: 12px; height: 2px; background: var(--mk-line-2); vertical-align: middle; border-radius: 2px; }
.mk-plan { display: flex; flex-direction: column; gap: 14px; padding: 26px; border: 1px solid var(--mk-line); border-radius: var(--mk-radius-lg); background: var(--mk-bg-2); }
.mk-plan--hl { border-color: var(--mk-accent); box-shadow: 0 0 0 3px var(--mk-accent-soft); }
.mk-plan__name { display: flex; align-items: center; justify-content: space-between; font: 600 1.1rem/1.3 var(--mk-sans); color: var(--mk-ink); }
.mk-plan__tag { font: 600 10.5px/1 var(--mk-sans); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; background: var(--mk-accent-soft); color: var(--mk-accent-2); }
.mk-plan__price { font: 400 2.8rem/1 var(--mk-serif); color: var(--mk-ink); letter-spacing: -.02em; }
.mk-plan__price small { font: 500 .85rem/1.3 var(--mk-sans); color: var(--mk-muted); margin-left: 6px; letter-spacing: 0; }
.mk-plan__for { font-size: .93rem; color: var(--mk-muted); margin: -4px 0 0; }
.mk-plan .mk-bullets { margin-top: 4px; gap: 9px; }
.mk-plan .mk-bullets li { font-size: .92rem; }
.mk-plan .mk-btn { margin-top: auto; width: 100%; }

/* ── Capabilities gallery: one tile per thing Renly can do ──────────────── */
.mk-caps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mk-cap { background: var(--mk-bg-2); border: 1px solid var(--mk-line); border-radius: var(--mk-radius-lg); overflow: hidden; display: flex; flex-direction: column; text-decoration: none !important; transition: border-color .2s, transform .25s var(--mk-ease), box-shadow .25s; }
a.mk-cap:hover { border-color: var(--mk-accent-ring); transform: translateY(-2px); box-shadow: var(--mk-shadow); }
.mk-cap__viz { position: relative; height: 156px; padding: 16px; background: var(--mk-bg-3); border-bottom: 1px solid var(--mk-line); overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 6px; font-family: var(--mk-ui); font-size: 11.5px; color: #44403C; }
html[data-theme="dark"] .mk-cap__viz { color: #cbd5e1; }
.mk-cap__body { padding: 18px 18px 22px; }
.mk-cap h3 { font: 600 1.02rem/1.3 var(--mk-sans); color: var(--mk-ink); margin: 0 0 6px; }
.mk-cap p { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--mk-text); }
.mk-cap .mk-beta { margin-left: 4px; }
/* mini visuals */
.cv-row { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 8px; background: #fff; border: 1px solid #E7E5E4; min-width: 0; }
html[data-theme="dark"] .cv-row { background: #131c2e; border-color: #22324f; }
.cv-row b { font-weight: 600; color: #1C1917; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-theme="dark"] .cv-row b { color: #f1f5f9; }
.cv-row span { color: #78716C; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-row em { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 600; color: #4338CA; background: #EEF2FF; border-radius: 4px; padding: 1px 5px; }
html[data-theme="dark"] .cv-row em { background: rgb(129 140 248 / .18); color: #c7d2fe; }
.cv-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c, #4F46E5); }
.cv-row > span > svg { width: 13px; height: 13px; display: block; }
.cv-wave .cv-mic svg { width: 18px; height: 18px; }
.cv-files { display: flex; justify-content: center; align-items: flex-end; gap: 10px; }
.cv-files .ui-file__ico { width: 44px; height: 54px; font-size: 10px; border-radius: 7px; box-shadow: 0 8px 18px -10px rgb(0 0 0 / .4); }
.cv-files .ui-file__ico:nth-child(2) { transform: translateY(-8px); }
.cv-files .ui-file__ico:nth-child(3) { transform: translateY(-4px); }
.cv-media { display: grid; grid-template-columns: 1.2fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; height: 100%; }
.cv-media i { border-radius: 8px; display: block; position: relative; }
.cv-media i:nth-child(1) { grid-row: span 2; background: linear-gradient(180deg, #FDBA74 0%, #F472B6 45%, #6D28D9 100%); }
.cv-media i:nth-child(1)::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 42%; border-radius: 0 0 8px 8px; background: linear-gradient(160deg, #1E1B4B 0%, #312E81 100%); clip-path: polygon(0 60%, 22% 18%, 40% 52%, 62% 0, 100% 55%, 100% 100%, 0 100%); }
.cv-media i:nth-child(2) { background: radial-gradient(circle at 70% 30%, #FDE68A 0 14%, transparent 15%), linear-gradient(135deg, #38BDF8, #0EA5E9 60%, #0369A1); }
.cv-media i:nth-child(3) { background: linear-gradient(135deg, #10B981, #065F46); }
.cv-media i:nth-child(3)::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: rgb(255 255 255 / .92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23065F46'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") 55% 50% / 12px no-repeat; }
.cv-bars { display: flex; align-items: flex-end; gap: 8px; height: 100%; padding: 4px 6px 0; border-bottom: 1px solid #D6D3D1; }
.cv-bars i { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #818CF8, #4F46E5); }
.cv-bars i.is-hi { background: linear-gradient(180deg, #34D399, #059669); }
.cv-diagram { display: block; width: 100%; height: 100%; }
.cv-diagram rect { fill: #fff; stroke: #C7D2FE; stroke-width: 1.5; }
.cv-diagram rect.k { fill: #EEF2FF; stroke: #4F46E5; }
.cv-diagram path { stroke: #A5B4FC; stroke-width: 1.5; fill: none; }
.cv-diagram text { font: 600 10px var(--mk-ui); fill: #312E81; }
html[data-theme="dark"] .cv-diagram rect { fill: #131c2e; stroke: #3b4c7a; }
html[data-theme="dark"] .cv-diagram rect.k { fill: rgb(129 140 248 / .2); stroke: #818cf8; }
html[data-theme="dark"] .cv-diagram text { fill: #c7d2fe; }
.cv-chips { display: flex; flex-wrap: wrap; gap: 6px; align-content: center; }
.cv-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; background: #fff; border: 1px solid #E7E5E4; font-weight: 500; color: #44403C; white-space: nowrap; }
html[data-theme="dark"] .cv-chip { background: #131c2e; border-color: #22324f; color: #cbd5e1; }
.cv-chip svg { width: 11px; height: 11px; color: #4F46E5; }
.cv-check { width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid #A8A29E; flex: none; }
.cv-check.is-done { background: #16A34A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 9px no-repeat; border-color: #16A34A; }
.cv-row.is-done b { text-decoration: line-through; color: #A8A29E; }
.cv-wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 100%; }
.cv-wave .cv-mic { width: 42px; height: 42px; border-radius: 50%; background: #4F46E5; color: #fff; display: inline-flex; align-items: center; justify-content: center; margin-right: 10px; box-shadow: 0 0 0 8px rgb(79 70 229 / .14); }
.cv-wave i { width: 4px; border-radius: 4px; background: #818CF8; height: var(--h, 20px); }
@media (prefers-reduced-motion: no-preference) { .cv-wave i { animation: cv-wave 1.2s ease-in-out infinite; animation-delay: var(--d, 0s); } }
@keyframes cv-wave { 50% { transform: scaleY(.45); } }
.cv-agent { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; background: #fff; border: 1px solid #E7E5E4; }
html[data-theme="dark"] .cv-agent { background: #131c2e; border-color: #22324f; }
.cv-agent b { display: block; font-size: 12.5px; color: #1C1917; }
html[data-theme="dark"] .cv-agent b { color: #f1f5f9; }
.cv-agent span { display: block; color: #78716C; margin: 2px 0 6px; }
.cv-mini-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.cv-mini-tags i { font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 4px; background: #F5F5F4; color: #57534E; }
html[data-theme="dark"] .cv-mini-tags i { background: #1b2a45; color: #94a3b8; }

/* ── Scene animation states (kit.js) ────────────────────────────────────── */
[data-mk-scene] [data-at] { transition: opacity .45s var(--mk-ease), transform .45s var(--mk-ease), max-height .5s var(--mk-ease); }
.mk-js [data-mk-scene] [data-at]:not(.is-on) { opacity: 0; transform: translateY(8px); }
/* A collapsing step takes no room until it appears, so the thread grows the
   way a real chat does instead of reserving blank space. */
.mk-js [data-mk-scene] [data-at].ui-collapse:not(.is-on) { max-height: 0; margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; border-width: 0; overflow: hidden; }
[data-mk-scene] [data-at].ui-collapse { max-height: 600px; }
.mk-js [data-mk-scene] [data-hide-at].is-off { display: none; }
/* Without the script, a scene shows its finished frame: transient steps
   (a spinner later replaced by a tick) stay out of it. */
html:not(.mk-js) [data-mk-scene] [data-hide-at] { display: none; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .mk-caps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-surfaces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-stat:nth-child(3) { border-left: 0; }
  .mk-stat:nth-child(n+3) { border-top: 1px solid var(--mk-line); }
}
@media (max-width: 900px) {
  .mk-row, .mk-hero--split .mk-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .mk-row--flip > :first-child { order: 0; }
  .mk-row__copy { max-width: none; }
  .mk-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .mk-hero--split .mk-hero__copy { text-align: center; margin: 0 auto; }
  .mk-hero--split .mk-hero__copy .mk-lede { margin-left: auto; }
  .mk-hero--split .mk-hero__copy .mk-actions { justify-content: center; }
}
@media (max-width: 640px) {
  .mk-wrap { padding: 0 16px; }
  .mk-grid--2, .mk-grid--4, .mk-caps { grid-template-columns: minmax(0, 1fr); }
  .mk-surfaces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-stats { grid-template-columns: minmax(0, 1fr); }
  .mk-stat { border-left: 0; border-top: 1px solid var(--mk-line); }
  .mk-stat:first-child { border-top: 0; }
  .mk-tablist { border-radius: 16px; width: 100%; justify-content: center; }
  .mk-tab { padding: 9px 13px; font-size: .9rem; }
  .mk-card { padding: 22px; }
  .ui-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ui-board .ui-col:nth-child(3) { display: none; }
  .ui-kv { grid-template-columns: 96px minmax(0, 1fr); }
  .mk-btn { min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .mk *, .mk *::before, .mk *::after { animation: none !important; transition: none !important; }
  .ui-caret { display: none; }
}
