:root {
  --ink: #17191c;
  --muted: #666b73;
  --soft: #f4f5f6;
  --line: #e3e5e8;
  --white: #ffffff;
  --red: #d71920;
  --red-dark: #a70f16;
  --red-soft: #fff0f1;
  --green: #18794e;
  --green-soft: #e8f5ee;
  --amber: #a45f00;
  --gray-100: #f0f1f2;
  --gray-200: #e6e7e8;
  --gray-300: #d4d6d9;
  --gray-400: #b8bbc0;
  --gray-500: #8b8e93;
  --gray-600: #6a6e75;
  --gray-700: #50545a;
  --gray-800: #34373b;
  --gray-900: #17191c;
  --font-size-xs: 0.8125rem;   /* 13px - piso minimo, ningun texto de UI por debajo */
  --font-size-sm: 0.875rem;    /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-md: 1.125rem;    /* 18px */
  --font-size-lg: 1.25rem;     /* 20px */
  --font-size-xl: 1.5rem;      /* 24px */
  --font-size-2xl: 2rem;       /* 32px */
  --shadow: 0 20px 60px rgba(16, 24, 40, .09);
  --sidebar: 272px;
  font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--white); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--white); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid rgba(215, 25, 32, .32); outline-offset: 3px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 9999; padding: 10px 16px; background: var(--ink); color: var(--white); border-radius: 8px; }
.skip-link:focus { top: 16px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.shell-width { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.eyebrow { margin: 0 0 12px; color: var(--red); font-size: var(--font-size-xs); font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; transition: background .18s ease, border .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .52; transform: none; }
.button-primary { color: var(--white); background: var(--red); }
.button-primary:hover { background: var(--red-dark); }
.button-secondary { color: var(--ink); background: var(--white); border-color: var(--gray-300); }
.button-secondary:hover { background: var(--soft); border-color: var(--gray-400); }
.button-quiet { color: var(--ink); background: transparent; border-color: var(--gray-300); }
.button-danger { color: var(--red); background: var(--red-soft); border-color: #f5c2c5; }
.button-large { min-height: 50px; padding-inline: 24px; }
.button-full { width: 100%; }
.text-button { padding: 2px 0; border: 0; color: var(--ink); background: transparent; font-weight: 700; text-decoration: underline; text-decoration-color: var(--gray-400); text-underline-offset: 4px; }
.text-button:hover { color: var(--red); }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }

/* Public experience */
.public-view { min-height: 100vh; background: linear-gradient(180deg, #fff 0 72%, var(--gray-100) 100%); }
.public-header { display: flex; align-items: center; justify-content: space-between; min-height: 90px; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 18px; color: var(--ink); text-decoration: none; }
.brand-lockup img { width: 155px; max-height: 48px; object-fit: contain; object-position: left center; }
.brand-divider { width: 1px; height: 32px; background: var(--line); }
.astra-wordmark { font-size: 1.04rem; letter-spacing: -.02em; }
.astra-wordmark strong { color: var(--red); }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); gap: clamp(48px, 8vw, 100px); align-items: center; min-height: 610px; padding-block: 80px; }
.hero h1 { max-width: 720px; margin: 0; font-size: clamp(2.9rem, 5.5vw, 5.25rem); line-height: .98; letter-spacing: -.065em; }
.hero h1 span { color: var(--gray-600); font-weight: 400; }
.hero-lead { max-width: 640px; margin: 28px 0; color: var(--muted); font-size: 1.15rem; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.privacy-note { display: flex; align-items: center; gap: 9px; margin: 24px 0 0; color: var(--muted); font-size: .88rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #e6f6ed; }
.hero-console { position: relative; min-height: 390px; padding: 26px; overflow: hidden; border: 1px solid var(--gray-300); border-radius: 20px; background: var(--gray-100); box-shadow: var(--shadow); }
.hero-console::after { content: ""; position: absolute; right: -80px; bottom: -110px; width: 260px; height: 260px; border: 50px solid rgba(215, 25, 32, .06); border-radius: 50%; }
.console-topline { display: flex; align-items: center; gap: 6px; padding-bottom: 24px; color: var(--gray-500); font-size: var(--font-size-xs); letter-spacing: .08em; }
.console-topline span { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-300); }
.console-topline span:first-child { background: var(--red); }
.console-topline strong { margin-left: auto; }
.console-message { position: relative; z-index: 1; max-width: 90%; margin-block: 16px; padding: 16px 18px; border-radius: 14px; line-height: 1.55; }
.console-user { margin-left: auto; background: var(--gray-900); color: var(--white); }
.console-astra { display: flex; gap: 12px; background: var(--white); border: 1px solid var(--line); }
.console-astra img { width: 28px; height: 28px; object-fit: contain; }
.console-astra p { margin: 0; }
.console-summary { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: 34px; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.console-summary strong { color: var(--green); }
.trust-strip { border-block: 1px solid var(--line); background: var(--gray-100); }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.trust-grid article { display: grid; gap: 8px; min-height: 150px; padding: 34px; border-left: 1px solid var(--line); }
.trust-grid article:last-child { border-right: 1px solid var(--line); }
.trust-grid span { color: var(--muted); line-height: 1.55; }
.public-access { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; padding-block: 80px; }
.public-access h2 { max-width: 620px; margin: 0; font-size: clamp(2rem, 4vw, 3.7rem); letter-spacing: -.045em; }
.access-links { display: grid; gap: 14px; justify-items: start; max-width: 360px; color: var(--muted); }
.public-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.public-footer > div { display: flex; justify-content: space-between; padding-block: 26px; }

/* Authentication */
.auth-view { min-height: 100vh; padding: 32px; background: var(--gray-100); }
.back-button { position: fixed; top: 28px; left: 32px; border: 0; background: transparent; font-weight: 700; }
.auth-shell { width: min(460px, 100%); margin: 30px auto; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 26px; font-weight: 800; }
.auth-brand img { width: 135px; }
.auth-brand span { padding-left: 18px; border-left: 1px solid var(--gray-300); }
.auth-card { padding: 38px; border: 1px solid var(--gray-200); border-radius: 18px; background: var(--white); box-shadow: 0 16px 50px rgba(20, 24, 31, .07); }
.auth-card h1 { margin: 0 0 10px; font-size: 2rem; letter-spacing: -.045em; }
.form-intro { margin: 0 0 26px; color: var(--muted); line-height: 1.55; }
.auth-card form, .account-dialog form { display: grid; gap: 18px; }
label { display: grid; gap: 7px; color: var(--gray-800); font-size: .86rem; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--gray-300); border-radius: 8px; background: var(--white); color: var(--ink); }
input, select { min-height: 44px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--red); outline: 3px solid rgba(215, 25, 32, .1); }
.auth-switch { margin-top: 18px; margin-right: 18px; font-size: .85rem; }
.form-message { min-height: 24px; margin-top: 18px; color: var(--muted); text-align: center; }
.form-message.error { color: var(--red-dark); }
.form-message.success { color: var(--green); }
.password-meter { height: 7px; overflow: hidden; border-radius: 99px; background: var(--gray-100); }
.password-meter span { display: block; width: 0; height: 100%; background: var(--red); transition: width .2s ease, background .2s ease; }
.password-meter-bar.is-valid { background: var(--green); }
.password-meter-bar.is-invalid { background: var(--red); }
.field-help { margin: -8px 0 0; color: var(--muted); font-size: var(--font-size-xs); line-height: 1.45; }
.mfa-enrollment { margin-bottom: 18px; }
.secret-box { margin-top: 14px; padding: 14px; border: 1px solid #f0c3c6; border-radius: 9px; background: var(--red-soft); }
.secret-box span, .secret-box p { display: block; margin: 0; color: var(--muted); font-size: var(--font-size-xs); }
.secret-box code { display: block; margin-block: 8px; overflow-wrap: anywhere; font-weight: 800; }

/* Authenticated application */
.app-view { min-height: 100vh; background: var(--gray-100); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; width: var(--sidebar); padding: 22px 16px; border-right: 1px solid var(--gray-200); background: var(--gray-100); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 22px; }
.sidebar-brand img { width: 34px; height: 34px; object-fit: contain; }
.sidebar-brand div { display: grid; gap: 2px; }
.sidebar-brand strong { letter-spacing: -.025em; }
.sidebar-brand span { color: var(--muted); font-size: var(--font-size-xs); }
.new-chat-button { justify-content: flex-start; gap: 10px; margin-bottom: 16px; border-color: var(--gray-300); background: var(--white); }
.new-chat-button span { color: var(--red); font-size: 1.15rem; }
.primary-nav { display: grid; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--gray-700); font-weight: 650; text-align: left; }
.nav-item:hover { background: var(--gray-200); }
.nav-item.active { color: var(--red); background: var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.nav-item span { width: 20px; color: var(--gray-600); text-align: center; }
.nav-item.active span { color: var(--red); }
.conversation-block { min-height: 0; margin-top: 24px; overflow: hidden; }
.sidebar-label { display: block; padding: 0 12px 8px; color: var(--gray-500); font-size: var(--font-size-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.conversation-list { display: grid; gap: 2px; max-height: 250px; overflow-y: auto; }
.conversation-list button { overflow: hidden; min-height: 36px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--gray-700); font-size: .82rem; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.conversation-list button:hover, .conversation-list button.active { background: var(--gray-200); color: var(--ink); }
.conversation-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; }
.conversation-item > button:first-child { min-width: 0; }
.conversation-actions { display: flex; }
.conversation-actions button { width: 28px; min-height: 28px; padding: 0; text-align: center; }
.account-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; margin-top: auto; padding: 8px; border: 1px solid var(--gray-300); border-radius: 10px; background: var(--gray-100); text-align: left; }
.account-button > span:first-child, .avatar-button { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--gray-900); color: var(--white); font-size: var(--font-size-xs); font-weight: 800; }
.account-button > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.account-button strong, .account-button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-button small { color: var(--muted); }
.account-button b { margin-left: auto; color: var(--gray-500); }
.app-main { min-height: 100vh; margin-left: var(--sidebar); }
.app-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.context-selectors { display: flex; align-items: center; gap: 8px; }
.context-selectors label { display: flex; align-items: center; gap: 8px; font-size: var(--font-size-xs); }
.context-selectors select { min-height: 36px; max-width: 220px; border-color: transparent; background: var(--gray-100); font-weight: 700; }
.context-divider { color: var(--gray-400); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.workspace { width: min(1220px, calc(100% - 60px)); margin: 0 auto; padding: 50px 0 80px; }
.workspace-panel { animation: panel-in .22s ease both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } }
.welcome-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.welcome-row h1, .panel-heading h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -.055em; }
.welcome-row h1 span { color: var(--gray-600); font-weight: 400; }
.welcome-row > div > p:last-child, .panel-heading p { margin: 10px 0 0; color: var(--muted); }
.role-badge { padding: 8px 11px; border: 1px solid #f0c3c6; border-radius: 99px; background: var(--red-soft); color: var(--red-dark); font-size: var(--font-size-xs); font-weight: 800; letter-spacing: .06em; }
.chat-stage { max-width: 900px; margin: 0 auto 26px; }
.chat-messages { display: grid; gap: 15px; max-height: 410px; overflow-y: auto; padding: 8px 4px 22px; }
.chat-message { max-width: 78%; padding: 14px 16px; border-radius: 14px; line-height: 1.55; white-space: pre-wrap; }
.chat-message.user { justify-self: end; background: var(--gray-900); color: var(--white); }
.chat-message.astra { justify-self: start; border: 1px solid var(--line); background: var(--white); }
.chat-message .source-label { display: block; margin-top: 8px; color: var(--green); font-size: var(--font-size-xs); font-weight: 800; }
.chat-composer { padding: 15px; border: 1px solid var(--gray-300); border-radius: 16px; background: var(--white); box-shadow: 0 12px 32px rgba(20, 24, 31, .07); }
.chat-composer textarea { min-height: 58px; padding: 3px; border: 0; outline: 0; font-size: 1rem; }
.chat-composer textarea:focus { outline: 0; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; border-top: 1px solid var(--gray-100); }
.composer-actions span { color: var(--muted); font-size: var(--font-size-xs); }
.send-button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--red); color: var(--white); font-size: 1.2rem; font-weight: 800; }
.suggested-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 900px; margin: 0 auto 38px; }
.suggested-grid button { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--gray-100); color: var(--gray-700); text-align: left; }
.suggested-grid button:hover { border-color: var(--gray-400); background: var(--white); }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dashboard-grid article, .programmer-grid article, .split-grid article { min-height: 190px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.card-heading { display: flex; justify-content: space-between; margin-bottom: 14px; }
.card-heading h2, .dashboard-grid h2, .programmer-grid h2, .split-grid h2 { margin: 0; font-size: .98rem; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 42px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); font-size: .82rem; }
.list-row:last-child { border-bottom: 0; }
.list-row span:last-child { color: var(--muted); font-size: var(--font-size-xs); }
.list-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.list-row-actions button, .list-row-actions select { min-height: 32px; padding: 0 8px; border: 1px solid var(--gray-300); border-radius: 7px; background: var(--white); font-size: var(--font-size-xs); }
.is-clickable { cursor: pointer; }
.is-clickable:hover { background: var(--gray-100); }
.is-clickable:focus-visible { outline: 3px solid rgba(215, 25, 32, .25); outline-offset: -2px; }
#activityReviewDialog { width: min(780px, calc(100% - 32px)); }
#activityReviewEvidence { display: grid; gap: 12px; margin-block: 18px; }
#activityReviewEvidence h3 { margin: 0; font-size: .95rem; }
.review-origin-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--gray-100); color: var(--gray-700); overflow-wrap: anywhere; }
.review-origin-card p { margin: 6px 0 0; line-height: 1.5; }
.review-origin-legacy { border-style: dashed; color: var(--muted); }
.review-evidence-group { border: 1px solid var(--line); border-radius: 12px; background: var(--white); overflow: hidden; }
.review-evidence-group > summary { padding: 13px 16px; background: var(--gray-100); color: var(--gray-700); cursor: pointer; font-size: .84rem; font-weight: 800; overflow-wrap: anywhere; }
.review-requirement-facts, .review-duplicate-facts { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--white); }
.review-evidence-source { padding: 14px 16px; border-top: 1px solid var(--line); }
.review-evidence-source h4 { margin: 0 0 10px; color: var(--gray-700); font-size: .8rem; overflow-wrap: anywhere; }
.review-evidence-item { margin-top: 10px; padding: 13px; border: 1px solid var(--gray-200); border-radius: 9px; background: var(--white); overflow-wrap: anywhere; }
.review-evidence-item:first-of-type { margin-top: 0; }
.review-evidence-badges { margin: 0 0 8px; }
.review-evidence-fact { margin: 5px 0; color: var(--gray-700); font-size: .8rem; line-height: 1.45; overflow-wrap: anywhere; }
.review-evidence-fact strong { color: var(--gray-900); }
.review-period-warning { margin-top: 10px; border-color: #e7bd75; background: #fff8e8; color: var(--amber); }
.review-period-warning p { margin: 0 0 10px; font-weight: 800; }
.review-period-reject-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e7bd75; }
.review-period-reject-form textarea { margin: 6px 0; }
.review-period-rejected { margin-top: 10px; border-color: #f5c2c5; background: var(--red-soft); color: var(--red-dark); }
.review-period-rejected p { margin: 0 0 6px; font-weight: 800; }
.review-original-file-link { display: inline-block; margin-top: 8px; }
.review-visual-thumb { margin-top: 10px; border: 1px solid var(--gray-400); border-radius: 8px; background: var(--gray-100); overflow: hidden; }
.review-visual-thumb-link { display: block; }
.review-visual-image-thumb { display: block; width: auto; max-width: 100%; max-height: 160px; margin: 0 auto; object-fit: contain; background: var(--white); }
.review-visual-thumb-placeholder { padding: 12px; color: var(--gray-700); font-size: .8rem; border-style: dashed; }
.review-position-note { margin: 6px 0 0; font-weight: 700; }
.review-aggregate-note, .review-historical-note { margin: 10px 0 0; padding: 10px; border-radius: 8px; background: var(--gray-100); line-height: 1.45; }
.review-group-grid { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); overflow: hidden; }
.review-group-grid > summary { padding: 13px 16px; background: var(--gray-100); color: var(--gray-700); cursor: pointer; font-size: .84rem; font-weight: 800; overflow-wrap: anywhere; }
.review-group-grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; padding: 14px 16px; }
.review-group-grid-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--gray-200); border-radius: 9px; background: var(--white); cursor: pointer; text-align: center; }
.review-group-grid-cell:hover { border-color: var(--gray-400); }
.review-group-grid-cell img { display: block; width: 100%; max-height: 90px; object-fit: cover; border-radius: 6px; }
.review-group-grid-placeholder { padding: 20px 4px; color: var(--muted); font-size: .74rem; }
.review-group-grid-label { font-size: .7rem; color: var(--gray-700); line-height: 1.3; }
.review-group-bulk-resolve { display: block; margin: 0 16px 14px; }
.empty-state { padding: 24px 0; color: var(--muted); font-size: .86rem; text-align: center; }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.card-grid, .knowledge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.process-card, .knowledge-card, .output-file-item { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.process-card h2, .knowledge-card h2 { margin: 0 0 8px; font-size: 1rem; }
.process-card p, .knowledge-card p { color: var(--muted); font-size: .82rem; line-height: 1.5; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.tag { padding: 5px 8px; border-radius: 99px; background: var(--gray-100); color: var(--gray-700); font-size: var(--font-size-xs); font-weight: 800; text-transform: uppercase; }
.tag.sensitive { background: var(--red-soft); color: var(--red-dark); }
.tag.status-success { background: var(--green-soft); color: var(--green); }
.tag.status-warning { background: rgba(164, 95, 0, .12); color: var(--amber); }
.tag.status-error { background: var(--red-soft); color: var(--red); }
.eyebrow-neutral { margin: 0 0 12px; color: var(--gray-600); font-size: var(--font-size-xs); font-weight: 700; letter-spacing: .02em; }
.tag-neutral { padding: 5px 8px; border-radius: 99px; background: var(--gray-100); color: var(--gray-700); font-size: var(--font-size-xs); font-weight: 600; }
.tag-neutral.sensitive { background: var(--gray-200); color: var(--gray-800); }
.process-search-form { display: flex; gap: 12px; margin-bottom: 20px; }
.process-search-form input { flex: 1 1 auto; }
.process-search-result { margin-bottom: 20px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.process-search-result p { margin: 0 0 10px; color: var(--muted); font-size: .86rem; }
.process-search-result .process-search-options { display: flex; flex-direction: column; gap: 8px; }
.process-search-result button.process-search-option { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 1px solid var(--gray-300); border-radius: 8px; background: var(--white); font-weight: 700; }
.process-search-result button.process-search-option:hover { background: var(--gray-100); border-color: var(--gray-400); }
.featured-process .process-card { border-color: var(--gray-400); background: var(--soft); }
.featured-process { margin-bottom: 24px; }
.process-category-heading { margin: 28px 0 12px; font-size: var(--font-size-sm); font-weight: 700; color: var(--gray-700); }
.process-category-heading:first-child { margin-top: 0; }
.drawer-card, .inline-form, .editor-form, .session-state-card { margin: 24px 0; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.inline-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: end; }
.inline-form textarea, .inline-form .check-label { grid-column: 1 / -1; }
.check-label { display: flex; align-items: center; gap: 9px; }
.check-label input { width: 18px; min-height: 18px; }
.editor-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.table-card { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.data-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); text-align: left; }
.data-table th { color: var(--gray-600); font-size: var(--font-size-xs); letter-spacing: .05em; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: 0; }
.output-files-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.output-file-item { display: grid; gap: 8px; }
.output-card { border: 1px solid var(--line); background: var(--white); }
.session-state-card > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.session-state-card h3 { margin: 0; }
.session-state-card dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; margin: 18px 0 0; font-size: .82rem; }
.session-state-card dt { color: var(--muted); }
.session-state-card dd { margin: 0; }
.session-badge { padding: 5px 8px; border-radius: 99px; font-size: var(--font-size-xs); font-weight: 800; }
.session-badge.active { color: var(--green); background: var(--green-soft); }
.session-badge.idle { color: var(--gray-600); background: var(--gray-100); }
.knowledge-card .status { display: inline-flex; padding: 5px 8px; border-radius: 99px; background: var(--gray-100); color: var(--gray-700); font-size: var(--font-size-xs); font-weight: 800; }
.knowledge-card .status.official { background: var(--green-soft); color: var(--green); }
.knowledge-card .status:not(.official) { background: #fbf0e2; color: var(--amber); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.card-actions button, .safe-actions button { min-height: 34px; padding: 0 10px; border: 1px solid var(--gray-300); border-radius: 7px; background: var(--white); font-size: var(--font-size-xs); font-weight: 700; }
.split-grid, .programmer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.artifact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.artifact-grid article { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.artifact-grid h2 { margin-top: 0; font-size: .95rem; }
.permission-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.permission-checks label { display: flex; align-items: center; gap: 8px; font-size: var(--font-size-xs); }
.programmer-extensions { padding-top: 0; }
.drawer-card summary { cursor: pointer; font-weight: 800; }
.notification-row.unread { border-left: 3px solid var(--red); padding-left: 12px; }
.notification-row { align-items: flex-start; padding-block: 12px; }
.notification-row p { margin: 4px 0; color: var(--muted); font-size: var(--font-size-xs); }
.split-grid article > h2, .programmer-grid article > h2 { margin-bottom: 18px; }
.local-link { margin: 16px 0; padding: 14px; border: 1px solid #f0c3c6; border-radius: 9px; background: var(--red-soft); overflow-wrap: anywhere; }
.metric-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.metric { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.metric span { display: block; color: var(--muted); font-size: var(--font-size-xs); text-transform: uppercase; }
.metric strong { display: block; margin-top: 8px; font-size: 1.6rem; }
.programmer-grid form { display: grid; gap: 10px; margin-bottom: 18px; }
.safe-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0; }
#technicalOutput { max-height: 330px; overflow: auto; padding: 16px; border-radius: 9px; background: var(--gray-900); color: var(--gray-200); font-family: Consolas, "Courier New", monospace; font-size: var(--font-size-xs); line-height: 1.55; white-space: pre-wrap; }
.account-dialog { width: min(620px, calc(100% - 32px)); max-height: calc(100vh - 40px); overflow: auto; padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 80px rgba(0,0,0,.2); }
.account-dialog::backdrop { background: rgba(15, 17, 20, .46); backdrop-filter: blur(3px); }
.account-dialog > * { margin-inline: 28px; }
.account-dialog > form { padding-block: 28px; }
.dialog-heading { display: flex !important; grid-template-columns: 1fr auto; align-items: center; justify-content: space-between; gap: 18px; margin-top: 0; border-bottom: 1px solid var(--line); }
.dialog-heading > div { min-width: 0; overflow-wrap: break-word; }
.dialog-heading h2 { margin: 0; overflow-wrap: break-word; }
.dialog-heading .icon-button { flex-shrink: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 22px 0 28px; border-top: 1px solid var(--line); }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 9px; width: min(390px, calc(100% - 44px)); }
.toast { padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 9px; background: var(--white); box-shadow: var(--shadow); font-size: .85rem; }
.toast.error { border-left-color: var(--red); }
.mobile-only { display: none; }

@media (max-width: 1100px) {
  :root { --sidebar: 244px; }
  .hero { grid-template-columns: 1fr 400px; gap: 42px; }
  .hero h1 { font-size: 3.7rem; }
  .card-grid, .knowledge-grid, .output-files-list { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid article:last-child { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .shell-width { width: min(100% - 32px, 720px); }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-block: 64px; }
  .hero-console { min-height: 330px; }
  .trust-grid { grid-template-columns: 1fr; }
  .trust-grid article { min-height: auto; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .public-access { align-items: flex-start; flex-direction: column; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.12); }
  .sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .mobile-only { display: inline-grid; }
  .app-header { padding-inline: 18px; }
  .workspace { width: min(100% - 32px, 720px); padding-top: 34px; }
  .suggested-grid { grid-template-columns: 1fr; }
  .programmer-grid, .split-grid, .artifact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .public-header { min-height: 76px; }
  .brand-lockup img { width: 120px; }
  .brand-divider { height: 24px; }
  .public-header .button { min-height: 38px; padding-inline: 12px; font-size: var(--font-size-xs); }
  .hero { padding-block: 44px; }
  .hero h1 { font-size: 2.8rem; }
  .hero-lead { font-size: 1rem; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-console { min-height: 360px; padding: 18px; }
  .console-topline strong { display: none; }
  .public-footer > div { align-items: flex-start; flex-direction: column; gap: 8px; }
  .auth-view { padding: 22px 14px; }
  .back-button { position: static; margin-bottom: 20px; }
  .auth-shell { margin-top: 0; }
  .auth-card { padding: 26px 20px; }
  .context-selectors label span, .context-divider { display: none; }
  .context-selectors select { max-width: 132px; }
  .welcome-row, .panel-heading { align-items: flex-start; flex-direction: column; }
  .chat-message { max-width: 90%; }
  .dashboard-grid, .card-grid, .knowledge-grid, .output-files-list, .form-grid, .inline-form { grid-template-columns: 1fr; }
  .dashboard-grid article:last-child { grid-column: auto; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .session-state-card dl { grid-template-columns: 1fr; }
  .session-state-card dd { margin-bottom: 8px; }
  .dialog-actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
