.dye-page { background: #f1f0ea; color: #20352d; }
.dye-page .page-shell { width: min(1120px, calc(100% - 28px)); }
.dye-page .brand-symbol, .dye-page .brand-symbol svg { width: 32px; height: 32px; flex: 0 0 32px; }
.dye-main { padding-top: 4px; }
.dye-hero { border-top: 4px solid #20352d; padding: 20px 0; }
.dye-hero h1 { font-size: clamp(1.95rem, 4vw, 3.25rem); line-height: 1.1; letter-spacing: -.035em; margin: 0 0 10px; text-wrap: balance; }
.dye-hero p { margin: 0; max-width: 67ch; color: #496352; line-height: 1.55; }
.dye-workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.dye-page h2 { font-size: 1.4rem; line-height: 1.25; letter-spacing: -.02em; margin: 0 0 12px; }
#dye-form { padding: 24px; background: #fffefa; border: 1px solid #cbd5cb; min-width: 0; }
#dye-form fieldset { min-width: 0; border: 0; border-top: 1px solid #cad5cc; padding: 14px 0 0; margin: 20px 0; }
#dye-form legend { padding-right: 8px; font-weight: 700; }
.dye-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dye-page label { display: flex; flex-direction: column; min-width: 0; font-size: .94rem; font-weight: 600; gap: 6px; }
.dye-page :is(input, select) { width: 100%; min-width: 0; height: 48px; border: 1px solid #92ac9a; border-radius: 3px; padding: 8px 10px; background: white; color: #20352d; font: inherit; font-variant-numeric: tabular-nums; }
.dye-page select { font-size: .9rem; }
.dye-page input[aria-invalid=true] { border: 2px solid #96371d; }
.dye-help, .dye-scope { font-size: .85rem; line-height: 1.5; color: #506252; margin: 10px 0 0; }
.dye-error { font-size: .85rem; line-height: 1.5; color: #873018; font-weight: 500; }
.dye-error:empty { display: none; }
.dye-page button { font: inherit; cursor: pointer; min-height: 44px; padding: 10px 14px; border-radius: 3px; touch-action: manipulation; }
.dye-primary { color: #fffefa; background: #20352d; border: 1px solid #20352d; font-weight: 650; }
.dye-primary:hover { background: #315f42; }
.dye-secondary { color: #20352d; background: #fffefa; border: 1px solid #728e78; }
.dye-secondary:hover { background: #e1e8de; }
.dye-clear { color: #435e4b; border: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.dye-clear:hover { color: #20352d; }
.dye-result { min-width: 0; padding: 24px; background: #e6eee4; border: 1px solid #b4c7b5; border-top: 5px solid #315f42; }
#dye-status { color: #3c5845; line-height: 1.5; margin: 0 0 15px; }
.dye-total { border-bottom: 1px solid #aec5af; padding-bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
#dye-total { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.04em; line-height: 1.15; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#dye-example { width: 100%; margin-top: 14px; text-align: left; }
.dye-ledger { margin: 18px 0; }
.dye-ledger div { display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid #c1d0bd; padding: 9px 0; }
.dye-ledger dt { font-size: .9rem; }
.dye-ledger dd { margin: 0; min-width: 0; text-align: right; font-weight: 700; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#dye-copy:disabled { opacity: .6; cursor: default; }
#dye-copy-status { font-size: .85rem; line-height: 1.5; }
#dye-copy-fallback { width: 100%; font: inherit; margin-top: 8px; }
.dye-tickets-section { margin: 28px 0; }
.dye-tickets { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dye-tickets li { min-width: 0; border: 1px solid #c0cfc0; border-left: 4px solid #315f42; background: #fffefa; padding: 16px; content-visibility: auto; contain-intrinsic-size: auto 110px; }
.dye-tickets h3 { font-size: 1rem; margin: 0 0 8px; }
.dye-tickets p { margin: 0; line-height: 1.6; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dye-section { max-width: 76ch; margin: 34px 0; }
.dye-section p { line-height: 1.65; margin: 10px 0; }
.dye-method { background: #e7ece3; border-left: 4px solid #315f42; padding: 18px; line-height: 1.8; }
.dye-figure { margin: 28px 0; }
.dye-figure img { display: block; width: 100%; height: auto; border: 1px solid #c5d1c5; }
.dye-figure figcaption { margin-top: 9px; font-size: .88rem; line-height: 1.5; color: #53665a; }
.dye-faq details { padding: 14px 0; border-top: 1px solid #c1d0c0; }
.dye-faq summary { font-weight: 650; cursor: pointer; line-height: 1.5; touch-action: manipulation; }
.dye-page a:hover { color: #315f42; text-decoration-thickness: 2px; }
.dye-page :is(input, select, button, a, summary, textarea):focus-visible { outline: 3px solid #af6e2f; outline-offset: 3px; }
.dye-related { display: flex; flex-wrap: wrap; gap: 14px 22px; border-top: 1px solid #b9cbbd; padding: 22px 0; }
.dye-page [hidden] { display: none !important; }
#dye-form, #dye-result-title { scroll-margin-top: 20px; }
@media (max-width: 760px) {
  .dye-page .site-header { padding-top: 16px; padding-bottom: 16px; }
  .dye-page .site-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; width: 100%; }
  .dye-page .site-nav a { display: grid; place-items: center; text-align: center; font-size: .72rem; letter-spacing: -.02em; line-height: 1.4; min-height: 44px; padding: 8px 0; }
  .dye-hero { padding: 16px 0 18px; }
  .dye-workspace { display: flex; flex-direction: column; gap: 16px; }
  .dye-result { order: -1; width: 100%; padding: 18px; }
  #dye-form { width: 100%; padding: 18px; }
  .dye-tickets { grid-template-columns: 1fr; }
  .dye-page h2 { font-size: 1.28rem; }
  .dye-fields { gap: 12px; }
  #dye-form, .dye-page :is(input, select, button, summary, textarea) { scroll-margin-top: 170px; }
}
@media print {
  .site-header, .site-footer, .dye-hero, #dye-form, .dye-page button, .dye-section, .dye-related, .dye-figure { display: none; }
  .dye-workspace { display: block; }
  .dye-result { background: white; border: 0; }
  .dye-tickets { display: block; }
  .dye-tickets li { content-visibility: visible; break-inside: avoid; margin-bottom: 10px; }
}
