/* Whereabouts' own styles: only what the house shell does not already provide.
   The shell gives .signin, .field, .section, .sheet, .btn, .chip, .page-head and
   the --sh-* tokens. Everything here is the calendar, the counts and the editor.

   The accent comes from brand-whereabouts.css through --sh-accent. The one other
   set of colours is the country palette in app.js: that is data, not chrome, and
   each colour is mixed into the surface so it works in both themes.

   House style: UK English, no em dashes. */

/* ---------- sign-in extras (as Intel) ---------- */
.signin__eyebrow {
  font-family: var(--sh-mono);
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--sh-accent-2); margin-bottom: 10px;
}
.signin .gate-status { font-size: 12.5px; color: var(--sh-muted); margin: 14px 0 0; min-height: 1.2em; }
.signin .gate-status.is-err { color: #f0866f; }
.signin .gate-foot { margin: 26px 0 0; font-size: 12px; color: var(--sh-faint); }
.signin .gate-foot a { color: var(--sh-faint); text-decoration: none; }
.sidebar-foot a { color: inherit; text-decoration: none; }

:root { --stop: #f0866f; --warn: #E8A13C; --ok: #4ade80; }

.lede { color: var(--sh-muted); font-size: 15px; line-height: 1.6; max-width: 68ch; margin: 0 0 20px; }
.loading { color: var(--sh-faint); font-size: 13.5px; }
.loading.is-err { color: var(--stop); }
.muted { color: var(--sh-muted); }
.faint { color: var(--sh-faint); }
.mono { font-family: var(--sh-mono); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card {
  background: var(--sh-surface); border: 1px solid var(--sh-rule);
  border-radius: var(--sh-radius); padding: 18px 18px 16px;
}
.card h2 { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--sh-muted); margin: 0 0 10px; }
.card .big { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--sh-fog); }
.card .big small { font-size: 16px; font-weight: 500; color: var(--sh-faint); margin-left: 4px; }
.card p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--sh-fog); }

.note-block {
  border-radius: var(--sh-radius-sm); padding: 11px 14px; margin: 0 0 12px;
  font-size: 13.5px; line-height: 1.55; border: 1px solid var(--sh-rule); border-left-width: 3px;
  background: var(--sh-surface-2); color: var(--sh-fog);
}
.note-block.is-info { border-left-color: var(--sh-accent); }
.note-block.is-warn { border-left-color: var(--warn); }
.note-block.is-stop { border-left-color: var(--stop); }

/* ---------- the count tiles ---------- */
.card p.rule { margin: -4px 0 12px; font-size: 12.5px; color: var(--sh-muted); }
.yh { font-size: 15px; margin: 26px 0 10px; color: var(--sh-fog); }
.yh span { font-size: 12.5px; font-weight: 500; color: var(--sh-faint); margin-left: 8px; }
.tile.is-warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--sh-rule)); }
.tile.is-stop { border-color: color-mix(in srgb, var(--stop) 65%, var(--sh-rule)); }
.tile.is-stop .big { color: var(--stop); }
.bar { position: relative; height: 10px; border-radius: 999px; background: var(--sh-surface-3, var(--sh-surface-2)); margin: 16px 0 22px; }
.bar__done, .bar__plan { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; }
.bar__plan { background: color-mix(in srgb, var(--sh-accent) 35%, transparent); }
.bar__done { background: var(--sh-accent); }
.tile.is-stop .bar__done { background: var(--stop); }
.tile.is-stop .bar__plan { background: color-mix(in srgb, var(--stop) 40%, transparent); }
.bar__mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--sh-fog); opacity: .7; }
.bar__mark.is-soft { opacity: .4; }
.bar__mark span {
  position: absolute; top: 18px; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--sh-mono); font-size: 10.5px; color: var(--sh-muted);
}

/* ---------- ties ---------- */
.ties { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ties td { padding: 8px 6px; border-top: 1px solid var(--sh-rule-soft, var(--sh-rule)); vertical-align: top; }
.ties td:first-child { white-space: nowrap; font-weight: 600; color: var(--sh-fog); }
.ties td:last-child { color: var(--sh-muted); }
.pill {
  display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--sh-surface-2); color: var(--sh-muted); white-space: nowrap;
}
.pill.is-met { background: color-mix(in srgb, var(--stop) 22%, transparent); color: var(--stop); }
.pill.is-warn { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.pill.is-clear { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--sh-rule); border-radius: var(--sh-radius-sm); margin-bottom: 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--sh-muted); padding: 9px 10px; background: var(--sh-surface-2); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-top: 1px solid var(--sh-rule); color: var(--sh-fog); white-space: nowrap; }
.tbl tr.is-click { cursor: pointer; }
.tbl tr.is-click:hover td { background: var(--sh-surface-2); }
.tbl tr.is-on td { background: color-mix(in srgb, var(--sh-accent) 10%, transparent); }

/* ---------- the calendar ---------- */
.cal-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cal-tools select, .cal-tools input { width: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 16px; font-size: 12.5px; color: var(--sh-muted); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 18px; }
.month h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--sh-fog); }
.month h3 span { color: var(--sh-faint); font-weight: 500; margin-left: 6px; font-size: 12px; }
.wk, .mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.wk div { font-size: 10.5px; color: var(--sh-faint); text-align: center; padding-bottom: 3px; font-family: var(--sh-mono); }
.day {
  position: relative; aspect-ratio: 1 / 1; min-width: 0; padding: 3px 0 0;
  border: 1px solid transparent; border-radius: 6px; cursor: pointer;
  background: color-mix(in srgb, var(--c, transparent) 38%, var(--sh-surface));
  color: var(--sh-fog); font: inherit; font-size: 11.5px; line-height: 1.1; text-align: center;
  display: flex; flex-direction: column; align-items: center; overflow: hidden;
}
.day.is-empty { background: var(--sh-surface); border: 1px dashed var(--sh-rule); color: var(--sh-faint); }
.day.is-pad { visibility: hidden; }
.day:hover { border-color: var(--sh-muted); }
.day.is-today { box-shadow: 0 0 0 2px var(--sh-accent); }
.day.is-sel { border-color: var(--sh-fog); box-shadow: 0 0 0 2px var(--sh-fog); }
.day.is-past { opacity: .62; }
.day .p { font-size: 8.5px; color: var(--sh-fog); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 92%; margin-top: 1px; }
.day .m { position: absolute; bottom: 2px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.day .m b { width: 5px; height: 5px; border-radius: 50%; background: var(--sh-fog); }
.day .m b.es { background: #f5b642; }
.day .m b.wk3 { background: #e5484d; border-radius: 1px; }
.day .av { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.day .av.available { background: var(--ok); }
.day .av.limited { background: var(--warn); }
.day .av.away { background: var(--stop); }
@media (max-width: 560px) { .day .p { display: none; } .months { grid-template-columns: 1fr; } }

/* ---------- the day editor ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 60; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 61;
  background: var(--sh-surface); border-left: 1px solid var(--sh-rule);
  overflow-y: auto; padding: 18px 18px 28px; box-shadow: var(--sh-shadow);
}
@media (max-width: 640px) {
  .panel { top: auto; left: 0; width: 100vw; max-height: 88vh; border-left: 0; border-top: 1px solid var(--sh-rule); border-radius: 16px 16px 0 0; }
}
.panel h2 { font-size: 17px; margin: 0 0 2px; color: var(--sh-fog); }
.panel .sub { font-size: 12.5px; color: var(--sh-muted); margin: 0 0 14px; }
.panel .x { position: absolute; top: 12px; right: 12px; }
.panel .field { margin-bottom: 12px; }
.panel .chips { margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--sh-fog); margin: 4px 0 12px; }
.check input { width: auto; }
.impact { margin: 6px 0 14px; }
.impact .ln { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--sh-rule); color: var(--sh-fog); }
.impact .ln b { font-family: var(--sh-mono); font-weight: 600; color: var(--sh-fog); white-space: nowrap; }
.impact .ln b.is-up { color: var(--warn); }
.impact .ln b.is-stop { color: var(--stop); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 18px; }
.notes { margin-top: 8px; border-top: 1px solid var(--sh-rule); padding-top: 14px; }
.notes h3 { font-size: 13px; margin: 0 0 10px; color: var(--sh-muted); font-weight: 600; }
.nt { background: var(--sh-surface-2); border-radius: var(--sh-radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.nt.is-resolved { opacity: .55; }
.nt .body { white-space: pre-wrap; font-size: 13.5px; color: var(--sh-fog); margin-bottom: 8px; }
.nt .row select { width: auto; font-size: 12px; padding: 3px 6px; }
.aud { font-size: 11px; font-family: var(--sh-mono); color: var(--sh-faint); }

/* ---------- now / next ---------- */
.runs { list-style: none; margin: 0; padding: 0; }
.runs li { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--sh-rule); font-size: 14px; }
.runs li:first-child { border-top: 0; }
.runs .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; align-self: center; }
.runs .when { color: var(--sh-muted); font-size: 12.5px; min-width: 150px; font-family: var(--sh-mono); }
.runs .what { color: var(--sh-fog); font-weight: 600; }
.runs .xtra { color: var(--sh-muted); font-size: 12.5px; }
.preview-banner { margin-bottom: 14px; }
