:root {
  --ink: #18283d;
  --ink-soft: #4b5c72;
  --paper: #f5f8fc;
  --sheet: #ffffff;
  --line: #d9e2ee;
  --line-dark: #9cacc1;
  --blue: #2d5e9f;
  --blue-hover: #254f88;
  --focus: #326bb8;
  --active-line: #8eafe0;
  --date-surface: #fff4e7;
  --date-line: #e8c6a5;
  --date-ink: #784522;
  --warning-bg: #fff6e6;
  --warning-ink: #754718;
  --signal: #a33431;
  --success: #17624f;
  --success-hover: #104f40;
  --mist: #edf4ff;
  --shadow: 0 12px 34px rgba(33, 60, 102, .07);
  --radius: 15px;
  --control-radius: 10px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px max(18px, calc((100% - 1180px) / 2));
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand strong { display: block; font-size: 16px; }
.brand small { display: block; margin-top: 1px; color: var(--ink-soft); font-size: 11px; }
.brand-mark { width: 36px; height: 36px; flex: none; display: grid; align-content: center; gap: 4px; padding: 8px; border-radius: 11px; background: var(--mist); }
.brand-mark i { height: 2px; border-radius: 2px; background: var(--blue); }
.brand-mark i:nth-child(2) { width: 72%; }
.brand-mark i:nth-child(3) { width: 44%; }

.page-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 30px 0 80px; }
.page-heading, .generator-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(27px, 4vw, 36px); line-height: 1.18; letter-spacing: -.035em; }
h2 { margin-bottom: 7px; font-size: clamp(22px, 3vw, 28px); line-height: 1.22; letter-spacing: -.025em; }
h3 { margin-bottom: 4px; font-size: 19px; line-height: 1.35; }
p { color: var(--ink-soft); line-height: 1.7; }
.document-code { margin-bottom: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }

.primary-button, .secondary-button, .quiet-button, .icon-button {
  min-height: 44px;
  border: 0;
  border-radius: var(--control-radius);
  cursor: pointer;
  font-weight: 700;
  transition: background-color .12s ease, border-color .12s ease;
}
.primary-button { padding: 0 22px; color: white; background: var(--blue); }
.primary-button:hover:not(:disabled) { background: var(--blue-hover); }
.primary-button:disabled { cursor: not-allowed; color: #54677e; background: #e4ebf5; }
.secondary-button { padding: 0 22px; color: var(--blue-hover); background: var(--mist); border: 1px solid #cadaef; }
.secondary-button:hover:not(:disabled), .quiet-button:hover { background: #e6f0ff; }
.secondary-button:disabled { cursor: not-allowed; opacity: .62; }
.quiet-button { padding: 0 15px; color: var(--blue-hover); background: var(--sheet); border: 1px solid var(--line); }
a.quiet-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.icon-button { width: 44px; padding: 0; color: var(--ink); background: transparent; font-size: 28px; }
.wide { width: 100%; }
:is(button, a, input, textarea, select):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.file-drop:has(input:focus-visible), .file-button:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
input[type="checkbox"] { accent-color: var(--blue); }

.project-list { margin-top: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); }
.project-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 82px;
  padding: 14px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.project-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.project-row:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.project-row:only-child { border-radius: var(--radius); }
.project-row:hover { background: var(--mist); }
.project-index { color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.project-main strong, .project-main small { display: block; }
.project-main strong { margin-bottom: 6px; font-size: 19px; }
.project-main small { overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.project-status { padding: 5px 9px; color: var(--warning-ink); background: var(--warning-bg); border-radius: 999px; font-size: 12px; font-weight: 600; }
.project-status.ready { color: var(--success); background: #e6f4ef; }

.empty-state { position: relative; overflow: hidden; margin-top: 30px; padding: 48px clamp(24px, 7vw, 64px); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); }
.empty-state > * { position: relative; max-width: 560px; }
.empty-grid { display: none; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 16px; color: var(--ink-soft); font-size: 13px; }
.breadcrumb a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.project-banner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px;
  align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.project-banner h1 { margin: 0; font-size: clamp(21px, 3vw, 27px); overflow-wrap: anywhere; }
.project-banner .quiet-button { white-space: nowrap; }
.project-banner p { grid-column: 1 / -1; margin: 0; font-size: 13px; }

.source-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.source-strip > div { min-width: 0; }
.source-strip span, .source-strip strong, .source-strip small { display: block; }
.source-strip span { color: var(--ink-soft); font-size: 12px; }
.source-strip strong { margin: 4px 0; overflow-wrap: anywhere; }
.source-strip small { color: var(--ink-soft); }
.file-button { display: inline-flex; align-items: center; white-space: nowrap; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.upload-sheet { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; margin-top: 26px; padding: 32px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); }
.sheet-corner { display: inline-block; margin-bottom: 16px; padding: 5px 10px; background: var(--mist); color: var(--blue-hover); border-radius: 999px; font-size: 12px; font-weight: 600; }
.upload-form { display: flex; flex-direction: column; gap: 18px; }
.file-drop { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; border: 1px dashed var(--line-dark); border-radius: var(--radius); background: var(--paper); cursor: pointer; }
.file-drop:hover { border-color: var(--blue); }
.file-drop input { position: absolute; opacity: 0; pointer-events: none; }
.file-drop-title { font-weight: 700; }
.file-drop-name { margin-top: 8px; color: var(--ink-soft); font-size: 13px; }

.generator, #revision { margin-top: 24px; }
.generator-heading { align-items: center; gap: 16px; margin-bottom: 16px; }
.generator-heading h2 { font-size: clamp(25px, 3.2vw, 36px); line-height: 1.14; }
.generator-heading p:last-child { margin-bottom: 0; font-size: 14px; }
.date-ticket {
  min-width: min(235px, 100%); padding: 11px 13px 10px; background: var(--date-surface);
  border: 1px solid var(--date-line); border-radius: var(--radius); color: var(--date-ink);
}
.date-ticket > label { display: block; font-size: 13px; font-weight: 700; }
.date-ticket input {
  flex: 1; width: 100%; min-width: 0; min-height: 44px; padding: 5px 8px;
  color: var(--ink); background: var(--sheet); border: 1px solid var(--date-line);
  border-radius: var(--control-radius); font-size: clamp(18px, 2.3vw, 22px); font-weight: 750; font-variant-numeric: tabular-nums;
}
.date-ticket .quiet-button { color: var(--date-ink); border-color: var(--date-line); }
.date-ticket .quiet-button:hover { background: #fffaf2; }

.unit-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.unit-sheet { min-width: 0; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); }
.unit-sheet > header { display: flex; align-items: center; gap: 11px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.unit-sheet > header > div { min-width: 0; overflow-wrap: anywhere; }
.unit-sheet h3 { font-size: clamp(16px, 2vw, 18px); }
.unit-sheet > header p { margin: 0; font-size: 12px; }
.unit-number { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue-hover); background: var(--mist); border-radius: var(--control-radius); font-weight: 700; font-variant-numeric: tabular-nums; }
.unit-sheet:focus-within { border-color: var(--active-line); box-shadow: 0 0 0 2px #2d5e9f16; }
.unit-sheet:focus-within > header,
.revision-unit:has(.revision-select-input:checked) > header {
  background: var(--mist); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.unit-sheet:focus-within > header .unit-number,
.revision-unit:has(.revision-select-input:checked) > header .unit-number {
  color: white; background: var(--blue);
}
.revision-unit:has(.revision-select-input:checked) { border-color: var(--active-line); }
.message-input { display: block; width: calc(100% - 36px); margin: 12px 18px 16px; padding: 12px; resize: vertical; color: var(--ink); background: #fbfdff; border: 1px solid var(--line); border-radius: var(--control-radius); line-height: 1.6; }
.message-input::placeholder { color: var(--ink-soft); }

.parse-result { margin: 0 18px 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.review-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.review-heading h4 { margin: 0; font-size: 17px; }
.review-heading span { color: var(--ink-soft); font-size: 12px; }
.people-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.people-table th, .people-table td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.people-table th:first-child, .people-table td:first-child { text-align: left; }
.people-table th { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.people-table input[type="number"] { width: 64px; min-height: 40px; padding: 6px; text-align: center; border: 1px solid var(--line); border-radius: var(--control-radius); font-variant-numeric: tabular-nums; }
.people-table tfoot th, .people-table tfoot td { color: var(--ink); background: var(--mist); font-weight: 700; font-variant-numeric: tabular-nums; }
.cell-error { color: var(--signal); background: #fae5e2; font-weight: 800; }
.change-editor { display: grid; grid-template-columns: 120px 88px 1fr 1fr; gap: 10px; align-items: center; margin-top: 12px; }
.change-editor strong { font-size: 13px; }
.change-editor input { min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--control-radius); color: var(--ink); }
.change-editor input[type="number"] { text-align: center; }
.change-editor input:focus { border-color: var(--ink); }
.change-heading { margin: 22px 0 8px; color: var(--ink); font-size: 14px; }
.notice-list { margin: 14px 0 0; padding: 12px 14px 12px 32px; color: var(--warning-ink); background: var(--warning-bg); border-radius: var(--control-radius); font-size: 13px; line-height: 1.65; }
.balance-ok { display: inline-block; margin-top: 14px; padding: 5px 9px; color: var(--success); background: #e6f4ef; border-radius: 999px; font-size: 12px; font-weight: 700; }
.balance-error { color: var(--signal); background: #fae9e7; }

.generator-actions { position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; padding: 12px; background: rgba(245, 248, 252, .96); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
/* Promote the available next step without changing button order or click behavior. */
#parse-button:enabled { color: white; background: var(--blue); border-color: var(--blue); }
#parse-button:enabled:hover { background: var(--blue-hover); }
#generate-button:enabled { background: var(--success); }
#generate-button:enabled:hover { background: var(--success-hover); }
.generator-actions:has(> #generate-button:enabled) #parse-button:enabled {
  color: var(--blue-hover); background: var(--sheet); border-color: var(--line);
}
.generator-actions:has(> #generate-button:enabled) #parse-button:enabled:hover { background: var(--mist); }
.generation-result { margin-top: 14px; padding: 14px 16px; color: var(--success); background: #e6f4ef; border: 1px solid #cbe4dc; border-radius: var(--radius); overflow-wrap: anywhere; }
.generation-result a { font-weight: 800; text-underline-offset: 4px; }

.history-section { margin-top: 34px; }
.history-section > header { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.history-section > header h2 { margin: 0; }
.history-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.history-row:hover { background: var(--sheet); }
.history-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.history-actions a, .generation-result a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 6px; color: var(--blue-hover); }
.replace-form { display: flex; flex-wrap: wrap; gap: 8px; }
.overtime-field { margin: 0 18px 14px; display: grid; gap: 5px; font-size: 13px; color: var(--ink-soft); }
.revision-select { margin-left: auto; white-space: nowrap; display: flex; flex-direction: row; align-items: center; min-height: 44px; gap: 6px; color: var(--blue-hover); }
.revision-select input { width: 18px; height: 18px; }
.revision-fields { border: 0; min-width: 0; padding: 18px 20px; margin: 0; display: grid; gap: 12px; }
.revision-fields[hidden] { display: none; }
.revision-fields label { display: grid; gap: 6px; margin: 0; min-width: 0; }
.revision-fields :is(textarea, input) { width: 100%; }
.revision-fields textarea { resize: vertical; }
.revision-counts > label, .revision-move-group > label { font-size: 13px; color: var(--ink-soft); }
.revision-counts, .revision-changes { display: grid; gap: 10px; }
.revision-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.revision-changes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.revision-move-group { display: grid; gap: 10px; align-content: start; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.revision-move-group h4 { margin: 0; }
.revision-buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.revision-status, #revision-summary { font-size: 13px; margin: 0; }
.revision-status:empty { display: none; }
.revision-unit > .revision-status { padding: 12px 20px; }
#revision .generator-actions { align-items: center; flex-wrap: wrap; }
#revision .generator-actions > p { margin-right: auto; }
.generation-result a + a { margin-left: 4px; }
.history-list span, .history-list small { color: var(--ink-soft); font-size: 12px; }
.history-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.plan-dialog { width: min(560px, calc(100% - 28px)); padding: 0; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 24px 80px rgba(24, 40, 61, .15); }
.plan-dialog::backdrop { background: rgba(24, 40, 61, .42); backdrop-filter: blur(3px); }
.plan-dialog form { padding: 26px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin-bottom: 0; }
.plan-dialog label, .login-form label { display: grid; gap: 7px; margin-bottom: 17px; color: var(--ink); font-size: 13px; font-weight: 700; }
.plan-dialog input, .login-form input { min-height: 46px; padding: 10px 12px; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--control-radius); }
.two-column-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-help { margin: -4px 0 19px; font-size: 12px; }
.form-error { padding: 9px 11px; color: var(--signal); background: #fae9e7; border-radius: var(--control-radius); font-size: 13px; }

.login-body { background-color: var(--paper); }
.login-body .page-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 0; }
.login-sheet { width: min(870px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; overflow: hidden; background: var(--sheet); border: 1px solid var(--line); border-radius: calc(var(--radius) + 5px); box-shadow: var(--shadow); }
.login-rule { display: none; }
.login-copy { min-height: 390px; display: flex; flex-direction: column; justify-content: center; padding: clamp(30px, 6vw, 58px); background: var(--mist); }
.login-copy h1 { max-width: 650px; font-size: clamp(30px, 4vw, 42px); }
.login-copy p:last-child { max-width: 560px; }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 5vw, 45px); background: var(--sheet); border-left: 1px solid var(--line); }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 90; max-width: min(420px, calc(100% - 40px)); padding: 14px 16px; color: white; background: var(--ink); border-radius: var(--control-radius); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #843531; }

@media (max-width: 760px) {
  .topbar { min-height: 60px; padding: 7px 12px; }
  .brand small { display: none; }
  .page-shell { width: min(100% - 24px, 680px); padding-top: 18px; }
  .page-heading, .generator-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .page-heading .primary-button { width: 100%; }
  .project-row { grid-template-columns: 38px minmax(0, 1fr); min-height: 88px; }
  .project-status { grid-column: 2; justify-self: start; }
  .upload-sheet { grid-template-columns: 1fr; gap: 16px; padding: 25px 20px; }
  .source-strip { align-items: stretch; flex-direction: column; }
  .replace-form, .file-button { width: 100%; justify-content: center; }
  .date-ticket { width: 100%; }
  .unit-sheet > header { padding-inline: 12px; }
  .message-input { width: calc(100% - 24px); margin: 10px 12px 12px; }
  .overtime-field { margin-inline: 12px; }
  .parse-result { margin: 0 14px 14px; overflow-x: auto; }
  .people-table { min-width: 520px; }
  .change-editor { grid-template-columns: 1fr 72px; }
  .change-editor input:nth-of-type(2), .change-editor input:nth-of-type(3) { grid-column: 1 / -1; }
  .generator-actions { margin-left: -12px; margin-right: -12px; padding: 13px 12px calc(13px + env(safe-area-inset-bottom)); }
  .generator-actions > * { flex: 1; padding-left: 10px; padding-right: 10px; }
  .history-row { grid-template-columns: minmax(0, 1fr) auto; }
  .history-row > span { grid-column: 1 / -1; }
  .revision-changes { grid-template-columns: minmax(0, 1fr); }
  .revision-fields { padding: 14px; }
  #revision-summary { flex: 1 0 100%; }
  .two-column-fields { grid-template-columns: 1fr; gap: 0; }
  .login-sheet { grid-template-columns: 1fr; }
  .login-copy { min-height: auto; padding: 28px 26px 22px; }
  .login-copy h1 { font-size: 30px; }
  .login-form { padding: 30px 26px 34px; border-left: 0; border-top: 1px solid var(--line); }
}

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

.source-strip .notice-inline { color: var(--warning-ink); font-weight: 600; }
.date-control, .document-row { display: flex; align-items: center; gap: .55rem; }
.date-control { margin-top: 5px; }
.date-control button { white-space: nowrap; }
.date-ticket small { color: var(--ink-soft); display: block; margin-top: .45rem; font-size: 12px; }
.document-intake { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; background: var(--sheet); display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.document-intake small { display: block; color: var(--ink-soft); margin-top: .25rem; }
#document-results { flex-basis: 100%; display: grid; gap: .45rem; }
#document-results:empty { display: none; }
.document-row span { min-width: 9rem; overflow-wrap: anywhere; }
.unit-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 11rem),1fr)); align-items: end; gap: 10px; padding: 10px 18px 0; }
.unit-options label { display: grid; gap: 4px; min-width: 0; font-size: 13px; color: var(--ink-soft); }
.document-row select, .unit-options select, .unit-options input, .overtime-field input,
.revision-fields :is(input, textarea), .project-schedule select {
  font: inherit; font-size: 14px; width: 100%; min-width: 0; min-height: 44px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--sheet); color: var(--ink);
}
.document-row select { width: min(28rem, 100%); }
.weather-status,.route-breakdown { color: var(--ink-soft); overflow-wrap: anywhere; }
.route-breakdown { grid-column: 1 / -1; }
.prior-check { background: var(--warning-bg); color: var(--warning-ink); border-radius: var(--control-radius); padding: .7rem; margin-bottom: .8rem; display: flex; align-items: flex-start; gap: .45rem; }
.prior-check input { width: auto; margin-top: .3rem; }
.prior-check[hidden],.monitor-setting[hidden] { display: none; }
.apply-prior { margin: .4rem .6rem .4rem 0; }
.project-schedule { margin-block: .8rem; border: 1px solid var(--line); border-radius: var(--control-radius); min-width: 0; }
.project-schedule select { display: block; }
@media(max-width:600px){
  .unit-options { grid-template-columns: 1fr; padding-inline: 12px; gap: 8px; }
  .message-input { min-height: 120px; }
  .document-row { display: grid; grid-template-columns: 1fr auto; }
  .document-row span { grid-column: 1/-1; }
  .date-control input { min-width: 0; flex: 1; }
  .people-table { min-width: 0; }
  .people-table th,.people-table td { font-size: .73rem; padding: .4rem .12rem; }
  .people-table th:first-child { width: 22%; }
  .people-table input[type="number"] { width: 100%; min-width: 0; padding: .12rem; font-size: 1rem; }
  .generator { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  #revision { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .generator-actions { position: fixed; inset: auto 0 0; margin: 0; }
  .generator-actions > :is(button, a) { min-width: 0; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
}
@media (pointer: coarse) {
  .message-input, .document-row select, .unit-options select, .unit-options input, .overtime-field input,
  .revision-fields :is(input, textarea), .plan-dialog :is(select, input), .login-form input, .change-editor input { font-size: 16px; }
}
