/* Phit stylesheet, part 5 of 8. Accounts, the date picker, the feedback page, Google and two-step sign-in, hover cards, popups, chart extras, week summaries and the zone band.
   The parts are one stylesheet cut into files: they must load in this order (index.html and the plain pages list them), because a later rule can override an earlier one. */

/* ----- accounts (hosted version) ----- */
.auth-panel { max-width: 440px; }
.auth-panel h1 { margin-bottom: 0.6rem; }
#auth-tabs { margin-bottom: 0.9rem; }
.auth-form { flex-direction: column; align-items: stretch; gap: 0.6rem; margin-bottom: 0.4rem; }
.auth-form input[type=email], .auth-form input[type=password], .auth-form input[type=text] { flex: none; width: 100%; }
.auth-form .check.consent { align-items: flex-start; font-size: var(--fs-sm); }
.auth-form .check.consent input { margin-top: 0.15rem; flex: none; }
.auth-form .check.consent a, .hint a { color: var(--accent); }
.auth-msg { margin-top: 0.6rem; }
.top-banner { display: flex; align-items: center; justify-content: center; gap: 0.8rem; flex-wrap: wrap; margin: 0; border-radius: 0; font-size: var(--fs-md); }
.top-banner .ghost { min-height: 28px; padding: 0.1rem 0.7rem; font-size: var(--fs-sm); }
/* the date picker (datepicker.js): a field that looks like the other fields, and a calendar drawn in the theme's own colours */
.dp { position: relative; }
.dp-field { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; width: 100%; min-height: 44px; padding: 0.5rem 0.75rem; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 16px; font-weight: 400; text-align: left; cursor: pointer; }
.dp-field.is-empty .dp-text { color: var(--muted); }
.dp-field:hover { border-color: var(--muted); }
.dp-field:focus-visible, .dp-pop button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dp-field svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dp-pop { position: fixed; z-index: 1000; width: 304px; max-width: calc(100vw - 16px); padding: 0.7rem 0.7rem 0.5rem; border-radius: var(--r-2xl); border: 1px solid var(--border);
  background: var(--panel); color: var(--text); box-shadow: 0 14px 40px rgb(0 0 0 / 0.35), 0 2px 8px rgb(0 0 0 / 0.2); }
.dp-pop[hidden] { display: none; }
.dp-pop button { min-height: 0; padding: 0; border: 0; border-radius: var(--r-lg); background: none; color: var(--text); font-size: var(--fs-lg); font-weight: 500; cursor: pointer; }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 0.3rem; margin-bottom: 0.45rem; }
.dp-nav { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); }
.dp-nav:hover, .dp-title:hover { background: rgb(var(--ink-rgb) / 0.08); color: var(--text); }
.dp-nav svg, .dp-title svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dp-title { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.2rem; height: 36px; font-size: 1rem; font-weight: 700; }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dp-week span { padding: 0.25rem 0 0.35rem; text-align: center; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.dp-grid { row-gap: 2px; }
.dp-day { height: 38px; position: relative; font-variant-numeric: tabular-nums; }
.dp-day:hover, .dp-month:hover { background: rgb(var(--ink-rgb) / 0.08); }
.dp-day.is-other { color: var(--muted); opacity: 0.55; }
.dp-day.is-today, .dp-month.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp-day.is-in-range { background: rgb(var(--accent-rgb) / 0.16); border-radius: 0; }
.dp-day.is-range-start { border-radius: var(--r-lg) 0 0 10px; background: rgb(var(--accent-rgb) / 0.16); }
.dp-day.is-range-end { border-radius: 0 10px 10px 0; background: rgb(var(--accent-rgb) / 0.16); }
.dp-day.is-anchor { box-shadow: inset 0 0 0 1.5px var(--accent); background: rgb(var(--accent-rgb) / 0.16); }
.dp-pop .dp-day.is-selected, .dp-pop .dp-month.is-selected { background: var(--accent); color: var(--on-accent); font-weight: 700; opacity: 1; }
.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem; padding: 0.3rem 0 0.2rem; }
.dp-month { height: 46px; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 0.4rem; padding-top: 0.4rem; border-top: 1px solid var(--border); }
.dp-pop .dp-link { height: 34px; padding: 0 0.7rem; color: var(--accent); font-size: var(--fs-base); font-weight: 600; }
.dp-link:hover { background: rgb(var(--accent-rgb) / 0.12); }

/* the feedback page */
.feedback-form { display: flex; flex-direction: column; align-items: stretch; gap: 0.35rem; margin: 1rem 0 1.5rem; }
.feedback-form label { font-weight: 600; margin-top: 0.7rem; }
.feedback-form label .hint { font-weight: 400; }
.feedback-form textarea { width: 100%; min-height: 9rem; padding: 0.6rem 0.75rem; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 16px; resize: vertical; }
.feedback-form textarea:focus, .feedback-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.feedback-form button { align-self: flex-start; margin-top: 0.8rem; }
.fb-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }     /* a field only a bot fills in */
.fb-thanks { padding: 0.9rem 1rem; border: 1px solid var(--good); border-radius: var(--r-md); }
body.no-garmin .garmin-only { display: none !important; }      /* the Garmin form is hidden wherever the experience has no Garmin (Files, Demo): not on every hosted site, since the owner's private site has it */
.button-link { display: inline-block; padding: 0.4rem 0.9rem; border: 1px solid var(--border); border-radius: var(--r-md); color: var(--muted); text-decoration: none; font-size: var(--fs-md); margin-right: 0.4rem; }
.button-link:hover { color: var(--text); border-color: var(--muted); }
button.danger { background: var(--bad); color: #fff; }
#account-dialog h3 { margin: 1rem 0 0.4rem; font-size: var(--fs-lg); }

/* ----- Sign in with Google ----- */
.or-sep { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: var(--fs-sm); margin: 0.2rem 0; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
/* Google's sign-in button: the multicolour "G" on Google's own light or dark button colours (white with a grey outline; near-black with a lighter
   outline), 40 px tall, 14 px medium text, 12 px side padding, 10 px between the G and the words. These follow Google's published branding
   guidelines as the author remembered them: check them against https://developers.google.com/identity/branding-guidelines before launch. */
:root { --gbtn-fill: #131314; --gbtn-stroke: #8e918f; --gbtn-text: #e3e3e3; }
:root[data-theme="light"] { --gbtn-fill: #ffffff; --gbtn-stroke: #747775; --gbtn-text: #1f1f1f; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 40px; min-height: 40px; padding: 0 12px; box-sizing: border-box;
  border: 1px solid var(--gbtn-stroke); border-radius: 20px; background: var(--gbtn-fill); color: var(--gbtn-text);
  font-family: Roboto, "Helvetica Neue", Arial, system-ui, sans-serif; font-weight: 500; font-size: 14px; line-height: 20px; letter-spacing: 0.25px;
  text-decoration: none; cursor: pointer; transition: box-shadow 0.15s;
}
.google-btn .g-logo { flex: none; width: 20px; height: 20px; }
.google-btn:hover { box-shadow: 0 1px 3px rgb(0 0 0 / 0.35); }
.google-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.google-btn[hidden], .or-sep[hidden] { display: none; }

/* two-step verification */
.tf-qr { width: 208px; height: 208px; margin: 0.4rem 0; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); background: #fff; }
.tf-qr svg { display: block; width: 100%; height: 100%; }
.tf-secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.05em; user-select: all; word-break: break-all; color: var(--text); }
.tf-codes { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-base); margin: 0.4rem 0; padding: 0.7rem 0.9rem; border: 1px dashed var(--muted); border-radius: var(--r-md);
  background: rgb(var(--ink-rgb) / 0.04); columns: 2; column-gap: 1.5rem; user-select: all; }
.tf-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
#tf-section[hidden], #tf-off[hidden], #tf-enrol[hidden], #tf-codes-box[hidden], #tf-on[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ----- hover on a run: the context the comparison table leaves out ----- */
.run-tip { position: fixed; z-index: 50; max-width: 340px; padding: 0.6rem 0.75rem; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: var(--fs-sm); line-height: 1.4; box-shadow: 0 6px 20px rgb(0 0 0 / 0.3); pointer-events: none; }
.run-tip[hidden] { display: none; }
.run-tip > div { margin-top: 0.3rem; color: var(--muted); }
.run-tip b { color: var(--text); font-weight: 600; }
.run-tip .tip-sub { margin-top: 0; }
.col-title { cursor: help; }

/* the "Add weeks" popup */
.week-dates { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.week-dates .field { flex: 1 1 9rem; }
.week-preview { margin: 0.5rem 0 0; font-size: var(--fs-base); }
.week-preview ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.week-preview li { margin: 0.1rem 0; }
.week-preview .more { list-style: none; margin-left: -1.2rem; color: var(--muted); }
#week-dialog .dialog-actions { flex-wrap: wrap; }

/* the "Create a block" popup */
#block-dialog .check { font-size: var(--fs-base); margin: 0.5rem 0 0; }
#block-dialog .check input:disabled + span { color: var(--muted); }
#block-dialog #block-weeks-hint { margin: 0.2rem 0 0 1.7rem; font-size: var(--fs-sm); }
.train-note { margin: 0.5rem 0 0; color: var(--text); }

/* the pace adjustments popup and its link */
.adjust-link { font-size: var(--fs-md); color: var(--accent); align-self: center; }
#adjust-dialog { max-width: 640px; }
.adjust-body { margin-top: 0.4rem; }
.adjust-body .chart-note { font-size: var(--fs-base); margin-bottom: 0.7rem; color: var(--text); }
.adjust-body .personal-box { margin-bottom: 0; }
.adjust-body .decoupling-note { margin-bottom: 0.7rem; }

/* the original pace (dashed, on the pace chart) and its label */
.chart-svg .series-line.original { stroke-dasharray: 6 4; stroke-width: 1.5; opacity: 0.85; }
.line-key.dashed { background: repeating-linear-gradient(90deg, var(--key, var(--muted)) 0 4px, transparent 4px 7px); }
.panel-toggle { position: absolute; display: inline-flex; align-items: center; gap: 0.4rem; height: 20px; padding: 0 0.35rem; min-height: 0; background: none; border: 0; border-radius: var(--r-sm); font: inherit; font-size: var(--fs-sm); color: var(--muted); cursor: pointer; opacity: 0.75; }
.panel-toggle.under { opacity: 0.12; }
.panel-toggle:hover { opacity: 1; color: var(--text); background: rgb(var(--ink-rgb) / 0.08); }
.panel-toggle[aria-pressed="true"] { opacity: 1; color: var(--text); }
.panel-toggle .line-key.dashed { --key: var(--muted); }
.panel-toggle[aria-pressed="true"] .line-key.dashed { --key: var(--text); }

/* "Show PR split": the stretch where a personal best was set */
.chart-svg .pr-area { fill: color-mix(in srgb, var(--good) 10%, transparent); stroke: var(--good); stroke-width: 1.5; stroke-dasharray: 6 4; pointer-events: none; }
.chart-svg .pr-edge { stroke: var(--good); stroke-width: 2; pointer-events: none; }
.chart-svg .pr-label { fill: var(--good); font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }

/* "Show decoupling": the measured stretch in two halves, the second tinted by how far efficiency fell */
.chart-svg .dec-half, .chart-svg .dec-outline, .chart-svg .dec-mid, .chart-svg .dec-text { pointer-events: none; }
.chart-svg .dec-half.first { fill: color-mix(in srgb, var(--muted) 12%, transparent); }
.chart-svg .dec-half.second { fill: color-mix(in srgb, var(--muted) 5%, transparent); }
.chart-svg .dec-half.second.some { fill: color-mix(in srgb, var(--warn) 16%, transparent); }
.chart-svg .dec-half.second.high { fill: color-mix(in srgb, var(--bad) 16%, transparent); }
.chart-svg .dec-outline { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 3; }
.chart-svg .dec-outline.some { stroke: var(--warn); }
.chart-svg .dec-outline.high { stroke: var(--bad); }
.chart-svg .dec-mid { stroke: var(--muted); stroke-width: 2; }
.chart-svg .dec-mid.some { stroke: var(--warn); }
.chart-svg .dec-mid.high { stroke: var(--bad); }
.chart-svg .dec-text { fill: var(--muted); font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.chart-svg .dec-text.some { fill: var(--warn); }
.chart-svg .dec-text.high { fill: var(--bad); }

.train-toolbar-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.train-toolbar-actions .hint { margin: 0; }
.adjust-body .chart-note a { color: var(--accent); }
.adjust-body .note-basis { margin: 0.4rem 0 0; font-size: var(--fs-sm); color: var(--muted); }
.chart-svg .series-line.garmin { stroke-dasharray: 1.5 4.5; stroke-width: 2; stroke-linecap: round; opacity: 0.9; }
.line-key.dotted { background: repeating-linear-gradient(90deg, var(--key, var(--muted)) 0 2px, transparent 2px 5px); }
.panel-toggle .line-key.dotted { --key: var(--muted); }
.panel-toggle[aria-pressed="true"] .line-key.dotted { --key: var(--text); }

/* the summary at the top of each Training week: zone colours (cool to hot) and the three styles */
:root { --z1: #4aa3e8; --z2: #35c48a; --z3: #f0c93a; --z4: #f29a3e; --z5: #e8554e; }
:root[data-theme="light"] { --z1: #2b7fc7; --z2: #1f9d6a; --z3: #d9a900; --z4: #e0782a; --z5: #cc3a35; }
.zbar, .wk-bar { display: flex; overflow: hidden; background: rgb(var(--ink-rgb) / 0.08); }
.zbar > i, .wk-bar > i { display: block; }
.z1 { background-color: var(--z1); } .z2 { background-color: var(--z2); } .z3 { background-color: var(--z3); } .z4 { background-color: var(--z4); } .z5 { background-color: var(--z5); }
.wk-stat { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk-none { font-size: var(--fs-sm); }
.wk-strip { display: flex; flex: 1 1 220px; min-width: 180px; max-width: 420px; margin-left: 0.3rem; }
.wk-strip .zbar { flex: 1; height: 8px; border-radius: var(--r-pill); }
.wk-b { margin: 0.1rem 0 0.5rem; }
.wk-stats { display: flex; align-items: baseline; gap: 1.4rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.wk-stats .big, .wk-nums .big { font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.wk-stats .lbl { font-size: var(--fs-sm); color: var(--muted); margin-left: 0.3rem; }
.wk-bar { height: 22px; border-radius: var(--r-sm); }
.wk-bar > i { display: flex; align-items: center; justify-content: center; font-style: normal; font-size: var(--fs-xs); font-weight: 650; color: #0b1118; }
:root[data-theme="light"] .wk-bar > i.z5 { color: #fff; }          /* the text on each zone is the one of white, dark or black that reads best on that zone's colour (4.5 to 1 or more) */
:root[data-theme="light"] .wk-bar > i.z1 { color: #000; }
.wk-bar > i.z3 { color: #1b1500; }
.wk-leg { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 0.35rem; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-leg > span { display: inline-flex; align-items: center; gap: 0.3rem; }
.wk-leg .dot { width: 9px; height: 9px; border-radius: 3px; }
.wk-c { display: grid; grid-template-columns: auto minmax(220px, 1fr); gap: 0.4rem 1.2rem; align-items: end; margin: 0.1rem 0 0.5rem; }
.wk-nums { display: flex; gap: 1.1rem; align-items: baseline; }
.wk-nums > span { display: block; }
.wk-nums .lbl { display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: 0.2rem; }
.wk-meter { position: relative; padding-top: 11px; }
.wk-grad { height: 12px; border-radius: var(--r-pill); }
.wk-mark { position: absolute; top: 0; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--text); transform: translateX(-5px); }
.wk-ticks { position: relative; height: 1.1em; margin-top: 4px; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-ticks > span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.wk-cap { margin-top: 2px; font-size: var(--fs-xs); }
@media (max-width: 640px) { .wk-c { grid-template-columns: 1fr; } }

/* "Show interval HR trend": the peak heart rate of each rep and the low of each rest, with a trend line through each */
:root { --lowhr: #a98bf5; }
:root[data-theme="light"] { --lowhr: #6a49d1; }
.chart-svg .iv-trend { pointer-events: none; }
.chart-svg .iv-dot { stroke: var(--panel); stroke-width: 1.5; }
.chart-svg .iv-dot.peak { fill: var(--bad); }
.chart-svg .iv-dot.low { fill: var(--lowhr); }
.chart-svg .iv-line { stroke-width: 2; stroke-dasharray: 6 4; }
.chart-svg .iv-line.peak { stroke: var(--bad); }
.chart-svg .iv-line.low { stroke: var(--lowhr); }
.chart-svg .iv-text { font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.chart-svg .iv-text.peak { fill: var(--bad); }
.chart-svg .iv-text.low { fill: var(--lowhr); }

/* the heart-rate zone band along the top of the first chart, its legend and the zone tag in the hover readout */
.chart-svg .zb.zt1 { fill: var(--z1); } .chart-svg .zb.zt2 { fill: var(--z2); } .chart-svg .zb.zt3 { fill: var(--z3); }
.chart-svg .zb.zt4 { fill: var(--z4); } .chart-svg .zb.zt5 { fill: var(--z5); }
.chart-svg .zone-band-label { fill: var(--muted); font-size: 10px; }
.zone-tag.zt1 { background: var(--z1); } .zone-tag.zt2 { background: var(--z2); } .zone-tag.zt3 { background: var(--z3); }
.zone-tag.zt4 { background: var(--z4); } .zone-tag.zt5 { background: var(--z5); }
.zone-group { display: inline-flex; align-items: center; gap: 0.5rem; }
.zone-settings { font-size: var(--fs-sm); color: var(--accent); }
.zone-tag { padding: 0 0.3rem; border-radius: 4px; font-size: var(--fs-xs); font-weight: 700; color: #0b1118; line-height: 1.35; }
:root[data-theme="light"] .zone-tag { color: #fff; }
.zone-tag.zt3 { color: #1b1500 !important; }

/* ----- the PR chart: a good surprise in green beside room to improve in orange, the card over a point, and the "about this" icon ----- */
.pc-dot-good { fill: var(--good); } .pc-ring-good { stroke: var(--good); } .pc-drop-good { stroke: var(--good); }
.pc-tag-good { fill: var(--good-ink); } .pc-mark-good { background: var(--good); } .pc-gain-good { color: var(--good-ink); }
.pc-good-title { margin-top: 1.1rem; }
.run-tip .tip-room { color: var(--series-2); font-weight: 600; } .run-tip .tip-good { color: var(--good-ink); font-weight: 600; }
.info-ico { display: block; width: 14px; height: 14px; }
.info-stem { fill: currentColor; } .info-dot { fill: var(--good); }
.compare-info { margin-left: 0.4rem; vertical-align: middle; }
.records-range { max-width: 34rem; margin: 0 0 0.2rem; } .records-range[hidden], .records-range-hint[hidden] { display: none; }
.records-range-hint { margin: 0 0 0.9rem; }
