
/* Layout: messenger mini-app column (phone width) on a workshop-steel ground; ПДО view widens to a board. */
:root {
  --bg: #e9edf1; --panel: #ffffff; --panel-2: #f4f6f8; --line: #d6dde4;
  --fg: #16202a; --muted: #5b6874; --steel: #1d3c5a; --steel-2: #2f5d86;
  --accent: #e5701b; --accent-ink: #ffffff; --accent-soft: #fdebdc;
  --ok: #1d7a4a; --ok-soft: #e1f2e8; --bad: #c0321f; --bad-soft: #fbe5e1; --warn: #9a6a00; --warn-soft: #fbf1d6;
  --bubble: #eef3f8;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-disp: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f151b; --panel: #18212a; --panel-2: #1f2a35; --line: #2c3a47;
  --fg: #e6edf3; --muted: #93a3b2; --steel: #8fb6dc; --steel-2: #7aa7d4;
  --accent: #f08a3c; --accent-ink: #1a0f05; --accent-soft: #3a2616;
  --ok: #5cc28c; --ok-soft: #173326; --bad: #ff8a75; --bad-soft: #3a1d18; --warn: #e2b64a; --warn-soft: #362b12;
  --bubble: #1c2834; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0f151b; --panel: #18212a; --panel-2: #1f2a35; --line: #2c3a47;
  --fg: #e6edf3; --muted: #93a3b2; --steel: #8fb6dc; --steel-2: #7aa7d4;
  --accent: #f08a3c; --accent-ink: #1a0f05; --accent-soft: #3a2616;
  --ok: #5cc28c; --ok-soft: #173326; --bad: #ff8a75; --bad-soft: #3a1d18; --warn: #e2b64a; --warn-soft: #362b12;
  --bubble: #1c2834; color-scheme: dark; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.45; }
.app { max-width: 560px; margin: 0 auto; padding-block: 12px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 12px; }
.app.wide { max-width: 1120px; }
.top { display: flex; align-items: center; gap: 12px; }
.ava { width: 42px; height: 42px; border-radius: 50%; background: var(--steel); color: var(--panel); display: grid; place-items: center; font-family: var(--f-disp); font-size: 11px; font-weight: 700; flex: none; }
.top h1 { font-family: var(--f-disp); font-weight: 600; font-size: 17px; margin: 0; letter-spacing: .01em; }
.top .sub { color: var(--muted); font-size: 13px; }
.demo-tag { margin-left: auto; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--warn); background: var(--warn-soft); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.roles { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.role { flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--fg); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.role[aria-pressed="true"] { background: var(--steel); border-color: var(--steel); color: var(--panel); }
.role .cnt { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; }
.role:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-width: 0; }
.order { display: grid; gap: 8px; }
.order .num { font-family: var(--f-disp); font-size: 13px; color: var(--steel-2); }
.order .name { font-weight: 600; font-size: 17px; }
.bar { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.meta { color: var(--muted); font-size: 13px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 2px 0; font-weight: 600; }
.msg { background: var(--bubble); border-radius: 14px 14px 14px 4px; padding: 12px 14px; display: grid; gap: 8px; border: 1px solid var(--line); }
.msg.in { border-left: 3px solid var(--accent); }
.msg .t { font-weight: 600; }
.msg .s { color: var(--muted); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { font: inherit; font-size: 14px; border-radius: 10px; padding: 8px 12px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: var(--panel); font-weight: 600; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input[type=number], select, textarea { font: inherit; font-size: 15px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); border-radius: 10px; padding: 7px 10px; }
input[type=number] { width: 84px; font-variant-numeric: tabular-nums; }
textarea { width: 100%; min-height: 60px; box-sizing: border-box; resize: vertical; }
.item { display: grid; gap: 10px; }
.item + .item { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.item .head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.item .nm { font-weight: 600; }
.item .bal { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; white-space: nowrap; }
.item .bal small { font-weight: 400; font-size: 12px; color: var(--muted); }
.route { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--muted); align-items: center; }
.route b { font-weight: 500; padding: 1px 7px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.route b.here { background: var(--steel); color: var(--panel); border-color: var(--steel); }
.form { display: grid; gap: 8px; background: var(--panel-2); border-radius: 10px; padding: 10px; border: 1px solid var(--line); }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.kit { display: grid; gap: 6px; }
.kit .kr { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; font-size: 14px; }
.kit .kr span:nth-child(2), .kit .kr span:nth-child(3) { font-variant-numeric: tabular-nums; text-align: right; }
.big { font-family: var(--f-disp); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.feed { display: grid; gap: 6px; font-size: 13px; }
.feed div { display: grid; grid-template-columns: 44px 1fr; gap: 8px; color: var(--muted); }
.feed div b { color: var(--fg); font-weight: 500; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 2px; }
.note { font-size: 13px; color: var(--muted); }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); }
.tblbox { overflow-x: auto; }
table.m { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
table.m th, table.m td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.m th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.m th:first-child, table.m td:first-child { text-align: left; white-space: normal; min-width: 150px; }
table.m td .tr { display: block; font-size: 11px; color: var(--warn); }
table.m td.z { color: var(--line); }
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.stat .l { font-size: 12px; color: var(--muted); }
.issue { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.issue:first-child { border-top: 0; padding-top: 0; }
@media (prefers-reduced-motion: no-preference) { .msg.in { animation: pop .25s ease-out; } @keyframes pop { from { transform: translateY(4px); opacity: .6; } to { transform: none; opacity: 1; } } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
.top .ttl { min-width: 0; flex: 1; }
.top .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.ghost { background: transparent; }
main { display: grid; gap: 12px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.login { display: grid; gap: 12px; max-width: 420px; }
.login label, .fld { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.login input, .login select, .fld input, .fld select { font-size: 16px; width: 100%; }
input[type=text], input[type=password], input[type=tel] { font: inherit; font-size: 16px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); border-radius: 10px; padding: 9px 10px; }
.err { color: var(--bad); font-size: 14px; min-height: 1.2em; }
.ohead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ohead .no { font-weight: 700; color: var(--steel-2); }
.fgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.ocard { display: grid; gap: 8px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.ocard[aria-pressed="true"] { outline: 2px solid var(--steel-2); }
.mini { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.mini b { color: var(--fg); font-weight: 600; }
.upd { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.out { opacity: .85; }
table.parts { border-collapse: collapse; width: 100%; font-size: 14px; }
table.parts td, table.parts th { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.parts th { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.offline { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
