@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
:root {
  color-scheme: light;
  --bg: #faf7f4;
  --surface: #fffdfa;
  --surface-soft: #f5efea;
  --ink: #29221f;
  --ink-secondary: #594f4c;
  --muted: #706561;
  --line: #ece2db;
  --line-dark: #dacdc5;
  --accent: #604eba;
  --accent-ink: #51409d;
  --accent-soft: #eee8fc;
  --rose: #923d5c;
  --rose-soft: #f8e7ed;
  --positive: #275b46;
  --positive-soft: #e7f2eb;
  --warning: #765125;
  --warning-soft: #fcf0dc;
  --error: #a13836;
  --error-soft: #fae9e7;
  --brand-gradient: linear-gradient(123deg, #5b4cc2, #8955af 54%, #b75554);
  --shadow-sm: 0 1px 3px #452a2010;
  --shadow: 0 1px 2px #452a200a, 0 16px 38px -24px #452a2040;
  --shadow-lg: 0 16px 45px -22px #4d2e3f50;
  --radius: 18px;
  --radius-lg: 26px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; color: var(--ink); font: 400 16px/1.5 Onest, system-ui, sans-serif; background: var(--bg); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; z-index: -1; inset: 0; background: radial-gradient(ellipse at 92% 5%, #f1e9fb 0%, transparent 43%), radial-gradient(ellipse at 42% -25%, #f8e9de 0%, transparent 56%); pointer-events: none; }
button, input, textarea, select { color: inherit; font: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--rose); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
:disabled { opacity: .65; cursor: default; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; }
h1 { font-size: clamp(2rem, 4vw, 3.05rem); line-height: 1.13; letter-spacing: -.047em; font-weight: 750; }
h2 { font-size: 1.3rem; line-height: 1.28; letter-spacing: -.021em; font-weight: 720; }
h3, h4 { font-size: 1rem; line-height: 1.32; font-weight: 690; }
small { font-size: .86rem; }
svg { width: 1.22em; height: 1.22em; flex: 0 0 auto; vertical-align: middle; }
.skip { position: fixed; top: 10px; left: 10px; z-index: 20; transform: translateY(-200%); padding: 7px 13px; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; }
.skip:focus { transform: none; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.shell { min-height: 100svh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; min-height: 0; padding: 18px 14px 14px; border-right: 1px solid var(--line); background: #fdfaf7; overflow: auto; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); padding: 0 7px; }
.brand:hover { color: var(--accent-ink); }
.brand img { flex-shrink: 0; display: block; border-radius: 13px; box-shadow: 0 7px 16px -8px #713e9e90; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.05rem; line-height: 1.35; letter-spacing: -.025em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: .74rem; }
.side-nav { display: grid; gap: 5px; margin-top: 32px; }
.nav-link, .tree-link { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 11px; border-radius: 10px; color: var(--ink-secondary); font-size: .9rem; font-weight: 570; transition: color .2s, background .2s; }
.nav-link:hover, .tree-link:hover { color: var(--accent-ink); background: var(--surface-soft); }
.nav-link.active { color: var(--accent-ink); background: var(--accent-soft); }
.tree-section { margin-top: 19px; min-height: 0; display: flex; flex-direction: column; }
.tree-title { display: flex; align-items: center; justify-content: space-between; padding: 2px 5px 7px 11px; color: var(--muted); font-weight: 660; font-size: .87rem; }
.tree-title .icon-button { width: 33px; min-height: 33px; }
.tree-nav { min-height: 0; overflow: auto; }
.project-tree { list-style: none; padding: 0; margin: 0; }
.project-tree .project-tree { padding-left: 12px; margin: 1px 0 4px 12px; border-left: 1px solid var(--line); }
.tree-link { padding-block: 6px; line-height: 1.35; }
.tree-link.active { color: var(--accent-ink); background: var(--accent-soft); }
.tree-link span, .project-label { min-width: 0; overflow-wrap: anywhere; }
.tree-hint { font-size: .82rem; color: var(--muted); padding: 0 11px; }
.side-footer { padding-top: 15px; margin-top: auto; align-self: flex-start; }
.topbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 8px clamp(16px, 2.8vw, 40px); border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; color: var(--muted); font-size: .86rem; }
.breadcrumbs svg { width: .91em; }
.breadcrumbs .current { color: var(--ink-secondary); font-weight: 630; overflow-wrap: anywhere; }
.top-label { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.main-area, .main-inner { min-width: 0; }
.main-inner { margin: 0 auto; max-width: 1600px; padding: 19px clamp(16px, 2.8vw, 40px) 28px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.page-head h1 { overflow-wrap: anywhere; font-size: clamp(1.75rem, 3vw, 2.55rem); }
.page-head p { color: var(--muted); margin-top: 5px; }
.page-head > .button { flex-shrink: 0; margin-bottom: 2px; }

.button { display: inline-flex; gap: 8px; justify-content: center; align-items: center; min-height: 41px; padding: 8px 14px; font-size: .9rem; font-weight: 650; line-height: 1.25; border: 1px solid var(--line-dark); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); transition: background .2s, box-shadow .2s; }
.button:hover { background: var(--surface-soft); color: var(--ink); box-shadow: var(--shadow); }
.button.primary { color: #fffdfb; background: #332725; border-color: #332725; box-shadow: 0 7px 18px -10px #29191699; }
.button.primary:hover { color: #fff; background: #4e3b3d; border-color: #4e3b3d; }
.button.danger { color: #fff; background: var(--error); border-color: var(--error); }
.button.danger:hover { background: #872f2e; }
.button.quiet { background: transparent; box-shadow: none; border-color: transparent; color: var(--muted); }
.button.quiet:hover { background: var(--surface-soft); color: var(--ink); }
.button.small { min-height: 34px; padding: 5px 9px; font-size: .8rem; }
.icon-button { display: inline-grid; place-items: center; width: 36px; min-height: 36px; flex: 0 0 auto; border: 0; border-radius: 9px; background: transparent; color: var(--ink-secondary); }
.icon-button:hover { background: var(--surface-soft); color: var(--accent-ink); }
.icon-button.danger-icon:hover { background: var(--error-soft); color: var(--error); }
.text-link { display: inline-flex; color: var(--accent-ink); font-size: .92rem; font-weight: 650; }
.text-link:hover { text-decoration: underline; }

.card, .project-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.desk-hero { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) 142px; align-items: center; min-height: 144px; gap: 18px; padding: 16px clamp(16px, 3vw, 30px); overflow: hidden; border: 1px solid #e9dcee; border-radius: var(--radius-lg); box-shadow: var(--shadow); background: radial-gradient(ellipse at 90% 30%, #e9ddfb 0%, transparent 57%), linear-gradient(120deg, #fff8f1, #f8eef5); }
.desk-hero h2 { font-size: clamp(1.45rem, 3vw, 2.5rem); letter-spacing: -.045em; }
.desk-hero p { max-width: 440px; margin: 5px 0 8px; color: var(--ink-secondary); }
.desk-wave { display: grid; place-items: center; position: relative; min-height: 104px; }
.desk-wave img { width: 76px; height: 76px; position: relative; z-index: 1; box-shadow: 0 19px 42px -16px #70379780; border-radius: 23px; transform: rotate(-11deg); }
.desk-wave::before, .desk-wave::after { content: ""; position: absolute; inset: 0; margin: auto; width: 104px; height: 104px; border: 1px solid #b592e06a; border-radius: 42px; transform: rotate(-11deg); }
.desk-wave::after { width: 124px; height: 124px; border-color: #b592e034; border-radius: 53px; }
.catalog-section { margin-top: 14px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(235px, 100%), 1fr)); gap: 12px; }
.project-card { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 10px; color: var(--ink); transition: box-shadow .2s, border-color .2s, transform .2s; }
.project-card:hover { color: var(--ink); border-color: #cfc0ed; box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.project-label { flex: 1; display: grid; gap: 1px; }
.project-label strong { font-size: .95rem; }
.project-label small { color: var(--muted); }
.project-card > svg { color: var(--muted); width: 1rem; }
.tile-icon { display: inline-grid; place-items: center; width: 43px; height: 43px; flex: 0 0 auto; border-radius: 13px; color: var(--accent-ink); background: var(--accent-soft); }
.tile-icon svg { width: 22px; height: 22px; }
.tile-icon.rose { color: var(--rose); background: var(--rose-soft); }
.subprojects { margin: 0 0 12px; }

.upload-zone { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 13px; border: 2px dashed #896cac; border-radius: var(--radius); background: linear-gradient(121deg, #f9f3fe, #fdf8f2); transition: border-color .2s, box-shadow .2s; }
.upload-zone.drag { border-color: var(--accent); box-shadow: 0 0 0 4px #604eba26; }
.context-head.drag, .dialog form.drag { background: #f5edff; box-shadow: inset 0 0 0 2px #9d8ad6; }
.selected-files { margin: 6px 0 10px; color: var(--ink-secondary); font-size: .86rem; overflow-wrap: anywhere; }
.upload-zone p { margin-top: 4px; color: var(--muted); font-size: .9rem; }
.upload-zone .button { margin-left: auto; flex-shrink: 0; }
.upload-icon { width: 43px; height: 43px; }
.upload-copy { min-width: 0; }
.workspace-section { margin-top: 14px; }
.workspace-head { margin-bottom: 8px; }
.segment { display: inline-flex; gap: 3px; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-soft); }
.segment button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 7px 12px; min-height: 39px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: .9rem; font-weight: 650; }
.segment button[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); border-color: var(--line); }
.segment button span:empty { display: none; }
.segment button span { color: var(--muted); font-weight: 550; font-size: .76rem; }
.panel { overflow: hidden; min-height: 128px; }
.panel-loading { margin: 0; padding: 28px; }
.panel-loading .button { margin-top: 10px; }
.empty { display: grid; justify-items: center; align-content: center; gap: 5px; padding: 15px 16px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 3px; color: var(--accent-ink); background: var(--accent-soft); border-radius: 15px; font-size: 1.16rem; }
.empty h3 { font-size: 1.05rem; }
.empty p { max-width: 420px; color: var(--muted); font-size: .9rem; }
.empty .button { margin-top: 3px; }
.record-list { list-style: none; margin: 0; padding: 0; }
.record-row { display: flex; align-items: center; gap: 11px; padding: 10px 13px; }
.record-row + .record-row { border-top: 1px solid var(--line); }
.job-icon { width: 40px; height: 40px; }
.record-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.record-name strong, .record-name small { display: block; }
.record-name strong { line-height: 1.25; font-size: .96rem; }
.record-name small { margin-top: 4px; color: var(--muted); }
.job-error { margin-top: 6px; color: var(--error); font-size: .87rem; }
.job-status { flex: 0 0 auto; width: 155px; }
.status { display: inline-flex; gap: 5px; align-items: center; padding: 4px 8px; color: var(--muted); background: var(--surface-soft); border-radius: 8px; font-size: .76rem; font-weight: 670; }
.status.running { color: var(--accent-ink); background: var(--accent-soft); }
.status.done { color: var(--positive); background: var(--positive-soft); }
.status.failed { color: var(--error); background: var(--error-soft); }
.job-progress, .form-progress { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .79rem; font-variant-numeric: tabular-nums; }
.job-progress { margin-top: 5px; }
.job-eta { display: block; margin-top: 2px; color: var(--ink-secondary); font-size: .78rem; font-variant-numeric: tabular-nums; }
.job-stage { display: block; margin-top: 3px; color: var(--muted); font-size: .75rem; }
progress { width: 100%; min-width: 0; height: 7px; border: 0; border-radius: 999px; color: var(--accent); accent-color: var(--accent); background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--brand-gradient); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--brand-gradient); border-radius: 999px; }
.downloads, .record-actions { display: inline-flex; align-items: center; gap: 7px; }
.download-alt { display: inline-flex; align-items: center; min-height: 36px; padding: 5px; font-weight: 650; font-size: .78rem; }
.context-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 14px; padding: 19px; border-bottom: 1px solid var(--line); }
.context-head p { max-width: 590px; margin-top: 5px; font-size: .88rem; color: var(--muted); }
.context-head .button { flex-shrink: 0; }

.pipeline-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.architecture-pipelines > h2 { margin-bottom: 12px; }
.pipeline { padding: 24px; align-self: stretch; }
.pipeline > h3 { margin-top: 11px; font-size: 1.48rem; }
.steps { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: steps; }
.steps li { display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 11px; position: relative; padding-bottom: 16px; counter-increment: steps; }
.steps li:last-child { padding-bottom: 0; }
.steps li:not(:last-child)::after { content: ""; width: 1px; position: absolute; top: 27px; bottom: 0; left: 13px; background: var(--line); }
.steps li::before { content: counter(steps); display: grid; place-items: center; width: 27px; height: 27px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 8px; font-size: .76rem; font-weight: 680; }
.steps h4 { padding-top: 3px; }
.steps p, .guide-block p { color: var(--ink-secondary); font-size: .93rem; margin-top: 5px; }
.architecture-results { margin-top: 28px; padding: clamp(16px, 3vw, 26px); background: #f8f4fc; }
.architecture-results-intro { margin-bottom: 17px; }
.architecture-results-intro p, .architecture-output p { color: var(--ink-secondary); margin-top: 5px; font-size: .93rem; }
.architecture-output { display: flex; align-items: flex-start; gap: 13px; padding: 13px 0; border-top: 1px solid #e8deee; }
.architecture-output:last-child { padding-bottom: 0; }
.architecture-output .tile-icon { background: #fff; }
.context-upload-status { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .86rem; color: var(--muted); }
.context-upload-status progress { width: clamp(125px, 24vw, 225px); accent-color: var(--accent); }
.guide-block { padding: 22px 24px; align-self: stretch; }
.guide-block p { max-width: 780px; }
.guide-block .tile-icon { margin-bottom: 9px; }
.main-inner > .guide-block + .guide-block { margin-top: 14px; }
.api-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 15px 0 0; }
.api-options div { padding: 11px; background: var(--surface-soft); border-radius: 10px; overflow-wrap: anywhere; }
.api-options dt { font-weight: 680; font-size: .89rem; }
.api-options dd { margin: 3px 0 0; font-size: .86rem; color: var(--ink-secondary); }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 15px; }
.example { min-width: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.example-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; }
.example-head h3 { font-size: .9rem; }
code { border-radius: 5px; background: var(--surface-soft); color: var(--ink); padding: 1px 4px; font: .9em/1.5 ui-monospace, monospace; }
pre { margin: 0; padding: 13px; width: 100%; max-width: 100%; overflow: auto; background: #30262d; color: #fff5f7; font-size: .79rem; line-height: 1.6; }
pre code { background: none; color: inherit; padding: 0; font-size: 1em; }
.table-wrap { overflow: auto; margin-top: 12px; }
.journal-section + .journal-section { margin-top: 19px; }
.journal-section h2 { margin-bottom: 7px; }
.journal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.journal-head h2 { margin-bottom: 0; }
.journal-table, .audit-table { margin: 0; }
.journal-table table { min-width: 660px; }
.audit-table table { min-width: 510px; }
.journal-table th, .audit-table th { background: #faf5f1; }
.journal-table th, .journal-table td, .audit-table th, .audit-table td { padding: 9px 13px; vertical-align: top; }
.audit-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-table td:last-child { overflow-wrap: anywhere; }
.journal-table td:nth-child(n+3) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.journal-table td:first-child { width: 45%; max-width: 360px; overflow-wrap: anywhere; }
.journal-table td:first-child small { display: block; color: var(--muted); font-size: .78rem; }
.journal-title { display: block; font-weight: 680; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; color: var(--ink-secondary); }
th, td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .84rem; }
tbody tr:last-child td { border-bottom: 0; }
.method { display: inline-flex; padding: 3px 6px; border-radius: 5px; background: var(--positive-soft); color: var(--positive); font-size: .7rem; font-weight: 700; }
.method.post { background: var(--accent-soft); color: var(--accent-ink); }
.method.delete { background: var(--error-soft); color: var(--error); }

.landing { width: min(100%, 1252px); margin-inline: auto; padding-inline: clamp(20px, 5vw, 58px); }
.landing-top { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.landing-top .brand { padding: 0; }
.landing-main { padding: clamp(12px, 2.5vh, 23px) 0 12px; }
.landing-copy { margin-bottom: clamp(12px, 2.4vh, 21px); }
.landing-copy h1 { max-width: 1000px; font-size: clamp(2.2rem, 4.7vw, 3.75rem); font-weight: 750; letter-spacing: -.057em; line-height: 1.14; text-wrap: pretty; }
.landing-copy h1 span { display: inline-block; white-space: nowrap; color: var(--accent-ink); }
.landing-copy p { margin-top: 6px; max-width: 620px; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.1rem); }
.landing-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(250px, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.landing-grid { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: stretch; }
.landing-visual { grid-column: 1 / span 2; grid-row: 1; position: relative; min-width: 0; background: #ebd7cb; }
.landing-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
.login-card { padding: clamp(16px, 2.7vw, 29px); border-radius: var(--radius-lg); }
.landing-grid .login-card { grid-column: 3; grid-row: 1; border-radius: 0; }
.login-card .tile-icon { width: 34px; height: 34px; margin-bottom: 5px; }
.login-card h2 { font-size: clamp(1.5rem, 2.3vw, 1.9rem); }
.login-card form { margin-top: 9px; }
.login-card form .button { margin-top: 9px; min-height: 41px; width: 100%; }
.login-card form > label:not(:first-child) { margin-top: 8px; }
.landing-features { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; border-top: 1px solid var(--line); background: #fbf7f3; }
.landing-features article { display: flex; align-items: flex-start; padding: clamp(8px, 1.5vw, 16px); gap: 9px; }
.landing-features article + article { border-left: 1px solid var(--line); }
.landing-features h2 { font-size: .98rem; }
.landing-features p { margin-top: 4px; color: var(--muted); font-size: .86rem; }
.login, .startup { display: grid; place-items: center; align-content: center; min-height: 100svh; padding: 16px; }
.startup { align-items: center; grid-auto-flow: column; justify-content: center; gap: 10px; color: var(--muted); }
.spinner { display: inline-block; vertical-align: middle; width: 19px; height: 19px; border: 2px solid var(--line-dark); border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dialog { padding: 0; width: min(620px, calc(100% - 28px)); max-height: calc(100svh - 32px); border: 1px solid var(--line); border-radius: 21px; background: var(--surface); color: var(--ink); box-shadow: 0 25px 76px -20px #291f37a0; }
.dialog::backdrop { background: #34273960; backdrop-filter: blur(2px); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 21px 13px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 1.39rem; margin-top: 4px; }
.modal-header p { margin-top: 5px; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.dialog form { padding: 16px 21px 20px; }
form > label, legend { display: block; margin-bottom: 5px; color: var(--ink-secondary); font-size: .88rem; font-weight: 670; }
form > label:not(:first-child) { margin-top: 12px; }
form > input { width: 100%; min-width: 0; min-height: 43px; padding: 8px 11px; background: #fbf7f3; border: 1px solid var(--line-dark); border-radius: 10px; }
form > input:focus { background: #fffdfa; border-color: var(--accent); }
input[type="file"] { font-size: .86rem; }
input::file-selector-button { padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.field-hint { display: block; margin: 4px 0 8px; color: var(--muted); font-size: .78rem; }
fieldset { margin: 13px 0 0; border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice { display: flex; align-items: flex-start; gap: 7px; padding: 9px 8px; border: 1px solid var(--line-dark); border-radius: 10px; font-size: .83rem; cursor: pointer; }
.choice:has(input:checked) { border-color: #b9a6e5; background: #f5effe; }
.choice input { margin: 3px 0 0; accent-color: var(--accent); }
.choice span, .choice strong, .choice small { display: block; }
.choice small { margin-top: 2px; color: var(--muted); font-size: .75rem; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.form-progress { margin-top: 15px; }
.form-progress span { flex-shrink: 0; }
.message { padding: 9px 10px; font-size: .87rem; border-radius: 8px; }
.message.error { background: var(--error-soft); color: var(--error); }
.form-error { margin-top: 9px; }
.notifications { position: fixed; z-index: 60; right: max(12px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: grid; gap: 6px; max-width: min(390px, calc(100vw - 26px)); pointer-events: none; }
.toast { padding: 10px 14px; color: #fff; background: #443232; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .88rem; }
.toast.error { background: var(--error); }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 221px minmax(0, 1fr); }
  .examples { grid-template-columns: minmax(0, 1fr); }
  .landing-features .tile-icon { width: 34px; height: 34px; border-radius: 10px; }
  .landing-features .tile-icon svg { width: 19px; height: 19px; }
}
@media (max-width: 800px) {
  .shell { display: block; }
  .sidebar { position: static; min-height: auto; height: auto; padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0; }
  .side-nav { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 3px 7px; margin: 0; }
  .nav-link { padding: 7px; font-size: .8rem; }
  .side-footer { grid-column: 2; grid-row: 1; align-self: center; margin: 0; padding: 0; }
  .side-footer .button { min-height: 36px; }
  .tree-section { grid-column: 1 / -1; margin: 0; }
  .tree-nav { display: none; }
  .topbar { min-height: 43px; padding: 8px 17px; }
  .top-label { display: none; }
  .main-inner { padding: 15px 15px 25px; }
  .landing-features article { flex-direction: column; }
}
@media (max-width: 590px) {
  .page-head { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .page-head p { margin-top: 5px; font-size: .92rem; }
  .desk-hero { grid-template-columns: minmax(0, 1fr) 65px; min-height: 130px; gap: 8px; padding: 17px; }
  .desk-wave { min-height: 0; }
  .desk-wave img { width: 54px; height: 54px; border-radius: 16px; }
  .desk-wave::before { width: 65px; height: 65px; border-radius: 19px; }
  .desk-wave::after { display: none; }
  .desk-hero p { font-size: .87rem; }
  .desk-hero h2 { font-size: 1.35rem; }
  .upload-zone { display: grid; grid-template-columns: auto 1fr; padding: 15px; gap: 9px 11px; }
  .upload-zone .button { grid-column: 1 / -1; margin-left: 0; justify-self: stretch; }
  .upload-icon { width: 42px; height: 42px; }
  .upload-zone h2 { font-size: 1.15rem; }
  .record-row { padding: 13px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 6px 11px; }
  .record-row .job-status, .record-row .downloads { grid-column: 2; width: min(100%, 210px); }
  .record-row .record-actions { grid-column: 2; }
  .record-row .record-name small { font-size: .76rem; }
  .context-head { grid-template-columns: minmax(0, 1fr); padding: 15px 13px; }
  .context-head .button { justify-self: start; }
  .pipeline-grid, .api-options, .landing-panel { grid-template-columns: minmax(0, 1fr); }
  .pipeline, .guide-block { padding-inline: 15px; }
  .landing-main { padding-top: 12px; }
  .landing-top { min-height: 54px; }
  .landing-grid .login-card { grid-column: 1; grid-row: 1; }
  .landing-visual { grid-column: 1; grid-row: 2; min-height: clamp(104px, 31vw, 175px); }
  .landing-copy h1 { font-size: clamp(2.1rem, 8.7vw, 3.25rem); letter-spacing: -.047em; }
  .landing-copy p { margin-top: 5px; font-size: .92rem; }
  .landing-features article { flex-direction: row; }
  .landing-features article + article { border-left: 0; border-top: 1px solid var(--line); }
  .login-card { padding: 13px 15px; }
}
@media (max-width: 360px) {
  .tree-link, .nav-link { gap: 4px; }
  .option-grid { grid-template-columns: minmax(0, 1fr); }
  .example-head { align-items: flex-start; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 1100px) {
  .job-status { width: 130px; }
  .downloads { flex-wrap: wrap; gap: 4px; }
}
.utility-nav .nav-link { display: inline-flex; align-items: center; gap: 7px; }
.tree-home { color: var(--ink-secondary); }
.utility-nav { display: flex; justify-content: flex-end; gap: 3px; flex-wrap: wrap; }
.utility-nav .nav-link { padding: 7px 8px; font-size: .81rem; }
.project-assistant { padding: clamp(13px, 2vw, 19px); }
.assistant-head { display: flex; gap: 12px; align-items: center; }
.assistant-head p { color: var(--muted); font-size: .88rem; margin-top: 4px; }
#ask-form { display: flex; align-items: flex-end; gap: 9px; margin-top: 14px; }
#ask-form textarea, .dialog select { min-width: 0; border: 1px solid var(--line-dark); border-radius: 9px; padding: 8px 11px; background: var(--surface); }
#ask-form textarea { flex: 1; resize: vertical; }
.template-guide { color: var(--muted); font-size: .86rem; margin-top: 6px; }
.template-guide summary { cursor: pointer; }
.chat-turn { margin-top: 13px; padding: 12px 14px; background: var(--surface-soft); border-radius: 12px; overflow-wrap: anywhere; }
.chat-question { font-weight: 700; }
.chat-question, .chat-answer, .source-content p { white-space: pre-wrap; }
.chat-answer, .chat-pending { margin-top: 8px; }
.chat-sources { padding: 0; margin: 10px 0 0; list-style: none; }
.chat-sources a { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: .88rem; }
.chat-sources a:hover { text-decoration: underline; }
.chat-sources small { color: var(--muted); }
.source-dialog { width: min(1020px, calc(100% - 40px)); min-height: min(430px, calc(100dvh - 40px)); max-height: calc(100dvh - 40px); }
.source-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.source-header { display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; padding: 18px clamp(16px, 4vw, 36px); border-bottom: 1px solid var(--line); }
.source-header > div { min-width: 0; }
.source-header h2 { font-size: clamp(1.2rem, 3vw, 1.65rem); overflow-wrap: anywhere; }
.source-location { display: inline-block; margin-top: 7px; padding: 3px 8px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-ink); font-size: .83rem; font-weight: 650; }
.source-content { padding: clamp(15px, 4vw, 36px); overflow: auto; overflow-wrap: anywhere; }
.source-content p { max-width: 76ch; padding-left: 16px; border-left: 3px solid #a78dc7; line-height: 1.7; }
.source-footer { padding: 11px clamp(16px, 4vw, 36px); border-top: 1px solid var(--line); }
.admin-tabs { margin-bottom: 14px; flex-wrap: wrap; }
.admin-body { padding: clamp(14px, 3vw, 24px); }
.admin-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.admin-body .table-wrap { overflow-x: auto; margin-top: 12px; }
.admin-body table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
.admin-body td, .admin-body th { padding: 10px 7px; border-bottom: 1px solid var(--line); }
.admin-body th { color: var(--muted); }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(114px, 1fr)); gap: 8px; margin: 14px 0; }
.admin-stats div { padding: 10px; border-radius: 9px; background: var(--surface-soft); }
.admin-stats strong, .admin-stats span { display: block; }
.admin-stats span { color: var(--muted); font-size: .82rem; }
.inline-check { display: flex; align-items: center; gap: 8px; }
@media (max-width: 590px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 5px; }
  .utility-nav { justify-content: flex-start; }
  .utility-nav .nav-link { padding-left: 5px; }
  #ask-form { flex-direction: column; align-items: stretch; }
  #ask-form .button { align-self: flex-start; }
  .source-dialog { width: 100%; height: 100dvh; max-height: 100dvh; max-width: 100%; margin: 0; border: 0; border-radius: 0; }
  .source-header { padding-top: max(12px, env(safe-area-inset-top)); }
  .source-footer { padding-bottom: max(11px, env(safe-area-inset-bottom)); }
}

.template-guide dl { margin: 6px 0 0; }
.template-guide dt { font-weight: 650; }
.template-guide dd { margin: 0 0 5px; }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 3px; }

.project-heading { display: flex; align-items: center; gap: 7px; min-width: 0; }
.project-heading h1 { min-width: 0; }
.project-options { position: relative; flex-shrink: 0; }
.project-options summary, .template-picker summary { list-style: none; cursor: pointer; }
.project-options summary::-webkit-details-marker, .template-picker summary::-webkit-details-marker { display: none; }
.project-options[open] summary { background: var(--accent-soft); color: var(--accent-ink); }
.project-options-list { position: absolute; z-index: 3; top: calc(100% + 4px); left: 0; min-width: max-content; display: grid; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-lg); }
.project-options-list .button { justify-content: flex-start; }
.project-options-list [data-action="remove-project"]:hover { background: var(--error-soft); color: var(--error); }
.template-picker { position: relative; }
.template-picker summary { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 1px solid var(--line-dark); border-radius: 10px; background: var(--surface); font-size: .9rem; font-weight: 630; }
.template-picker summary svg { transform: rotate(90deg); color: var(--muted); }
.template-picker[open] summary { border-color: var(--accent); }
.template-picker[open] summary svg { transform: rotate(-90deg); }
.template-options { position: absolute; z-index: 4; inset: calc(100% + 5px) 0 auto; display: grid; gap: 2px; padding: 4px; border: 1px solid var(--line-dark); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-lg); }
.template-options button { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 37px; padding: 5px 8px; border: 0; border-radius: 7px; background: var(--surface); text-align: left; font-size: .88rem; }
.template-options button svg { visibility: hidden; }
.template-options button:hover, .template-options button:focus-visible { background: var(--surface-soft); }
.template-options button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.template-options button[aria-pressed="true"] svg { visibility: visible; }
@media (max-width: 800px) {
  .project-heading { position: relative; }
  .project-options { position: static; }
}
@media (max-width: 590px) {
  .workspace-head .segment { display: flex; flex-wrap: wrap; }
  .workspace-head .segment button { flex: 1 1 auto; gap: 4px; padding-inline: 5px; font-size: .83rem; }
  .landing-copy { margin-bottom: 12px; }
  .login-card > .tile-icon { display: none; }
  .landing-visual { min-height: clamp(90px, 26vw, 135px); }
  .landing-features .tile-icon { width: 28px; height: 28px; }
  .landing-features .tile-icon svg { width: 16px; height: 16px; }
  .landing-features p { margin-top: 2px; font-size: .82rem; }
}
@media (min-width: 591px) and (max-height: 740px) {
  .landing-copy { margin-bottom: 12px; }
  .login-card { padding-block: 18px; }
  .landing-features article { padding-block: 10px; }
}
