/* A-Players · Второй мозг. Дизайн-система по a-players.ru: кремовая бумага, изумруд, золото, засечки Roboto Slab */
:root {
  --bg: #F4F1EA; --bg2: #EFE9D9; --bg-alt: #EBE5D7; --card: #FCFAF4;
  --ink: #16201B; --muted: #5A6056; --line: #DCD4C2; --line-soft: #E6DECE;
  --emerald: #143A2D; --emerald2: #1C4C3B; --dark-ink: #EFE9DA;
  --gold: #B0822E; --gold2: #C79A45; --gold-hover: #977019; --btn-ink: #19120A;
  --green: #3E8E5E; --amber: #C9952B; --terra: #A75A45; --violet: #6B4C8A;
  --f-display: "Roboto Slab", Georgia, serif;
  --f-text: "Manrope", -apple-system, "Segoe UI", sans-serif;
  --f-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --shadow-md: 0 26px 64px -26px rgba(20,58,45,.30);
  --shadow-sm: 0 10px 28px -16px rgba(20,58,45,.35);
  --ease: cubic-bezier(.16,1,.3,1);
  --tab-h: 68px; --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-text); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body { min-height: 100vh; }
#app { max-width: var(--app-w, 560px); margin: 0 auto; min-height: 100vh; position: relative; background: var(--bg); }
@media (min-width: 900px) { :root[data-wide] { --app-w: 1240px; } }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.12; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
.hide { display: none !important; }

/* каркас экранов */
.screen { padding: calc(14px + var(--safe-t)) 16px calc(var(--tab-h) + 28px + var(--safe-b)); animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.logo { display: inline-flex; align-items: center; font-family: var(--f-display); font-weight: 800; font-size: 14px; letter-spacing: .04em; color: var(--gold2); background: var(--emerald); padding: 6px 11px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--gold), inset 0 0 0 3.5px var(--emerald), inset 0 0 0 4.5px rgba(199,154,69,.55); text-transform: uppercase; }
.page-title { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 16px; }
.page-title p { margin: 0; color: var(--muted); }
.section { margin: 22px 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.section-head h2 { font-size: 18px; }
.link { color: var(--gold); font-weight: 700; font-size: 13px; }

/* метки и пилюли как на сайте */
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: var(--dark-ink); font-family: var(--f-mono); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; padding: 8px 14px; border-radius: 100px; }
.pill::before, .glabel::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold2); box-shadow: 0 0 0 3px rgba(199,154,69,.25); }
.glabel { display: inline-flex; align-items: center; gap: 7px; background: rgba(249,246,239,.92); border: 1px solid var(--line); color: var(--gold); font-family: var(--f-mono); font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 100px; box-shadow: 0 2px 10px -4px rgba(20,58,45,.25); }
.glabel::before { width: 6px; height: 6px; box-shadow: none; background: var(--gold); }
.tag { font-family: var(--f-mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }

/* герой */
.hero { position: relative; overflow: hidden; background: var(--emerald); color: var(--dark-ink); border-radius: 22px; padding: 20px 18px 18px; box-shadow: var(--shadow-md); }
.hero::before { content: "A A A A\A A A A A\A A A A"; white-space: pre; position: absolute; inset: -10px -10px auto auto; width: 70%; text-align: right; font-family: var(--f-display); font-weight: 800; font-size: 54px; line-height: 1.1; letter-spacing: .5em; color: rgba(199,154,69,.07); pointer-events: none; transform: rotate(-8deg); }
.hero > * { position: relative; }
.hero h1 { color: #fff; margin: 14px 0 4px; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, rgba(199,154,69,.45) 62%); }
.hero p { margin: 0; color: rgba(239,233,218,.78); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.stat { background: rgba(255,255,255,.07); border: 1px solid rgba(239,233,218,.14); border-radius: 12px; padding: 10px 4px; text-align: center; min-width: 0; min-height: 64px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.stat b { display: block; font-family: var(--f-display); font-size: 22px; color: #fff; line-height: 1; white-space: nowrap; }
.stat span { display: block; margin-top: 5px; font-family: var(--f-mono); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; color: rgba(239,233,218,.65); white-space: nowrap; }
.stat.warn b { color: #F0B49F; }
.nextup { margin-top: 14px; display: flex; align-items: center; gap: 12px; background: var(--card); color: var(--ink); border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line); text-align: left; width: 100%; }
.nextup .when { font-family: var(--f-mono); font-size: 12px; font-weight: 700; color: var(--emerald); background: var(--bg2); padding: 6px 9px; border-radius: 8px; white-space: nowrap; }
.nextup .t { font-weight: 700; line-height: 1.25; }
.nextup .s { font-size: 12.5px; color: var(--muted); }

/* карточки и строки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.card.pad { padding: 14px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 12px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.item:active { transform: scale(.985); }
.item .time { font-family: var(--f-mono); font-size: 12px; font-weight: 700; color: var(--muted); min-width: 44px; }
.item .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg2); color: var(--emerald); flex: none; }
.item .ico.meeting { background: rgba(107,76,138,.12); color: var(--violet); }
.item .ico.block { background: rgba(20,58,45,.10); color: var(--emerald); }
.item .ico.over { background: rgba(167,90,69,.14); color: var(--terra); }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.done .title { text-decoration: line-through; color: var(--muted); }
.item .go { color: var(--line); flex: none; }
.check { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--gold); display: grid; place-items: center; color: transparent; flex: none; transition: all .25s var(--ease); }
.check:active, .check.on { background: var(--gold); color: var(--btn-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 100px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; transition: all .2s var(--ease); }
.chip.on { background: var(--emerald); color: var(--dark-ink); border-color: var(--emerald); }
.chip.slot { background: #EAF3EC; border-color: #BCD8C3; color: #2B6A47; font-family: var(--f-mono); font-weight: 700; }
.chip.gold { background: rgba(176,130,46,.12); border-color: rgba(176,130,46,.45); color: var(--gold-hover); }
.badge { flex: none; white-space: nowrap; font-family: var(--f-mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--bg2); color: var(--muted); }
.badge.ok { background: rgba(62,142,94,.14); color: #2B6A47; }
.badge.warn { background: rgba(201,149,43,.18); color: #8A6212; }
.badge.unknown { background: rgba(90,96,86,.14); color: var(--muted); }
.badge.bad { background: rgba(167,90,69,.15); color: var(--terra); }

/* кнопки */
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 10px; font-weight: 700; font-size: 15px; transition: transform .2s var(--ease), background .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--gold); color: var(--btn-ink); box-shadow: 0 14px 28px -18px rgba(176,130,46,.9); }
.btn-primary:hover { background: var(--gold-hover); }
.btn-dark { background: var(--emerald); color: var(--dark-ink); }
.btn-ghost { background: transparent; color: var(--emerald); box-shadow: inset 0 0 0 1.5px var(--emerald); }
.btn-soft { background: var(--bg2); color: var(--ink); }
.btn-danger { background: transparent; color: var(--terra); box-shadow: inset 0 0 0 1.5px rgba(167,90,69,.5); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* поля */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.input, textarea.input, select.input { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; outline: none; transition: border-color .2s, box-shadow .2s; min-height: 46px; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,130,46,.18); }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.45; }
.seg { display: flex; background: var(--bg2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { flex: 1; padding: 9px 8px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); transition: all .25s var(--ease); }
.seg button.on { background: var(--card); color: var(--emerald); box-shadow: 0 4px 12px -6px rgba(20,58,45,.4); }
.switch { position: relative; width: 48px; height: 28px; border-radius: 20px; background: var(--line); transition: background .25s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.switch.on { background: var(--emerald); } .switch.on::after { transform: translateX(20px); }
.mic { width: 46px; height: 46px; border-radius: 50%; background: var(--emerald); color: var(--gold2); display: grid; place-items: center; flex: none; position: relative; transition: transform .2s var(--ease); }
.mic:active { transform: scale(.94); }
.mic.rec { background: var(--terra); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(167,90,69,.5); } 100% { box-shadow: 0 0 0 16px rgba(167,90,69,0); } }
.with-mic { display: flex; gap: 10px; align-items: flex-end; }
.with-mic .input { flex: 1; }

/* прогресс */
.bar { height: 8px; border-radius: 8px; background: var(--bg-alt); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 8px; transition: width .8s var(--ease); }
.progress-row { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.progress-row .head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.pipe { display: flex; gap: 3px; height: 10px; margin: 10px 0 8px; }
.pipe i { flex: 1; border-radius: 4px; background: var(--bg-alt); }
.pipe i.has { background: var(--emerald2); }
.pipe i.has.hot { background: var(--gold); }

/* нижнее меню */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(100%, var(--app-w, 560px)); z-index: 20; display: grid; grid-template-columns: 62px repeat(5, 1fr); align-items: end; padding: 8px 8px calc(8px + var(--safe-b)); background: rgba(244,241,234,.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 2px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: -.01em; position: relative; min-width: 0; white-space: nowrap; }
.tab.on { color: var(--emerald); }
.tab.on::after { content: ""; position: absolute; top: -9px; width: 22px; height: 3px; border-radius: 3px; background: var(--gold); }
.fab { width: 52px; height: 52px; border-radius: 17px; margin: 0 0 4px; background: var(--gold); color: var(--btn-ink); display: grid; place-items: center; box-shadow: 0 18px 30px -14px rgba(176,130,46,.95), inset 0 0 0 1.5px rgba(255,255,255,.25); transition: transform .25s var(--ease); }
.fab:active { transform: scale(.92) rotate(90deg); }

/* шторка */
.backdrop { position: fixed; inset: 0; background: rgba(22,32,27,.5); z-index: 40; opacity: 0; transition: opacity .3s; backdrop-filter: blur(2px); }
.backdrop.on { opacity: 1; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%); width: min(100%, 560px); max-height: 92vh; z-index: 41; background: var(--bg); border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + var(--safe-b)); overflow-y: auto; transition: transform .45s var(--ease); box-shadow: 0 -30px 80px -30px rgba(20,58,45,.5); }
.sheet.on { transform: translate(-50%, 0); }
.sheet .grab { width: 44px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.x { width: 34px; height: 34px; border-radius: 50%; background: var(--bg2); display: grid; place-items: center; flex: none; }

/* календарь */
.daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0; }
.dsb { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.dsb small { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dsb b { font-size: 16px; font-family: var(--f-display); }
.dsb i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.dsb i.has { background: var(--gold); }
.dsb.on { background: var(--emerald); color: var(--dark-ink); border-color: var(--emerald); }
.dsb.on small { color: rgba(239,233,218,.7); }
.dsb.today b { color: var(--gold); } .dsb.on.today b { color: var(--gold2); }
.dsb.off { opacity: .55; }
.grid { position: relative; margin-top: 8px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.grid .hl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-soft); }
.grid .hl span { position: absolute; left: 8px; top: -8px; background: var(--card); padding: 0 4px; font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); }
.grid .lane { position: absolute; left: 54px; right: 8px; top: 0; bottom: 0; }
.ev { position: absolute; left: 0; right: 0; border-radius: 9px; padding: 6px 9px; color: #fff; overflow: hidden; text-align: left; box-shadow: 0 8px 18px -12px rgba(0,0,0,.5); }
.ev.meeting { background: var(--violet); } .ev.block { background: var(--emerald2); } .ev.done { background: #8E948A; }
.ev.task { background: var(--terra); left: 0; right: 40%; }
.ev b { display: block; font-size: 12.5px; line-height: 1.2; } .ev small { font-family: var(--f-mono); font-size: 10.5px; opacity: .85; }
.nowline { position: absolute; left: 46px; right: 0; border-top: 2px solid #D93025; z-index: 3; } .nowline::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: #D93025; }
/* неделя как в Google Календаре: колонки дней, часовая шкала слева, события блоками */
.wk { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 8px; }
.wk-head, .wk-body { display: grid; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); }
.wk-head { border-bottom: 1px solid var(--line); background: var(--card); }
.wk-day { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 6px; font-family: var(--f-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line-soft); }
.wk-day b { font-family: var(--f-display); font-size: 15px; letter-spacing: 0; width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; color: var(--ink); }
.wk-day.today { color: var(--gold); }
.wk-day.today b { background: var(--emerald); color: var(--gold2); }
.wk-day.off { opacity: .55; }
.wk-body { position: relative; padding: 9px 0 6px; }
.wk-gutter { position: relative; }
.wk-gutter span { position: absolute; right: 3px; transform: translateY(-50%); font-family: var(--f-mono); font-size: 9px; color: var(--muted); }
.wk-col { position: relative; border-left: 1px solid var(--line-soft); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hp) - 1px), var(--line-soft) calc(var(--hp) - 1px), var(--line-soft) var(--hp)); }
.wk-col.off { background-color: rgba(235,229,215,.45); }
.wk-ev { position: absolute; border-radius: 5px; padding: 2px 3px; overflow: hidden; color: #fff; font-size: 9px; line-height: 1.15; font-weight: 700; text-align: left; box-shadow: 0 0 0 1px var(--card); overflow-wrap: anywhere; }
.wk-ev small { display: block; font-family: var(--f-mono); font-weight: 500; font-size: 8px; opacity: .85; }
.wk-ev.meeting { background: var(--violet); } .wk-ev.block { background: var(--emerald2); } .wk-ev.task { background: var(--terra); } .wk-ev.done { background: #8E948A; }
.wk-now { position: absolute; left: 0; right: 0; border-top: 2px solid #D93025; z-index: 3; pointer-events: none; }
.wk-now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: #D93025; }
.agenda-day { margin-top: 16px; }
.agenda-day h3 { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* воронки */
.fcard { padding: 14px; display: block; width: 100%; text-align: left; }
.fcard h3 { margin-bottom: 2px; }
.kpis { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.kpis b { color: var(--ink); font-family: var(--f-display); font-size: 16px; margin-right: 3px; }
.kanban { display: flex; gap: 10px; overflow-x: auto; margin: 0; padding: 4px 0 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
/* заголовок этапа закреплен и закрывает собой верхний отступ колонки, иначе карточки видны над ним и налезают */
.kcol .khead { position: sticky; top: 0; z-index: 2; background: var(--bg2); margin: -10px -10px 0; padding: 12px 14px 8px; border-radius: 16px 16px 0 0; width: calc(100% + 20px); }
.khead { margin: 2px 4px 2px; padding: 4px 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--emerald); display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; font-weight: 800; }
.khead .kn { background: var(--emerald); color: var(--dark-ink); border-radius: 999px; min-width: 24px; padding: 2px 8px; text-align: center; letter-spacing: 0; }
.kcard.more { color: var(--emerald); background: transparent; border-style: dashed; font-weight: 700; font-size: 13px; }
.kcol.kadd { align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--line); background: transparent; color: var(--emerald); font-weight: 700; min-height: 120px; }
/* ползунок закреплен над нижней панелью: виден при любой прокрутке страницы и в широком окне */
.kslider-wrap { position: sticky; bottom: calc(var(--tab-h) + 6px + var(--safe-b)); z-index: 12; background: rgba(244,241,234,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 14px; padding: 6px 10px 2px; box-shadow: 0 6px 24px -12px rgba(20,58,45,.45); display: flex; flex-direction: column; gap: 0; }
.kslider-wrap small { font-size: 11px; color: var(--muted); text-align: center; margin-top: -4px; padding-bottom: 4px; }
.kslider-wrap .kslider { margin: 0; }
@media (min-width: 900px) {
  /* на широком экране колонки этапов с собственной прокруткой, чтобы заголовки и ползунок не уезжали за край */
  :root[data-wide] .kanban { gap: 14px; align-items: flex-start; }
  :root[data-wide] .kcol { width: 300px; max-width: 300px; max-height: calc(100vh - 330px); overflow-y: auto; }
  :root[data-wide] .kcol .khead { position: sticky; top: 0; background: var(--bg2); z-index: 1; }
}
.kslider { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 2px 0 14px; }
.kslider::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: var(--bg2); box-shadow: inset 0 0 0 1px var(--line); }
.kslider::-moz-range-track { height: 8px; border-radius: 999px; background: var(--bg2); box-shadow: inset 0 0 0 1px var(--line); }
.kslider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 54px; height: 24px; margin-top: -8px; border-radius: 999px; background: var(--emerald); border: 2px solid var(--gold); }
.kslider::-moz-range-thumb { width: 54px; height: 24px; border-radius: 999px; background: var(--emerald); border: 2px solid var(--gold); }
.kcol { flex: none; width: 78%; max-width: 280px; scroll-snap-align: start; background: var(--bg2); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.kcol h4 { margin: 2px 4px 2px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--emerald); display: flex; justify-content: space-between; }
.kcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: left; font-weight: 700; }
.knick { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 8px 2px 6px; border-radius: 999px; background: rgba(20,58,45,.08); color: var(--emerald); font-size: 12px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.knick:active { background: var(--emerald); color: var(--dark-ink); }
.kcard small { display: block; font-weight: 500; color: var(--muted); margin-top: 2px; }
.kcard { position: relative; }
.dot-amo { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #D64545; box-shadow: 0 0 0 3px rgba(214,69,69,.18); flex: none; }
.kcard .dot-amo { position: absolute; top: 10px; right: 10px; }
.tier { font-family: var(--f-mono); font-size: 10.5px; font-weight: 800; letter-spacing: .02em; padding: 3px 8px; border-radius: 999px; flex: none; white-space: nowrap; background: var(--bg2); color: var(--muted); }
.tier.top { background: var(--gold); color: var(--btn-ink); box-shadow: 0 6px 14px -8px rgba(176,130,46,.9); }
.tier.sales { background: #E3EFE6; color: #1F6B3A; }
.tier.none { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.meta-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.mchip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg2); color: var(--muted); white-space: nowrap; }
.mchip.hi { background: #E3EFE6; color: #1F6B3A; }
.mchip.mid { background: #F6EBCF; color: #8A6212; }
.mchip.lo { background: #F6E1DC; color: #A33A2A; }
.tier.stop { box-shadow: inset 0 0 0 2px #A33A2A; }
.fit { font-family: var(--f-mono); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 8px; flex: none; }
.fit.ok { background: #E3EFE6; color: #1F6B3A; }
.fit.warn { background: #F6EBCF; color: #8A6212; }
.fit.bad { background: #F6E1DC; color: #A33A2A; }
.chip[class*="flag-"] { white-space: normal; text-align: left; max-width: 100%; }
.chip.flag-good { background: rgba(62,142,94,.12); border-color: rgba(62,142,94,.4); color: #2B6A47; font-size: 12.5px; }
.chip.flag-warn { background: rgba(201,149,43,.14); border-color: rgba(201,149,43,.45); color: #8A6212; font-size: 12.5px; }
.chip.flag-bad { background: rgba(167,90,69,.12); border-color: rgba(167,90,69,.45); color: var(--terra); font-size: 12.5px; }
[hidden] { display: none !important; }
:root { --alex: #2F6DB5; }
.layers { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 2px 0 12px; }
.layers .chip { display: inline-flex; align-items: center; gap: 7px; }
.layers .chip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.layers .chip.off { opacity: .55; }
.layers .chip.off i { background: transparent !important; box-shadow: inset 0 0 0 1.5px currentColor; }
.layers small { color: var(--muted, #7b8077); font-size: 11.5px; }
.wk-col .wk-ev, .lane .ev { z-index: 2; }
/* свободное время Александра: свой цвет (синий). Где оно совпало с моим свободным, поверх рисуется зеленая рамка */
.wk-alex, .alexb { position: absolute; left: 1px; right: 1px; background: rgba(47,109,181,.22); border-radius: 5px; pointer-events: none; z-index: 1; }
.wk-common, .commonb { position: absolute; left: 0; right: 0; border: 2.5px solid var(--green); border-radius: 7px; pointer-events: none; z-index: 3; box-shadow: 0 0 0 1px rgba(255,255,255,.7) inset; }
.alexb { left: 0; right: 0; font-size: 11px; color: var(--alex); padding: 4px 8px; font-weight: 700; }
.commonb { display: flex; align-items: flex-end; justify-content: flex-end; padding: 2px 8px; font-size: 11px; font-weight: 800; color: var(--green); }
.wk-free, .freeb { position: absolute; left: 1px; right: 1px; border-radius: 5px; background: #E3F1E7; border: 1px dashed #A8CDB3; z-index: 0; cursor: pointer; padding: 0; }
.freeb { left: 0; right: 0; border-radius: 9px; border-width: 1.5px; display: flex; align-items: flex-start; justify-content: flex-start; padding: 5px 9px; font-family: var(--f-mono); font-size: 11.5px; font-weight: 700; color: #2B6A47; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.tile { text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-height: 84px; }
.tile .tn { font-family: var(--f-display); font-weight: 800; font-size: 28px; line-height: 1; color: var(--emerald); }
.tile .tl { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.tile.warn .tn { color: var(--terra); }
.tile.on { background: var(--emerald); border-color: var(--emerald); }
.tile.on .tn, .tile.on .tl { color: var(--dark-ink); }
.tiles.compact { gap: 8px; margin-bottom: 8px; }
.tiles.compact .tile { flex-direction: row; align-items: center; justify-content: space-between; min-height: 48px; padding: 8px 12px; gap: 8px; }
.tiles.compact .tile .tn { font-size: 18px; order: 2; }
.tiles.compact .tile .tl { font-size: 13px; }
.busy-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.busy-row .bt { font-family: var(--f-mono); font-weight: 700; font-size: 13px; min-width: 92px; color: var(--emerald); }
.busy-row.done { opacity: .55; }
.tgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.tgrid button { padding: 9px 0; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font-family: var(--f-mono); font-weight: 700; font-size: 13px; color: var(--ink); }
.tgrid button.free { background: #EAF3EC; border-color: #BCD8C3; color: #2B6A47; }
.tgrid button.common { box-shadow: inset 0 0 0 2px var(--green); border-color: var(--green); background: #E3F1E7; }
.tgrid button.busy { opacity: .4; text-decoration: line-through; }
.tgrid button.on { background: var(--emerald); color: var(--dark-ink); border-color: var(--emerald); box-shadow: none; }
.ans { display: flex; flex-direction: column; gap: 6px; }
.ans-row { border-left: 4px solid var(--line, #d9d4c4); padding: 4px 0 4px 10px; border-radius: 2px; }
.ans-row small { display: block; font-size: 11.5px; opacity: .65; }
.ans-row b { font-size: 14px; font-weight: 700; white-space: pre-wrap; }
.ans-row.good { border-color: var(--green); background: rgba(62,142,94,.07); }
.ans-row.warn { border-color: var(--amber); background: rgba(201,149,43,.09); }
.ans-row.bad { border-color: var(--terra); background: rgba(167,90,69,.09); }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--btn-ink); font-family: var(--f-display); font-weight: 800; font-size: 18px; flex: none; }

/* варианты сообщений */
.variant { padding: 14px; }
.variant pre { margin: 10px 0 12px; white-space: pre-wrap; word-wrap: break-word; font-family: var(--f-text); font-size: 14.5px; line-height: 1.5; background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 12px; }
.note { font-size: 13px; color: var(--muted); background: var(--bg2); border-radius: 10px; padding: 10px 12px; }
.note b { color: var(--emerald); }

/* база знаний */
.sec { padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 8px; min-height: 92px; justify-content: space-between; }
.sec b { font-family: var(--f-display); font-size: 26px; color: var(--gold); line-height: 1; }
.sec span { font-weight: 700; }
.answer { padding: 14px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mcell { padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 10px; min-height: 100px; transition: transform .25s var(--ease); }
.mcell:active { transform: scale(.97); }
.mcell .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--emerald); color: var(--gold2); }
.mcell .t { font-weight: 800; font-family: var(--f-display); font-size: 15px; line-height: 1.15; }
/* голосовой ввод: крупная кнопка и карточка на главной */
.mic-big { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 64px; border-radius: 16px; background: var(--emerald); color: var(--dark-ink); font-weight: 800; font-size: 16px; position: relative; overflow: hidden; }
.mic-big .dot { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--btn-ink); display: grid; place-items: center; }
.mic-big.rec { background: var(--terra); animation: pulse 1.2s infinite; } .mic-big.rec .dot { background: #fff; color: var(--terra); }
.mic-big small { display: block; font-weight: 500; font-size: 12px; opacity: .8; }
.mcell small { color: var(--muted); font-size: 12px; }
.mcell .cnt { align-self: flex-start; }

/* прочее */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 24px + var(--safe-b)); transform: translate(-50%, 20px); background: var(--ink); color: var(--dark-ink); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; z-index: 60; opacity: 0; transition: all .4s var(--ease); max-width: 90%; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); } .toast.err { background: var(--terra); }
.skeleton { height: 64px; border-radius: var(--r); background: linear-gradient(90deg, var(--bg2), #F7F3E8, var(--bg2)); background-size: 200% 100%; animation: sk 1.3s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 26px 16px; color: var(--muted); }
.empty b { display: block; font-family: var(--f-display); color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(0,0,0,.15); border-top-color: currentColor; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.thinking { display: flex; align-items: center; gap: 10px; padding: 14px; color: var(--muted); font-weight: 600; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.help-block { padding: 14px; } .help-block h3 { margin-bottom: 8px; color: var(--emerald); } .help-block ul { margin: 0; padding-left: 18px; color: var(--ink); } .help-block li { margin: 4px 0; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 700px) { body { background: #E9E4D6; } #app { box-shadow: 0 0 80px -30px rgba(20,58,45,.5); } }

.tstrip { display: flex; gap: 6px; position: sticky; top: 0; z-index: 5; padding: 6px 0 8px; background: var(--bg, #f5f2ea); }
.dchip { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.dchip small { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.dchip b { font-size: 16px; }
.dchip i { font-style: normal; font-size: 11px; font-weight: 800; min-height: 14px; color: var(--muted); }
.dchip i.has { color: var(--terra); }
.dchip.on { background: var(--emerald); border-color: var(--emerald); }
.dchip.on small, .dchip.on b, .dchip.on i { color: var(--dark-ink); }
.dayblock { margin-top: 14px; scroll-margin-top: 84px; }

.dchip { min-width: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
details.later > summary { cursor: pointer; list-style: none; }
details.later > summary::-webkit-details-marker { display: none; }
details.dayblock > summary { cursor: pointer; list-style: none; }
details.dayblock > summary::-webkit-details-marker { display: none; }


.sqbtn { width: 30px; height: 30px; flex: none; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--emerald); display: inline-grid; place-items: center; padding: 0; }
.sqbtn:hover { border-color: var(--emerald); }

.stageblock { margin: 4px 0 12px; }
.stagebtn { width: 100%; margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--emerald); color: var(--dark-ink); font-weight: 700; font-size: 15px; text-align: left; }
.stagebtn .cur { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stagebtn .burger { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.12); }
.stage-item.cur { background: rgba(22,66,52,.08); }
.stage-item.cur .title { font-weight: 800; }
.stage-item.past { opacity: .6; }

.logo { white-space: nowrap; flex: none; }

.tboard { display: grid; grid-template-columns: repeat(7, minmax(132px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-top: 4px; }
.tcol { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 150px; }
.tcol.today { border-color: var(--emerald); box-shadow: inset 0 0 0 1px var(--emerald); }
.thead { display: flex; align-items: center; gap: 6px; text-align: left; padding: 2px 2px 6px; border-bottom: 1px solid var(--line); }
.thead small { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.thead b { font-size: 16px; }
.thead .badge { margin-left: auto; }
.tcard { text-align: left; padding: 6px 8px; border-radius: 8px; background: rgba(167,90,69,.1); border-left: 3px solid var(--terra); font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.tcard small { display: block; font-family: var(--f-mono); font-size: 10.5px; opacity: .7; }
.tcard.done { opacity: .5; text-decoration: line-through; border-left-color: var(--line); background: var(--bg2); }
.tempty { font-size: 12px; padding: 4px; }

/* шапка в узком окне: все кнопки в одну строку, при совсем малой ширине переносятся */
.topbar { flex-wrap: wrap; row-gap: 8px; }
.topbar > .row { margin-left: auto; flex-wrap: nowrap; gap: 6px !important; }
.topbar .btn-sm { padding: 0 10px; min-height: 34px; }
.topbar .logo { font-size: 13px; padding: 5px 9px; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid3 .btn { padding: 0 8px; }
details.aud-fold > summary::-webkit-details-marker { display: none; }

.ev-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; cursor: ns-resize; touch-action: none; display: grid; place-items: center; }
.ev-grip::after { content: ''; width: 28px; height: 3px; border-radius: 2px; background: currentColor; opacity: .45; }

.conv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 14px; font-weight: 600; }
.conv-row small { display: block; font-weight: 500; font-size: 12px; }

.toast-undo { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 78px + var(--safe-b)); transform: translate(-50%, 20px); display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--dark-ink); padding: 10px 12px 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; z-index: 61; opacity: 0; pointer-events: none; transition: all .4s var(--ease); max-width: 92%; }
.toast-undo.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-undo button { background: var(--gold, #B38530); color: #fff; border-radius: 8px; padding: 6px 12px; font-weight: 800; }
.tcard.duty { background: rgba(179,133,48,.14); border-left-color: var(--gold, #B38530); }
.tcard.dragging { opacity: .35; }
.tcard.ghost { position: fixed; z-index: 80; pointer-events: none; opacity: .92; box-shadow: 0 10px 24px rgba(0,0,0,.22); background: var(--card); }
.tcol.over { outline: 2px dashed var(--emerald); outline-offset: -2px; }
.tcard[data-open="1"] { touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; }

.progress-row .head .mono { white-space: nowrap; flex: none; }

.goalhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; }
.seg-sm button { padding: 6px 12px; font-size: 13px; }
