/* air-fry-fix v1 — mobile-first, one column, dark on light. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --ink: #16130f;
  --ink-soft: #57514a;
  --line: #ded7cd;
  --surface: #f7f4ef;
  --card: #fffdf9;
  --accent: #b24a17;
  --accent-ink: #8a3a12;
}

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

body {
  margin: 0 auto;
  max-width: 640px;
  padding: 16px 16px 48px;
  background: var(--surface);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
}

h1 {
  margin: 8px 0 4px;
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 1rem;
}

section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin: 0 0 16px;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

textarea,
input[type="number"],
select,
button {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

textarea {
  min-height: 112px;
  padding: 12px;
  resize: vertical;
}

input[type="number"],
select {
  min-height: 48px;
  padding: 10px 12px;
}

input,
select,
textarea {
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 1px), calc(100% - 13px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

button {
  min-height: 48px;
  padding: 12px 16px;
  margin-top: 12px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:active {
  background: var(--accent-ink);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.field {
  margin-bottom: 12px;
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* Mode toggle */
#mode {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#mode legend {
  padding: 0 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.mode-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 16px 0 0;
}

/* Radios are not in the width:100% group and need the native look back. */
.mode-option input {
  width: auto;
  margin: 0;
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: var(--accent);
}

/* Parse summary */
#parse-summary {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  min-height: 1.2em;
  overflow-wrap: break-word;
}

/* Secondary action under the summary: switch to deep-fry mode. */
#suggest-deep {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent-ink);
}

#suggest-deep:active {
  background: #fdf1e3;
}

/* Result panel */
#result {
  border-color: var(--accent);
}

#already-airfryer {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdf1e3;
  color: var(--accent-ink);
  font-weight: 600;
}

#already-airfryer:empty {
  display: none;
}

#cannot {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-ink);
}

#cannot:empty {
  display: none;
}

.numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  align-items: baseline;
}

.big {
  font-size: clamp(2.4rem, 16vw, 3.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hint-inline {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

#out-flip,
#out-doneness,
#out-broil {
  margin: 12px 0 0;
}

#out-flip:empty,
#out-doneness:empty,
#out-broil:empty {
  display: none;
}

#out-doneness {
  font-weight: 700;
}

#out-broil {
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  background: #fdf1e3;
  font-size: 0.9rem;
}

#out-warnings {
  margin: 12px 0 0;
  padding: 0 0 0 20px;
  color: var(--accent-ink);
  font-size: 0.9rem;
}

#out-warnings:empty {
  display: none;
}

#out-warnings li {
  margin-bottom: 4px;
}

/* Deep-fry notes: same shape as the warnings, calmer color. */
#out-notes {
  margin: 12px 0 0;
  padding: 0 0 0 20px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

#out-notes:empty {
  display: none;
}

#out-notes li {
  margin-bottom: 4px;
}

/* History chips */
#history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chip {
  min-height: 44px;
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
}

.chip:active {
  background: #f1ece4;
}

#history-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

footer {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

@media (min-width: 480px) {
  .row {
    grid-template-columns: 1fr 100px 1fr;
    align-items: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
