/* РЗДС — приложение. Вариант А «Цех»: светлый, фирменные цвета. */

@font-face { font-family: Onest; font-weight: 400; font-display: swap; src: url(fonts/onest-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: Onest; font-weight: 500; font-display: swap; src: url(fonts/onest-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: Onest; font-weight: 600; font-display: swap; src: url(fonts/onest-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: Onest; font-weight: 700; font-display: swap; src: url(fonts/onest-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: Onest; font-weight: 400; font-display: swap; src: url(fonts/onest-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Onest; font-weight: 500; font-display: swap; src: url(fonts/onest-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Onest; font-weight: 600; font-display: swap; src: url(fonts/onest-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Onest; font-weight: 700; font-display: swap; src: url(fonts/onest-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Unbounded; font-weight: 600; font-display: swap; src: url(fonts/unbounded-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: Unbounded; font-weight: 600; font-display: swap; src: url(fonts/unbounded-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+2000-206F; }
@font-face { font-family: Unbounded; font-weight: 700; font-display: swap; src: url(fonts/unbounded-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: Unbounded; font-weight: 700; font-display: swap; src: url(fonts/unbounded-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+2000-206F; }

:root {
  --bg: #F4F1EA; --bg2: #FBF9F4; --card: #FFFFFF; --ink: #1B1F1C; --muted: #5A5F58;
  --line: #E6E1D6; --line2: #F0ECE3; --chip: #E8E3D8; --btnline: #D5CFC2;
  --green: #1F6436; --green-d: #174D2A; --green-l: #E3EFE6;
  --bronze: #AF7C58; --bronze-d: #6B4528; --bronze-dd: #5A391F; --bronze-l: #F3E4D5; --bronze-m: #E8DCCF;
  --red: #C62828; --red-d: #9E1B12; --red-t: #B3261E; --red-l: #FDE3DF; --red-ll: #FFF4F2; --red-line: #F2C4BE;
  --amber: #C98A2E; --amber-d: #6E440F; --amber-l: #FBEBD3;
  --gray: #9A9F98; --gray-d: #4E534D; --gray-l: #ECEDEA;
  --top: env(safe-area-inset-top, 0px); --bottom: env(safe-area-inset-bottom, 0px);
  --tabh: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  font-family: Onest, -apple-system, system-ui, sans-serif; color: var(--ink);
  font-size: 16px; line-height: 1.35; -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none; -webkit-text-size-adjust: 100%;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
h1, h2, h3, p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent); outline-offset: 2px; }

/* ---------------------------------------------------------------- каркас */
#app { min-height: 100%; }
.screen {
  max-width: 560px; margin: 0 auto;
  padding: calc(var(--top) + 18px) 18px calc(var(--bottom) + var(--tabh) + 28px);
  display: flex; flex-direction: column; gap: 16px;
  animation: in .18s ease-out;
}
.screen.no-tabs { padding-bottom: calc(var(--bottom) + 28px); }
.screen.with-cta { padding-bottom: calc(var(--bottom) + 110px); }
@keyframes in { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.title { font-family: Unbounded, Onest, sans-serif; font-size: 28px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin-top: 4px; }
.sub { margin-top: 4px; font-size: 15px; color: var(--muted); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.link-btn { border: none; background: none; padding: 10px 0; color: var(--green); font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; gap: 2px; text-decoration: none; }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 4px 0; }
.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.h2 { font-size: 17px; font-weight: 700; }

.icon-btn {
  position: relative; width: 48px; height: 48px; flex-shrink: 0; border-radius: 16px;
  border: 1px solid #E0DACD; background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.icon-btn.green { background: var(--green); color: #fff; border-color: var(--green); }
.badge {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg);
}

/* --------------------------------------------------------------- кнопки */
.btn {
  height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--btnline);
  background: var(--card); color: var(--ink); font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.btn.danger { background: var(--card); border: 2px solid var(--red); color: var(--red-t); font-weight: 700; }
.btn.danger.on { background: var(--red); color: #fff; }
.btn.big { height: 76px; border-radius: 20px; font-size: 22px; }
.btn.tall { height: 60px; border-radius: 18px; font-size: 16px; }
.btn.bronze { background: var(--bronze-l); border-color: #D9C3AE; color: var(--bronze-dd); font-weight: 700; }
.btn.ghost { border: none; background: none; color: var(--green); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btns { display: flex; gap: 8px; }
.btns > * { flex: 1 1 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------------------------------------------------------- карточки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line2); }
.pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.red { background: var(--red-l); color: var(--red-d); }
.pill.bronze { background: var(--bronze-l); color: var(--bronze-d); }
.pill.green { background: var(--green-l); color: var(--green); }
.pill.amber { background: var(--amber-l); color: var(--amber-d); }
.pill.gray { background: var(--gray-l); color: var(--gray-d); }
.pill.solid-red { background: var(--red); color: #fff; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 700; }

/* Блок «ждут решения» — зелёный, самый заметный на главном экране */
.decide { background: var(--green); color: #fff; border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.decide .count { padding: 3px 10px; border-radius: 999px; background: #fff; color: var(--green); font-size: 13px; font-weight: 700; }
.decide .item { background: #fff; color: var(--ink); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.decide.empty { background: var(--green-l); color: var(--green-d); flex-direction: row; align-items: center; gap: 10px; font-weight: 700; }

/* Плитки станков */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.tile.problem { background: var(--red-ll); border-color: var(--red-line); }
/* Плитка станка с кнопкой простоя под ней (04.10) */
.tile-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile-wrap .tile { flex: 1 1 auto; }
.btn.tile-stop { height: 42px; min-height: 42px; font-size: 14px; border-radius: 14px; background: var(--card);
  border: 1.5px solid var(--red-line); color: var(--red-t); font-weight: 700; }
.btn.tile-stop.go { border-color: var(--green); color: var(--green); }
.tile .name { font-size: 16px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; }
.bar { height: 6px; border-radius: 3px; background: #ECE7DC; overflow: hidden; }
.bar > i { display: block; height: 6px; border-radius: 3px; }

/* ------------------------------------------------------------ вкладки */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 6px 8px calc(var(--bottom) + 6px); background: rgba(251, 249, 244, .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid #E3DED3;
}
.tabbar .in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tab { position: relative; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; }
.tab.on { color: var(--green); font-weight: 700; }
.tab .badge { top: 0; right: auto; left: 54%; border-color: var(--bg2); min-width: 18px; height: 18px; font-size: 11px; }

.segment { display: grid; gap: 4px; padding: 4px; border-radius: 14px; background: var(--chip); }
.segment button { height: 40px; border: none; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.segment button.on { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* -------------------------------------------------------------- задачи */
.task { display: flex; gap: 10px; padding: 12px 14px 12px 8px; align-items: flex-start; }
.check { flex-shrink: 0; width: 44px; height: 44px; margin: -6px 0 -6px 0; border: none; background: none; display: flex; align-items: center; justify-content: center; }
.check i { width: 24px; height: 24px; border-radius: 12px; border: 2.5px solid var(--gray); display: flex; align-items: center; justify-content: center; }
.check.done i { background: var(--green); border-color: var(--green); color: #fff; }
.task .body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; padding-top: 2px; }
.task .text { font-size: 15px; font-weight: 600; line-height: 1.3; }
.task.is-done .text { text-decoration: line-through; color: #8C918A; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.avatar { width: 22px; height: 22px; border-radius: 11px; background: var(--bronze-m); color: var(--bronze-dd); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar.me { background: var(--green-l); color: var(--green); }
.avatar.lg { width: 32px; height: 32px; border-radius: 16px; font-size: 13px; }
.who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--btnline); background: var(--card); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.chip.person { border-radius: 22px; padding: 0 14px 0 6px; }
.chip.on .avatar { background: #fff; color: var(--green); }
.levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.levels button { height: 44px; border-radius: 12px; border: 2px solid transparent; font-size: 13px; font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 20px; background: var(--card); border: 1px solid #E0DACD; }
.field span { font-size: 13px; font-weight: 700; color: var(--muted); }
.field textarea, .field input { border: none; outline: none; resize: none; background: transparent; font-size: 18px; font-weight: 600; padding: 0; }
.input-row { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 6px 0 16px; border-radius: 16px; background: var(--card); border: 1px solid #E0DACD; }
.input-row input { flex: 1 1 auto; min-width: 0; border: none; outline: none; background: transparent; font-size: 16px; }
.input-row .icon-btn { width: 40px; height: 40px; border-radius: 12px; }

.info { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--green-l); color: var(--green-d); font-size: 14px; font-weight: 600; }
.info.bronze { background: var(--bronze-l); color: var(--bronze-dd); }
.info.red { background: var(--red-ll); color: var(--red-d); border: 1px solid var(--red-line); }

.kv { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; }
.kv > .k { width: 72px; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.kv > .v { flex: 1 1 auto; font-size: 15px; font-weight: 600; }

.steps { display: flex; justify-content: space-between; padding: 12px 10px; }
.steps > div { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1 1 0; text-align: center; font-size: 12px; }
.steps i { width: 12px; height: 12px; border-radius: 6px; background: var(--line); }
.steps i.on { background: var(--green); }
.steps i.now { background: var(--bronze); }

.bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--card); border: 1px solid var(--line); align-self: flex-start; }
.bubble.mine { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: var(--green); border-color: var(--green); color: #fff; }
.bubble .by { font-size: 12px; font-weight: 700; color: var(--bronze-d); }
.bubble.mine .by { color: #CFE5D6; }

/* Нижняя закреплённая кнопка */
.cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 18px calc(var(--bottom) + 14px); background: rgba(244, 241, 234, .96); border-top: 1px solid #E3DED3; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.cta .in { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }
.cta .btn { height: 58px; border-radius: 18px; font-size: 17px; }

/* ----------------------------------------------------------------- Гант */
.gantt { background: var(--card); border: 1px solid var(--line); border-radius: 20px; display: flex; overflow: hidden; }
.gantt .names { width: 86px; flex-shrink: 0; border-right: 1px solid var(--line2); background: var(--card); z-index: 2; }
.gantt .names > div { height: 64px; padding-left: 12px; display: flex; flex-direction: column; justify-content: center; border-top: 1px solid var(--line2); }
.gantt .names > div:first-child { height: 26px; border-top: none; }
.gantt .scroll { flex: 1 1 auto; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.gantt .scroll::-webkit-scrollbar { display: none; }
.gantt .track { position: relative; }
.gantt .hours { position: relative; height: 26px; }
.gantt .hours span { position: absolute; top: 5px; font-size: 11px; font-weight: 600; color: var(--muted); transform: translateX(3px); }
.gantt .lane { position: relative; height: 64px; border-top: 1px solid var(--line2); }
.gantt .grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line2); }
.gantt .blk { position: absolute; top: 10px; height: 44px; border-radius: 11px; padding: 0 10px; text-align: left; overflow: hidden; white-space: nowrap; display: flex; flex-direction: column; justify-content: center; border: 1px solid transparent; }
.gantt .blk b { font-size: 13px; } .gantt .blk small { font-size: 11px; font-weight: 500; }
.blk.work { background: var(--green); color: #fff; }
.blk.problem { background: var(--red-l); color: var(--red-d); border: 2px solid var(--red); }
.blk.plan { background: var(--bronze-l); color: var(--bronze-dd); border-color: #D9C3AE; }
.blk.done { background: var(--gray-l); color: var(--gray-d); }
.blk.wait { background: var(--amber-l); color: var(--amber-d); border-color: #EBCB98; }
.blk.sel { box-shadow: 0 0 0 3px var(--ink); }
.gantt .now { position: absolute; top: 22px; bottom: 0; width: 2px; background: var(--red); z-index: 1; pointer-events: none; }
.gantt .now span { position: absolute; top: -20px; left: -18px; padding: 1px 5px; border-radius: 6px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabh) + var(--bottom) + 12px); z-index: 25;
  padding: 10px 18px 16px; border-radius: 26px 26px 0 0; background: var(--card);
  box-shadow: 0 -10px 30px rgba(27, 31, 28, .16); display: flex; flex-direction: column; gap: 10px;
  max-width: 560px; margin: 0 auto; animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes down { from { transform: translate(-50%, -16px); opacity: .4; } to { transform: translate(-50%, 0); opacity: 1; } }
.grab { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--btnline); }

/* ------------------------------------------------------------- переключатели */
.switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.switch-row .t { flex: 1 1 auto; min-width: 0; }
.switch { flex-shrink: 0; width: 52px; height: 32px; padding: 3px; border-radius: 16px; border: none; background: #C9C4B8; display: flex; justify-content: flex-start; transition: background .15s; }
.switch i { width: 26px; height: 26px; border-radius: 13px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"] i { transform: translateX(20px); }

.push-preview { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 24px; background: #2B2F2C; }
.push-preview .lbl { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #C9CEC8; }
.push { display: flex; gap: 10px; padding: 12px; border-radius: 18px; background: #F2F0EB; }
.push img { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; }

/* ------------------------------------------------------------ смена рабочего */
.shift-card { background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.order-big { font-family: Unbounded, Onest, sans-serif; font-size: 38px; font-weight: 600; line-height: 1; }

/* ---------------------------------------------------------------- вход */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: calc(var(--top) + 24px) 24px calc(var(--bottom) + 24px); max-width: 460px; margin: 0 auto; }
.code-input { width: 100%; height: 64px; border-radius: 18px; border: 1px solid #D5CFC2; background: var(--card); text-align: center; font-size: 28px; font-weight: 700; letter-spacing: .3em; }
.install-step { display: flex; gap: 14px; align-items: flex-start; padding: 14px; }
.install-step .n { width: 32px; height: 32px; border-radius: 16px; background: var(--green); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ios-share { display: inline-flex; vertical-align: -5px; color: #0A84FF; }

/* ---------------------------------------------------------------- тосты */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 50;
  top: calc(var(--top) + 12px); max-width: calc(100% - 32px);
  padding: 12px 16px; border-radius: 14px; background: #1B1F1C; color: #fff; font-size: 15px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: up .2s ease-out;
  width: max-content; text-align: center;
}
.toast.error { background: var(--red-d); }
.status-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.demo-flag { position: fixed; top: calc(var(--top) + 6px); right: 10px; z-index: 30; padding: 3px 9px; border-radius: 999px; background: var(--bronze); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; pointer-events: none; }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 15px; }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.still .screen, .still .sheet, .still .toast { animation: none; }
.tile { font: inherit; color: inherit; cursor: pointer; }
.tile:active, .task .body:active { opacity: .85; }
button.kv { font: inherit; color: inherit; cursor: pointer; }

.decide .btn { font-size: 14px; padding: 0 10px; line-height: 1.15; }
.btn.tall.danger, .grid2 .btn.tall { font-size: 15px; line-height: 1.15; }

/* ---------------------------------------------- отклик на нажатие (29.09) */
.spinner { display: inline-block; width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.check .spinner { width: 22px; height: 22px; color: var(--green); }
.toast.wait { display: flex; align-items: center; gap: 10px; }
.toast.ok { background: var(--green-d); }
.busy { pointer-events: none; }
.btn.busy, .chip.busy, .check.busy, .levels button.busy, .switch.busy { opacity: .9; }
.btn.busy::after, .chip.busy::after { content: ''; display: inline-block; width: 16px; height: 16px; flex-shrink: 0;
  border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.check.busy i { border-style: dotted; animation: spin 1s linear infinite; }
.task.saving { opacity: .85; }
.chip, .levels button, .check, .tile, .kv[data-act], .switch { transition: transform .08s ease; }
.chip:active, .levels button:active, .check:active, .tile:active, .switch:active { transform: scale(.95); }

/* ---------------------------------------------------- календарь (29.09) */
.cal { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cal-sum { font-size: 16px; font-weight: 700; color: var(--green-d); background: var(--green-l); border-radius: 12px; padding: 10px 12px; text-align: center; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head b { font-size: 17px; }
.cal-head .icon-btn { width: 44px; height: 44px; font-size: 24px; line-height: 1; }
.cal-head .icon-btn[disabled] { opacity: .3; }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal-wd span { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-wd .wknd { color: #A8ABA6; }
.cal-d { position: relative; height: 44px; border: none; border-radius: 12px; background: var(--bg2); font-size: 16px; font-weight: 600; color: var(--ink); }
.cal-d.wknd { color: #8C918A; background: transparent; }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--bronze); }
.cal-d.sel { background: var(--green); color: #fff; box-shadow: none; }
.cal-d[disabled] { color: #C9C6BE; background: transparent; }
.cal-d:active { transform: scale(.92); }
.cal-times { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-times .chip { height: 40px; padding: 0 12px; }
.cal-d small { position: absolute; top: 2px; left: 0; right: 0; font-size: 9px; font-weight: 700; color: var(--bronze-d); text-transform: uppercase; line-height: 1; }
.cal-d.sel small { color: #CFE5D6; }
.cal-d { padding-top: 6px; }
.task.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 30% { background: var(--green-l); } 100% { background: transparent; } }
.toast { animation: down .18s ease-out; z-index: 60; }

/* ------------------------------------------ «Исходящие» и входы (волна 1) */
.toast.queued { background: var(--bronze-dd); }
.outbox-chip { position: fixed; top: calc(var(--top) + 8px); left: 50%; transform: translateX(-50%); z-index: 40;
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: none; border-radius: 999px;
  background: var(--bronze-l); color: var(--bronze-dd); font: 700 14px/1 inherit; font-family: inherit;
  box-shadow: 0 4px 14px rgba(90, 57, 31, .22); cursor: pointer; }
.outbox-chip .spinner { width: 14px; height: 14px; border-width: 2px; }
.ob-back { position: fixed; inset: 0; z-index: 44; background: rgba(27, 31, 28, .35); }
.ob-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; max-height: 80vh; overflow: auto;
  background: var(--bg); border-radius: 24px 24px 0 0; padding: 18px 18px calc(var(--bottom) + 18px);
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -8px 30px rgba(0,0,0,.2); animation: up .2s ease-out; }
.ob-item { display: flex; gap: 10px; align-items: center; padding: 12px 14px; }
.task.saving.queued { opacity: 1; background: var(--bronze-l); }
.task.saving.queued .check { color: var(--bronze-d); display: flex; align-items: center; justify-content: center; }
.sess { display: flex; gap: 12px; align-items: center; padding: 14px; }
.sess .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--bg2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink2, #3A3F3A); }
.sess.off { opacity: .55; }
.sess .me { color: var(--green); font-weight: 700; }
.has-ob .toast { top: calc(var(--top) + 52px); }

/* ------------------------------------------------------------ волна 2 */
/* Фото */
.ph-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ph { position: relative; width: 76px; height: 76px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--bg2);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--muted); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 13px; border: none; background: rgba(27,31,28,.7); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.ph-full { position: fixed; inset: 0; z-index: 70; background: rgba(10,12,10,.94); display: flex; align-items: center; justify-content: center; padding: calc(var(--top) + 12px) 12px calc(var(--bottom) + 12px); }
.ph-full img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.ph-close { position: absolute; top: calc(var(--top) + 12px); right: 12px; width: 44px; height: 44px; border-radius: 22px; border: none; background: rgba(255,255,255,.18); color: #fff; display: flex; align-items: center; justify-content: center; }
.input-row .icon-btn:first-child { margin-left: -10px; }
/* Смена: таймер, пауза, количество, чек-лист */
.timer { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--green-l); color: var(--green-d); font-size: 15px; }
.timer.paused { background: var(--bronze-l); color: var(--bronze-dd); }
.timer.bad { background: var(--red-l); color: var(--red-d); }
.shift-card .grid2 .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.field-in { border: none; outline: none; background: #fff; border-radius: 12px; padding: 12px; font-size: 16px; color: var(--ink); }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; }
.stepper .icon-btn { width: 56px; height: 56px; border-radius: 16px; font-size: 26px; font-weight: 600; background: #fff; }
.stepper input { height: 56px; border: none; border-radius: 16px; background: #fff; text-align: center; font-size: 26px; font-weight: 700; color: var(--ink); min-width: 0; }
.check-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: none; background: none; text-align: left; font: inherit; font-size: 16px; color: var(--ink); }
.check-row .check { pointer-events: none; }
.check-row.on { background: var(--green-l); }
.ob-sheet .btn.big[disabled] { opacity: .5; }
/* Заказ у станка */
.pass-row { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.pass-v { font-size: 16px; white-space: pre-wrap; line-height: 1.4; }
/* Поиск */
.search-box { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px; border-radius: 16px; background: var(--card); border: 1px solid #E0DACD; color: var(--muted); }
.search-box input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 17px; color: var(--ink); }
/* План: неделя, перетаскивание, перенос */
.gantt .hours.week .wd { position: absolute; top: 5px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; transform: none; }
.gantt .hours.week .wd.today { color: var(--green-d); }
.gantt .hours.week .wd.wk { color: #A8ABA6; }
.gantt .grid.day { background: var(--line); }
.gantt .wkbg { position: absolute; top: 0; bottom: 0; background: rgba(0,0,0,.025); }
.gantt.is-week .blk { padding: 0 5px; border-radius: 8px; }
.gantt.is-week .blk b { font-size: 11px; }
.gantt .blk { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: pan-x; }
.gantt .blk.dragging { z-index: 5; box-shadow: 0 8px 20px rgba(27,31,28,.3); outline: 2px solid var(--ink); overflow: visible; }
.gantt .blk.dragging::after { content: attr(data-to); position: absolute; top: -22px; left: 0; padding: 1px 6px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; }
.sheet.mv { max-height: 72vh; overflow: auto; }
.sheet .late { color: var(--red-d); font-weight: 700; }
.mv-list .kv { gap: 8px; }

/* ------------------------------------------------------------ волна 3 */
.parsed { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--green-l); color: var(--green-d); font-size: 14px; line-height: 1.35; margin-top: -6px; }
.parsed svg { flex-shrink: 0; margin-top: 2px; }

/* Волна 3: переписка по заказу, «сделать задачей», маршрутный лист, сканер */
.to-task { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 6px 0 0; color: var(--green-d); text-decoration: none; font-weight: 600; }
.bubble.mine .to-task { color: #fff; }
.bubble.queued { opacity: .75; }
.route-sheet { display: flex; flex-direction: column; gap: 12px; }
.route-op { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); break-inside: avoid; page-break-inside: avoid; }
.route-op .qr { width: 112px; height: 112px; flex-shrink: 0; background: #fff; display: flex; align-items: center; justify-content: center; }
.route-op .qr svg, .route-op .qr img { width: 112px; height: 112px; display: block; }
.route-op .num { font-size: 13px; font-weight: 700; color: var(--bronze-d); }
.scan-box { position: relative; border-radius: 22px; overflow: hidden; background: #111; aspect-ratio: 3 / 4; width: 100%; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-box .frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.op-focus { outline: 3px solid var(--bronze); outline-offset: 2px; }
@media print {
  body { background: #fff !important; }
  .topbar, .no-print, .tabbar, .cta, .outbox-chip, .toast, .demo-flag { display: none !important; }
  .screen { padding: 0 !important; max-width: none !important; }
  .route-op { border-color: #999; }
}

/* 04.10: окно выбора времени после «Сегодня» / «Завтра» */
.tp { gap: 10px; }
.tp-h { font-size: 15px; color: var(--muted); }
.tp-h b { color: var(--ink); }
.tp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tp-grid .chip { height: 44px; padding: 0; justify-content: center; font-size: 15px; }
.tp-grid .chip.soon { grid-column: span 4; }
.tp-grid .chip[disabled] { opacity: .35; }
.chip.now { border-color: #E3A5A0; color: #B3261E; }
.chip.now.on { background: #B3261E; border-color: #B3261E; color: #fff; }

/* 04.10: крутилка на любой кнопке, пока идёт запрос, и общий кружок сверху */
.icon-btn.busy, .link-btn.busy, .levels button.busy, .kv.busy, .check-row.busy, .switch.busy { position: relative; }
.icon-btn.busy > svg { opacity: 0; }
.icon-btn.busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px;
  border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.link-btn.busy::after, .levels button.busy::after, .kv.busy::after { content: ''; display: inline-block; width: 14px; height: 14px; margin-left: 6px; vertical-align: -2px;
  border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.check-row.busy .check i { border-style: dotted; animation: spin 1s linear infinite; }
.switch.busy { opacity: .6; }
.net-spin { position: fixed; bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); right: 16px; z-index: 60; width: 40px; height: 40px;
  border-radius: 50%; background: var(--card); box-shadow: 0 2px 12px rgba(0,0,0,.18); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.net-spin i { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--green); border-right-color: transparent; animation: spin .7s linear infinite; }
.icon-btn.spinning svg { animation: spin .8s linear infinite; }
@media print { .net-spin { display: none !important; } }
.net-spin[hidden] { display: none; }

/* Шапка главного экрана: четыре кнопки (QR, поиск, обновить, колокольчик) влезают в 390 точек */
.head .head-btns { display: flex; gap: 6px; flex-shrink: 0; }
.head .head-btns .icon-btn { width: 42px; height: 42px; }
.head > div:first-child { min-width: 0; }

/* 04.10: фото не загрузилось — видно и можно повторить */
.ph.bad { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--bronze-d); border-color: var(--bronze); }
.ph.bad small { font-size: 11px; font-weight: 700; }
.ph-msg { color: #fff; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; font-size: 16px; max-width: 320px; }
.ph-msg .btn { background: #fff; color: var(--ink); }

/* Доработки за поставщиков (11.10): идущая — бронзовой карточкой. */
.rw-run { display: flex; flex-direction: column; gap: 8px; border-left: 4px solid var(--bronze, #AF7C58); }
.rw-run .rw-k { color: var(--bronze-d, #7a5236); text-transform: uppercase; letter-spacing: .04em; }
.rw-dur { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.rw-dur .field-in { width: 84px; }
.rwform .field-in { width: 100%; box-sizing: border-box; }
.rwform .rw-dur .field-in { width: 84px; }
.rw-row { color: inherit; font: inherit; cursor: pointer; }
