/* Listclick admin (design: canvas page "Panel admina"). Light only: an internal tool. */
:root {
  --bg: #FFF7FB;
  --surface: #FFFFFF;
  --ink: #1C1833;
  --ink-2: #4A4560;
  --muted: #6A6580;
  --faint: #A79FB3;
  --line: #EADFE6;
  --line-2: #F3EAF0;
  --grid: #EFE6EC;
  --track: #F5EBF1;
  --key: #FFCB3D;
  --key-soft: #FFF6DA;
  --key-text: #5A4500;
  --violet-soft: #F5F2FB;
  --violet: #4B3BB5;
  --series: #C2185B;
  --series-soft: #F3C6DA;
  --good: #0F5A31;
  --good-bg: #DDF5E6;
  --bad: #8C1D18;
  --bad-bg: #FFE2E0;
  --pill: #F3EEF2;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.45 "Nunito", system-ui, sans-serif; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1 { margin: 0; font-size: 36px; font-weight: 900; line-height: 1.1; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 17px; font-weight: 900; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; height: 72px; display: flex; align-items: center; gap: 28px; padding: 0 40px; background: var(--surface); border-bottom: 2px solid var(--ink); }
.brand { display: flex; align-items: center; gap: 9px; }
.brand svg { display: block; }
.word { font-size: 23px; font-weight: 900; letter-spacing: -0.01em; }
.badge { font-size: 11px; font-weight: 900; letter-spacing: 0.12em; padding: 4px 8px; border-radius: 7px; background: var(--ink); color: var(--key); }
nav { display: flex; gap: 6px; margin-left: 12px; }
.tab { height: 40px; padding: 0 16px; border-radius: 12px; font-size: 15px; font-weight: 800; border: 2px solid transparent; background: none; color: var(--ink-2); }
.tab[aria-selected="true"] { background: var(--key); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); color: var(--ink); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.avatar { width: 34px; height: 34px; flex-shrink: 0; border-radius: 999px; background: #FFE3F0; border: 2px solid var(--ink); display: grid; place-items: center; font-size: 14px; font-weight: 900; }
.whoEmail { font-size: 14px; font-weight: 700; color: var(--ink-2); }

/* Buttons */
.key { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 56px; padding: 0 20px; border-radius: 16px; border: 2px solid var(--ink); background: var(--key); box-shadow: 0 4px 0 var(--ink); font-size: 17px; font-weight: 900; }
.key:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.key:disabled { opacity: 0.55; cursor: default; }
.key.white { background: var(--surface); font-size: 15px; }
.key.wide { width: 100%; }
.ghost, .soft { height: 40px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 800; }
.ghost { height: 36px; border-radius: 10px; }
.link { border: 0; background: none; padding: 0; color: var(--series); font-weight: 900; }
.segmented { display: inline-flex; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--surface); flex-shrink: 0; }
.segmented button { border: 0; background: none; padding: 8px 16px; font-size: 14px; font-weight: 900; }
.segmented button + button { border-left: 2px solid var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--key); }

/* Layout */
main { width: min(1200px, 100% - 32px); margin: 0 auto; padding: 36px 0 60px; }
.page { display: flex; flex-direction: column; gap: 22px; }
.pageHead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.sub { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.actions { display: flex; align-items: center; gap: 12px; }
.center { min-height: 70vh; display: grid; place-items: center; }
.card { background: var(--surface); border: 2px solid var(--ink); border-radius: 22px; box-shadow: 0 4px 0 var(--ink); padding: 22px 24px; min-width: 0; }
.cardHead { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cardHead.wrap { flex-wrap: wrap; }
.hint { font-size: 13px; font-weight: 700; color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-135 { grid-template-columns: 1.35fr 1fr; }
.grid-push { grid-template-columns: 1.15fr 1fr; gap: 22px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.error { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--bad-bg); color: var(--bad); font-weight: 700; }
.ok { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--good-bg); color: var(--good); font-weight: 700; }
.login { max-width: 440px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.login h1 { font-size: 28px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.kpiTop { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.label { font-size: 12.5px; font-weight: 900; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.delta { font-size: 12.5px; font-weight: 900; padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
.delta.up { background: var(--good-bg); color: var(--good); }
.delta.down { background: var(--bad-bg); color: var(--bad); }
.kpiMid { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 10px; }
.big { font-size: 48px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpiSub { margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.spark { display: block; flex-shrink: 0; }

/* Funnel */
.funnel { display: flex; gap: 18px; margin-top: 18px; }
.step { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stepLabel { font-size: 13px; font-weight: 900; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.stepN { display: flex; align-items: baseline; gap: 8px; }
.stepN b { font-size: 34px; font-weight: 900; }
.stepN span { font-size: 15px; font-weight: 800; color: var(--series); }
.stepBar { height: 64px; border-radius: 12px; background: var(--track); display: flex; align-items: flex-end; overflow: hidden; }
.stepBar div { width: 100%; background: var(--series); border-radius: 10px 10px 0 0; }
.stepNote { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.arrow { align-self: center; font-size: 24px; font-weight: 900; color: #C9B9C3; padding-top: 20px; }

/* Engagement tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.tile { padding: 16px 18px; border-radius: 18px; border: 1.5px solid var(--line); }
.tile .label { font-size: 12px; }
.tileN { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.tileN b { font-size: 28px; font-weight: 900; }
.tileN span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.meter { margin-top: 10px; height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.meter div { height: 100%; border-radius: 99px; background: var(--series); }

/* Charts */
.chart { position: relative; margin-top: 18px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart .hit { fill: transparent; }
.chart .mark { transition: filter 0.15s; }
.chart .mark.on { filter: brightness(0.85); }
.tip { position: fixed; z-index: 20; pointer-events: none; padding: 7px 10px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12.5px; line-height: 1.35; text-align: center; box-shadow: 0 6px 16px rgba(28, 24, 51, 0.2); }
.tip b { font-size: 15px; }
.tip span { color: #C9C3D8; }

/* Status + plans */
.stacked { display: flex; gap: 2px; height: 22px; margin: 18px 0 12px; border-radius: 8px; overflow: hidden; }
.stacked div { min-width: 2px; }
.legendRow { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.sw { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.legendRow .name { flex: 1; font-size: 15px; font-weight: 700; }
.legendRow .pct { width: 48px; text-align: right; font-size: 13px; font-weight: 700; color: var(--muted); }
.legendRow .n { width: 44px; text-align: right; font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
.texture { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.55) 0 3px, transparent 3px 7px); }
.money { display: flex; gap: 14px; margin: 16px 0 10px; }
.money > div { flex: 1; padding: 14px 16px; border-radius: 16px; }
.money .label { font-size: 12px; }
.money b { display: block; font-size: 30px; font-weight: 900; margin-top: 4px; }
.mrr { background: var(--key-soft); }
.mrr .label { color: var(--key-text); }
.conv { background: var(--violet-soft); }
.conv .label { color: var(--violet); }
.planRow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.planRow .name { width: 92px; font-size: 15px; font-weight: 800; }
.planRow .meter { flex: 1; margin: 0; height: 10px; }
.planRow .price { width: 70px; text-align: right; font-size: 13px; font-weight: 700; color: var(--muted); }
.planRow .n { width: 36px; text-align: right; font-size: 16px; font-weight: 900; }

/* Users table */
.tools { display: flex; gap: 10px; flex-wrap: wrap; }
.search { width: 260px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.search input { border: 0; outline: none; background: none; width: 100%; font-size: 14px; }
.search:focus-within, select:focus, input:focus, textarea:focus { outline: none; border-color: var(--ink); }
.tableWrap { overflow-x: auto; margin-top: 14px; }
.users { width: 100%; border-collapse: collapse; }
.users th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 900; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; border-bottom: 2px solid var(--line); white-space: nowrap; }
.users td { padding: 12px; border-bottom: 1px solid var(--line-2); font-size: 14px; white-space: nowrap; }
.users tbody tr:hover { background: #FFF1F7; }
.users .num { text-align: right; }
.users td.num { font-size: 15px; font-weight: 900; }
.who2 { display: flex; align-items: center; gap: 12px; }
.ini { width: 34px; height: 34px; flex-shrink: 0; border-radius: 999px; background: #FFE3F0; display: grid; place-items: center; font-size: 14px; font-weight: 900; }
.who2 b { display: block; font-size: 14.5px; font-weight: 800; }
.who2 .noname { color: var(--faint); }
.who2 small { font-size: 13px; color: var(--muted); }
.pill { font-size: 12px; font-weight: 900; padding: 4px 9px; border-radius: 8px; background: var(--pill); }
.pill.paid { background: var(--key); }
.consents { display: flex; gap: 6px; }
.consent { font-size: 11.5px; font-weight: 900; padding: 3px 7px; border-radius: 7px; background: var(--pill); color: var(--faint); }
.consent.on { background: var(--good-bg); color: var(--good); }
.tableFoot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13.5px; font-weight: 700; color: var(--muted); }

/* Push form */
.form { display: flex; flex-direction: column; gap: 16px; }
.form .cardHead { margin-bottom: 2px; }
.langFields { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.fieldHead { display: flex; justify-content: space-between; font-size: 14px; font-weight: 800; }
.count { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.field input, .field textarea, .input { width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-size: 15.5px; line-height: 1.45; font-weight: 600; }
.field input:not(:placeholder-shown), .field textarea:not(:placeholder-shown) { border-color: var(--ink); }
.field textarea { resize: vertical; min-height: 96px; }
.input { height: 48px; padding: 0 14px; font-weight: 700; }
.info { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--violet-soft); font-size: 13.5px; line-height: 1.45; color: var(--violet); }
.choices { display: flex; gap: 10px; }
.choice { position: relative; flex: 1; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.choice.grow { flex: 1.2; }
.choice input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input[type="radio"]:checked) { border-color: var(--ink); background: var(--key-soft); box-shadow: 0 3px 0 var(--ink); }
.choice:has(input[type="radio"]:focus-visible) { outline: 3px solid var(--series); outline-offset: 2px; }
.dot { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; border-radius: 999px; border: 2px solid var(--ink); background: var(--surface); display: grid; place-items: center; }
.choice:has(input[type="radio"]:checked) .dot::after { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--ink); }
.choiceText { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choiceText b { font-size: 15px; font-weight: 900; }
.choiceText > span { font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.choiceN { margin-left: auto; font-size: 20px; font-weight: 900; }
.when { display: flex; gap: 8px; margin-top: 6px; }
.when input { height: 40px; border-radius: 10px; border: 2px solid var(--ink); background: var(--surface); padding: 0 10px; font-size: 14.5px; font-weight: 800; min-width: 0; }
.when input[type="date"] { flex: 1; }
.when input[type="time"] { width: 124px; }
.choice:not(:has(input[type="radio"]:checked)) .when, .choice:not(:has(input[type="radio"]:checked)) .tz { display: none; }
.tz { font-size: 12.5px; color: var(--key-text); margin-top: 6px; }
.formActions { display: flex; gap: 12px; margin-top: 4px; }
.formActions .grow { flex: 1; }

/* Preview */
.lock { position: relative; height: 330px; margin-top: 16px; border-radius: 26px; overflow: hidden; background: linear-gradient(160deg, #3A3358 0%, #1C1833 60%, #2B2440 100%); font-family: -apple-system, system-ui, sans-serif; }
.lockTime { position: absolute; left: 0; right: 0; top: 28px; text-align: center; color: #fff; }
.lockDate { font-size: 15px; font-weight: 600; opacity: 0.85; }
.lockClock { font-size: 72px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.iosNote { position: absolute; left: 16px; right: 16px; bottom: 22px; padding: 12px 14px; border-radius: 20px; background: rgba(255, 255, 255, 0.82); display: flex; gap: 12px; color: #1C1C1E; }
.pvIcon { width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: var(--bg); display: grid; place-items: center; }
.pvText { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14px; line-height: 1.35; }
.pvRow { display: flex; justify-content: space-between; gap: 8px; }
.pvRow b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pvWhen { color: #6C6C70; font-size: 13px; flex-shrink: 0; }
.iosNote .pvBody { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shade { margin-top: 16px; padding: 28px 16px; border-radius: 26px; background: linear-gradient(180deg, #2B2440 0%, #3A3358 100%); font-family: Roboto, system-ui, sans-serif; }
.andNote { padding: 14px 16px; border-radius: 22px; background: #F4EFF4; color: #1D1B20; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.andHead { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #49454F; }
.andIcon { width: 20px; height: 20px; border-radius: 999px; background: #FF4F9A; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 900; }
.andNote .pvTitle { font-size: 15px; }
.stack .hint { margin: 12px 0 0; }

/* Campaigns */
.camp { padding: 16px 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 5px; }
.camp:first-child { margin-top: 10px; }
.campTop { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.campTop b { font-size: 15.5px; font-weight: 900; }
.status { font-size: 12px; font-weight: 900; padding: 4px 9px; border-radius: 8px; white-space: nowrap; background: var(--pill); }
.status.sent { background: var(--good-bg); color: var(--good); }
.status.scheduled { background: var(--key-soft); color: var(--key-text); }
.campBody { font-size: 14px; color: var(--ink-2); }
.campMeta { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); }
.campMeta .link { font-size: 13.5px; }
.empty { margin: 16px 0 0; color: var(--muted); }

/* Messages (design: canvas page "Wiadomości · admin") */
.tabCount { min-width: 22px; height: 22px; margin-left: 8px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; background: var(--ink); color: var(--key); vertical-align: 1px; }
.tiles.three { grid-template-columns: repeat(3, 1fr); }
body.inboxMode main { width: 100%; padding: 0; }
.inbox { display: flex; height: calc(100dvh - var(--top, 72px)); min-height: 520px; }
.threads { width: 400px; flex-shrink: 0; background: var(--surface); border-right: 2px solid var(--ink); display: flex; flex-direction: column; min-height: 0; }
.threadsHead { padding: 20px 18px 14px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1.5px solid var(--line); }
.threadsTitle { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.threadsTitle h1 { font-size: 26px; }
.unreadNote { font-size: 13px; font-weight: 800; color: var(--series); }
.search.wide { width: 100%; height: 42px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pillBtn { height: 34px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 900; white-space: nowrap; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink-2); }
.pillBtn span { font-size: 12px; opacity: 0.7; }
.pillBtn[aria-pressed="true"] { background: var(--ink); color: #fff; border: 2px solid var(--ink); }
.pillBtn[aria-pressed="true"] span { opacity: 0.85; }
.threadsTools { display: flex; align-items: center; gap: 8px; }
.threadsTools .hint { margin-left: auto; font-size: 12.5px; }
select.small { height: 34px; border-radius: 10px; font-size: 13.5px; }
.threadList { flex: 1; overflow-y: auto; }
.trow { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-2); background: var(--surface); display: flex; gap: 10px; padding: 14px 18px; }
.trow:hover { background: #FFF1F7; }
.trow[aria-current="true"] { background: var(--key-soft); box-shadow: inset 4px 0 0 var(--ink); }
.trow .udot { width: 9px; height: 9px; margin-top: 7px; border-radius: 99px; flex-shrink: 0; }
.trow.unread .udot { background: var(--series); }
.trow .tbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.trow .tline { display: flex; align-items: baseline; gap: 8px; }
.trow .tname { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .ttime { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.trow.unread .tname { font-weight: 900; }
.trow.unread .ttime { font-weight: 900; color: var(--series); }
.trow .tchips { display: flex; align-items: center; gap: 6px; }
.trow .tclip { margin-left: auto; display: flex; }
.trow .tsnip { font-size: 14px; line-height: 1.4; color: var(--ink-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow.unread .tsnip { color: var(--ink); font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 900; padding: 3px 9px; border-radius: 8px; white-space: nowrap; background: #F1EEF4; color: var(--ink-2); }
.chip i { width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.t-keyboard { background: #FFE3F0; color: #B0134F; }
.t-idea { background: #FFF1C7; color: #6E4A00; }
.t-app { background: #EDE9FF; color: var(--violet); }
.t-payments { background: var(--good-bg); color: var(--good); }
.s-new { background: #FFF1C7; color: var(--key-text); }
.s-waiting { background: #EDE9FF; color: var(--violet); }
.listEmpty { padding: 64px 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.listEmpty b { font-size: 19px; font-weight: 900; }
.listEmpty span { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.bigIcon { width: 72px; height: 72px; border-radius: 22px; border: 2px solid var(--ink); background: var(--good-bg); box-shadow: 0 4px 0 var(--ink); display: grid; place-items: center; flex-shrink: 0; }
.bigIcon.key-bg { width: 96px; height: 96px; border-radius: 28px; background: var(--key); box-shadow: 0 5px 0 var(--ink); }
.bigIcon.sm { width: 48px; height: 48px; border-radius: 14px; background: var(--pill); box-shadow: 0 3px 0 var(--ink); }
.shim { background: linear-gradient(90deg, #F3EAF0 0%, #FBF5F8 50%, #F3EAF0 100%); background-size: 200% 100%; animation: shim 1.4s linear infinite; border-radius: 8px; display: block; }
@keyframes shim { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .shim { animation: none; } }
.skRow { display: flex; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.skRow > div { flex: 1; display: flex; flex-direction: column; gap: 9px; }

.threadPane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.paneEmpty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 32px; }
.paneEmpty b { font-size: 24px; font-weight: 900; margin-top: 8px; }
.paneEmpty span:last-child { max-width: 380px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.threadView { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.threadHead { min-height: 84px; flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: var(--surface); border-bottom: 1.5px solid var(--line); }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }
.thWho { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.thRow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.thRow b { font-size: 19px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; }
.thMeta { font-size: 13.5px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconText { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 900; text-decoration: none; color: var(--ink); }
.iconBtn { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--line); padding: 0; }
.iconBtn.keyBtn[aria-pressed="true"] { background: var(--key); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.iconBtn.plain { border: 0; width: 32px; height: 32px; }
.iconBtn.back { display: none; }
.msgList { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; }
.daySep { display: flex; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 900; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.daySep::before, .daySep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { max-width: min(540px, 85%); display: flex; flex-direction: column; gap: 6px; }
.msg.user { align-self: flex-start; }
.msg.admin { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 13px 16px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user .bubble { border-radius: 20px 20px 20px 6px; background: var(--surface); border: 1.5px solid var(--line); font-weight: 500; }
.msg.admin .bubble { border-radius: 20px 20px 6px 20px; background: var(--violet); color: #fff; font-weight: 600; }
.msgMeta { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 0 4px; }
.msgChips { display: flex; gap: 6px; flex-wrap: wrap; }
.msg.admin .msgChips { justify-content: flex-end; }
.dchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 8px; background: var(--violet-soft); color: var(--violet); }
.dchip.read { background: var(--good-bg); color: var(--good); }
.dchip.mail { background: var(--key-soft); color: var(--key-text); }
.dchip.dev { background: #F1EEF4; color: var(--ink-2); }
.shot { margin-top: 10px; display: flex; gap: 10px; align-items: flex-end; white-space: normal; }
.shotBtn { position: relative; width: 120px; height: 200px; padding: 0; border-radius: 12px; overflow: hidden; border: 2px solid var(--ink); background: var(--pill); flex-shrink: 0; }
.shotBtn img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.shotBtn .zoom { position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 9px; background: var(--ink); display: grid; place-items: center; }
.shot small { font-size: 12.5px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.sysLine { align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--muted); padding: 5px 12px; border-radius: 999px; background: var(--pill); }

.composer { position: relative; flex-shrink: 0; padding: 14px 24px 18px; background: var(--surface); border-top: 1.5px solid var(--line); }
.deliveryNote { margin: 0 0 8px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--good); }
.deliveryNote.off { color: var(--key-text); }
.composer textarea { width: 100%; min-height: 88px; max-height: 40vh; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); font-size: 15px; line-height: 1.5; font-weight: 500; resize: none; display: block; }
.composer textarea:not(:placeholder-shown) { border-color: var(--ink); }
.composerBar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.shortcut { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
kbd { font: inherit; font-weight: 900; padding: 2px 6px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--bg); }
.sendBtn { height: 44px; padding: 0 20px; border-radius: 14px; font-size: 15.5px; box-shadow: 0 3px 0 var(--ink); }
.sendBtn:disabled { background: #F3E7C2; border-color: #D8CFAE; box-shadow: 0 3px 0 #D8CFAE; color: #8E879E; opacity: 1; }
.sendBtn:disabled svg { stroke: #8E879E; }
.sendError { margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; background: var(--bad-bg); color: var(--bad); display: flex; align-items: center; gap: 10px; font-size: 14px; }
.sendError > span { flex: 1; }
.sendError .soft { border-color: var(--bad); color: var(--bad); }
.tplWrap { position: relative; }
.tplMenu { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 5; width: 420px; max-width: calc(100vw - 32px); padding: 12px; border-radius: 18px; background: var(--surface); border: 2px solid var(--ink); box-shadow: 0 6px 0 var(--ink); display: flex; flex-direction: column; gap: 8px; }
.tplList { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; }
.tplItem { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: 12px; }
.tplItem:hover, .tplItem:focus-within { background: var(--key-soft); }
.tplPick { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tplPick b { font-size: 14.5px; font-weight: 900; }
.tplPick span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tplEdit { display: flex; gap: 10px; font-size: 13px; }
.tplFoot { display: flex; justify-content: space-between; padding: 8px 4px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.tplHint { margin: 0; padding: 0 4px; font-size: 12.5px; color: var(--muted); }
.closedBox { flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 18px 24px; background: var(--surface); border-top: 1.5px solid var(--line); }
.closedText { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--ink-2); }
.closedText b { font-size: 16px; color: var(--ink); }
.closedBox .key { height: 44px; font-size: 15px; }

.userPanel { width: 320px; flex-shrink: 0; background: var(--surface); border-left: 1.5px solid var(--line); padding: 22px; overflow-y: auto; }
.upHead { display: flex; justify-content: space-between; align-items: center; }
.upWho { display: flex; align-items: center; gap: 12px; margin: 12px 0 10px; }
.upWho .avatar { width: 52px; height: 52px; font-size: 22px; }
.upWho b { display: block; font-size: 18px; font-weight: 900; }
.upWho span span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.upRow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 14px; font-weight: 800; }
.upRow > span:first-child { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.upNote { margin: 12px 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.onoff { font-size: 12px; font-weight: 900; padding: 3px 9px; border-radius: 8px; background: var(--pill); color: var(--ink-2); }
.onoff.on { background: var(--good-bg); color: var(--good); }

.lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(28, 24, 51, 0.88); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px; }
.lbBar { width: min(900px, 100%); display: flex; align-items: center; gap: 10px; color: #fff; }
.lbInfo { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; color: #C9C3D8; }
.lbInfo b { font-size: 16px; color: #fff; }
.lightbox img { flex: 1; min-height: 0; max-width: 100%; object-fit: contain; border-radius: 16px; border: 2px solid #fff; background: #fff; }
.lbHint { margin: 0; font-size: 13px; color: #C9C3D8; }

@media (max-width: 1180px) {
  .userPanel { position: fixed; right: 0; top: var(--top, 72px); bottom: 0; z-index: 8; box-shadow: -8px 0 24px rgba(28, 24, 51, 0.15); }
}
@media (max-width: 900px) {
  .threads { width: 100%; border-right: 0; }
  .inbox.open .threads { display: none; }
  .inbox:not(.open) .threadPane { display: none; }
  .iconBtn.back { display: grid; border: 0; }
  .threadHead { padding: 10px 12px; gap: 10px; min-height: 0; }
  .threadHead .avatar.lg { display: none; }
  #thClose { padding: 0 10px; }
  #thClose .lbl { display: none; }
  .thMeta { display: none; }
  .msgList { padding: 16px 14px; }
  .composer { padding: 10px 12px 12px; }
  .shortcut { display: none; }
  .userPanel { left: 0; width: auto; top: auto; max-height: 80dvh; border-left: 0; border-top: 2px solid var(--ink); border-radius: 22px 22px 0 0; }
  .tiles.three { grid-template-columns: 1fr; }
}

@media (max-width: 1000px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-135, .grid-push { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top { height: auto; flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  nav { order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 0 12px 2px; overflow-x: auto; gap: 4px; }
  .tab { height: 36px; padding: 0 12px; font-size: 14px; flex-shrink: 0; white-space: nowrap; }
  .who { order: 2; }
  .whoEmail { display: none; }
  main { padding-top: 20px; }
  h1 { font-size: 28px; }
  .kpis { grid-template-columns: 1fr; }
  .big { font-size: 40px; }
  .funnel { flex-direction: column; gap: 14px; }
  .arrow { display: none; }
  .tiles { grid-template-columns: 1fr; }
  .choices, .formActions, .money { flex-direction: column; }
  .search { width: 100%; }
  .card { padding: 18px; }
}
