/* TBS Request Tracker
   Structure: navy. Attention: red is used only for overdue/urgent, amber for waiting, green for done.
   Numbers people must read exactly (request and part numbers) are set in a monospace face with a dotted zero. */
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; font-display: swap; src: url("/assets/fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("/assets/fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url("/assets/fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --navy: #1B2A4A;
  --navy-2: #26395f;
  --red: #CC3333;
  --red-bg: #fbeaea;
  --amber: #8a5a00;
  --amber-bg: #fdf1d3;
  --green: #256b43;
  --green-bg: #e3f3e9;
  --blue: #1f5aa8;
  --blue-bg: #e6eefa;
  --ink: #1c2330;
  --muted: #5b6676;
  --line: #d5dae1;
  --line-soft: #e6e9ee;
  --page: #eef1f4;
  --surface: #ffffff;
  --display: "Barlow Semi Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.45 var(--body); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; margin: 0; color: var(--navy); }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
a { color: var(--blue); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #f0b429; outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: .93em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ shell */
.banner { background: #fff4c2; border-bottom: 1px solid #e2c75a; color: #5a4300; padding: 6px 16px; font-size: 13px; text-align: center; }
/* Owner/Admins only: system problems that need attention. The whole strip is the link to System health. */
a.banner { display: block; font-weight: 600; }
.banner-warn { background: var(--amber-bg); border-bottom-color: #ecd28a; color: var(--amber); }
.banner-danger { background: var(--red-bg); border-bottom-color: #eab5b5; color: #7d1a1a; }
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: .03em; padding: 4px 8px 14px; line-height: 1.1; }
.brand small { display: block; font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #aab8d4; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #dbe3f2; text-decoration: none; padding: 8px 10px; border-radius: var(--radius); font-family: var(--display); font-weight: 500; font-size: 16px; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--navy); font-weight: 600; }
.nav .count { font-family: var(--body); font-size: 12px; background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.side-foot { margin-top: auto; font-size: 13px; color: #c5d0e6; padding: 10px 8px 0; border-top: 1px solid #33466f; }
.side-foot .who { font-weight: 600; color: #fff; }
.linklike { background: none; border: 0; color: #c5d0e6; text-decoration: underline; cursor: pointer; padding: 0; font: inherit; }
.main { padding: 20px 28px 60px; max-width: 1360px; width: 100%; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ------------------------------------------------------------ surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card > h2, .card > h3 { margin-bottom: 10px; }
.card-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.empty { color: var(--muted); padding: 10px 0; }

/* ------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; font: 600 14px var(--body); padding: 8px 14px; border-radius: var(--radius); border: 1px solid #b9c1cd; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: #f3f5f8; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-danger { background: #fff; border-color: var(--red); color: #a12727; }
.btn-danger:hover { background: var(--red-bg); }
.btn-small { padding: 4px 9px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }

/* ------------------------------------------------------------ chips */
.chip { display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.5; padding: 1px 8px; border-radius: 3px; background: #e9edf2; color: #37404d; border: 1px solid #d0d6de; white-space: nowrap; }
.chip-danger { background: var(--red-bg); color: #9b1f1f; border-color: #eab5b5; }
.chip-warn { background: var(--amber-bg); color: var(--amber); border-color: #ecd28a; }
.chip-ok { background: var(--green-bg); color: var(--green); border-color: #a9d6b9; }
.chip-info { background: var(--blue-bg); color: #194a8b; border-color: #b6ccec; }
.chip-solid { background: var(--navy); color: #fff; border-color: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* Request number as a shop tag: monospace, with a punched hole. */
.tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--navy); background: #f4f6f9; border: 1px solid #c3cbd7; border-radius: 3px; padding: 1px 8px 1px 6px; text-decoration: none; white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid #8794a8; background: var(--page); }
a.tag:hover { border-color: var(--navy); }
.tag-lg { font-size: 16px; padding: 3px 12px 3px 9px; }

/* ------------------------------------------------------------ routing strip (the seven stages, in order) */
.routing { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; list-style: none; margin: 0; padding: 0; }
.routing li { position: relative; padding: 8px 6px 8px 30px; font-family: var(--display); font-weight: 500; font-size: 14px; line-height: 1.15; color: var(--muted); background: #f4f6f9; border: 1px solid var(--line); border-left-width: 0; min-height: 44px; display: flex; align-items: center; }
.routing li:first-child { border-left-width: 1px; border-radius: var(--radius) 0 0 var(--radius); }
.routing li:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.routing li::before { content: attr(data-step); position: absolute; left: 7px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #9aa5b6; font: 600 11px/15px var(--body); text-align: center; color: var(--muted); background: #fff; }
.routing li.is-done { color: var(--navy); background: #e8edf5; }
.routing li.is-done::before { content: "\2713"; background: var(--navy); border-color: var(--navy); color: #fff; }
.routing li.is-current { background: var(--navy); color: #fff; font-weight: 600; border-color: var(--navy); }
.routing li.is-current::before { background: #fff; border-color: #fff; color: var(--navy); }
.routing li.is-won { background: var(--green); border-color: var(--green); }
.routing li.is-lost { background: #6b7482; border-color: #6b7482; }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font: 600 12px var(--body); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #f7f9fb; }
table.list .title { font-weight: 600; color: var(--ink); text-decoration: none; }
table.list th.what, table.list td.what { min-width: 230px; }
table.list .title:hover { text-decoration: underline; }
table.plain { border-collapse: collapse; font-size: 14px; }
table.plain th, table.plain td { text-align: left; padding: 4px 14px 4px 0; vertical-align: top; }
table.plain th { color: var(--muted); font-weight: 400; white-space: nowrap; }
/* Key/value tables sit in narrow side cards: let a long value (a due date) wrap instead of spilling out. */
table.plain td .nowrap { white-space: normal; }
td.num, th.num, table.list th.num, table.list td.num { text-align: right; font-variant-numeric: tabular-nums; }
.overdue { color: #a12727; font-weight: 600; }
.unknown { color: var(--amber); font-weight: 600; }

/* ------------------------------------------------------------ forms */
.field { display: block; margin: 0 0 12px; }
.field > span, .field > label, legend { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=datetime-local], input[type=number], input[type=search], input[type=time], select, textarea {
  width: 100%; font: 15px var(--body); color: var(--ink); background: #fff; border: 1px solid #aeb7c4; border-radius: 4px; padding: 7px 9px; }
textarea { min-height: 76px; resize: vertical; }
input.mono, textarea.mono { font-family: var(--mono); }
[aria-invalid=true] { border-color: var(--red); background: #fffafa; }
.field-error { color: #a12727; font-size: 13px; margin-top: 3px; font-weight: 600; }
.form-ok { background: var(--green-bg); border: 1px solid #a9d3b3; color: #14532d; border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; font-weight: 600; }
.form-error { background: var(--red-bg); border: 1px solid #eab5b5; color: #7d1a1a; border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; }
.check input { margin-top: 3px; width: 17px; height: 17px; flex: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 2px; margin: 0 0 12px; }
legend { padding: 0 6px; margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.save-state { font-size: 13px; color: var(--muted); }
.save-state.is-dirty { color: var(--amber); font-weight: 600; }
.save-state.is-error { color: #a12727; font-weight: 600; }
.next-action { background: #f4f6f9; border: 1px dashed #aab4c3; border-radius: var(--radius); padding: 10px 12px 0; margin-bottom: 12px; }
.next-action > strong { display: block; margin-bottom: 6px; font-family: var(--display); font-size: 15px; color: var(--navy); }

.conflict, .duplicates { background: #fff8e1; border: 2px solid #e0a800; border-radius: var(--radius); padding: 12px; margin-bottom: 14px; }
.conflict table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.conflict th, .conflict td { text-align: left; padding: 5px 8px; border-bottom: 1px solid #ecd28a; vertical-align: top; overflow-wrap: anywhere; }
.conflict th:first-child, .conflict td:first-child, .conflict td:last-child { white-space: nowrap; overflow-wrap: normal; }
.conflict-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.duplicates ul { margin: 6px 0 10px; padding: 0; list-style: none; }
.duplicates li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #ecd28a; }

.picker { position: relative; }
.pick { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-top: 0; padding: 8px 10px; font: 14px var(--body); cursor: pointer; }
.pick:first-child { border-top: 1px solid var(--line); }
.pick:hover { background: var(--blue-bg); }
.pick-new { font-weight: 600; color: var(--navy); }
.chosen { background: var(--blue-bg); border: 1px solid #b6ccec; border-radius: 4px; padding: 7px 10px; display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 6px; }

/* ------------------------------------------------------------ dialogs */
dialog { border: 0; border-radius: 8px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(15, 25, 45, .35); color: var(--ink); }
dialog.wide { width: min(980px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(20, 30, 50, .55); }
.dialog-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.dialog-body { padding: 16px 18px 18px; }
.x { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 8px; border-radius: 4px; }
.x:hover { background: #eef1f4; }

/* ------------------------------------------------------------ request workspace */
.req-head { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.req-head h1 { font-size: 26px; margin: 8px 0 4px; }
.req-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.req-meta strong { color: var(--ink); }
.req-meta strong.overdue { color: #a12727; }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 14px 0 16px; overflow-x: auto; }
.tabs a { font-family: var(--display); font-weight: 500; font-size: 17px; color: var(--muted); text-decoration: none; padding: 8px 14px; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a:hover { color: var(--navy); }
.tabs a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }
.tabs .n { font-family: var(--body); font-size: 12px; background: #e3e7ee; border-radius: 9px; padding: 0 6px; margin-left: 4px; color: var(--ink); }
.next-card { border-left: 5px solid var(--navy); }
.next-card.is-overdue { border-left-color: var(--red); }
.next-card .what { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.25; color: var(--ink); }
.blocker { border-left: 4px solid #e0a800; background: #fffaf0; padding: 7px 10px; margin-bottom: 6px; border-radius: 0 4px 4px 0; }
.blocker.is-danger { border-left-color: var(--red); background: #fff6f6; }
.blocker strong { display: block; }
.task { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.task:last-child { border-bottom: 0; }
.task .t-title { font-weight: 600; }
.task.is-done .t-title { font-weight: 400; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); }
.timeline li.is-auto::before { border-color: #9aa5b6; }
.timeline .who { font-weight: 600; }
.timeline .when { color: var(--muted); font-size: 13px; }
.changes { margin: 4px 0 0; font-size: 13.5px; border-collapse: collapse; }
.changes td { padding: 1px 10px 1px 0; vertical-align: top; overflow-wrap: anywhere; }
.changes .was { color: #8a2c2c; text-decoration: line-through; }
.note { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.file { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.file .thumb { height: 150px; background: #e9edf2; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .thumb .ext { font-family: var(--display); font-weight: 700; font-size: 26px; color: #8794a8; letter-spacing: .05em; }
.file .info { padding: 9px 10px; font-size: 13.5px; }
.file.is-removed { opacity: .6; }
.preview-frame { width: 100%; height: min(72vh, 820px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.preview-img { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; }
.compare th.vendor { min-width: 190px; }
.offer { border: 1px solid var(--line); border-radius: 4px; padding: 8px; margin-bottom: 6px; background: #fff; }
.offer.is-lowest { border-color: var(--green); box-shadow: inset 4px 0 0 var(--green); }
.offer.not-comparable { border-style: dashed; background: #fffdf5; }
.caution { color: var(--amber); font-size: 13px; }

/* ------------------------------------------------------------ worklist, board, dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; text-decoration: none; color: var(--ink); display: block; }
.tile:hover { border-color: var(--navy); }
.tile .n { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--navy); }
.tile .l { font-size: 13px; color: var(--muted); margin-top: 3px; }
.tile.is-danger .n { color: var(--red); }
.tile.is-warn .n { color: var(--amber); }
.section { margin-bottom: 18px; }
.section > h2 { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.section > h2 .n { font-family: var(--body); font-size: 14px; font-weight: 600; color: var(--muted); }
.work { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 11px 14px; background: #fff; border: 1px solid var(--line); border-top-width: 0; }
.work:first-of-type { border-top-width: 1px; border-radius: var(--radius) var(--radius) 0 0; }
.work:last-of-type { border-radius: 0 0 var(--radius) var(--radius); }
.work:only-of-type { border-radius: var(--radius); }
.work .w-title { font-weight: 600; font-size: 15.5px; }
.work .w-sub { color: var(--muted); font-size: 13.5px; }
.work .w-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.work.is-overdue { box-shadow: inset 4px 0 0 var(--red); }
.board { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.column { background: #e3e7ee; border-radius: var(--radius); padding: 8px; min-height: 120px; }
.column > h3 { font-size: 15px; padding: 2px 4px 8px; display: flex; justify-content: space-between; }
.bcard { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 8px; margin-bottom: 8px; display: block; text-decoration: none; color: var(--ink); font-size: 13.5px; }
.bcard:hover { border-color: var(--navy); }
.bcard .b-title { font-weight: 600; margin: 4px 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; }
.filters .field { margin: 0; min-width: 130px; }
.filters .field > span { font-size: 12px; }
.seg { display: inline-flex; border: 1px solid #b9c1cd; border-radius: var(--radius); overflow: hidden; }
.seg a { padding: 7px 12px; text-decoration: none; color: var(--ink); background: #fff; font-weight: 600; font-size: 14px; }
.seg a[aria-current="true"] { background: var(--navy); color: #fff; }
.stat { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.stat:last-child { border-bottom: 0; }
.stat b { font-variant-numeric: tabular-nums; }
.def { font-size: 13px; color: var(--muted); background: #f4f6f9; border-radius: 4px; padding: 8px 10px; }

/* ------------------------------------------------------------ toasts, login, print */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--radius); box-shadow: 0 6px 20px rgba(15, 25, 45, .3); max-width: 380px; }
.toast-ok { background: var(--green); }
.login { max-width: 480px; margin: 9vh auto; padding: 0 16px; }
.login .card { padding: 26px; }
.sheet { background: #fff; max-width: 860px; margin: 20px auto; padding: 40px 44px; border: 1px solid var(--line); }
.sheet h1 { font-size: 30px; }
.sheet table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.sheet th { text-align: left; border-bottom: 2px solid var(--navy); padding: 6px 8px; font-size: 13px; }
.sheet td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.sheet .total td { border-top: 2px solid var(--navy); border-bottom: 0; font-weight: 700; font-size: 17px; }
.draft-mark { border: 2px dashed var(--red); color: #a12727; padding: 6px 10px; font-weight: 700; display: inline-block; margin-bottom: 12px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 10px; gap: 2px; }
  .brand { padding: 4px 8px; font-size: 16px; }
  .brand small { display: none; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 6px 9px; font-size: 15px; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0 6px; display: flex; gap: 10px; align-items: center; }
  .main { padding: 14px 12px 60px; }
  /* minmax(0, ...) lets a column shrink below its widest child, so a wide table scrolls inside its own box. */
  .grid-2, .grid-3, .grid-4, .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .routing { grid-template-columns: 1fr; }
  .routing li { border-left-width: 1px; border-top-width: 0; border-radius: 0 !important; min-height: 34px; }
  .routing li:first-child { border-top-width: 1px; }
  .routing li:not(.is-current) { display: none; }
  .work, .task { grid-template-columns: 1fr; }
  .work .w-actions { justify-content: flex-start; }
  h1 { font-size: 23px; }
  .btn { padding: 10px 14px; }
  .sheet { padding: 20px 16px; margin: 0; border: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: rise .14s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media print {
  body { background: #fff; }
  .no-print, .side, .banner, #toasts { display: none !important; }
  .shell { display: block; }
  .sheet { border: 0; margin: 0; padding: 0; max-width: none; }
}
