/* The seven-day forecast (forecast-view.js): daily cards, the switchable graph, its table, the notes, and the dialog
   Home opens it in. Colours come from design/tokens.css; the top is the brand navy and the base a lighter blue, the
   same in the cards' swatches, the bars and the key. */
:root {
  --fc-top: var(--navy);
  --fc-base: #4a86c8;   /* 3.7:1 on white: a bar that reads against the white plot */
}

.fc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fc-week { margin-top: 16px; font-variant-numeric: tabular-nums; }
.fc-title { margin: 0; font-size: var(--text-lg); font-weight: 600; letter-spacing: var(--tracking-title); color: var(--text); }
.fc-title.cond-h { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.fc-sub { margin: 2px 0 0; font-size: var(--text-sm); color: var(--muted); }
.fc-i { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Daily cards: a row that scrolls sideways when it doesn't fit ---------- */
.fc-scroll { position: relative; margin: 8px 0 0; padding: 0 0 6px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; border-radius: var(--radius-sm); }
.fc-scroll:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.fc-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(126px, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.fc-day { position: relative; scroll-snap-align: start; min-width: 0; padding: 10px 10px 8px; border-radius: var(--radius-sm); background: var(--fill); border: 1px solid transparent; font-size: 13px; line-height: 1.3; color: var(--text); }
.fc-day.incomplete { border: 1px dashed var(--stroke); }
.fc-day.none { background: transparent; border: 1px dashed var(--stroke); color: var(--muted); }
.fc-date { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin: 0; }
.fc-date strong { font-size: 14px; font-weight: 600; white-space: nowrap; }
.fc-date span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.fc-sky { display: flex; align-items: center; gap: 6px; min-height: 28px; margin: 4px 0 0; }
.fc-icon { font-size: 22px; line-height: 1; }
.fc-icon.none { font-size: 15px; color: var(--muted); }
.fc-desc { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.fc-thunder { flex: none; padding: 1px 6px; border-radius: 999px; background: rgb(122 82 199 / .12); color: #5b3a9e; font-size: 11px; font-weight: 600; }
.fc-rows { margin: 4px 0 0; }
.fc-row { padding-top: 5px; margin-top: 5px; border-top: 1px solid var(--separator); }
.fc-row dt { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fc-row dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 8px; margin: 2px 0 0; }
.fc-temp { font-weight: 600; white-space: nowrap; }
.fc-temp small { margin-left: 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.fc-snow, .fc-rain, .fc-gust { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.fc-snow { color: var(--accent); font-weight: 600; }
.fc-rain { color: #2f5f8a; }
.fc-gust { color: var(--muted); }
.fc-part { margin-left: 1px; font-size: 11px; color: var(--muted); }
.fc-gap { margin: 6px 0 0; font-size: 11px; line-height: 1.3; color: var(--muted); }
.fc-swatch { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 2px; background: var(--fc-top); }
.fc-row.base .fc-swatch, .fc-swatch.base { background: var(--fc-base); }
.fc-swatch.resort { background: var(--fc-top); }

/* Compact (Home's widget): narrower cards, one line per elevation, the key above */
.fc-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 12px 0 6px; font-size: 12px; color: var(--muted); }
.fc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.fc-days.compact { grid-auto-columns: minmax(92px, 1fr); gap: 6px; }
.fc-days.compact .fc-day { padding: 8px 8px 6px; }
.fc-days.compact .fc-date { flex-direction: column; gap: 0; }
.fc-days.compact .fc-sky { min-height: 26px; margin-top: 2px; }
.fc-days.compact .fc-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; padding-top: 3px; }
.fc-days.compact .fc-row dd { margin: 0; gap: 0 6px; }
.fc-days.compact .fc-temp small { margin-left: 3px; }

/* ---------- The graph ---------- */
.fc-graph { margin-top: 14px; }
.fc-switch { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: var(--radius-sm); background: var(--fill-2); }
.fc-switch button { flex: 1 1 auto; min-height: 34px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fc-switch button:hover { background: var(--fill-hover); }
.fc-switch button[aria-pressed="true"] { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgb(var(--navy-rgb) / .16); }
.fc-switch button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.fc-chart { margin: 10px 0 0; }
.fc-caption { font-size: 12px; color: var(--muted); }
.fc-plot { position: relative; height: 170px; margin-top: 8px; }
.fc-grid, .fc-cols { position: absolute; left: 30px; right: 0; top: 4px; }
.fc-grid { bottom: 22px; }
.fc-tick { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--separator); }
.fc-tick.zero { border-top: 1px solid var(--muted); }
.fc-tick i { position: absolute; right: calc(100% + 6px); transform: translateY(-50%); font-size: 10px; font-style: normal; line-height: 1; color: var(--muted); white-space: nowrap; }
.fc-cols { bottom: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.fc-col { display: flex; flex-direction: column; min-width: 0; }
.fc-col.today { border-radius: 6px 6px 0 0; background: rgb(var(--accent-rgb) / .05); }
.fc-bars { position: relative; flex: 1; display: flex; justify-content: center; gap: 3px; }
.fc-x { height: 22px; line-height: 22px; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }
.fc-col.today .fc-x { color: var(--accent); font-weight: 600; }
.fc-b { position: relative; width: 34%; max-width: 14px; height: 100%; color: var(--fc-top); }
.fc-b.base { color: var(--fc-base); }
.fc-fill { position: absolute; left: 0; right: 0; box-sizing: border-box; border-radius: 3px 3px 0 0; background: currentColor; }
.temp .fc-fill { border-radius: 3px; }
.fc-b.part .fc-fill { background: repeating-linear-gradient(135deg, transparent 0 3px, color-mix(in srgb, currentColor 30%, transparent) 3px 5px); border: 2px solid currentColor; }
.fc-b.missing i { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); font-size: 12px; font-style: normal; line-height: 1; color: var(--muted); }
.fc-gustline { position: absolute; left: 50%; width: 2px; margin-left: -1px; background: currentColor; }
.fc-gustline::after { content: ""; position: absolute; top: -4px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: #fff; border: 2px solid currentColor; box-sizing: border-box; }
.fc-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: 11px; color: var(--muted); }
.fc-key span { display: inline-flex; align-items: center; gap: 5px; }
.fc-swatch.gust { width: 2px; height: 11px; border-radius: 1px; background: var(--muted); }
.fc-swatch.hollow { background: transparent; border: 2px solid var(--muted); box-sizing: border-box; }

/* ---------- The numbers ---------- */
.fc-table { margin-top: 10px; }
.fc-table summary { display: inline-flex; align-items: center; min-height: 32px; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 6px; }
.fc-table summary:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.fc-table-wrap { overflow-x: auto; }
.fc-table table { width: 100%; margin-top: 4px; border-collapse: collapse; font-size: 13px; }
.fc-table th, .fc-table td { padding: 6px 8px 6px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--separator); }
.fc-table thead th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fc-table tbody th { font-weight: 600; white-space: nowrap; }
.fc-table small { display: block; font-size: 11px; color: var(--muted); text-transform: none; letter-spacing: 0; }

.fc-notes { margin: 12px 0 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.4; color: var(--muted); }
.fc-notes li + li { margin-top: 3px; }
.fc-source { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.fc-source a { color: inherit; }

/* ---------- The button that opens the dialog, and the dialog ---------- */
.fc-open { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 12px; border: 0; border-radius: 999px; background: var(--fill-2); color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fc-open:hover { background: var(--fill-hover); }
/* A 44 px target for fingers without making the pill bigger */
@media (max-width: 600px), (pointer: coarse) {
  .fc-open { position: relative; }
  .fc-open::after { content: ""; position: absolute; inset: -6px 0; }
}
.fc-open:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.fc-open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.fc-dialog { width: min(760px, calc(100vw - 32px)); max-width: none; max-height: min(92vh, 960px); padding: 0; border: 0; border-radius: var(--radius-lg); background: #fff; color: var(--text); box-shadow: var(--shadow); font-family: var(--font); }
.fc-dialog[open] { display: flex; flex-direction: column; }
.fc-dialog::backdrop { background: rgb(var(--navy-rgb) / .35); }
.fc-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; border-bottom: 1px solid var(--separator); }
.fc-dialog-head h2 { margin: 0; font-size: var(--text-title); font-weight: 600; letter-spacing: var(--tracking-title); }
.fc-dialog-name { margin: 2px 0 0; font-size: var(--text-sm); color: var(--muted); }
.fc-close { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--fill-2); color: var(--text); cursor: pointer; }
.fc-close:hover { background: var(--fill-hover); }
.fc-close:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.fc-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.fc-dialog-body { overflow-x: hidden; overflow-y: auto; padding: 0 20px 20px; overscroll-behavior: contain; }
.fc-dialog-body > .fc-week { margin-top: 12px; }
.fc-dialog-body > .fc-week > .fc-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }   /* the dialog's own title says it */
.fc-status { margin: 20px 0 8px; color: var(--muted); }
.fc-retry { min-height: 36px; padding: 6px 14px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; cursor: pointer; }

/* Phones: the dialog is a sheet from the bottom */
@media (max-width: 600px) {
  .fc-dialog { width: 100%; max-height: 94dvh; margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .fc-dialog-head { padding: 14px 16px 8px; }
  .fc-dialog-body { padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }
  .fc-plot { height: 150px; }
  .fc-switch button { flex-basis: calc(50% - 3px); }
}
