/* ---------- Base ---------- */
:root {
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --paper: #f7f1e6;
  --paper-deep: #efe5d4;
  --card: #fffcf6;
  --ink: #2b241c;
  --ink-soft: #5d5042;
  --muted: #8b7a66;
  --line: #e6d9c5;
  --line-strong: #d8c7ac;
  --terra: #b8542f;
  --terra-dark: #94401f;
  --terra-soft: #f7e4da;
  --olive: #4d6244;
  --olive-soft: #e9eee1;
  --gold: #c08a2e;
  --green: #407a51;
  --shadow-sm: 0 1px 2px rgba(70, 50, 20, .05);
  --shadow: 0 14px 34px -18px rgba(70, 50, 20, .45), 0 2px 6px rgba(70, 50, 20, .05);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 24px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  background-color: var(--paper);
  background-image:
    radial-gradient(900px 480px at 100% -12%, rgba(192, 138, 46, .12), transparent 60%),
    radial-gradient(720px 420px at -12% 4%, rgba(184, 84, 47, .08), transparent 62%);
  background-attachment: fixed;
}

body.modal-open { overflow: hidden; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid rgba(184, 84, 47, .35); outline-offset: 2px; }

.eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--terra);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s;
}
.btn:active { transform: translateY(1px); }
.btn-icon { width: 17px; height: 17px; }
.btn-primary {
  background: var(--terra);
  color: #fff9f2;
  box-shadow: 0 2px 0 rgba(110, 48, 18, .22), 0 8px 18px -10px rgba(184, 84, 47, .75);
}
.btn-primary:hover { background: var(--terra-dark); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.btn-ghost:hover { background: #f5ecdd; color: var(--ink); }
.btn-danger { background: #a23a29; color: white; }
.btn-danger:hover { background: #852a1b; }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--ink); background: #f5ecdd; }
.icon-btn svg { width: 18px; height: 18px; }

.link-btn {
  border: 0; background: none; padding: 0;
  color: var(--terra); font-size: 13px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 241, 230, .9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.logo-mark { width: 42px; height: 42px; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--serif); font-size: 21px; line-height: 1.1; letter-spacing: -.02em; }
.brand-tag {
  margin-top: 3px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: 28px;
  align-items: start;
}
.library, .detail { min-width: 0; }
.library-head { margin-bottom: 18px; }
.library-heading h2 { font-size: clamp(28px, 4vw, 37px); line-height: 1.1; margin-top: 5px; }
.library-sub { margin-top: 7px; color: var(--ink-soft); font-size: 14px; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 252, 246, .75);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}
.search-wrap { position: relative; flex: 1 1 240px; min-width: 190px; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted); pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 10px 12px 10px 37px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf9;
  color: var(--ink);
}
.search-wrap input::placeholder { color: #a3937e; }
.select-wrap { flex: 0 1 auto; }
.toolbar select {
  min-width: 145px;
  max-width: 100%;
  padding: 10px 32px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: #fffdf9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%237a6a58' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  appearance: none;
  color: var(--ink);
  cursor: pointer;
}
.toolbar select:disabled { opacity: .55; cursor: default; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--terra) !important;
  box-shadow: 0 0 0 3px rgba(184, 84, 47, .14) !important;
}

.results-meta {
  min-height: 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 2px 8px;
}
.result-count { font-size: 13px; color: var(--muted); }

/* ---------- Recipe cards ---------- */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 18px;
}
.recipe-card {
  display: flex; flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.recipe-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-deep); }
.card-media img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.recipe-card:hover .card-media img { transform: scale(1.04); }
.media-placeholder {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 48px;
  text-shadow: 0 4px 10px rgba(60, 40, 15, .12);
}
.country-badge {
  position: absolute; left: 10px; top: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: calc(100% - 20px);
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 999px;
  background: rgba(255, 252, 246, .92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(40, 25, 10, .12);
  color: var(--ink-soft);
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 18px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cat-pill {
  padding: 4px 8px; border-radius: 7px;
  background: var(--olive-soft); color: var(--olive);
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-time { flex: none; color: var(--muted); font-size: 12px; }
.card-body h3 { font-size: 19px; line-height: 1.25; }
.card-desc {
  color: var(--ink-soft); font-size: 13px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.storage-note { margin-top: 26px; color: var(--muted); font-size: 12px; text-align: center; }

/* ---------- Empty state ---------- */
.empty-state {
  padding: 54px 24px;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: 20px;
  background: rgba(255, 252, 246, .52);
}
.empty-emoji { font-size: 44px; line-height: 1; }
.empty-state h3 { margin: 14px 0 7px; font-size: 25px; }
.empty-state p { max-width: 42ch; margin: 0 auto; color: var(--ink-soft); font-size: 14px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }

/* ---------- Recipe detail ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
  color: var(--ink-soft); font-size: 14px; font-weight: 600;
  text-decoration: none;
}
.back-link:hover { color: var(--terra); }
.detail-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 6px;
}
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.detail-hero { position: relative; aspect-ratio: 21 / 9; background: var(--paper-deep); overflow: hidden; }
.detail-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.detail-hero .media-placeholder { font-size: 82px; }
.detail-body { padding: 26px 30px 34px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-badges .badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
}
.badge.country-badge-static { border: 1px solid var(--line); background: #fbf4e9; color: var(--ink-soft); }
.badge.category-badge { background: var(--olive-soft); color: var(--olive); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
.detail-title { margin: 14px 0 9px; font-size: clamp(29px, 4.4vw, 42px); line-height: 1.08; }
.detail-desc { color: var(--ink-soft); font-size: 16px; line-height: 1.6; max-width: 66ch; }
.facts { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.fact {
  min-width: 92px;
  display: flex; flex-direction: column; gap: 3px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbf6ec;
}
.fact span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.fact strong { font-size: 14px; font-weight: 600; }
.detail-cols {
  display: grid;
  grid-template-columns: minmax(210px, .88fr) 1.12fr;
  gap: 34px;
  margin-top: 27px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}
.detail-cols h2 { margin-bottom: 14px; font-size: 22px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.45; }
.checklist input {
  flex: none; width: 17px; height: 17px; margin: 3px 0 0;
  accent-color: var(--olive); cursor: pointer;
}
.checklist label { cursor: pointer; }
.checklist input:checked + label { color: var(--muted); text-decoration: line-through; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 15px; }
.steps li {
  display: grid; grid-template-columns: 28px 1fr; gap: 12px;
  color: var(--ink-soft); font-size: 15px; line-height: 1.62;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--terra-soft); color: var(--terra-dark);
  font-family: var(--sans); font-size: 12.5px; font-weight: 700;
}

/* ---------- Timer ---------- */
.sidebar { min-width: 0; }
.timer-card {
  position: sticky;
  top: 88px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.timer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.timer-head h2 { margin-top: 3px; font-size: 22px; }
.timer-state {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap;
}
.timer-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.timer-state.ready { background: #f1ece3; color: var(--muted); }
.timer-state.running { background: var(--olive-soft); color: var(--green); }
.timer-state.paused { background: #f7edd4; color: #9a6d16; }
.timer-state.done { background: var(--terra-soft); color: var(--terra); }

.dial-wrap { position: relative; width: 190px; height: 190px; margin: 14px auto 6px; }
.dial { display: block; width: 100%; height: 100%; }
.dial-track { fill: none; stroke: #efe6d8; stroke-width: 10; }
.dial-progress {
  fill: none; stroke: var(--terra); stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset .25s linear, stroke .2s;
}
.dial-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; pointer-events: none;
}
.timer-display {
  font-family: var(--serif); font-size: 42px; line-height: 1;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.timer-sub { max-width: 140px; text-align: center; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.timer-card.is-done .dial-progress { stroke: var(--terra); }
.timer-card.is-done .timer-display { color: var(--terra); }
.timer-card.is-done { animation: donePulse 1.4s ease-in-out infinite; }
.timer-card.flash { animation: cardFlash .9s ease; }

.preset-row { display: flex; gap: 6px; margin: 8px 0 14px; }
.preset {
  flex: 1; min-width: 0;
  padding: 7px 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbf6ed;
  color: var(--ink-soft);
  font-size: 11.5px; font-weight: 600;
  cursor: pointer;
}
.preset:hover { border-color: var(--terra); color: var(--terra); background: var(--terra-soft); }
.timer-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.timer-field { display: flex; flex-direction: column; gap: 5px; }
.timer-field span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.timer-field input {
  width: 100%; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fffdf9; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.timer-field input:disabled { opacity: .6; cursor: not-allowed; }
.timer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

.wake-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.wake-row { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.wake-row input {
  flex: none; width: 20px; height: 20px; margin: 1px 0 0;
  accent-color: var(--terra); cursor: pointer;
}
.wake-row input:disabled { cursor: not-allowed; opacity: .6; }
.wake-copy { display: flex; flex-direction: column; gap: 2px; }
.wake-title { font-size: 14px; font-weight: 600; }
.wake-hint { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.wake-hint::before {
  content: ""; display: inline-block;
  width: 7px; height: 7px; margin-right: 6px; border-radius: 50%;
  background: #c9bba7; vertical-align: 1px;
}
.wake-hint.active { color: var(--green); }
.wake-hint.active::before { background: var(--green); }
.wake-hint.error { color: var(--terra); }
.wake-hint.error::before { background: var(--terra); }

.mini-timer {
  position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  display: none; align-items: center; gap: 9px;
  padding: 10px 15px;
  border: 0; border-radius: 999px;
  background: var(--ink); color: white;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.mini-timer.is-active { display: flex; }
.mini-timer.is-done { background: var(--terra-dark); }
.mini-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: pulse 1.5s infinite; }
.mini-timer.is-done .mini-dot { background: #ffd9c8; }
.mini-label { color: rgba(255, 255, 255, .65); font-size: 12px; font-weight: 500; }

/* ---------- Dialogs ---------- */
dialog {
  width: min(760px, calc(100vw - 28px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
dialog::backdrop { background: rgba(43, 36, 28, .52); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog[open] { animation: dialogIn .2s ease-out; }
.sheet-inner {
  display: flex; flex-direction: column;
  max-height: min(90vh, 900px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 30px 80px rgba(30, 20, 8, .35);
}
.sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 26px 16px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { margin-top: 3px; font-size: 26px; }
.sheet-body { padding: 20px 26px 26px; overflow-y: auto; }
.sheet-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 15px 26px;
  border-top: 1px solid var(--line);
  background: #fcf7ef;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { min-width: 0; }
.field.span-2 { grid-column: 1 / -1; }
.field > label:first-child {
  display: block; margin-bottom: 6px;
  color: var(--ink-soft); font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
}
.field .unit { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
.req { color: var(--terra); }
.field input, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf9;
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
.field input::placeholder, .field textarea::placeholder { color: #ab9b86; }
.hint { margin-top: 5px; color: var(--muted); font-size: 11.5px; }

.photo-drop {
  position: relative; display: block;
  min-height: 130px;
  overflow: hidden;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: #fdf8f0;
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.photo-drop:hover, .photo-drop.dragging { border-color: var(--terra); background: var(--terra-soft); }
.photo-placeholder {
  min-height: 130px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--muted); text-align: center;
}
.photo-icon svg { width: 30px; height: 30px; }
.photo-label { color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.photo-hint { font-size: 11.5px; }
.photo-drop img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.photo-remove {
  position: absolute; right: 10px; top: 10px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 9px;
  background: rgba(255, 252, 246, .94);
  color: var(--terra-dark);
  font-size: 12px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(40, 25, 10, .18);
  cursor: pointer;
}

dialog#confirmDialog { width: min(420px, calc(100vw - 28px)); }
.confirm-inner { padding: 28px 26px 24px; text-align: center; background: var(--card); border-radius: 20px; box-shadow: 0 30px 80px rgba(30, 20, 8, .35); }
.confirm-icon { font-size: 30px; }
.confirm-inner h2 { margin: 10px 0 8px; font-size: 23px; }
.confirm-inner p { color: var(--ink-soft); font-size: 14px; }
.confirm-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }

.toast {
  position: fixed; left: 50%; bottom: 24px;
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink); color: #fff9f2;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
  font-size: 13.5px;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity .22s, transform .22s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Motion & responsive ---------- */
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.8); } }
@keyframes donePulse { 0%, 100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 0 0 5px rgba(184, 84, 47, .16), var(--shadow); } }
@keyframes cardFlash { 0%, 100% { box-shadow: var(--shadow); } 40% { box-shadow: 0 0 0 7px rgba(192, 138, 46, .3); } }
@keyframes dialogIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; }
  .timer-display { font-size: 38px; }
  .dial-wrap { width: 172px; height: 172px; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .timer-card { position: static; }
  .dial-wrap { width: 200px; height: 200px; }
  .preset-row { max-width: 420px; margin-left: auto; margin-right: auto; }
  .timer-inputs, .timer-actions { max-width: 420px; margin-left: auto; margin-right: auto; }
  .timer-actions { margin-top: 14px; }
}
@media (min-width: 861px) {
  .mini-timer { display: none !important; }
}
@media (max-width: 620px) {
  .header-inner { padding: 11px 16px; }
  .logo-mark { width: 36px; height: 36px; }
  .brand-name { font-size: 18px; }
  .brand-tag { display: none; }
  .header-actions .btn { padding: 10px 12px; font-size: 13px; }
  .layout { padding: 20px 16px 48px; }
  .toolbar select { flex: 1 1 130px; min-width: 0; }
  .search-wrap { flex: 1 1 100%; }
  .detail-body { padding: 22px 20px 28px; }
  .detail-cols { grid-template-columns: 1fr; gap: 26px; }
  .detail-hero { aspect-ratio: 16 / 9; }
  .form-grid { grid-template-columns: 1fr; }
  .sheet-head, .sheet-body, .sheet-foot { padding-left: 18px; padding-right: 18px; }
  .timer-card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

