:root {
  --espresso: #2A1E17;
  --espresso-2: #35271E;
  --card: #EDE3D3;
  --card-line: #DACDB6;
  --ochre: #C0774A;
  --warm-sand: #E7DCC7;
  --buff: #CBBBA0;
  --ink: #2A1E17;
  --gold: #C9A983;
  --terracotta: #D1A58F;
}

body {
  background: var(--espresso);
  color: var(--warm-sand);
  margin: 0;
  font-family: 'Noto Sans', system-ui, sans-serif;
  font-size: 16px;
  min-height: 100dvh;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px calc(16px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.wordmark {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--warm-sand);
  margin: 0;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tab {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--buff);
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  background: transparent;
}

.tab.is-active {
  background: var(--espresso-2);
  color: var(--warm-sand);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.brewer-toggle {
  display: flex;
  background: var(--espresso-2);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
}

.pill {
  flex: 1;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--buff);
  padding: 10px;
  border-radius: 999px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
}

.pill.is-active {
  background: var(--ochre);
  color: #fff;
}

.recipe-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 16px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  border-left: 4px solid var(--ochre);
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 1px, transparent 1px), linear-gradient(to right, var(--card-line) 1px, transparent 1px);
  background-size: 100% 24px, 100% 24px;
}

.recipe-list .card {
  cursor: pointer;
}

.recipe-list .card:active {
  transform: translateY(1px);
}

.card-tab {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ochre);
  font-weight: 500;
}

.recipe-list .card h3 {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 18px;
  margin: 4px 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.recipe-list .card .card-ratio {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: #6b5a48;
  font-size: 14px;
}

.back {
  background: none;
  border: none;
  color: var(--buff);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 15px;
  padding: 4px 0 12px;
  cursor: pointer;
}

.detail-card {
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 20px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  border-left: 4px solid var(--ochre);
}

.detail-title {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 4px 0;
  color: var(--ink);
}

.detail-ratio {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--ochre);
  font-size: 16px;
  margin-bottom: 12px;
}

.dose {
  margin: 12px 0;
}

.dose-label {
  display: block;
  font-size: 13px;
  color: #6b5a48;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dose-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--card-line);
  background: #fff8ec;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.dose-input {
  flex: 1;
  text-align: center;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 28px;
  font-weight: 500;
  padding: 6px;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  background: #fff8ec;
  color: var(--ink);
  width: 100%;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.dose-input::-webkit-outer-spin-button,
.dose-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px solid var(--card-line);
  border-bottom: 1px solid var(--card-line);
}

.readout .stat {
  display: flex;
  flex-direction: column;
}

.readout .stat .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b5a48;
}

.readout .stat .v {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
}

.readout .stat .v .u {
  font-size: 13px;
  color: #6b5a48;
  margin-left: 2px;
}

.steps {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.steps li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--card-line);
}

.steps li:last-child {
  border-bottom: none;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 500;
  color: #fff;
  background: var(--ochre);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.steps li.no-num::before {
  content: '';
  background: transparent;
}

.steps .s-label {
  color: var(--ink);
  font-size: 15px;
}

.steps .s-time {
  color: #6b5a48;
  font-size: 13px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  white-space: nowrap;
  grid-column: 2;
  margin-top: 2px;
  display: block;
}

.steps .s-target {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  white-space: nowrap;
}

.steps li.is-current {
  background: rgba(192, 119, 74, 0.12);
  border-radius: 8px;
  margin: 0 -8px;
  padding: 10px 8px;
}

.meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 8px 0;
  font-size: 13px;
  color: #6b5a48;
}

.recipe-note {
  font-size: 13px;
  color: #6b5a48;
  font-style: italic;
  margin: 8px 0 0;
  line-height: 1.4;
}

.timer {
  margin: 16px 0;
  padding: 14px;
  background: var(--espresso);
  border-radius: 10px;
  text-align: center;
  color: var(--warm-sand);
}

.timer-time {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.timer-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 500;
  cursor: pointer;
}

.btn-timer {
  flex: 1;
  background: var(--ochre);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--buff);
  border: 1px solid var(--buff);
}

.btn-primary {
  background: var(--ochre);
  color: #fff;
  width: 100%;
}

.btn-log {
  margin-top: 4px;
}

.view-heading {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 500;
  color: var(--warm-sand);
  font-size: 18px;
  margin: 4px 0 14px;
}

.log-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-list li {
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--gold);
}

.log-list .log-main {
  display: flex;
  flex-direction: column;
}

.log-list .log-recipe {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 500;
  font-size: 15px;
}

.log-list .log-sub {
  font-size: 13px;
  color: #6b5a48;
}

.log-list .log-del {
  background: none;
  border: none;
  color: var(--terracotta);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.empty {
  color: var(--buff);
  text-align: center;
  padding: 24px;
  font-style: italic;
}

.stamp {
  text-align: center;
  color: #6b5a48;
  font-size: 11px;
  margin-top: 28px;
  letter-spacing: 0.04em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--espresso-2);
  color: var(--warm-sand);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 10;
}
