/* Разделы «День»: Сегодня · Требует решения · План и календарь · Задачи (исполнитель S1, аудит 4).
   Только токены app.css (обе темы задаются там), анимации — transform/opacity, всё стихает при prefers-reduced-motion. */

/* ───────── Сегодня: ниша ───────── */
.td-niche .niche-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px 36px; align-items: center; }
.td-ering { display: flex; align-items: center; gap: 16px; }
.td-ering .ring-c b { font-size: 24px; }
.td-ecap { display: grid; gap: 2px; justify-items: start; min-width: 0; }
.td-ecap b { font: 600 19px/1.25 var(--display); letter-spacing: -.015em; }
.td-ecap .stat-s { margin-top: 0; }
.td-ebtn { margin-top: 6px; margin-left: -10px; }
.td-niche .stat-now { font-size: 19px; }
.td-niche .stat-s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.td-edit { position: relative; z-index: 1; display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-deep);
  animation: td-rise var(--t-base) var(--out) both; }
.niche.calm .td-edit { margin-top: 8px; padding-top: 0; border-top: 0; width: 100%; justify-self: stretch; }
.td-edit-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.td-eout { font: 600 30px/1 var(--display); color: #fff; letter-spacing: -.03em; min-width: 72px; }
.td-range { flex: 1; min-width: 180px; }
.td-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--on-deep-2); padding-left: 84px; }
.td-note { flex: 1; min-width: 200px; background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .18); color: #fff; }
.td-range::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--peach), var(--sun) 45%, var(--aqua)) 0 0 / var(--v) 100% no-repeat, rgb(255 255 255 / .14); }
.td-note::placeholder { color: var(--on-deep-2); }
@keyframes td-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ───────── Сегодня: план (отметка прямо в строке) ───────── */
.td-grid { align-items: start; }
.td-tl .tl { grid-template-columns: 50px 28px minmax(0, 1fr) auto; align-items: center; padding: 9px 8px; border-radius: 12px; }
.td-tl .tl + .tl { border-top: 0; }
.td-tl .tl:hover { background: var(--surface-2); }
.td-tl .tl.now { background: linear-gradient(90deg, var(--accent-soft), transparent 85%); }
.td-tl .tl-time { line-height: 1.3; }
.td-tl .tl-time:empty::before { content: "—"; color: var(--faint); font-weight: 500; }
.td-tl .chk { width: 26px; height: 26px; justify-self: center; }
.td-tl .chk.hab { border-color: color-mix(in srgb, var(--sun) 70%, var(--line-2)); }
.td-tl .chk.hab[aria-pressed="true"] { background: var(--sun-ink); border-color: var(--sun-ink); }
.td-tl .chk:disabled { cursor: default; }
.tl-mark { justify-self: center; width: 10px; height: 10px; border-radius: 3px; transform: rotate(45deg); background: var(--peach); opacity: .75; }
.tl.event .tl-mark, .tl.meeting .tl-mark { background: var(--k4); }
.tl.pause .tl-mark { background: var(--line-2); }
.td-tl .tl-title { overflow-wrap: anywhere; }
.td-tl .tl.done .tl-title, .td-tl .tl.is-done .tl-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.td-tl .tl.is-done { opacity: .75; transition: opacity var(--t-base); }
.td-tl .tl-acts .icon-btn { opacity: .55; transition: opacity var(--t-fast); }
.td-tl .tl:hover .tl-acts .icon-btn, .td-tl .tl-acts .icon-btn:focus-visible, .td-tl .tl-acts [aria-expanded="true"] { opacity: 1; }
.td-sub { margin: 14px 8px 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.td-collect { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px;
  border-radius: 14px; background: var(--accent-soft); }
.td-collect b { color: var(--ink); font: 600 15.5px/1.3 var(--display); }
.td-plan.td-bare { padding: 0; background: transparent; border: 0; box-shadow: none; }
.td-plan.card-empty .empty { padding-block: 36px; }

/* ───────── Сегодня: «Сейчас» ───────── */
.td-now-h { display: flex; align-items: center; gap: 8px; }
.td-now-h .mini-orb { --s: 18px; }
.td-now .now-title { margin-top: 2px; }
.td-why { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-top: 8px; }
.td-why .i { width: 14px; height: 14px; color: var(--accent); flex: none; margin-top: 2px; }
.td-now .now-step { margin-top: 12px; }
.td-step-t { flex: 1; min-width: 0; }
.td-now-acts { align-items: center; }
.td-now-acts .menu-wrap { margin-left: auto; }
.td-min { display: grid; gap: 8px; }
.td-min-c { display: flex; flex-wrap: wrap; gap: 6px; }

/* ───────── Сегодня: вечер ───────── */
.td-eve { background: linear-gradient(135deg, color-mix(in srgb, var(--k4) 8%, var(--surface)), var(--surface) 60%); }
.td-eve-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px 32px; }
.td-eve-k { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.td-eve-k .i { width: 15px; height: 15px; color: var(--k4); }
.td-eve-h { font: 600 22px/1.2 var(--display); letter-spacing: -.02em; color: var(--ink); margin-bottom: 4px; }
.td-eve-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.td-eve-b { padding-left: 24px; border-left: 1px solid var(--line); display: grid; align-content: start; gap: 6px; justify-items: start; }
.td-tom { display: grid; gap: 4px; width: 100%; }
.td-tom li { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; color: var(--ink);
  border-left: 3px solid var(--accent-2); }
.td-tom li .num { font: 600 12.5px/1.5 var(--display); color: var(--muted); }
.td-tom li.ev { border-left-color: var(--k4); } .td-tom li.dl { border-left-color: var(--peach); }
.td-tom li.pay { border-left-color: var(--sun); } .td-tom li.date { border-left-color: var(--k5); }
.td-eve-b .linkish { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.td-eve-b .linkish .i { width: 14px; height: 14px; }

/* ───────── План: неделя ───────── */
.wk-hab { padding: 2px 9px 0; font-size: 11.5px; color: var(--muted); }
.wk-hab::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--k6); margin-right: 6px; vertical-align: 1px; }
.wr { display: grid; gap: 18px; }
.wr-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wr-tile { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.wr-tile b { display: flex; align-items: baseline; gap: 5px; font: 600 28px/1 var(--display); letter-spacing: -.03em; color: var(--ink); }
.wr-tile b small { font: 500 13px/1 var(--sans); color: var(--muted); letter-spacing: 0; }
.wr-tile > span { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.wr-en { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 96px; }
.wr-en li { display: grid; grid-template-rows: 1fr auto; gap: 6px; height: 100%; text-align: center; font-size: 11.5px; color: var(--muted); }
.wr-en .col { position: relative; align-self: end; justify-self: center; width: min(28px, 100%); height: 100%; border-radius: 8px; background: var(--bg-2); overflow: hidden; }
.wr-en .col i { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; border-radius: 8px; background: var(--accent-2);
  transform-origin: bottom; transform: scaleY(var(--h, 0)); transition: transform .7s var(--out); }
.wr-en .col i.low { background: var(--sun); }
.wr-en .col.none { background: repeating-linear-gradient(135deg, var(--bg-2) 0 4px, transparent 4px 8px); }
.wr-en b { font: 600 12px/1 var(--display); color: var(--ink); }
.wr-k { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.wr-focus { display: flex; flex-wrap: wrap; gap: 8px; }
.wr-focus .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.wr-chosen { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); }
.wr-chosen .i { color: var(--accent); }
.wr details summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.wr details summary::-webkit-details-marker { display: none; }
.wr details summary .i { width: 14px; height: 14px; transition: transform var(--t-fast); }
.wr details[open] summary .i { transform: rotate(90deg); }
.wr-notes { display: grid; gap: 6px; margin-top: 10px; font-size: 13.5px; color: var(--text); }
.wr-notes li { padding-left: 14px; position: relative; }
.wr-notes li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }
.wr-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.wr-calm { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.wr-calm p { color: var(--muted); font-size: 14px; }

/* ───────── План: месяц (D-В5) ───────── */
.cal-month .mo-day.past:not(.out) { opacity: .6; }
.cal-month .mo-day.we:not(.out) { background: var(--surface-2); }
.mo-evs { display: none; }
@media (min-width: 1100px) {
  .mo-day { min-height: 108px; }
  .mo-evs { display: grid; gap: 3px; margin-top: 6px; min-width: 0; align-content: start; align-self: start; }
  .mo-ev { display: block; padding: 2px 6px; border-radius: 6px; border-left: 2px solid var(--accent-2); background: var(--surface-2); font-size: 11.5px; line-height: 1.35;
    color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mo-day.we .mo-ev { background: var(--surface); }
  .mo-ev.ev { border-left-color: var(--k4); } .mo-ev.dl { border-left-color: var(--peach); } .mo-ev.pay { border-left-color: var(--sun); } .mo-ev.date { border-left-color: var(--k5); }
  .mo-more { font-size: 11px; color: var(--muted); padding-left: 6px; }
  .cal-month .mo-n { display: none; }
  .cal-month .mo-dots { display: none; }
}
.cal-legend { margin-left: auto; }

/* ───────── Задачи: группы по времени ───────── */
.card.flush .rows > li.tk-group { padding: 12px 20px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); gap: 8px;
  border-top: 1px solid var(--line); background: var(--surface-2); }
.card.flush .rows > li.tk-group:first-child { border-top: 0; border-radius: 18px 18px 0 0; }
.tk-group .seg-n { font-weight: 600; color: var(--faint); }
.card.flush .rows > li.tk-group.warn { color: var(--danger); }
.rows > li.task-r.is-done .r-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.rows > li.task-r.is-done { opacity: .7; transition: opacity var(--t-base); }

/* ───────── Требует решения ───────── */
.dc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dc-count { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.dc-count .sun-dot { width: 7px; height: 7px; }
.dc-ext .ext-text { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; color: var(--ink); font-size: 14px; }
.dc-ext .card-foot .menu-wrap { margin-left: auto; }
.dc-done .card-head h2 { display: flex; align-items: center; gap: 8px; }
.dc-calm { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 44px 20px 40px; }
.dc-calm .empty-ic { width: 64px; height: 64px; }
.dc-calm .empty-ic .i { width: 28px; height: 28px; }

/* ───────── телефон ───────── */
@media (max-width: 720px) {
  .td-niche .niche-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .td-grid > .stack:last-child { order: -1; }
  .td-niche .stat.lead { grid-column: auto; }
  .td-ering { gap: 12px; }
  .td-scale { padding-left: 0; }
  .td-eout { font-size: 26px; min-width: 60px; }
  .td-note { min-width: 0; width: 100%; }
  .td-tl .tl { grid-template-columns: 42px 28px minmax(0, 1fr) auto; padding: 9px 4px; gap: 0 8px; }
  .td-tl .tl-acts { grid-column: auto; padding-top: 0; }
  .td-tl .tl-acts .icon-btn { opacity: 1; }
  .td-eve-grid { grid-template-columns: minmax(0, 1fr); }
  .td-eve-b { padding-left: 0; border-left: 0; padding-top: 14px; border-top: 1px solid var(--line); }
  .td-collect .btn { width: 100%; }
  .wr-tiles { gap: 6px; }
  .wr-tile { padding: 10px 12px; }
  .wr-tile b { font-size: 22px; }
  .wk-hab { display: none; }
  .card.flush .rows > li.tk-group { padding: 10px 16px 6px; }
  .cal-legend { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .td-edit { animation: none; }
  .wr-en .col i { transition: none; }
}
.td-grid.solo { grid-template-columns: minmax(0, 1fr); }
.td-grid.solo .td-plan.card-empty .empty { padding-block: 44px; }
@media (max-width: 720px) {
  .cal-note { flex-wrap: wrap; }
  .cal-note > span { flex: 1 1 200px; min-width: 0; }
  .cal-note .btn { flex: none; margin-left: auto; }
}
