:root {
  color-scheme: light;
  --bg: #ffffff;
  --label: #000000;
  --text: #3c3c43;
  --secondary: #8a8a8e;
  --sep: #e0e0e3;
  --track: rgba(60, 60, 67, 0.18);
  --hl: #f2f2f4;
  --field: #ffffff;
  --field-border: #d8d8dc;
  --pill: #e9e9eb;
  --accent: #007aff;
  --red: #ff3b30;
  --red-half: rgba(255, 59, 48, 0.5);
  --green: #34c759;
  --btn: #fdfdfd;
  --btn-border: #e5e5ea;
  --grouped: #f2f2f7;
  --cell: #ffffff;
  --switch-off: #e9e9ea;
  --backdrop: rgba(0, 0, 0, 0.3);
  --chrome-height: 100px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Segoe UI", Roboto, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --label: #ffffff;
  --text: rgba(235, 235, 245, 0.8);
  --secondary: #8d8d93;
  --sep: #38383a;
  --track: rgba(235, 235, 245, 0.18);
  --hl: #161617;
  --field: #000000;
  --field-border: #2c2c2e;
  --pill: #1c1c1d;
  --accent: #0a84ff;
  --red: #ff453a;
  --red-half: rgba(255, 69, 58, 0.5);
  --green: #30d158;
  --btn: #202020;
  --btn-border: #2c2c2e;
  --grouped: #000000;
  --cell: #1c1c1e;
  --switch-off: #39393d;
  --backdrop: rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --label: #ffffff;
    --text: rgba(235, 235, 245, 0.8);
    --secondary: #8d8d93;
    --sep: #38383a;
    --track: rgba(235, 235, 245, 0.18);
    --hl: #161617;
    --field: #000000;
    --field-border: #2c2c2e;
    --pill: #1c1c1d;
    --accent: #0a84ff;
    --red: #ff453a;
    --red-half: rgba(255, 69, 58, 0.5);
    --green: #30d158;
    --btn: #202020;
    --btn-border: #2c2c2e;
    --grouped: #000000;
    --cell: #1c1c1e;
    --switch-off: #39393d;
    --backdrop: rgba(0, 0, 0, 0.5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--label); font-family: var(--font); font-size: 16px; line-height: 1.6; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.google-auto-placed { display: none !important; }

.masthead { max-width: 1040px; height: 52px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--label); font-weight: 700; font-size: 17px; text-decoration: none; white-space: nowrap; }
.brand img { border-radius: 7px; }
.masthead-preferences { display: flex; align-items: center; gap: 12px; min-inline-size: 0; }
.preference-label { display: flex; align-items: center; gap: 6px; min-inline-size: 0; font-size: 13px; color: var(--secondary); white-space: nowrap; }
.preference-label select { font-size: 13px; padding: 4px 6px; border: 1px solid var(--field-border); border-radius: 8px; background: var(--field); color: var(--label); min-inline-size: 0; max-inline-size: 150px; }
.app-promo { margin: 0; padding: 6px 16px; display: flex; flex-wrap: wrap; justify-content: center; column-gap: 10px; background: var(--hl); color: var(--text); font-size: 13px; line-height: 1.5; text-align: center; border-top: 1px solid var(--sep); border-bottom: 1px solid var(--sep); }
.app-promo a { font-weight: 600; text-decoration: none; }
.app-promo a:hover { text-decoration: underline; }

.timer-app {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  grid-template-areas:
    "edit title menu"
    "timer timer timer"
    "entry entry entry"
    "laphead laphead laphead"
    "list list list";
  align-content: start;
  max-width: 600px;
  min-height: calc(100svh - var(--chrome-height));
  margin: 0 auto;
  padding: 0 16px;
}
.toolbar { display: contents; }
.bar-button { width: 44px; height: 44px; border: 0; padding: 0; background: none; color: var(--accent); display: flex; align-items: center; justify-content: center; border-radius: 22px; }
.edit-toggle { grid-area: edit; justify-self: start; }
.menu-button { grid-area: menu; justify-self: end; }
.edit-toggle svg { width: 20px; height: 20px; }
.menu-button svg { width: 22px; height: 17px; }
.edit-toggle .icon-check, .timer-app[data-editing="true"] .edit-toggle .icon-pencil { display: none; }
.timer-app[data-editing="true"] .edit-toggle .icon-check { display: block; }
.title-area { grid-area: title; min-width: 0; display: flex; align-items: center; justify-content: center; }
.timer-title { margin: 0; font-size: 17px; font-weight: 600; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.title-input { width: 100%; height: 36px; padding: 0 10px; font-size: 17px; font-weight: 600; text-align: center; }
.field { border: 1px solid var(--field-border); border-radius: 8px; background: var(--field); color: var(--label); min-width: 0; }
.field::placeholder { color: var(--secondary); }

.timer-pane { grid-area: timer; }
.donuts { position: relative; height: 282px; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px 0; }
.timer-app[data-laps="true"] .donuts { height: 232px; gap: 24px; }
.donut { position: relative; flex: none; }
.donut-ring-slot { display: contents; }
.donut-ring { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); overflow: visible; }
.donut-ring circle { fill: none; }
.donut-track { stroke: var(--track); }
.donut-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; text-align: center; pointer-events: none; }
.donut-center p { margin: 0; max-width: 100%; }
.donut-heading { font-size: 12px; line-height: 16px; color: var(--secondary); padding-bottom: 2px; }
.donut-name { font-size: 17px; font-weight: 600; line-height: 22px; padding-bottom: 5px; overflow-wrap: anywhere; }
.donut-time { font-size: 28px; font-weight: 700; line-height: 34px; white-space: nowrap; overflow: hidden; width: 100%; font-variant-numeric: tabular-nums; }
.donut-center.small .donut-name { font-size: 12px; line-height: 16px; padding-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.donut-center.small .donut-time { font-size: 20px; line-height: 26px; }
.donut-center.overtime .donut-name, .donut-center.overtime .donut-time { color: var(--red); }

.controls { display: flex; align-items: center; justify-content: center; gap: 35px; padding: 4px 0 16px; }
.control { width: 48px; height: 48px; border: 0; padding: 0; background: none; color: var(--accent); display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.control svg { width: 30px; height: 30px; }
.control:disabled { opacity: 0.3; }
.control .icon-pause, .control[data-running="true"] .icon-play { display: none; }
.control[data-running="true"] .icon-pause { display: block; }
.pane-divider { display: none; }

.item-entry { grid-area: entry; display: flex; align-items: center; gap: 8px; padding: 12px 0 8px; border-top: 1px solid var(--sep); }
.item-entry .field { flex: 1; height: 40px; padding: 0 12px; font-size: 17px; }
.time-pill { flex: none; width: 64px; height: 36px; border: 0; border-radius: 8px; padding: 0 4px; background: var(--pill); color: var(--accent); font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.add-button { flex: none; width: 32px; height: 32px; border: 0; border-radius: 16px; padding: 0; background: var(--accent); color: #ffffff; display: flex; align-items: center; justify-content: center; }
.add-button svg { width: 16px; height: 16px; }

.lap-header { grid-area: laphead; display: flex; align-items: stretch; height: 28px; font-size: 13px; line-height: 28px; color: var(--secondary); border-bottom: 1px solid var(--sep); }
.lap-header > span:first-child { flex: 1; text-align: center; }
.lap-column { flex: none; width: var(--lap-width, 60px); margin-left: 8px; border-left: 1px solid var(--sep); text-align: center; }

.item-list { grid-area: list; list-style: none; margin: 0; padding: 0; }
.item-row { position: relative; display: flex; align-items: center; height: 52px; background: var(--bg); }
.item-row.dragging { z-index: 2; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); border-radius: 8px; }
.item-row.shifting { transition: transform 0.15s ease; }
.row-divider { position: absolute; left: 28px; right: 0; bottom: 0; height: 1px; background: var(--sep); pointer-events: none; }
.timer-app[data-laps="true"] .row-divider { left: 26px; }
.timer-app[data-editing="true"] .row-divider { left: 62px; }
.planned { flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; margin: 0 -8px; padding: 0 8px; border-radius: 8px; }
.timer-app[data-laps="true"] .planned { margin-right: 0; padding-right: 8px; }
.planned.current { background: var(--hl); }
.color-dot { flex: none; width: 28px; height: 44px; border: 0; padding: 0; background: none; display: flex; align-items: center; }
.color-dot::before { content: ""; width: 16px; height: 16px; border-radius: 8px; background: var(--dot); }
.timer-app[data-laps="true"] .color-dot, .timer-app[data-editing="true"] .color-dot { width: 26px; }
.name-button { flex: 1; min-width: 0; height: 44px; border: 0; padding: 0; background: none; text-align: left; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name-input { flex: 1; height: 36px; padding: 0 8px; margin-right: 8px; font-size: 17px; font-weight: 600; }
.time-button { flex: none; width: calc(44px + var(--extra, 0px)); height: 32px; margin-right: 12px; border: 0; border-radius: 8px; padding: 0; background: none; color: var(--secondary); font-size: 17px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timer-app[data-laps="true"] .time-button { width: calc(40px + var(--extra, 0px)); margin-right: 8px; }
.timer-app[data-editing="true"] .time-button { width: calc(56px + var(--extra, 0px)); margin-right: 8px; text-align: center; color: var(--accent); background: var(--pill); }
.handle { flex: none; width: 22px; height: 44px; border: 0; padding: 0; background: none; color: var(--secondary); display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; border-radius: 4px; }
.handle svg { width: 22px; height: 14px; }
.item-row.dragging .handle { cursor: grabbing; }
.lap-time { flex: none; width: var(--lap-width, 60px); height: 44px; line-height: 44px; padding-right: 2px; text-align: right; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; border-left: 1px solid var(--sep); border-radius: 0 8px 8px 0; }
.lap-time.current { background: var(--hl); }
.lap-time.over { color: var(--red); }
.delete-button { flex: none; width: 28px; height: 44px; margin-right: 8px; border: 0; padding: 0; background: none; color: var(--red); display: flex; align-items: center; }
.delete-button svg { width: 22px; height: 22px; }
.noscript { grid-column: 1 / -1; color: var(--secondary); text-align: center; }

.timer-app[data-editing="true"] .controls .control { opacity: 0.3; }

@media (min-width: 900px) {
  :root { --chrome-height: 88px; }
  .timer-app {
    max-width: 951px;
    height: clamp(480px, calc(100svh - var(--chrome-height)), 669px);
    min-height: 0;
    padding: 0;
    grid-template-columns: calc((100% - 81px) * 540 / 870) 1px minmax(0, 1fr) 81px;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    grid-template-areas:
      "timer divider title toolbar"
      "timer divider entry toolbar"
      "timer divider laphead toolbar"
      "timer divider list toolbar";
  }
  .toolbar { grid-area: toolbar; display: flex; flex-direction: column; align-items: center; gap: 13px; padding-top: 24px; }
  .bar-button { width: 48px; height: 48px; border-radius: 24px; border: 1px solid var(--btn-border); background: var(--btn); color: var(--label); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); }
  .edit-toggle svg { width: 22px; height: 22px; }
  .menu-button svg { width: 24px; height: 18px; }
  .timer-pane { position: relative; overflow: hidden; }
  .timer-stage { position: absolute; left: 50%; top: 0; width: 540px; height: 669px; transform: translateX(-50%) scale(var(--duo-scale, 1)); transform-origin: top center; }
  .donuts { position: absolute; left: 0; top: 40px; width: 540px; height: 496px; padding: 0; gap: 12px; }
  .timer-app[data-laps="true"] .donuts { top: 172px; height: 252px; gap: 12px; }
  .donut-center { gap: 6px; }
  .donut-heading { font-size: 13px; line-height: 18px; padding: 0; }
  .donut-name { font-size: 26px; line-height: 32px; height: 32px; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
  .donut-time { font-family: var(--rounded); font-size: 112px; line-height: 112px; height: 112px; letter-spacing: -1px; }
  .donut-center.small { gap: 2px; }
  .donut-center.small .donut-name { font-size: 17px; line-height: 22px; height: 22px; }
  .donut-center.small .donut-time { font-size: 56px; line-height: 59px; height: 59px; letter-spacing: 0; }
  .controls { position: absolute; left: 0; top: 568px; width: 540px; height: 56px; padding: 0; gap: 40px; }
  .control { width: 56px; height: 56px; }
  .control svg { width: 36px; height: 36px; }
  .pane-divider { display: block; grid-area: divider; background: var(--sep); margin: 24px 0; }
  .title-area { justify-content: flex-start; padding: 24px 16px 16px; }
  .timer-app[data-editing="true"] .title-area { padding: 20px 16px 12px; }
  .timer-title { font-size: 22px; font-weight: 700; line-height: 28px; text-align: left; }
  .title-input { font-size: 20px; font-weight: 700; text-align: left; }
  .item-entry { padding: 0 16px 8px; border-top: 0; }
  .lap-header { margin: 0 16px; }
  .item-list { overflow-y: auto; padding: 0 16px; overscroll-behavior: contain; }
}

.ad { max-width: 970px; margin: 48px auto 0; padding: 0 16px; }
.ad-label { display: none; margin: 0 0 4px; font-size: 11px; color: var(--secondary); text-align: center; }
.ad:has(ins.adsbygoogle[data-ad-status="filled"]) .ad-label { display: block; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }

.about { max-width: 760px; margin: 48px auto 0; padding: 0 16px; color: var(--text); font-size: 15px; line-height: 1.85; }
.about h1 { margin: 0 0 12px; color: var(--label); font-size: 26px; line-height: 1.4; }
.about h2 { margin: 40px 0 14px; padding-top: 24px; border-top: 1px solid var(--sep); color: var(--label); font-size: 20px; line-height: 1.4; }
.about h3 { margin: 0 0 4px; color: var(--label); font-size: 16px; line-height: 1.5; }
.about p { margin: 0; }
.lead { font-size: 16px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px 28px; }
.steps { margin: 0; padding-left: 1.4em; display: grid; gap: 16px; }
.steps li::marker { color: var(--accent); font-weight: 700; }
.notes ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.qa + .qa { margin-top: 20px; }

.site-footer { max-width: 1040px; margin: 56px auto 0; padding: 20px 16px 36px; border-top: 1px solid var(--sep); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; color: var(--secondary); font-size: 12px; }
.site-footer .brand { font-size: 16px; }
.site-footer nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer nav a { color: var(--secondary); text-decoration: none; }
.site-footer nav a:hover { color: var(--label); text-decoration: underline; }
.site-footer small { width: 100%; font-size: 11px; }

dialog { border: 0; padding: 0; color: var(--label); background: var(--cell); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); }
dialog::backdrop { background: var(--backdrop); }
.sheet { width: 560px; border-radius: 14px; background: var(--grouped); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; }
.sheet.compact { width: 380px; }
.sheet-header { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 52px; padding: 4px 8px; border-bottom: 1px solid var(--sep); background: var(--cell); }
.sheet-header > :first-child { justify-self: start; }
.sheet-header > :last-child { justify-self: end; }
.sheet-title { margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.text-button { border: 0; background: none; color: var(--accent); font-size: 17px; padding: 8px; border-radius: 8px; }
.text-button.strong, .alert-actions .strong { font-weight: 600; }
.sheet-body { overflow-y: auto; padding: 8px 16px 24px; }
.page-settings { max-inline-size: 970px; margin: 32px auto 0; padding: 24px 16px; border-block-start: 1px solid var(--sep); }
.page-settings h2 { margin: 0; font-size: 20px; }
.notification-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 20px; align-items: start; }
.group { border: 0; margin: 24px 0 0; padding: 0; min-width: 0; }
.group-title { margin: 0 0 8px; padding: 0; font-size: 15px; font-weight: 600; color: var(--text); }
legend.group-title { float: left; width: 100%; }
.group-body { clear: both; background: var(--cell); border: 1px solid var(--sep); border-radius: 10px; overflow: hidden; }
.group-footer { margin: 6px 0 0; padding: 0 16px; font-size: 13px; line-height: 1.5; color: var(--secondary); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 16px; width: 100%; border: 0; background: none; text-align: left; font-size: 17px; text-decoration: none; color: var(--label); }
.row + .row { border-top: 1px solid var(--sep); }
.row select { max-width: 60%; font-size: 16px; padding: 4px 8px; border: 1px solid var(--field-border); border-radius: 8px; background: var(--field); }
.row-link { color: var(--accent); justify-content: flex-start; }
.row-link svg { width: 22px; height: 22px; }
input[type="checkbox"][role="switch"] { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 51px; height: 31px; margin: 0; border-radius: 16px; background: var(--switch-off); cursor: pointer; transition: background 0.2s; }
input[type="checkbox"][role="switch"]::before { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #ffffff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
input[type="checkbox"][role="switch"]:checked { background: var(--green); }
input[type="checkbox"][role="switch"]:checked::before { transform: translateX(20px); }
.pattern-list { clear: both; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.pattern-option { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 20px; align-items: center; gap: 8px; min-block-size: 80px; padding: 12px; border: 1px solid var(--sep); border-radius: 10px; background: var(--cell); cursor: pointer; }
.pattern-option input { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; }
.pattern-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.pattern-name { overflow-wrap: anywhere; }
.swatches { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 4px; flex-wrap: wrap; }
.swatches span { width: 12px; height: 12px; border-radius: 6px; }
.pattern-check { grid-column: 2; grid-row: 1; width: 20px; height: 20px; color: var(--accent); visibility: hidden; }
.pattern-option:has(input:checked) .pattern-check { visibility: visible; }

.time-fields { display: flex; justify-content: center; gap: 12px; padding: 28px 16px 32px; background: var(--cell); }
.time-field { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 600; }
.time-field input { width: 72px; height: 44px; padding: 0 8px; border: 1px solid var(--field-border); border-radius: 8px; background: var(--field); font-size: 22px; text-align: right; font-variant-numeric: tabular-nums; }

.alert { width: 300px; border-radius: 14px; text-align: center; }
.alert form { padding: 20px 16px 0; }
.alert-title { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
.alert-message { margin: 4px 0 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.alert .field { width: 100%; height: 36px; margin-top: 14px; padding: 0 8px; font-size: 15px; }
.alert-actions { display: flex; margin: 18px -16px 0; border-top: 1px solid var(--sep); }
.alert-actions button { flex: 1; min-height: 44px; border: 0; background: none; color: var(--accent); font-size: 17px; }
.alert-actions button + button { border-left: 1px solid var(--sep); }
.alert-actions .destructive { color: var(--red); }

.drawer { inset: 0 0 0 auto; margin: 0; width: min(75vw, 380px); max-width: none; height: 100dvh; max-height: none; border-radius: 16px 0 0 16px; background: var(--bg); box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2); }
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in 0.25s ease-out; }
@keyframes drawer-in { from { transform: translateX(100%); } }
.drawer-header { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 16px; background: var(--grouped); }
.drawer-title { margin: 0; font-size: 17px; font-weight: 600; }
.icon-button { width: 36px; height: 36px; border: 0; padding: 0; background: none; color: var(--secondary); display: flex; align-items: center; justify-content: center; border-radius: 18px; }
.icon-button svg { width: 26px; height: 26px; }
.drawer-actions { flex: none; display: grid; gap: 10px; padding: 16px; border-bottom: 1px solid var(--sep); }
.drawer-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bordered { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 10px; background: var(--pill); color: var(--accent); font-size: 15px; }
.bordered svg { width: 20px; height: 20px; }
.drawer-section { flex: none; margin: 0; padding: 10px 16px 8px; font-size: 17px; font-weight: 600; border-bottom: 1px solid var(--sep); }
.saved-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.saved-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--sep); }
.saved-load { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 10px 8px 10px 16px; border: 0; background: none; text-align: left; }
.saved-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.saved-title { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-meta { font-size: 12px; color: var(--secondary); white-space: nowrap; }
.saved-date { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--secondary); }
.saved-date svg { width: 12px; height: 12px; }
.saved-delete { flex: none; width: 48px; border: 0; padding: 0; background: none; color: var(--red); display: flex; align-items: center; justify-content: center; }
.saved-delete svg { width: 22px; height: 22px; }
.saved-empty { padding: 14px 16px; color: var(--secondary); font-style: italic; }

.feedback-form { display: grid; gap: 12px; padding-top: 16px; }
.feedback-lead { margin: 0; font-size: 15px; line-height: 1.6; color: var(--secondary); }
.feedback-form textarea { min-height: 140px; resize: vertical; padding: 10px; border: 0; border-radius: 12px; background: var(--cell); font-size: 17px; line-height: 1.5; }
.feedback-error { margin: 0; font-size: 13px; color: var(--red); }
.primary-button { min-height: 48px; border: 0; border-radius: 12px; background: var(--accent); color: #ffffff; font-size: 17px; font-weight: 600; }
.primary-button:disabled { opacity: 0.5; }
.feedback-sent { display: grid; justify-items: center; gap: 6px; padding: 48px 16px; text-align: center; }
.feedback-sent p { margin: 0; }
.sent-mark { font-size: 48px; line-height: 1.2; }
.sent-title { font-size: 17px; font-weight: 600; }
.sent-note { color: var(--secondary); }

@media (max-width: 680px) {
  .preference-label > span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .masthead-preferences { gap: 8px; }
  .preference-label select { inline-size: 120px; }
  #language { inline-size: 100px; }
}

@media (max-width: 480px) {
  .pattern-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pattern-option { grid-template-columns: minmax(0, 1fr) 16px; gap: 4px; min-block-size: 0; padding: 10px; }
  .pattern-name { font-size: 14px; }
  .pattern-check { width: 16px; height: 16px; }
  .masthead { padding-inline: 8px; gap: 6px; }
  .masthead .brand { gap: 4px; font-size: 13px; }
  .masthead .brand img { inline-size: 22px; block-size: 22px; }
  .masthead-preferences { gap: 4px; }
  .preference-label select { inline-size: 110px; font-size: 12px; padding-inline: 3px; }
  #language { inline-size: 80px; }
  .sheet, .sheet.compact { width: 100%; }
  .time-fields { gap: 8px; padding-inline: 8px; }
  .time-field input { width: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer[open] { animation: none; }
  .item-row.shifting { transition: none; }
  input[type="checkbox"][role="switch"], input[type="checkbox"][role="switch"]::before { transition: none; }
}
