/* Four «Задачи» (Phase 2b). Calm first screen. Design (2b, by request): clean light Yandex-like style: light-grey background,
   white cards with big radii and soft shadows, yellow accent with dark ink, system sans (no web font: first-screen speed).
   Only applies under html.tm-on (the flagged document); the legacy game CSS is never needed for this screen. */
html.tm-on {
  --tm-bg: #F3F4F6; --tm-surface: #FFFFFF; --tm-surface-2: #EEEFF2; --tm-line: #ECEDF0; --tm-line-2: #D8DADF;
  --tm-text: #21201F; --tm-text-2: #6E6F75; --tm-text-3: #A0A2A8;
  --tm-primary: #FFDB4D; --tm-primary-ink: #21201F; --tm-primary-soft: rgba(255, 210, 50, .26); --tm-primary-text: #21201F;
  --tm-chip-on: #21201F; --tm-chip-on-ink: #FFFFFF; --tm-info: #2F76F0;
  --tm-accent: #FC3F1D; --tm-error: #E5352B; --tm-success: #1FA45A;
  --tm-p3: #F0412A; --tm-p2: #FF9A00; --tm-p1: #2F76F0; --tm-p0: #B8BAC0;
  --tm-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 18px rgba(0, 0, 0, .06);
  --tm-shadow-2: 0 14px 44px rgba(0, 0, 0, .18);
  --tm-radius: 20px;
  --tm-font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --tm-tabs-h: 58px;
  --tm-kb: 0px;
  background: var(--tm-bg);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  html.tm-on:not([data-theme="light"]) {
    --tm-bg: #141416; --tm-surface: #222225; --tm-surface-2: #2C2C30; --tm-line: #303035; --tm-line-2: #42424A;
    --tm-text: #F2F2F3; --tm-text-2: #A6A7AD; --tm-text-3: #74757C;
    --tm-primary-soft: rgba(255, 219, 77, .16); --tm-primary-text: #FFDB4D; --tm-p0: #66676E;
    --tm-chip-on: #F2F2F3; --tm-chip-on-ink: #141416; --tm-info: #5B97FF;
    --tm-shadow: 0 1px 2px rgba(0, 0, 0, .3); --tm-shadow-2: 0 14px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
html.tm-on[data-theme="dark"] {
  --tm-bg: #141416; --tm-surface: #222225; --tm-surface-2: #2C2C30; --tm-line: #303035; --tm-line-2: #42424A;
  --tm-text: #F2F2F3; --tm-text-2: #A6A7AD; --tm-text-3: #74757C;
  --tm-primary-soft: rgba(255, 219, 77, .16); --tm-primary-text: #FFDB4D; --tm-p0: #66676E;
  --tm-chip-on: #F2F2F3; --tm-chip-on-ink: #141416; --tm-info: #5B97FF;
  --tm-shadow: 0 1px 2px rgba(0, 0, 0, .3); --tm-shadow-2: 0 14px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
html.tm-on:not(.tm-legacy) body { margin: 0; background: var(--tm-bg); }
html.tm-on.tm-root-on body { overflow: hidden; }

#tm-root { display: none; }
html.tm-on.tm-root-on #tm-root { display: block; }
#tm-root {
  position: fixed; inset: 0; z-index: 9000; background: var(--tm-bg); color: var(--tm-text);
  font: 400 15px/1.4 var(--tm-font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none; touch-action: manipulation;
}
#tm-root *, #tm-root *::before, #tm-root *::after { box-sizing: border-box; }
/* reset (beats the legacy game CSS once it is loaded: its input/textarea/select rules are global) */
#tm-root button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; width: auto; min-height: 0; border-radius: 0; box-shadow: none; text-transform: none; letter-spacing: normal; }
#tm-root input, #tm-root textarea, #tm-root select { font: inherit; color: var(--tm-text); margin: 0; width: auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; -webkit-user-select: text; user-select: text; }
#tm-root [hidden] { display: none !important; }
#tm-root svg { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tm-root .tm-app { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* header */
#tm-root .tm-head { padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 6px; display: flex; align-items: center; gap: 8px; }
#tm-root .tm-head-t { flex: 1; min-width: 0; }
#tm-root .tm-h1 { margin: 0; font: 800 26px/1.15 var(--tm-font); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tm-root .tm-sub { margin: 2px 0 0; color: var(--tm-text-2); font-size: 13px; first-letter: uppercase; }
#tm-root .tm-ibtn { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--tm-text-2); }
#tm-root .tm-ibtn:active { background: var(--tm-surface-2); }
#tm-root .tm-search { flex: 1; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; background: var(--tm-surface); border: 1px solid var(--tm-line); }
#tm-root .tm-search input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; font-size: 16px; }

/* view pills */
#tm-root .tm-views { display: flex; gap: 6px; padding: 4px 16px 10px; overflow-x: auto; scrollbar-width: none; }
#tm-root .tm-views::-webkit-scrollbar { display: none; }
#tm-root .tm-pill { flex: none; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--tm-surface); border: 1px solid var(--tm-line) !important;
  color: var(--tm-text-2); font-weight: 650 !important; font-size: 14px !important; display: inline-flex; align-items: center; gap: 6px; }
#tm-root .tm-pill .n { color: var(--tm-text-3); font-weight: 600; font-size: 12px; }
#tm-root .tm-pill.is-on { background: var(--tm-primary); border-color: var(--tm-primary) !important; color: var(--tm-primary-ink); }
#tm-root .tm-pill.is-on .n { color: rgba(255, 255, 255, .75); }
#tm-root .tm-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--tm-text-3)); }

/* list */
#tm-root .tm-main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 12px calc(var(--tm-tabs-h) + env(safe-area-inset-bottom, 0px) + 96px); overscroll-behavior: contain; }
#tm-root .tm-sec { margin: 6px 0 14px; }
#tm-root .tm-sec-h { display: flex; align-items: center; gap: 8px; padding: 8px 6px 6px; color: var(--tm-text-2); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
#tm-root .tm-sec-h .n { color: var(--tm-text-3); font-weight: 600; }
#tm-root .tm-sec-h.is-over { color: var(--tm-error); }
#tm-root .tm-sec-h button { margin-left: auto; color: var(--tm-primary-text); font-weight: 650; font-size: 13px; }
#tm-root .tm-sec-list { background: var(--tm-surface); border-radius: var(--tm-radius); box-shadow: var(--tm-shadow); overflow: hidden; }
#tm-root .tm-task { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 11px 6px 11px 12px; min-height: 52px; background: var(--tm-surface);
  border-top: 1px solid var(--tm-line); transition: opacity .25s ease, transform .2s ease; }
#tm-root .tm-task:first-child { border-top: 0; }
#tm-root .tm-task.is-drag { z-index: 2; box-shadow: var(--tm-shadow-2); transition: none; border-radius: 10px; }
#tm-root .tm-task.is-leaving { opacity: .35; }
#tm-root .tm-check { width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--tm-p0) !important; flex: none; position: relative; }
#tm-root .tm-task.p1 .tm-check { border-color: var(--tm-p1) !important; background: rgba(47, 118, 240, .07) !important; }
#tm-root .tm-task.p2 .tm-check { border-color: var(--tm-p2) !important; background: rgba(255, 154, 0, .09) !important; }
#tm-root .tm-task.p3 .tm-check { border-color: var(--tm-p3) !important; background: rgba(240, 65, 42, .08) !important; }
#tm-root .tm-check::after { content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid transparent; border-width: 0 2px 2px 0; transform: rotate(45deg); }
#tm-root .tm-task.is-done .tm-check, #tm-root .tm-item.is-done .tm-check { background: var(--tm-primary) !important; border-color: var(--tm-primary) !important; }
#tm-root .tm-task.is-done .tm-check::after, #tm-root .tm-item.is-done .tm-check::after { border-color: var(--tm-primary-ink); }
#tm-root .tm-check::before { content: ''; position: absolute; inset: -11px; }
#tm-root .tm-tbody { flex: 1; min-width: 0; cursor: pointer; }
#tm-root .tm-title { font-size: 15.5px; line-height: 1.35; word-wrap: break-word; overflow-wrap: anywhere; }
#tm-root .tm-task.is-done .tm-title { color: var(--tm-text-3); text-decoration: line-through; }
#tm-root .tm-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; color: var(--tm-text-3); font-size: 12.5px; align-items: center; }
#tm-root .tm-meta span { display: inline-flex; align-items: center; gap: 3px; }
#tm-root .tm-meta svg { width: 13px !important; height: 13px !important; }
#tm-root .tm-meta .is-over { color: var(--tm-error); font-weight: 650; }
#tm-root .tm-meta .is-today { color: var(--tm-primary-text); font-weight: 650; }
#tm-root .tm-meta .ldot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
#tm-root .tm-pickn { flex: none; align-self: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--tm-primary-soft); color: var(--tm-primary-text);
  font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
#tm-root .tm-drag { flex: none; align-self: center; width: 32px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--tm-text-3); touch-action: none; cursor: grab; }
#tm-root .tm-drag svg { width: 18px !important; height: 18px !important; }
#tm-root .tm-sel { flex: none; align-self: center; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--tm-line-2) !important; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--tm-primary-ink); }
#tm-root .tm-sel.is-on { background: var(--tm-primary) !important; border-color: var(--tm-primary) !important; }
#tm-root .tm-empty { text-align: center; color: var(--tm-text-2); padding: 48px 24px 24px; }
#tm-root .tm-empty b { display: block; color: var(--tm-text); font-size: 17px; margin-bottom: 6px; }
#tm-root .tm-empty .art { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px; background: var(--tm-primary-soft); color: var(--tm-primary-text); display: flex; align-items: center; justify-content: center; }
#tm-root .tm-empty .art svg { width: 34px; height: 34px; }

/* banners and cards */
#tm-root .tm-card { margin: 4px 0 14px; padding: 14px; border-radius: var(--tm-radius); background: var(--tm-surface); box-shadow: var(--tm-shadow); }
#tm-root .tm-card-h { display: flex; align-items: center; gap: 8px; font-weight: 750; }
#tm-root .tm-card-h .tag { margin-left: auto; font-size: 12.5px; color: var(--tm-text-2); font-weight: 650; }
#tm-root .tm-card p { margin: 6px 0 0; color: var(--tm-text-2); font-size: 13.5px; }
#tm-root .tm-card .row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
#tm-root .tm-btn { height: 40px; padding: 0 16px; border-radius: 11px; font-weight: 700 !important; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#tm-root .tm-btn.pri { background: var(--tm-primary) !important; color: var(--tm-primary-ink) !important; }
#tm-root .tm-btn.sec { background: var(--tm-surface-2) !important; color: var(--tm-text) !important; }
#tm-root .tm-btn.ghost { color: var(--tm-text-2) !important; }
#tm-root .tm-btn.danger { color: var(--tm-error) !important; background: rgba(240, 65, 42, .08) !important; }
#tm-root .tm-btn:disabled { opacity: .5; }
#tm-root .tm-disc { border: 1px solid var(--tm-line); }
#tm-root .tm-disc .bar { height: 6px; border-radius: 3px; background: var(--tm-surface-2); margin-top: 10px; overflow: hidden; }
#tm-root .tm-disc .bar i { display: block; height: 100%; background: var(--tm-primary); border-radius: inherit; }
#tm-root .tm-disc .picks { margin-top: 8px; }
#tm-root .tm-disc .picks .tm-task { padding-left: 0; border-top-color: var(--tm-line); min-height: 44px; }
#tm-root .tm-disc .hint { margin-top: 8px; font-size: 13px; color: var(--tm-text-2); display: flex; gap: 6px; align-items: center; }
#tm-root .tm-disc .hint svg { width: 15px; height: 15px; }
#tm-root .tm-disc.is-closed { border-color: rgba(31, 164, 90, .45); }
#tm-root .tm-flame { color: var(--tm-accent); }

/* floating add */
#tm-root .tm-fab { position: absolute; right: 18px; bottom: calc(var(--tm-tabs-h) + env(safe-area-inset-bottom, 0px) + 16px); width: 56px; height: 56px; border-radius: 18px;
  background: var(--tm-primary) !important; color: var(--tm-primary-ink) !important; box-shadow: 0 8px 24px rgba(0, 0, 0, .16); display: flex; align-items: center; justify-content: center; z-index: 5; }
#tm-root .tm-fab svg { width: 28px !important; height: 28px !important; stroke-width: 2.2 !important; }
#tm-root .tm-fab:active { transform: scale(.96); }

/* bottom tabs (same 4 places as the game: Задачи · Прогресс · Играть · Люди) */
#tm-root .tm-tabs { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tm-tabs-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; background: var(--tm-surface); border-top: 1px solid var(--tm-line); z-index: 6; }
#tm-root .tm-tab { flex: 1; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--tm-text-3) !important; font-size: 11.5px !important; font-weight: 650 !important; }
#tm-root .tm-tab.is-on { color: var(--tm-primary-text) !important; }

/* quick add */
#tm-root .tm-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .36); z-index: 20; opacity: 0; transition: opacity .18s ease; }
#tm-root .tm-scrim.is-on { opacity: 1; }
#tm-root .tm-quick { position: absolute; left: 0; right: 0; bottom: var(--tm-kb); z-index: 21; background: var(--tm-surface); border-radius: 18px 18px 0 0; box-shadow: var(--tm-shadow-2);
  padding: 12px 12px calc(env(safe-area-inset-bottom, 0px) + 10px); }
#tm-root .tm-q-row { display: flex; gap: 8px; align-items: center; }
#tm-root .tm-q-in { flex: 1; min-width: 0; height: 46px; border-radius: 12px; border: 1px solid var(--tm-line) !important; background: var(--tm-bg) !important; padding: 0 12px; font-size: 16px !important; outline: 0; }
#tm-root .tm-q-in:focus { border-color: var(--tm-primary) !important; }
#tm-root .tm-q-send { width: 46px; height: 46px; border-radius: 14px; background: var(--tm-primary) !important; color: var(--tm-primary-ink) !important; display: flex; align-items: center; justify-content: center; }
#tm-root .tm-q-send:disabled { opacity: .45; }
#tm-root .tm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 0; }
#tm-root .tm-chip { height: 28px; padding: 0 6px 0 10px; border-radius: 8px; background: var(--tm-primary-soft) !important; color: var(--tm-primary-text) !important; font-size: 13px !important; font-weight: 650 !important;
  display: inline-flex; align-items: center; gap: 4px; }
#tm-root .tm-chip.p3 { background: rgba(240, 65, 42, .10) !important; color: var(--tm-p3) !important; }
#tm-root .tm-chip.p2 { background: rgba(255, 154, 0, .14) !important; color: #B86A00 !important; }
#tm-root .tm-chip.p1 { background: rgba(47, 118, 240, .10) !important; color: var(--tm-p1) !important; }
#tm-root .tm-chip .x { opacity: .6; font-size: 15px; padding: 0 2px; }
#tm-root .tm-q-tools { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
#tm-root .tm-q-tools::-webkit-scrollbar { display: none; }
#tm-root .tm-tool { flex: none; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--tm-surface-2) !important; color: var(--tm-text-2) !important; font-size: 13.5px !important; font-weight: 650 !important;
  display: inline-flex; align-items: center; gap: 5px; position: relative; }
#tm-root .tm-tool svg { width: 16px !important; height: 16px !important; }
#tm-root .tm-tool.is-on { background: var(--tm-primary-soft) !important; color: var(--tm-primary-text) !important; }
#tm-root .tm-tool input[type="date"] { position: absolute; inset: 0; opacity: 0; width: 100%; }
#tm-root .tm-q-hint { margin: 8px 2px 0; color: var(--tm-text-3); font-size: 12px; }

/* sheets */
#tm-root .tm-sheet { position: absolute; left: 0; right: 0; bottom: 0; top: calc(env(safe-area-inset-top, 0px) + 28px); z-index: 30; background: var(--tm-bg); border-radius: 18px 18px 0 0;
  box-shadow: var(--tm-shadow-2); display: flex; flex-direction: column; transform: translateY(0); transition: transform .22s ease; }
#tm-root .tm-sheet.is-in { transform: translateY(100%); }
#tm-root .tm-sheet-h { display: flex; align-items: center; gap: 6px; padding: 8px 8px 4px 8px; }
#tm-root .tm-sheet-h .grab { position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--tm-line-2); }
#tm-root .tm-sheet-h .t { flex: 1; font-weight: 750; font-size: 16px; padding-left: 6px; }
#tm-root .tm-sheet-b { flex: 1; overflow-y: auto; padding: 4px 14px calc(env(safe-area-inset-bottom, 0px) + 24px); }
#tm-root .tm-d-title { width: 100%; border: 0 !important; outline: 0; resize: none; background: transparent !important; font: 750 20px/1.3 var(--tm-font) !important; padding: 6px 2px; overflow: hidden; }
#tm-root .tm-d-check { display: flex; align-items: flex-start; gap: 10px; padding: 4px 2px 8px; }
#tm-root .tm-d-check .tm-check { margin-top: 10px; }
#tm-root .tm-group { background: var(--tm-surface); border-radius: var(--tm-radius); box-shadow: var(--tm-shadow); margin: 10px 0; overflow: hidden; }
#tm-root .tm-field { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 6px 12px; border-top: 1px solid var(--tm-line); }
#tm-root .tm-field:first-child { border-top: 0; }
#tm-root .tm-field > svg { color: var(--tm-text-3); }
#tm-root .tm-field .lab { flex: 1; min-width: 0; color: var(--tm-text-2); font-size: 14.5px; }
#tm-root .tm-field select, #tm-root .tm-field input[type="date"], #tm-root .tm-field input[type="time"], #tm-root .tm-field input[type="text"] {
  border: 0 !important; background: transparent !important; outline: 0; font-size: 15px !important; font-weight: 650; color: var(--tm-text) !important; text-align: right; max-width: 60%; min-height: 36px; }
#tm-root .tm-field input[type="text"] { text-align: left; max-width: none; flex: 1; font-weight: 500; }
#tm-root .tm-field .val { font-weight: 650; }
#tm-root .tm-quickd { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 12px 12px 46px; }
#tm-root .tm-quickd button { height: 30px; padding: 0 10px; border-radius: 8px; background: var(--tm-surface-2) !important; color: var(--tm-text-2) !important; font-size: 13px !important; font-weight: 650 !important; }
#tm-root .tm-seg { display: flex; gap: 6px; }
#tm-root .tm-seg button { height: 32px; min-width: 40px; padding: 0 8px; border-radius: 9px; background: var(--tm-surface-2) !important; font-size: 13px !important; font-weight: 700 !important; color: var(--tm-text-2) !important; }
#tm-root .tm-seg button.is-on { color: #fff !important; }
#tm-root .tm-seg button.is-on.p0 { background: var(--tm-text-3) !important; }
#tm-root .tm-seg button.is-on.p1 { background: var(--tm-p1) !important; }
#tm-root .tm-seg button.is-on.p2 { background: var(--tm-p2) !important; }
#tm-root .tm-seg button.is-on.p3 { background: var(--tm-p3) !important; }
#tm-root .tm-item { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px 6px 4px 12px; border-top: 1px solid var(--tm-line); }
#tm-root .tm-item:first-child { border-top: 0; }
#tm-root .tm-item .tm-check { width: 20px; height: 20px; border-radius: 6px; margin: 0; }
#tm-root .tm-item .tm-check::after { left: 5px; top: 1px; }
#tm-root .tm-item input { flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent !important; font-size: 15px !important; }
#tm-root .tm-item.is-done input { color: var(--tm-text-3) !important; text-decoration: line-through; }
#tm-root .tm-item .del { width: 32px; height: 32px; color: var(--tm-text-3) !important; display: inline-flex; align-items: center; justify-content: center; }
#tm-root .tm-item .del svg { width: 16px !important; height: 16px !important; }
#tm-root .tm-note { width: 100%; min-height: 96px; border: 0 !important; outline: 0; resize: vertical; background: transparent !important; padding: 12px !important; font-size: 15px !important; line-height: 1.45; }
#tm-root .tm-gh { padding: 14px 4px 0; color: var(--tm-text-2); font-size: 13px; font-weight: 700; }
#tm-root .tm-foot { display: flex; gap: 8px; margin-top: 16px; }
#tm-root .tm-foot .tm-btn { flex: 1; }
#tm-root .tm-small { color: var(--tm-text-3); font-size: 12.5px; padding: 8px 4px; }

/* menu */
#tm-root .tm-menu { position: absolute; right: 10px; top: calc(env(safe-area-inset-top, 0px) + 52px); z-index: 40; min-width: 250px; max-width: calc(100% - 20px); max-height: 70vh; overflow-y: auto; background: var(--tm-surface); border-radius: 14px; box-shadow: var(--tm-shadow-2);
  padding: 6px; border: 1px solid var(--tm-line); }
#tm-root .tm-menu button { width: 100%; display: flex !important; align-items: center; gap: 10px; height: 44px; padding: 0 10px; border-radius: 10px; text-align: left; font-size: 15px !important; }
#tm-root .tm-menu button:active { background: var(--tm-surface-2) !important; }
#tm-root .tm-menu button svg { color: var(--tm-text-2); width: 19px !important; height: 19px !important; }
#tm-root .tm-menu button .r { margin-left: auto; color: var(--tm-text-3); font-size: 13px; }
#tm-root .tm-menu hr { border: 0; border-top: 1px solid var(--tm-line); margin: 4px 6px; }

/* toggles */
#tm-root .tm-switch { position: relative; width: 48px; height: 28px; border-radius: 14px; background: var(--tm-line-2) !important; flex: none; transition: background .15s ease; }
#tm-root .tm-switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s ease; }
#tm-root .tm-switch.is-on { background: var(--tm-primary) !important; }
#tm-root .tm-switch.is-on::after { transform: translateX(20px); }

/* discipline sheet */
#tm-root .tm-stats { display: flex; gap: 10px; margin: 10px 0; }
#tm-root .tm-stat { flex: 1; background: var(--tm-surface); border-radius: var(--tm-radius); box-shadow: var(--tm-shadow); padding: 12px; }
#tm-root .tm-stat b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; }
#tm-root .tm-stat span { color: var(--tm-text-2); font-size: 12.5px; }
#tm-root .tm-week { display: flex; justify-content: space-between; padding: 12px; }
#tm-root .tm-wd { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--tm-text-3); font-weight: 650; }
#tm-root .tm-wd i { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--tm-line-2); display: flex; align-items: center; justify-content: center; font-style: normal; color: var(--tm-primary-ink); font-size: 13px; }
#tm-root .tm-wd.done i { background: var(--tm-primary); border-color: var(--tm-primary); }
#tm-root .tm-wd.pass i { border-style: dashed; }
#tm-root .tm-wd.miss i { border-color: rgba(229, 53, 43, .45); }
#tm-root .tm-wd.today i { border-color: var(--tm-primary); }
#tm-root .tm-wd.today { color: var(--tm-primary-text); }
#tm-root .tm-badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px; }
#tm-root .tm-badge { text-align: center; font-size: 11.5px; color: var(--tm-text-3); font-weight: 650; line-height: 1.2; }
#tm-root .tm-badge i { display: flex; width: 46px; height: 46px; margin: 0 auto 6px; border-radius: 14px; background: var(--tm-surface-2); align-items: center; justify-content: center; font-style: normal; font-size: 13px; font-weight: 800; color: var(--tm-text-3); }
#tm-root .tm-badge.got { color: var(--tm-text); }
#tm-root .tm-badge.got i { background: linear-gradient(160deg, #FFE680, #FFC800); color: #21201F; box-shadow: 0 3px 10px rgba(255, 190, 0, .35); }
#tm-root .tm-season { padding: 0 12px 12px; font-size: 13px; color: var(--tm-text-2); }
#tm-root .tm-season .bar { height: 6px; border-radius: 3px; background: var(--tm-surface-2); margin-top: 6px; overflow: hidden; }
#tm-root .tm-season .bar i { display: block; height: 100%; background: var(--tm-accent); }

/* toast + loading */
#tm-root .tm-toast { position: absolute; left: 12px; right: 12px; bottom: calc(var(--tm-tabs-h) + env(safe-area-inset-bottom, 0px) + 84px); z-index: 50; display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 8px 8px 8px 14px; border-radius: 12px; background: #21201F; color: #FFFFFF; box-shadow: var(--tm-shadow-2); font-size: 14px; }
#tm-root .tm-toast span { flex: 1; }
#tm-root .tm-toast button { height: 34px; padding: 0 12px; border-radius: 9px; color: #FFDB4D !important; font-weight: 750 !important; }
#tm-root .tm-loading { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--tm-bg); color: var(--tm-text-2); font-weight: 650; }
#tm-root .tm-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--tm-line-2); border-top-color: var(--tm-primary); animation: tmspin .8s linear infinite; }
@keyframes tmspin { to { transform: rotate(360deg); } }
#tm-root .tm-skel { height: 52px; margin: 8px 0; border-radius: 12px; background: var(--tm-surface); opacity: .7; }
/* ---------- 2b: drawer, subtasks, selection, detail extras ---------- */
#tm-root .tm-burger { margin-left: -8px; }
#tm-root .tm-pill .pi { display: inline-flex; color: var(--tm-text-3); }
#tm-root .tm-pill.is-on .pi { color: rgba(255, 255, 255, .85); }
#tm-root .tm-pill .pi svg { width: 16px; height: 16px; }
#tm-root .tm-node { background: var(--tm-surface); border-top: 1px solid var(--tm-line); }
#tm-root .tm-node:first-child { border-top: 0; }
#tm-root .tm-node > .tm-task { border-top: 0; }
#tm-root .tm-node.is-drag { position: relative; z-index: 2; box-shadow: var(--tm-shadow-2); border-radius: 10px; transition: none; }
#tm-root .tm-subs { padding-left: 26px; }
#tm-root .tm-subs .tm-node { border-top: 1px dashed var(--tm-line); }
#tm-root .tm-task.lvl { min-height: 44px; padding-top: 9px; padding-bottom: 9px; }
#tm-root .tm-task.lvl .tm-check { width: 19px; height: 19px; }
#tm-root .tm-task.lvl .tm-check::after { left: 5px; top: 1px; }
#tm-root .tm-exp { flex: none; align-self: center; width: 30px; height: 34px; display: inline-flex; align-items: center; justify-content: center; color: var(--tm-text-3) !important; }
#tm-root .tm-exp svg { width: 17px !important; height: 17px !important; transition: transform .15s ease; }
#tm-root .tm-exp.is-open svg { transform: rotate(90deg); }
#tm-root .tm-meta .sp { color: var(--tm-text-2); font-weight: 650; }
#tm-root .tm-meta .ctx { color: #7A5EA8; font-weight: 600; }
#tm-root .tm-meta .is-wont { color: var(--tm-text-3); font-style: italic; }
#tm-root .tm-task.is-wont .tm-title { text-decoration: line-through; font-style: italic; }
#tm-root .tm-task.is-wont .tm-check { background: var(--tm-surface-2) !important; border-color: var(--tm-line-2) !important; }
#tm-root .tm-task.is-wont .tm-check::after { border: 0; width: 12px; height: 2px; left: 3px; top: 8px; background: var(--tm-text-3); transform: rotate(-45deg); }
#tm-root .tm-task.is-sel { background: var(--tm-primary-soft) !important; }
#tm-root .tm-sel { flex: none; align-self: center; margin-right: 6px; }
#tm-root .tm-sec-h button[data-act="sec-add"] { font-size: 12.5px; }
#tm-root .tm-btn.sm { height: 32px; padding: 0 12px; font-size: 13px !important; align-self: center; margin-right: 6px; }
#tm-root .tm-mh { padding: 8px 10px 4px; color: var(--tm-text-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
#tm-root .tm-menu button.is-on { color: var(--tm-primary-text); font-weight: 700; }
#tm-root .tm-menu button.is-on svg { color: var(--tm-primary-text); }
#tm-root .tm-q-mic { width: 40px; height: 46px; border-radius: 12px; color: var(--tm-text-2) !important; display: flex; align-items: center; justify-content: center; }
#tm-root .tm-q-mic.is-on { color: var(--tm-error) !important; background: rgba(229, 53, 43, .1) !important; }
#tm-root .tm-chip.ctx { background: rgba(122, 94, 168, .12) !important; color: #7A5EA8 !important; }

/* drawer */
#tm-root .tm-drawer { position: absolute; left: 0; top: 0; bottom: 0; width: min(86%, 340px); z-index: 31; background: var(--tm-bg); box-shadow: var(--tm-shadow-2); display: flex; flex-direction: column;
  transform: translateX(0); transition: transform .22s ease; padding-top: env(safe-area-inset-top, 0px); }
#tm-root .tm-drawer.is-in { transform: translateX(-102%); }
#tm-root #tm-drawer-host > .tm-scrim { z-index: 30; }
#tm-root .tm-dr-top { display: flex; align-items: center; padding: 10px 8px 4px 18px; }
#tm-root .tm-dr-top b { flex: 1; font-size: 20px; font-weight: 800; }
#tm-root .tm-dr-b { flex: 1; overflow-y: auto; padding: 0 10px calc(env(safe-area-inset-bottom, 0px) + 20px); }
#tm-root .tm-dr-h { display: flex; align-items: center; padding: 14px 8px 4px; color: var(--tm-text-3); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
#tm-root .tm-dr-h button { margin-left: auto; width: 30px; height: 26px; display: inline-flex; align-items: center; justify-content: center; color: var(--tm-text-2) !important; }
#tm-root .tm-dr-h button svg { width: 18px; height: 18px; }
#tm-root .tm-dr-g { background: var(--tm-surface); border-radius: var(--tm-radius); box-shadow: var(--tm-shadow); padding: 4px; margin-top: 6px; }
#tm-root .tm-dr-it { width: 100%; display: flex !important; align-items: center; gap: 12px; min-height: 42px; padding: 0 10px; border-radius: 10px; text-align: left; font-size: 15px !important; }
#tm-root .tm-dr-it svg { width: 19px; height: 19px; color: var(--tm-text-2); }
#tm-root .tm-dr-it span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tm-root .tm-dr-it b { color: var(--tm-text-3); font-size: 12.5px; font-weight: 650; }
#tm-root .tm-dr-it.is-on { background: var(--tm-primary-soft) !important; color: var(--tm-primary-text); font-weight: 700; }
#tm-root .tm-dr-it .dot { width: 10px; height: 10px; margin: 0 4.5px; border-radius: 50%; background: var(--c); flex: none; }
#tm-root .tm-dr-it .pj { display: inline-flex; color: var(--tm-primary-text); }
#tm-root .tm-dr-sub { padding-left: 18px; }
#tm-root .tm-dr-hint { padding: 8px 10px; color: var(--tm-text-3); font-size: 13px; }
#tm-root .tm-dr-low { margin-top: 14px; }

/* selection bar */
#tm-root .tm-bulk { position: absolute; left: 8px; right: 8px; bottom: calc(var(--tm-tabs-h) + env(safe-area-inset-bottom, 0px) + 10px); z-index: 7; display: flex; gap: 2px; padding: 6px; border-radius: 16px;
  background: var(--tm-surface); box-shadow: var(--tm-shadow-2); border: 1px solid var(--tm-line); }
#tm-root .tm-bulk button { flex: 1; display: flex !important; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; font-size: 11.5px !important; font-weight: 650 !important; color: var(--tm-text-2) !important; }
#tm-root .tm-bulk button:disabled { opacity: .4; }
#tm-root .tm-bulk button svg { width: 20px; height: 20px; }
#tm-root .tm-bulk input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#tm-root .tm-app.is-sel .tm-main { padding-bottom: calc(var(--tm-tabs-h) + env(safe-area-inset-bottom, 0px) + 110px); }

/* focus mini timer (shown on every view while a pomodoro runs) */
#tm-root .tm-mini { position: absolute; left: 14px; bottom: calc(var(--tm-tabs-h) + env(safe-area-inset-bottom, 0px) + 22px); z-index: 5; height: 44px; padding: 0 14px; border-radius: 22px;
  background: var(--tm-surface) !important; box-shadow: var(--tm-shadow-2); display: flex !important; align-items: center; gap: 8px; font-weight: 750 !important; font-variant-numeric: tabular-nums; color: var(--tm-primary-text) !important; }
#tm-root .tm-mini[hidden] { display: none !important; }
#tm-root .tm-mini svg { width: 18px; height: 18px; }
#tm-root .tm-mini.is-break { color: var(--tm-accent) !important; }

/* detail extras */
#tm-root .tm-crumb { display: inline-flex !important; align-items: center; gap: 6px; margin: 4px 2px 0; padding: 4px 10px; border-radius: 8px; background: var(--tm-surface-2) !important; color: var(--tm-text-2) !important; font-size: 13px !important; max-width: 100%; }
#tm-root .tm-crumb svg { width: 15px; height: 15px; }
#tm-root .tm-gh .n { color: var(--tm-text-3); font-weight: 650; }
#tm-root .tm-subrow .tt { flex: 1; min-width: 0; display: flex !important; flex-direction: column; align-items: flex-start; text-align: left; padding: 6px 0; }
#tm-root .tm-subrow .tt span { font-size: 15px; overflow-wrap: anywhere; }
#tm-root .tm-subrow .tt em { font-style: normal; color: var(--tm-text-3); font-size: 12px; }
#tm-root .tm-subrow.is-done .tt span { color: var(--tm-text-3); text-decoration: line-through; }
#tm-root .tm-subrow .tm-check { border-radius: 50%; }
#tm-root .tm-rems { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px 46px; }
#tm-root .tm-rchip { height: 30px; padding: 0 6px 0 10px; border-radius: 8px; background: var(--tm-primary-soft) !important; color: var(--tm-primary-text) !important; font-size: 13px !important; font-weight: 650 !important; display: inline-flex !important; align-items: center; gap: 4px; }
#tm-root .tm-rchip .x { opacity: .6; font-size: 15px; padding: 0 2px; }
#tm-root .tm-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
#tm-root .tm-acts button { display: flex !important; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; border-radius: 12px; background: var(--tm-surface) !important; box-shadow: var(--tm-shadow);
  font-size: 12.5px !important; font-weight: 650 !important; color: var(--tm-text-2) !important; }
#tm-root .tm-acts button svg { width: 20px; height: 20px; color: var(--tm-primary-text); }
#tm-root .tm-wdpick { display: flex; gap: 6px; padding: 4px 12px 12px; }
#tm-root .tm-wdpick button { flex: 1; height: 36px; border-radius: 10px; background: var(--tm-surface-2) !important; font-weight: 700 !important; font-size: 13px !important; color: var(--tm-text-2) !important; }
#tm-root .tm-wdpick button.is-on { background: var(--tm-primary) !important; color: var(--tm-primary-ink) !important; }
#tm-root .tm-radio { display: flex; flex-direction: column; gap: 6px; padding: 4px 12px 12px; }
#tm-root .tm-radio button { display: flex !important; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px; background: var(--tm-surface-2) !important; text-align: left; font-size: 14px !important; font-weight: 600 !important; }
#tm-root .tm-radio button.is-on { background: var(--tm-primary-soft) !important; color: var(--tm-primary-text) !important; box-shadow: inset 0 0 0 1.5px var(--tm-primary); }
#tm-root .tm-radio input { width: 52px !important; height: 30px; border-radius: 8px !important; background: var(--tm-surface) !important; text-align: center; font-weight: 700; }
#tm-root .tm-field input[type="number"] { border: 0 !important; background: var(--tm-surface-2) !important; border-radius: 8px !important; height: 34px; padding: 0 8px !important; font-weight: 700; color: var(--tm-text) !important; }
#tm-root .tm-app[data-v="focus"] .tm-views, #tm-root .tm-app[data-v="stats"] .tm-views { padding-bottom: 6px; }

@media (prefers-reduced-motion: reduce) { #tm-root * { transition: none !important; animation: none !important; } }
@media (min-width: 700px) { .tm-app { max-width: 640px; margin: 0 auto; left: 0; right: 0; } }
/* ---------- design skin: clean light cards, big radii, yellow accent, big tap zones ---------- */
#tm-root { font-size: 15px; }
#tm-root .tm-head { padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 8px; gap: 10px; }
#tm-root .tm-h1 { font: 800 clamp(24px, 7.2vw, 30px)/1.12 var(--tm-font); letter-spacing: -.025em; }
#tm-root .tm-sub { margin-top: 3px; font-size: 13.5px; }
#tm-root .tm-ibtn { width: 44px; height: 44px; border-radius: 50%; color: var(--tm-text); }
#tm-root .tm-head .tm-ibtn { background: var(--tm-surface) !important; box-shadow: var(--tm-shadow); }
#tm-root .tm-burger { margin-left: 0; }
#tm-root .tm-search { height: 44px; border-radius: 14px; border: 0; box-shadow: var(--tm-shadow); }
#tm-root .tm-views { gap: 8px; padding: 6px 16px 12px; }
#tm-root .tm-pill { height: 38px; padding: 0 15px; border-color: transparent !important; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); color: var(--tm-text); font-weight: 600 !important; font-size: 14.5px !important; }
#tm-root .tm-pill.is-on { background: var(--tm-chip-on); border-color: var(--tm-chip-on) !important; color: var(--tm-chip-on-ink); }
#tm-root .tm-pill.is-on .n, #tm-root .tm-pill.is-on .pi { color: inherit; opacity: .7; }
#tm-root .tm-main { padding-left: 14px; padding-right: 14px; }
#tm-root .tm-sec { margin: 4px 0 18px; }
#tm-root .tm-sec-h { padding: 12px 6px 8px; color: var(--tm-text); font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
#tm-root .tm-sec-h .n { font-size: 15px; color: var(--tm-text-3); }
#tm-root .tm-sec-h.is-over { color: var(--tm-error); }
#tm-root .tm-sec-h button { color: var(--tm-text-2); font-weight: 600; font-size: 14px; min-height: 32px; }
#tm-root .tm-task { padding: 14px 8px 14px 16px; min-height: 58px; gap: 12px; }
#tm-root .tm-title { font-size: 16px; }
#tm-root .tm-meta { font-size: 13px; margin-top: 4px; }
#tm-root .tm-meta .is-today { color: var(--tm-info); }
#tm-root .tm-check { border-width: 2px; }
#tm-root .tm-card { padding: 16px; margin: 4px 0 16px; }
#tm-root .tm-card-h { font-weight: 800; font-size: 16px; }
#tm-root .tm-btn { height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 650 !important; font-size: 15px !important; }
#tm-root .tm-btn.pri:active, #tm-root .tm-fab:active, #tm-root .tm-q-send:active { filter: brightness(.95); }
#tm-root .tm-btn.sm { height: 36px; border-radius: 12px; }
#tm-root .tm-fab { width: 60px; height: 60px; border-radius: 50%; right: 16px; }
#tm-root .tm-tabs { border-top: 0; box-shadow: 0 -1px 0 var(--tm-line), 0 -6px 24px rgba(0, 0, 0, .04); }
#tm-root .tm-tab { gap: 3px; color: var(--tm-text-2) !important; font-size: 11.5px !important; font-weight: 600 !important; }
#tm-root .tm-tab svg { width: 56px; height: 30px; padding: 4px 17px; border-radius: 15px; transition: background .15s ease; }
#tm-root .tm-tab.is-on { color: var(--tm-text) !important; }
#tm-root .tm-tab.is-on svg { background: var(--tm-primary); color: var(--tm-primary-ink); }
#tm-root .tm-quick { border-radius: 24px 24px 0 0; padding: 18px 14px calc(env(safe-area-inset-bottom, 0px) + 12px); }
#tm-root .tm-quick::before { content: ''; position: absolute; left: 50%; top: 7px; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--tm-line-2); }
#tm-root .tm-q-in { height: 48px; border-radius: 14px; border-color: transparent !important; background: var(--tm-surface-2) !important; padding: 0 14px; }
#tm-root .tm-q-in:focus { border-color: var(--tm-primary) !important; background: var(--tm-surface) !important; }
#tm-root .tm-q-send { width: 48px; height: 48px; }
#tm-root .tm-chip { height: 30px; border-radius: 10px; }
#tm-root .tm-tool { height: 36px; padding: 0 12px; border-radius: 12px; color: var(--tm-text) !important; }
#tm-root .tm-sheet { border-radius: 24px 24px 0 0; top: calc(env(safe-area-inset-top, 0px) + 24px); }
#tm-root .tm-sheet-h { padding: 18px 10px 6px; }
#tm-root .tm-sheet-h .grab { top: 8px; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; }
#tm-root .tm-sheet-h .t { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
#tm-root .tm-sheet-h .tm-ibtn { background: var(--tm-surface-2) !important; width: 38px; height: 38px; }
#tm-root .tm-sheet-b { padding-left: 16px; padding-right: 16px; }
#tm-root .tm-d-title { font-size: 22px !important; font-weight: 800 !important; }
#tm-root .tm-group { margin: 12px 0; }
#tm-root .tm-field { min-height: 54px; padding: 6px 16px; }
#tm-root .tm-quickd button { height: 34px; padding: 0 12px; border-radius: 10px; color: var(--tm-text) !important; }
#tm-root .tm-seg button { height: 34px; border-radius: 10px; }
#tm-root .tm-gh { padding: 18px 4px 2px; color: var(--tm-text); font-size: 15px; font-weight: 800; }
#tm-root .tm-menu { border: 0; border-radius: 20px; padding: 8px; min-width: 260px; }
#tm-root .tm-menu button { height: 48px; padding: 0 12px; border-radius: 12px; }
#tm-root .tm-menu button svg { color: var(--tm-text); }
#tm-root .tm-stat { padding: 14px 16px; }
#tm-root .tm-stat b { font-size: clamp(20px, 6.2vw, 28px); letter-spacing: -.02em; white-space: nowrap; }
#tm-root .tm-toast { border-radius: 16px; padding-left: 16px; }
#tm-root .tm-skel { border-radius: 20px; }
#tm-root .tm-empty .art { border-radius: 26px; background: var(--tm-primary-soft); color: var(--tm-text); }

/* ===== ЭТАП 3: super-app places (Игры / Общение / Безопасность) — content comes from lazy modules (tm/p3.css) ===== */
#tm-root .tm-place { position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--tm-tabs-h) + env(safe-area-inset-bottom, 0px)); overflow: hidden; background: var(--tm-bg); z-index: 3; }
#tm-root .tm-app[data-place]:not([data-place="tasks"]) > .tm-head,
#tm-root .tm-app[data-place]:not([data-place="tasks"]) > .tm-views,
#tm-root .tm-app[data-place]:not([data-place="tasks"]) > .tm-main,
#tm-root .tm-app[data-place]:not([data-place="tasks"]) > .tm-fab,
#tm-root .tm-app[data-place]:not([data-place="tasks"]) > .tm-mini,
#tm-root .tm-app[data-place]:not([data-place="tasks"]) > .tm-bulk { display: none !important; }
#tm-root .tm-app[data-sub="full"] .tm-place { bottom: 0; }
#tm-root .tm-app[data-sub="full"] .tm-tabs { display: none; }
#tm-root .tm-tab { position: relative; }
#tm-root .tm-tab-badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tm-accent); color: #fff; font: 700 11px/18px var(--tm-font); text-align: center; box-shadow: 0 0 0 2px var(--tm-surface); }
#tm-root .p3-loading { padding: calc(env(safe-area-inset-top, 0px) + 64px) 16px 0; }
/* legacy game tab bar for p3 users: Задачи · Игры · Общение · Безопасность (the game screens stay inside «Игры») */
html.tm-p3 #tabs.tabs button[data-tab="week"], html.tm-p3 #tabs.tabs button[data-tab="goal"], html.tm-p3 #tabs.tabs button[data-tab="people"] { display: none !important; }
html.tm-p3 #tabs.tabs button.tm-p3-tab svg { display: block !important; width: 50px !important; height: 28px !important; padding: 3px 14px; box-sizing: border-box; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.tm-p3 body.is-goal #tabs.tabs button[data-tmplace="games"], html.tm-p3 body.is-week #tabs.tabs button[data-tmplace="games"], html.tm-p3 body.is-people #tabs.tabs button[data-tmplace="games"] {
  color: #fff6c8; background: linear-gradient(180deg, rgba(224, 193, 92, .55) 0%, rgba(90, 72, 28, .72) 100%); border-color: #e0c15c; }
html.tm-p3 #tabs.tabs .tm-p3-badge { position: absolute; top: 2px; right: 18%; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #FC3F1D; color: #fff; font: 700 10px/16px system-ui, sans-serif; }
html.tm-p3 #screen-people .people-stubs, html.tm-p3 #people-friends, html.tm-p3 #people-dm, html.tm-p3 #people-chat { display: none !important; }

/* ===== ГризлиOn design system (gl/tokens.css) — «Задачи» and every super-app place read the shared tokens ===== */
html.tm-on.gl-on {
  --tm-bg: var(--gl-bg); --tm-surface: var(--gl-surface); --tm-surface-2: var(--gl-surface-2); --tm-line: var(--gl-line); --tm-line-2: var(--gl-line-2);
  --tm-text: var(--gl-text); --tm-text-2: var(--gl-text-2); --tm-text-3: var(--gl-text-3);
  --tm-primary: var(--gl-yellow); --tm-primary-ink: var(--gl-yellow-ink); --tm-primary-soft: var(--gl-yellow-soft);
  --tm-chip-on: var(--gl-chip-on); --tm-chip-on-ink: var(--gl-chip-on-ink); --tm-info: var(--gl-info);
  --tm-accent: var(--gl-honey-deep); --tm-error: var(--gl-danger); --tm-success: var(--gl-ok);
  --tm-shadow: var(--gl-shadow-1); --tm-shadow-2: var(--gl-shadow-2);
  --tm-radius: var(--gl-radius-xl); --tm-font: var(--gl-font);
}
html.tm-on.gl-on:not([data-theme="dark"]) { --tm-primary-text: var(--gl-yellow-ink); }
/* signature: honey-gradient pill under the active tab, paw-step loading, bear-paw empty states, tall soft sheets */
html.gl-on #tm-root .tm-tab.is-on svg { background: var(--gl-brand-grad); }
html.gl-on #tm-root .tm-tab-badge { background: var(--gl-honey-deep); }
html.gl-on #tm-root .tm-spin { width: 84px; height: 30px; border: 0; border-radius: 0; animation: none;
  background: var(--gl-paw) 0 70% / 20px 20px no-repeat, var(--gl-paw) 32px 20% / 20px 20px no-repeat, var(--gl-paw) 64px 70% / 20px 20px no-repeat;
  -webkit-mask: linear-gradient(90deg, #000 0 30%, rgba(0, 0, 0, .25) 30% 100%) 0 0 / 300% 100%; mask: linear-gradient(90deg, #000 0 30%, rgba(0, 0, 0, .25) 30% 100%) 0 0 / 300% 100%;
  animation: gl-walk 1.2s steps(3) infinite; }
@keyframes gl-walk { from { -webkit-mask-position: 150% 0; mask-position: 150% 0; } to { -webkit-mask-position: -150% 0; mask-position: -150% 0; } }
html.gl-on #tm-root .tm-empty .art { position: relative; background: var(--gl-honey-soft); color: var(--gl-honey-ink); border-radius: 28px 28px 28px 12px; }
html.gl-on #tm-root .tm-empty .art::after { content: ''; position: absolute; right: -8px; bottom: -6px; width: 24px; height: 24px; background: var(--gl-paw) center / contain no-repeat; transform: rotate(18deg); }
html.gl-on #tm-root .tm-sheet { border-radius: var(--gl-radius-sheet) var(--gl-radius-sheet) 0 0; }
html.gl-on #tm-root .tm-sheet-h .grab { background: var(--gl-honey); opacity: .55; }
html.gl-on #tm-root .tm-skel { background: linear-gradient(100deg, var(--gl-surface) 30%, var(--gl-honey-soft) 50%, var(--gl-surface) 70%) 0 0 / 300% 100%; animation: gl-shim 1.6s linear infinite; }
@keyframes gl-shim { to { background-position: -300% 0; } }
html.gl-on #tm-root .tm-menu { border-radius: var(--gl-radius-l); }
html.gl-on #tm-root .tm-fab { background: var(--gl-brand-grad); }
/* p3 users: the game tab bar (over the village) wears the same light skin — static chrome only, no canvas changes */
html.tm-p3 #tabs.tabs { background: var(--gl-surface, #fff) !important; border-top: 0 !important; box-shadow: 0 -1px 0 var(--gl-line, #eceBE7), 0 -6px 24px rgba(0, 0, 0, .06) !important; }
html.tm-p3 #tabs.tabs button { background: transparent !important; background-image: none !important; border: 0 !important; box-shadow: none !important; color: var(--gl-text-2, #6f6b66) !important; }
html.tm-p3 #tabs.tabs button .btn-cap { font-family: var(--gl-font, system-ui) !important; font-weight: 650 !important; text-shadow: none !important; color: inherit !important; }
html.tm-p3 #tabs.tabs button .tab-ico { filter: none !important; }
html.tm-p3 #tabs.tabs button.is-on, html.tm-p3 body.is-goal #tabs.tabs button[data-tmplace="games"], html.tm-p3 body.is-week #tabs.tabs button[data-tmplace="games"], html.tm-p3 body.is-people #tabs.tabs button[data-tmplace="games"] { color: var(--gl-text, #221f1c) !important; background: transparent !important; }
html.tm-p3 #tabs.tabs button svg { padding: 3px 14px; width: 50px !important; height: 28px !important; border-radius: 14px; box-sizing: border-box; }
html.tm-p3 body.is-goal #tabs.tabs button[data-tmplace="games"] svg, html.tm-p3 body.is-week #tabs.tabs button[data-tmplace="games"] svg, html.tm-p3 body.is-people #tabs.tabs button[data-tmplace="games"] svg { background: var(--gl-brand-grad); color: #221F1C; }
html.tm-p3 #tabs.tabs button[data-tab="today"] .tab-ico { width: 22px; height: 22px; }

/* rollout 2026-10-09: welcome card for a brand-new account (over «Задачи», same agree contract as the classic onboarding) */
#tm-root #tm-welcome { position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 16, 10, .42);
  padding: 16px 12px calc(env(safe-area-inset-bottom, 0px) + 12px); animation: tm-wel-in .25s ease-out; transition: opacity .25s; }
#tm-root #tm-welcome.is-out { opacity: 0; }
#tm-root .tm-wel-card { width: 100%; max-width: 440px; max-height: 100%; overflow: auto; background: var(--tm-surface); color: var(--tm-text); border-radius: 26px; padding: 22px 20px 16px;
  box-shadow: 0 14px 44px rgba(40, 25, 5, .22); text-align: center; }
#tm-root .tm-wel-card .gl-bear { width: 84px; height: 84px; margin-bottom: 6px; }
#tm-root .tm-wel-card .k { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--tm-text-3); font-weight: 700; }
#tm-root .tm-wel-card h2 { margin: 4px 0 14px; font-size: 22px; line-height: 1.2; font-weight: 800; }
#tm-root .tm-wel-card ul { list-style: none; margin: 0 0 14px; padding: 0; text-align: left; display: grid; gap: 10px; }
#tm-root .tm-wel-card li { display: flex; gap: 12px; align-items: center; font-size: 14.5px; color: var(--tm-text-2); line-height: 1.3; }
#tm-root .tm-wel-card li b { color: var(--tm-text); }
#tm-root .tm-wel-card li svg { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 11px; background: #FFF1D6; stroke: #B8741A; }
#tm-root .tm-wel-card .tz { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; padding: 10px 12px; border-radius: 14px; background: var(--tm-surface-2); font-size: 14px; }
#tm-root .tm-wel-card .tz select { border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--tm-text); text-align: right; }
#tm-root .tm-wel-card .tm-btn.wide { width: 100%; height: 50px; font-size: 16px !important; }
#tm-root .tm-wel-card .legal { margin: 10px 0 0; font-size: 12.5px; color: var(--tm-text-3); }
#tm-root .tm-wel-card .legal a { color: inherit; text-decoration: underline; }
@keyframes tm-wel-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- village: stats behind «Сводка» (bottom sheet), clean map ---------- */
html.tm-vclean #screen-goal .village-hud #vil-nearest,
html.tm-vclean #screen-goal .village-hud .vil-chip-row,
html.tm-vclean #screen-goal .village-hud #vil-ratings-chip,
html.tm-vclean #screen-goal .village-hud #vil-day-pause,
html.tm-vclean #screen-goal .village-hud #vil-era { display: none !important; }
html.tm-vclean #screen-goal .village-hud { max-height: none; }
.tm-vstat-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; margin-left: auto; border-radius: 17px; border: 1px solid rgba(255, 216, 120, .45);
  background: linear-gradient(180deg, rgba(60, 44, 24, .92), rgba(36, 26, 14, .92)); color: #FFE7A8; font: 700 13px/1 -apple-system, BlinkMacSystemFont, 'Inter', Roboto, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35); white-space: nowrap; min-width: 0; -webkit-tap-highlight-color: transparent; }
.tm-vstat-btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: #FFD25A; stroke-width: 2.4; stroke-linecap: round; }
.tm-vstat-btn b { font-weight: 600; color: rgba(255, 231, 168, .72); overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.tm-vstat-btn b:empty { display: none; }
.tm-vstat-btn:active { transform: scale(.97); }
@media (max-width: 370px) { .tm-vstat-btn b { display: none; } }
/* 09.10: Летопись / Рейтинги — in-game buttons in the village top row (moved out of the Игры hub) */
html.tm-vclean #screen-goal .vil-top-row > h2 { display: none !important; }
.tm-vgo-btn { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px 0 7px; margin-right: 6px; border-radius: 17px; border: 1px solid rgba(255, 216, 120, .45);
  background: linear-gradient(180deg, rgba(60, 44, 24, .92), rgba(36, 26, 14, .92)); color: #FFE7A8; font: 700 13px/1 -apple-system, BlinkMacSystemFont, 'Inter', Roboto, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35); white-space: nowrap; flex: none; -webkit-tap-highlight-color: transparent; }
.tm-vgo-btn img { width: 20px; height: 20px; object-fit: contain; flex: none; }
.tm-vgo-btn:active { transform: scale(.97); }
@media (max-width: 370px) { .tm-vgo-btn { padding: 0 8px 0 6px; font-size: 12px; margin-right: 4px; } .tm-vgo-btn img { width: 18px; height: 18px; } .tm-vstat-btn { padding: 0 10px 0 8px; } }
.tm-vback { display: none; }
html.tm-p3 .tm-vback { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px 0 8px; margin: 0 0 8px; border-radius: 18px; border: 1px solid rgba(255, 216, 120, .45);
  background: linear-gradient(180deg, rgba(60, 44, 24, .92), rgba(36, 26, 14, .92)); color: #FFE7A8; font: 700 14px/1 -apple-system, BlinkMacSystemFont, 'Inter', Roboto, sans-serif; cursor: pointer; }
html.tm-p3 .tm-vback svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tm-vstat { position: fixed; inset: 0; z-index: 9000; }
.tm-vstat-scrim { position: absolute; inset: 0; background: rgba(10, 8, 4, 0); transition: background .2s; }
.tm-vstat.is-on .tm-vstat-scrim { background: rgba(10, 8, 4, .45); }
.tm-vstat-sheet { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 480px; max-height: 82vh; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #2E2316, #1E170E); color: #FFF3D6; border-radius: 22px 22px 0 0; padding: 6px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .45); transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .9, .3, 1); }
.tm-vstat.is-on .tm-vstat-sheet { transform: none; }
.tm-vstat-grab { display: block; width: 38px; height: 5px; border-radius: 3px; background: rgba(255, 231, 168, .35); margin: 4px auto 6px; }
.tm-vstat-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; }
.tm-vstat-head b { font: 800 17px/1.2 -apple-system, BlinkMacSystemFont, 'Inter', Roboto, sans-serif; color: #FFE7A8; }
.tm-vstat-x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 231, 168, .12); color: #FFE7A8; font-size: 22px; line-height: 34px; padding: 0; }
#tm-vstat .tm-vstat-body.village-hud { position: static !important; transform: none !important; left: auto !important; width: auto !important; max-height: none !important; padding: 0 !important;
  background: none !important; border-radius: 0 !important; display: flex; flex-direction: column; gap: 10px; z-index: auto; }
#tm-vstat .tm-vstat-body > * { margin: 0 !important; max-width: none !important; }
#tm-vstat .tm-vstat-body .vil-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
#tm-vstat .tm-vstat-body #vil-ratings-chip, #tm-vstat .tm-vstat-body #vil-day-pause, #tm-vstat .tm-vstat-body #vil-nearest { align-self: flex-start; }
#tm-vstat .tm-vstat-body #vil-day-pause { white-space: pre-line; }
#tm-vstat .tm-vstat-body .vil-era { position: static !important; width: auto !important; }
.tm-vstat-empty { margin: 4px 0 8px; color: rgba(255, 243, 214, .7); font-size: 14px; }
