@font-face {
  font-family: "Albert Sans";
  src: url("fonts/AlbertSans-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Albert Sans";
  src: url("fonts/AlbertSans-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Albert Sans";
  src: url("fonts/AlbertSans-800-latin.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Big Shoulders";
  src: url("fonts/BigShoulders-800-latin.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --kiln: #173642;
  --kiln-deep: #102832;
  --ink: #122128;
  --ink-soft: #476068;
  --steel: #e8eeee;
  --steel-deep: #cbd8d8;
  --paper: #ffffff;
  --wax: #f2b84b;
  --wax-pale: #fff2ca;
  --oil: #4b8793;
  --oil-pale: #dcebed;
  --check: #277467;
  --check-pale: #dcebe6;
  --coral: #ce5943;
  --coral-pale: #f8e3dd;
  --rule: #b8c7c8;
  --shadow: 0 18px 40px rgba(18, 33, 40, 0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ad-pad: 0px;
  font-family: "Albert Sans", "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--steel);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--steel);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  color: inherit;
}

button,
select,
input[type="date"] {
  touch-action: manipulation;
}

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

a {
  color: var(--kiln);
  text-underline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0.5rem);
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.side-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: calc(100dvh - var(--ad-pad));
  padding: calc(18px + var(--safe-top)) 17px calc(18px + var(--safe-bottom));
  overflow: auto;
  background: var(--kiln);
  color: #f9fcfc;
}

.brand-picture {
  position: relative;
  height: 152px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: var(--kiln-deep);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}

.brand-picture > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 50%;
  filter: saturate(0.88) contrast(1.05);
}

.brand-stamp {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--kiln);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.25);
}

.brand-stamp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  margin: 17px 3px 23px;
  line-height: 0.85;
}

.brand-name strong,
.brand-name span {
  display: block;
  font-family: "Big Shoulders", "Arial Narrow", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-name span {
  color: var(--wax);
}

.side-nav {
  display: grid;
  gap: 5px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.side-nav .nav-button {
  width: 100%;
  padding: 10px 11px;
  border-left: 3px solid transparent;
  color: #dbe6e8;
}

.side-nav .nav-button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.side-nav .nav-button.active {
  border-left-color: var(--wax);
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  font-weight: 700;
}

.nav-button svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.local-note {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: 18px 4px 2px;
  color: #ccdcde;
}

.local-note strong,
.local-note span {
  display: block;
}

.local-note strong {
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
}

.local-note span {
  margin-top: 3px;
  font-size: 0.69rem;
  line-height: 1.4;
}

.local-dot {
  width: 9px;
  height: 9px;
  margin-top: 3px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #69c8b2;
  box-shadow: 0 0 0 4px rgba(105, 200, 178, 0.13);
}

#main {
  width: 100%;
  min-width: 0;
  padding: 28px clamp(20px, 3vw, 48px) 52px;
}

.page {
  width: min(1420px, 100%);
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0;
  font-family: "Big Shoulders", "Arial Narrow", sans-serif;
  font-size: clamp(2.65rem, 5vw, 4.75rem);
  line-height: 0.88;
  letter-spacing: 0.005em;
}

.page-head p {
  max-width: 650px;
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.55;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.planner-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1fr) minmax(330px, 390px);
  align-items: start;
  gap: clamp(20px, 2.3vw, 34px);
}

.input-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.work-sheet {
  position: relative;
  min-width: 0;
  padding: 21px clamp(17px, 2.5vw, 28px) 24px;
  border: 1px solid var(--rule);
  border-left: 5px solid var(--kiln);
  background: var(--paper);
}

.work-sheet::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border-left: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--steel);
}

.work-sheet.blend-sheet {
  border-left-color: var(--oil);
}

.work-sheet.notes-sheet {
  border-left-color: var(--wax);
}

.work-sheet.cost-sheet {
  border-left-color: var(--check);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-right: 15px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.section-head p {
  max-width: 590px;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

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

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gap-top-15 {
  margin-top: 15px;
}

.gap-top-17 {
  margin-top: 17px;
}

.compact-title {
  margin-top: 9px;
}

.copy-gap {
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field > span:first-child,
.field-label {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
}

.field small,
.field-help {
  color: var(--ink-soft);
  font-size: 0.69rem;
  line-height: 1.4;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #91a4a7;
  border-radius: 4px;
  background: #fbfdfd;
  color: var(--ink);
}

input,
select {
  min-height: 46px;
  padding: 9px 11px;
  font-variant-numeric: tabular-nums;
}

textarea {
  min-height: 94px;
  padding: 11px;
  resize: vertical;
  line-height: 1.5;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--kiln);
}

.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid #91a4a7;
  border-radius: 4px;
  background: #fbfdfd;
}

.input-with-unit:focus-within {
  outline: 3px solid var(--wax);
  outline-offset: 2px;
  border-color: var(--kiln);
}

.input-with-unit input {
  border: 0;
  border-radius: 0;
  outline: 0;
}

.input-with-unit span {
  min-width: 44px;
  padding: 0 11px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--steel);
}

.segmented button {
  min-height: 34px;
  padding: 6px 11px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
}

.segmented button.active {
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(18, 33, 40, 0.14);
}

.basis-warning {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 4px solid var(--coral);
  background: var(--coral-pale);
  font-size: 0.76rem;
  line-height: 1.45;
}

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

.basis-option {
  position: relative;
  display: grid;
  align-content: start;
  min-height: 188px;
  padding: 17px;
  border: 2px solid var(--rule);
  border-radius: 7px;
  background: #f9fbfb;
  cursor: pointer;
  text-align: left;
}

.basis-option:hover {
  border-color: var(--oil);
}

.basis-option.selected {
  border-color: var(--ink);
  background: var(--wax-pale);
  box-shadow: inset 0 -5px 0 var(--wax);
}

.basis-option .method-name {
  display: block;
  margin-right: 26px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
}

.basis-option .method-ratio {
  display: block;
  margin-top: 8px;
  color: var(--kiln);
  font-size: 0.75rem;
  font-weight: 700;
}

.basis-option .method-formula {
  display: block;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(18, 33, 40, 0.22);
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.basis-option .selection-dot {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 17px;
  height: 17px;
  border: 2px solid var(--ink-soft);
  border-radius: 50%;
}

.basis-option.selected .selection-dot {
  border: 5px solid var(--ink);
  background: var(--wax);
}

.load-entry {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  align-items: end;
  gap: 16px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--rule);
}

.denominator-readout {
  padding-bottom: 4px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.45;
}

.denominator-readout strong {
  color: var(--ink);
}

.blend-head,
.blend-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.5fr) minmax(80px, 0.65fr) minmax(105px, 0.9fr) minmax(125px, 1fr) 36px;
  gap: 8px;
  align-items: center;
}

.blend-head {
  padding: 0 2px 7px;
  color: var(--ink-soft);
  font-size: 0.67rem;
  font-weight: 700;
}

.blend-row {
  padding: 9px 0;
  border-top: 1px solid #d9e2e2;
}

.blend-row input {
  min-height: 42px;
}

.blend-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 9px;
  padding: 11px 0 0;
  border-top: 2px solid var(--ink);
  font-size: 0.78rem;
}

.blend-total strong {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.blend-total.invalid strong {
  color: var(--coral);
}

.button,
.text-button,
.icon-button {
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 9px 15px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.button:hover {
  background: #f5f8f8;
}

.button.primary {
  border-color: var(--kiln);
  background: var(--kiln);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--kiln-deep);
}

.button.wax {
  border-color: var(--ink);
  background: var(--wax);
  color: var(--ink);
}

.button.danger {
  border-color: var(--coral);
  color: #9f3322;
}

.button.compact {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.72rem;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.text-button {
  padding: 3px 1px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--kiln);
  font-size: 0.73rem;
  font-weight: 700;
}

.text-button.danger {
  color: var(--coral);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  font-size: 1.15rem;
}

.result-column {
  position: sticky;
  top: 24px;
  min-width: 0;
}

.batch-slip {
  position: relative;
  overflow: hidden;
  border: 1px solid #9fb1b3;
  background: var(--paper);
  box-shadow: var(--shadow);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}

.batch-slip::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border-left: 1px solid #9fb1b3;
  border-bottom: 1px solid #9fb1b3;
  background: var(--steel);
}

.slip-head {
  padding: 22px 22px 18px;
  border-bottom: 6px solid var(--wax);
  background: var(--kiln);
  color: #ffffff;
}

.slip-head span {
  display: block;
  color: #bdd1d4;
  font-size: 0.72rem;
  font-weight: 600;
}

.slip-head strong {
  display: block;
  margin-top: 2px;
  font-family: "Big Shoulders", "Arial Narrow", sans-serif;
  font-size: clamp(3.1rem, 5vw, 4.45rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.slip-head small {
  display: block;
  margin-top: 7px;
  color: #d8e4e6;
  font-size: 0.71rem;
  line-height: 1.4;
}

.slip-section {
  padding: 17px 21px;
  border-bottom: 1px solid var(--rule);
}

.slip-section:last-child {
  border-bottom: 0;
}

.slip-section h3 {
  margin: 0 0 11px;
  font-size: 0.77rem;
}

.ingredient-row,
.cost-row,
.reconcile-row,
.meta-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 13px;
  align-items: baseline;
  padding: 5px 0;
  font-size: 0.75rem;
}

.ingredient-row span:first-child,
.cost-row span:first-child,
.meta-row span:first-child {
  min-width: 0;
  color: var(--ink-soft);
}

.ingredient-row strong,
.cost-row strong,
.meta-row strong,
.reconcile-row strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ingredient-row.fragrance strong {
  color: #236f7c;
}

.reconcile-row {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 2px solid var(--ink);
  font-weight: 800;
}

.formula-block {
  display: grid;
  gap: 9px;
  padding-left: 13px;
  border-left: 3px solid var(--oil);
}

.formula-block strong {
  font-size: 0.76rem;
  line-height: 1.35;
}

.formula-block code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-family: "Albert Sans", sans-serif;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 0.7rem;
  line-height: 1.4;
}

.check-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--check-pale);
  color: var(--check);
  font-size: 0.66rem;
  font-weight: 800;
}

.check-item.fail .check-icon {
  background: var(--coral-pale);
  color: var(--coral);
}

.check-item.info .check-icon {
  background: var(--wax-pale);
  color: #76520c;
}

.check-item strong,
.check-item span {
  display: block;
}

.check-item span {
  margin-top: 1px;
  color: var(--ink-soft);
}

.slip-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
}

.error-slip {
  padding: 24px;
  border: 2px solid var(--coral);
  background: var(--coral-pale);
}

.error-slip h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.error-slip p {
  margin: 0;
  color: #752b20;
  font-size: 0.8rem;
  line-height: 1.5;
}

.mobile-summary {
  display: none;
}

.safety-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #d29c34;
  background: var(--wax-pale);
  font-size: 0.72rem;
  line-height: 1.45;
}

.safety-note strong {
  display: block;
  margin-bottom: 2px;
}

.safety-note .safety-mark {
  font-weight: 800;
}

.view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
  gap: 24px;
  align-items: start;
}

.advertising-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 22px;
  padding: 17px 18px;
  border: 1px solid var(--rule);
  border-left: 5px solid var(--oil);
  background: var(--paper);
  box-shadow: 0 7px 20px rgba(18, 33, 40, 0.06);
}

.advertising-card.complete {
  border-left-color: var(--check);
  background: var(--check-pale);
}

.advertising-card strong,
.advertising-card span {
  display: block;
}

.advertising-card strong {
  font-size: 0.84rem;
}

.advertising-card span {
  max-width: 700px;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.73rem;
  line-height: 1.5;
}

.advertising-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.record-list {
  display: grid;
  gap: 11px;
}

.empty-state {
  padding: 34px 26px;
  border: 1px dashed #8ea2a5;
  background: rgba(255, 255, 255, 0.46);
}

.empty-state h2 {
  margin: 0 0 7px;
  font-size: 1rem;
}

.empty-state p {
  max-width: 580px;
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.record {
  border: 1px solid var(--rule);
  border-left: 5px solid var(--kiln);
  background: var(--paper);
}

.record.estimate {
  border-left-color: var(--wax);
}

.record.profile {
  border-left-color: var(--oil);
}

.record.recipe {
  border-left-color: var(--check);
}

.record-main {
  padding: 19px 20px;
}

.record-top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.record h2,
.record h3 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.3;
}

.record .record-subtitle {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.4;
}

.record-value {
  flex: 0 0 auto;
  color: var(--kiln);
  font-family: "Big Shoulders", "Arial Narrow", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
  text-align: right;
}

.record-formula {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--oil);
  background: #f1f6f6;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.record-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.record-meta > div {
  padding: 9px 10px;
  border-top: 1px solid var(--rule);
}

.record-meta span,
.record-meta strong {
  display: block;
}

.record-meta span {
  color: var(--ink-soft);
  font-size: 0.64rem;
}

.record-meta strong {
  margin-top: 3px;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  background: #f5f8f8;
}

.guide-panel {
  position: sticky;
  top: 24px;
  padding: 22px;
  border: 1px solid var(--rule);
  background: var(--kiln);
  color: #f7fbfb;
}

.guide-panel h2 {
  margin: 0 0 10px;
  font-family: "Big Shoulders", "Arial Narrow", sans-serif;
  font-size: 2rem;
  line-height: 0.95;
}

.guide-panel p,
.guide-panel li {
  color: #d4e0e2;
  font-size: 0.76rem;
  line-height: 1.55;
}

.guide-panel ol,
.guide-panel ul {
  margin: 12px 0 0;
  padding-left: 1.2rem;
}

.confidence-ladder {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.confidence-rung {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.confidence-rung > span:first-child {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  color: var(--wax);
  font-weight: 800;
  font-size: 0.7rem;
}

.confidence-rung strong,
.confidence-rung small {
  display: block;
}

.confidence-rung strong {
  font-size: 0.75rem;
}

.confidence-rung small {
  margin-top: 2px;
  color: #c4d4d6;
  font-size: 0.68rem;
  line-height: 1.4;
}

.source-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.source-list a {
  color: #ffffff;
  font-size: 0.72rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid var(--rule);
  border-radius: 99px;
  background: var(--steel);
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

.chip.measured {
  border-color: #70a799;
  background: var(--check-pale);
  color: #165a4f;
}

.chip.estimated {
  border-color: #d4a74d;
  background: var(--wax-pale);
  color: #6f4c09;
}

.chip.reference {
  border-color: #7ea7ae;
  background: var(--oil-pale);
  color: #275d67;
}

.profile-notes {
  margin: 13px 0 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.5;
}

.app-dialog {
  width: min(650px, calc(100vw - 28px));
  max-height: min(820px, calc(100dvh - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #82979a;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(8, 23, 29, 0.35);
}

.app-dialog::backdrop {
  background: rgba(8, 23, 29, 0.66);
}

.app-dialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(820px, calc(100dvh - 28px));
}

.app-dialog header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 22px 17px;
  border-bottom: 5px solid var(--wax);
  background: var(--kiln);
  color: #ffffff;
}

.dialog-kicker {
  margin: 0 0 3px;
  color: #bfd0d3;
  font-size: 0.69rem;
  font-weight: 600;
}

.app-dialog h2 {
  margin: 0;
  font-family: "Big Shoulders", "Arial Narrow", sans-serif;
  font-size: 2.1rem;
  line-height: 0.95;
}

.app-dialog header .icon-button {
  border-color: rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #ffffff;
}

.dialog-body {
  padding: 22px;
  overflow: auto;
}

.dialog-body .field-grid + .field-grid,
.dialog-body .field-grid + .field,
.dialog-body .field + .field-grid,
.dialog-body .field + .field {
  margin-top: 15px;
}

.dialog-note {
  margin: 0 0 17px;
  padding: 11px 13px;
  border-left: 4px solid var(--oil);
  background: var(--oil-pale);
  color: #2f5961;
  font-size: 0.74rem;
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--rule);
  background: #f3f7f7;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: calc(24px + var(--ad-pad));
  z-index: 200;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 16px;
  border-left: 5px solid var(--wax);
  background: var(--ink);
  color: #ffffff;
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.bottom-nav {
  display: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1160px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .brand-picture {
    height: 130px;
  }

  .planner-grid {
    grid-template-columns: minmax(400px, 1fr) minmax(300px, 340px);
  }

  .field-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blend-head,
  .blend-row {
    grid-template-columns: minmax(120px, 1.35fr) minmax(72px, 0.6fr) minmax(95px, 0.8fr) minmax(110px, 1fr) 34px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .side-rail {
    display: none;
  }

  #main {
    padding: calc(18px + var(--safe-top)) 16px calc(102px + var(--safe-bottom) + var(--ad-pad));
  }

  .page-head {
    align-items: flex-start;
  }

  .page-head h1 {
    font-size: 3.15rem;
  }

  .planner-grid,
  .view-grid {
    grid-template-columns: 1fr;
  }

  .result-column {
    position: static;
  }

  .guide-panel {
    position: static;
  }

  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: var(--ad-pad);
    left: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px 8px calc(6px + var(--safe-bottom));
    border-top: 1px solid #8ca0a3;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -7px 24px rgba(18, 33, 40, 0.13);
  }

  .bottom-nav .nav-button {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 54px;
    padding: 5px 2px;
    border-radius: 4px;
    color: var(--ink-soft);
    font-size: 0.65rem;
  }

  .bottom-nav .nav-button.active {
    background: var(--kiln);
    color: #ffffff;
  }

  .bottom-nav .nav-button svg {
    width: 20px;
    height: 20px;
  }

  .mobile-summary {
    position: sticky;
    top: calc(8px + var(--safe-top));
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin: -4px 0 15px;
    padding: 11px 14px;
    border: 1px solid #102832;
    border-bottom: 5px solid var(--wax);
    background: var(--kiln);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(18, 33, 40, 0.18);
  }

  .mobile-summary span,
  .mobile-summary strong {
    display: block;
  }

  .mobile-summary span {
    color: #c9d9db;
    font-size: 0.65rem;
  }

  .mobile-summary strong {
    font-family: "Big Shoulders", "Arial Narrow", sans-serif;
    font-size: 2rem;
    line-height: 0.95;
    font-variant-numeric: tabular-nums;
  }

  .mobile-summary small {
    color: #d6e1e3;
    font-size: 0.66rem;
    text-align: right;
  }
}

@media (max-width: 640px) {
  #main {
    padding-right: 12px;
    padding-left: 12px;
  }

  .page-head {
    display: grid;
    gap: 14px;
    margin-bottom: 17px;
  }

  .page-head h1 {
    font-size: 2.85rem;
  }

  .page-head p {
    font-size: 0.84rem;
  }

  .head-actions {
    justify-content: flex-start;
  }

  .field-grid,
  .field-grid.three,
  .field-grid.four {
    grid-template-columns: 1fr;
  }

  .work-sheet {
    padding: 18px 14px 21px;
    border-left-width: 4px;
  }

  .section-head {
    display: grid;
    gap: 10px;
  }

  .basis-grid {
    grid-template-columns: 1fr;
  }

  .basis-option {
    min-height: 0;
  }

  .load-entry {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .blend-head {
    display: none;
  }

  .blend-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) 36px;
    padding: 13px 0;
  }

  .blend-row .blend-name {
    grid-column: 1 / 3;
  }

  .blend-row .blend-certificate {
    grid-column: 1 / 3;
  }

  .blend-row .remove-blend {
    grid-column: 3;
    grid-row: 1;
  }

  .record-meta {
    grid-template-columns: 1fr;
  }

  .record-meta > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .record-meta strong {
    margin: 0;
    text-align: right;
  }

  .record-top {
    display: grid;
  }

  .record-value {
    text-align: left;
  }

  .slip-actions {
    grid-template-columns: 1fr;
  }

  .slip-actions .button {
    width: 100%;
  }

  .dialog-body {
    padding: 18px 16px;
  }

  .dialog-actions {
    padding-right: 16px;
    padding-left: 16px;
  }

  .toast {
    right: 16px;
    bottom: calc(84px + var(--safe-bottom) + var(--ad-pad));
    left: 16px;
  }
}

@media (max-width: 760px) {
  .advertising-card {
    display: grid;
  }

  .advertising-actions {
    justify-content: flex-start;
  }

  .advertising-actions .button {
    flex: 1 1 145px;
  }
}

.legal-page {
  width: min(780px, calc(100% - 32px));
  margin: 24px auto 72px;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid var(--rule);
  border-top: 7px solid var(--wax);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.legal-page header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}

.legal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.legal-brand img {
  width: 48px;
  height: 48px;
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.legal-page h1 {
  margin: 30px 0 8px;
  font-family: "Big Shoulders", "Arial Narrow", sans-serif;
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 0.9;
}

.legal-page h2 {
  margin: 30px 0 8px;
  font-size: 1.08rem;
}

.legal-page p,
.legal-page li {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.72;
}

.legal-page .button {
  margin-top: 20px;
}

@media (max-width: 360px) {
  .page-head h1 {
    font-size: 2.55rem;
  }

  .blend-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
  }

  .button {
    padding-right: 11px;
    padding-left: 11px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    transition: opacity 150ms ease, transform 150ms ease;
  }
}

@media print {
  .side-rail,
  .bottom-nav,
  .page-head,
  .input-stack,
  .mobile-summary,
  .safety-note,
  .slip-actions,
  .advertising-card {
    display: none !important;
  }

  .app-shell,
  .planner-grid {
    display: block;
  }

  #main {
    padding: 0;
  }

  .result-column {
    position: static;
    width: 100%;
  }

  .batch-slip {
    clip-path: none;
    box-shadow: none;
  }
}
