/* tm2027 · Телефон в руке. Экраны нарисованы теми же цветами, что `Ink`
   в приложениях; каждая секция борда меняет в них ровно одну вещь. */

:root {
  --canvas: #0b0f14;
  --panel: #10151c;
  --bar: #11161d;
  --glass: #080b10;
  --control: #1b2230;
  --control-hover: #252d3a;
  --selection: #1d365d;
  --selection-border: #5b7cfa;
  --border: #252d38;
  --border-strong: #303947;
  --ink: #f4f7fb;
  --body: #e8edf2;
  --muted: #9aa6b5;
  --live: #62d6a7;
  --amber: #d5a64a;
  --blocked: #f19aa7;
  --accent: #8fc7ff;
  --faint: #6b7686;
  --mono: "Cascadia Mono", "Hack", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--canvas); }

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--body);
  padding-bottom: 84px;
}

.mono { font-family: var(--mono); }

.masthead { border-bottom: 1px solid var(--border); background: var(--panel); }
.mast-inner { max-width: 1220px; margin: 0 auto; padding: 40px 24px 32px; }

.mast-brand {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: lowercase;
}

.mast-dot { color: var(--selection-border); }

h1 { font-size: 34px; font-weight: 650; color: var(--ink); letter-spacing: -.01em; margin: 10px 0 12px; }

.lede { max-width: 84ch; color: var(--body); margin-bottom: 22px; }
.lede em, .rule em, .axis-note em, .option em { color: var(--body); font-style: italic; }

.rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

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

.rule { background: var(--canvas); padding: 12px 14px; font-size: 12.5px; color: var(--muted); }
.rule-name { display: block; color: var(--body); font-weight: 600; }

code {
  font-family: var(--mono);
  font-size: .92em;
  color: var(--accent);
  background: #131a24;
  border-radius: 3px;
  padding: 0 3px;
}

main { max-width: 1220px; margin: 0 auto; padding: 12px 24px; }

.part-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 40px 0 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.part-head::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.axis-note { color: var(--muted); font-size: 13px; max-width: 84ch; margin-bottom: 16px; }

/* ---------------------------------------------------------- телефон */

.phone {
  --cell: 9px;
  width: 236px;
  border: 6px solid #1a2330;
  border-radius: 22px;
  background: var(--canvas);
  overflow: hidden;
  font-family: var(--mono);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  display: flex;
  flex-direction: column;
  flex: none;
}

.phone.wide { width: 300px; --cell: 10.5px; }

.phone-notch {
  height: 14px;
  background: #0d1219;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 7.5px;
  color: var(--faint);
  border-bottom: 1px solid var(--border);
}

.phone-notch .dot { width: 4px; height: 4px; border-radius: 50%; background: #1a2330; }

.screens { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }

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

.p-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  background: var(--bar);
  border-bottom: 1px solid var(--border);
  font-size: 9px;
}

.p-head .who { color: var(--accent); letter-spacing: .06em; }
.p-head .hair { flex: 1; height: 1px; background: var(--border); }
.p-head .chip {
  border: 1px solid #2c5347;
  border-radius: 3px;
  color: var(--live);
  padding: 0 4px;
  font-size: 8px;
  flex: none;
}

.p-head .picker {
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--control);
  color: var(--body);
  padding: 0 4px;
  font-size: 8.5px;
  flex: none;
}

/* --------------------------------------------------------- лента панов */

.ribbon {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  font-size: 9px;
  color: var(--body);
}

.ribbon .edge { color: var(--faint); flex: none; }
.ribbon .name { flex: 1; text-align: center; color: var(--ink); }
.ribbon .ghost { color: #3d4654; font-size: 8px; flex: none; max-width: 52px; overflow: hidden; white-space: nowrap; }

.chips {
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  background: #0d1219;
  overflow: hidden;
}

.chips .chip {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 5px;
  font-size: 8px;
  color: var(--muted);
  white-space: nowrap;
  flex: none;
}

.chips .chip.on { border-color: var(--selection-border); background: #12203a; color: var(--body); }
.chips .chip .st { color: var(--live); }
.chips .chip .st.wait { color: var(--amber); }

.dots {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.dots .d { width: 4px; height: 4px; border-radius: 50%; background: #2a3546; }
.dots .d.on { background: var(--accent); }

/* -------------------------------------------------------------- стекло */

.p-glass {
  position: relative;
  flex: 1;
  min-height: 168px;
  background: var(--glass);
  padding: 5px 6px;
  overflow: hidden;
  font-size: 8.5px;
  line-height: 1.35;
}

.p-glass .sline { white-space: pre; color: var(--body); }
.p-glass .dim { color: var(--faint); }
.p-glass .ok { color: var(--live); }
.p-glass .warn { color: var(--amber); }
.p-glass .acc { color: var(--accent); }
.p-glass .cur { background: var(--live); color: var(--glass); }

.sel { background: var(--selection); color: var(--ink); border-radius: 1px; }

.grip {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--selection-border);
  border: 2px solid var(--glass);
}

.grip.tail { transform: translate(-4px, -4px); }
.grip.head { transform: translate(-4px, -4px); }

.bubble {
  position: absolute;
  display: flex;
  gap: 6px;
  padding: 2px 6px;
  background: var(--control);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-size: 8px;
  color: var(--body);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .6);
  white-space: nowrap;
}

.bubble .verb { color: var(--accent); }
.bubble .verb.quiet { color: var(--muted); }

.press {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--selection-border);
  background: rgba(91, 124, 250, .3);
  box-shadow: 0 0 0 4px rgba(91, 124, 250, .14);
  z-index: 2;
}

.press.two::after,
.press.two::before {
  content: "";
  position: absolute;
  top: 4px;
  width: 12px;
  height: 14px;
  border-radius: 7px;
  background: rgba(143, 199, 255, .5);
}

.press.two::before { left: -8px; }
.press.two::after { right: -8px; }

.hint {
  position: absolute;
  left: 6px;
  bottom: 4px;
  font-size: 7.5px;
  color: var(--faint);
  background: rgba(8, 11, 16, .85);
  padding: 0 3px;
  border-radius: 2px;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 2px 8px;
  border: 1px solid #2c5347;
  border-radius: 10px;
  background: #0f1d18;
  color: var(--live);
  font-size: 8px;
  white-space: nowrap;
}

/* ------------------------------------------------------- панель клавиш */

.keybar {
  display: flex;
  gap: 3px;
  padding: 4px 5px;
  background: var(--bar);
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.keybar .k {
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--control);
  color: var(--muted);
  padding: 1px 5px;
  font-size: 8px;
  flex: none;
}

.keybar .k.on { color: var(--accent); border-color: #23405d; background: #12203a; }
.keybar .k.wide { letter-spacing: .06em; }

/* -------------------------------------------------------- список панов */

.p-list { flex: 1; min-height: 168px; background: var(--canvas); overflow: hidden; padding-bottom: 4px; }

.g-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 8px 3px;
  font-size: 8.5px;
  color: var(--muted);
}

.g-head .where { color: var(--faint); font-size: 8px; }
.g-head.ruled { border-bottom: 1px solid var(--border); padding-bottom: 4px; }

.g-card {
  margin: 6px 6px 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel);
  overflow: hidden;
}

.g-card .g-head { padding-top: 5px; }

.p-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 9px;
}

/* Своё имя, не `.rule`: та живёт в шапке борда и красит целую карточку. */
.p-row .mark { width: 2px; align-self: stretch; border-radius: 1px; background: #2a3546; flex: none; }
.p-row .mark.run { background: var(--live); }
.p-row .mark.wait { background: var(--amber); }
.p-row .mark.done { background: var(--accent); }
.p-row .nm { color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-row .tail { flex: 1; color: var(--faint); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-row .age { color: var(--faint); font-size: 8px; flex: none; }
.p-row.ruled { border-bottom: 1px solid #171d26; }
.p-row.on { background: var(--selection); }

/* --------------------------------------------------- список подключений */

.d-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 9px;
  border-bottom: 1px solid #171d26;
}

.d-row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.d-row .dot.live { background: var(--live); }
.d-row .nm { color: var(--body); }
.d-row .addr { flex: 1; color: var(--faint); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-row .verb { color: var(--blocked); font-size: 8px; flex: none; }
.d-row.on { background: var(--selection); }

.d-foot {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  background: var(--bar);
  font-size: 8.5px;
}

.d-foot .cap {
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--control);
  color: var(--muted);
  padding: 0 5px;
}

.p-note {
  padding: 6px 8px;
  color: var(--faint);
  font-size: 8px;
}

/* ------------------------------------------------------ карточки борда */

.options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 6px;
}

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

.option {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  padding: 16px 16px 14px;
  cursor: pointer;
  transition: border-color 90ms linear, background 90ms linear;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.option:hover { border-color: var(--border-strong); }
.option.picked { border-color: var(--selection-border); background: #101c31; }

.o-tag {
  position: absolute;
  top: -9px;
  left: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 6px;
}

.option.picked .o-tag { color: var(--ink); border-color: var(--selection-border); background: #101c31; }
.option h3 { font-size: 16px; font-weight: 620; color: var(--ink); margin-top: 2px; }
.option p { font-size: 12.8px; color: var(--muted); flex: 1; }

.cost {
  font-size: 11.5px;
  color: var(--faint);
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.cost b { color: var(--body); font-weight: 600; }
.stage { display: flex; justify-content: center; }

/* ------------------------------------------------------------- пульт */

.desk-note { padding-top: 18px; }

.desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px;
  align-items: start;
  padding: 8px 0 40px;
}

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

.desk-stage {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.desk-switches { display: flex; flex-direction: column; gap: 12px; }
.sgroup { border: 1px solid var(--border); border-radius: 5px; background: var(--panel); padding: 8px 10px 10px; }

.sgroup-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  padding-bottom: 6px;
}

.sgroup-head .sno { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.sgroup-row { display: flex; flex-direction: column; gap: 4px; }

.switch {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--canvas);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
}

.switch:hover { border-color: var(--border-strong); }
.switch.on { border-color: var(--selection-border); background: #12203a; color: var(--body); }
.switch .no { font-family: var(--mono); font-size: 10.5px; color: var(--faint); flex: none; }
.switch.on .no { color: var(--ink); }

.desk-notes { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; align-self: stretch; }
.desk-note-row { display: flex; gap: 8px; font-size: 12px; color: var(--muted); align-items: baseline; }
.desk-note-row.warn { color: var(--amber); }
.note-mark { flex: none; }
.note-mark.ok { color: var(--live); }

/* ---------------------------------------------------------- pickbar */

.pickbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bar);
  border-top: 1px solid var(--border-strong);
  z-index: 10;
}

.pick-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.pick-count { font-size: 12.5px; color: var(--muted); flex: none; }

.pick-codes {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  color: #83d9b2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#copy-btn {
  font-family: inherit;
  font-size: 12.5px;
  color: var(--body);
  background: var(--control);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
}

#copy-btn:hover { background: var(--control-hover); }
#copy-btn.done { color: #83d9b2; border-color: #2c5347; }
