/* ⏳ Time (web/time.js): how busy, the suggestions, then the next 4 weeks as one bar per day. Uses
   choreboy.css's tokens (light and dark); phone first (no sideways scroll at 320 px). The bars' widths
   and the busy line come from --tm-w and --tm-at (time.js paint): no inline styles in the markup. */

.tm { max-width: 860px; margin: 0 auto; }
.tm .list-sub { margin: .2rem 0 0; }
.tm-k { margin: 0; font-size: 1.02rem; font-weight: 700; color: var(--text); }
.tm-k.small { font-size: .95rem; }

/* How busy */
.tm-summary { margin: 0 0 1rem; padding: .8rem .9rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.tm-summary p { margin: .15rem 0 0; overflow-wrap: anywhere; }
.tm-big { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.tm-very { color: var(--bad); font-weight: 650; }
.tm-sub { font-size: .9rem; color: var(--text-2); }

/* The suggestions */
.tm-plan { margin: 0 0 1.2rem; }
.tm-steps-head, .tm-days-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: 0 0 .5rem; }
.tm-steps-head .tm-k, .tm-days-head .tm-k { margin-right: auto; }
.tm-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.tm-step { min-width: 0; padding: .6rem .7rem; background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.tm-step.rule { border-left-color: var(--info); }
.tm-step p { margin: 0; overflow-wrap: anywhere; }
.tm-what { font-weight: 600; color: var(--text); }
.tm-why { margin-top: .15rem !important; font-size: .86rem; color: var(--text-2); }
.tm-reason { margin-top: .2rem !important; font-size: .86rem; color: var(--text-2); font-style: italic; }
.tm-btns { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: .45rem; }
.tm-later { font-size: .84rem; color: var(--text-3); }
.tm-btns [aria-disabled="true"], .tm-steps-head [aria-disabled="true"] { opacity: .55; cursor: progress; }
.tm-none, .tm-verify { margin: .2rem 0; }
.tm-claude-box { margin-top: .8rem; }
.tm-claude-box .tm-k { margin-bottom: .35rem; }
.tm-claude-msg { margin: .5rem 0 0; font-size: .9rem; }
.tm-claude-msg.bad { color: var(--bad); }

/* The next 4 weeks */
.tm-legend { display: flex; align-items: center; gap: .3rem .5rem; flex-wrap: wrap; margin: 0; font-size: .8rem; color: var(--text-3); }
.tm-key { display: inline-block; width: .8rem; height: .55rem; border-radius: 3px; background: var(--text-3); }
.tm-key.mov { background: var(--accent); }
.tm-key.line { width: 2px; height: .8rem; border-radius: 0; background: var(--bad); }
.tm-days { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.tm-day details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.tm-day summary { display: grid; grid-template-columns: 6.6rem minmax(0, 1fr) 4.4rem 1.7rem; align-items: center; gap: .5rem;
  min-height: 2.4rem; padding: .3rem .6rem; cursor: pointer; list-style: none; }
.tm-day summary::-webkit-details-marker { display: none; }
.tm-day summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.tm-date { font-size: .88rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-day.today .tm-date { color: var(--accent-text); }
.tm-bar { position: relative; display: flex; height: .7rem; min-width: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.tm-fix, .tm-mov { flex: 0 0 auto; width: var(--tm-w, 0%); height: 100%; transition: width .4s ease; }
/* (--text-3: at least 3:1 on the track in light and dark, so what can't move stands apart.) */
.tm-fix { background: var(--text-3); }
.tm-mov { background: var(--accent); }
.tm-day.lvl-1 .tm-mov { background: var(--warn); }
.tm-day.lvl-2 .tm-mov { background: var(--bad); }
.tm-line { position: absolute; top: 0; bottom: 0; left: var(--tm-at, 100%); width: 2px; background: var(--bad); opacity: .7; }
.tm-min { font-size: .86rem; color: var(--text-2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tm-day.lvl-1 .tm-min { color: var(--warn); font-weight: 650; }
.tm-day.lvl-2 .tm-min { color: var(--bad); font-weight: 700; }
.tm-fire { font-size: .85rem; white-space: nowrap; }
.tm-day.lvl-1 details { border-color: var(--warn); }
.tm-day.lvl-2 details { border-color: var(--bad); }
.tm-day.away details { background: var(--surface-2); }
.tm-day.away .tm-bar { opacity: .4; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
.tm-items { list-style: none; margin: 0; padding: .1rem .7rem .55rem; display: grid; gap: .25rem; }
.tm-item { display: flex; flex-wrap: wrap; gap: 0 .5rem; font-size: .88rem; min-width: 0; }
.tm-item-t { color: var(--text); font-weight: 550; overflow-wrap: anywhere; min-width: 0; }
.tm-item-m { color: var(--text-3); overflow-wrap: anywhere; }
.tm-item.fixed .tm-item-t { color: var(--text-2); font-weight: 500; }
.tm-fixed-why { color: var(--text-2); }
.tm-empty { margin: 0; padding: .1rem .7rem .55rem; }

@media (max-width: 520px) {
  .tm-day summary { grid-template-columns: 5.2rem minmax(0, 1fr) 3.8rem 1.8rem; gap: .35rem; padding: .3rem .5rem; }
  .tm-date { font-size: .82rem; }
  .tm-min { font-size: .8rem; }
  .tm-btns .btn { min-height: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tm-fix, .tm-mov { transition: none; }
}
:root[data-fx="off"] .tm-fix, :root[data-fx="off"] .tm-mov { transition: none; }
