/* Цвета берутся из темы Telegram пользователя; значения после запятой — запасные для браузера. */
:root {
  --bg: var(--tg-theme-secondary-bg-color, #0f1115);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #1a1d24));
  --text: var(--tg-theme-text-color, #eef0f4);
  --hint: var(--tg-theme-hint-color, #8b93a3);
  --link: var(--tg-theme-link-color, #6ea8ff);
  --accent: var(--tg-theme-button-color, #4f8cff);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --danger: var(--tg-theme-destructive-text-color, #ff5a5f);
  --sep: var(--tg-theme-section-separator-color, rgba(140, 150, 170, .18));
  --header: var(--tg-theme-header-bg-color, var(--bg));
  --ok: #2fb36b;
  --warn: #e8a317;
  --soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --soft-ok: color-mix(in srgb, var(--ok) 16%, transparent);
  --soft-warn: color-mix(in srgb, var(--warn) 18%, transparent);
  --soft-danger: color-mix(in srgb, var(--danger) 15%, transparent);
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: light) {
  :root:not(.tg) {
    --bg: #f1f2f6; --card: #ffffff; --text: #14161b; --hint: #6b7280; --sep: rgba(20, 22, 27, .09);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh;
  padding-bottom: calc(74px + var(--safe-b));
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--link); text-decoration: none; }
[hidden] { display: none !important; }

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px 10px; background: var(--header);
  border-bottom: 1px solid var(--sep);
}
.topbar-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.topbar-title > span:first-child { font-size: 20px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--soft); color: var(--accent); white-space: nowrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 6px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  background: var(--soft-ok); color: var(--ok);
}
.pill.off { background: var(--soft-danger); color: var(--danger); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- контент ---------- */
.view { padding: 12px 12px 8px; max-width: 760px; margin: 0 auto; }
.section-title { font-size: 13px; font-weight: 600; color: var(--hint); text-transform: uppercase; letter-spacing: .04em; margin: 18px 6px 8px; }
.section-title:first-child { margin-top: 4px; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.card.tap { transition: transform .12s ease; }
.card.tap:active { transform: scale(.985); }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--hint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.pre { white-space: pre-wrap; word-break: break-word; }
.empty { text-align: center; color: var(--hint); padding: 48px 20px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ---------- чипы, сегменты ---------- */
.num { font-weight: 700; font-variant-numeric: tabular-nums; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--sep); color: var(--hint); white-space: nowrap; }
.chip.new { background: var(--soft); color: var(--accent); }
.chip.in_progress, .chip.pending, .chip.scheduled, .chip.sending, .chip.draft { background: var(--soft-warn); color: var(--warn); }
.chip.answered, .chip.approved, .chip.done, .chip.open { background: var(--soft-ok); color: var(--ok); }
.chip.rejected, .chip.cancelled, .chip.closed, .chip.banned { background: var(--soft-danger); color: var(--danger); }
.segments { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 10px; margin: 0 -2px; }
.segments::-webkit-scrollbar { display: none; }
.segments button { flex-shrink: 0; padding: 7px 12px; border-radius: 99px; background: var(--card); font-size: 13.5px; font-weight: 500; color: var(--hint); }
.segments button.active { background: var(--accent); color: var(--accent-text); }
.segments button .c { opacity: .75; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- формы ---------- */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: var(--hint); margin: 0 4px 6px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--sep);
  background: var(--bg); outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 88px; }
.search { position: relative; margin-bottom: 10px; }
.search .input { padding-left: 36px; background: var(--card); border-color: transparent; }
.search::before { content: "🔍"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .55; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--sep); position: relative; flex-shrink: 0; transition: background .2s; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 14px; border-radius: 12px; font-weight: 600; font-size: 14.5px; background: var(--soft); color: var(--accent); transition: opacity .15s, transform .1s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.danger { background: var(--soft-danger); color: var(--danger); }
.btn.ok { background: var(--soft-ok); color: var(--ok); }
.btn.ghost { background: transparent; color: var(--hint); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btns .btn { flex: 1 1 auto; }
.fab { position: fixed; right: 16px; bottom: calc(84px + var(--safe-b)); z-index: 15; width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 28px; font-weight: 300; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent); display: grid; place-items: center; }

/* ---------- обращения ---------- */
.ticket-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ticket-head .num { font-size: 16px; }
.ticket-head .who { flex: 1; min-width: 0; font-size: 13.5px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--hint); }
.queue-pos { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--bg); font-size: 12px; font-weight: 700; color: var(--hint); }
.bubble { background: var(--bg); border-radius: 12px; padding: 12px; }
.bubble.answer { background: var(--soft-ok); }
.quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 8px 0; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex-shrink: 0; padding: 6px 10px; border-radius: 99px; background: var(--bg); font-size: 12.5px; color: var(--hint); }

/* ---------- мероприятия ---------- */
.meter { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.kv { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--hint); }
.kv dd { margin: 0; word-break: break-word; }
.field-row { background: var(--bg); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.field-row .row { gap: 6px; }
.field-row .input { background: var(--card); padding: 9px 10px; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--card); color: var(--hint); flex-shrink: 0; }

/* ---------- ещё ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 92px; }
.tile i { font-style: normal; font-size: 24px; }
.tile b { font-weight: 600; }
.tile small { color: var(--hint); font-size: 12.5px; }
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--sep); }
.list-item:last-child { border-bottom: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex-shrink: 0; font-size: 15px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--link); font-weight: 500; margin: 2px 4px 10px; }

/* ---------- статистика ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.kpi { background: var(--card); border-radius: var(--radius); padding: 14px; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12.5px; color: var(--hint); margin-top: 2px; }
.kpi .s { font-size: 12px; color: var(--ok); margin-top: 4px; font-weight: 600; }
.chart { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-top: 18px; border-bottom: 1px solid var(--sep); }
.chart .bar { flex: 1; position: relative; height: 100%; display: flex; align-items: flex-end; }
.chart .bar i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; transition: opacity .15s; }
.chart .bar.zero i { background: var(--sep); height: 2px !important; border-radius: 2px; }
.chart:hover .bar i, .chart.touched .bar i { opacity: .45; }
.chart .bar:hover i, .chart .bar.on i { opacity: 1; }
.chart .tip { position: absolute; top: -4px; transform: translateX(-50%); background: var(--text); color: var(--card); font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 2; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--hint); margin-top: 6px; }
.status-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; margin: 10px 0 8px; background: var(--bg); }
.status-bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--hint); }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--c); }

/* ---------- нижняя навигация ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; padding: 6px 6px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--sep);
}
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; border-radius: 12px; color: var(--hint); font-size: 11px; font-weight: 500; position: relative; }
.tabbar button i { font-style: normal; font-size: 21px; line-height: 1; filter: grayscale(1); opacity: .7; transition: .15s; }
.tabbar button.active { color: var(--accent); }
.tabbar button.active i { filter: none; opacity: 1; }
.tabbar .dot { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* ---------- шторка ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); animation: fade .2s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto;
  background: var(--card); border-radius: 20px 20px 0 0; padding: 8px 16px calc(20px + var(--safe-b));
  animation: up .25s cubic-bezier(.2, .9, .3, 1); max-width: 760px; margin: 0 auto;
}
.sheet .card { background: var(--bg); }
.sheet .input { background: var(--bg); }
.sheet-grip { width: 38px; height: 5px; border-radius: 99px; background: var(--sep); margin: 2px auto 12px; }
.sheet h2 { font-size: 19px; margin: 0 0 4px; letter-spacing: -.01em; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(88px + var(--safe-b)); transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--card); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: up .2s ease; }

.loader { display: flex; justify-content: center; gap: 6px; padding: 60px 0; }
.loader span { width: 8px; height: 8px; border-radius: 50%; background: var(--hint); animation: blink 1s infinite ease-in-out; }
.loader span:nth-child(2) { animation-delay: .15s; } .loader span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.live-card { background: linear-gradient(135deg, color-mix(in srgb, #ff3b5c 22%, var(--card)), var(--card)); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff3b5c; box-shadow: 0 0 0 0 rgba(255, 59, 92, .6); animation: pulse 1.6s infinite; flex-shrink: 0; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 59, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0); } }
.progress { height: 4px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--ok); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- подсказки ---------- */
.help-btn { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--accent); font-weight: 700; font-size: 15px; display: grid; place-items: center; }
.help-dot { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--soft); color: var(--accent); font-size: 11px; font-weight: 700; margin-left: 6px; vertical-align: 1px; text-transform: none; letter-spacing: 0; }
.tip-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; margin-bottom: 10px; border-radius: var(--radius); background: var(--soft); color: var(--text); }
.tip-card > span { font-size: 18px; line-height: 1.2; }
.tip-x { color: var(--hint); width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; }
.help-body { font-size: 14.5px; line-height: 1.5; }
.help-body p { margin: 8px 0; }
.help-body ul, .help-body ol { margin: 8px 0; padding-left: 20px; }
.help-body li { margin: 6px 0; }

/* ---------- шаблоны и конструктор ---------- */
.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px; border-radius: var(--radius); background: var(--bg); }
.tpl i { font-style: normal; font-size: 28px; }
.tpl b { display: block; font-size: 15.5px; }
.tpl small { color: var(--hint); font-size: 13px; }
.tpl:active { transform: scale(.985); }
.ftype { font-size: 12.5px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: var(--card); color: var(--hint); }
.field-row { background: var(--card); }
.field-row .input { background: var(--bg); }
.icon-btn:disabled { opacity: .3; }
.add-field { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.add-field button { padding: 8px 12px; border-radius: 99px; border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); font-size: 13.5px; font-weight: 600; }
.add-field button::before { content: "＋ "; }
.sticky-actions { position: sticky; bottom: calc(70px + var(--safe-b)); display: flex; gap: 8px; padding: 10px 0 4px; margin-top: 14px; background: linear-gradient(transparent, var(--bg) 30%); z-index: 5; }

/* ---------- предпросмотр диалога ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--bg); }
.msg { max-width: 86%; padding: 9px 12px; border-radius: 16px; font-size: 14px; line-height: 1.4; }
.msg.bot { align-self: flex-start; background: var(--card); border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 6px; }
.msg-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.msg-btns span { flex: 1 1 100%; text-align: center; padding: 7px 8px; border-radius: 9px; background: var(--soft); color: var(--accent); font-size: 13px; font-weight: 500; }
.sheet .chat .msg.bot { background: var(--card); box-shadow: 0 1px 0 var(--sep); }

/* ---------- турнирная сетка ---------- */
.mode-opt { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.mode-opt input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex-shrink: 0; }
.bracket { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; }
.br-col { flex: 0 0 220px; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; scroll-snap-align: start; }
.br-title { font-size: 12px; font-weight: 700; color: var(--hint); text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.br-match { background: var(--card); border-radius: 12px; overflow: hidden; cursor: pointer; border: 1.5px solid transparent; position: relative; }
.br-match.ready { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.br-match.bye { opacity: .6; cursor: default; }
.pl { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 13.5px; font-weight: 500; }
.pl + .pl { border-top: 1px solid var(--sep); }
.pl small { display: block; font-size: 11px; color: var(--hint); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.pl.win { background: var(--soft-ok); }
.pl.lose { opacity: .5; }
.pl.empty { color: var(--hint); font-style: italic; font-weight: 400; }
.br-score { position: absolute; right: 8px; bottom: 4px; font-size: 11px; color: var(--hint); }
.champ { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, color-mix(in srgb, #f5c542 25%, var(--card)), var(--card)); }
.champ > span { font-size: 30px; }
.chip.twitch { background: color-mix(in srgb, #9146ff 20%, transparent); color: #a970ff; }
.twitch-card { border: 1px solid color-mix(in srgb, #9146ff 40%, transparent); }
.steps { margin: 0 0 12px; padding-left: 20px; line-height: 1.5; }
.steps li { margin: 4px 0; }

.add-field.presets button { border-style: solid; background: var(--soft); }
.add-field.presets button::before { content: ""; }

/* ---------- формат «Пары» ---------- */
.pair-card { cursor: pointer; border: 1.5px solid transparent; }
.pair-card.now { border-color: #ff4d6a; }
.pair-card.next { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.pair-no { font-size: 12.5px; font-weight: 700; color: var(--hint); text-transform: uppercase; letter-spacing: .05em; }
.pair-st { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--sep); color: var(--hint); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.pair-st.now { background: #ff4d6a; color: #fff; }
.pair-st.next { background: var(--accent); color: var(--accent-text); }
.pair-st.done { background: var(--soft-ok); color: var(--ok); }
.pp-box { background: var(--bg); border-radius: 12px; overflow: hidden; position: relative; }
.pp { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.pp + .pp, .pp-vs + .pp { border-top: 1px solid var(--sep); }
.pp small { display: block; font-size: 12px; color: var(--hint); }
.pp.win { background: var(--soft-ok); box-shadow: inset 4px 0 0 var(--ok); }
.pp.lose { opacity: .45; }
.pp.empty { color: var(--hint); font-style: italic; font-size: 13px; }
.pp-win { font-size: 11.5px; font-weight: 800; color: var(--ok); white-space: nowrap; }
.pp-vs { position: absolute; left: 62%; top: 50%; transform: translate(-50%, -50%); font-size: 10.5px; font-weight: 800; color: var(--hint); background: var(--card); border: 1px solid var(--sep); border-radius: 99px; padding: 3px 7px; z-index: 1; }

/* ---------- время и секундомер в паре ---------- */
.pair-card { cursor: default; }
.tm { width: 76px; flex-shrink: 0; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px;
  padding: 8px 6px; border-radius: 10px; border: 1.5px solid var(--sep); background: var(--card); color: var(--text); outline: none; }
.tm:focus { border-color: var(--accent); }
.pp.win .tm { border-color: color-mix(in srgb, var(--ok) 60%, transparent); color: var(--ok); }
.tm.flash { animation: flash .9s ease; }
@keyframes flash { 0% { background: var(--soft-ok); border-color: var(--ok); } 100% { background: var(--card); } }
.pp .pp-win { font-size: 10.5px; padding: 2px 6px; border-radius: 99px; background: var(--soft-ok); vertical-align: 2px; }
.sw { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding: 8px; border-radius: 12px; background: var(--bg); }
.sw .sw-open { display: none; }
.sw.collapsed { background: none; padding: 0; }
.sw.collapsed > :not(.sw-open) { display: none; }
.sw.collapsed .sw-open { display: inline-flex; padding: 7px 11px; border-radius: 10px; background: var(--soft); color: var(--accent); font-weight: 600; font-size: 13px; }
.sw-time { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; min-width: 96px; padding: 0 4px; }
.sw.running .sw-time { color: #ff4d6a; }
.sw-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 16px; display: grid; place-items: center; }
.sw-btn[data-sw-act="reset"] { background: var(--sep); color: var(--text); }
.sw.running .sw-btn[data-sw-act="toggle"] { background: #ff4d6a; color: #fff; }
.sw-to { padding: 7px 10px; border-radius: 10px; background: var(--soft); color: var(--accent); font-size: 12.5px; font-weight: 600; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-open { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.bracket-open .grow { display: flex; flex-direction: column; gap: 3px; }
.bracket-open .progress { margin-top: 6px; }
.bo-icon { font-size: 28px; }
.bo-go { color: var(--accent); font-weight: 700; font-size: 14px; white-space: nowrap; }
[data-open-br] { cursor: pointer; }
