/* v3.css — iPhone layout v3 (2.4.0; cut plan, calculator and converter 2.4.1)
   Applies only on phones (≤768px) with Options > iPhone layout = v3
   (body.layout-v3). Classic and desktop never see any of it.
   Type: Barlow / Barlow Semi Condensed from app.css. Measurements use
   Barlow's OpenType "frac" feature, so "21 1/8" is drawn as 21⅛ while the
   field keeps the text the server reads. */

.v3-app, .v3-sheet-wrap, .v3-toast, .v3-only { display: none; }

@media (max-width: 768px) {
  body.layout-v3 {
    --v3-ground: #F1F3F0;
    --v3-ink:    #1C2320;
    --v3-muted:  #56615B;   /* 5.6:1 on the ground */
    --v3-line:   #D5DAD5;
    --v3-accent: #2343C2;   /* actions only */
    --v3-accent-tint: #EEF1FC;
    --v3-wood:   #E4CB9C;
    --v3-wood-key: #F6EBD6;
    --v3-wood-ink: #4A3A22;
    --v3-cut:    #B8412B;   /* delete and cut lines only */
    --v3-tabs-h: calc(64px + var(--safe-bot));
  }

  /* Classic phone layout steps aside; the results page is untouched. */
  body.layout-v3 #page-input > .toolbar,
  body.layout-v3 #page-input > .options-bar,
  body.layout-v3 #page-input > .main-layout { display: none !important; }

  body.layout-v3 .v3-app {
    display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 50;
    background: var(--v3-ground); color: var(--v3-ink); font-family: var(--font-ui);
  }
  body.layout-v3 .v3-sheet-wrap:not([hidden]) { display: block; }
  body.layout-v3 .v3-toast { display: flex; }

  .v3-num { font-feature-settings: "tnum" 1; }
  .v3-frac { font-feature-settings: "frac" 1, "tnum" 1; }
  .v3-app svg, .v3-sheet svg, .v3-only svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

  /* Header */
  .v3-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
             padding: calc(14px + var(--safe-top)) 20px 12px; }
  .v3-head-text { min-width: 0; }
  .v3-title { margin: 0; font-family: var(--font-cond); font-size: 30px; font-weight: 600; line-height: 1.1; }
  .v3-title-btn { all: unset; cursor: pointer; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62vw; }
  .v3-title-btn:focus-visible { outline: 2px solid var(--v3-accent); outline-offset: 2px; }
  .v3-sub { margin: 2px 0 0; font-size: 14px; color: var(--v3-muted); }
  .v3-tools-btn { flex: none; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px;
                  border-radius: 22px; background: #fff; border: 1px solid var(--v3-line); color: var(--v3-ink);
                  font: 600 15px var(--font-ui); }
  .v3-tools-btn svg { width: 20px; height: 20px; }

  /* Scrolling content between the header and the bottom button */
  .v3-main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 16px; }

  /* Lists */
  .v3-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--v3-line);
             border-radius: 14px; overflow: hidden; }
  .v3-swipe { position: relative; overflow: hidden; }
  .v3-swipe + .v3-swipe { border-top: 1px solid var(--v3-line); }
  .v3-swipe-del { position: absolute; right: 0; top: 0; bottom: 0; width: 92px; border: 0; background: var(--v3-cut);
                  color: #fff; font: 600 15px var(--font-ui); display: flex; flex-direction: column;
                  align-items: center; justify-content: center; gap: 2px; }
  .v3-swipe-del svg { width: 20px; height: 20px; }
  .v3-row { position: relative; width: 100%; display: flex; align-items: center; gap: 12px; min-height: 64px;
            padding: 0 14px; border: 0; background: #fff; color: var(--v3-ink); text-align: left; font-family: var(--font-ui); }
  .v3-row-sheet { min-height: 76px; padding-left: 6px; }
  .v3-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  .v3-row-size { font-size: 19px; font-weight: 700; white-space: nowrap; }
  .v3-row-name { font-size: 14px; color: var(--v3-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .v3-unit { font-size: 14px; font-weight: 500; color: var(--v3-muted); }
  .v3-incomplete { font-size: 16px; font-weight: 600; color: var(--v3-cut); }
  .v3-qty { flex: none; min-width: 34px; text-align: right; font-size: 17px; font-weight: 700; }
  .v3-chev { flex: none; width: 16px; height: 16px; color: var(--v3-muted); }
  .v3-ico-grain { flex: none; width: 18px; height: 18px; color: var(--v3-muted); }
  .v3-letter { flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--v3-wood); color: var(--v3-wood-ink);
               display: flex; align-items: center; justify-content: center; font: 700 17px var(--font-ui); }
  .v3-letter-sm { width: 30px; height: 30px; font-size: 15px; }
  .v3-letter-empty { background: #E6E9E5; color: var(--v3-muted); }
  .v3-note { margin: 12px 4px 0; font-size: 14px; line-height: 1.45; color: var(--v3-muted); }
  .v3-empty { margin-top: 18vh; text-align: center; color: var(--v3-muted); font-size: 15px; }
  .v3-empty p { margin: 4px 0; }
  .v3-empty-h { font: 600 22px var(--font-cond); color: var(--v3-ink); }

  .v3-thumb { flex: none; width: 80px; height: 48px; display: flex; align-items: center; justify-content: center; }
  .v3-thumb-face, .v3-preview-face { background: var(--v3-wood); border: 1px solid var(--v3-wood-ink); box-sizing: border-box;
    background-image: repeating-linear-gradient(0deg, transparent 0 4px, rgba(74,58,34,.25) 4px 5px); }
  .v3-h2 { margin: 24px 4px 10px; font: 600 16px var(--font-cond); color: var(--v3-muted); }
  .v3-stock { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .v3-stock-btn { display: flex; align-items: center; gap: 2px; min-height: 64px; padding: 0 10px 0 0; border: 1px solid var(--v3-line);
                  border-radius: 12px; background: #fff; text-align: left; color: var(--v3-ink); font-family: var(--font-ui); }
  .v3-stock-btn .v3-thumb { width: 60px; }
  .v3-stock-btn > span:last-child { display: flex; flex-direction: column; }
  .v3-stock-btn .v3-row-size { font-size: 16px; }
  .v3-kerf { margin-top: 20px; width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 58px;
             padding: 0 16px; background: #fff; border: 1px solid var(--v3-line); border-radius: 14px; text-align: left;
             color: var(--v3-ink); font-family: var(--font-ui); }
  .v3-kerf > span:first-child { display: flex; flex-direction: column; }
  .v3-kerf-h { font-size: 16px; font-weight: 700; }
  .v3-link { color: var(--v3-accent); font-weight: 600; font-size: 15px; }

  /* Bottom button and tab bar */
  .v3-cta { padding: 8px 16px 10px; }
  .v3-btn { width: 100%; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
            font: 600 18px var(--font-ui); border: 0; }
  .v3-btn svg { width: 21px; height: 21px; stroke-width: 2.2; }
  .v3-btn-primary { background: var(--v3-accent); color: #fff; }
  .v3-btn-outline { background: #fff; color: var(--v3-accent); border: 2px solid var(--v3-accent); }
  .v3-btn-danger { background: #fff; color: var(--v3-cut); border: 1.5px solid var(--v3-cut); }
  .v3-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: var(--v3-tabs-h); box-sizing: border-box;
             padding: 4px 12px var(--safe-bot); background: #fff; border-top: 1px solid var(--v3-line); }
  .v3-tab { border: 0; background: transparent; color: var(--v3-muted); display: flex; flex-direction: column; align-items: center;
            justify-content: center; gap: 3px; font: 500 13px var(--font-ui); min-height: 48px; }
  .v3-tab svg { width: 24px; height: 24px; stroke-width: 1.8; }
  .v3-tab b { font-size: 12px; }
  .v3-tab-on { color: var(--v3-accent); font-weight: 600; }

  /* Bottom sheets: edit and tools */
  .v3-sheet-wrap { position: fixed; inset: 0; z-index: 180; }
  .v3-scrim { position: absolute; inset: 0; background: rgba(20, 26, 24, .42); opacity: 0; transition: opacity .2s; }
  .v3-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - 16px - var(--safe-top));
              overflow-y: auto; background: #fff; border-radius: 16px 16px 0 0; padding: 6px 16px calc(10px + var(--safe-bot));
              box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; color: var(--v3-ink); font-family: var(--font-ui);
              transform: translateY(100%); transition: transform .22s ease-out; }
  .v3-sheet-open .v3-scrim { opacity: 1; }
  .v3-sheet-open .v3-sheet { transform: none; }
  .v3-grabber { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--v3-line); flex: none; }
  .v3-sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 40px; }
  .v3-sheet-head > :last-child { justify-self: end; }
  .v3-sheet-title { margin: 0; display: flex; align-items: center; gap: 8px; font: 600 21px var(--font-cond); }
  .v3-link-btn { border: 0; background: transparent; color: var(--v3-accent); font: 500 17px var(--font-ui); min-height: 44px; padding: 0; justify-self: start; }
  .v3-link-strong { font-weight: 700; }
  .v3-name { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border: 1px solid var(--v3-line);
             border-radius: 12px; font-size: 15px; color: var(--v3-muted); flex: none; }
  .v3-name input { flex: 1; min-width: 0; border: 0; outline: 0; font: 17px var(--font-ui); color: var(--v3-ink); background: transparent; }
  .v3-vals { display: grid; grid-template-columns: 1.25fr 1.25fr .7fr; gap: 8px; flex: none; }
  .v3-val { height: 58px; border-radius: 12px; border: 2px solid var(--v3-line); background: #fff; padding: 6px 12px; text-align: left;
            display: flex; flex-direction: column; justify-content: center; gap: 2px; color: var(--v3-ink); font-family: var(--font-ui); min-width: 0; }
  .v3-val-on { border-color: var(--v3-accent); background: var(--v3-accent-tint); }
  .v3-val-l { font-size: 13px; color: var(--v3-muted); }
  .v3-val-v { font-size: 24px; font-weight: 600; white-space: nowrap; overflow: hidden; min-height: 28px; line-height: 1.15; }
  .v3-caret { display: inline-block; width: 2px; height: 23px; margin-left: 2px; vertical-align: -3px; background: var(--v3-accent);
              animation: v3-blink 1s steps(1) infinite; }
  @keyframes v3-blink { 50% { opacity: 0; } }
  .v3-shape { display: flex; gap: 12px; align-items: center; flex: none; }
  .v3-preview { flex: none; width: 118px; height: 56px; border-radius: 10px; background: var(--v3-ground);
                display: flex; align-items: center; justify-content: center; }
  .v3-preview-face[data-grain="any"] { background-image: none; }
  .v3-preview-face[data-grain="width"] { background-image: repeating-linear-gradient(90deg, transparent 0 4px, rgba(74,58,34,.25) 4px 5px); }
  .v3-seg { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--v3-ground); border-radius: 12px; }
  .v3-seg button { height: 48px; border: 0; border-radius: 9px; background: transparent; color: var(--v3-muted);
                   font: 600 13px var(--font-ui); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
  .v3-seg button svg { width: 20px; height: 20px; stroke-width: 2; }
  .v3-seg .v3-seg-on { background: #fff; color: var(--v3-accent); }
  .v3-fracs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; flex: none; }
  .v3-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; flex: none; }
  .v3-key { height: 44px; border-radius: 10px; border: 0; background: #EDEFEC; color: var(--v3-ink); font: 500 23px var(--font-ui);
            display: flex; align-items: center; justify-content: center; gap: 5px; touch-action: manipulation; }
  .v3-key:active { filter: brightness(.92); }
  .v3-key svg { width: 24px; height: 24px; }
  .v3-key-op { background: #DDE2DD; }
  .v3-key-calc { font-size: 16px; font-weight: 600; }
  .v3-key-calc svg { width: 20px; height: 20px; }
  .v3-key-next { background: var(--v3-accent); color: #fff; font-size: 17px; font-weight: 600; }
  .v3-key-frac { height: 40px; background: var(--v3-wood-key); color: var(--v3-wood-ink); border: 1px solid rgba(74,58,34,.2); font-size: 21px; font-weight: 600; }
  .v3-key-frac:disabled { opacity: .4; }
  .v3-key-toggle { grid-column: 5; font-size: 15px; }
  .v3-sheet-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-top: 2px; flex: none; }
  .v3-sheet-foot .v3-btn { height: 48px; font-size: 17px; }
  .v3-sheet-foot .v3-btn[hidden] { display: none; }
  .v3-sheet-foot:has(.v3-btn[hidden]) { grid-template-columns: 1fr; }
  .v3-sheet-short { gap: 12px; }
  .v3-tool-list { display: flex; flex-direction: column; }
  .v3-tool { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; border: 0;
             background: #fff; color: var(--v3-ink); font: 17px var(--font-ui); text-align: left; }
  .v3-tool + .v3-tool { border-top: 1px solid var(--v3-line); }


  /* ── Cut plan (2.4.1) ── */
  .v3-stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
  .v3-stat { background: #fff; border: 1px solid var(--v3-line); border-radius: 12px; padding: 8px 12px; }
  .v3-stat-v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
  .v3-stat-l { font-size: 13px; color: var(--v3-muted); }
  .v3-stat-l-low { margin-top: 13px; }
  .v3-stat-bad { border-color: var(--v3-cut); }
  .v3-stat-bad .v3-stat-v { color: var(--v3-cut); }
  .v3-bar { margin: 4px 0 3px; height: 6px; border-radius: 3px; background: #E1E5E1; overflow: hidden; }
  .v3-bar i { display: block; height: 100%; background: var(--v3-ink); }
  .v3-alert { margin-top: 10px; width: 100%; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--v3-cut); border-radius: 12px;
              background: #FBEDEA; color: var(--v3-cut); font: 600 15px var(--font-ui); text-align: left; }
  .v3-chips { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; }
  .v3-chip { flex: none; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--v3-line); background: #fff;
             color: var(--v3-ink); font: 600 14px var(--font-ui); }
  .v3-chip span { color: var(--v3-muted); font-weight: 500; margin-left: 4px; }
  .v3-chip-on { border: 2px solid var(--v3-accent); color: var(--v3-accent); background: var(--v3-accent-tint); }
  .v3-plan { display: flex; gap: 14px; align-items: flex-start; margin-top: 12px; }
  .v3-fig { margin: 0; flex: none; display: flex; flex-direction: column; gap: 4px; }
  .v3-figcap { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--v3-muted); }
  .v3-sheetdraw { position: relative; box-sizing: content-box; border: 1.5px solid var(--v3-ink);
                  background: repeating-linear-gradient(45deg, #E6E9E5 0 3px, #C9CFCA 3px 4px); }
  .v3-piece { position: absolute; box-sizing: border-box; padding: 0; border: 1px solid var(--v3-wood-ink); background: var(--v3-wood);
              color: var(--v3-wood-ink); font-family: var(--font-ui); font-weight: 700; display: flex; align-items: center; justify-content: center; }
  .v3-piece-sel { outline: 3px solid var(--v3-accent); outline-offset: -1px; z-index: 1; }
  .v3-legend { list-style: none; margin: 18px 0 0; padding: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .v3-leg { width: 100%; display: flex; gap: 8px; align-items: flex-start; padding: 5px 6px; border: 0; border-radius: 8px;
            background: transparent; text-align: left; color: var(--v3-ink); font-family: var(--font-ui); min-height: 44px; }
  .v3-leg-sel { background: var(--v3-accent-tint); }
  .v3-letter-xs { width: 26px; height: 26px; border-radius: 6px; font-size: 13px; }
  .v3-leg-t { min-width: 0; display: flex; flex-direction: column; }
  .v3-leg-size { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
  .v3-leg-name { font-size: 12.5px; color: var(--v3-muted); line-height: 1.25; }
  .v3-cta-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .v3-spin { display: inline-block; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--v3-line);
             border-top-color: var(--v3-accent); animation: v3-spin .8s linear infinite; }
  @keyframes v3-spin { to { transform: rotate(360deg); } }
  .v3-retry { margin: 16px auto 0; width: auto; padding: 0 24px; }
  .v3-part-name { margin: 0; font-size: 17px; font-weight: 600; }
  .v3-part-help { margin: 0; font-size: 14px; color: var(--v3-muted); }
  .v3-part-left { margin: 0; color: var(--v3-cut); font-weight: 600; }
  .v3-pos { width: 100%; border-collapse: collapse; font-size: 17px; font-variant-numeric: tabular-nums; }
  .v3-pos th { text-align: left; font-size: 13px; font-weight: 600; color: var(--v3-muted); padding: 4px 8px 6px 0; border-bottom: 1.5px solid var(--v3-ink); }
  .v3-pos td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--v3-line); }
  .v3-pos td:nth-child(3), .v3-pos td:nth-child(4) { font-weight: 700; }
  #v3-part-body { display: flex; flex-direction: column; gap: 10px; padding-bottom: 6px; }

  /* ── Calculator and converter in v3 (2.4.1) ── */
  body.layout-v3 .v3-only.v3-fracs { display: grid; }
  body.layout-v3 .v3-only.v3-insert-bar:not([hidden]) { display: block; }
  body.layout-v3 .v3-only.v3-conv-pad { display: flex; flex-direction: column; gap: 6px; }
  body.layout-v3 #calc-insert-row,
  body.layout-v3 #conv-insert-row,
  body.layout-v3 #calc-frac-presets,
  body.layout-v3 .conv-hint + .conv-table + .insert-row { display: none !important; }
  body.layout-v3 #modal-calc .modal-box, body.layout-v3 #modal-converter .modal-box { font-family: var(--font-ui); }
  body.layout-v3 #modal-calc .modal-header span, body.layout-v3 #modal-converter .modal-header span { font-family: var(--font-cond); font-size: 21px; }
  body.layout-v3 #modal-calc .kp-btn { background: #EDEFEC; color: var(--v3-ink); border: 0; border-radius: 10px; }
  body.layout-v3 #modal-calc .kp-btn.kp-op { background: #DDE2DD; color: var(--v3-ink); }
  body.layout-v3 #modal-calc .kp-btn.kp-clr { background: #F3DDD7; color: var(--v3-cut); }
  body.layout-v3 #modal-calc .kp-btn.kp-eq { background: var(--v3-ink); color: #fff; }
  body.layout-v3 #modal-calc .kp-unit { border-radius: 9px; color: var(--v3-accent); }
  /* The card sits on the dark display: keep its text light, mark it with a blue edge */
  body.layout-v3 #modal-calc .au-card.au-active { border: 2px solid #8FA3F0; background: rgba(143, 163, 240, .22); }
  body.layout-v3 #modal-calc .au-card.au-active .au-unit { color: #C9D3FA; }
  body.layout-v3 #modal-calc .calc-result, body.layout-v3 #modal-calc .calc-frac { font-feature-settings: "tnum" 1; }
  body.layout-v3 #calc-v3-fracs, body.layout-v3 #conv-v3-fracs { margin: 2px 0 6px; }
  body.layout-v3 .v3-insert-bar { position: sticky; bottom: 0; z-index: 2; margin: 8px -16px 0; padding: 10px 16px calc(10px + var(--safe-bot));
                                  background: #fff; border-top: 1px solid var(--v3-line); }
  body.layout-v3 .v3-insert-bar .v3-btn:disabled { background: #C9CFCA; }
  body.layout-v3 #modal-calc .v3-insert-bar { margin: 4px 0 0; }   /* the calculator body has no side padding */
  .v3-insert-2 { display: grid; grid-template-columns: 1fr 2.3fr; gap: 10px; }
  .v3-insert-2 .v3-btn { font-size: 16px; }
  body.layout-v3 #modal-converter #conv-val { font-size: 26px; font-weight: 600; caret-color: transparent; }
  body.layout-v3 #modal-converter .conv-table td { font-variant-numeric: tabular-nums; }
  .v3-key-word { font-size: 15px !important; }
  /* Converter: keep the value in view while typing, and fit the screen */
  body.layout-v3 #modal-converter .conv-hint { display: none; }
  body.layout-v3 #modal-converter .conv-input-row { position: sticky; top: 56px; z-index: 1; background: #fff; padding: 6px 0;
    display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 8px; align-items: end; margin-bottom: 4px; }
  body.layout-v3 #modal-converter .conv-input-row label { min-width: 0; }
  body.layout-v3 #modal-converter .conv-input-row label:nth-child(3) { display: none; }   /* rounding follows Options */
  body.layout-v3 #modal-converter .conv-input-row input, body.layout-v3 #modal-converter .conv-input-row select { width: 100%; box-sizing: border-box; min-height: 52px; }
  /* Calculator: compact enough that the keypad sits above the Insert bar */
  /* Fits Safari's 659 pt viewport: = sits above the Insert bar */
  body.layout-v3 #modal-calc .calc-display { padding: 6px 16px 4px; }
  body.layout-v3 #modal-calc .calc-result { font-size: 34px; line-height: 1.1; }
  body.layout-v3 #modal-calc .calc-allunits { padding: 6px 16px; }
  body.layout-v3 #modal-calc .au-card { padding: 4px 2px; min-height: 0; }
  body.layout-v3 #modal-calc .au-card .au-frac { min-height: 0; }
  body.layout-v3 #modal-calc .calc-unit-row { padding: 4px 8px; }
  body.layout-v3 #modal-calc .kp-unit { min-height: 38px; padding: 4px 2px; }
  body.layout-v3 #modal-calc .keypad { padding: 4px 8px; gap: 5px; }
  body.layout-v3 #modal-calc .keypad .kp-btn { min-height: 44px !important; height: 44px; padding: 0; }
  body.layout-v3 #calc-v3-fracs { padding: 0 8px; }
  /* History folds into its header row; tap it to open */
  body.layout-v3 #modal-calc .calc-history { display: none; }
  body.layout-v3 #modal-calc.v3-hist-open .calc-history { display: block; max-height: 140px; }
  body.layout-v3 #modal-calc .calc-hist-header { cursor: pointer; }
  body.layout-v3 #modal-calc .calc-hist-header > span:first-child::after { content: " ▸"; }
  body.layout-v3 #modal-calc.v3-hist-open .calc-hist-header > span:first-child::after { content: " ▾"; }
  body.layout-v3 #modal-converter .conv-table td { padding-top: 6px; padding-bottom: 6px; }
  body.layout-v3 .v3-conv-pad .v3-key { height: 42px; }
  body.layout-v3 .v3-conv-pad .v3-key-frac { height: 38px; }
  .v3-key-clr { background: #F3DDD7; color: var(--v3-cut); }

  /* Toast */
  .v3-toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--v3-tabs-h) + 78px); z-index: 250;
              align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 8px 6px 16px;
              border-radius: 12px; background: var(--v3-ink); color: #fff; font: 15px var(--font-ui);
              opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s, transform .18s; }
  .v3-toast-show { opacity: 1; transform: none; pointer-events: auto; }
  .v3-toast-error { background: var(--v3-cut); }
  .v3-toast-btn { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-radius: 8px; background: rgba(255,255,255,.16);
                  color: #fff; font: 700 15px var(--font-ui); }

  @media (prefers-reduced-motion: reduce) {
    .v3-sheet, .v3-scrim, .v3-toast, .v3-row { transition: none !important; }
    .v3-caret { animation: none; }
  }
}
