:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --bg-deep: #e9e2d5;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #fffdf8;
  --ink: #1d1d1a;
  --muted: #6d6a63;
  --line: rgba(48, 44, 38, 0.12);
  --orange: #ff6b2c;
  --orange-dark: #d8480c;
  --yellow: #ffca58;
  --green: #467853;
  --danger-bg: #fff1e7;
  --shadow: 0 18px 55px rgba(73, 53, 30, 0.1);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 7%, rgba(255, 202, 88, 0.35), transparent 26rem),
    radial-gradient(circle at 3% 38%, rgba(255, 107, 44, 0.11), transparent 22rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

body:has(dialog[open]) {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--orange) 75%, white);
  outline-offset: 3px;
}

.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;
}

.page-shell {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 48px);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: var(--ink);
  transform: rotate(-3deg);
}

.brand-mark svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button,
.round-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.icon-button svg,
.round-button svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hero {
  max-width: 780px;
  padding: clamp(46px, 8vh, 90px) 0 42px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 15px;
  color: var(--orange-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(255, 107, 44, 0.12);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.75rem, 7.6vw, 6.7rem);
  font-weight: 810;
  letter-spacing: -0.075em;
  line-height: 0.94;
}

.hero h1 span {
  color: var(--muted);
  font-size: 0.59em;
  font-weight: 640;
  letter-spacing: -0.065em;
}

.hero-copy {
  max-width: 580px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  letter-spacing: -0.025em;
  line-height: 1.75;
}

.calculator-card {
  position: relative;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.field-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-group > label,
.field-group > legend {
  display: block;
  margin: 0 0 10px;
  padding: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
  letter-spacing: 0.02em;
}

.search-group {
  position: relative;
  z-index: 5;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 20px;
  width: 24px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
  pointer-events: none;
}

input[type="search"],
input[type="number"],
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--surface-solid);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="search"] {
  height: 68px;
  padding: 0 58px 0 58px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 620;
  letter-spacing: -0.025em;
  appearance: none;
}

input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

input::placeholder {
  color: #9b978f;
  font-weight: 480;
}

input:focus,
select:focus {
  border-color: rgba(255, 107, 44, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 107, 44, 0.1);
  outline: none;
}

.clear-button {
  position: absolute;
  top: 50%;
  right: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--bg-deep);
  cursor: pointer;
  transform: translateY(-50%);
}

.clear-button svg {
  width: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 2;
}

.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  max-height: 330px;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-solid);
  box-shadow: 0 20px 45px rgba(42, 35, 26, 0.17);
}

.suggestion-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 13px;
  padding: 11px 12px;
  border: 0;
  border-radius: 14px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.suggestion-item:hover,
.suggestion-item[aria-selected="true"] {
  background: var(--bg);
}

.suggestion-emoji {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  font-size: 1.45rem;
  background: var(--bg);
}

.suggestion-copy {
  min-width: 0;
  flex: 1;
}

.suggestion-copy strong,
.suggestion-copy small {
  display: block;
}

.suggestion-copy strong {
  font-size: 0.95rem;
}

.suggestion-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.suggestion-setting {
  color: var(--orange-dark);
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.field-error {
  margin: 8px 0 0;
  color: #b72c16;
  font-size: 0.8rem;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(130px, 0.45fr);
  gap: 20px;
  margin-top: 24px;
}

.field-grid--secondary {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.segmented label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 7px 8px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.segmented input:checked + span {
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: 0 2px 9px rgba(49, 41, 31, 0.09);
}

.segmented input:focus-visible + span {
  outline: 3px solid rgba(255, 107, 44, 0.55);
}

.number-input {
  position: relative;
}

.number-input input,
select {
  height: 60px;
  padding: 0 16px;
  font-weight: 680;
}

.number-input input {
  padding-right: 50px;
  appearance: textfield;
}

.number-input input::-webkit-inner-spin-button,
.number-input input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.number-input span {
  position: absolute;
  top: 50%;
  right: 17px;
  color: var(--muted);
  font-size: 0.86rem;
  transform: translateY(-50%);
  pointer-events: none;
}

select {
  padding-right: 38px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236d6a63' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  padding: 15px 22px;
  border: 0;
  border-radius: 18px;
  color: white;
  background: var(--ink);
  box-shadow: 0 12px 28px rgba(29, 29, 26, 0.18);
  font-weight: 760;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.primary-button:hover {
  background: #33322f;
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(1px) scale(0.995);
}

.primary-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.quick-section,
.saved-section {
  padding: 86px 0 8px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.45rem);
  letter-spacing: -0.055em;
}

.section-heading .section-kicker {
  margin-bottom: 7px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.quick-card {
  position: relative;
  display: flex;
  min-height: 180px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: inherit;
  background: rgba(255, 255, 255, 0.52);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.quick-card::after {
  position: absolute;
  right: -18px;
  bottom: -28px;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: var(--card-glow, rgba(255, 202, 88, 0.28));
  content: "";
  filter: blur(2px);
}

.quick-card:hover {
  background: var(--surface-solid);
  transform: translateY(-3px);
}

.quick-card-emoji {
  position: relative;
  z-index: 1;
  font-size: 2.55rem;
  filter: drop-shadow(0 8px 12px rgba(71, 48, 20, 0.1));
}

.quick-card-copy {
  position: relative;
  z-index: 1;
}

.quick-card strong,
.quick-card small {
  display: block;
}

.quick-card strong {
  margin-bottom: 5px;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
}

.quick-card small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.text-button,
.footer-link {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.saved-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.saved-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
}

.saved-item-main {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.saved-item-emoji {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: var(--bg);
  font-size: 1.4rem;
}

.saved-item-copy {
  min-width: 0;
}

.saved-item-copy strong,
.saved-item-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-item-copy strong {
  font-size: 0.9rem;
}

.saved-item-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.saved-star {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.saved-star svg {
  width: 19px;
  fill: var(--yellow);
  stroke: #b97900;
  stroke-width: 1.5;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 86px;
  padding: 30px 0 max(34px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}

footer p {
  margin: 0;
}

dialog {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
}

dialog::backdrop {
  background: rgba(25, 22, 18, 0.52);
  backdrop-filter: blur(7px);
}

.result-dialog {
  width: min(100%, 720px);
  height: 100%;
  margin: 0 0 0 auto;
}

.dialog-inner {
  min-height: 100%;
  background: var(--bg);
  overflow-y: auto;
}

.dialog-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: max(12px, env(safe-area-inset-top)) 22px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(20px);
}

.dialog-topbar > p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 760;
  text-align: center;
}

.round-button {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.62);
}

.favorite-button[aria-pressed="true"] svg {
  fill: var(--yellow);
  stroke: #b97900;
}

.result-hero {
  padding: 16px 26px 38px;
  text-align: center;
}

.food-emoji {
  display: grid;
  width: 92px;
  height: 92px;
  margin: 14px auto 20px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 29px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 14px 35px rgba(71, 51, 26, 0.12);
  font-size: 3.15rem;
  transform: rotate(-3deg);
}

.result-context {
  margin: 0 0 7px;
  color: var(--orange-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-hero h2 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.2rem);
  letter-spacing: -0.065em;
}

.result-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 6vw, 42px);
  margin: 27px 0 13px;
}

.result-numbers > div {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.result-numbers span:not(.number-divider) {
  font-size: clamp(3.15rem, 12vw, 5.2rem);
  font-weight: 820;
  letter-spacing: -0.08em;
  line-height: 1;
}

.result-numbers small {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 720;
}

.number-divider {
  width: 1px;
  height: 58px;
  background: var(--line);
}

.result-adjustment {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.result-body {
  padding: 0 22px max(34px, env(safe-area-inset-bottom));
}

.callout {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 13px;
  padding: 16px;
  border: 1px solid rgba(220, 89, 24, 0.16);
  border-radius: 18px;
  background: var(--danger-bg);
}

.callout-icon {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: var(--orange-dark);
  background: white;
}

.callout-icon svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.callout strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.82rem;
}

.callout p {
  margin: 0;
  color: #79523d;
  font-size: 0.76rem;
  line-height: 1.55;
}

.steps-card {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.card-heading h3 {
  margin: 0;
  font-size: 0.98rem;
  letter-spacing: -0.03em;
}

.card-heading span {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(70, 120, 83, 0.1);
  font-size: 0.67rem;
  font-weight: 780;
  white-space: nowrap;
}

.steps-card ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.steps-card li {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 11px;
  align-items: start;
  padding: 15px 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
  counter-increment: steps;
}

.steps-card li:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.steps-card li::before {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: var(--bg);
  content: counter(steps, decimal-leading-zero);
  font-size: 0.64rem;
  font-weight: 800;
}

.result-actions {
  display: grid;
  gap: 10px;
  padding: 14px 0;
}

.timer-button,
.secondary-button {
  width: 100%;
  min-height: 60px;
  border-radius: 18px;
  cursor: pointer;
}

.timer-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 11px 20px;
  border: 0;
  color: white;
  background: var(--ink);
}

.timer-button svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.timer-button span {
  text-align: left;
}

.timer-button strong,
.timer-button small {
  display: block;
}

.timer-button strong {
  font-size: 0.84rem;
}

.timer-button small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.68rem;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  font-weight: 720;
}

.guide-dialog {
  width: min(100% - 28px, 640px);
  max-height: min(90vh, 850px);
  margin: auto;
  border-radius: 28px;
  background: var(--bg);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.24);
}

.guide-inner {
  max-height: min(90vh, 850px);
  overflow-y: auto;
}

.topbar-spacer {
  width: 42px;
}

.guide-content {
  padding: 20px 32px 38px;
}

.guide-content > h2 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 7vw, 3.3rem);
  letter-spacing: -0.07em;
  line-height: 1.03;
}

.guide-content > p:not(.section-kicker, .privacy-note) {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.guide-points {
  display: grid;
  gap: 1px;
  margin: 26px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--line);
}

.guide-points article {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 17px;
  background: var(--surface-solid);
}

.guide-points article > span {
  color: var(--orange-dark);
  font-size: 0.68rem;
  font-weight: 850;
}

.guide-points h3,
.guide-points p {
  margin: 0;
}

.guide-points h3 {
  font-size: 0.85rem;
}

.guide-points p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.55;
}

.source-card {
  padding: 18px;
  border-radius: 18px;
  color: white;
  background: var(--ink);
}

.source-card h3 {
  margin: 0 0 10px;
  font-size: 0.8rem;
}

.source-card a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  line-height: 1.5;
  text-decoration: none;
}

.source-card a span {
  color: white;
  font-size: 1rem;
}

.privacy-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.65;
}

.timer-dock {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  z-index: 20;
  display: flex;
  max-width: 520px;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  color: white;
  background: rgba(25, 25, 23, 0.94);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.timer-dock-main {
  display: grid;
  min-width: 0;
  flex: 1;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  padding: 8px 10px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.timer-food {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-display {
  grid-column: 1;
  grid-row: 2;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  font-weight: 790;
  letter-spacing: -0.03em;
}

.timer-status {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--ink);
  background: white;
  font-size: 0.68rem;
  font-weight: 750;
}

.timer-stop {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.timer-stop svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.toast {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  z-index: 30;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 999px;
  color: white;
  background: rgba(29, 29, 26, 0.92);
  box-shadow: 0 9px 28px rgba(0, 0, 0, 0.18);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  transform: translateX(-50%);
}

.noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  padding: 16px;
  border-radius: 14px;
  color: white;
  background: #a52f1a;
  text-align: center;
}

@media (max-width: 760px) {
  .site-header {
    height: 72px;
  }

  .hero {
    padding: 42px 0 32px;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 14.4vw, 5.3rem);
    line-height: 0.98;
  }

  .hero h1 span {
    display: inline-block;
    margin-top: 5px;
    font-size: 0.5em;
    line-height: 1.08;
  }

  .hero-copy {
    margin-top: 22px;
  }

  .calculator-card {
    margin-right: -4px;
    margin-left: -4px;
  }

  .field-grid,
  .field-grid--secondary {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .field-grid--secondary {
    margin-top: 20px;
    padding-top: 20px;
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-card {
    min-height: 158px;
  }

  .saved-list {
    grid-template-columns: 1fr;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-dialog {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .page-shell {
    padding: 0 15px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .calculator-card {
    padding: 19px;
    border-radius: 25px;
  }

  input[type="search"] {
    height: 62px;
    padding-right: 52px;
    padding-left: 50px;
  }

  .search-icon {
    left: 17px;
    width: 21px;
  }

  .segmented span {
    min-height: 47px;
    padding: 6px 4px;
    font-size: 0.74rem;
  }

  .quick-section,
  .saved-section {
    padding-top: 64px;
  }

  .quick-grid {
    gap: 9px;
  }

  .quick-card {
    min-height: 146px;
    padding: 16px;
  }

  .quick-card-emoji {
    font-size: 2.2rem;
  }

  .guide-content {
    padding: 12px 22px 30px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #151513;
    --bg-deep: #24231f;
    --surface: rgba(39, 38, 34, 0.82);
    --surface-solid: #282722;
    --ink: #f6f1e8;
    --muted: #aaa69d;
    --line: rgba(255, 255, 255, 0.1);
    --orange: #ff7840;
    --orange-dark: #ff8b5c;
    --danger-bg: #38241d;
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.26);
  }

  body {
    background:
      radial-gradient(circle at 88% 7%, rgba(163, 106, 29, 0.24), transparent 26rem),
      radial-gradient(circle at 3% 38%, rgba(255, 107, 44, 0.08), transparent 22rem),
      var(--bg);
  }

  .brand-mark,
  .primary-button,
  .timer-button,
  .source-card {
    color: #1b1a17;
    background: #f4efe5;
  }

  .primary-button:hover {
    background: white;
  }

  .icon-button,
  .round-button,
  .quick-card,
  .saved-item,
  .secondary-button {
    background: rgba(255, 255, 255, 0.045);
  }

  .quick-card:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .callout p {
    color: #d9ad97;
  }

  .steps-card {
    background: rgba(255, 255, 255, 0.06);
  }

  .timer-button small {
    color: rgba(0, 0, 0, 0.56);
  }
}

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