:root {
  --bg: #0e0e0f;
  --surface: #17171a;
  --surface-2: #202024;
  --border: #2a2a2e;
  --text: #ffffff;
  --text-2: #9a9aa0;
  --text-3: #5c5c63;
  --accent: #34c759;
  --danger: #ff453a;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 24px;
  font-weight: 400;
}
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; color: inherit; }

.hidden { display: none !important; }

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 20px;
}
.head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
}
.head-meta {
  font-size: 15px;
  line-height: 20px;
  color: var(--text-2);
  white-space: nowrap;
}

.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  min-height: 120px;
}
.tile:active { background: var(--surface-2); }
.tile-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.tile-num {
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
}
.tile-status {
  font-size: 15px;
  line-height: 20px;
  color: var(--text-2);
}
.tile-name {
  margin-top: 8px;
  font-size: 15px;
  line-height: 20px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 17px;
  line-height: 24px;
}
.tile-pct { font-weight: 700; }

.bar {
  height: 8px;
  margin-top: 16px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  min-height: 100%;
  background: var(--accent);
}

.empty {
  padding: 80px 0 0;
  text-align: center;
  color: var(--text-3);
}
.empty svg {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto;
}
.empty p {
  margin: 16px 0 0;
  font-size: 17px;
  line-height: 24px;
  color: var(--text-2);
}

.order-head { padding: 24px 0 20px; }
.order-back {
  display: block;
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
}
.order-sub {
  margin-top: 8px;
  font-size: 15px;
  line-height: 20px;
  color: var(--text-2);
}

.label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

.done-block { margin-bottom: 32px; }
.done-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 0;
  font-size: 17px;
  line-height: 24px;
}
.done-block .bar { margin-top: 12px; }

.scale {
  position: relative;
  height: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.scale-readout,
.scale-flash {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
}
.scale-flash {
  background: var(--surface);
  z-index: 1;
}
.scale-flash[hidden] { display: none; }
.flash-ok {
  width: 48px;
  height: 48px;
  color: var(--accent);
}
.flash-text {
  margin-top: 12px;
  font-size: 17px;
  line-height: 24px;
}

.weight {
  display: flex;
  align-items: baseline;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.w-num {
  font-size: 96px;
  line-height: 96px;
  font-weight: 700;
}
.w-num.is-empty { color: var(--text-3); }
.w-num.is-dim { color: var(--text-2); }
.w-unit {
  margin-left: 8px;
  font-size: 28px;
  line-height: 32px;
  font-weight: 500;
  color: var(--text-2);
}

.scale-status {
  margin-top: 12px;
  font-size: 15px;
  line-height: 20px;
  color: var(--text-2);
}
.scale-status #status-text { margin-left: 2px; }
.scale-status.is-error { color: var(--danger); }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}
.dot.hollow {
  background: transparent;
  border: 1.5px solid var(--text-3);
  box-sizing: border-box;
}

.btn-main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 72px;
  margin-top: 16px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  font-size: 20px;
  line-height: 24px;
  font-weight: 600;
  cursor: pointer;
}
.btn-main:disabled {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-3);
  cursor: default;
}
.btn-main:not(:disabled):active {
  background: var(--surface-2);
  color: var(--text);
}

.svc {
  margin-top: 16px;
  text-align: center;
  font-size: 15px;
  line-height: 20px;
  color: var(--text-2);
}
.svc-dot { margin: 0 8px; }
.svc-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 15px;
  line-height: 20px;
  cursor: pointer;
}
.svc-link:hover { text-decoration: underline; }

.recent { margin-top: 32px; }
.recent ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.recent li {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  font-size: 17px;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
}
.recent li.recent-empty {
  display: block;
  height: auto;
  padding: 12px 0 0;
  border: 0;
  font-size: 15px;
  line-height: 20px;
  color: var(--text-3);
}
.recent .r-kg { text-align: right; }
.recent time {
  font-size: 15px;
  line-height: 20px;
  color: var(--text-2);
}
.r-del {
  height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 15px;
  line-height: 20px;
  cursor: pointer;
}
.r-del:hover { text-decoration: underline; }
.r-del:active { color: var(--text); }

.sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.sheet-card {
  width: 100%;
  max-width: 680px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}
.manual-input {
  width: 100%;
  height: 72px;
  margin-top: 8px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 40px;
  line-height: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.keys button {
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}
.keys button:active { background: var(--border); }
.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.btn-quiet {
  height: 72px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 20px;
  line-height: 24px;
  font-weight: 600;
  cursor: pointer;
}
.sheet-ok { margin-top: 0; }

.passport { background: #efe8d8; color: #1c1917; }
.pass {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 22px 40px;
}
.pass-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: #6b6254;
}
.pass h1 { margin: 4px 0 8px; font-size: 40px; letter-spacing: -0.03em; }
.pass-product { font-size: 22px; margin: 0; }
.pass-gost { margin: 4px 0 20px; color: #5c5346; }
.pass-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin: 0; }
.pass-grid dt { font-size: 13px; color: #6b6254; }
.pass-grid dd { margin: 2px 0 0; font-size: 20px; font-weight: 650; }
.pass-note {
  margin-top: 24px;
  padding: 12px 14px;
  background: #f3dd9a;
  border-radius: 8px;
  font-weight: 650;
}

@media (max-width: 720px) {
  .pass-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .w-num { font-size: 72px; line-height: 72px; }
}
