:root {
  --ink: #14232f;
  --navy: #102b3f;
  --navy-2: #183b52;
  --teal: #167c80;
  --teal-dark: #0d5d61;
  --teal-pale: #e7f3f1;
  --amber: #f5ad42;
  --amber-pale: #fff4dc;
  --paper: #ffffff;
  --canvas: #edf1f2;
  --line: #d7e0e2;
  --muted: #687983;
  --danger: #b3413e;
  --danger-pale: #fff0ee;
  --shadow: 0 18px 50px rgba(20, 35, 47, .08);
  --sans: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --display: "STZhongsong", "Noto Serif CJK SC", "Songti SC", serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font: 16px/1.55 var(--sans); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, label:focus-within { outline: 3px solid rgba(245, 173, 66, .55); outline-offset: 2px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 268px minmax(0, 1fr); }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 22px; background: var(--navy); color: #dce9ec; overflow-y: auto; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-glyph { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--amber); color: var(--navy); font: 700 23px/1 var(--display); box-shadow: inset 0 -3px 0 rgba(16,43,63,.16); }
.brand-lockup strong { display: block; font-size: 17px; letter-spacing: .04em; }
.brand-lockup small { display: block; margin-top: 1px; color: var(--muted); font: 10px/1.2 var(--mono); letter-spacing: .15em; }
.brand-lockup.inverse small { color: #90aab6; }

.workflow-nav { margin: 60px 0 30px; }
.workflow-nav > p { margin: 0 0 14px 9px; color: #87a2af; font: 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.flow-step { position: relative; width: 100%; display: flex; gap: 13px; align-items: flex-start; padding: 15px 12px; border: 0; border-radius: 10px; background: transparent; color: #a8bdc6; text-align: left; cursor: default; }
.flow-step:not(:last-child)::after { content: ""; position: absolute; left: 25px; top: 47px; width: 1px; height: 24px; background: #365468; }
.flow-step b { position: relative; z-index: 1; flex: 0 0 30px; height: 30px; display: grid; place-items: center; border: 1px solid #446478; border-radius: 50%; font: 10px var(--mono); }
.flow-step span { font-weight: 700; }
.flow-step small { display: block; margin-top: 2px; color: #7893a0; font-size: 12px; font-weight: 400; }
.flow-step.active { background: #173a50; color: white; }
.flow-step.active b { border-color: var(--amber); background: var(--amber); color: var(--navy); }
.flow-step.done b { border-color: #61b0aa; background: var(--teal); color: white; }

.rail-actions { margin-top: auto; display: grid; gap: 2px; }
.rail-actions form { margin: 0; }
.rail-link { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 9px; border: 0; border-radius: 8px; background: transparent; color: #c9d8dd; text-decoration: none; text-align: left; cursor: pointer; }
.rail-link:hover { background: #173a50; color: white; }
.rail-link span { width: 22px; color: var(--amber); font-weight: 700; text-align: center; }
.rail-link.muted { color: #87a2af; }
.rail-foot { margin: 20px 9px 0; padding-top: 18px; border-top: 1px solid #2e4b5e; color: #6f8c99; font-size: 11px; }
.team-switch { display: grid; gap: 7px; margin-top: 26px; font-size: 13px; }
.team-switch select { background: var(--navy-2); color: white; border-color: #446478; }
.people-choice { border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.people-choice summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 14px; }
.people-choice summary small { color: var(--teal-dark); white-space: nowrap; }
.choice-actions { display: flex; gap: 14px; margin-top: 15px; font-size: 13px; }
.people-checkboxes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.people-checkboxes label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.people-checkboxes input { width: 18px; min-height: 18px; accent-color: var(--teal); }
.small-dialog { max-width: 540px; }

.workspace { width: 100%; max-width: 1500px; margin: 0 auto; padding: 36px clamp(22px, 4vw, 64px) 70px; }
.workspace-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.workspace-head h1 { margin: 3px 0 0; font: 700 clamp(29px, 3vw, 42px)/1.2 var(--display); letter-spacing: .03em; }
.section-kicker, .index-label { margin: 0; color: var(--teal-dark); font: 700 11px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.server-state { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.server-state span { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(22,124,128,.1); }

.paper { background: var(--paper); border: 1px solid rgba(16,43,63,.08); border-radius: 18px; box-shadow: var(--shadow); }
.upload-card { position: relative; overflow: hidden; padding: clamp(23px, 3vw, 36px); }
.upload-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: linear-gradient(var(--teal), var(--amber)); }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.card-heading.compact { margin-bottom: 17px; }
.card-heading h2 { margin: 4px 0 0; font-size: 21px; line-height: 1.35; }
.file-rule, .period-badge { padding: 6px 10px; border-radius: 999px; background: var(--teal-pale); color: var(--teal-dark); font: 700 11px var(--mono); white-space: nowrap; }

.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.case-entry { display: flex; align-items: center; gap: 14px; margin: -4px 0 20px; padding: 14px 16px; border: 1px solid #d2e2e2; border-radius: 10px; background: #f1f7f6; }
.case-entry-icon { flex: 0 0 27px; width: 27px; height: 33px; color: var(--teal-dark); }
.case-entry > div { min-width: 0; }
.case-entry strong { font-size: 14px; }
.case-entry p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.case-entry a { flex-shrink: 0; margin-left: auto; padding: 9px 13px; border: 1px solid #aec8ca; border-radius: 7px; color: var(--teal-dark); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: background .2s; }
.case-entry a:hover { background: #e1efec; }
.dropzone { min-height: 185px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; border: 1.5px dashed #9eb5bb; border-radius: 14px; background: repeating-linear-gradient(0deg, transparent 0 27px, rgba(22,124,128,.045) 27px 28px), #f8fbfa; text-align: center; cursor: pointer; transition: border-color .2s, transform .2s, background .2s; }
.dropzone:hover, .dropzone.dragging { border-color: var(--teal); background-color: var(--teal-pale); transform: translateY(-2px); }
.dropzone.has-file { border-style: solid; border-color: var(--teal); background-color: #f0f8f6; }
.drop-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 12px 12px 12px 2px; background: var(--navy); color: white; font: 700 19px var(--display); }
.dropzone strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone small { margin-top: 5px; color: var(--muted); font-size: 13px; }
.action-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 21px; padding-top: 20px; border-top: 1px solid var(--line); }
.action-strip p { margin: 0; color: var(--muted); font-size: 12px; }
.privacy-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--teal); }

.button { min-height: 42px; padding: 9px 18px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { background: var(--navy); color: white; box-shadow: 0 7px 18px rgba(16,43,63,.18); }
.button.primary:hover:not(:disabled) { background: var(--navy-2); box-shadow: 0 9px 22px rgba(16,43,63,.24); }
.button.secondary { border-color: var(--line); background: white; color: var(--teal-dark); }
.button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button.wide { width: 100%; }
.button.large { min-width: 200px; min-height: 50px; padding-inline: 25px; }
.button.small { min-height: 35px; padding: 6px 12px; font-size: 13px; }
.text-button { padding: 4px; border: 0; background: transparent; color: var(--teal-dark); font-weight: 700; cursor: pointer; }

.results-area { margin-top: 22px; }
.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 18px; }
.metric { position: relative; min-height: 106px; padding: 20px; border: 1px solid rgba(16,43,63,.08); border-radius: 14px; background: white; box-shadow: 0 10px 30px rgba(20,35,47,.05); overflow: hidden; }
.metric::after { content: attr(data-unit); position: absolute; right: 13px; bottom: 7px; color: rgba(16,43,63,.07); font: 700 38px var(--display); }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric b { display: block; margin-top: 4px; color: var(--navy); font: 700 27px var(--mono); }
.metric.warn b { color: #9b620e; }
.metric.error b { color: var(--danger); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 18px; }
.matrix-card, .issue-card, .generate-card { padding: 25px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { height: 38px; padding: 7px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
thead th { background: #f1f5f5; color: var(--muted); font-size: 11px; }
th:first-child, td:first-child { position: sticky; left: 0; z-index: 1; background: white; text-align: left; font-weight: 700; }
thead th:first-child { z-index: 2; background: #f1f5f5; }
.rest-day { background: var(--amber-pale) !important; color: #8c5b13; }
.table-note { margin: 10px 2px 0; color: var(--muted); font-size: 11px; }

.issue-list { display: grid; gap: 9px; max-height: 345px; overflow: auto; }
.issue { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 11px; border-radius: 9px; background: var(--amber-pale); color: #665126; font-size: 12px; }
.issue.error { background: var(--danger-pale); color: #772d2b; }
.issue.ok { background: var(--teal-pale); color: var(--teal-dark); }
.issue i { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.8); font-style: normal; font-weight: 800; }

.generate-card { margin-top: 18px; }
.output-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.output-choice { position: relative; display: grid; grid-template-columns: 21px 1fr; gap: 10px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.output-choice:hover { border-color: #93b9b9; }
.output-choice:has(input:checked) { border-color: var(--teal); background: var(--teal-pale); }
.output-choice input { width: 18px; height: 18px; accent-color: var(--teal); }
.output-choice strong { display: block; font-size: 14px; }
.output-choice small { color: var(--muted); font-size: 11px; }
.generation-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 25px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.generation-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-left: auto; }
.progress-wrap { flex: 1; min-width: min(240px, 100%); }
.progress-copy { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.progress-copy b { color: var(--navy); font-family: var(--mono); }
.progress-track { height: 7px; border-radius: 10px; background: #e6ecee; overflow: hidden; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--amber)); transition: width .35s ease; }

.history { margin-top: 34px; }
.section-line { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 13px; }
.section-line h2 { margin: 2px 0 0; font-size: 20px; }
.job-list { display: grid; gap: 9px; }
.job-row { display: grid; grid-template-columns: minmax(0,1.4fr) .7fr .65fr auto; gap: 16px; align-items: center; padding: 14px 17px; border: 1px solid rgba(16,43,63,.08); border-radius: 11px; background: rgba(255,255,255,.74); }
.job-row { cursor: pointer; transition: border-color .15s, background .15s; }
.job-row:hover, .job-row:focus-within { border-color: var(--teal); }
.job-row.selected { border-color: var(--teal); background: var(--teal-pale); }
.job-row.loading { border-style: dashed; }
.job-open { min-width: 0; padding: 0; border: 0; background: transparent; color: var(--navy); font: inherit; text-align: left; cursor: pointer; }
.job-open:focus-visible { outline: 2px solid var(--teal); outline-offset: 5px; border-radius: 3px; }
.job-open-hint { color: var(--teal-dark); }
.workspace-task { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; margin-bottom: 16px; border: 1px solid var(--teal); border-radius: 11px; background: var(--teal-pale); }
.workspace-task strong { overflow-wrap: anywhere; }
.workspace-task .table-note { margin-bottom: 0; }
.job-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-main small, .job-row > span { color: var(--muted); font-size: 12px; }
.status-pill { justify-self: start; padding: 4px 8px; border-radius: 999px; background: #e8edef; color: var(--muted); font-size: 11px !important; font-weight: 700; }
.status-pill.completed { background: var(--teal-pale); color: var(--teal-dark); }
.status-pill.failed { background: var(--danger-pale); color: var(--danger); }
.job-download { color: var(--teal-dark); font-weight: 700; text-decoration: none; }
.empty-state { margin: 0; padding: 20px; border: 1px dashed #b7c5c9; border-radius: 11px; color: var(--muted); text-align: center; }

.settings-dialog { width: min(980px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 28px 90px rgba(8,28,42,.35); }
.settings-dialog::backdrop { background: rgba(7,25,37,.64); backdrop-filter: blur(4px); }
.dialog-shell { display: flex; flex-direction: column; max-height: calc(100vh - 30px); }
.dialog-head, .settings-tabs, .dialog-foot { flex-shrink: 0; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 25px 28px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 3px 0 0; font: 700 29px var(--display); }
.dialog-head p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.icon-button { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--muted); font-size: 24px; cursor: pointer; }
.settings-tabs { display: flex; gap: 8px; padding: 12px 28px 0; border-bottom: 1px solid var(--line); background: #f7f9f9; }
.settings-tab { padding: 12px 18px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.settings-tab:hover { color: var(--teal-dark); }
.settings-tab.active { border-bottom-color: var(--teal); color: var(--teal-dark); background: var(--teal-pale); border-radius: 8px 8px 0 0; }
.settings-body { min-height: 0; padding: 8px 28px 30px; overflow-y: auto; }
.settings-section { padding: 24px 0 0; }
.settings-section h3 { margin: 0 0 15px; font-size: 16px; }
.settings-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.settings-title h3 { margin-bottom: 2px; }
.settings-title p { margin: 0 0 15px; color: var(--muted); font-size: 12px; }
.settings-title .button, .settings-title .count-chip { flex-shrink: 0; white-space: nowrap; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px 18px; }
.field-grid label, .edit-row label { display: grid; gap: 5px; }
.field-grid label > span, .edit-row label > span { color: var(--muted); font-size: 12px; font-weight: 700; }
input, select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #becace; border-radius: 8px; background: white; color: var(--ink); }
input:focus, select:focus { border-color: var(--teal); }
.editable-list { display: grid; gap: 8px; }
.edit-row { display: grid; grid-template-columns: 1fr 1.35fr .8fr 1fr 1fr auto; gap: 8px; align-items: end; padding: 11px; border-radius: 10px; background: #f4f7f7; }
.edit-row.people { grid-template-columns: 1fr .8fr 1fr 1fr 1fr auto; }
.edit-row input, .edit-row select { min-height: 37px; padding: 7px 9px; font-size: 13px; }
.remove-row { width: 35px; height: 35px; border: 0; border-radius: 7px; background: var(--danger-pale); color: var(--danger); cursor: pointer; }
.count-chip { padding: 5px 9px; border-radius: 999px; background: var(--teal-pale); color: var(--teal-dark); font: 700 11px var(--mono); }
.dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 28px; border-top: 1px solid var(--line); background: #f7f9f9; }
.dialog-foot > span { color: var(--teal-dark); font-size: 12px; }

.toast { position: fixed; right: 25px; bottom: 25px; z-index: 100; max-width: min(420px, calc(100vw - 40px)); padding: 13px 17px; border-radius: 10px; background: var(--navy); color: white; box-shadow: 0 15px 40px rgba(16,43,63,.28); opacity: 0; transform: translateY(15px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #7e2f2d; }

.guide-float { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid #305366; border-radius: 50%; background: var(--navy); color: var(--amber); text-decoration: none; box-shadow: 0 6px 20px rgba(16,43,63,.18); transition: transform .2s, box-shadow .2s; animation: guide-entry .45s ease-out both; }
.guide-float:hover { transform: translateY(-2px); box-shadow: 0 9px 24px rgba(16,43,63,.24); }
.guide-float-question { font: 700 27px/1 var(--sans); }
.guide-float-hint { position: absolute; right: calc(100% + 12px); top: 50%; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--navy); box-shadow: 0 4px 15px rgba(16,43,63,.07); font-size: 13px; white-space: nowrap; opacity: 0; visibility: hidden; transform: translate(4px,-50%); pointer-events: none; transition: opacity .18s, transform .18s, visibility .18s; }
.guide-float-hint::after { content: ""; position: absolute; right: -5px; top: calc(50% - 4px); width: 8px; height: 8px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: white; transform: rotate(45deg); }
.guide-float:hover .guide-float-hint, .guide-float:focus-visible .guide-float-hint { opacity: 1; visibility: visible; transform: translate(0,-50%); }
.support-float { position: fixed; right: 24px; bottom: 90px; z-index: 60; }
.support-float::before { content: ""; position: absolute; top: 0; right: 100%; width: 14px; height: 100%; }
.support-trigger { display: grid; place-items: center; width: 54px; height: 54px; padding: 0; border: 1px solid var(--teal-dark); border-radius: 50%; background: var(--teal); color: white; box-shadow: 0 6px 20px rgba(16,43,63,.18); cursor: pointer; transition: background .2s, box-shadow .2s; }
.support-trigger:hover, .support-trigger[aria-expanded="true"] { background: var(--teal-dark); box-shadow: 0 9px 24px rgba(16,43,63,.24); }
.support-trigger svg { width: 29px; height: 29px; }
.support-panel { position: absolute; right: calc(100% + 14px); bottom: -4px; width: 284px; max-height: calc(100dvh - 110px); overflow-y: auto; padding: 20px 18px 15px; border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: 14px; background: var(--paper); color: var(--ink); box-shadow: 0 12px 36px rgba(16,43,63,.16); text-align: center; animation: guide-entry .18s ease-out both; }
.support-panel h2 { margin: 0; font-size: 17px; line-height: 1.5; }
.support-contact { margin: 5px 0 12px; color: var(--teal-dark); font-size: 15px; font-weight: 700; }
.support-qr { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: white; }
.support-caption { margin: 11px 0 0; color: var(--muted); font-size: 12px; }
@keyframes guide-entry { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.inspection-busy { overflow: hidden; }
.inspection-dialog { width: min(360px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); margin: auto; padding: 32px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 65px rgba(16,43,63,.2); text-align: center; }
.inspection-dialog::backdrop { background: rgba(16,43,63,.4); backdrop-filter: blur(2px); }
.inspection-spinner { display: block; width: 42px; height: 42px; margin: 0 auto; border: 3px solid var(--teal-pale); border-top-color: var(--teal); border-radius: 50%; animation: inspection-spin .85s linear infinite; }
.inspection-dialog h2 { margin: 18px 0 7px; font: 700 20px/1.5 var(--sans); outline: none; }
.inspection-dialog p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
@keyframes inspection-spin { to { transform: rotate(360deg); } }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: var(--navy); }
.login-shell { width: min(1120px, 100%); min-height: 660px; display: grid; grid-template-columns: 1.3fr .8fr; overflow: hidden; border-radius: 24px; background: white; box-shadow: 0 38px 100px rgba(0,0,0,.28); }
.login-mark { position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: clamp(40px, 7vw, 90px); background: #e9f1f1; }
.blueprint-grid { position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(rgba(22,124,128,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(22,124,128,.12) 1px, transparent 1px), linear-gradient(rgba(16,43,63,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(16,43,63,.07) 1px, transparent 1px); background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px; }
.login-mark::after { content: "勤"; position: absolute; right: -35px; bottom: -75px; color: rgba(22,124,128,.1); font: 700 310px/1 var(--display); transform: rotate(-6deg); }
.login-mark > *:not(.blueprint-grid) { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 22px; color: var(--teal-dark); font: 700 11px var(--mono); letter-spacing: .18em; }
.login-mark h1 { max-width: 650px; margin: 0; font: 700 clamp(34px, 4.7vw, 63px)/1.2 var(--display); letter-spacing: .02em; }
.login-flow { display: flex; align-items: center; gap: 10px; margin-top: 60px; color: var(--muted); font: 700 11px var(--mono); }
.login-flow i { width: 26px; height: 1px; background: #9fb3b8; }
.login-panel { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(32px, 5vw, 60px); }
.login-form { display: grid; gap: 14px; }
.login-form h2 { margin: 4px 0 0; font: 700 30px var(--display); }
.login-form p { margin: 3px 0 13px; color: var(--muted); font-size: 13px; }
.login-form label { color: var(--muted); font-size: 12px; font-weight: 700; }
.login-form input { min-height: 48px; }
.login-form .form-error { margin: 0; color: var(--danger); }
.privacy-note { margin: 30px 0 0; color: var(--muted); font-size: 11px; }
.privacy-note span { color: var(--teal); }

@media (max-width: 1040px) {
  .app-shell { grid-template-columns: 218px minmax(0,1fr); }
  .rail { padding-inline: 16px; }
  .content-grid { grid-template-columns: 1fr; }
  .issue-list { max-height: none; }
  .output-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .edit-row, .edit-row.people { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .remove-row { grid-column: 2; justify-self: end; }
}

@media (max-width: 760px) {
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .app-shell { display: block; }
  .rail { position: static; width: auto; height: auto; padding: 16px 18px; overflow: visible; }
  .workflow-nav { display: flex; gap: 5px; margin: 22px 0 10px; }
  .workflow-nav > p, .flow-step small, .flow-step::after, .rail-foot { display: none; }
  .flow-step { justify-content: center; padding: 9px 5px; }
  .flow-step b { flex-basis: 25px; width: 25px; height: 25px; }
  .flow-step span { font-size: 12px; }
  .rail-actions { grid-template-columns: repeat(2,1fr); margin-top: 8px; border-top: 1px solid #2e4b5e; padding-top: 8px; }
  .rail-link { justify-content: center; padding-inline: 4px; font-size: 12px; }
  .rail-link span { display: none; }
  .workspace { padding: 24px 15px 50px; }
  .workspace-head { align-items: flex-start; }
  .server-state { display: none; }
  .upload-grid, .metric-row, .field-grid { grid-template-columns: 1fr; }
  .dropzone { min-height: 150px; }
  .metric-row { grid-template-columns: repeat(2,1fr); }
  .output-grid { grid-template-columns: 1fr; }
  .action-strip, .generation-row { align-items: stretch; flex-direction: column; }
  .generation-actions { width: 100%; margin-left: 0; flex-direction: column; }
  .button.large { width: 100%; }
  .settings-tabs { gap: 4px; padding-inline: 16px; }
  .settings-tab { flex: 1; padding-inline: 8px; font-size: 13px; }
  .settings-title { flex-wrap: wrap; justify-content: flex-start; gap: 10px; margin-bottom: 14px; }
  .settings-title > div { flex-basis: 100%; }
  .settings-title p { margin-bottom: 0; }
  .job-row { grid-template-columns: 1fr auto; }
  .job-row > span:not(.status-pill) { display: none; }
  .login-body { padding: 0; background: white; }
  .login-shell { min-height: 100vh; grid-template-columns: 1fr; border-radius: 0; }
  .login-mark { min-height: 300px; padding: 45px 28px; }
  .login-mark h1 { font-size: 37px; }
  .login-flow { margin-top: 36px; }
  .login-panel { gap: 45px; padding: 34px 28px; }
  .workspace { padding-bottom: 110px; }
  .case-entry { flex-wrap: wrap; gap: 10px; padding: 13px; }
  .case-entry > div { flex: 1; }
  .case-entry a { margin: 0 0 0 37px; }
  .guide-float { right: 14px; bottom: 14px; width: 48px; height: 48px; }
  .guide-float-question { font-size: 24px; }
  .support-float { right: 14px; bottom: 74px; }
  .support-trigger { width: 48px; height: 48px; }
  .support-trigger svg { width: 26px; height: 26px; }
  .support-panel { right: 0; bottom: calc(100% + 12px); width: min(284px, calc(100vw - 28px)); max-height: calc(100dvh - 148px); }
  .support-float::before { inset: auto 0 100%; width: 100%; height: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
