/* Rayline operator console: the app's own look — cream ground, Nunito headlines, mint Ray, orange CTA. */
:root {
  --bg: #fff6e9;
  --sheet: #ffffff;
  --side: #fffaf2;
  --fg: #2b2a4a;
  --muted: #5a5878;
  --faint: #a19fbb;
  --line: #f1e6d6;
  --line-2: #e8d9c4;
  --field: #fffdf9;
  --good: #2e9e78;
  --good-bg: #e8f7f0;
  --warn: #c77418;
  --warn-bg: #fff1dc;
  --bad: #e5484d;
  --bad-bg: #ffe9e9;
  --cta: #ff5a1f;
  --cta-fg: #ffffff;
  --cta-soft: #ffe3d6;
  --orb1: #5fbf9c;
  --orb2: #9be3c7;
  --orb3: #ffb89a;
  --code-bg: #2b2a4a;
  --code-fg: #fff6e9;
  --shadow: 0 10px 30px rgba(43, 42, 74, .08);
  --radius: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1e1d33; --sheet: #29283f; --side: #232238; --fg: #fff6e9; --muted: #b9b6d3; --faint: #7c79a0;
    --line: #37355a; --line-2: #45426b; --field: #232238; --good: #7fe0b9; --good-bg: rgba(127, 224, 185, .12);
    --warn: #ffc46b; --warn-bg: rgba(255, 196, 107, .12); --bad: #ff8f8f; --bad-bg: rgba(255, 143, 143, .12);
    --cta: #ff6a2b; --cta-soft: rgba(255, 106, 43, .18); --code-bg: #15142a; --code-fg: #fff6e9;
    --shadow: 0 10px 30px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1e1d33; --sheet: #29283f; --side: #232238; --fg: #fff6e9; --muted: #b9b6d3; --faint: #7c79a0;
  --line: #37355a; --line-2: #45426b; --field: #232238; --good: #7fe0b9; --good-bg: rgba(127, 224, 185, .12);
  --warn: #ffc46b; --warn-bg: rgba(255, 196, 107, .12); --bad: #ff8f8f; --bad-bg: rgba(255, 143, 143, .12);
  --cta: #ff6a2b; --cta-soft: rgba(255, 106, 43, .18); --code-bg: #15142a; --code-fg: #fff6e9;
  --shadow: 0 10px 30px rgba(0, 0, 0, .25); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.5 Rubik, system-ui, sans-serif; font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, .logo b { font-family: Nunito, system-ui, sans-serif; font-weight: 900; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.15; }
h2 { font-size: 20px; }
h3 { font-size: 16px; font-weight: 800; }
p { margin: 0; }
a { color: var(--cta); }
small, .muted { color: var(--muted); font-size: 13px; }
code, .mono { font: 12.5px/1.5 ui-monospace, Consolas, monospace; }
code { background: var(--line); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
pre { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--code-bg); color: var(--code-fg); font: 12.5px/1.6 ui-monospace, Consolas, monospace; overflow-x: auto; white-space: pre; }

/* ── controls ── */
label { display: grid; gap: 6px; font-weight: 500; font-size: 14px; min-width: 0; }
label > small { font-weight: 400; }
input, textarea, select {
  width: 100%; min-width: 0; border: 1.5px solid var(--line-2); border-radius: 14px; padding: 10px 12px;
  font: 400 14.5px Rubik, system-ui, sans-serif; background: var(--field); color: var(--fg);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
textarea.mono { font: 13px/1.5 ui-monospace, Consolas, monospace; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--cta); border-color: transparent; }
input[type="color"] { padding: 3px; height: 42px; width: 56px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--cta); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  padding: 10px 18px; font: 600 14px Rubik, sans-serif; background: var(--cta); color: var(--cta-fg); cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: transform .15s, filter .15s;
}
button:hover, .btn:hover { filter: brightness(1.05); }
button:active, .btn:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: default; }
button.ghost, .btn.ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--line-2); }
button.soft { background: var(--cta-soft); color: var(--cta); }
button.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1.5px currentColor; }
button.small { padding: 6px 12px; font-size: 13px; }
button.link { background: none; color: var(--cta); padding: 0; font-weight: 500; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.stack { display: grid; gap: 14px; min-width: 0; }

/* ── layout ── */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--side); border-right: 1.5px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.logo b { font-size: 21px; }
.logo span { font-size: 12px; color: var(--muted); display: block; line-height: 1.1; }
.ray { width: 34px; height: 34px; flex: none; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; color: var(--fg); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--line); }
.nav a.on { background: var(--sheet); box-shadow: var(--shadow); }
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav a.on svg { color: var(--cta); }
.nav .sep { height: 1px; background: var(--line); margin: 8px 6px; }
.pid { margin-top: auto; background: var(--sheet); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); display: grid; gap: 4px; }
.pid b { font: 600 17px ui-monospace, Consolas, monospace; letter-spacing: .04em; }
main { padding: 28px clamp(16px, 3.4vw, 44px) 60px; display: grid; gap: 22px; align-content: start; min-width: 0; max-width: 1180px; }
.head { display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.head p { color: var(--muted); max-width: 62ch; margin-top: 6px; }
.topbar { display: none; }

.panel { background: var(--sheet); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 14px; min-width: 0; }
.panel > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { background: var(--sheet); border-radius: 20px; box-shadow: var(--shadow); padding: 16px 18px; display: grid; gap: 2px; }
.tile b { font: 900 30px Nunito, sans-serif; line-height: 1.1; }
.tile small { font-size: 13px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* bars */
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 92px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 14px; }
.bar i { display: block; height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar i > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--orb1), var(--orb2)); }
.bar em { font-style: normal; text-align: right; color: var(--muted); }
.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; }
.months div { display: grid; gap: 4px; align-items: end; height: 100%; grid-template-rows: 1fr auto; }
.months i { display: block; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--orb2), var(--orb1)); min-height: 3px; align-self: end; }
.months span { font-size: 11px; color: var(--muted); text-align: center; }

/* tables */
.table { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1.5px solid var(--line-2); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--line); color: var(--muted); white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.cta { background: var(--cta-soft); color: var(--cta); }

.copy { display: flex; gap: 8px; align-items: center; background: var(--field); border: 1.5px solid var(--line-2); border-radius: 14px; padding: 6px 6px 6px 12px; min-width: 0; }
.copy code { background: none; padding: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.callout { border-radius: 16px; padding: 12px 14px; background: var(--cta-soft); font-size: 14px; display: grid; gap: 4px; }
.callout.good { background: var(--good-bg); }
.callout.warn { background: var(--warn-bg); }
.steps { counter-reset: s; display: grid; gap: 16px; }
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
.step::before { counter-increment: s; content: counter(s); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--cta-soft); color: var(--cta); font: 900 16px Nunito, sans-serif; }
.step.done::before { content: '✓'; background: var(--good-bg); color: var(--good); }
.step > div { display: grid; gap: 8px; min-width: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line-2); font-weight: 400; cursor: pointer; }
.chips label:has(input:checked) { background: var(--cta-soft); box-shadow: inset 0 0 0 1.5px var(--cta); color: var(--cta); }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.seg { display: inline-flex; background: var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: transparent; color: var(--muted); padding: 7px 14px; font-weight: 500; }
.seg button.on { background: var(--sheet); color: var(--fg); box-shadow: var(--shadow); }

/* phone preview for messages and branding */
.phone { width: 280px; max-width: 100%; aspect-ratio: 9 / 18.5; border-radius: 38px; padding: 10px; background: #15142a; box-shadow: var(--shadow); justify-self: center; position: sticky; top: 20px; }
.screen { height: 100%; border-radius: 30px; overflow: hidden; position: relative; background: #1e1d33 center / cover no-repeat; color: #fff6e9; display: grid; }
.story { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 16px 18px 20px; gap: 10px; background: linear-gradient(180deg, rgba(20, 19, 40, .55), rgba(20, 19, 40, .82)); }
.story .bars-top { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.story .bars-top i { display: block; height: 100%; width: 35%; background: #fff; }
.story .body { align-self: center; display: grid; gap: 8px; text-align: center; overflow-wrap: anywhere; }
.story .body b { font: 900 21px Nunito, sans-serif; }
.story .body p { font-size: 14.5px; white-space: pre-wrap; }
.story .act { display: grid; gap: 8px; }
.story .act span { text-align: center; border-radius: 999px; padding: 10px; font-weight: 600; font-size: 14px; background: var(--cta); color: #fff; }
.story .act em { font-style: normal; text-align: center; font-size: 12px; opacity: .75; }
.story .x { position: absolute; top: 22px; right: 16px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); font-size: 13px; }

.app-prev { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 18px 14px; gap: 10px; color: var(--p-fg); background: var(--p-bg) center / cover no-repeat; }
.app-prev .veil { position: absolute; inset: 0; background: var(--p-bg); opacity: .55; pointer-events: none; }
.app-prev > * { position: relative; }
.app-prev .top { display: flex; align-items: center; gap: 8px; font: 900 16px Nunito, sans-serif; }
.app-prev .top img, .app-prev .top .lt { width: 26px; height: 26px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: linear-gradient(135deg, var(--p-o2), var(--p-o1)); color: #2b2a4a; font-size: 13px; }
.app-prev .mid { display: grid; place-items: center; align-content: center; gap: 12px; text-align: center; }
.app-prev .ball { width: 118px; height: 118px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, var(--p-o2), var(--p-o1) 70%); position: relative; box-shadow: 0 16px 30px rgba(0, 0, 0, .18); }
.app-prev .ball::before, .app-prev .ball::after { content: ''; position: absolute; top: 46%; width: 11px; height: 14px; border-radius: 50%; background: #2b2a4a; }
.app-prev .ball::before { left: 31%; }
.app-prev .ball::after { right: 31%; }
.app-prev .mid b { font: 900 22px Nunito, sans-serif; }
.app-prev .card { background: var(--p-card); border-radius: 18px; padding: 12px; display: grid; gap: 8px; font-size: 12.5px; }
.app-prev .card span { display: block; text-align: center; border-radius: 999px; padding: 8px; font-weight: 600; background: var(--p-cta); color: #fff; }

/* login */
.auth { min-height: 100%; display: grid; place-items: center; padding: 30px 16px; }
.auth .panel { width: min(440px, 100%); padding: 28px; gap: 16px; }
.auth .hello { display: grid; justify-items: center; gap: 10px; text-align: center; }
.auth .ray { width: 76px; height: 76px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 13px; }
.or::before, .or::after { content: ''; height: 1px; background: var(--line-2); flex: 1; }
.tg-box { display: grid; place-items: center; min-height: 40px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 500; box-shadow: var(--shadow); z-index: 50; max-width: calc(100% - 32px); }
dialog { border: 0; border-radius: var(--radius); padding: 22px; background: var(--sheet); color: var(--fg); box-shadow: var(--shadow); width: min(560px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(20, 19, 40, .45); }
dialog .stack { gap: 12px; }

@media (max-width: 920px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .tiles, .tiles.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phone { position: static; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 40; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .shell.menu .side { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1.5px solid var(--line); }
  .topbar b { font: 900 18px Nunito, sans-serif; }
  .topbar button { padding: 8px 12px; }
  main { padding-top: 18px; }
  .bar { grid-template-columns: 74px minmax(0, 1fr) 36px; }
}

/* «Настройки приложения» */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.set-row:last-of-type { border-bottom: 0; }
.set-row > div:first-child { display: grid; gap: 2px; min-width: 0; flex: 1 1 260px; }
.set-row small { color: var(--muted); font-size: 13px; }
.srv-table td { padding: 6px 8px; }
.srv-table input:not([type]) , .srv-table select { padding: 6px 10px; font-size: 13.5px; min-width: 110px; }
.srv-table input[type="checkbox"] { width: 18px; height: 18px; }
.savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--sheet); border-radius: 22px; padding: 8px 10px; box-shadow: var(--shadow); justify-self: start; max-width: 100%; }
.savebar small { color: var(--warn); padding-right: 8px; }
