/* ===== Surfaces (REDESIGN.md §2) — one header, segments inside ===== */
.surface { display: flex; flex-direction: column; height: 100%; }
.surface-body { flex: 1; min-height: 0; position: relative; overflow-y: auto; overflow-x: hidden; }
.surface-bar {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
  padding: 14px 36px 0; }
.surface-title { font-size: 13px; font-weight: 600; color: var(--text-faint); }
.surface-menu { display: none; }
/* Inside a segmented surface the segment IS the title — the page's own head
   only survives when it carries actions (Health's CSV import/export). */
.surface.segmented .page-inner { padding-top: 16px; }
.surface.segmented .page-head > .page-title,
.surface.segmented .page-head > .page-sub { display: none; }
.surface.segmented .page-head:not(:has(> div)) { display: none; }
.surface.segmented .page-head { padding-bottom: 0; border-bottom: none; margin-bottom: 14px; }

/* ===== Today — the cockpit ===== */
.ck-hero { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 0 22px; }
.ck-hero h1 { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.ck-hero .ck-date { color: var(--text-dim); font-size: 13.5px; }
.ck-hero .dash-clock { margin-left: 2px; }

.cockpit { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr); gap: 26px; align-items: start; }
.ck-col { min-width: 0; }
.ck-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ck-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.ck-sum { font-family: var(--mono); font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ck-bar { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 6px 0 4px; }
.ck-bar > i { display: block; height: 100%; background: var(--accent); }

.ck-task {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 4px; border-bottom: 1px solid var(--border-soft);
  background: none; border-left: none; border-right: none; border-top: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ck-task:hover { background: var(--bg-elev); }
.ck-task .cbx { flex-shrink: 0; }
.ck-time { font-family: var(--mono); font-size: 12px; color: var(--text-dim); min-width: 62px; font-variant-numeric: tabular-nums; }
.ck-text { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.ck-task.done .ck-text { text-decoration: line-through; color: var(--text-faint); }
.ck-meta { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.ck-meta:empty { display: none; }
.ck-rule { font-size: 11.5px; font-weight: 600; color: var(--text-faint); margin: 12px 0 2px; }
.ck-add { margin-top: 12px; }

.wk-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--border-soft); }
.wk-label { color: var(--text-dim); font-size: 13px; }
.wk-val { font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.wk-val small { font-family: var(--font); color: var(--text-faint); font-size: 12px; margin-left: 6px; }
.wk-cta { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wk-cta .rv-when { font-size: 12px; color: var(--text-faint); }

/* one line for the assistant, whatever its state */
.ai-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 26px 0 0; padding: 12px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.ai-strip .ai-strip-label { font-weight: 600; font-size: 13px; margin-right: 4px; }
.ai-strip .ai-key-notice { flex: 1; margin: 0; }
.ai-panels { margin-top: 16px; }
.ai-panels .section:last-child { margin-bottom: 0; }

/* the index of everything else: a ruled list, one line per surface */
.idx { margin-top: 26px; }
.idx-title { font-size: 11.5px; font-weight: 600; color: var(--text-faint); margin-bottom: 4px; }
.idx-row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) 16px; align-items: center; gap: 14px; width: 100%;
  padding: 9px 2px; border-bottom: 1px solid var(--border-soft);
  background: none; border-left: none; border-right: none; border-top: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer; }
.idx-row:first-of-type { border-top: 1px solid var(--border-soft); }
.idx-row:hover { background: var(--bg-elev); }
.idx-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.idx-name svg { color: var(--text-faint); }
.idx-stat { color: var(--text-dim); font-size: 13px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idx-go { color: var(--text-faint); }

/* first run */
.firstrun { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; max-width: 620px; }
.firstrun h2 { margin: 0 0 6px; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.firstrun p { margin: 0; color: var(--text-dim); font-size: 13.5px; }
.firstrun-opts { display: grid; gap: 8px; margin-top: 16px; }
.fr-opt {
  display: flex; gap: 12px; align-items: center; text-align: left; width: 100%;
  padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  background: var(--bg-elev); font: inherit; color: inherit; cursor: pointer; }
.fr-opt:hover { border-color: var(--accent); }
.fr-opt:active { background: var(--bg); }
.fr-opt svg { color: var(--text-faint); flex-shrink: 0; }
/* The title has to out-rank its own subtitle: the wrapping span sets the dim
   12.5px and it cascaded straight into the <b>, so both lines read the same. */
.fr-opt b { display: block; font-weight: 600; color: var(--text); font-size: 13.5px; }
.fr-opt span { color: var(--text-dim); font-size: 12.5px; }
.sample-banner {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 18px;
  border: 1px solid var(--warn); border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-dim); }
.sample-banner b { color: var(--text); font-weight: 600; }

/* sidebar "now" strip */
.sb-now { padding: 6px 14px 12px; border-bottom: 1px solid var(--border-soft); font-size: 12px; color: var(--text-dim); }
.sb-now-time { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sb-now-line { margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collapsed .sb-now { display: none; }

@media (max-width: 900px) {
  .cockpit { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 760px) {
  .surface-bar { padding: 10px 14px 0; gap: 10px; }
  .surface-menu { display: grid; min-width: 44px; min-height: 44px; }
  /* a page fills its surface, so an editor (Notes) can stretch to the bottom */
  .surface-body > * { min-height: 100%; display: flex; flex-direction: column; }
  .surface-body .page { flex: 1 1 auto; display: flex; flex-direction: column; }
  .surface-body .page > .page-inner { flex: 1 1 auto; width: 100%; }
  .surface-segs .ftab { min-height: 40px; } /* 58+ wide already; 40 tall makes a real target */
  .surface-title { display: none; }
  .surface-segs { overflow-x: auto; max-width: 100%; }
  .ck-hero h1 { font-size: 28px; }
  /* greeting on its own line; the date and clock share the next one */
  .ck-hero { row-gap: 4px; }
  .ck-hero h1 { flex: 1 1 100%; }
  /* chips drop under the text instead of squeezing it */
  .ck-task {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: start;
    gap: 4px 8px; min-height: 44px; padding: 3px 4px 3px 0; }
  /* The checkbox keeps its 18px face but gets a 40×44 hit area: the face is drawn
     by ::before at the top of the box so it still sits on the first text line. */
  .ck-task .cbx {
    width: 40px; height: 44px; margin: 0 0 0 -7px; padding: 5px 0 0; border: none; background: none;
    position: relative; place-items: start center; grid-row: 1 / 3; align-self: start;
    transform-origin: 20px 11px; }
  .ck-task .cbx::before {
    content: ''; position: absolute; top: 2px; left: 11px; width: 18px; height: 18px; box-sizing: border-box;
    border: 1.5px solid var(--border); border-radius: 6px; transition: background 0.15s, border-color 0.15s; }
  .ck-task .cbx.checked::before { background: var(--accent); border-color: var(--accent); }
  .ck-task .cbx svg { position: relative; }
  .ck-time { min-width: 0; padding-top: 2px; }
  .ck-meta { grid-column: 2 / 4; }
  .ck-meta:empty { display: none; }
  /* thumb-sized actions; the banner and first-run card go full width */
  .sample-banner { padding: 10px 12px; }
  .sample-banner .spacer { display: none; }
  .sample-banner .btn { flex: 1 1 100%; min-height: 44px; justify-content: center; }
  .firstrun { padding: 18px 16px; }
  .fr-opt { min-height: 44px; }
  .wk-cta .btn, .ai-strip .btn, .ai-panels .btn { min-height: 44px; }
  .ai-panels .section { padding: 16px 14px; }
  .idx-row { grid-template-columns: 90px minmax(0, 1fr) 16px; min-height: 44px; }
}
