:root {
  --ink: #29241f;
  --paper: #f2eadc;
  --cream: #fffaf0;
  --copper: #c8552d;
  --dark-copper: #8d311d;
  --sage: #68755c;
  --line: rgba(41, 36, 31, .18);
  --shadow: 0 18px 55px rgba(76, 45, 25, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 7%, rgba(200,85,45,.13), transparent 29rem),
    linear-gradient(90deg, rgba(69,55,43,.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 28px 28px, auto;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }

.topbar {
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1240px;
  margin: auto;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
}
.topbar p { margin: 0; font-size: 13px; letter-spacing: .08em; color: #71665d; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-weight: 700; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--cream); background: var(--ink); }

main { overflow: hidden; }
.hero {
  max-width: 1180px;
  min-height: 485px;
  margin: 0 auto;
  padding: 72px 54px 60px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  align-items: center;
  position: relative;
}
.eyebrow { margin: 0 0 20px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; letter-spacing: .18em; color: var(--dark-copper); }
h1 { font-size: clamp(44px, 6vw, 76px); line-height: 1.02; letter-spacing: -.055em; margin: 0; font-weight: 500; }
h1 em { color: var(--copper); font-style: italic; }
.intro { max-width: 540px; margin: 28px 0; font-size: 17px; line-height: 1.8; color: #665b52; }
.hero-stats { display: flex; gap: 35px; }
.hero-stats div { display: flex; flex-direction: column; border-left: 2px solid var(--copper); padding-left: 12px; }
.hero-stats strong { font-size: 24px; }
.hero-stats span { font-size: 12px; color: #786c62; margin-top: 3px; }

.pan-visual { min-height: 330px; position: relative; display: grid; place-items: center; transform: rotate(-7deg); }
.pan { width: 270px; height: 270px; border: 24px solid var(--ink); border-radius: 50%; background: #453e37; box-shadow: inset 0 0 0 8px #191714, var(--shadow); display: grid; place-items: center; position: relative; }
.pan::after { content: ""; position: absolute; width: 175px; height: 38px; background: var(--ink); right: -165px; top: 45px; border-radius: 0 28px 28px 0; transform: rotate(-15deg); transform-origin: left; }
.food { width: 154px; height: 154px; color: #fff4df; background: var(--copper); border: 8px solid #e99255; border-radius: 48% 52% 46% 54%; display: grid; place-content: center; text-align: center; line-height: 1.25; font-size: 25px; box-shadow: inset 8px -10px 0 rgba(105,40,20,.22); transform: rotate(8deg); }
.steam { position: absolute; width: 35px; height: 95px; border: 4px solid transparent; border-left-color: rgba(141,49,29,.35); border-radius: 50%; top: 3px; z-index: 2; }
.steam.s1 { left: 35%; }.steam.s2 { left: 50%; top: -16px; }.steam.s3 { left: 65%; }

.workspace { background: var(--cream); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(360px, .82fr) minmax(520px, 1.18fr); }
.record-form, .analysis { padding: 58px max(34px, calc((100vw - 1180px) / 2)); }
.record-form { padding-right: 58px; background: #e2d6c1; }
.analysis { padding-left: 58px; }
.section-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 32px; }
.section-heading > span { font-family: ui-monospace, monospace; width: 38px; height: 38px; border: 1px solid currentColor; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: var(--copper); flex: none; }
h2 { font-size: 28px; font-weight: 500; margin: 0; letter-spacing: -.03em; }
.section-heading p { margin: 5px 0 0; color: #746960; font-size: 13px; }
.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 14px; }
.field { position: relative; display: flex; flex-direction: column; gap: 7px; }
.field.wide, .rating-field { grid-column: 1 / -1; }
.field > span, .rating-field legend { font-size: 13px; font-weight: 700; }
.field b { color: #817367; font-size: 10px; font-family: sans-serif; }
.field i { font-size: 11px; font-weight: 400; color: #817367; }
input, textarea, select { color: var(--ink); border: 0; border-bottom: 1px solid #8d7e70; border-radius: 0; background: transparent; outline: none; padding: 10px 2px; min-width: 0; }
input:focus, textarea:focus, select:focus { border-bottom-color: var(--copper); box-shadow: 0 1px 0 var(--copper); }
textarea { resize: vertical; line-height: 1.5; }
.field small { color: #897c70; font-size: 10px; align-self: flex-end; position: absolute; bottom: -15px; }
.rating-field { border: 0; margin: 0; padding: 0; }
.rating-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 10px; }
.rating-options input { position: absolute; opacity: 0; pointer-events: none; }
.rating-options label { display: flex; flex-direction: column; align-items: center; padding: 9px 3px; border: 1px solid rgba(73,61,51,.25); cursor: pointer; transition: .2s ease; }
.rating-options b { font-size: 19px; }.rating-options span { font-size: 10px; color: #75695f; }
.rating-options input:checked + label { color: white; background: var(--copper); border-color: var(--copper); transform: translateY(-3px); box-shadow: 0 5px 0 var(--dark-copper); }
.rating-options input:checked + label span { color: #ffe8d8; }
.form-error { min-height: 22px; margin-top: 16px; color: #942e23; font-size: 12px; }
.primary-button { width: 100%; border: 0; color: white; background: var(--ink); padding: 16px 20px; display: flex; justify-content: space-between; transition: .2s; }
.primary-button:hover { background: var(--copper); }.primary-button b { font-size: 20px; }

.filter-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 24px; font-size: 12px; }
.filter-row label { color: #807369; }.filter-row select { padding: 6px 22px 6px 6px; font-weight: 700; }
.filter-row > span { margin-left: auto; color: #807369; }
.empty-state { min-height: 390px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-ring { width: 96px; height: 96px; display: grid; place-items: center; border: 1px dashed #ad9d8c; border-radius: 50%; margin-bottom: 18px; }
.empty-ring span { width: 54px; height: 54px; display: grid; place-items: center; color: white; background: var(--sage); border-radius: 50%; font-size: 25px; }
.empty-state h3 { margin: 0 0 8px; font-size: 20px; }.empty-state p { max-width: 400px; line-height: 1.7; color: #776b62; font-size: 13px; margin: 0; }
.chart-topline { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.chart-topline > div:first-child { display: flex; flex-direction: column; }.chart-topline strong { font-size: 17px; }.chart-topline span { color: #81756c; font-size: 10px; margin-top: 4px; }
.legend { display: flex; gap: 12px; }.legend span { display: flex; align-items: center; gap: 5px; }
.dot-key { width: 8px; height: 8px; border-radius: 50%; background: var(--copper); }.band-key { width: 18px; height: 8px; background: rgba(104,117,92,.23); border-top: 1px solid var(--sage); }
.chart-wrap { width: 100%; overflow: hidden; margin-top: 14px; }
#scatter-chart { display: block; width: 100%; min-width: 480px; }
.chart-insight { background: #f0e7d7; border-left: 3px solid var(--sage); padding: 12px 14px; font-size: 12px; line-height: 1.6; margin: 8px 0 14px; }
.detail-card { min-height: 80px; border: 1px solid var(--line); padding: 14px 16px; display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 12px; align-items: center; }
.detail-main strong { display: block; font-size: 16px; }.detail-main span, .detail-stat span { color: #81756c; font-size: 10px; }.detail-main p { margin: 6px 0 0; font-size: 11px; color: #665b52; overflow-wrap: anywhere; }
.detail-stat { border-left: 1px solid var(--line); padding-left: 12px; }.detail-stat b { display: block; margin-top: 4px; font-size: 15px; }

.logbook { max-width: 1180px; margin: auto; padding: 70px 54px 90px; }
.log-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 25px; }
.log-heading .eyebrow { margin-bottom: 7px; }.text-button { border: 0; border-bottom: 1px solid currentColor; background: none; color: var(--dark-copper); padding: 4px 0; }
.log-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.log-row { display: grid; grid-template-columns: 85px minmax(150px, 1fr) repeat(4, minmax(75px, .55fr)) 38px; align-items: center; background: var(--paper); padding: 17px 18px; gap: 12px; }
.log-row time, .log-cell small { display: block; color: #81756c; font-size: 10px; }.log-name strong { font-size: 16px; }.log-name p { margin: 4px 0 0; color: #71655c; font-size: 11px; overflow-wrap: anywhere; }
.log-cell b { display: block; font-size: 13px; margin-top: 3px; }.score-pill { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%; color: white; background: var(--copper); font-weight: 700; }
.delete-button { border: 0; background: transparent; color: #8a7c72; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; }.delete-button:hover { color: white; background: #963628; }
.log-empty { background: var(--paper); padding: 35px; text-align: center; color: #7b6f65; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 25px); opacity: 0; pointer-events: none; padding: 11px 18px; color: white; background: var(--ink); font-size: 12px; box-shadow: var(--shadow); transition: .25s ease; z-index: 10; }.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 52px; }.pan-visual { display: none; }
  .workspace { grid-template-columns: 1fr; }.record-form, .analysis { padding: 46px max(24px, calc((100vw - 680px) / 2)); }.analysis { min-height: 520px; }
  .log-row { grid-template-columns: 72px minmax(130px, 1fr) repeat(2, minmax(65px, .5fr)) 38px; }.log-cell.temp, .log-cell.thick { display: none; }
}
@media (max-width: 600px) {
  .topbar { height: 60px; padding: 0 18px; }.topbar p { display: none; }
  .hero { padding: 46px 22px 45px; }.hero-stats { gap: 18px; }.hero-stats strong { font-size: 20px; }
  .record-form, .analysis { padding: 40px 20px; }.field-grid { grid-template-columns: 1fr 1fr; }.field:first-child { grid-column: 1 / -1; }
  .rating-options span { display: none; }.rating-options label { padding: 10px 3px; }
  .chart-wrap { overflow-x: auto; padding-bottom: 5px; }.chart-topline { flex-direction: column; }.detail-card { grid-template-columns: 1fr 1fr; }.detail-main { grid-column: 1 / -1; }
  .logbook { padding: 52px 20px 70px; }.log-row { grid-template-columns: 62px 1fr 42px 34px; padding: 14px 10px; gap: 8px; }.log-cell.time { display: none; }.log-cell.score { text-align: center; }.log-name strong { font-size: 14px; }
}

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