:root {
  --fl-bg:      #fde8f0;
  --fl-border:  #f5b8d0;
  --fl-text:    #a02040;
  --fl-icon-bg: #fde8f0;
  --fl-mid:     #c84878;
  --fl-dark:    #6a0828;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.app-hero { border-bottom: 1px solid var(--color-border); padding: 1.25rem 1.5rem 1.1rem; }
.app-hero--sakura { background: var(--fl-bg); border-bottom-color: var(--fl-border); }
.app-hero__inner { margin: 0 auto; }
.app-hero__title {
  font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800;
  color: var(--fl-text); letter-spacing: -.02em;
  margin: 0 0 .5rem; line-height: 1.2;
}
.app-hero__desc  { font-size: .9rem; color: var(--color-text-secondary); max-width: 660px; line-height: 1.6; margin: 0 0 .85rem; }
.app-hero__chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.hero-chip {
  display: inline-flex; align-items: center;
  padding: .22rem .65rem; font-size: .72rem; font-weight: 700;
  background: var(--color-surface); border: 1.5px solid var(--fl-border);
  border-radius: var(--radius-full); color: var(--fl-text); white-space: nowrap;
}

/* ── Warning banner ──────────────────────────────────────────────────────── */
.warning-banner {
  background: #fff7d0;
  border: 1.5px solid #e8c84a;
  border-radius: var(--radius-md);
  padding: .6rem .9rem;
  font-size: .8rem;
  color: #6a4800;
  line-height: 1.5;
  margin-bottom: 0;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.app-wrap {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem 1rem 3rem;
}

.pane-in {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pane-out {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--fl-border);
  border-radius: var(--radius-xl);
  padding: 1rem 1.125rem;
}

.card-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fl-text);
  margin: 0 0 .75rem;
}

.field { margin-bottom: .7rem; }
.field:last-child { margin-bottom: 0; }

label.lbl {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: .28rem;
}

select.sel, input.num-in {
  width: 100%;
  box-sizing: border-box;
  padding: .4rem .6rem;
  font-size: .85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text-primary);
  transition: border-color .15s;
}
select.sel:focus, input.num-in:focus { outline: none; border-color: var(--fl-mid); }

/* ── Preset buttons ──────────────────────────────────────────────────────── */
.preset-row { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.preset-btn {
  padding: .25rem .6rem;
  font-size: .75rem; font-weight: 700;
  background: var(--fl-bg);
  border: 1.5px solid var(--fl-border);
  border-radius: var(--radius-full);
  color: var(--fl-text);
  cursor: pointer;
  transition: background .15s;
}
.preset-btn:hover { background: var(--fl-border); }

/* ── Unit toggle ──────────────────────────────────────────────────────────── */
.unit-toggle {
  display: flex;
  border: 1.5px solid var(--fl-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: .75rem;
}
.unit-toggle button {
  flex: 1; padding: .32rem .5rem; font-size: .74rem; font-weight: 600;
  background: none; border: none; cursor: pointer;
  color: var(--color-text-muted);
  transition: background .15s, color .15s;
}
.unit-toggle button.active { background: var(--fl-bg); color: var(--fl-text); }

/* ── Result stats ────────────────────────────────────────────────────────── */
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
}
.stat-cell {
  background: var(--fl-bg);
  border: 1px solid var(--fl-border);
  border-radius: var(--radius-md);
  padding: .6rem .75rem;
  text-align: center;
}
.stat-lbl { font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); margin-bottom: .3rem; }
.stat-val { font-size: 1.1rem; font-weight: 800; color: var(--fl-dark); line-height: 1.2; word-break: break-all; }

/* ── Titration table ─────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}
table.tbl th {
  background: var(--fl-bg);
  color: var(--fl-text);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .4rem .6rem;
  text-align: left;
  border-bottom: 1.5px solid var(--fl-border);
}
table.tbl td {
  padding: .35rem .6rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
}
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: var(--fl-bg); }

/* ── Decay bar chart ─────────────────────────────────────────────────────── */
.decay-chart {
  display: flex;
  align-items: flex-end;
  gap: .4rem;
  height: 140px;
  padding: 0 .25rem;
}
.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.bar-track {
  width: 100%;
  background: var(--color-border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  height: 100px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.bar-fill {
  width: 100%;
  background: var(--fl-mid);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height .4s ease;
}
.bar-label { font-size: .62rem; color: var(--color-text-muted); margin-top: .2rem; text-align: center; }
.bar-val   { font-size: .6rem; color: var(--fl-text); font-weight: 700; text-align: center; }

/* ── Checklist ───────────────────────────────────────────────────────────── */
.checklist { display: flex; flex-direction: column; gap: .5rem; list-style: none; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--color-text-primary);
}
.checklist input[type=checkbox] {
  width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--fl-mid); margin-top: .12rem; cursor: pointer;
}
.checklist li.done span { text-decoration: line-through; color: var(--color-text-muted); }

/* ── Storage reminder ────────────────────────────────────────────────────── */
.storage-grid { display: flex; flex-direction: column; gap: .4rem; }
.storage-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; padding: .3rem 0;
  border-bottom: 1px dashed var(--color-border);
}
.storage-row:last-child { border-bottom: none; }
.storage-lbl { color: var(--color-text-muted); }
.storage-val { font-weight: 700; color: var(--fl-text); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .app-wrap { flex-direction: column; }
  .pane-in  { width: 100%; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  .app-hero, .pane-in, .warning-banner { display: none; }
  .pane-out { width: 100%; }
}
