* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --ink: #18344c;
  --muted: #708397;
  --blue: #377fb7;
  --blue-dark: #225d8c;
  --line: #e3edf5;
  --surface: #ffffff;
  --background: #f3f8fc;
}
body {
  margin: 0; min-height: 100vh; background: var(--background); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, textarea { font: inherit; }
.app-shell { width: min(100% - 28px, 560px); margin: 0 auto; padding: 28px 0 32px; }
.topbar { text-align: center; padding: 10px 0 24px; }
.eyebrow, .section-kicker { color: #6590b2; letter-spacing: .16em; font-size: 10px; font-weight: 800; }
h1 { margin: 9px 0 4px; font-size: 27px; letter-spacing: .16em; font-weight: 800; color: #245c86; }
.subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px 18px; margin-bottom: 16px; box-shadow: 0 8px 28px rgba(41, 91, 128, .055); }
h2 { margin: 6px 0 7px; font-size: 20px; letter-spacing: -.025em; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }
.mode-switch { display: flex; padding: 4px; border-radius: 12px; background: #eef5fa; margin: 18px auto 12px; width: min(100%, 310px); }
.mode-button { border: 0; border-radius: 9px; background: transparent; color: #627b90; padding: 10px; flex: 1; font-size: 13px; font-weight: 700; cursor: pointer; }
.mode-button.active { color: #245c86; background: white; box-shadow: 0 2px 8px rgba(36, 92, 134, .10); }
.wheel-wrap { width: min(100%, 330px); aspect-ratio: 1; position: relative; margin: 0 auto; }
#cyanometer-wheel { width: 100%; height: 100%; overflow: visible; }
.wheel-segment { cursor: pointer; stroke: #fff; stroke-width: 1.3; transition: opacity .12s, stroke-width .12s; }
.wheel-segment:focus { outline: none; stroke: #173e5c; stroke-width: 3; }
.wheel-segment.selected { stroke: #183c58; stroke-width: 3; }
.wheel-centre { position: absolute; width: 39%; height: 39%; left: 30.5%; top: 30.5%; border-radius: 50%; background: white; box-shadow: 0 2px 14px rgba(26, 67, 98, .10); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px; pointer-events: none; }
.centre-label { font-size: 8px; letter-spacing: .12em; font-weight: 800; color: #8297a8; }
.wheel-centre strong { font-size: 34px; line-height: 1.1; color: #285f89; margin: 4px 0; }
.wheel-centre span:last-child { font-size: 10px; color: var(--muted); }
.scale-ends { display: flex; justify-content: space-between; max-width: 310px; margin: -2px auto 15px; color: #91a4b4; font-size: 9px; letter-spacing: .12em; font-weight: 800; }
.selected-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 14px; }
.selected-swatch { width: 42px; height: 42px; border-radius: 11px; background: #edf4f8; border: 1px solid rgba(0,0,0,.06); flex: 0 0 auto; }
.selected-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.selected-copy strong { font-size: 13px; }
.selected-copy span { color: var(--muted); font-size: 11px; }
.primary-button { width: 100%; border: 0; border-radius: 12px; background: var(--blue); color: white; padding: 14px 16px; font-weight: 750; font-size: 14px; cursor: pointer; }
.primary-button:disabled { opacity: .42; cursor: not-allowed; }
.primary-button:not(:disabled):active { background: var(--blue-dark); transform: translateY(1px); }
.fine-print { color: #94a5b3; font-size: 10px; line-height: 1.45; margin: 12px 2px 0; text-align: center; }
.journal-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 16px; }
.count-pill { background: #eef5fa; color: #47789e; padding: 6px 9px; border-radius: 20px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.empty-state { border: 1px dashed #d7e5ef; border-radius: 14px; padding: 24px 14px; display: flex; align-items: center; flex-direction: column; text-align: center; gap: 7px; }
.empty-icon { font-size: 26px; color: #8db3d0; }
.empty-state strong { font-size: 13px; }
.empty-state span { font-size: 11px; color: var(--muted); }
.reading-list { display: grid; gap: 9px; }
.reading-item { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; }
.reading-colour { width: 39px; height: 39px; border-radius: 10px; flex: 0 0 auto; }
.reading-info { min-width: 0; flex: 1; }
.reading-info strong { display: block; font-size: 12px; }
.reading-info span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.reading-note { color: #536f84; font-size: 11px; margin-top: 6px; line-height: 1.4; overflow-wrap: anywhere; }
.delete-reading { border: 0; background: transparent; color: #91a3b1; font-size: 19px; padding: 5px; cursor: pointer; }
footer { text-align: center; color: #a2b1bd; font-size: 9px; letter-spacing: .14em; padding: 8px 0; }
.dialog-backdrop { position: fixed; inset: 0; background: rgba(17, 42, 62, .42); display: grid; place-items: end center; padding: 14px; z-index: 5; }
.dialog-backdrop[hidden] { display: none; }
.dialog { width: min(100%, 480px); background: white; border-radius: 22px; padding: 24px 20px 20px; position: relative; box-shadow: 0 16px 60px rgba(10, 35, 55, .22); }
.dialog h2 { margin-bottom: 16px; }
.close-button { position: absolute; right: 16px; top: 12px; border: 0; background: transparent; font-size: 27px; color: #8196a7; cursor: pointer; }
.dialog-reading { display: flex; align-items: center; gap: 10px; background: #f5f9fc; padding: 10px; border-radius: 12px; margin-bottom: 17px; font-size: 13px; }
.dialog-reading span { width: 28px; height: 28px; border-radius: 8px; }
.dialog label { display: block; font-size: 12px; font-weight: 750; margin-bottom: 7px; }
textarea { display: block; width: 100%; resize: vertical; border: 1px solid #dce8f0; border-radius: 11px; padding: 11px; color: var(--ink); margin-bottom: 15px; outline-color: #80afd2; font-size: 13px; }
@media (min-width: 600px) { .app-shell { padding-top: 42px; } .panel { padding: 26px; } .dialog-backdrop { place-items: center; } }
