/* heygregor Portal – basiert auf dem heygregor Brand Book (Near Black, Off-White, Electric Lime, Deep Green) */

@font-face { font-family: "Roboto"; src: url("fonts/roboto-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("fonts/roboto-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("fonts/roboto-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Roboto Condensed"; src: url("fonts/roboto-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Roboto Condensed"; src: url("fonts/roboto-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #0A0B0A;
  --charcoal: #1A1A1A;
  --paper: #F5F5F0;
  --white: #FFFFFF;
  --mist: #E6E6E6;
  --line: #DCDCD5;
  --muted: #5B5F5B;
  --lime: #B7FF00;
  --forest: #082D1F;
  --forest-soft: #E3EDE7;
  --red: #B42318;
  --red-soft: #FBE9E7;
  --amber: #8A5A00;
  --amber-soft: #FFF3D6;

  --font-display: "Roboto Condensed", "Arial Narrow", "Liberation Sans Narrow", Arial, sans-serif;
  --font-text: "Roboto", Arial, system-ui, sans-serif;
  --radius: 14px;
  --radius-s: 8px;
  --side: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.55 var(--font-text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); border-radius: 4px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  background: var(--ink);
  color: var(--white);
  padding: 22px 14px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; text-decoration: none; }
.brand svg { width: 27px; height: 34px; flex: none; }
.brand__name { font: 700 21px/1 var(--font-display); letter-spacing: -0.01em; }
.brand__name small { display: block; font: 400 12px/1.3 var(--font-text); color: #9EA39E; letter-spacing: 0; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: #C9CCC9; text-decoration: none; font-weight: 500;
  position: relative;
}
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; }
.nav a:hover { background: var(--charcoal); color: var(--white); }
.nav a[aria-current="page"] { background: var(--charcoal); color: var(--white); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--lime); }
.nav .count { margin-left: auto; background: var(--lime); color: var(--ink); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.nav__sep { height: 1px; background: #2A2E2A; margin: 10px 12px; }

.side__foot { margin-top: auto; padding: 12px; border-top: 1px solid #2A2E2A; display: flex; align-items: center; gap: 10px; }
.side__foot .who { min-width: 0; flex: 1; }
.side__foot .who strong { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side__foot .who a { color: #9EA39E; font-size: 13px; text-decoration: none; }
.side__foot .who a:hover { color: var(--white); }
.side__foot form button { background: none; border: 0; color: #9EA39E; cursor: pointer; padding: 6px; border-radius: 8px; }
.side__foot form button:hover { color: var(--white); background: var(--charcoal); }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--forest); color: var(--lime); display: grid; place-items: center; font: 700 13px/1 var(--font-display); flex: none; letter-spacing: 0.02em; }
.avatar--client { background: var(--mist); color: var(--ink); }

.main { min-width: 0; padding: 28px clamp(16px, 3.4vw, 44px) 64px; }
.topbar { display: none; }
.menu-toggle { display: none; }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 24px; }
.page-head h1 {
  font: 700 clamp(30px, 3.6vw, 44px)/0.95 var(--font-display);
  text-transform: uppercase; letter-spacing: -0.005em; margin: 0;
  max-width: 22ch; overflow-wrap: anywhere;
}
.page-head .sub { color: var(--muted); margin: 8px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 10px; }
.crumb:hover { color: var(--ink); }
.ref { font-family: var(--font-display); font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--white); color: var(--ink);
  font: 700 15px/1 var(--font-display); letter-spacing: 0.03em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--ink); color: var(--white); }
.btn--primary { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--lime); }
.btn--dark { background: var(--ink); color: var(--white); }
.btn--dark:hover { background: var(--charcoal); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--mist); color: var(--ink); }
.btn--danger { border-color: var(--red); color: var(--red); background: var(--white); }
.btn--danger:hover { background: var(--red); color: var(--white); }
.btn--sm { min-height: 34px; padding: 0 13px; font-size: 14px; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ink); }

/* ---------- Surfaces ---------- */
.panel { background: var(--white); border-radius: var(--radius); border: 1px solid var(--line); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel__head h2 { font: 700 19px/1.1 var(--font-display); margin: 0; }
.panel__head a { font-size: 14px; color: var(--muted); }
.panel__body { padding: 20px; }
.panel__empty { padding: 28px 20px; color: var(--muted); }
.panel__empty p { margin: 0 0 12px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.stack { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.grid-main > *, .grid-2 > *, .stack > * { min-width: 0; }

/* Kennzahlen: eine dunkle Leiste statt einzelner Karten */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--ink); color: var(--white); border-radius: var(--radius); margin-bottom: 24px; overflow: hidden; }
.figure { padding: 18px 22px; border-left: 1px solid #2A2E2A; text-decoration: none; }
.figure:first-child { border-left: 0; }
.figure:hover { background: var(--charcoal); }
.figure b { display: block; font: 700 34px/1 var(--font-display); }
.figure span { color: #A9ADA9; font-size: 14px; }
.figure--alert b { color: var(--lime); }

/* ---------- Lists / tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; text-decoration: none; }
a.row:hover { background: #FAFAF7; }
.row__main { min-width: 0; flex: 1; }
.row__title { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { color: var(--muted); font-size: 13.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__side { text-align: right; flex: none; font-size: 14px; }
.row--unread .row__title { font-weight: 700; }
.row--unread .row__title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--forest); margin-right: 8px; vertical-align: 2px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table a { text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }
.table tbody tr:hover { background: #FAFAF7; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--mist); color: var(--ink); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge--offen, .badge--versendet, .badge--planung { background: var(--ink); color: var(--white); }
.badge--offen::before, .badge--versendet::before { background: var(--white); opacity: .9; }
.badge--in_bearbeitung, .badge--in_arbeit { background: var(--forest); color: var(--white); }
.badge--in_bearbeitung::before, .badge--in_arbeit::before { background: var(--white); opacity: .9; }
.badge--wartet, .badge--review { background: var(--amber-soft); color: var(--amber); }
.badge--erledigt, .badge--abgeschlossen, .badge--bezahlt, .badge--angenommen { background: var(--forest-soft); color: var(--forest); }
.badge--abgelehnt, .badge--storniert, .badge--pausiert, .badge--entwurf { background: var(--mist); color: var(--muted); }
.badge--ueberfaellig, .badge--dringend { background: var(--red-soft); color: var(--red); }
.badge--hoch { background: var(--amber-soft); color: var(--amber); }
.badge--niedrig, .badge--normal { background: transparent; color: var(--muted); padding-left: 0; }
.badge--normal::before, .badge--niedrig::before { display: none; }

.progress { height: 6px; background: var(--mist); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--forest); border-radius: 999px; }

/* ---------- Tabs / filter ---------- */
.filters { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.tabs { display: flex; gap: 4px; background: var(--mist); padding: 4px; border-radius: 999px; overflow-x: auto; max-width: 100%; }
.tabs a { padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(10, 11, 10, .08); }
.search { display: flex; gap: 8px; }
.search input { width: 240px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13.5px; font-weight: 500; }
.field small { color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-s);
  padding: 10px 12px; min-height: 42px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: #BFC2BB; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(183, 255, 0, .55); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--forest); flex: none; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }
.file-input { font-size: 14px; color: var(--muted); }
.file-input::file-selector-button { font: 500 14px var(--font-text); border: 1.5px solid var(--line); background: var(--white); padding: 7px 12px; border-radius: 999px; margin-right: 10px; cursor: pointer; }

/* ---------- Flash ---------- */
.flashes { display: grid; gap: 8px; margin-bottom: 20px; }
.flash { padding: 12px 16px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--forest); font-size: 14.5px; overflow-wrap: anywhere; }
.flash--error { border-left-color: var(--red); background: var(--red-soft); }
.flash--warning { border-left-color: var(--amber); background: var(--amber-soft); }
.flash--info { border-left-color: var(--ink); }

/* ---------- Ticket thread ---------- */
.thread { display: grid; gap: 14px; margin-bottom: 20px; }
.msg { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
.msg__card { background: var(--white); border: 1px solid var(--line); border-radius: 4px var(--radius) var(--radius) var(--radius); padding: 14px 18px; }
.msg--team .msg__card { background: var(--ink); color: var(--white); border-color: var(--ink); }
.msg--team .msg__meta { color: #A9ADA9; }
.msg--team .msg__body a { color: var(--lime); }
.msg--internal .msg__card { background: var(--amber-soft); border: 1.5px dashed #D9B25A; color: var(--ink); }
.msg__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.msg__meta strong { color: inherit; font-weight: 700; }
.msg--team .msg__meta strong { color: var(--white); }
.msg__body { overflow-wrap: anywhere; }
.msg__files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--paper); color: var(--ink); text-decoration: none; border: 1px solid var(--line); max-width: 100%; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip:hover { border-color: var(--ink); }
.file-chip svg { width: 14px; height: 14px; stroke: currentColor; flex: none; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: rgba(0,0,0,.06); }
.msg--team .tag { background: rgba(255,255,255,.12); }

.reply { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.reply textarea { border-color: var(--line); min-height: 140px; }
.reply__bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.reply__bar .spacer { flex: 1; }
.seg { display: inline-flex; background: var(--mist); border-radius: 999px; padding: 3px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); }
.seg input:checked + span { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(10,11,10,.08); }
.seg input:focus-visible + span { outline: 3px solid var(--lime); }

.meta-list { display: grid; gap: 14px; margin: 0; }
.meta-list div { display: grid; gap: 2px; }
.meta-list dt { font-size: 13px; color: var(--muted); }
.meta-list dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Tasks ---------- */
.task { display: flex; align-items: center; gap: 12px; padding: 11px 20px; }
.task + .task { border-top: 1px solid var(--line); }
.task form { margin: 0; }
.task__check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--ink); background: var(--white); display: grid; place-items: center; cursor: pointer; padding: 0; }
.task__check svg { width: 14px; height: 14px; stroke: var(--lime); opacity: 0; }
.task--done .task__check { background: var(--forest); border-color: var(--forest); }
.task--done .task__check svg { opacity: 1; }
.task__title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.task--done .task__title { color: var(--muted); text-decoration: line-through; }
.task__dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.task--done .task__dot { background: var(--forest); border-color: var(--forest); }
.task__meta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.task-add { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.task-add input[type=text] { flex: 1 1 220px; }
.task-add input[type=date] { width: 160px; flex: none; }

/* ---------- Documents ---------- */
.items-table input { min-height: 38px; padding: 7px 10px; }
.items-table td { padding: 6px 6px; border: 0; }
.items-table th { padding: 6px; border: 0; }
.items-table .col-desc { width: 52%; }
.items-table .col-qty { width: 10%; }
.items-table .col-unit { width: 12%; }
.items-table .col-price { width: 16%; }
.items-table textarea { min-height: 38px; height: 38px; padding: 8px 10px; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--red-soft); color: var(--red); }
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; }

.totals { margin-left: auto; width: min(340px, 100%); display: grid; gap: 6px; padding: 16px 20px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; gap: 20px; }
.totals .grand { border-top: 2px solid var(--ink); padding-top: 10px; margin-top: 4px; font: 700 22px/1.1 var(--font-display); }

.doc-preview { padding: 28px clamp(18px, 3vw, 36px); }
.doc-preview .intro { margin: 0 0 20px; max-width: 70ch; }

.callout { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--forest); color: var(--white); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 20px; }
.callout p { margin: 0; }
.callout strong { font: 700 20px/1.2 var(--font-display); display: block; }

/* ---------- Guest (Login) ---------- */
.guest { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(360px, 520px); background: var(--ink); }
.guest__art { color: var(--white); padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; overflow: hidden; position: relative; }
.guest__art .brand__name { font-size: 26px; }
.guest__claim { font: 700 clamp(48px, 7vw, 108px)/0.9 var(--font-display); text-transform: uppercase; margin: 0; max-width: 9ch; }
.guest__claim em { font-style: normal; color: var(--lime); }
.guest__art p.small { color: #9EA39E; margin: 0; max-width: 40ch; }
.guest__form { background: var(--paper); padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; }
.guest__form h1 { font: 700 34px/1 var(--font-display); text-transform: uppercase; margin: 0 0 8px; }
.guest__form p.lead { color: var(--muted); margin: 0 0 28px; }
.guest__form .btn { width: 100%; }
.guest__links { margin-top: 18px; font-size: 14px; color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }
.hidden { display: none !important; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.empty-hero { text-align: left; padding: 36px 24px; }
.empty-hero h2 { font: 700 24px/1.1 var(--font-display); margin: 0 0 8px; }
.empty-hero p { color: var(--muted); margin: 0 0 18px; max-width: 52ch; }
details.danger summary { cursor: pointer; color: var(--red); font-size: 14px; }
details.danger[open] summary { margin-bottom: 12px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--mist); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 30; transform: translateX(-100%); transition: transform .22s ease; }
  .menu-toggle:checked ~ .shell .side { transform: none; box-shadow: 0 0 0 100vmax rgba(10, 11, 10, .45); }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: var(--white); padding: 10px 16px; position: sticky; top: 0; z-index: 20; }
  .topbar label { cursor: pointer; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; }
  .topbar label:hover { background: var(--charcoal); }
  .topbar svg.ico { width: 22px; height: 22px; stroke: currentColor; }
  .topbar .brand { padding: 0; }
  .topbar .brand svg { width: 22px; height: 28px; }
  .main { padding-top: 20px; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure:nth-child(3) { border-left: 0; }
  .figure:nth-child(n+3) { border-top: 1px solid #2A2E2A; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .guest { grid-template-columns: 1fr; }
  .guest__art { padding-bottom: 28px; gap: 28px; }
  .guest__claim { font-size: clamp(44px, 13vw, 72px); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .form-grid { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .search input { width: 100%; flex: 1; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .row { padding: 13px 16px; align-items: flex-start; }
  .panel__head, .panel__body { padding-left: 16px; padding-right: 16px; }
  .task { padding: 11px 16px; }
  .task-add { padding: 14px 16px; }
  .task-add input[type=date] { width: 100%; flex: 1 1 140px; }
  .figure { padding: 14px 16px; }
  .figure b { font-size: 28px; }
  .msg { grid-template-columns: 1fr; }
  .msg .avatar { display: none; }
  .items-table thead { display: none; }
  .items-table, .items-table tbody, .items-table tr, .items-table td { display: block; width: 100%; }
  .items-table tr { display: grid; grid-template-columns: 0.8fr 1.1fr 1.3fr 34px; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .items-table td, .items-table .col-desc, .items-table .col-qty, .items-table .col-unit, .items-table .col-price { padding: 0; width: auto; }
  .items-table td.col-desc { grid-column: 1 / -1; }
  .items-table td.col-desc textarea { height: auto; min-height: 64px; }
  .items-table td[data-line-total] { grid-column: 1 / 4; text-align: right; font-weight: 500; }
  .table-stack thead { display: none; }
  .table-stack tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-stack td { padding: 0; border: 0; }
  .table-stack td[data-hide-sm] { display: none; }
  .table-stack td.num { text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.reply--internal { background: var(--amber-soft); border: 1.5px dashed #D9B25A; }
.reply--internal textarea { background: #FFFBF0; }
.doc-items td.desc { min-width: 200px; }
@media (max-width: 640px) {
  .doc-items .hide-sm { display: none; }
  .doc-items td.desc { min-width: 0; }
  .doc-items th, .doc-items td { padding-left: 6px; padding-right: 6px; }
  .doc-preview { padding: 20px 14px; }
}
.crumb svg { width: 16px; height: 16px; stroke: currentColor; }
@media (min-width: 901px) {
  .shell { background: linear-gradient(to right, var(--ink) var(--side), transparent var(--side)); }
}
