@font-face {
  font-family: Manrope;
  src: url('/assets/fonts/manrope-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
:root {
  --bg: #10111d;
  --surface: #191b2b;
  --surface-2: #212439;
  --surface-3: #2b2e47;
  --rail: #141624;
  --editor: #131522;
  --border: #34384f;
  --border-soft: #292c40;
  --field-border: #5b6387;
  --ink: #f1f2fa;
  --muted: #b6bbd1;
  --quiet: #9ea6c1;
  --accent: #b8a4ff;
  --accent-hover: #c9baff;
  --accent-ink: #211735;
  --selected: #2b2544;
  --selected-border: #625083;
  --cyan: #7bd7e5;
  --warn: #edc37a;
  --radius: 14px;
  --body: Manrope, 'Trebuchet MS', sans-serif;
  --mono: 'Cascadia Code', Consolas, monospace;
  --shadow: 0 16px 48px #07081255;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scrollbar-color: var(--field-border) var(--bg); }
textarea, pre, dialog { scrollbar-color: var(--field-border) var(--editor); scrollbar-width: auto; }
html:has(body.light) { scrollbar-color: #939bbb #f5f6fc; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 var(--body); }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a, summary { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; border: 0; }
button:disabled { opacity: .48; cursor: not-allowed; }
button, input, select, textarea { color: var(--ink); }
a { color: inherit; text-decoration: none; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
button, a, input, select, textarea { transition: color 160ms, background-color 160ms, border-color 160ms; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
::selection { background: var(--selected-border); color: var(--ink); }
input, textarea { caret-color: var(--accent); }
input, textarea, select { width: 100%; min-height: 44px; padding: 10px 12px; font-size: 14px; line-height: 1.6; background: var(--editor); border: 1px solid var(--field-border); border-radius: 8px; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--quiet); opacity: 1; }
select { padding-right: 28px; }
p, h1, h2, h3 { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px 18px; background: var(--accent); color: var(--accent-ink); border-radius: 6px; }
.skip-link:focus { top: 12px; }
.skip-link:hover { color: var(--accent-ink); }
.accent, .lime { color: var(--accent); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; width: 236px; padding: 28px 16px 20px; background: var(--rail); border-right: 1px solid var(--border-soft); }
.brand { display: flex; width: max-content; align-items: center; gap: 9px; color: var(--ink); }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.brand-name>span { color: var(--accent); }
.brand-name small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .16em; margin-top: 6px; }
.sidebar-label { margin: 42px 12px 13px; color: var(--quiet); font-size: 12px; font-weight: 600; }
.tool-nav { display: grid; gap: 7px; }
.tool-nav>a { display: flex; align-items: center; gap: 12px; padding: 13px 12px; color: var(--muted); border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 600; }
.tool-nav>a:hover { background: var(--surface-2); color: var(--ink); }
.tool-nav>a[aria-current=page] { background: var(--selected); border-color: var(--selected-border); color: var(--accent); }
.tool-nav small { display: block; margin-top: 3px; color: var(--quiet); font-size: 12px; font-weight: 400; }
.nav-icon { display: flex; align-items: center; }
.nav-icon .icon { width: 21px; height: 21px; }
.nav-arrow { margin-left: auto; opacity: 0; }
.nav-arrow .icon { width: 14px; height: 14px; }
.tool-nav>a[aria-current=page] .nav-arrow { opacity: 1; }
.sidebar-bottom { margin-top: auto; padding-top: 36px; }
.privacy-note { padding: 18px 14px 17px; border-top: 1px solid var(--border); margin-bottom: 13px; }
.privacy-symbol { color: var(--cyan); float: right; }
.privacy-symbol .icon { width: 22px; height: 22px; }
.privacy-note strong { font-size: 13px; font-weight: 650; line-height: 1.5; }
.privacy-note p { max-width: 24ch; margin: 11px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.privacy-note a { color: var(--accent); font-size: 12px; }
.sidebar-button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 11px 12px; color: var(--muted); background: none; text-align: left; font-size: 12px; border-radius: 8px; }
.sidebar-button:hover { color: var(--ink); background: var(--surface-2); }
.sidebar-button .icon { width: 18px; height: 18px; }
.sidebar-foot { display: flex; justify-content: space-between; margin: 25px 10px 0; color: var(--quiet); font-size: 12px; }
.workspace { margin-left: 236px; padding: 0 38px; max-width: 1800px; }
.topbar { display: flex; height: 68px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-soft); color: var(--muted); font-size: 12px; }
.topbar>div { display: flex; align-items: center; gap: 13px; }
.local-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }
.page-intro { display: flex; min-height: 143px; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 0 26px; }
h1 { margin: 0 0 10px; font-size: 34px; font-weight: 750; line-height: 1.2; letter-spacing: -.035em; }
.page-intro p { color: var(--muted); font-size: 13px; margin: 0; max-width: 65ch; }
.intro-note { display: flex; align-items: center; justify-content: flex-end; flex-shrink: 0; width: 116px; height: 104px; }
.intro-note img { display: block; width: 116px; height: 116px; object-fit: contain; }
.document-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 0 16px; }
.document-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.document-name>.icon { width: 17px; height: 17px; color: var(--quiet); }
.document-name input { background: none; border: 0; border-radius: 3px; font-size: 12px; font-weight: 600; min-height: 32px; max-width: 270px; padding: 4px 0; }
.small-status { font-size: 12px; color: var(--quiet); white-space: nowrap; }
.document-actions { display: flex; align-items: center; gap: 18px; }
.text-button { display: inline-flex; align-items: center; gap: 6px; background: none; color: var(--muted); font-size: 12px; padding: 5px 0; min-height: 32px; white-space: nowrap; }
.text-button:hover { color: var(--accent); }
.text-button .icon { width: 15px; height: 15px; }
.work-grid { display: grid; grid-template-columns: minmax(300px,.92fr) minmax(350px,1.08fr); gap: 22px; align-items: start; }
.panel { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.panel-heading>div { display: flex; align-items: center; gap: 10px; }
.panel-heading h2 { font-size: 14px; font-weight: 700; letter-spacing: -.015em; margin: 0; }
.panel-body { padding: 22px; }
.field-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 20px 0 7px; font-size: 12px; font-weight: 650; }
.field-label:first-child { margin-top: 0; }
#image-style-fields>.field-label:first-child { margin-top: 20px; }
.field-label span { color: var(--quiet); font-size: 12px; font-weight: 500; text-transform: lowercase; }
.field-label .required-label { color: var(--accent); }
.field-hint { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 0 0 9px; }
.form-divider { display: flex; align-items: center; gap: 10px; margin: 21px 0; }
.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.form-divider span { color: var(--quiet); font-size: 12px; text-transform: lowercase; }
.advanced { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 12px; }
.advanced summary { display: flex; align-items: center; justify-content: space-between; min-height: 36px; cursor: pointer; list-style: none; font-size: 12px; font-weight: 500; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary .icon { width: 16px; height: 16px; color: var(--quiet); transition: transform 160ms; }
.advanced[open] summary .icon { transform: rotate(180deg); }
.advanced-body { padding-top: 8px; }
.variables-section { border-top: 1px solid var(--border); padding: 16px 22px 19px; }
.section-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.section-line strong { color: var(--ink); font-size: 12px; font-weight: 650; }
.variable-row { border-top: 1px solid var(--border-soft); padding-top: 14px; margin-top: 12px; }
.variable-row .field-label { margin-top: 0; }
.variable-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--quiet); font: 12px/1.5 var(--mono); }
.variable-meta button { padding: 8px 0; background: none; color: var(--muted); font: 12px var(--body); }
.variable-meta button:hover { color: var(--accent); }
.editor-panel { position: sticky; top: 18px; }
.mode-badge { padding: 3px 7px; border: 1px solid var(--border); border-radius: 5px; color: var(--cyan); font-size: 12px; font-weight: 600; letter-spacing: .025em; }
.mode-badge.manual { color: var(--accent); border-color: var(--selected-border); }
.editor-toolbar { display: flex; justify-content: space-between; align-items: center; min-height: 42px; padding: 8px 22px; border-bottom: 1px solid var(--border-soft); }
.editor-toolbar>span { color: var(--quiet); font-size: 12px; font-weight: 500; text-transform: lowercase; }
.editor-toolbar>label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.editor-toolbar select { border: 0; border-radius: 3px; background: var(--surface); font-size: 12px; min-height: 26px; padding: 2px 20px 2px 4px; }
.editor-area { padding: 22px 22px 5px; background: var(--editor); }
.editor-area textarea { height: 360px; min-height: 280px; max-height: 1000px; border: 0; border-radius: 0; padding: 0; background: transparent; font: 13px/1.8 var(--mono); }
.editor-area textarea:focus { outline: 0; }
.editor-area:focus-within { box-shadow: inset 0 0 0 1px var(--selected-border); }
.editor-area textarea::placeholder { color: var(--quiet); font: 13px/1.95 var(--body); }
.editor-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; color: var(--quiet); background: var(--editor); font-size: 12px; font-variant-numeric: tabular-nums; }
.editor-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding: 16px 20px 12px; }
.button-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 10px 14px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; line-height: 1.4; }
.button .icon { width: 16px; height: 16px; }
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.primary:active { background: var(--accent); }
.secondary { background: var(--surface-2); border-color: var(--field-border); color: var(--ink); }
.secondary:hover { background: var(--surface-3); border-color: var(--accent); }
.danger { background: #5e302d; border-color: #b77870; color: #ffede7; }
.danger:hover { background: #743b36; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 38px; min-height: 38px; padding: 8px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--field-border); border-radius: 8px; }
.icon-button:hover { color: var(--accent); border-color: var(--accent); }
.icon-button .icon { width: 18px; height: 18px; }
.editor-footnote { color: var(--quiet); font-size: 12px; margin: 0; padding: 0 22px 16px; }
.editor-warnings { color: #f4d79f; background: #362c1e; border-bottom: 1px solid #6e5937; padding: 11px 22px; font-size: 12px; }
.editor-warnings.empty-prompt { color: var(--quiet); background: var(--editor); border-color: var(--border-soft); font-size: 12px; }
.workspace-tip { display: flex; align-items: center; gap: 13px; padding: 22px 0 28px; margin-top: 5px; }
.workspace-tip .icon { color: var(--accent); width: 20px; height: 20px; }
.workspace-tip p { color: var(--muted); font-size: 12px; margin: 0; max-width: 70ch; }
.workspace-tip strong { display: block; color: var(--ink); font-size: 12px; font-weight: 650; margin-bottom: 3px; }
.workspace-tip>a { color: var(--accent); font-size: 12px; white-space: nowrap; margin-left: auto; }
.workspace-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0 24px; border-top: 1px solid var(--border-soft); color: var(--quiet); font-size: 12px; }
.workspace-footer>div { display: flex; align-items: center; gap: 18px; }
.notice { padding: 16px 20px; border: 1px solid #8a7045; border-radius: 10px; color: #f4d79f; background: #362c1e; margin-bottom: 20px; font-size: 12px; }
.notice button { margin: 10px 10px 0 0; }
.inline-info { padding: 13px 14px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 12px; margin-bottom: 18px; }
.analysis-intro h3 { font-size: 22px; letter-spacing: -.025em; font-weight: 700; margin-bottom: 12px; }
.analysis-intro p { color: var(--muted); font-size: 12px; line-height: 1.75; }
.analysis-intro .button { width: 100%; margin: 6px 0 22px; }
.analysis-summary { background: #18333a; border: 1px solid #4b7883; border-radius: 8px; padding: 14px; margin-bottom: 14px; color: #cbf3f5; font-size: 12px; }
.analysis-summary.stale { background: #362c1e; border-color: #8a7045; color: #f4d79f; }
.analysis-check { margin: 10px 0; border-bottom: 1px solid var(--border); }
.analysis-check summary { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; cursor: pointer; font-size: 12px; }
.check-status { color: var(--muted); font-size: 12px; white-space: nowrap; }
.analysis-check.issue .check-status { color: var(--warn); }
.analysis-check.pass .check-status { color: var(--cyan); }
.check-body { padding: 0 0 16px; color: var(--muted); font-size: 12px; }
.check-body p { margin: 4px 0 10px; }
.check-body code { overflow-wrap: anywhere; font-size: 12px; }
.check-body .text-button { margin-left: 10px; }
.check-limit { color: var(--quiet); font-size: 12px; }
.empty-copy { color: var(--muted); font-size: 12px; padding: 14px 0; }
.vault-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.segmented button { min-height: 36px; padding: 8px 13px; border-radius: 7px; color: var(--muted); background: none; font-size: 12px; font-weight: 500; }
.segmented button[aria-pressed=true] { background: var(--selected); color: var(--accent); }
.vault-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.search-field { flex: 1; min-width: 220px; position: relative; }
.search-field>.icon { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; color: var(--quiet); }
.search-field input { padding-left: 40px; }
.vault-filters>select { max-width: 186px; }
.check-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; cursor: pointer; }
.check-label input { width: 16px; height: 16px; min-height: 16px; accent-color: var(--accent); }
.vault-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 17px; margin: 22px 0 40px; }
.vault-card { display: flex; flex-direction: column; min-width: 0; padding: 23px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); transition: border-color 160ms; }
.vault-card:hover { border-color: var(--selected-border); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 20px; }
.category-tag { color: var(--accent); font-size: 12px; font-weight: 650; }
.kind-tag { color: var(--quiet); font-size: 12px; text-transform: lowercase; }
.vault-card h3 { font-size: 18px; font-weight: 700; line-height: 1.4; letter-spacing: -.025em; margin-bottom: 10px; overflow-wrap: anywhere; }
.vault-card p { color: var(--muted); font-size: 12px; margin-bottom: 20px; overflow-wrap: anywhere; white-space: pre-wrap; }
.card-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.card-footer .button { min-height: 35px; padding: 8px 11px; font-size: 12px; }
.card-footer .text-button { font-size: 12px; }
.card-footer [aria-pressed=true] .icon { fill: currentColor; }
.card-footer time { color: var(--quiet); font-size: 12px; }
.card-footer .field-hint { margin: 0; font-size: 12px; }
.empty-state { grid-column: 1/-1; text-align: center; padding: 46px 24px 60px; }
.empty-state img { width: 120px; height: 120px; margin-bottom: 18px; object-fit: contain; }
.empty-state h3 { font-size: 25px; font-weight: 700; letter-spacing: -.025em; margin-bottom: 9px; }
.empty-state p { color: var(--muted); font-size: 13px; }
.toast { position: fixed; bottom: 22px; left: calc(50% + 118px); transform: translateX(-50%); max-width: calc(100vw - 40px); padding: 13px 20px; background: var(--accent); color: var(--accent-ink); border-radius: 10px; box-shadow: var(--shadow); font-size: 12px; font-weight: 600; z-index: 99; }
.toast.error { color: #34220e; background: #edc37a; }
dialog { width: min(640px,calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 28px; border: 1px solid var(--selected-border); border-radius: 16px; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: #080a16ce; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.dialog-header h2 { font-size: 23px; font-weight: 700; line-height: 1.35; letter-spacing: -.025em; margin: 0; }
.dialog-header .icon-button { border: 0; background: none; }
#dialog-body { color: var(--muted); font-size: 13px; line-height: 1.75; }
#dialog-body p { margin-bottom: 14px; max-width: 70ch; }
#dialog-body strong { color: var(--ink); }
#dialog-body pre { max-height: 230px; overflow: auto; padding: 16px; background: var(--editor); border: 1px solid var(--border); border-radius: 8px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.8 var(--mono); }
#dialog-body textarea { min-height: 150px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; margin-top: 22px; }
.dialog-actions .button { font-size: 12px; }
.dialog-form .field-label { margin-top: 16px; }
.dialog-form input[type=checkbox] { width: 18px; min-height: 18px; accent-color: var(--accent); }
.shortcut-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); padding: 10px 0; }
kbd { padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--editor); font: 12px var(--mono); white-space: nowrap; }
.page-intro>div:first-child { min-width: 0; }
body.light { --bg: #f5f6fc; --surface: #ffffff; --surface-2: #eff0f9; --surface-3: #e7e9f6; --rail: #eceef8; --editor: #f9faff; --border: #cbd0e5; --border-soft: #dce0ef; --field-border: #939bbb; --ink: #24283e; --muted: #555e7e; --quiet: #646d8b; --accent: #6943c4; --accent-hover: #5833b1; --accent-ink: #ffffff; --selected: #e5dcfb; --selected-border: #9982ce; --cyan: #176c81; --warn: #805300; --shadow: 0 16px 48px #23234222; color-scheme: light; }
.light .analysis-summary { background: #e6f3f6; border-color: #78a6b1; color: #245665; }
.light .editor-warnings, .light .notice, .light .analysis-summary.stale { background: #fff0cf; border-color: #bf9e64; color: #674a1b; }
.light .editor-warnings.empty-prompt { color: var(--quiet); background: var(--editor); border-color: var(--border-soft); }
@media (min-width: 1600px) { .workspace { padding-right: 60px; padding-left: 60px; } .work-grid { grid-template-columns: minmax(360px,.9fr) minmax(440px,1.1fr); } .page-intro { padding-top: 32px; padding-bottom: 30px; } }
@media (max-width: 1200px) { .sidebar { width: 212px; padding-right: 12px; padding-left: 12px; } .brand-name { font-size: 15px; } .brand img { width: 39px; height: 39px; } .workspace { margin-left: 212px; padding: 0 26px; } .work-grid { grid-template-columns: minmax(270px,.95fr) minmax(300px,1.05fr); gap: 17px; } .panel-body, .panel-heading { padding: 18px; } .editor-bottom { padding-right: 16px; padding-left: 16px; } .editor-bottom .button { padding-right: 11px; padding-left: 11px; } .vault-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .toast { left: calc(50% + 106px); } .small-status { display: none; } }
@media (max-width: 980px) { .sidebar { width: 80px; padding: 24px 10px; } .brand { justify-content: center; width: auto; } .brand-name { display: none; } .brand img { width: 48px; height: 48px; } .sidebar-label { font-size: 0; margin: 26px 0 10px; } .tool-nav>a { justify-content: center; padding: 15px 8px; } .tool-nav>a>span:not(.nav-icon) { display: none; } .tool-nav .icon { width: 23px; height: 23px; } .sidebar-bottom { padding-top: 24px; } .privacy-note, .sidebar-foot { display: none; } .sidebar-button { justify-content: center; padding: 14px 8px; font-size: 0; } .sidebar-button .icon { width: 20px; height: 20px; } .workspace { margin-left: 80px; } .document-name input { max-width: 230px; } .toast { left: calc(50% + 40px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

.brand-bar { display: flex; align-items: center; justify-content: space-between; }
.mobile-menu, .mobile-nav-label, .mobile-workspace-nav { display: none; }
@media (max-width: 760px) {
  .sidebar { position: static; display: block; width: auto; padding: 10px max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left)); border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { justify-content: flex-start; min-height: 44px; }
  .brand img { width: 36px; height: 36px; }
  .brand-name { display: block; font-size: 17px; }
  .brand-name small { margin-top: 4px; font-size: 12px; }
  .sidebar-label, .sidebar-bottom, .topbar { display: none; }
  .mobile-menu { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 10px; color: var(--muted); background: none; border-radius: 8px; }
  .tool-nav { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; margin-top: 10px; }
  .tool-nav>a { min-height: 56px; justify-content: center; flex-direction: column; gap: 4px; padding: 7px 2px; border-radius: 8px 8px 0 0; font-size: 13px; }
  .tool-nav>a>.desktop-nav-label, .tool-nav>a>.nav-arrow { display: none; }
  .tool-nav>a>span.mobile-nav-label { display: block; }
  .tool-nav .icon { width: 18px; height: 18px; }
  .workspace { margin-left: 0; padding: 0 max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left)); }
  .page-intro { min-height: 0; padding: 20px 0 16px; }
  h1 { font-size: 27px; margin-bottom: 6px; }
  .page-intro p { font-size: 14px; line-height: 1.6; }
  .intro-note { display: none; }
  .document-bar { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; padding-bottom: 6px; }
  .document-name { display: block; }
  .document-name>.icon, .document-name>.small-status { display: none; }
  .document-name input { max-width: none; min-height: 44px; font-size: 16px; padding: 8px 0; text-overflow: ellipsis; }
  .document-actions { justify-content: flex-end; gap: 20px; }
  .document-actions .text-button { min-height: 44px; font-size: 14px; }
  .mobile-workspace-nav { position: sticky; top: 0; z-index: 9; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px 0 12px; background: var(--bg); }
  .mobile-workspace-nav button { min-height: 44px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-weight: 650; color: var(--muted); background: var(--surface); }
  .mobile-workspace-nav button:hover { color: var(--ink); background: var(--surface-2); }
  .mobile-workspace-nav button[aria-pressed=true] { color: var(--accent); border-color: var(--selected-border); background: var(--selected); }
  #document-view[data-mobile-pane=configuration] .editor-panel, #document-view[data-mobile-pane=editor] .configuration-panel { display: none; }
  .work-grid { grid-template-columns: minmax(0,1fr); }
  .editor-panel { position: static; }
  .panel-body, .panel-heading { padding: 18px; }
  .panel-heading { min-height: 56px; }
  .panel-heading h2 { font-size: 15px; }
  .field-label { font-size: 14px; }
  .field-label span, .field-hint { font-size: 13px; }
  input, textarea, select { font-size: 16px; }
  .variables-section { padding: 16px 18px 20px; }
  .advanced>summary { min-height: 44px; font-size: 14px; }
  .editor-toolbar { display: grid; grid-template-columns: minmax(0,1fr); gap: 4px; padding: 10px 18px; }
  .editor-toolbar label, .editor-toolbar>span { font-size: 13px; }
  .editor-toolbar>label { justify-content: space-between; }
  .editor-toolbar select { width: auto; min-width: 140px; min-height: 44px; font-size: 16px; }
  .editor-area { padding: 16px 18px 4px; }
  .editor-area textarea { height: clamp(220px,36dvh,420px); min-height: 220px; font-size: 16px; line-height: 1.65; }
  .editor-meta { padding: 12px 18px; font-size: 12px; }
  .editor-bottom { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; padding: 14px 18px; }
  .editor-bottom>.button-group { display: flex; gap: 10px; }
  .editor-bottom>.button-group:first-child { display: grid; grid-template-columns: 1.2fr 1fr; }
  .editor-bottom .button { flex: 1; min-width: 0; min-height: 44px; gap: 6px; padding: 10px 8px; font-size: 14px; justify-content: center; white-space: nowrap; }
  .editor-bottom .icon-button { min-width: 44px; min-height: 44px; }
  .editor-footnote { padding: 0 18px 18px; font-size: 13px; }
  .editor-warnings { padding: 10px 18px; font-size: 13px; }
  .workspace-tip { padding-top: 20px; align-items: flex-start; }
  .workspace-tip p, .workspace-tip strong { font-size: 13px; }
  .workspace-tip>a { display: none; }
  .workspace-footer { padding-bottom: max(24px,env(safe-area-inset-bottom)); }
  .workspace-footer>span { display: none; }
  .workspace-footer>div { width: 100%; justify-content: space-between; gap: 12px; }
  .vault-grid { grid-template-columns: minmax(0,1fr); }
  .vault-toolbar>.button-group { width: 100%; }
  .vault-toolbar .button { min-height: 44px; font-size: 13px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; min-height: 44px; font-size: 14px; }
  .vault-filters>select { flex: 1; min-width: 120px; max-width: none; }
  .search-field { min-width: 100%; }
  .section-line { align-items: flex-start; font-size: 13px; }
  #vault-storage-status { max-width: 65%; }
  .vault-card { padding: 20px; }
  .analysis-check summary, .check-body, .check-status { font-size: 14px; }
  .analysis-check summary { min-height: 44px; }
  dialog { padding: 20px; }
  .dialog-actions { justify-content: stretch; }
  .dialog-actions>.button { flex: 1; min-height: 44px; }
  .dialog-header h2 { font-size: 21px; }
  .toast { left: 50%; width: calc(100% - 32px); bottom: max(16px,env(safe-area-inset-bottom)); font-size: 13px; text-align: center; }
}
.builder-modebar { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.builder-modebar button { min-height: 44px; padding: 9px 12px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; border-radius: 8px; }
.builder-modebar button[aria-pressed=true] { color: var(--accent); background: var(--selected); }
.builder-modebar button:hover { background: var(--surface-2); color: var(--ink); }
.engineer-input-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.engineer-input-modes button { min-height: 44px; padding: 9px 10px; background: var(--editor); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 13px; }
.engineer-input-modes button[aria-pressed=true] { color: var(--accent); border-color: var(--selected-border); background: var(--selected); }
.engineer-intro { margin: 16px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.engineer-workspace>.field-label { margin-top: 0; font-size: 14px; }
.engineer-workspace textarea { min-height: 94px; }
.engineer-field-line { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 16px 0 6px; }
.engineer-field-line label { font-size: 14px; font-weight: 600; }
.engineer-options { margin: 14px 0; }
.engineer-options summary { min-height: 44px; padding: 10px 0; color: var(--muted); cursor: pointer; font-size: 13px; }
.engineer-options select { margin-top: 5px; }
.engineer-consent { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 7px; font-size: 13px; line-height: 1.7; }
.engineer-consent input { width: 20px; height: 20px; min-height: 20px; margin: 2px 0 0; padding: 0; accent-color: var(--accent); flex-shrink: 0; }
.engineer-privacy { margin: 0 0 18px; color: var(--quiet); font-size: 12px; line-height: 1.7; }
.engineer-privacy a { color: var(--accent); text-decoration: underline; }
.engineer-actions { flex-wrap: wrap; }
.engineer-actions .button { min-height: 44px; }
.engineer-status { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.engineer-status.error { color: var(--warn); }
.engineer-results:empty { display: none; }
.engineer-results { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.engineer-results h3 { font-size: 16px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 9px; }
.engineer-understood>p { font-size: 14px; line-height: 1.75; margin: 0 0 16px; }
.engineer-disclosure { border-top: 1px solid var(--border-soft); }
.engineer-disclosure summary { min-height: 44px; padding: 11px 0; color: var(--muted); font-size: 13px; cursor: pointer; }
.engineer-disclosure h4 { margin: 12px 0 6px; font-size: 13px; }
.engineer-disclosure p, .engineer-disclosure li { color: var(--muted); font-size: 13px; line-height: 1.75; }
.engineer-disclosure ul { padding-left: 20px; margin: 0 0 16px; }
.engineer-disclosure blockquote { margin: 12px 0 8px; padding: 0; color: var(--ink); font-size: 13px; }
.engineer-answer-hint, .engineer-review-note { color: var(--quiet); font-size: 12px; line-height: 1.7; margin: 16px 0; }
.engineer-results .field-label { font-size: 14px; align-items: flex-start; }
.engineer-proposal-title { margin-top: 20px !important; }
.engineer-proposal { background: var(--editor); margin: 0 0 16px; padding: 16px; max-height: 430px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font: 13px/1.8 var(--mono); border-radius: 8px; }
.engineer-results>.button { min-height: 44px; margin-bottom: 14px; }
.engineer-change, .engineer-issue { padding: 10px 0; border-top: 1px solid var(--border-soft); }
.engineer-change:first-of-type, .engineer-issue:first-of-type { border-top: 0; }
@media (max-width: 760px) {
  .builder-modebar { padding: 8px 12px; }
  .builder-modebar button, .engineer-input-modes button { font-size: 14px; }
  .engineer-workspace input:not([type=checkbox]), .engineer-workspace select, .engineer-workspace textarea { font-size: 16px; }
  .engineer-consent { font-size: 14px; min-height: 44px; }
  .engineer-intro, .engineer-status, .engineer-disclosure p, .engineer-disclosure li, .engineer-disclosure summary { font-size: 14px; }
  .engineer-privacy, .engineer-answer-hint, .engineer-review-note { font-size: 13px; }
  .engineer-proposal { padding: 14px; font-size: 14px; }
  .engineer-field-line { align-items: flex-start; }
  .engineer-field-line .text-button { min-height: 44px; white-space: normal; text-align: right; }
  .engineer-actions .button { font-size: 14px; }
}


.engineer-brief>summary { min-height: 44px; padding: 10px 0; color: var(--accent); font-size: 13px; cursor: pointer; }
.engineer-brief[open]>summary { display: none; }
.engineer-brief .field-label { font-size: 14px; }
.engineer-brief .engineer-input-modes { margin-bottom: 4px; }
