/* Popular browser tools (wave 6). Loaded only on those pages, after webtools.css. Uses the site tokens.
   The first block repeats the few shared rules from webtools-more.css and webtools-everyday.css, which these pages skip. */
.tool[data-webtool] { grid-template-columns: minmax(0, 1fr); }
.tool [hidden] { display: none !important; }
.wt-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.wt-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.wt-table caption { text-align: left; font-weight: 600; padding: 0 0 0.4rem; color: var(--text); }
.wt-table th, .wt-table td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.wt-table thead th { position: sticky; top: 0; background: var(--bg-2); }
.wt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.5rem; }
.wt-stats:empty { display: none; }
.cc-stat { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.cc-stat span { font-size: 0.8rem; color: var(--text-2); }
.cc-stat strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cc-stat .cc-copy { align-self: flex-start; margin-top: 0.35rem; padding: 0.25rem 0.7rem; font-size: 0.8rem; min-height: 0; }
.cc-table-wrap { grid-column: 1 / -1; max-width: 100%; max-height: 22rem; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cc-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.cc-table th, .cc-table td { padding: 0.35rem 0.6rem; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.cc-table thead th { position: sticky; top: 0; background: var(--bg-2, var(--bg)); font-weight: 600; }
.cc-table tbody th { text-align: left; font-weight: 500; }
.cc-table-dl { grid-column: 1 / -1; margin: 0.25rem 0 0; }
[data-calc], [data-calc] label, [data-calc] > * { min-width: 0; }
[data-calc] select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.wt-canvas { display: block; width: 100%; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.wt-file { display: grid; gap: 0.35rem; font-size: 0.82rem; color: var(--text-2); }

/* shared pieces */
.tool input[type=range] { width: 100%; min-height: 28px; padding: 0; border: 0; background: none; accent-color: var(--accent); }
.tool label.btn { display: inline-flex; align-items: center; justify-content: center; font-size: 0.98rem; color: var(--text); cursor: pointer; }
.pw-range output { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.pw-more { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.pw-more > summary { min-height: 36px; padding-top: 0.4rem; font-weight: 600; cursor: pointer; }
.pw-more[open] > summary { margin-bottom: 0.6rem; }
.pw-more > :not(summary) + :not(summary) { margin-top: 0.6rem; }
.pw-more > p { margin-block: 0; font-size: 0.9rem; color: var(--text-2); }
.pw-drop { padding: 1rem; text-align: center; border: 2px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; }
.pw-drop input[type=file] { margin: 0.35rem auto 0; max-width: 100%; font-size: 0.9rem; border: 0; background: none; padding: 0; }
.pw-drop-sub { display: block; font-size: 0.8rem; color: var(--text-3); }
.pw-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tp-stage .tool .pw-chip { min-height: 36px; padding: 0.25rem 0.75rem; font-size: 0.85rem; }
.pw-credit { margin: 0; font-size: 0.75rem; color: var(--text-3); }
.pw-credit a { color: inherit; text-decoration: underline; }
.pw-rooms { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.pw-print-host { display: none; }
@media print {
  html.pw-printing body > *:not(.pw-print-host) { display: none !important; }
  html.pw-printing .pw-print-host { display: block !important; }
  html.pw-printing .pw-print-host .wt-table-wrap { overflow: visible; max-height: none; }
  html.pw-printing .pw-print-host .wt-table thead th { position: static; }
}

/* sound: tone, noise, decibel meter */
.sl-readout { text-align: center; }
.sl-big { margin: 0; font-size: clamp(2.6rem, 10vw, 4rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.sl-big span { font-size: 0.4em; font-weight: 600; color: var(--text-2); }
.sl-sub { margin: 0.3rem 0 0; color: var(--text-2); min-height: 1.4em; }
.sl-slider input[type=range] { min-height: 40px; }
.sl-chart { color: var(--accent); aspect-ratio: 5 / 1; }
.nz-scope { color: var(--c-audio-1); aspect-ratio: 16 / 3; }
.wt-bar.wt-bar-hot { background: var(--bad); }
.nz-colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.5rem; }
.nz-colors legend { grid-column: 1 / -1; }
.tool .nz-color { position: relative; display: block; cursor: pointer; }
.tool .nz-color input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.nz-color span { display: grid; gap: 0.15rem; height: 100%; padding: 0.7rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: 0.95rem; }
.nz-color small { font-size: 0.8rem; color: var(--text-2); }
.nz-color input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.nz-color input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.nz-left { margin: 0; min-height: 1.4em; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* keyboard test */
.kb-pad { overflow-x: auto; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); outline: none; }
.kb-pad.kb-focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.kb-hint { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--text-2); }
.kb-board { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: flex-start; min-width: 680px; }
.kb-block { display: grid; gap: 0.5rem; min-width: 0; }
.kb-main { flex: 15 1 0; }
.kb-nav { flex: 3 1 0; }
.kb-num { flex: 4 1 0; }
.kb-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: 2.3rem; gap: 4px; }
.kb-key { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 0 0.15rem; overflow: hidden; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--bg-2); color: var(--text); font-size: 0.7rem; line-height: 1.1; text-align: center; white-space: nowrap; user-select: none; transition: background-color 120ms, transform 60ms; }
.kb-key.kb-ok { background: color-mix(in srgb, var(--ok) 22%, var(--bg)); border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.kb-key.kb-down { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(1px); }
.kb-gap { visibility: hidden; }
.kb-arrows { display: flex; gap: 4px; min-width: 0; }
.kb-arrows > .kb-key, .kb-stack { flex: 1 1 0; }
.kb-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 2px; }
.kb-stack .kb-key { font-size: 0.6rem; }
.kb-extra { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 4px; align-items: center; }
.kb-extra .kb-key { height: 2rem; padding: 0 0.5rem; }
.kb-extra-h { margin-right: 0.3rem; font-size: 0.8rem; color: var(--text-2); }
.kb-log { margin: 0; min-height: 1.4em; font: 0.8rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text-2); }

/* mouse test */
.ms-pad { display: grid; justify-items: center; gap: 0.6rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); outline: none; user-select: none; touch-action: manipulation; transition: box-shadow 150ms; }
.ms-pad:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.ms-pad.ms-alert { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 50%, transparent); }
.ms-mouse { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 96px 1fr; width: 150px; height: 230px; border: 2px solid var(--border); border-radius: 75px 75px 70px 70px; background: var(--bg-2); }
.ms-btn { display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 600; color: var(--text-2); border-bottom: 2px solid var(--border); transition: background-color 120ms; }
.ms-left { grid-column: 1; grid-row: 1; border-right: 1px solid var(--border); border-radius: 73px 0 0 0; }
.ms-right { grid-column: 2; grid-row: 1; border-left: 1px solid var(--border); border-radius: 0 73px 0 0; }
.ms-mid { position: absolute; z-index: 1; top: 24px; left: 50%; width: 24px; height: 46px; margin-left: -12px; border: 2px solid var(--border); border-radius: 12px; background: var(--bg); font-size: 0.6rem; }
.ms-wheel { position: absolute; z-index: 2; top: 76px; left: 50%; width: 40px; margin-left: -20px; height: 18px; text-align: center; font-size: 0.75rem; line-height: 18px; color: var(--accent); }
.ms-wheel[data-dir=up]::after { content: "▲"; }
.ms-wheel[data-dir=down]::after { content: "▼"; }
.ms-wheel[data-dir=left]::after { content: "◀"; }
.ms-wheel[data-dir=right]::after { content: "▶"; }
.ms-side { position: absolute; left: -12px; width: 12px; height: 30px; border: 2px solid var(--border); border-right: 0; border-radius: 6px 0 0 6px; background: var(--bg); font-size: 0; }
.ms-fwd { top: 84px; }
.ms-back { top: 120px; }
.ms-btn.ms-ok, .ms-side.ms-ok { background: color-mix(in srgb, var(--ok) 24%, var(--bg-2)); }
.ms-btn.ms-down, .ms-side.ms-down { background: var(--accent); color: #fff; }
.ms-hint { margin: 0; font-size: 0.85rem; color: var(--text-2); }
.ms-log { max-height: 12rem; margin: 0; padding-left: 1.4rem; overflow: auto; font-size: 0.85rem; }
.ms-log:empty { display: none; }
.ms-log .ms-warn { color: var(--bad); font-weight: 600; }

/* click speed test */
.cps-pad { display: grid; place-items: center; align-content: center; gap: 0.35rem; width: 100%; min-height: 220px; padding: 1.25rem; border: 2px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: inherit; cursor: pointer; user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.cps-pad:active { transform: scale(0.995); }
.cps-big { font-size: clamp(1.8rem, 7vw, 3rem); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cps-sub { font-size: 0.9rem; color: var(--text-2); }
.cps-pad.cps-run { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.cps-pad.cps-end { border-style: solid; border-color: var(--ok); }

/* gamepad tester */
.gp-wait { margin: 0; padding: 1rem; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text-2); }
.gp-view { display: grid; gap: 1rem; }
.gp-sticks { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; }
.gp-stick { display: grid; justify-items: center; gap: 0.4rem; margin: 0; font-size: 0.85rem; color: var(--text-2); }
.gp-ring { position: relative; width: 150px; height: 150px; border: 2px solid var(--border); border-radius: 50%; background: var(--bg); }
.gp-ring::before, .gp-ring::after { content: ""; position: absolute; background: var(--border-2); }
.gp-ring::before { top: 0; bottom: 0; left: 50%; width: 1px; }
.gp-ring::after { left: 0; right: 0; top: 50%; height: 1px; }
.gp-dead { position: absolute; top: 50%; left: 50%; width: var(--dead, 10%); height: var(--dead, 10%); transform: translate(-50%, -50%); border: 1px dashed color-mix(in srgb, var(--star) 75%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--star) 22%, transparent); }
.gp-dot { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
.gp-dot::after { content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--text-3); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.gp-dot.gp-moved::after { background: var(--accent); }
.gp-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.4rem; }
.gp-btn { display: grid; gap: 0.3rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 0.8rem; }
.gp-name { color: var(--text-2); }
.gp-bar { display: block; height: 6px; overflow: hidden; border-radius: 3px; background: var(--bg-2); }
.gp-bar > span { display: block; width: 0; height: 100%; background: var(--accent); }
.gp-btn.gp-ok { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.gp-btn.gp-ok .gp-name { color: var(--text); }
.gp-btn.gp-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--bg)); }

/* webcam test and screen recorder */
.wc-stage { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-sm); background: #000; }
.wc-stage video { width: 100%; height: 100%; object-fit: contain; }
.wc-stage video.wc-mirror { transform: scaleX(-1); }
.wc-empty { position: absolute; inset: auto 1rem; margin: 0; text-align: center; color: #fff; opacity: 0.85; }
.wc-stage:fullscreen { aspect-ratio: auto; width: 100vw; height: 100vh; border-radius: 0; }
.wc-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.6rem; }
.wc-shots:empty { display: none; }
.wc-shot { display: grid; gap: 0.3rem; margin: 0; font-size: 0.8rem; color: var(--text-2); }
.wc-shot img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; }
.sr-time { margin: 0; min-height: 1.3em; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sr-video { width: 100%; max-height: 60vh; border-radius: var(--radius-sm); background: #000; }

/* typing test */
.ty-text { max-height: 9.6em; overflow: hidden; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text-3); font: 1.2rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: break-word; }
.ty-text .ty-ok { color: var(--text); }
.ty-text .ty-bad { border-radius: 2px; background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.ty-text .ty-cur { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.tool textarea.ty-input { font: 1.05rem/1.5 inherit; font-family: inherit; resize: none; }
.ty-best { margin: 0; font-size: 0.85rem; color: var(--text-2); }

/* text to speech, notepad, image to text: writing fields in the body font */
[data-webtool="tts"] textarea, [data-webtool="notepad"] textarea, [data-webtool="ocr"] textarea { font-family: inherit; font-size: 1rem; line-height: 1.6; }
.tts-view { max-height: 14rem; overflow: auto; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); font-size: 1.05rem; line-height: 1.7; white-space: pre-wrap; }
.tts-view:empty { display: none; }
.tts-view mark { padding: 0 1px; border-radius: 3px; background: color-mix(in srgb, var(--star) 45%, transparent); color: inherit; }
.np-wrap { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 0.9rem; align-items: start; }
.np-side, .np-main { display: grid; gap: 0.6rem; min-width: 0; }
.np-list { display: grid; gap: 2px; max-height: 26rem; margin: 0; padding: 0; overflow: auto; list-style: none; }
.np-item { display: grid; gap: 0.1rem; width: 100%; padding: 0.5rem 0.6rem; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.np-item strong { overflow: hidden; font-size: 0.9rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.np-item small { font-size: 0.75rem; color: var(--text-2); }
.np-item:hover, .np-item.np-on { background: var(--bg); }
.np-item.np-on { box-shadow: inset 3px 0 0 var(--accent); }
.np-none { padding: 0.5rem 0.6rem; font-size: 0.85rem; color: var(--text-2); }
.np-main textarea { min-height: 18rem; resize: vertical; }
.tool textarea.np-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.np-meta { margin: 0; min-height: 1.3em; font-size: 0.8rem; color: var(--text-2); }
.tp-stage .tool .np-undo { min-height: 32px; margin-left: 0.4rem; padding: 0.2rem 0.75rem; font-size: 0.85rem; }
.oc-thumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.oc-thumbs:empty { display: none; }
.oc-thumb { position: relative; display: grid; gap: 0.2rem; width: 110px; margin: 0; font-size: 0.72rem; color: var(--text-2); }
.oc-thumb img { width: 110px; height: 110px; object-fit: cover; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.oc-thumb figcaption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
[data-webtool="ocr"] progress { width: 100%; height: 10px; accent-color: var(--accent); }

/* symbols */
.sy-cats { display: flex; gap: 0.35rem; overflow-x: auto; padding-bottom: 0.25rem; scrollbar-width: thin; }
.sy-cat { flex: 0 0 auto; min-height: 36px; padding: 0.3rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg); color: var(--text); font: inherit; font-size: 0.85rem; white-space: nowrap; cursor: pointer; }
.sy-cat.sy-on { border-color: var(--accent); background: var(--accent); color: #fff; }
.sy-grid { display: grid; gap: 0.9rem; max-height: 34rem; overflow: auto; padding-right: 0.2rem; }
.sy-sec h3 { margin: 0 0 0.4rem; font-size: 0.9rem; color: var(--text-2); }
.sy-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.sy-cell { display: flex; align-items: center; justify-content: center; height: 44px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 1.35rem; line-height: 1; cursor: pointer; transition: transform 100ms, background-color 150ms; }
.sy-cell:hover { background: var(--bg-2); transform: translateY(-1px); }
.sy-cell.sy-flash { background: color-mix(in srgb, var(--ok) 28%, var(--bg)); }
.sy-none { margin: 0; color: var(--text-2); }
.sy-tray { display: grid; gap: 0.5rem; }
.tool .sy-tray input { font-size: 1.4rem; }
.sy-info { margin: 0; min-height: 1.6em; font-size: 0.9rem; color: var(--text-2); }
.sy-big { margin-right: 0.25rem; font-size: 1.6rem; vertical-align: middle; color: var(--text); }

/* developer: JSON, Base64, JWT, regex */
.dv-err { padding: 0.6rem 0.8rem; border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--border)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--bad) 8%, var(--bg)); font-size: 0.9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.dv-tree { max-height: 28rem; overflow: auto; padding: 0.3rem 0.2rem; font: 0.82rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dv-tree summary { cursor: pointer; }
.dv-kids { margin-left: 0.3rem; padding-left: 1.1rem; border-left: 1px dashed var(--border); }
.dv-leaf { padding-left: 1rem; overflow-wrap: anywhere; }
.dv-k { color: var(--accent); }
.dv-t, .dv-null { color: var(--text-3); }
.dv-null { font-style: italic; }
.dv-leaf .dv-s { color: var(--ok); }
.dv-n { color: #a1460a; }
.dv-b { color: #7c3aed; }
.dv-more { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--text-2); }
.dv-jwt { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.6rem; }
.dv-jwt:empty { display: none; }
.dv-part { min-width: 0; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-top: 3px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.dv-part h3 { margin: 0 0 0.35rem; font-size: 0.85rem; }
.dv-part pre { margin: 0; font: 0.78rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.dv-part.dv-h { border-top-color: #e5484d; }
.dv-part.dv-p { border-top-color: #8e4ec6; }
.dv-part.dv-s { border-top-color: #0b8fd6; }
.dv-verify { margin: 0; min-height: 1.4em; font-weight: 600; }
.dv-verify.dv-ok { color: var(--ok); }
.dv-verify.dv-bad { color: var(--bad); }
.dv-preview img { max-width: 100%; max-height: 240px; border: 1px solid var(--border); border-radius: 8px; }
.rx-pattern { display: flex; align-items: flex-end; gap: 0.35rem; font: 1.1rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.rx-pattern > span { padding-bottom: 0.7rem; color: var(--text-3); }
.rx-input { flex: 1 1 auto; }
.rx-flags { flex: 0 0 5.5rem; }
.tool .rx-pattern input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.rx-view { min-height: 3rem; max-height: 18rem; overflow: auto; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); font: 0.85rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.rx-m { padding: 0 1px; border-radius: 3px; color: inherit; }
.rx-m0 { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.rx-m1 { background: color-mix(in srgb, var(--star) 42%, transparent); }
.rx-empty { display: inline-block; width: 2px; height: 1em; vertical-align: text-bottom; background: var(--accent); }
.rx-table th, .rx-table td { font: 0.8rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.wt-table-wrap:empty { display: none; }

/* privacy manifest and app-ads.txt */
.tool .pm-sec { display: grid; gap: 0.6rem; padding: 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.tool .pm-sec legend { margin-bottom: 0; padding: 0 0.3rem; }
.pm-types, .pm-apis { display: grid; gap: 0.6rem; max-height: 30rem; overflow: auto; }
.pm-group h4, .pm-api h4 { margin: 0.3rem 0; font-size: 0.9rem; }
.pm-type { padding: 0.1rem 0; border-bottom: 1px solid var(--border-2); }
.pm-opts { display: grid; gap: 0.1rem; padding: 0 0 0.5rem 1.6rem; }
.pm-purposes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 0.6rem; margin-top: 0.2rem; padding: 0.4rem 0.6rem; border-radius: 8px; background: var(--bg-2); }
.pm-api { padding: 0.3rem 0 0.5rem; border-bottom: 1px solid var(--border-2); }
.tool .pm-reason { align-items: flex-start; padding-block: 0.35rem; }
.pm-reason input { margin-top: 0.2rem; }
.pm-reason code { margin-right: 0.3rem; font-weight: 600; }
.aa-rows { display: grid; gap: 0.6rem; }
.aa-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.5rem; align-items: end; padding: 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.aa-del { min-height: 44px; }
.aa-report { display: grid; gap: 0.3rem; max-height: 26rem; margin: 0; padding-left: 1.4rem; overflow: auto; font-size: 0.88rem; }
.aa-report:empty { display: none; }
.aa-report code { padding: 0 0.25rem; border-radius: 4px; background: var(--bg-2); font-size: 0.8rem; overflow-wrap: anywhere; }
.aa-report .aa-ok::marker, .aa-report .aa-ok strong { color: var(--ok); }
.aa-report .aa-warn::marker, .aa-report .aa-warn strong { color: #b45309; }
.aa-report .aa-err::marker, .aa-report .aa-err strong { color: var(--bad); }

/* crop and rotate */
.cr-stage { position: relative; margin: 0 auto; overflow: hidden; border-radius: 6px; background: repeating-conic-gradient(var(--bg-2) 0 25%, var(--bg) 0 50%) 0 0 / 16px 16px; touch-action: none; user-select: none; }
.cr-canvas { display: block; }
.cr-box { position: absolute; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); outline: 1px solid rgba(255, 255, 255, 0.9); cursor: move; touch-action: none; }
.cr-box::before { content: ""; position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(to right, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) 0 calc(33.33% + 0.5px), transparent 0 calc(66.67% - 0.5px), rgba(255, 255, 255, 0.45) 0 calc(66.67% + 0.5px), transparent 0),
  linear-gradient(to bottom, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) 0 calc(33.33% + 0.5px), transparent 0 calc(66.67% - 0.5px), rgba(255, 255, 255, 0.45) 0 calc(66.67% + 0.5px), transparent 0); }
.cr-box:focus-visible { outline: 2px solid var(--accent); }
.cr-h { position: absolute; width: 22px; height: 22px; border: 3px solid #fff; }
.cr-h::after { content: ""; position: absolute; inset: -12px; }
.cr-h[data-h=nw] { top: -4px; left: -4px; border-right: 0; border-bottom: 0; cursor: nwse-resize; }
.cr-h[data-h=ne] { top: -4px; right: -4px; border-left: 0; border-bottom: 0; cursor: nesw-resize; }
.cr-h[data-h=sw] { bottom: -4px; left: -4px; border-right: 0; border-top: 0; cursor: nesw-resize; }
.cr-h[data-h=se] { right: -4px; bottom: -4px; border-left: 0; border-top: 0; cursor: nwse-resize; }
.cr-wh { display: flex; gap: 0.4rem; }

/* word tools */
.wd-results { display: grid; gap: 0.8rem; }
.wd-group h3 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.wd-group h3 small { margin-left: 0.3rem; font-weight: 400; color: var(--text-2); }
.wd-group ul, .wd-five { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.wd-word { min-height: 36px; padding: 0.25rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: 600 0.95rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.03em; text-transform: uppercase; cursor: pointer; }
.wd-word small { margin-left: 0.35rem; font-size: 0.7rem; font-weight: 400; color: var(--text-3); }
.wd-more { margin: 0.4rem 0 0; font-size: 0.82rem; color: var(--text-2); }
.wd-tiles { display: flex; gap: 0.4rem; }
.tool input.wd-tile { width: 3.2rem; height: 3.2rem; padding: 0; border-width: 2px; font-size: 1.5rem; font-weight: 700; text-align: center; text-transform: uppercase; }
.tool input.wd-green { border-color: #2e9d4f; background: color-mix(in srgb, #2e9d4f 14%, var(--bg)); }
.tool input.wd-yellow { flex: 1 1 0; width: auto; min-width: 0; border-color: #c9a227; background: color-mix(in srgb, #c9a227 16%, var(--bg)); font-size: 1rem; }

/* random number and coin flip */
.rn-big { margin: 0; min-height: 1.2em; text-align: center; font-size: clamp(2rem, 8vw, 3.4rem); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
[data-mode="coin"] .rn-big { font-size: clamp(1.4rem, 5vw, 2rem); }
.rn-hist { max-height: 12rem; margin: 0.5rem 0 0; padding-left: 1.4rem; overflow: auto; font-size: 0.88rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cf-stage { display: grid; place-items: center; padding: 1rem 0; perspective: 900px; }
.cf-coin { position: relative; width: 160px; height: 160px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; transform: rotateY(0deg); transform-style: preserve-3d; -webkit-tap-highlight-color: transparent; }
.cf-coin.cf-show-t { transform: rotateY(180deg); }
.cf-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 1.1rem; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; font-size: 1.1rem; font-weight: 700; text-align: center; overflow-wrap: anywhere; color: #5b3a00; background: radial-gradient(circle at 35% 30%, #ffe9a8, #f2b632 55%, #c8860d); box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.35), inset 0 0 0 9px rgba(140, 90, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.25); }
.cf-tails { transform: rotateY(180deg); color: #2c333a; background: radial-gradient(circle at 35% 30%, #f6f7f8, #c3c9d0 55%, #8a939c); box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.4), inset 0 0 0 9px rgba(60, 70, 80, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25); }
.cf-coin.cf-spin-h { animation: cf-h 0.9s cubic-bezier(0.25, 0.8, 0.3, 1) forwards; }
.cf-coin.cf-spin-t { animation: cf-t 0.9s cubic-bezier(0.25, 0.8, 0.3, 1) forwards; }
@keyframes cf-h { 50% { transform: rotateY(900deg) scale(1.15); } 100% { transform: rotateY(1800deg) scale(1); } }
@keyframes cf-t { 50% { transform: rotateY(990deg) scale(1.15); } 100% { transform: rotateY(1980deg) scale(1); } }
.cf-hist { margin: 0; font: 0.85rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.05em; color: var(--text-2); overflow-wrap: anywhere; }

/* prayer times, Qibla, Hijri, panchang, moon */
.ast-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.5rem; }
.ast-out:empty { display: none; }
.ast-head { grid-column: 1 / -1; margin: 0; font-weight: 600; }
.ast-out .cc-stat.ast-now { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); box-shadow: inset 3px 0 0 var(--accent); }
.ast-minor strong { font-size: 0.95rem; color: var(--text-2); }
.ast-next { margin: 0; min-height: 1.4em; font-weight: 600; }
.ast-list { display: grid; gap: 0.3rem; margin: 0; padding-left: 1.2rem; }
[data-suntimes] h3, [data-quarters] h3, [data-cal] h3 { margin: 0 0 0.5rem; font-size: 1rem; }
[data-suntimes] p { margin: 0.5rem 0 0; }
.pw-month { max-height: 32rem; }
.pw-month th[scope=row] { white-space: nowrap; }
.qb-wrap, .mn-hero { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 1rem; align-items: center; }
.qb-rose, .mn-disc { display: block; width: 100%; height: auto; }
.qb-stats { grid-template-columns: 1fr; }
.qb-face { fill: var(--bg); stroke: var(--border); stroke-width: 2; }
.qb-tick { stroke: var(--text-3); stroke-width: 1.5; }
.qb-tick.qb-big { stroke: var(--text); stroke-width: 3; }
.qb-lbl { fill: var(--text-2); font: 600 14px system-ui, sans-serif; text-anchor: middle; }
.qb-lbl.qb-n { fill: var(--bad); }
.qb-arrow { stroke: var(--accent); stroke-width: 6; stroke-linecap: round; }
.qb-head { fill: var(--accent); }
.qb-kaaba, .qb-hub { fill: var(--text); }
.qb-on-target .qb-arrow { stroke: var(--ok); }
.qb-on-target .qb-head { fill: var(--ok); }
.qb-on-target .qb-face { stroke: var(--ok); stroke-width: 4; }
.mn-dark { fill: #2b2f36; stroke: var(--border); stroke-width: 1; }
.mn-lit { fill: #f4f1e6; }
.mn-qs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.mn-qs li { padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); font-size: 0.88rem; }
.mn-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.mn-cal li { display: grid; justify-items: center; align-content: start; gap: 2px; min-width: 0; padding: 0.3rem 0.1rem; border: 1px solid var(--border-2); border-radius: 8px; background: var(--bg); font-size: 0.75rem; }
.mn-cal li.mn-dow, .mn-cal li.mn-pad { border: 0; background: none; }
.mn-cal li.mn-dow { font-weight: 600; color: var(--text-2); }
.mn-cal li b { font-weight: 600; }
.mn-cal svg { width: 100%; max-width: 34px; height: auto; }
.mn-cal li.mn-sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mn-cal li small { font-size: 0.62rem; line-height: 1.1; text-align: center; color: var(--text-2); }
@media (max-width: 600px) {
  .qb-wrap, .mn-hero { grid-template-columns: minmax(0, 1fr); }
  .qb-rose, .mn-disc { max-width: 240px; margin: 0 auto; }
  .np-wrap { grid-template-columns: minmax(0, 1fr); }
  .np-list { max-height: 12rem; }
}

/* printable calendar: the preview is drawn as paper, so it keeps paper colours in dark mode */
.pc-sheet { display: grid; gap: 1rem; }
.pc-page { display: flex; flex-direction: column; gap: 1.6cqw; aspect-ratio: var(--pc-ratio, 1.414); overflow: hidden; padding: 3.5% 4%; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: #111; box-shadow: var(--elev-1); container-type: inline-size; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pc-page h2 { margin: 0; font-size: 5.4cqw; line-height: 1.05; color: #111; }
.pc-title { margin: 0; font-size: 1.9cqw; letter-spacing: 0.08em; text-transform: uppercase; color: #555; }
.pc-month .pc-grid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto; grid-auto-rows: minmax(0, 1fr); border-top: 1px solid #bbb; border-left: 1px solid #bbb; }
.pc-month .pc-grid.pc-has-wk { grid-template-columns: 2.6cqw repeat(7, minmax(0, 1fr)); }
.pc-month .pc-dow { padding: 0.5cqw; border-right: 1px solid #bbb; border-bottom: 1px solid #bbb; background: #f3f3f3; color: #444; font-size: 1.5cqw; font-weight: 700; text-align: center; text-transform: uppercase; }
.pc-month .pc-day { position: relative; min-height: 0; overflow: hidden; padding: 0.5cqw 0.7cqw; border-right: 1px solid #bbb; border-bottom: 1px solid #bbb; }
.pc-month .pc-n { font-size: 2.1cqw; font-weight: 600; }
.pc-month .pc-wk { padding-top: 0.6cqw; border-right: 1px solid #bbb; border-bottom: 1px solid #bbb; background: #f8f8f8; color: #777; font-size: 1.2cqw; text-align: center; }
.pc-day.pc-we .pc-n, .pc-day.pc-hol .pc-n { color: #b3261e; }
.pc-month .pc-day.pc-hol { background: #fff4e5; }
.pc-day.pc-empty { background: #fafafa; }
.pc-hn { display: block; font-size: 1.15cqw; line-height: 1.2; color: #8a4b00; }
.pc-moon { position: absolute; top: 0.6cqw; right: 0.6cqw; width: 2.2cqw; height: 2.2cqw; }
.pc-moon-dark { fill: #3a3a3a; stroke: #3a3a3a; stroke-width: 3; }
.pc-moon-lit { fill: #fff; }
.pc-notes { display: grid; gap: 2.2cqw; margin-top: 0.6cqw; font-size: 1.4cqw; color: #666; }
.pc-line { height: 0; border-bottom: 1px solid #bbb; }
.pc-minis { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2cqw 2.5cqw; align-content: start; }
.pc-minis.pc-portrait { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pc-mini h3 { margin: 0 0 0.6cqw; font-size: 1.8cqw; color: #111; }
.pc-mini .pc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.2cqw; text-align: center; }
.pc-mini .pc-grid.pc-has-wk { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.pc-mini .pc-dow { font-size: 1.05cqw; font-weight: 700; color: #666; }
.pc-mini .pc-day { position: relative; padding: 0.25cqw 0; font-size: 1.25cqw; }
.pc-mini .pc-wk { padding: 0.25cqw 0; font-size: 1cqw; color: #999; }
.pc-dot { position: absolute; bottom: 0; left: 50%; width: 0.5cqw; height: 0.5cqw; margin-left: -0.25cqw; border-radius: 50%; background: #b3261e; }
.pc-legend { display: flex; flex-wrap: wrap; gap: 0.3cqw 1.4cqw; margin: 0; font-size: 1.1cqw; color: #444; }
.pc-portrait .pc-page h2 { font-size: 6.4cqw; }
@media print {
  html.pw-printing .pc-sheet { display: block; }
  html.pw-printing .pc-page { height: var(--pc-print-h); aspect-ratio: auto; padding: 0; border: 0; border-radius: 0; box-shadow: none; break-after: page; }
  html.pw-printing .pc-page:last-child { break-after: auto; }
}

/* invoices: form */
.iv-sec { min-width: 0; margin: 0 0 0.9rem; padding: 0.7rem 1rem 1rem; border: 1px solid var(--border, #e5e5ea); border-radius: 12px; }
.iv-sec > legend { padding: 0 0.4rem; font-weight: 700; }
.iv-logo-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; margin: 0.6rem 0; }
.iv-lines { container-type: inline-size; display: grid; gap: 0.55rem; margin-bottom: 0.4rem; }
.iv-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.4rem 0.6rem; align-items: end; padding: 0.65rem; border: 1px solid var(--border, #e5e5ea); border-radius: 10px; }
.iv-line .iv-c-desc { grid-column: 1 / -1; }
.tool .iv-cell { gap: 0.2rem; min-width: 0; font-size: 0.85rem; }
.iv-cell input, .iv-cell select { width: 100%; min-width: 0; }
.iv-amt { align-self: center; justify-self: end; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.iv-x { align-self: center; justify-self: end; width: 2rem; height: 2rem; border: 1px solid var(--border, #d8d8de); border-radius: 50%; background: transparent; color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.iv-x:hover { border-color: #c62828; color: #c62828; }
@container (min-width: 540px) {
  [data-mode="invoice"] .iv-line { grid-template-columns: minmax(0, 1fr) 4.5rem 7rem 7rem 2rem; padding: 0; border: 0; border-radius: 0; }
  [data-mode="invoice"] .iv-line .iv-c-desc { grid-column: auto; }
  [data-mode="invoice"] .iv-line:not(:first-child) .iv-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  [data-mode="gst"] .iv-line { grid-template-columns: 6rem 4.2rem 4.6rem minmax(5rem, 1fr) 4.4rem 5rem minmax(5.5rem, 1fr) 2rem; }
}
.iv-sigbox { margin-top: 0.8rem; }
.iv-sighead { margin: 0 0 0.4rem; font-weight: 600; }
.iv-pad { display: block; width: 100%; height: 120px; border: 1px dashed var(--border, #c8c8ce); border-radius: 10px; background: #fff; cursor: crosshair; touch-action: none; }
.iv-status:empty, .tool [data-sum]:empty { display: none; }
.iv-warn { margin: 0.6rem 0; padding: 0.6rem 0.9rem 0.6rem 2rem; border: 1px solid #f0cf85; border-radius: 10px; background: #fff8e8; color: #5e3d00; font-size: 0.92rem; }
.iv-warn li + li { margin-top: 0.25rem; }

/* invoices: the preview is a white page that scales with its width, like the PDF */
.iv-paper { container-type: inline-size; margin-top: 1rem; }
.iv-doc { --iv-ac: #1f4e79; min-height: calc(100cqw * 1.414); padding: 6.7cqw 6.7cqw 5cqw; border-radius: 4px; background: #fff; color: #1b1b1f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 10px 28px rgba(0, 0, 0, 0.08); font: 400 max(10px, 1.55cqw)/1.42 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
.iv-doc p { margin: 0; }
.iv-copy { margin: -3cqw 0 1.2cqw; color: #66666b; font-size: 0.8em; text-align: right; }
.iv-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 4cqw; }
.iv-seller { flex: 1 1 50%; min-width: 0; }
.iv-logo { display: block; max-width: min(150px, 25cqw); max-height: 9cqw; margin-bottom: 1.6cqw; object-fit: contain; }
.iv-name { font-size: 1.45em; font-weight: 700; overflow-wrap: anywhere; }
.iv-sub { color: #55555b; overflow-wrap: anywhere; }
.iv-head { flex: 0 1 auto; text-align: right; }
.iv-title { margin: 0 0 1.2cqw; color: var(--iv-ac); font-size: 2.2em; line-height: 1.1; letter-spacing: 0.04em; text-transform: uppercase; }
.iv-meta { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 0.15em 1.6em; margin: 0; }
.iv-meta dt { color: #66666b; text-align: left; }
.iv-meta dd { margin: 0; font-weight: 600; text-align: right; }
.iv-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14em), 1fr)); gap: 4cqw; margin: 3cqw 0 2.6cqw; padding-top: 2.4cqw; border-top: 1px solid #dcdce0; }
.iv-doc h3 { margin: 0 0 0.35em; color: #6b6b70; font-size: 0.78em; letter-spacing: 0.06em; text-transform: uppercase; }
.iv-pname { font-size: 1.15em; font-weight: 700; overflow-wrap: anywhere; }
.iv-doc .iv-ph { color: #a2a2a8; font-style: italic; }
.iv-tablewrap { overflow-x: auto; }
.iv-items { width: 100%; min-width: 46em; border-collapse: collapse; font-size: 0.95em; }
.iv-items th { padding: 0.55em 0.5em; background: #eaf0f6; background: color-mix(in srgb, var(--iv-ac) 10%, #fff); color: color-mix(in srgb, var(--iv-ac) 80%, #000); font-size: 0.82em; font-weight: 700; text-align: left; }
.iv-items td { padding: 0.5em; border-bottom: 1px solid #e3e3e7; vertical-align: top; white-space: pre-line; overflow-wrap: anywhere; }
.iv-items .iv-r { text-align: right; font-variant-numeric: tabular-nums; }
.iv-items .iv-c { text-align: center; }
.iv-items td.iv-empty { padding: 1.5em; color: #8a8a90; font-style: italic; text-align: center; }
.iv-summary { margin-bottom: 2.4cqw; font-size: 0.85em; }
.iv-summary th { background: #f1f1f3; color: #46464b; }
.iv-summary tfoot td { padding: 0.5em; border-bottom: 1px solid #c8c8cc; font-weight: 700; }
.iv-sums { display: flex; flex-wrap: wrap-reverse; justify-content: space-between; align-items: flex-start; gap: 3cqw; margin: 2.4cqw 0; }
.iv-wordsbox { flex: 1 1 14em; min-width: 0; }
.iv-words { font-style: italic; }
.iv-totals { min-width: min(100%, 19em); margin-left: auto; border-collapse: collapse; }
.iv-totals th { padding: 0.25em 1.5em 0.25em 0; color: #5c5c61; font-weight: 400; text-align: left; }
.iv-totals td { padding: 0.25em 0; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.iv-totals .iv-big th, .iv-totals .iv-big td { padding-top: 0.5em; border-top: 1px solid #d5d5da; color: #1b1b1f; font-size: 1.1em; font-weight: 700; }
.iv-stamp { display: inline-block; margin-top: 1em; padding: 0.15em 0.7em; border: 2px solid #1b7f3e; border-radius: 4px; color: #1b7f3e; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; transform: rotate(-4deg); }
.iv-pay { display: flex; justify-content: space-between; align-items: flex-start; gap: 3cqw; margin: 2.4cqw 0; }
.iv-paytext { min-width: 0; }
.iv-paytext p { overflow-wrap: anywhere; }
.iv-qrbox { flex: none; max-width: 12em; margin: 0; text-align: center; }
.iv-qr { display: block; width: min(112px, 19cqw); height: auto; margin: 0 auto 0.3em; }
.iv-qrbox figcaption { color: #66666b; font-size: 0.78em; }
.iv-note { margin: 0 0 1.6cqw; }
.iv-note p { white-space: pre-line; overflow-wrap: anywhere; }
.iv-sign { width: min(100%, 16em); margin: 3cqw 0 0 auto; text-align: right; }
.iv-for { font-weight: 700; }
.iv-sign img { display: block; max-width: 100%; max-height: 3.4em; margin: 0.3em 0 0 auto; }
.iv-sigspace { display: block; height: 3.4em; }
.iv-siglabel { padding-top: 0.3em; border-top: 1px solid #1b1b1f; color: #5c5c61; }
@media print {
  html.pw-printing .iv-print .iv-doc { min-height: 0; padding: 0; border-radius: 0; box-shadow: none; font-size: 9.5pt; break-after: page; }
  html.pw-printing .iv-print .iv-doc:last-child { break-after: auto; }
  html.pw-printing .iv-print .iv-tablewrap { overflow: visible; }
  html.pw-printing .iv-print .iv-items th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html.pw-printing .iv-print .iv-items tr { break-inside: avoid; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dv-n { color: #fbbf24; }
  :root:not([data-theme="light"]) .dv-b { color: #c4b5fd; }
  :root:not([data-theme="light"]) .aa-report .aa-warn strong { color: #fbbf24; }
  :root:not([data-theme="light"]) .iv-warn { border-color: #6b5112; background: #33270a; color: #fde7b0; }
}
:root[data-theme="dark"] .iv-warn { border-color: #6b5112; background: #33270a; color: #fde7b0; }
:root[data-theme="dark"] .dv-n { color: #fbbf24; }
:root[data-theme="dark"] .dv-b { color: #c4b5fd; }
:root[data-theme="dark"] .aa-report .aa-warn strong { color: #fbbf24; }
@media (prefers-reduced-motion: reduce) {
  .cf-coin.cf-spin-h, .cf-coin.cf-spin-t { animation: none; }
  .kb-key, .sy-cell, .ms-btn { transition: none; }
}
