/* Reoflex в цеху — айдентика бренда: чёрный, оранжевый, белые плашки, крупные скругления */

:root {
  --black: #000000;
  --panel: #17181c;
  --panel-2: #23252b;
  --surface: #ffffff;

  --ink: #1d2444;          /* тёмно-синий из логотипа */
  --ink-2: #4c5570;
  --ink-3: #858ba0;
  --line: #e3e6ee;
  --steel: #eef1f7;
  --steel-deep: #2c4a72;

  --brand: #ed6b06;
  --brand-dark: #c85804;
  --warn: #d94a12;
  --ok: #1f7a44;

  --r: 22px;
  --r-sm: 14px;
  --pill: 999px;
  --tap: 58px;
  --pad: 14px;

  --font: 'Rubik', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--black);
  color: #fff;
  font-family: var(--font);
  font-size: 17px; line-height: 1.35;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

svg { fill: none; stroke: currentColor; }
.ic { width: 24px; height: 24px; display: block; flex: none; }
.ic--lg { width: 30px; height: 30px; }

button, input, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- шапка ---------- */

/* шапка не липкая: длинные заголовки техкарт съедали бы пол-экрана */
.bar {
  background: var(--black);
  padding: calc(10px + env(safe-area-inset-top)) var(--pad) 12px;
}
.bar__top { display: flex; align-items: center; gap: 10px; min-height: 52px; }

.bar__back {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  background: var(--panel-2); color: #fff;
  border-radius: var(--pill);
}
.bar__back:active { background: var(--brand); }

.plate {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 22px;
  background: #fff;
  border-radius: var(--pill);
}
.plate__logo { display: block; height: 26px; width: auto; }

.bar__timers {
  display: flex; align-items: center; gap: 6px; flex: none;
  height: 46px; padding: 0 16px;
  background: var(--brand); color: #fff;
  border-radius: var(--pill);
  font-family: var(--mono); font-weight: 600;
}

.bar__title {
  display: block; margin-top: 14px;
  font-size: clamp(24px, 7vw, 30px); font-weight: 800; line-height: 1.05;
  letter-spacing: -.02em; text-transform: uppercase;
  text-wrap: balance;
}

/* ---------- каркас ---------- */

.view {
  padding: 4px var(--pad) calc(104px + env(safe-area-inset-bottom));
  max-width: 720px; margin: 0 auto;
}

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-radius: var(--r) var(--r) 0 0;
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; height: 56px; border-radius: var(--r-sm);
  color: #8d93a4; font-size: 11px; font-weight: 600;
}
.nav a[aria-current] { background: var(--brand); color: #fff; }

/* ---------- типографика ---------- */

h2 {
  margin: 24px 4px 10px;
  font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: #7d8397;
}
h2:first-child { margin-top: 12px; }

.lead { margin: 0 4px 14px; color: #b3b8c6; font-size: 15px; }
.muted { color: var(--ink-3); font-size: 13px; }

/* ---------- блоки ---------- */

.block {
  background: var(--surface); color: var(--ink);
  border-radius: var(--r); overflow: hidden;
  margin-bottom: 12px;
}
.block__head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.block__body { padding: 18px; }

/* ---------- условия в цеху ---------- */

.cond { display: grid; grid-template-columns: 1fr 1fr; }
.cond__cell { padding: 18px; display: flex; align-items: center; gap: 12px; }
.cond__cell + .cond__cell { border-left: 1px solid var(--line); }
.cond__cell svg { color: var(--brand); }
.cond__val { font-family: var(--mono); font-size: 32px; font-weight: 600; line-height: 1; }
.cond__lab { margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

.advice { padding: 16px 18px; background: var(--steel); }
.advice strong { display: block; margin-bottom: 4px; font-size: 17px; }
.advice--warn { background: #ffe9dc; }
.advice--warn svg { color: var(--warn); }
.advice__row { display: flex; gap: 10px; align-items: flex-start; }

/* ---------- плитки и кнопки ---------- */

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 118px; padding: 16px;
  background: var(--surface); color: var(--ink);
  border-radius: var(--r); text-align: left;
}
.tile:active { transform: scale(.985); }
.tile__ic { color: var(--brand); }
.tile__t { font-weight: 700; font-size: 17px; }
.tile__s { font-size: 12px; color: var(--ink-3); }
.tile--brand { background: var(--brand); color: #fff; }
.tile--brand .tile__ic, .tile--brand .tile__s { color: #fff; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: var(--tap); padding: 0 20px;
  background: var(--brand); color: #fff;
  border-radius: var(--pill);
  font-weight: 700; font-size: 16px;
}
.btn:active { transform: translateY(1px); }
.btn--brand { background: var(--brand); color: #fff; }
.btn--ghost { background: var(--steel); color: var(--ink); }
.btn + .btn { margin-top: 10px; }

/* ---------- списки ---------- */

.list { background: var(--surface); color: var(--ink); border-radius: var(--r); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: var(--tap); padding: 14px 18px;
  text-align: left;
}
.row + .row { border-top: 1px solid var(--line); }
.row:active { background: var(--steel); }
.row__main { flex: 1; min-width: 0; }
.row__t { font-weight: 700; }
.row__s { font-size: 13px; color: var(--ink-3); }
.row__go { color: var(--ink-3); }

.tag {
  display: inline-block; padding: 5px 11px;
  border-radius: var(--pill);
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  background: var(--ink); color: #fff;
}
.tag--brand { background: var(--brand); }
.tag--steel { background: var(--steel); color: var(--steel-deep); }
.tag--out { background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); }

/* ---------- шаги техкарты ---------- */

.step { background: var(--surface); color: var(--ink); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.step__head { display: flex; gap: 14px; padding: 16px 18px; align-items: flex-start; }
.step__n {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  border-radius: var(--pill);
  font-family: var(--mono); font-weight: 600; font-size: 17px;
}
.step__t { font-weight: 700; font-size: 19px; line-height: 1.2; }
.step__prod { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.step__body { border-top: 1px solid var(--line); padding: 14px 18px; }
.step__meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.step__note { font-size: 14px; color: var(--ink-2); }
.step__acts { display: flex; gap: 8px; padding: 0 18px 18px; }
.step__acts .btn { min-height: 50px; font-size: 15px; }

/* ---------- калькулятор ---------- */

.pick {
  width: 100%; min-height: var(--tap); padding: 0 18px;
  background: var(--surface); color: var(--ink);
  border: 0; border-radius: var(--pill);
  font-weight: 600;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 22px) 26px, calc(100% - 16px) 26px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.stepper {
  display: grid; grid-template-columns: var(--tap) 1fr var(--tap);
  background: var(--surface); color: var(--ink);
  border-radius: var(--pill); overflow: hidden;
}
.stepper button { display: grid; place-items: center; color: var(--ink); }
.stepper button:active { background: var(--brand); color: #fff; }
.stepper__val { display: grid; place-items: center; font-family: var(--mono); font-size: 26px; font-weight: 600; }

.result { background: var(--surface); color: var(--ink); border-radius: var(--r); overflow: hidden; margin-top: 12px; }
.result__row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.result__row + .result__row { border-top: 1px solid var(--line); }
.result__row--total { background: var(--ink); color: #fff; }
.result__n { flex: 1; min-width: 0; }
.result__n b { display: block; font-size: 16px; }
.result__n span { font-size: 12px; color: var(--ink-3); }
.result__row--total .result__n span { color: #a8afc6; }
.result__v { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.result__v i { font-style: normal; font-size: 14px; color: var(--ink-3); margin-left: 3px; }
.result__row--total .result__v i { color: #a8afc6; }
.swatch { width: 8px; height: 44px; border-radius: var(--pill); background: var(--brand); flex: none; }

/* ---------- таймеры ---------- */

.timer {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; margin-bottom: 10px;
  background: var(--surface); color: var(--ink);
  border-radius: var(--r);
}
.timer__t { flex: 1; min-width: 0; }
.timer__t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer__t span { font-size: 12px; color: var(--ink-3); }
.timer__left { font-family: var(--mono); font-size: 28px; font-weight: 600; }
.timer--done { background: var(--brand); color: #fff; }
.timer--done .timer__t span { color: #ffe0c6; }
.timer__x { width: 44px; height: 44px; display: grid; place-items: center; color: currentColor; opacity: .55; }

/* ---------- поиск, чипсы, цвета ---------- */

.search { display: flex; background: var(--surface); border-radius: var(--pill); overflow: hidden; margin-bottom: 12px; }
.search input {
  flex: 1; min-height: var(--tap); padding: 0 20px;
  border: 0; outline: none; background: none; color: var(--ink);
  font-size: 18px; font-weight: 600; text-transform: uppercase;
}
.search input::placeholder { text-transform: none; font-weight: 400; color: var(--ink-3); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; padding: 10px 18px;
  background: var(--panel-2); color: #d3d7e2;
  border-radius: var(--pill); font-weight: 600; font-size: 14px;
}
.chips button[aria-pressed="true"] { background: var(--brand); color: #fff; }

.color-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; text-align: left; }
.color-row + .color-row { border-top: 1px solid var(--line); }
.color-chip { width: 54px; height: 54px; flex: none; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.color-row__t b { display: block; }
.color-row__t span { font-size: 13px; color: var(--ink-3); }

/* ---------- разное ---------- */

.note {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 18px; margin-bottom: 12px;
  background: var(--panel); color: #b7bcca;
  border-radius: var(--r); font-size: 14px;
}
.note svg { color: var(--brand); }

.demo-flag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; margin-bottom: 12px;
  background: var(--panel-2); color: #c3c8d6;
  border-radius: var(--pill);
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.demo-flag svg { width: 16px; height: 16px; color: var(--brand); }

.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
  z-index: 50; max-width: 90vw;
  padding: 14px 22px; background: var(--brand); color: #fff;
  border-radius: var(--pill); font-weight: 700; font-size: 15px;
}

.empty { padding: 32px 18px; text-align: center; color: var(--ink-3); background: var(--surface); border-radius: var(--r); }

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
