/* RadTime app layout. Colours, radii, fonts and effects come ONLY from the --rt-* tokens and the .rt-* hooks in
   skins.css (so every skin works); this file adds layout, spacing and the app's own components.
   Mobile first: 375 px works with no horizontal scroll and 44 px touch targets. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--rt-font); font-size: 1rem; line-height: 1.5; color: var(--rt-text);
  background: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3, p { margin: 0; }
a { color: var(--rt-accent); }
a:hover { text-decoration: none; }
kbd {
  display: inline-block; min-width: 1.4em; padding: 0 0.35em; text-align: center; font-size: 0.8em; line-height: 1.5;
  border: 1px solid var(--rt-line-strong); border-radius: var(--rt-radius-sm); background: var(--rt-well); color: var(--rt-muted);
}
[hidden] { display: none !important; }

/* ---- utilities ------------------------------------------------------- */
.rt-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.rt-skip {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 100; padding: 0.6rem 1rem; border-radius: var(--rt-control-radius);
  background: var(--rt-surface); color: var(--rt-text); border: 1px solid var(--rt-accent);
}
.rt-skip:focus { top: 0.5rem; }
.rt-card { padding: 1rem; }
.rt-h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.5rem; }
.rt-h3 { font-size: 1rem; font-weight: 600; }
.rt-label { display: block; font-weight: 500; margin-bottom: 0.25rem; }
.rt-hint { font-size: 0.85rem; margin-top: 0.5rem; }
.rt-plain-list { list-style: none; margin: 0.5rem 0; padding: 0; }
.rt-field-error { color: var(--rt-bad); font-size: 0.9rem; margin-top: 0.25rem; }
.rt-field-warn { color: var(--rt-warn); font-size: 0.9rem; margin-top: 0.25rem; }
.rt-noscript { margin: 1rem 0; }
.rt-row-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 0; }
.rt-btn-small { padding: 0.4rem 0.75rem; font-size: 0.9rem; }
.rt-btn-icon { padding: 0.4rem; min-width: 44px; }
.rt-danger {
  /* Own label/hover tokens too: holo's dark --rt-on-button gave only 3.11:1 on this red (A11Y-01); white is 6.5:1.
     tests/contrast/check.mjs verifies these for every skin. */
  --rt-button: #b3261e; --rt-button-image: none; --rt-on-button: #ffffff;
  --rt-button-hover-bg: #8c1c15; --rt-button-hover-fg: #ffffff; --rt-button-hover-filter: none;
}
.rt-danger-btn { border-color: var(--rt-bad); color: var(--rt-bad); }
.rt-callout { border: 1px solid var(--rt-bad); border-radius: var(--rt-radius-sm); padding: 0.75rem; margin: 0.75rem 0; }

/* ---- header ---------------------------------------------------------- */
.rt-chrome-inner {
  max-width: 70rem; margin: 0 auto; padding: 0.5rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
}
.rt-brand { display: flex; align-items: baseline; gap: 0.6rem; margin-right: auto; }
.rt-wordmark { font-family: var(--rt-font-heading); font-size: 1.5rem; font-weight: 700; letter-spacing: var(--rt-heading-tracking); color: var(--rt-text); text-decoration: none; }
.rt-wordmark span { color: var(--rt-accent); }
.rt-byline { font-size: 0.85rem; color: var(--rt-muted); }
.rt-chrome-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.header-controls { display: flex; align-items: center; }
.rt-nav { max-width: 70rem; margin: 0 auto; padding: 0 0.5rem; }
.rt-tabs { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
.rt-tabs .rt-tab { flex: 1 1 0; white-space: nowrap; }

.rt-skinpicker { display: flex; }
.rt-skin-dot {
  width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
.rt-skin-dot .rt-swatch { width: 1.4rem; height: 1.4rem; }
.rt-skin-dot[aria-checked="true"] .rt-swatch { box-shadow: 0 0 0 2px var(--rt-bg), 0 0 0 4px var(--rt-accent); }

.rt-syncdot {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.6rem; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--rt-control-radius); color: var(--rt-muted); font: inherit; font-size: 0.85rem;
}
.rt-syncdot:hover { background: var(--rt-hover); color: var(--rt-text); }
.rt-syncdot .rt-dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--rt-dim); flex: none; }
.rt-syncdot[data-state="idle"] .rt-dot { background: var(--rt-ok); }
.rt-syncdot[data-state="syncing"] .rt-dot { background: var(--rt-info); }
.rt-syncdot[data-state="offline"] .rt-dot, .rt-syncdot[data-state="paused"] .rt-dot { background: var(--rt-warn); }
.rt-syncdot[data-state="error"] .rt-dot, .rt-syncdot[data-state="signedout"] .rt-dot { background: var(--rt-bad); }

/* the account menu AuthUI inserts into .header-controls, mapped onto the skin */
[data-rt-skin], :root:not([data-rt-skin]) {
  --glass-bg: var(--rt-surface); --glass-blur: var(--rt-blur); --glass-blur-heavy: blur(20px);
  --glass-border-color: var(--rt-line-strong); --glass-border-hover: var(--rt-accent);
  --glass-highlight: 0 0 0 0 transparent; --glass-highlight-strong: 0 0 0 0 transparent;
  --glass-radius-sm: var(--rt-control-radius); --glass-radius-lg: var(--rt-radius-lg);
  --glass-shadow: 0 0 0 0 transparent; --glass-shadow-sm: 0 0 0 0 transparent; --glass-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --aquamarine: var(--rt-accent); --aquamarine-rgb: var(--rt-accent-rgb); --jungle-green: var(--rt-accent); --bronze: var(--rt-accent);
  --night: var(--rt-badge-ink); --platinum: var(--rt-text); --ash-gray: var(--rt-muted);
}
.user-menu { margin-left: 0; }
.user-menu-btn, .auth-form button[type="submit"] {
  background-color: var(--rt-button); background-image: var(--rt-button-image); color: var(--rt-on-button); border: var(--rt-button-border);
  border-radius: var(--rt-control-radius); min-height: 44px; font-weight: var(--rt-button-weight); box-shadow: none; text-transform: none; letter-spacing: 0;
}
.user-menu-btn:hover, .auth-form button[type="submit"]:hover { background-color: var(--rt-button-hover-bg); color: var(--rt-button-hover-fg); filter: var(--rt-button-hover-filter); transform: none; box-shadow: none; }
.user-dropdown-btn { min-height: 44px; background: var(--rt-surface); color: var(--rt-text); }
.user-dropdown-content { background: var(--rt-modal-bg); }
.user-dropdown-content a { min-height: 44px; display: flex; align-items: center; }
.user-dropdown-content a:hover { background: var(--rt-hover); color: var(--rt-accent); }
.auth-modal { --glass-bg: var(--rt-modal-bg); }
.auth-modal-content { color: var(--rt-text); }
.auth-form h2 { text-shadow: none; }
.auth-form input { background: var(--rt-well); color: var(--rt-text); min-height: 44px; }
.auth-form input:focus { background: var(--rt-well); }
.auth-form input::placeholder { color: var(--rt-placeholder); opacity: 1; }
.auth-switch a, .password-toggle { color: var(--rt-accent); }
.auth-modal-close { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; top: 0.4rem; right: 0.4rem; }
.auth-message.error { color: var(--rt-bad); }
.auth-message.success { color: var(--rt-ok); }
.auth-cta { background: var(--rt-well); }

/* ---- banners / toasts / dialogs -------------------------------------- */
.rt-banners { max-width: 70rem; margin: 0 auto; padding: 0 1rem; }
.rt-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 0.75rem; padding: 0.6rem 0.9rem;
  border-left: 4px solid var(--rt-info);
}
.rt-banner[data-tone="bad"] { border-left-color: var(--rt-bad); }
.rt-banner[data-tone="warn"] { border-left-color: var(--rt-warn); }
.rt-banner-text { flex: 1 1 16rem; }
.rt-banner-actions { display: flex; gap: 0.5rem; }

.rt-toasts {
  position: fixed; left: 0; right: 0; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 0 1rem; pointer-events: none;
}
.rt-toast { pointer-events: auto; display: flex; align-items: center; gap: 0.75rem; max-width: 34rem; padding: 0.5rem 0.5rem 0.5rem 1rem; background: var(--rt-modal-bg); border: 1px solid var(--rt-line-strong); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.rt-toast[data-tone="bad"] { border-color: var(--rt-bad); }
.rt-toast[data-tone="ok"] { border-color: var(--rt-ok); }
.rt-toast-text { flex: 1; }
.rt-toast-close { min-width: 44px; min-height: 44px; background: transparent; border: 0; color: var(--rt-muted); font-size: 1.4rem; cursor: pointer; border-radius: var(--rt-control-radius); }
.rt-toast-close:hover { color: var(--rt-text); background: var(--rt-hover); }

dialog.rt-dialog { padding: 0; width: min(92vw, 30rem); }
dialog.rt-dialog-wide { width: min(94vw, 40rem); }
.rt-dialog-inner { padding: 1.25rem; }
.rt-dialog-title { font-size: 1.25rem; margin-bottom: 0.75rem; }
.rt-dialog-body > * + * { margin-top: 0.75rem; }
.rt-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }

/* ---- layout ---------------------------------------------------------- */
.rt-main { max-width: 70rem; margin: 0 auto; padding: 1rem 1rem 3rem; }
.rt-main:focus { outline: none; }
.rt-panel:focus { outline: none; }
.rt-panel:focus-visible { outline: 2px solid var(--rt-focus); outline-offset: 4px; }
.rt-footer { max-width: 70rem; margin: 0 auto; padding: 0 1rem 2rem; color: var(--rt-muted); font-size: 0.85rem; }
.rt-section-title { margin: 1.25rem 0 0.5rem; }

/* ---- timer tab ------------------------------------------------------- */
.rt-hero { text-align: center; padding: 1.25rem 1rem; }
.rt-hero-top { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.rt-hero-state { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.rt-hero-name { display: flex; align-items: center; gap: 0.5rem; font-size: 1.25rem; font-weight: 600; justify-content: center; }
.rt-hero-dot { width: 0.8rem; height: 0.8rem; }
.rt-hero-clock { font-size: clamp(3rem, 15vw, 6rem); line-height: 1.1; margin: 0.25rem 0; font-weight: 500; letter-spacing: 0.01em; }
.rt-hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.25rem; color: var(--rt-muted); }
.rt-hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.9rem; }
.rt-stop { min-width: 9rem; }

.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr)); gap: 0.6rem; }
.rt-act {
  --act-color: var(--rt-accent); justify-content: flex-start; text-align: left; gap: 0.6rem; min-height: 4.4rem; padding: 0.6rem 0.75rem; width: 100%;
}
.rt-act-chip { flex: none; width: 0.4rem; align-self: stretch; border-radius: 0.2rem; background: var(--act-color); }
.rt-act-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rt-act-name { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.rt-act-time { font-size: 0.8rem; color: var(--rt-muted); font-variant-numeric: tabular-nums; }
.rt-act-key { flex: none; align-self: flex-start; }
.rt-act[aria-pressed="true"] { background: color-mix(in srgb, var(--act-color) 22%, var(--rt-surface)); border-color: var(--act-color); box-shadow: inset 0 0 0 1px var(--act-color); }
.rt-act[aria-pressed="true"] .rt-act-time { color: var(--rt-text); }
@media (hover: none) { .rt-act-key { display: none; } }

.rt-correction { margin-top: 1.25rem; }
.rt-correction-sub { margin-bottom: 0.75rem; font-size: 0.9rem; }
.rt-field { margin-top: 0.9rem; }
.rt-field > label { display: block; font-weight: 500; margin-bottom: 0.3rem; }
.rt-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.rt-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.rt-reports-input { width: 8rem; }
.rt-avg { color: var(--rt-muted); font-variant-numeric: tabular-nums; }
.rt-fieldset { border: 0; padding: 0; margin: 1rem 0 0; min-width: 0; }
.rt-fieldset legend { font-weight: 500; padding: 0; margin-bottom: 0.4rem; }
.rt-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rt-type-chip { white-space: normal; }
.rt-type-chip input { width: 1.1rem; height: 1.1rem; margin: 0; flex: none; }
.rt-phi-notice { font-size: 0.85rem; color: var(--rt-muted); margin: 0 0 0.4rem; }
.rt-phi-notice strong { color: var(--rt-warn); }
.rt-note-meta { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; margin-top: 0.25rem; }
.rt-note-errors:empty, .rt-field-error:empty { display: none; }

/* ---- dashboard ------------------------------------------------------- */
.rt-dash-controls { display: flex; flex-direction: column; gap: 0.6rem; }
.rt-seg { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.rt-seg-btn { flex: 1 1 auto; padding-inline: 0.9rem; }
.rt-custom-range { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.rt-date-label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; color: var(--rt-muted); }
.rt-date { width: 11.5rem; }
.rt-range-note { font-size: 0.9rem; }
.rt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.6rem; margin-top: 0.9rem; }
.rt-kpi { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.8rem 0.9rem; }
.rt-kpi-label { font-size: 0.85rem; color: var(--rt-muted); }
.rt-kpi-value { font-size: 1.7rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rt-kpi-sub, .rt-kpi-hint { font-size: 0.8rem; }
.rt-unknown-note { margin-top: 0.5rem; }
.rt-defs { margin-top: 0.9rem; }
.rt-defs summary { cursor: pointer; font-weight: 500; min-height: 1.75rem; }
.rt-defs ul { margin: 0.6rem 0 0; padding-left: 1.2rem; color: var(--rt-muted); }
.rt-defs li + li { margin-top: 0.4rem; }
.rt-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 0.75rem; margin-top: 0.9rem; }
.rt-chart-card { min-width: 0; }
.rt-chart-card:nth-child(1), .rt-chart-card:nth-child(2) { grid-column: 1 / -1; }
.rt-chart-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.rt-chart-sub { font-size: 0.85rem; max-width: 46rem; }
.rt-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0 0 0.5rem; padding: 0; font-size: 0.85rem; color: var(--rt-muted); }
.rt-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.rt-legend-bar { width: 0.8rem; height: 0.8rem; border-radius: 2px; background: var(--rt-bad); }
.rt-legend-line { width: 1.2rem; height: 3px; border-radius: 2px; background: var(--rt-accent); }
.rt-chart-host { width: 100%; min-width: 0; }
.rt-empty-note { padding: 1rem 0; }
.rt-chart { display: block; max-width: 100%; height: auto; overflow: visible; font-family: var(--rt-font); }
.rt-ch-label { fill: var(--rt-text); font-size: 13px; }
.rt-ch-value, .rt-ch-vlabel { fill: var(--rt-text); font-size: 12px; font-variant-numeric: tabular-nums; }
.rt-ch-value { fill: var(--rt-muted); }
.rt-ch-vlabel { paint-order: stroke; stroke: var(--rt-surface-solid, var(--rt-bg)); stroke-width: 4px; stroke-linejoin: round; }
.rt-ch-axis { fill: var(--rt-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.rt-ch-sub { opacity: 0.9; }
.rt-ch-head { fill: var(--rt-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.rt-ch-empty { fill: var(--rt-muted); font-size: 13px; }
.rt-ch-grid { stroke: var(--rt-chart-grid); stroke-width: 1; stroke-dasharray: 2 4; }
.rt-ch-baseline { stroke: var(--rt-line-strong); stroke-width: 1; }
.rt-ch-track { fill: var(--rt-chart-grid); opacity: 0.55; }
.rt-ch-hl { fill: rgba(var(--rt-bad-rgb), 0.1); stroke: rgba(var(--rt-bad-rgb), 0.4); stroke-width: 1; }
.rt-ch-today { fill: rgba(var(--rt-accent-rgb), 0.1); }
.rt-ch-line { fill: none; stroke: var(--rt-accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.rt-ch-dot { fill: var(--rt-accent); stroke: var(--rt-bg); stroke-width: 2; }
.rt-ch-gap { fill: none; stroke: var(--rt-dim); stroke-width: 1.5; }
.rt-table-wrap { overflow-x: auto; }
.rt-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.rt-table th, .rt-table td { padding: 0.45rem 0.6rem; text-align: left; border-bottom: 1px solid var(--rt-line); white-space: nowrap; }
.rt-table thead th { color: var(--rt-muted); font-weight: 600; }
.rt-table tbody th { font-weight: 500; }

/* ---- history --------------------------------------------------------- */
.rt-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rt-filter-row { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.75rem; }
.rt-filter { width: auto; max-width: 100%; min-width: 12rem; }
.rt-hist-count { margin: 0.6rem 0; font-size: 0.9rem; }
.rt-day { margin-top: 1rem; }
.rt-day-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; font-size: 1rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--rt-line); }
.rt-day-total { font-size: 0.85rem; font-weight: 400; }
.rt-entries { list-style: none; margin: 0; padding: 0; }
.rt-entry { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--rt-line-soft, var(--rt-line)); align-items: center; }
.rt-entry-main { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.8rem; }
.rt-entry-chip { max-width: 100%; white-space: normal; padding-block: 0.15rem; }
.rt-entry-time { color: var(--rt-muted); font-variant-numeric: tabular-nums; }
.rt-entry-dur { font-weight: 600; }
.rt-entry-details { grid-column: 1 / 2; display: flex; flex-direction: column; font-size: 0.9rem; gap: 0.1rem; }
.rt-entry-note { font-style: italic; color: var(--rt-muted); overflow-wrap: anywhere; }
.rt-entry-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 0.4rem; }
.rt-more { margin: 1rem auto 0; display: flex; }
.rt-empty { text-align: center; margin-top: 1rem; }
.rt-form-msgs:empty { display: none; }
.rt-form-msgs { margin-top: 0.75rem; }
.rt-tz-note { font-size: 0.85rem; margin-top: 0.5rem; }
.rt-corr-fields { margin-top: 1rem; }

/* ---- settings -------------------------------------------------------- */
.rt-settings { display: grid; gap: 0.9rem; }
.rt-set-section > .rt-muted { margin-bottom: 0.5rem; }
.rt-act-edit { list-style: none; margin: 0.75rem 0; padding: 0; display: grid; gap: 0.5rem; }
.rt-act-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.6rem; background: var(--rt-well); box-shadow: none; }
.rt-act-row.is-archived { opacity: 0.7; }
.rt-act-row-main { display: flex; align-items: center; gap: 0.6rem; flex: 1 1 14rem; min-width: 0; }
.rt-act-row-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; }
.rt-act-group { width: auto; min-width: 10rem; }
.rt-act-row-move { display: inline-flex; gap: 0.25rem; }
.rt-color { width: 44px; height: 44px; padding: 2px; flex: none; background: transparent; border: 1px solid var(--rt-control-line); border-radius: var(--rt-control-radius); cursor: pointer; }
.rt-check { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; cursor: pointer; }
.rt-check input { width: 1.15rem; height: 1.15rem; margin: 0; }
.rt-add-act-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rt-add-act-row .rt-input { flex: 1 1 12rem; width: auto; }
.rt-skin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.6rem; }
.rt-skin-card { display: flex; align-items: center; gap: 0.8rem; text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%; min-height: 4.5rem; }
.rt-skin-card[aria-checked="true"] { border-color: var(--rt-accent); box-shadow: inset 0 0 0 1px var(--rt-accent); }
.rt-swatch-lg { width: 2.2rem; height: 2.2rem; }
.rt-skin-text { display: flex; flex-direction: column; }
.rt-skin-name { font-weight: 600; }
.rt-skin-blurb { font-size: 0.85rem; }
.rt-danger-zone { border-color: var(--rt-bad); }

/* ---- small screens --------------------------------------------------- */
@media (max-width: 640px) {
  .rt-chrome-inner { padding: 0.4rem 0.75rem; }
  .rt-chrome-tools { width: 100%; justify-content: space-between; }
  .rt-main { padding-inline: 0.75rem; }
  .rt-banners { padding-inline: 0.75rem; }
  .rt-tab { padding-inline: 0.4rem; font-size: 0.95rem; }
  .rt-field-row { grid-template-columns: 1fr; }
  .rt-entry { grid-template-columns: 1fr; }
  .rt-entry-actions { grid-column: 1; grid-row: auto; }
  .rt-date { width: 100%; }
  .rt-custom-range > * { flex: 1 1 8rem; }
  .rt-syncdot-text { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (min-width: 900px) {
  .rt-grid { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* AuthUI shows its modal with style="display:block"; centre it like the rest of the site's modals. */
.auth-modal[style*="block"] { display: flex !important; align-items: center; justify-content: center; }

/* ---- Windows High Contrast / forced-colors (A11Y-06) -------------------
   Forced colours strips gradients, box-shadows and most background colours, which made the four skin swatches
   identical empty circles, hid which skin / activity is selected and removed the chart legend keys.  Keep the
   swatch / key / chip fills (forced-color-adjust: none) and show every "selected" or "running" state with a thick
   system-colour outline (+ a check mark for skins) instead of a colour or shadow. */
@media (forced-colors: active) {
  .rt-swatch, .rt-legend-bar, .rt-legend-line, .rt-act-chip { forced-color-adjust: none; border: 1px solid CanvasText; }
  .rt-skin-dot { border: 1px solid ButtonText; }
  .rt-skin-dot[aria-checked="true"], .rt-skin-card[aria-checked="true"], .rt-btn[aria-pressed="true"], .rt-act[aria-pressed="true"] {
    outline: 3px solid Highlight; outline-offset: 1px; border-color: Highlight; box-shadow: none;
  }
  .rt-skin-dot[aria-checked="true"]::after { content: "\2713" / ""; position: absolute; font-weight: 700; color: CanvasText; text-shadow: 0 0 2px Canvas; pointer-events: none; }
  .rt-skin-dot { position: relative; }
  .rt-skin-card[aria-checked="true"] .rt-skin-name::after { content: " \2713 selected" / ""; }
  .rt-act[aria-pressed="true"] .rt-act-name::after { content: " (running)" / ""; }
  .rt-skin-card, .rt-act { border: 1px solid ButtonText; }
}
