/* «Подача» — приложение студии. Стекло в духе iOS 26, светлая и тёмная темы. */
:root {
  --bg: #EEF0F5; --glass: rgba(255, 255, 255, .64); --glass-2: rgba(255, 255, 255, .84); --stroke: rgba(255, 255, 255, .78);
  --line: rgba(16, 18, 30, .08); --fill: rgba(16, 18, 30, .045); --fill-2: rgba(16, 18, 30, .08);
  --ink: #0B0D14; --ink-2: #3B3F4C; --mute: #5F6473;
  --accent: #2D5BFF; --accent-2: #4E77FF; --on-accent: #fff; --lime: #C8FF2E; --violet: #8F7BFF; --orange: #FF4F1A; --coral: #E4572E; --green: #16A34A;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 22px 50px -28px rgba(14, 18, 40, .28), 0 0 0 .5px rgba(14, 18, 40, .04);
  --blur: blur(26px) saturate(185%);
  --r-xl: 30px; --r-l: 24px; --r-m: 18px; --r-s: 13px;
  --font: Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090A0F; --glass: rgba(30, 32, 44, .58); --glass-2: rgba(38, 41, 56, .86); --stroke: rgba(255, 255, 255, .08);
    --line: rgba(255, 255, 255, .08); --fill: rgba(255, 255, 255, .06); --fill-2: rgba(255, 255, 255, .1);
    --ink: #F3F4F8; --ink-2: #C9CCD6; --mute: #9DA1B0;
    --accent: #5B7FFF; --accent-2: #7C99FF;
    --shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 60px -30px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; font: 500 15px/1.45 var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 12% 8%, rgba(45, 91, 255, .22), transparent 70%),
    radial-gradient(35% 30% at 92% 18%, rgba(143, 123, 255, .18), transparent 70%),
    radial-gradient(45% 35% at 60% 102%, rgba(200, 255, 46, .2), transparent 70%);
  filter: blur(10px);
}
@media (prefers-color-scheme: dark) {
  body::before { background:
    radial-gradient(40% 35% at 12% 8%, rgba(45, 91, 255, .28), transparent 70%),
    radial-gradient(35% 30% at 92% 18%, rgba(143, 123, 255, .22), transparent 70%),
    radial-gradient(45% 35% at 60% 102%, rgba(200, 255, 46, .1), transparent 70%); }
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(45, 91, 255, .25); }
[hidden] { display: none !important; }

.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-mark { width: 56px; height: 56px; border-radius: 18px; background: url(/assets/favicon.svg) center/cover; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .7; } }

/* ── стекло ── */
.glass { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--stroke); box-shadow: var(--shadow); }
.card { composes: glass; background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--stroke); box-shadow: var(--shadow); border-radius: var(--r-l); padding: 18px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title { font-weight: 800; font-size: 17px; letter-spacing: -.02em; margin: 0; }
.card-sub { color: var(--mute); font-size: 13.5px; margin: -6px 0 12px; }
.label { font: 600 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--mute); }

/* ── каркас ── */
.shell { min-height: 100dvh; }
.side { display: none; }
.main { padding: max(18px, env(safe-area-inset-top)) 14px calc(118px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }
.page { animation: enter .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 4px 18px; }
.page-title { margin: 0; font-weight: 800; font-size: 34px; line-height: 1.02; letter-spacing: -.045em; }
.page-title small { display: block; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin-bottom: 8px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); text-decoration: none; font-weight: 700; margin: 0 4px 6px; }

/* нижнее меню-капсула (телефон) */
.tabbar {
  position: fixed; left: 12px; right: 84px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; height: 64px; border-radius: 999px;
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; background: var(--glass-2); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); box-shadow: var(--shadow), 0 18px 40px -18px rgba(14, 18, 40, .4);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 999px; text-decoration: none; color: var(--mute); font-size: 10.5px; font-weight: 700; transition: background .25s, color .25s; }
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--ink); background: var(--fill-2); }
.fab {
  position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 31; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--on-accent); text-decoration: none; border: 0; cursor: pointer;
  box-shadow: 0 16px 34px -12px rgba(45, 91, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .35); transition: transform .2s;
}
.fab:active { transform: scale(.93); }
.fab svg { width: 28px; height: 28px; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 264px 1fr; }
  .side {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 14px; height: calc(100dvh - 28px); margin: 14px 0 14px 14px; padding: 18px 12px;
    border-radius: var(--r-xl); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--stroke); box-shadow: var(--shadow);
  }
  .side .brand { margin: 2px 8px 18px; }
  .side a.nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; text-decoration: none; font-weight: 700; color: var(--ink-2); transition: background .2s, color .2s; }
  .side a.nav svg { width: 20px; height: 20px; color: var(--mute); }
  .side a.nav:hover { background: var(--fill); }
  .side a.nav.on { background: var(--fill-2); color: var(--ink); }
  .side a.nav.on svg { color: var(--accent); }
  .side .new { margin: 10px 4px 6px; }
  .side .who { margin-top: auto; padding: 12px; border-radius: 16px; background: var(--fill); font-size: 13px; }
  .side .who b { display: block; font-size: 14px; }
  .tabbar, .fab { display: none; }
  .main { padding: 28px 28px 48px; }
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: url(/assets/favicon.svg) center/cover; box-shadow: 0 6px 16px -6px rgba(45, 91, 255, .7); flex: none; }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -.04em; }

/* ── кнопки ── */
.btn {
  appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none;
  height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 15px; letter-spacing: -.01em;
  background: var(--fill-2); color: var(--ink); transition: transform .15s, background .2s, opacity .2s, box-shadow .2s;
}
.btn:hover { background: color-mix(in srgb, var(--fill-2) 100%, var(--ink) 4%); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .input:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 12px 26px -14px rgba(45, 91, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.primary:hover { background: var(--accent-2); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--fill); }
.btn.danger { color: #DC2626; }
.btn.sm { height: 36px; padding: 0 13px; font-size: 13.5px; }
.btn.icon { width: 44px; padding: 0; }
.btn.sm.icon { width: 36px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.lime { background: var(--lime); color: #0B0D14; }

/* ── поля ── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--mute); padding-left: 4px; }
.input {
  width: 100%; height: 46px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--glass-2); padding: 0 14px;
  font-weight: 600; font-size: 15.5px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; min-width: 0;
}
textarea.input { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%); background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.input::placeholder { color: color-mix(in srgb, var(--mute) 70%, transparent); font-weight: 500; }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .grid.two, .grid.three { grid-template-columns: 1fr; } .grid.keep { grid-template-columns: 1fr 1fr; } }
.hint { font-size: 13px; color: var(--mute); margin: 6px 4px 0; }
.hint code, .copy-line code { font: 500 12px var(--mono); }

/* сегменты как в iOS */
.seg { display: inline-flex; padding: 3px; border-radius: 13px; background: var(--fill-2); gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { appearance: none; border: 0; background: transparent; height: 34px; padding: 0 13px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s; }
.seg button.on { background: var(--glass-2); color: var(--ink); box-shadow: 0 3px 10px -4px rgba(14, 18, 40, .25); }

/* переключатель */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--fill-2); position: relative; cursor: pointer; transition: background .25s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(20px); }

/* ── статусы ── */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap; background: var(--fill-2); color: var(--ink-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.sent { background: rgba(45, 91, 255, .12); color: #2D5BFF; }
.pill.viewed { background: rgba(143, 123, 255, .16); color: #7A62FF; }
.pill.accepted { background: rgba(22, 163, 74, .14); color: #15803D; }
.pill.paid { background: var(--lime); color: #0B0D14; }
.pill.declined { background: rgba(228, 87, 46, .14); color: #C2410C; }
@media (prefers-color-scheme: dark) {
  .pill.sent { color: #8EA6FF; } .pill.viewed { color: #B3A6FF; } .pill.accepted { color: #4ADE80; } .pill.declined { color: #FB923C; }
}

/* ── списки ── */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-m);
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--stroke); box-shadow: var(--shadow);
  text-decoration: none; color: inherit; transition: transform .15s, background .2s; cursor: pointer;
}
.row:hover { background: var(--glass-2); }
.row:active { transform: scale(.99); }
.row-title { font-weight: 750; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-sub { color: var(--mute); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-num { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.empty { text-align: center; padding: 34px 18px; color: var(--mute); }
.empty b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; letter-spacing: -.02em; }
.more { appearance: none; border: 0; background: transparent; color: var(--accent); font-weight: 700; cursor: pointer; padding: 8px 4px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.toolbar .input { flex: 1 1 220px; height: 42px; }
.search { position: relative; flex: 1 1 220px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--mute); }
.search .input { padding-left: 40px; height: 42px; }

/* ── сводка ── */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { padding: 18px; border-radius: var(--r-l); min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; }
.stat .big { font-weight: 800; font-size: 30px; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .cap { color: var(--mute); font-size: 13px; font-weight: 600; }
.stat.hero { grid-column: span 2; background: #0B0D14; color: #F3F4F8; border-color: transparent; position: relative; overflow: hidden; }
.stat.hero::after { content: ""; position: absolute; width: 260px; height: 200px; right: -60px; top: -80px; border-radius: 50%; background: var(--lime); filter: blur(60px); opacity: .32; }
.stat.hero .big { color: var(--lime); font-size: 40px; position: relative; z-index: 1; }
.stat.hero .cap, .stat.hero .label { color: #9CA0AE; position: relative; z-index: 1; }
@media (max-width: 760px) { .bento { grid-template-columns: 1fr 1fr; } .stat.hero { grid-column: span 2; } .stat { min-height: 110px; } .stat .big { font-size: 26px; } }
.cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 960px) { .cols { grid-template-columns: 1fr; } }
.cols > .card + .card { margin-top: 0; }
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); text-decoration: none; }
.feed-item:last-child { border-bottom: 0; }
.feed-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--fill-2); font-size: 16px; }
.feed-time { color: var(--mute); font-size: 12.5px; white-space: nowrap; }
.steps { display: grid; gap: 8px; counter-reset: s; }
.step { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-m); background: var(--fill); text-decoration: none; }
.step i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; background: var(--glass-2); font-size: 13px; }
.step.done i { background: var(--green); color: #fff; }
.step.done { opacity: .7; }

/* ── редактор КП ── */
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.ed-side { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 1100px) { .ed { grid-template-columns: 1fr; } .ed-side { position: static; } }
.sec { padding: 14px; }
.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sec-dot { width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.sec-dot.opt { background: transparent !important; box-shadow: inset 0 0 0 2px var(--mute); }
.sec-title { flex: 1; height: 42px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; background: transparent; border-color: transparent; padding: 0 8px; }
.sec-title:hover { background: var(--fill); }
.sec-sum { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 4px; }
.sec-tag { font: 700 10.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--mute); padding: 4px 8px; border-radius: 8px; background: var(--fill); }
.lines { display: flex; flex-direction: column; gap: 6px; }
/* строка КП: название во всю ширину, под ним подписанные кол-во / ед. / цена / сумма */
.line { display: grid; grid-template-columns: 88px 84px 132px minmax(0, 1fr) 36px; grid-template-areas: "n n n n x" "q u p s s" "o o o o o"; gap: 6px 8px; align-items: end; padding: 8px; border-radius: 16px; background: var(--fill); }
.line .input { height: 40px; border-radius: 11px; font-size: 14.5px; padding: 0 10px; background: var(--glass-2); }
.line .l-name { grid-area: n; font-weight: 700; }
.line .x { grid-area: x; width: 36px; height: 36px; align-self: center; }
.l-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.l-f span, .l-sum span { font-size: 11.5px; font-weight: 600; color: var(--mute); padding-left: 4px; }
.line .l-qty { grid-area: q; } .line .l-unit { grid-area: u; } .line .l-price { grid-area: p; }
.line .l-sum { grid-area: s; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; padding-right: 4px; }
.line .l-sum b { height: 40px; display: flex; align-items: center; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line .l-note { grid-area: o; height: 34px; font-size: 13px; font-weight: 500; color: var(--ink-2); background: transparent; border-color: transparent; }
.line .l-note:focus { background: var(--glass-2); }
@media (max-width: 720px) {
  .line { grid-template-columns: 1fr 1fr 1.3fr 36px; grid-template-areas: "n n n x" "q u p p" "o o s s"; }
  .line .l-sum { align-self: center; } .line .l-sum span { display: none; }
}
.sec-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.add-sec { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }

.totals { padding: 18px 20px; border-radius: var(--r-l); background: #0B0D14; color: #F3F4F8; position: relative; overflow: hidden; border: 0; box-shadow: 0 24px 50px -24px rgba(11, 13, 20, .7); }
.totals::after { content: ""; position: absolute; width: 200px; height: 160px; right: -60px; top: -70px; border-radius: 50%; background: var(--lime); filter: blur(55px); opacity: .3; pointer-events: none; }
.t-row { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #23252F; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.t-row span:first-child { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: #9CA0AE; align-self: center; }
.t-row:last-child { border-bottom: 0; }
.t-big { position: relative; z-index: 1; padding: 12px 0 8px; }
.t-big b { display: block; font-weight: 800; font-size: 38px; letter-spacing: -.045em; line-height: 1.05; color: var(--lime); font-variant-numeric: tabular-nums; }
.t-big .label { color: #9CA0AE; }
.saved { font-size: 12.5px; color: var(--mute); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.saved.busy::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); animation: pulse 1s infinite; }
.saved.ok::before { content: "✓"; color: var(--green); font-weight: 900; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.tl i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; background: var(--fill-2); }
.tl.on i { background: var(--green); color: #fff; }
.tl time { color: var(--mute); font-size: 12.5px; }
.link-box { display: flex; gap: 6px; align-items: center; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--fill); }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 12.5px var(--mono); }
.share { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.docs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.docs .btn { justify-content: flex-start; height: 44px; border-radius: 14px; }
.client-pick { display: flex; flex-direction: column; gap: 10px; }
.client-pick .search { flex: none; }
.dropdown:empty { display: none; }
.chosen-client { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-m); background: var(--fill); }
.chosen-client b { display: block; }
.dropdown { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.dropdown button { text-align: left; appearance: none; border: 0; background: var(--fill); padding: 10px 12px; border-radius: 12px; cursor: pointer; font-weight: 700; }
.dropdown button small { display: block; font-weight: 500; color: var(--mute); }
.dropdown button:hover { background: var(--fill-2); }

/* мобильная панель итога в редакторе */
.ed-bar { display: none; }
@media (max-width: 1100px) {
  .ed-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; position: fixed; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 29;
    padding: 8px 8px 8px 18px; border-radius: 999px; background: #0B0D14; color: #F3F4F8; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
  }
  .ed-bar b { font-size: 19px; letter-spacing: -.03em; color: var(--lime); font-variant-numeric: tabular-nums; }
  .ed-bar .label { color: #9CA0AE; display: block; }
}
@media (min-width: 960px) and (max-width: 1100px) { .ed-bar { bottom: 16px; left: 290px; } }

/* ── листы (окна) ── */
.sheet { border: 0; padding: 0; margin: auto; width: min(560px, calc(100vw - 20px)); max-height: min(86dvh, 820px); border-radius: var(--r-xl); background: var(--glass-2); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); color: var(--ink); box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .6); overflow: hidden; }
.sheet::backdrop { background: rgba(10, 12, 20, .32); backdrop-filter: blur(3px); }
.sheet[open] { display: flex; flex-direction: column; animation: sheet .34s cubic-bezier(.2, .9, .25, 1.1); }
@keyframes sheet { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 18px 8px 22px; }
.sheet-head h3 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.sheet-body { padding: 8px 22px 22px; overflow: auto; }
.sheet-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 18px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 30px 30px 0 0; max-height: 92dvh; }
  .sheet[open] { animation: up .36s cubic-bezier(.2, .9, .25, 1); }
  .sheet-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@keyframes up { from { transform: translateY(100%); } }
.sheet.wide { width: min(980px, calc(100vw - 20px)); }
.preview { background: transparent; padding: 0 12px 20px; }
.preview .kp { box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .5); }

.cat-group { margin-bottom: 14px; }
.cat-group h4 { margin: 0 0 8px 4px; font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--mute); }
.cat-item { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 14px; background: var(--fill); margin-bottom: 6px; cursor: pointer; border: 0; width: 100%; text-align: left; transition: background .2s, transform .15s; }
.cat-item:hover { background: var(--fill-2); }
.cat-item:active { transform: scale(.99); }
.cat-item b { font-weight: 700; }
.cat-item small { display: block; color: var(--mute); font-weight: 500; }
.cat-item .price { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-item .plus { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 900; font-size: 18px; line-height: 1; }
.cat-item.added .plus { background: var(--green); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); transition: transform .15s; }
.swatch.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.swatch:active { transform: scale(.9); }
.logo-box { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.logo-prev { height: 56px; min-width: 120px; padding: 8px 14px; border-radius: 14px; background: #08070C; display: grid; place-items: center; }
.logo-prev img { max-height: 40px; max-width: 200px; display: block; }
.logo-prev span { color: #F4F1EA; font-weight: 800; letter-spacing: -.03em; }
.copy-line { display: flex; gap: 6px; align-items: center; padding: 6px 6px 6px 12px; border-radius: 14px; background: var(--fill); margin-top: 6px; }
.copy-line code { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.badge-on { color: var(--green); font-weight: 800; }

/* ── вход ── */
.land { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 440px); column-gap: 48px; row-gap: 26px; align-items: start; max-width: 1180px; margin: 0 auto; padding: 22px 24px 48px; }
.land-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.land-hero { padding-top: 18px; }
.land-hero h1 { font-size: clamp(40px, 5vw, 70px); line-height: .98; letter-spacing: -.05em; margin: 0 0 18px; font-weight: 800; text-wrap: balance; }
.land-hero h1 em { font: italic 500 1.04em "Cormorant Garamond", Georgia, serif; letter-spacing: -.02em; color: var(--accent); }
.land-hero p.lead { font-size: 18px; color: var(--ink-2); max-width: 560px; margin: 0 0 24px; text-wrap: pretty; }
.land-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.land-feats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.feat { padding: 16px 18px; border-radius: var(--r-l); }
.feat b { display: block; font-size: 15.5px; letter-spacing: -.01em; margin-bottom: 4px; }
.feat span { color: var(--mute); font-size: 13.5px; }
.feat .n { font: 600 11px var(--mono); color: var(--accent); margin-bottom: 10px; display: block; }
.auth { padding: 24px; border-radius: var(--r-xl); }
.auth h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.04em; }
.auth form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.auth .err { color: #DC2626; font-weight: 700; font-size: 14px; margin: 0; }
@media (max-width: 980px) { .land-feats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .land { grid-template-columns: 1fr; padding: 16px 14px 40px; row-gap: 18px; }
  .land-hero { padding-top: 6px; }
  .land-top .btn { display: none; }
}

.toast { position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 100; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 14px; box-shadow: 0 20px 44px -18px rgba(0, 0, 0, .55); max-width: calc(100vw - 24px); text-align: center; animation: enter .25s; }
.toast.err { background: #DC2626; color: #fff; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── поправки по скриншотам ── */
.back { white-space: nowrap; }
.ed > *, .ed-main > *, .line > *, .grid > *, .cols > * { min-width: 0; }
.docs .btn { white-space: normal; text-align: left; height: auto; min-height: 44px; padding: 8px 12px; line-height: 1.2; }
@media (max-width: 720px) {
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-title { font-size: 28px; }
  .page-actions { justify-content: flex-start; }
  .page-actions .btn span { display: inline; }
  .chosen-client { flex-wrap: wrap; }
  .main { padding-left: 12px; padding-right: 12px; }
  .card { padding: 16px 14px; }
}

/* ── UX этап 1 (17.10) ── */
.shell.no-fab .tabbar { right: 12px; }
.pill.prepaid { background: rgba(200, 255, 46, .35); color: #3F6212; }
.pill.expired { background: var(--fill-2); color: #9A3412; }
.feed-ico svg { width: 18px; height: 18px; }
.feed-item.viewed .feed-ico { color: #7A62FF; } .feed-item.accepted .feed-ico { color: #15803D; } .feed-item.paid .feed-ico { background: var(--lime); color: #0B0D14; } .feed-item.declined .feed-ico { color: #C2410C; }
.feed-txt { min-width: 0; }
.tl i svg { width: 14px; height: 14px; }
.first-kp { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; background: linear-gradient(120deg, rgba(45, 91, 255, .12), rgba(200, 255, 46, .14)); }
.first-kp h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.03em; }
.first-kp p { margin: 0; max-width: 560px; color: var(--ink-2); }
.first-kp-act { display: flex; gap: 8px; flex-wrap: wrap; }
.setup { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 14px; }
.setup .label { margin-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 6px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--stroke); color: var(--ink-2); text-decoration: none; font-size: 13.5px; }
.chip b { color: var(--ink); }
.chip:hover { background: var(--fill-2); }
.docs.docs-now .btn { font-weight: 700; }
.docs-rest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.t-row.paid span:last-child { color: var(--lime); font-weight: 800; }
@media (max-width: 720px) {
  .feed-item { grid-template-columns: 34px minmax(0, 1fr); }
  .feed-time { grid-column: 2; margin-top: -6px; }
  .first-kp-act { width: 100%; } .first-kp-act .btn { flex: 1; justify-content: center; }
}
.docs.docs-now { display: flex; flex-direction: column; gap: 8px; }
.docs.docs-now .btn { width: 100%; min-height: 46px; height: auto; justify-content: flex-start; white-space: normal; text-align: left; }
.docs-rest .btn { min-height: 36px; height: auto; }
.line textarea.l-name { height: auto; min-height: 40px; padding: 9px 10px; line-height: 1.35; resize: none; overflow: hidden; display: block; }
/* версии: согласованное — только чтение */
.note-card { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-bottom: 14px; border: 1px solid rgba(45, 91, 255, .25); }
.note-card.ok { border-color: rgba(22, 163, 74, .35); }
.note-card span { flex: 1 1 320px; color: var(--ink-2); font-size: 14px; }
.ed.locked .ed-main :is([data-a="add-line"], [data-a="del-line"], [data-a="add-sec"], [data-a="add-opt"], [data-a="pick"], [data-a="sec-menu"], [data-a="client-change"], [data-a="client-new"]) { display: none; }
.ed.locked .ed-main .sec-dot { pointer-events: none; }
.ed.locked .ed-main :is(input, textarea, select):disabled { opacity: 1; color: var(--ink); -webkit-text-fill-color: var(--ink); cursor: default; }
/* настройки разделами */
.tabs-set { margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs-set::-webkit-scrollbar { display: none; }
.tabs-set button { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.tab-dot.ok { background: var(--green); } .tab-dot.todo { background: var(--orange); }
.set-pane { max-width: 860px; }
.tg-state { font-size: 12.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.tg-state.on { background: rgba(22, 163, 74, .14); color: #15803D; } .tg-state.off { background: var(--fill-2); color: var(--ink-2); } .tg-state.warn { background: rgba(255, 79, 26, .14); color: #C2410C; }
.switches.off .switch { opacity: .5; }
.pay-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.pay-opt { appearance: none; text-align: left; border: 1px solid var(--stroke); background: var(--fill); border-radius: 16px; padding: 14px 16px; cursor: pointer; color: var(--ink); font: inherit; display: flex; flex-direction: column; gap: 3px; }
.pay-opt span { color: var(--mute); font-size: 13px; }
.pay-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 91, 255, .15); background: var(--glass-2); }
.steps-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.steps-list li { padding-left: 4px; line-height: 1.45; }
.steps-list .copy-line { margin-top: 8px; }
.pay-res { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-left: 6px; }
.pay-res.ok { color: #15803D; } .pay-res.bad { color: #C2410C; }
@media (max-width: 640px) { .pay-pick { grid-template-columns: 1fr; } }
.switches.off .switch input { filter: grayscale(1); }
/* сворачивание в редакторе */
.fold-btn svg { width: 18px; height: 18px; transition: transform .2s; }
.sec.folded .fold-btn svg, .card.folded > .fold-head .fold-btn svg { transform: rotate(-90deg); }
.sec.folded .lines, .sec.folded .sec-foot { display: none; }
.sec-count { display: none; color: var(--mute); font-size: 13px; font-weight: 600; white-space: nowrap; }
.sec.folded .sec-count { display: inline; }
.fold-head { cursor: pointer; user-select: none; }
.fold-head .fold-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--mute); }
.fold-sum { display: none; margin: -4px 0 0; color: var(--ink-2); font-size: 14px; }
.card.folded > .fold-sum { display: block; }
.card.folded > .fold-body { display: none; }
.sec.folded .sec-head { margin-bottom: 0; }
@media (max-width: 720px) {
  /* название раздела — целиком в первой строке, сумма и пометки — во второй */
  .sec-head { flex-wrap: wrap; row-gap: 2px; }
  .sec-head .sec-title { flex: 1 1 50%; min-width: 0; }
  .sec-head .sec-dot { order: 1; } .sec-head .sec-title { order: 2; } .sec-head .fold-btn { order: 3; } .sec-head [data-a="sec-menu"] { order: 4; }
  .sec-head .sec-tag { order: 5; margin-left: 34px; } .sec-head .sec-count { order: 6; margin-left: 34px; } .sec-head .sec-tag + .sec-count { margin-left: 0; }
  .sec-head .sec-sum { order: 7; margin-left: auto; padding-right: 8px; }
}
.start-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 14px; align-items: start; }
.start-grid > .card + .card { margin-top: 0; }
.start-opt { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); border: 1px solid var(--stroke); transition: transform .15s, box-shadow .15s; }
.start-opt:hover { transform: translateY(-2px); }
.start-opt b { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.start-opt b svg { width: 22px; height: 22px; color: var(--accent); }
.start-opt span { color: var(--mute); }
@media (max-width: 760px) { .start-grid { grid-template-columns: 1fr; } }
.ed.locked .ed-main :is(input, textarea)::placeholder { color: transparent; }
.ed.locked .client-pick .search, .ed.locked .client-pick .dropdown { display: none; }
/* тариф */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 10px; }
.plan-card { border: 1px solid var(--stroke); border-radius: 18px; padding: 16px; background: var(--fill); display: flex; flex-direction: column; gap: 4px; }
.plan-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 91, 255, .14); background: var(--glass-2); }
.plan-price { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.plan-price small { font-size: 14px; font-weight: 600; color: var(--mute); }
.plan-year { font-size: 12.5px; color: var(--mute); }
.plan-card p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; flex: 1; }
.plan-act { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
/* кабинет владельца сервиса */
.own-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.own-studio { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--fill); }
.own-studio + .own-studio { margin-top: 6px; }
.own-studio .k { font-size: 11px; color: var(--mute); font-weight: 600; display: block; }
.own-flags { display: flex; gap: 4px; flex-wrap: wrap; }
.own-flags span { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--fill-2); color: var(--ink-2); }
.own-flags span.ok { background: rgba(22, 163, 74, .14); color: #15803D; }
@media (max-width: 860px) { .own-totals { grid-template-columns: 1fr 1fr; } .own-studio { grid-template-columns: 1fr 1fr; } .own-studio > :first-child { grid-column: 1 / -1; } }
/* ── календарь ── */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cal-wrap > .card + .card { margin-top: 0; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head b { flex: 1; text-align: center; font-size: 18px; letter-spacing: -.02em; }
.cal-next svg { transform: rotate(180deg); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font: 600 11px var(--mono); text-transform: uppercase; color: var(--mute); padding: 4px 0; }
.cal-wd.we { color: #C2410C; }
.cal-day { appearance: none; border: 0; background: var(--fill); border-radius: 12px; min-height: 86px; padding: 6px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; color: var(--ink); font: inherit; min-width: 0; transition: background .15s; }
.cal-day:hover { background: var(--fill-2); }
.cal-day .n { font-weight: 800; font-size: 13px; }
.cal-day.we .n { color: #C2410C; }
.cal-day.out { opacity: .45; }
.cal-day.today .n { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; align-self: flex-start; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--accent); background: var(--glass-2); }
.cal-day .pills { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pill-ev { font-style: normal; font-size: 11px; font-weight: 700; line-height: 1.25; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-ev.work { background: rgba(45, 91, 255, .14); color: #2D5BFF; } .pill-ev.remind { background: rgba(255, 79, 26, .14); color: #C2410C; }
.pill-ev.expires { background: var(--fill-2); color: var(--ink-2); } .pill-ev.paid { background: rgba(200, 255, 46, .4); color: #3F6212; }
.more-ev { font-style: normal; font-size: 11px; color: var(--mute); font-weight: 700; padding-left: 4px; }
.cal-day .dots { display: none; gap: 3px; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot.work { background: #2D5BFF; } .dot.remind { background: #FF4F1A; } .dot.expires { background: var(--mute); } .dot.paid { background: #84CC16; }
.cal-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.ev-chip { cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; opacity: .5; }
.ev-chip.on { opacity: 1; }
.ev-chip svg, .chip svg { width: 15px; height: 15px; }
.ev-list { display: flex; flex-direction: column; gap: 6px; }
.ev { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--fill); text-decoration: none; color: var(--ink); }
.ev:hover { background: var(--fill-2); }
.ev.done { opacity: .6; }
.ev-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--glass-2); }
.ev-ico svg { width: 18px; height: 18px; }
.ev.work .ev-ico { color: #2D5BFF; } .ev.remind .ev-ico { color: #C2410C; } .ev.paid .ev-ico { background: var(--lime); color: #0B0D14; }
.ev-txt { min-width: 0; font-size: 14.5px; } .ev-txt b { font-weight: 800; }
.ev-when { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--mute); margin: 6px 2px 0; }
.soon { margin-bottom: 14px; }
.date-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
.date-row .dash { color: var(--mute); }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.sm { min-height: 30px; padding: 4px 11px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }
.chip.on { background: var(--accent); color: #fff; border-color: transparent; }
.more-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.more-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--fill-2); color: var(--accent); }
.more-ico svg { width: 20px; height: 20px; }
@media (max-width: 960px) { .cal-wrap { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .cal-day { min-height: 52px; align-items: center; padding: 6px 2px; }
  .cal-day .pills { display: none; } .cal-day .dots { display: flex; }
  .cal-day.today .n { align-self: center; }
}
.ev-chip.on { background: var(--glass-2); color: var(--ink); border-color: var(--stroke); }
.ev-chip:not(.on) { background: transparent; text-decoration: line-through; }
.ev-chip.work svg { color: #2D5BFF; } .ev-chip.remind svg { color: #C2410C; } .ev-chip.expires svg { color: var(--mute); } .ev-chip.paid svg { color: #65A30D; }
