/* v3 Phase C styles (focus timer, stats, collaboration, kanban, API). Motion: only transform / opacity animate. */

/* ---- C.12 focus timer ---- */
.timer-bar { position: relative; overflow: hidden; display: flex; align-items: center; gap: var(--sp-2); margin: 0 var(--sp-4) var(--sp-2);
  padding: 7px 10px 9px 12px; border-radius: var(--r-md); background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); font-size: var(--fs-sm); box-shadow: var(--e-1); }
.timer-bar.hidden { display: none; }
.timer-bar[data-kind="break"] { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.timer-ico { color: var(--accent-ink); display: inline-flex; }
.timer-bar[data-kind="break"] .timer-ico { color: var(--ok); }
.timer-kind { color: var(--muted); white-space: nowrap; }
.timer-item { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; padding: 0; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
button.timer-item:hover { text-decoration: underline; }
.timer-clock { font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--fs-md); letter-spacing: .02em; }
.timer-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform-origin: left center;
  transform: scaleX(0); transition: transform 1s linear; }
.timer-bar[data-kind="break"] .timer-progress { background: var(--ok); }
.focus-field { display: flex; flex-direction: column; gap: 6px; }
.focus-summary { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-sm); }
.focus-summary .est-chip { padding: 1px 7px; border-radius: var(--r-pill); background: var(--chip-bg); font-size: var(--fs-xs); }
.focus-summary.est-over .est-chip { color: var(--danger); }
.focus-summary.est-on .est-chip { color: var(--ok); }
.focus-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.focus-actions .spacer { flex: 1; }
.set-sub { margin: var(--sp-4) 0 var(--sp-1); font-size: var(--fs-sm); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 767px) { .timer-bar { margin: 0 var(--sp-2) var(--sp-2); } .timer-kind { display: none; } }

/* ---- C.13 statistics + weekly summary ---- */
.stats { padding: var(--sp-2) var(--sp-4) var(--sp-8); display: flex; flex-direction: column; gap: var(--sp-4); max-width: 1100px; }
.stats-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.stats-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-xl); font-weight: 500; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); }
.stat-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e-1); }
.stat-label { color: var(--muted); font-size: var(--fs-sm); }
.stat-value { font-size: var(--fs-title); font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-sub { color: var(--text-2); font-size: var(--fs-xs); }
.stats-sec { padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.stats-sec h3, .week-summary h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-md); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stats-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-4); }
.chart-box { width: 100%; }
.chart { display: block; overflow: visible; font-family: var(--font); }
.chart .ch-bar { fill: var(--accent); transition: opacity var(--dur-fast) var(--ease); }
.chart .ch-bar.zero { fill: var(--line-strong); }
.chart .ch-bar:hover { opacity: .75; }
.chart .ch-track { fill: var(--surface-3); }
.chart .ch-axis { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 10px; }
.chart .ch-label { fill: var(--text-2); font-size: 12px; }
.chart .ch-val { fill: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.acc-buckets { display: flex; gap: 8px; margin: 6px 0; }
.acc-b { padding: 2px 8px; border-radius: var(--r-pill); background: var(--chip-bg); font-size: var(--fs-xs); }
.acc-b.over { color: var(--danger); } .acc-b.on { color: var(--ok); }
.acc-worst, .stalled { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-ink); cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 4px; text-align: left; }
.linkish:hover { text-decoration: underline; }
.week-summary { margin: 0 0 var(--sp-3); padding: 12px 14px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border: 1px solid var(--line); }
.week-nums { display: flex; flex-wrap: wrap; gap: var(--sp-4); font-size: var(--fs-sm); color: var(--text-2); }
.week-nums b { font-size: var(--fs-lg); color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.week-nums .delta { font-size: var(--fs-xs); }
.week-nums .delta.up { color: var(--ok); } .week-nums .delta.down { color: var(--danger); }
.week-top { margin-top: 6px; font-size: var(--fs-sm); }
@media (max-width: 767px) { .stats { padding: var(--sp-2); } }
.stats-range button { white-space: nowrap; }
.chart-box .chart { max-height: 220px; }

/* ---- C.14 collaboration ---- */
.side-invite { display: flex; align-items: center; gap: 6px; padding: 6px 10px; margin: 2px 6px; border-radius: var(--r-md); background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: var(--fs-sm); }
.side-invite .label { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-invite .label b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.shared-dot { color: var(--muted); display: inline-flex; margin-left: 4px; }
.share-dialog { display: flex; flex-direction: column; gap: var(--sp-2); min-width: min(520px, 86vw); }
.share-form { display: flex; gap: 6px; flex-wrap: wrap; }
.share-form input[type=email] { flex: 1; min-width: 180px; }
.share-dialog h4 { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--muted); }
.share-list { display: flex; flex-direction: column; }
.share-row { display: flex; align-items: center; gap: var(--sp-2); padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.share-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.activity-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; }
.act-row { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.comments { display: flex; flex-direction: column; gap: 8px; }
.comment { padding: 8px 10px; border-radius: var(--r-md); background: var(--surface-2); }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); }
.comment-head .icon-btn { margin-left: auto; opacity: .6; }
.comment-head .icon-btn:hover { opacity: 1; }
.comment-body { white-space: pre-wrap; font-size: var(--fs-sm); margin-top: 2px; overflow-wrap: anywhere; }
.comment-add { display: flex; gap: 6px; align-items: flex-end; }
.comment-add textarea { flex: 1; resize: vertical; }
.shared-page { padding: var(--sp-2) var(--sp-4) var(--sp-8); display: flex; flex-direction: column; gap: var(--sp-3); max-width: 900px; }
.sh-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.sh-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-xl); font-weight: 500; }
.sh-tabs { margin-left: auto; }
.role-chip { padding: 1px 8px; border-radius: var(--r-pill); background: var(--chip-bg); }
.sh-body { display: flex; flex-direction: column; gap: var(--sp-3); }
.sh-add { display: flex; gap: 6px; }
.sh-add input { flex: 1; }
.sh-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.sh-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px calc(12px + var(--indent, 0) * 22px); border-bottom: 1px solid var(--line); cursor: pointer; }
.sh-row:last-child { border-bottom: 0; }
.sh-row:hover { background: var(--surface-2); }
.sh-row.sel { background: var(--sel); }
.sh-row.done .sh-title { color: var(--muted); text-decoration: line-through; }
.sh-check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; color: #fff; cursor: pointer; flex: none; }
.sh-check.on { background: var(--accent); border-color: var(--accent); }
.sh-check:disabled { cursor: default; opacity: .6; }
.sh-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-meta { color: var(--muted); font-size: var(--fs-xs); }
.sh-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--chip-bg); font-size: var(--fs-xs); color: var(--text-2); }
.sh-detail { display: flex; flex-direction: column; gap: var(--sp-2); padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--e-2); }
.sh-detail h4 { display: flex; align-items: center; gap: 6px; margin: var(--sp-2) 0 0; font-size: var(--fs-sm); }
.sh-title-edit { font-size: var(--fs-md); font-weight: 500; }

/* ---- C.15 kanban board ---- */
.board { display: flex; gap: var(--sp-3); align-items: flex-start; overflow-x: auto; padding: var(--sp-2) var(--sp-4) var(--sp-8); min-height: 60vh; scroll-snap-type: x proximity; }
.board-col { flex: 0 0 272px; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); scroll-snap-align: start;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease); }
.board-col.drop-on { transform: scale(1.012); box-shadow: 0 0 0 2px var(--accent); }
.board-head { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); padding: 0 2px; }
.board-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.board-col[data-col="today"] .board-dot { background: var(--warn); }
.board-col[data-col="done"] .board-dot { background: var(--ok); }
.board-count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.board-cards { display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.board-card { padding: 9px 11px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e-1); cursor: grab; user-select: none; touch-action: pan-y;
  transition: opacity var(--dur-fast) var(--ease); }
.board-card.sel { border-color: var(--sel-line); background: var(--sel); }
.board-card.cursor { box-shadow: 0 0 0 2px var(--focus-ring); }
.board-card.done .bc-title { color: var(--muted); text-decoration: line-through; }
.board-card.drag-src { opacity: .35; }
.board-ghost { position: fixed; z-index: 1000; margin: 0; pointer-events: none; box-shadow: var(--e-3); cursor: grabbing; transform-origin: 50% 50%; }
.bc-title { font-size: var(--fs-base); overflow-wrap: anywhere; }
.bc-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: var(--fs-xs); color: var(--muted); }
.bc-due { display: inline-flex; align-items: center; gap: 3px; }
.bc-due.over { color: var(--danger); } .bc-due.today { color: var(--warn); }
.bc-flag { color: var(--flag); display: inline-flex; }
.bc-prio { font-weight: 600; }
.board-empty { padding: 12px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); color: var(--muted); font-size: var(--fs-xs); text-align: center; }
@media (max-width: 767px) { .board { padding: var(--sp-2); } .board-col { flex-basis: 82vw; } }

/* ---- C.16 open API: Settings → API ---- */
.api-chip { display: inline-block; padding: 1px 7px; margin: 2px 4px 2px 0; border-radius: var(--r-pill); background: var(--chip-bg); color: var(--text-2); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.api-chip.ok { background: var(--accent-soft); color: var(--ok); }
.api-chip.bad { color: var(--danger); }
.api-chip.pending { color: var(--warn); }
.api-events { flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }
.api-event { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); }
.api-hook { padding: 8px 10px; margin: 6px 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.api-hook-main { min-width: 0; overflow-wrap: anywhere; }
.api-log { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.api-log li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border-radius: var(--r-sm); background: var(--surface-2); }
.api-payload { flex-basis: 100%; }
.api-payload pre { margin: 4px 0 0; max-height: 220px; overflow: auto; font: var(--fs-xs)/1.45 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.api-endpoints ul { margin: 6px 0; padding-left: 18px; font-size: var(--fs-sm); }
