.width-page [hidden] { display: none !important; }
.width-page .site-header { padding-inline: max(28px, calc((100% - 1320px) / 2)); }
.width-page .header-actions { position: static; display: flex; width: auto; padding: 0; border: 0; background: transparent; box-shadow: none; opacity: 1; visibility: visible; transform: none; transition: none; }
.width-page .header-actions .header-btn { width: auto; }
.width-intro { min-height: 108px; grid-template-columns: 1.2fr 1fr; gap: 24px; padding: 22px 28px; }
.width-intro h1 { margin: 0; font-size: clamp(1.7rem, 3.1vw, 2.8rem); line-height: 1.12; }
.width-intro > p { font-size: .95rem; }
.width-workbench { grid-template-columns: minmax(360px, .88fr) minmax(0, 1.12fr); min-height: 680px; }
.width-controls { margin: 14px; padding: 20px; border: 1px solid #ccc6b6; border-radius: 8px; background: var(--paper); }
.width-mode-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 2px; border: 1px solid var(--line-strong); border-radius: 7px; }
.width-mode-switch button { min-height: 47px; padding: 9px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; font-size: .92rem; font-weight: 700; }
.width-mode-switch button[aria-pressed="true"] { color: var(--paper); background: var(--ink); box-shadow: inset 0 2px 4px rgba(0,0,0,.22); }
.width-unit-row { margin: 18px 0 16px; font-size: .86rem; font-weight: 700; }
.width-page .unit-switch button { min-height: 34px; font-size: .78rem; padding-inline: 15px; }
.width-basis { padding: 0; margin: 0; border: 0; min-width: 0; }
.width-basis legend { font-family: var(--serif); font-size: 1.72rem; font-weight: 700; }
.width-basis-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 7px; }
.width-controls .width-basis-choices label { display: flex; align-items: center; gap: 10px; font-size: .92rem; cursor: pointer; }
.width-controls input[type="radio"], .width-controls input[type="checkbox"] { width: 23px; height: 23px; min-height: 0; padding: 0; margin: 0; accent-color: var(--ink); flex: 0 0 auto; }
.width-basis p, .width-field-note { margin: 11px 0 24px; color: var(--ink-soft); font-size: .86rem; line-height: 1.55; }
.width-field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.width-controls label { display: block; font-size: .89rem; }
.width-controls input:not([type="radio"]):not([type="checkbox"]), .width-controls select { display: block; min-height: 43px; margin-top: 6px; border-radius: 6px; font-size: .94rem; font-weight: 600; background: #fcfaf5; }
.width-controls label span { display: inline; }
.width-controls .width-target-field { margin: 18px 0 25px; }
.width-repeat { border-top: 1px solid var(--line-strong); padding-top: 17px; }
.width-repeat summary { font-size: .94rem; font-weight: 700; cursor: pointer; }
.width-repeat > p { color: var(--ink-soft); font-size: .8rem; margin: 10px 0 14px; }
.width-controls .width-check { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.width-error { color: #8d2d20; background: #f8e6de; border-left: 4px solid var(--madder); padding: 12px; font-size: .9rem; }
.width-results { padding: 22px 25px 25px 20px; }
.width-ticket { padding: 26px 31px 24px; align-self: stretch; box-shadow: 6px 7px 0 rgba(109,75,53,.1); }
.width-ticket h2 { margin: 0 0 17px; border-bottom: 1px solid var(--line-strong); padding-bottom: 13px; font: 700 2rem/1.15 var(--serif); }
.width-basis-label { margin: 0; color: var(--madder); text-transform: uppercase; letter-spacing: .09em; font-size: .73rem; font-weight: 800; }
.width-primary-result, .width-secondary-result { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 16px; }
.width-primary-result strong { font: 700 clamp(4.4rem, 7.5vw, 7rem)/1.02 var(--serif); letter-spacing: -.05em; }
.width-primary-result span { font: 700 1.9rem/1.15 var(--serif); }
.width-secondary-result { margin-bottom: 12px; }
.width-secondary-result strong { font: 700 clamp(2.6rem, 4.6vw, 4.2rem)/1.1 var(--serif); letter-spacing: -.04em; }
.width-secondary-result span { font: 700 1.45rem/1.2 var(--serif); }
.width-ledger { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 12px; border: 1px solid var(--line-strong); }
.width-ledger > div { padding: 9px 14px; min-width: 0; }
.width-ledger > div + div { border-left: 1px solid var(--line-strong); }
.width-ledger dt { font-size: .8rem; color: var(--ink-soft); }
.width-ledger dd { margin: 0; font-size: .95rem; font-weight: 800; }
.width-math { border: 1px solid var(--line-strong); padding: 10px 14px; }
.width-math h3 { margin: 0 0 6px; color: var(--madder); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; }
.width-math p { white-space: pre-line; overflow-wrap: anywhere; margin: 0; font: .9rem/1.7 ui-monospace, Consolas, monospace; }
.width-assumption { border-left: 4px solid var(--saffron); padding: 9px 12px; margin: 15px 0 0; background: #f0e8d7; color: var(--ink-soft); font-size: .79rem; line-height: 1.5; }
.width-actions button { min-height: 44px; font-size: .92rem; }
.width-actions button:last-child { background: transparent; color: var(--ink); }
.width-actions button:disabled { opacity: .45; cursor: not-allowed; }
.width-toast { font-size: .82rem; margin: 8px 0 0; }
.width-toast:empty { display: none; }
.width-copy-fallback { display: block; width: 100%; min-height: 155px; margin-top: 10px; color: var(--ink); background: var(--paper); font: .8rem/1.4 var(--sans); }
.width-next { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: .85rem; font-weight: 700; }
.width-next a { color: var(--ink); text-underline-offset: 4px; }
.width-guide { padding: 19px 28px 22px; border-top: 1px solid #ddd3bd; background: var(--paper); }
.width-guide h2 { border-top: 1px solid var(--line-strong); padding-top: 10px; margin: 0 0 9px; font: 700 1.65rem/1.2 var(--serif); }
.width-guide p { margin: 7px 0 0; max-width: 1100px; font-size: .87rem; line-height: 1.6; }
.width-guide a { color: var(--ink); text-underline-offset: 3px; }
.width-footer { max-width: 1264px; margin: 0 auto; padding: 15px 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.width-footer .brand { font-size: 1rem; }
.width-footer .footer-links { margin: 0; }
.width-noscript { margin: 16px 24px; }
@media (max-width: 1050px) {
  .width-intro { grid-template-columns: 1fr; gap: 10px; }
  .width-workbench { grid-template-columns: minmax(300px,.9fr) minmax(0,1.1fr); }
  .width-controls { padding: 16px; margin: 10px; }
  .width-ticket { padding-inline: 20px; }
  .width-basis-choices { gap: 12px; }
  .width-controls .width-basis-choices label { font-size: .82rem; gap: 7px; }
}
@media (max-width: 760px) {
  .width-page .site-header { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .width-page .header-actions { position: static; display: flex; width: 100%; padding: 0; margin: 0; justify-content: flex-start; gap: 7px; border: 0; border-radius: 0; background: transparent; box-shadow: none; opacity: 1; visibility: visible; transform: none; }
  .width-page .header-actions .header-btn { width: auto; min-height: 38px; font-size: .78rem; padding-inline: 9px; }
  .width-page .length-main { width: 100%; padding-top: 0; }
  .width-page .length-tool-shell { border-radius: 0; border-inline: 0; }
  .width-intro { padding: 21px 18px; }
  .width-intro h1 { font-size: 2rem; }
  .width-intro > p { font-size: .87rem; }
  .width-workbench { display: block; min-height: 0; }
  .width-controls { padding: 18px; margin: 12px; }
  .width-results { padding: 17px 16px 24px; }
  .width-ticket { padding: 26px 21px 22px; }
  .width-primary-result strong { font-size: 5.5rem; }
  .width-primary-result span { font-size: 1.6rem; }
  .width-secondary-result strong { font-size: 3rem; }
  .width-secondary-result span { font-size: 1.1rem; }
  .width-ledger > div { padding-inline: 10px; }
  .width-guide { padding: 22px 19px; }
  .width-guide h2 { font-size: 1.6rem; }
  .width-footer { margin-inline: 20px; flex-wrap: wrap; }
}
@media print {
  .width-page .width-guide, .width-page .width-next, .width-page .width-toast, .width-page .width-copy-fallback { display: none !important; }
  .width-page .width-ticket { padding: 0; }
  .width-primary-result strong { font-size: 48pt; }
  .width-secondary-result strong { font-size: 30pt; }
  .width-page .width-assumption { color: #222; }
}
