/* today.css — экран «Сегодня» (второй заход UX, трек «Пульт») */
#screen-today { max-width: 1280px; }
.td-head { display: block; }
.td-head-sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.td-head-sub::first-letter { text-transform: uppercase; }

/* две колонки: мероприятия слева шире, справа люди и сметы; на телефоне — одна */
.td-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.td-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.td-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px 18px; min-width: 0; }
.td-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; font-family: var(--font-ui); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.td-h-n { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.td-h-link { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; }
.td-h-link:hover { color: var(--ink); text-decoration: underline; }
.td-body { animation: td-in 0.18s ease-out; }
@keyframes td-in { from { opacity: 0; } to { opacity: 1; } }

.td-empty, .td-err { font-size: 13px; color: var(--muted); padding: 6px 0; line-height: 1.5; }
.td-empty a { color: var(--ink); }
.td-err { color: var(--danger); }
.td-retry { margin-left: 4px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--white); color: var(--ink); font-size: 12px; cursor: pointer; }
.td-retry:hover { border-color: var(--ink); }

/* скелетоны при загрузке */
.td-skel { display: flex; flex-direction: column; gap: 10px; }
.td-skel span { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-2) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: td-shimmer 1.2s linear infinite; }
.td-skel span:nth-child(2n) { width: 72%; }
.td-skel span:nth-child(3n) { width: 48%; }
#td-events .td-skel span { height: 64px; width: 100%; }
@keyframes td-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .td-skel span, .td-body { animation: none; } }

/* ── мероприятия ── */
.td-evs { display: flex; flex-direction: column; gap: 8px; }
/* карточка — блок; название — ссылка на всю площадь (::after), «на графике» — своя ссылка поверх */
.td-ev { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; color: inherit; transition: border-color 0.15s, background 0.15s; }
.td-ev:hover { border-color: var(--line-strong); background: var(--surface-2); }
.td-ev:focus-within { border-color: var(--ink); }
a.td-ev-name { color: inherit; text-decoration: none; outline: none; }
a.td-ev-name::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.td-ev-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.td-ev-foot .td-tags:empty { display: none; }
.td-ev-sched { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 2px 6px; margin-right: -6px; border-radius: 6px; color: var(--muted); font-size: 12px; text-decoration: none; white-space: nowrap; transition: color 0.15s, background 0.15s; }
.td-ev-sched:hover { color: var(--ink); background: var(--bg); }
.td-ev-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.td-ev-name { font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.td-ev-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.td-draft { color: var(--warn-ink); }
.td-when { flex-shrink: 0; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.td-when-live, .td-when-today { color: var(--accent); font-weight: 600; }
.td-when-soon { color: var(--ink); }

.td-bar { display: flex; height: 6px; margin-top: 4px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.td-seg { display: block; height: 100%; transition: width 0.2s ease-out; }
.td-seg-acc { background: var(--ok); }
.td-seg-conf { background: var(--ok); }
.td-seg-prop { background: var(--warn); }
.td-ev-legend { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.td-leg { display: inline-flex; align-items: center; gap: 4px; }
.td-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; }
.td-dot:first-child { margin-left: 0; }
.td-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.td-tag { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; line-height: 1.5; }
.td-tag-vac { background: var(--tint-accent); color: var(--accent); }
.td-tag-wait { background: var(--tint-warn); color: var(--warn-ink); }
.td-tag-pass { background: var(--tint-bad); color: var(--danger); }
.td-tag-ok { background: var(--tint-ok); color: var(--ok); }

/* ── ждут ответа ── */
.td-wg + .td-wg { margin-top: 14px; }
.td-wg-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.td-wg-head:hover .td-wg-name { text-decoration: underline; }
.td-wg-name { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.td-wg-meta { font-size: 12px; color: var(--muted); }
.td-wr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0 7px 12px; border-left: 2px solid color-mix(in srgb, var(--warn) 32%, transparent); margin-left: 2px; }
.td-wr + .td-wr { border-top: 1px solid var(--border); }
.td-wr-main { display: flex; flex-direction: column; min-width: 0; }
.td-person { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.td-person:hover { color: var(--accent); }
.td-wr-sub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.td-wr-acts { display: flex; gap: 6px; flex-shrink: 0; }
.td-act { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); font-size: 12px; font-weight: 500; text-decoration: none; transition: border-color 0.15s; }
.td-act:hover { border-color: var(--ink); }
/* молчит больше 2 дней */
.td-stale-sum { margin: -4px 0 10px; padding: 6px 10px; border-radius: 8px; background: var(--tint-accent); color: var(--accent); font-size: 12px; font-weight: 500; }
.td-wr.is-stale { border-left-color: var(--accent); background: linear-gradient(90deg, var(--tint-accent), transparent 70%); }
.td-wr.is-stale .td-ago { color: var(--accent); font-weight: 500; }

/* ── недоступны на этой неделе ── */
.td-un { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; }
.td-un + .td-un { border-top: 1px solid var(--border); }
.td-un-main { display: flex; flex-direction: column; min-width: 0; }
.td-now { font-weight: 600; color: var(--ink); }
.td-un-kind { flex-shrink: 0; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.td-un-vacation .td-un-kind { background: var(--tint-neutral); color: var(--info); }
.td-un-busy .td-un-kind { background: var(--tint-warn); color: var(--warn-ink); }

/* ── база людей ── */
.td-base { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.td-ring-box { position: relative; width: 88px; height: 88px; flex-shrink: 0; }
.td-ring circle { fill: none; stroke-width: 8; }
.td-ring-bg { stroke: var(--border); }
.td-ring-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray 0.2s ease-out; }
.td-ring-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.td-ring-val b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.td-ring-val small { font-size: 10px; color: var(--muted); }
.td-base-sum { display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: 600; }
.td-base-sum span { font-size: 12px; font-weight: 400; color: var(--muted); }
.td-gaps { display: flex; flex-direction: column; }
.td-gap { display: flex; justify-content: space-between; gap: 12px; padding: 7px 8px; margin: 0 -8px; border-radius: 6px; color: var(--ink); font-size: 13px; text-decoration: none; }
.td-gap + .td-gap { border-top: 1px solid var(--border); }
.td-gap:hover { background: var(--bg); }
.td-gap b { font-weight: 600; font-variant-numeric: tabular-nums; }
.td-gap.is-zero { color: var(--muted); }
.td-gap.is-zero b { font-weight: 400; }

/* ── сметы ── */
.td-est-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.td-count { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: inherit; text-decoration: none; }
.td-count:hover { border-color: var(--line-strong); }
.td-count b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.td-count span { font-size: 12px; color: var(--muted); }
.td-sub { margin: 4px 0 4px; font-size: 12px; color: var(--muted); }
.td-est, .td-rec { display: flex; flex-direction: column; gap: 1px; padding: 7px 8px; margin: 0 -8px; border-radius: 6px; color: inherit; text-decoration: none; }
.td-est:hover, .td-rec:hover { background: var(--bg); }
.td-est-name, .td-rec-title { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.td-est-meta, .td-rec-hint { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

/* ── недавние ── */
.td-rec { flex-direction: row; align-items: center; gap: 10px; width: calc(100% + 16px); border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.td-rec-ic { display: inline-flex; color: var(--muted); flex-shrink: 0; }
.td-rec-main { display: flex; flex-direction: column; min-width: 0; }

@media (max-width: 900px) {
  .td-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .td-card { padding: 14px 14px 16px; border-radius: 10px; }
  .td-act { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .td-act span { display: none; }
  .td-person { min-height: 32px; }
  .td-ev-sched { min-height: 36px; padding: 0 8px; }
  .td-h-link { min-height: 32px; display: inline-flex; align-items: center; }
  .td-gap, .td-est, .td-rec { min-height: 44px; align-items: center; }
  .td-est, .td-rec { justify-content: center; align-items: stretch; }
  .td-rec { align-items: center; }
  .td-retry { min-height: 44px; padding: 0 14px; }
}
