:root {
  --bg: var(--tg-theme-bg-color, #fff);
  --bg2: var(--tg-theme-secondary-bg-color, #f2f3f5);
  --text: var(--tg-theme-text-color, #111);
  --hint: var(--tg-theme-hint-color, #888);
  --link: var(--tg-theme-link-color, #2a7ae2);
  --btn: var(--tg-theme-button-color, #2a7ae2);
  --btn-text: var(--tg-theme-button-text-color, #fff);
  --danger: #d9443a;
  --ok: #2e9d57;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.4 -apple-system, system-ui, Segoe UI, Roboto, sans-serif; background: var(--bg2); color: var(--text); }
header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 4px; }
.title { font-weight: 700; font-size: 18px; }
nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; position: sticky; top: 0; background: var(--bg2); z-index: 5; scrollbar-width: none; }
nav button { flex: none; border: 0; border-radius: 20px; padding: 7px 12px; background: var(--bg); color: var(--text); font-size: 14px; }
nav button.active { background: var(--btn); color: var(--btn-text); }
main { padding: 4px 10px 80px; }
.card { background: var(--bg); border-radius: var(--radius); padding: 12px; margin: 8px 0; }
.card h3 { margin: 0 0 6px; font-size: 15px; }
.muted { color: var(--hint); font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.chip { display: inline-block; padding: 3px 9px; border-radius: 14px; background: var(--bg2); font-size: 12px; margin: 2px 2px 2px 0; }
.chip.on { background: var(--btn); color: var(--btn-text); }
button.b { border: 0; border-radius: 10px; padding: 9px 14px; font-size: 14px; background: var(--btn); color: var(--btn-text); }
button.b.ghost { background: var(--bg2); color: var(--text); }
button.b.danger { background: var(--danger); color: #fff; }
button.b.ok { background: var(--ok); color: #fff; }
button.b:disabled { opacity: .5; }
input, textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--bg2); border: 1px solid transparent; border-radius: 10px; padding: 8px 10px; }
textarea { min-height: 90px; resize: vertical; }
textarea.tall { min-height: 260px; font-size: 13px; }
label { display: block; font-size: 12px; color: var(--hint); margin: 10px 0 4px; }
.badge { background: var(--danger); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; }
.badge:empty { display: none; }
.kanban { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.col { flex: 0 0 240px; background: var(--bg); border-radius: var(--radius); padding: 8px; }
.col h4 { margin: 2px 4px 8px; font-size: 13px; text-transform: capitalize; }
.mini { background: var(--bg2); border-radius: 10px; padding: 8px; margin-bottom: 6px; font-size: 13px; }
.mini b { display: block; margin-bottom: 2px; }
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; display: flex; align-items: flex-end; }
.sheet-body { background: var(--bg); width: 100%; max-height: 88vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 16px; }
.hidden { display: none !important; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 9px 14px; border-radius: 10px; z-index: 30; font-size: 14px; max-width: 90%; }
.hl { outline: 2px solid var(--btn); }
pre { white-space: pre-wrap; font: 13px/1.4 inherit; margin: 6px 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td, th { padding: 5px 4px; text-align: left; border-bottom: 1px solid var(--bg2); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #ccc; border-radius: 26px; transition: .2s; }
.switch span:before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span:before { transform: translateX(18px); }
