@font-face {
  font-family: Inter;
  src: url("/brand/inter-cyrillic.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Inter;
  src: url("/brand/inter-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Play;
  src: url("/brand/play-700-cyrillic.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Play;
  src: url("/brand/play-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  font: 16px/1.45 Inter, "Segoe UI", sans-serif;
  color: #1a1a1a;
  background: #f5f5f7;
  --black: #141414;
  --ink: #1a1a1a;
  --muted: #5a5a5a;
  --line: #e0e0e0;
  --red: #c93026;
  --paper: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #276ad1; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: Play, Inter, sans-serif; }
.topbar {
  min-height: calc(64px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: env(safe-area-inset-top) max(32px, env(safe-area-inset-right)) 0 max(32px, env(safe-area-inset-left));
  background: var(--black);
  color: #fff;
  border-bottom: 2px solid var(--red);
}
.brand, .account { display: flex; align-items: center; gap: 16px; }
.brand img { display: block; object-fit: contain; }
.brand-divider { height: 20px; border-left: 1px solid #747474; }
.brand-label, .account { font-size: .875rem; }
.brand-label { color: #e2e2e2; font-weight: 650; }
.text-button { min-height: 44px; color: inherit; background: transparent; border: 1px solid #828282; border-radius: 24px; padding: 5px 16px; }
.text-button:hover { background: #333; }
#main { max-width: 1520px; margin: 0 auto; padding: 30px max(32px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left)); }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; }
h1 { font-size: 2.25rem; line-height: 1.15; letter-spacing: -.035em; }
.demo-label { margin-top: 4px; color: var(--muted); font-size: .8125rem; }
.primary, .secondary { border: 1px solid transparent; border-radius: 24px; padding: 8px 16px; min-height: 44px; font-weight: 650; }
.primary { color: #fff; background: var(--red); }
.primary:hover { background: #aa281f; }
.secondary { color: var(--ink); background: #fff; border-color: var(--line); }
.secondary:hover { background: #f0f0f2; }
#status-nav { display: none; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.column {
  --stage: #777;
  min-width: 0;
  min-height: 430px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--stage);
  border-radius: 12px;
  background: #eeedf0;
}
.column[data-status="queued"] { --stage: #478ef6; }
.column[data-status="working"] { --stage: #d3382d; }
.column[data-status="closed"] { --stage: #398b29; }
.column-header { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 14px 12px 12px; border-bottom: 1px solid var(--line); }
.column h2 { font-size: 1.06rem; line-height: 1.2; }
.count { display: grid; place-items: center; min-width: 24px; padding: 2px 6px; border-radius: 20px; background: #e0dfe2; color: #383838; font-size: .82rem; font-variant-numeric: tabular-nums; }
.column-items { display: grid; gap: 10px; padding: 10px; }
.empty { padding: 15px 7px; color: var(--muted); font-size: .88rem; }
.card {
  display: grid;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--paper);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.card:hover { border-color: #a2a2a2; }
.card-name { font-weight: 750; line-height: 1.2; }
.card .plate { margin-left: 7px; font-size: .78rem; font-variant-numeric: tabular-nums; font-weight: 650; background: #efeff1; color: #353535; border-radius: 4px; padding: 2px 5px; display: inline-block; }
.card-line { color: var(--muted); font-size: .875rem; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid #ebebed; min-height: 29px; }
.amount { margin-left: auto; white-space: nowrap; font-weight: 750; font-size: .94rem; font-variant-numeric: tabular-nums; }
.inspection { font-size: .76rem; font-weight: 700; border-radius: 4px; color: #624901; background: #fff2c6; padding: 2px 6px; }
.inspection.pending { background: #ffe6d4; color: #803b13; }
.signin { width: min(100%, 390px); margin: 62px auto 0; padding: 30px; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; }
.signin form { display: grid; gap: 16px; margin-top: 24px; }
.signin button { margin-top: 4px; }
label { display: grid; gap: 5px; color: var(--ink); font-size: .875rem; font-weight: 600; }
input, select, textarea { min-width: 0; width: 100%; min-height: 44px; border: 1px solid #aaa; border-radius: 8px; padding: 8px 10px; color: var(--ink); background: var(--paper); font-weight: 400; font-size: 1rem; }
input[type="date"] { display: block; }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--red); }
input::file-selector-button { font: inherit; min-height: 30px; border: 0; padding: 3px 9px; margin-right: 8px; border-radius: 5px; color: var(--ink); background: #ededef; }
textarea { resize: vertical; min-height: 80px; }
.notice { padding: 9px 11px; border-radius: 6px; background: #fce7e5; color: #8b211b; font-size: .875rem; }
#page-error { margin-bottom: 14px; }
dialog { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100%; height: 100dvh; max-height: none; width: min(640px, 94vw); max-width: none; padding: 0; border: 0; background: var(--paper); color: var(--ink); box-shadow: -10px 0 30px #14141428; }
dialog::backdrop { background: #14141460; }
body:has(dialog[open]) { overflow: hidden; }
dialog form { display: flex; flex-direction: column; height: 100%; }
.editor-header, .editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; }
.editor-header h2 { font-size: 1.42rem; line-height: 1.25; overflow-wrap: anywhere; }
.record-id { font-size: .825rem; color: var(--muted); margin-bottom: 3px; }
.icon-button { flex: none; background: #ededf0; color: var(--ink); border: 0; border-radius: 24px; width: 44px; height: 44px; font-size: 1.45rem; }
.icon-button:hover { background: #ddd; }
.tabs { display: flex; gap: 14px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.tabs button { min-height: 46px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); padding: 10px 6px; }
.tabs button[aria-pressed="true"] { border-bottom-color: var(--red); color: var(--red); font-weight: 700; }
.editor-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px; }
.editor-footer { justify-content: end; flex-wrap: wrap; border-top: 1px solid var(--line); }
.editor-footer .notice { flex-basis: 100%; }
.status-field { margin-bottom: 18px; }
fieldset, .field-group { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0 0 16px; }
.field-group { padding: 0 12px; }
.field-group summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.field-group[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.field-group .field-grid { padding-bottom: 12px; }
legend { padding: 0 5px; font-weight: 700; }
.field-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
.hint { color: var(--muted); font-size: .875rem; }
.file-row { display: grid; gap: 7px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.file-row a { color: #99251d; overflow-wrap: anywhere; padding-block: 10px; }
.file-options { display: flex; gap: 14px; flex-wrap: wrap; }
.file-options label { display: flex; align-items: center; gap: 6px; }
.file-links { align-items: center; justify-content: space-between; }
.file-hint { margin-bottom: 14px; }
#history h3 { margin: 0 0 8px; font-size: 1rem; }
#history ul { list-style: none; padding: 0; margin: 0 0 20px; }
#history li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; overflow-wrap: anywhere; }
#history li p { white-space: pre-wrap; }

@media (max-width: 900px) {
  #main { max-width: 660px; padding: 20px max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .topbar { gap: 10px; padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); }
  .brand { gap: 10px; }
  .brand img { width: 104px; height: auto; }
  #account-name { display: none; }
  h1 { font-size: 1.9rem; }
  .page-heading { gap: 8px; margin-bottom: 12px; }
  .page-heading .primary { flex-shrink: 0; padding-inline: 12px; font-size: .875rem; }
  #status-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: sticky;
    top: 0;
    z-index: 1;
    gap: 6px;
    padding: 5px 0 10px;
    background: #f5f5f7;
  }
  .status-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-height: 48px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
    text-align: left;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.2;
  }
  .status-filter[aria-pressed="true"] { color: #fff; background: var(--black); border-color: var(--black); box-shadow: inset 3px 0 var(--red); }
  .status-filter[aria-pressed="true"] .count { color: #fff; background: #393939; }
  .board { display: block; }
  .column { min-height: 0; }
  .column:not(.active-column), .column-header { display: none; }
  .card { min-height: 56px; }
  .signin { margin-top: 24px; padding: 24px; }
  dialog { width: 100%; }
  .editor-header, .editor-footer, .tabs, .editor-body {
    padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right));
  }
  .editor-header { padding-block: max(9px, env(safe-area-inset-top)) 9px; }
  .editor-footer { padding-block: 9px max(9px, env(safe-area-inset-bottom)); }
  .editor-footer button { flex: 1; }
  .editor-body { padding-block: 12px; }
  .tabs { gap: 0; }
  .tabs button { flex: 1; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .field-group summary, .file-options label, .file-row a { min-height: 44px; }
}
