/* Today panel (js/today.js) on the main page, index.html, as the .strip
   variant: one row across the page.
   Loads after css/common.css. */

.today { display: grid; gap: var(--s-4); }
.today .panel-head { margin-bottom: 0; }

/* Headline: unlogged time, the number you act on */
.today-gap .stat-label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-soft); margin-bottom: 2px; }
.gap-value { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.stat-big {
  font-size: 30px;
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-big .unit, .today-facts .unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-left: 3px;
  letter-spacing: 0;
}
.stat-big.warn { color: var(--warn); }
.stat-big.over { color: var(--accent); }

/* --- The day bar ------------------------------------------------------------
   The whole bar is the workday. Segments are positioned in % by today.js:
   logged, then lunch, then unlogged, then whatever's still to come. */
.daybar-track { position: relative; padding: 4px 0; }
.daybar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.seg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  transition: left .4s ease, width .4s ease;
}
.seg-logged { background: var(--accent); }
.seg-gap { background: var(--warn); opacity: .85; }
.seg-lunch {
  background: repeating-linear-gradient(
    -45deg, var(--line-strong) 0 3px, var(--track) 3px 6px);
}
.now-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--ink);
  transition: left .4s ease;
}
.now-mark.hidden { display: none; }
.daybar-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* --- Facts under the bar, each keyed to its colour in the bar ------------- */
.today-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3) var(--s-4);
  margin: 0;
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}
.today-facts > div { min-width: 0; }
.today-facts dt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}
.today-facts dd {
  margin: 1px 0 0;
  font-size: var(--fs-md);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.inline-label { display: inline; margin: 0; font: inherit; color: inherit; cursor: pointer; }
.today-facts .lunch-fact dd { display: flex; align-items: center; min-height: 22px; }

.swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; background: var(--track); }
.swatch.logged { background: var(--accent); }
.swatch.gap { background: var(--warn); }
.swatch.lunch { background: repeating-linear-gradient(-45deg, var(--ink-faint) 0 2px, var(--track) 2px 4px); }
.swatch.left { background: var(--track); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* --- Strip variant (index.html) -------------------------------------------- */
.today.strip {
  grid-template-columns: minmax(170px, auto) minmax(0, 1fr);
  grid-template-areas:
    "head head"
    "gap  bar"
    "gap  facts";
  column-gap: var(--s-8);
  row-gap: var(--s-2);
  padding: var(--s-5) var(--s-6);
}
.today.strip .panel-head { grid-area: head; margin-bottom: var(--s-1); }
.today.strip .today-gap { grid-area: gap; align-self: center; }
.today.strip .daybar-wrap { grid-area: bar; align-self: end; }
.today.strip .today-facts {
  grid-area: facts;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-6);
  padding-top: 0;
  border-top: none;
}
.today.strip .today-facts > div { display: flex; align-items: center; gap: 6px; }
.today.strip .today-facts dd { margin: 0; font-size: 13px; }
.today.strip .today-facts .unit { font-size: 11.5px; }
.today.strip .daybar-scale { display: none; }

@media (max-width: 720px) {
  .today.strip {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "gap" "bar" "facts";
  }
}

/* --- Today's hours (button in the head + its popover) --------------------- */
.today-head-right { display: flex; align-items: center; gap: var(--s-3); }
.hours-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border: 1px solid transparent; border-radius: 999px;
  background: none;
  font: inherit; font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  cursor: pointer;
}
.hours-btn svg { width: 13px; height: 13px; }
.hours-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.hours-btn.changed { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.hours-btn.changed:hover { border-color: var(--accent); }

.day-hours-pop { width: min(280px, calc(100vw - 2 * var(--s-4))); }
.day-hours-pop input[type="time"] { width: auto; padding: 4px 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.day-hours-pop .day-reset { margin-top: var(--s-4); width: 100%; }
.day-hours-pop .day-reset.hidden { display: none; }
.day-hours-note { margin: var(--s-4) 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-soft); }
