/* Review shares Sonni's palette. Only punctuality adds a quiet green. */
:root { --on-time: #31592b; --on-time-soft: #e7f2dc; }
html { scroll-padding-bottom: calc(180px + env(safe-area-inset-bottom)); }
.shell { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }
.bottom-tabs {
  position: fixed; z-index: 19; inset: auto 0 0; display: flex; justify-content: center; gap: 44px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}
.bottom-tabs a { display: grid; place-items: center; min-width: 64px; min-height: 48px; border-radius: 16px; color: var(--muted); }
.bottom-tabs a[aria-current] { background: var(--sun-soft); color: var(--accent); }
.bottom-tabs svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.add-speed-dial, .feedback-fab { bottom: calc(84px + env(safe-area-inset-bottom)); }
.feedback-fab { position: fixed; z-index: 20; right: max(18px, calc((100vw - 720px) / 2 + 18px)); }
#performance-view { padding-top: 24px; }
#performance-view h3 { font-family: var(--display); font-size: 1.1rem; margin: 0 0 14px; }
.review-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.review-hero > div { flex: 1; min-width: 0; }
.review-hero h2 { font-size: clamp(1.4rem, 5vw, 2rem); line-height: 1.15; margin-bottom: 12px; text-wrap: balance; }
.review-hero p:not(.eyebrow) { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.review-hero img { flex: 0 0 auto; width: clamp(104px, 30vw, 150px); height: auto; }
.review-controls, .review-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-controls label { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.review-controls select { width: auto; max-width: 210px; padding: 10px; }
.review-controls button { flex: 0 0 44px; padding: 10px; }
#performance-view button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.review-sync { min-height: 2.7em; margin-top: 10px; font-size: .78rem; color: var(--muted); line-height: 1.4; }
.review-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 24px; }
.review-metrics > div { padding: 18px 12px 18px 0; border-top: 1px solid var(--line); }
.review-metrics > div:nth-child(even) { padding-left: 16px; padding-right: 0; }
.review-metrics dt { font-size: .8rem; color: var(--muted); min-height: 2.5em; }
.review-metrics dd { margin: 0 0 6px; font-family: var(--display); font-size: clamp(1.65rem, 6vw, 2.5rem); font-variant-numeric: tabular-nums; }
.review-metrics small { display: block; max-width: 24ch; font-size: .76rem; line-height: 1.45; color: var(--muted); }
.timeliness-bar { display: flex; height: 12px; border-radius: 8px; overflow: hidden; background: var(--line); }
.timeliness-bar span { flex-basis: 0; }
.timeliness-bar .on-time { background: var(--on-time); }
.timeliness-bar .late { background: var(--accent); }
.timeliness-bar .unknown { background: var(--muted); }
.timeliness-legend { font-size: .8rem; line-height: 1.6; margin: 10px 0; }
.review-note { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.review-insights { margin: 20px 0 0; padding: 0 0 0 18px; color: var(--muted); font-size: .85rem; line-height: 1.6; }
.review-insights:empty { display: none; }
.review-insights li + li { margin-top: 8px; }
.timeline-section, .feedback-section { margin-top: 32px; }
.review-section-head h3 { margin: 0 !important; }
#timeline-range { margin: 0; font-variant-numeric: tabular-nums; }
.timeline-range-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#timeline-today { flex: 0 0 44px; width: 44px; height: 44px; padding: 8px; }
#performance-view #timeline-today svg { width: 26px; height: 26px; }
.timeline-now-day { fill: currentColor; stroke: none; font-family: inherit; font-size: 8px; font-weight: 700; }
.timeline-controls { display: flex; flex-shrink: 0; gap: 0; }
.timeline-controls button { width: 44px; height: 44px; padding: 10px; border-color: transparent; }
.timeline-controls button:disabled { cursor: default; }
.timeline-viewport { position: relative; height: 124px; overflow: hidden; touch-action: none; border-radius: 12px; }
.timeline-viewport[data-animating="true"] .timeline-empty { visibility: hidden; }
.timeline-inner { position: relative; }
.timeline-inner > svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.timeline-axis, .timeline-tick { stroke: var(--line); fill: none; stroke-width: 1.5; }
.timeline-tick-label { fill: var(--muted); font-size: 12px; }
.timeline-connection { stroke: var(--muted); stroke-width: 1; fill: none; opacity: .5; }
.timeline-connection.on-time { stroke: var(--on-time); }
.timeline-connection.late { stroke: var(--accent); }
.timeline-connection.unknown { stroke-dasharray: 3 3; }
.timeline-event { position: absolute; height: 44px; padding: 0; transform: translate(-50%, -50%); border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.timeline-event:hover { background: var(--sun-soft); }
.timeline-event:focus-visible, .timeline-viewport:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.timeline-dot { position: absolute; width: 10px; height: 10px; border: 2px solid var(--muted); border-radius: 50%; background: var(--muted); transform: translate(-50%, -50%); }
.timeline-dot.created { background: var(--bg); }
.timeline-dot.on-time { background: var(--on-time); border-color: var(--on-time); }
.timeline-dot.late { background: var(--accent); border-color: var(--accent); }
.timeline-dot.unknown { background: var(--bg); border-style: dashed; }
.timeline-dot.feedback { background: var(--sun); border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--muted); }
.timeline-dot.pending { border-style: dashed; opacity: .65; }
.timeline-count { position: absolute; left: 50%; top: 34px; transform: translateX(-50%); font-size: 12px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.timeline-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .76rem; margin: 0 0 10px; }
.timeline-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.timeline-legend .timeline-dot { position: static; display: inline-block; transform: none; flex-shrink: 0; }
#timeline-help { margin: 0; }
.timeline-empty { position: absolute; inset: 78px 12px auto; margin: 0; color: var(--muted); text-align: center; font-size: .8rem; line-height: 1.5; }
.timeline-choices { list-style: none; padding: 0; margin: 12px 0 0; }
.timeline-choices button { width: 100%; min-height: 44px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); text-align: left; font-size: .85rem; line-height: 1.5; overflow-wrap: anywhere; }
.timeline-choices button:hover { background: var(--sun-soft); }
.feedback-list { list-style: none; padding: 0; margin: 0; }
.feedback-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.feedback-item { background: transparent; border: 0; color: var(--text); border-radius: 8px; text-align: left; padding: 8px 4px; }
.feedback-item small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; margin-bottom: 6px; }
.feedback-item span { display: block; overflow-wrap: anywhere; }
.feedback-list li > small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.feedback-list li > button.compact { margin-left: 12px; }
.review-explanation { margin-top: 28px; font-size: .85rem; line-height: 1.6; color: var(--muted); }
.review-explanation summary { cursor: pointer; min-height: 44px; padding-block: 12px; color: var(--text); }
.review-explanation p { margin: 12px 0; }
.review-dialog { width: min(600px, calc(100% - 24px)); max-height: calc(100dvh - 36px); overflow-y: auto; border: 1px solid var(--line); border-radius: 24px; padding: 20px; background: var(--bg); color: var(--text); box-shadow: var(--lift); }
.review-dialog::backdrop { background: rgb(34 27 20 / 42%); }
.review-dialog [hidden] { display: none !important; }
.review-dialog .modal-head { margin-bottom: 12px; }
.review-dialog .icon-button { min-width: 44px; }
.review-detail-meta { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr; gap: 10px 14px; font-size: .82rem; }
.review-detail-meta dt { color: var(--muted); }
.review-detail-meta dd { margin: 0; overflow-wrap: anywhere; }
.review-dialog a { color: var(--accent); }
.review-dialog > a { display: inline-block; padding: 12px 0; }
#review-detail-body { margin-block: 24px; }
.review-dialog .markdown-excerpt { color: var(--text); font-size: 1rem; overflow: visible; }
.review-dialog .markdown-excerpt::before { display: none; }
#feedback-form-error { color: var(--danger); font-size: .85rem; line-height: 1.5; }
#feedback-form-error:empty { display: none; }
body:has(.review-dialog[open]) { overflow: hidden; }
@media (max-width: 360px) { .review-controls label { gap: 6px; } .review-controls select { max-width: 184px; } }
