/* The breeder page's stylesheet: auto-crypto-wallet signer/src/page/css/base.css and frame.css at
   02c3836 (the signer's admin page), with a teal accent in place of its indigo so the two pages
   cannot be mixed up (contract 11.5); breeder rules at the end. */
:root {
  color-scheme: light;
  --ink: #19273f;
  --muted: #4e6078;
  --line: #dfe5ed;
  --surface: #fff;
  --canvas: #f8f9fd;
  --tint: #f2f5fa;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --green: #126745;
  --amber: #784706;
  --red: #a12939;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Liberation Sans", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body, h1, h2, h3, h4, p, dl, dd { margin: 0; }
body { min-width: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent-dark); }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
code {
  font-family: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
small, .help { font-size: 12px; color: var(--muted); }
svg { flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.frame { width: min(1168px, calc(100% - 64px)); margin-inline: auto; }
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.brand-row, .brand, .state { display: flex; align-items: center; }
.brand-row { justify-content: space-between; min-height: 67px; gap: 12px; }
.brand { gap: 10px; }
.brand h1 { font-size: 18px; letter-spacing: -.025em; font-weight: 740; }
.mark { display: grid; place-items: center; width: 32px; height: 32px; color: white; background: var(--accent); border-radius: 9px; }
.state { gap: 12px; color: var(--muted); font-size: 12px; }
.tabs { display: flex; align-items: stretch; gap: 29px; }
.tabs a, .subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 620;
  border-bottom: 2px solid transparent;
}
.tabs a { padding-inline: 2px; margin-bottom: -1px; }
.tabs a:hover, .subnav a:hover, .tabs a[aria-current], .subnav a[aria-current] { color: var(--accent); }
.tabs a[aria-current], .subnav a[aria-current] { border-bottom-color: var(--accent); }
main { padding-block: 27px 35px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h2 { font-size: 30px; font-weight: 740; letter-spacing: -.041em; line-height: 1.18; }
.page-note { color: var(--muted); margin: -2px 0 18px; }
.overview-status { display: flex; align-items: center; color: var(--muted); font-size: 12px; gap: 8px; }
.overview-status span { padding: 4px 8px; border-radius: 5px; background: #edf0f7; }
.overview-status b { color: var(--ink); margin-right: 3px; }
.pill { display: inline-flex; width: max-content; max-width: 100%; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 5px; padding: 1px 7px; font-size: 12px; font-weight: 680; white-space: nowrap; }
.dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.healthy { background: #e9f8ef; color: var(--green); border-color: #d1eedc; }
.waiting { background: #fff5dc; color: var(--amber); border-color: #f4e2b6; }
.approved { background: #e6f6f3; color: var(--accent-dark); border-color: #cdeee8; }
.neutral { background: var(--tint); color: var(--muted); border-color: var(--line); }
.approval, .metric, .wallet-panel, .payments, .security-log, .settings-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 4px #17244006;
}
.approval { overflow: hidden; }
.approval-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 11px 23px;
  border-bottom: 1px solid var(--line);
}
.approval-head h3, .section-title h3 { font-size: 17px; font-weight: 710; letter-spacing: -.018em; }
.approval-layout { display: grid; grid-template-columns: 1.64fr 1fr; }
.transfer { min-width: 0; padding: 20px 23px 23px; }
.transfer h4 { font-size: 43px; line-height: 1.02; font-weight: 740; letter-spacing: -.06em; }
.transfer h4 span { font-size: 24px; color: var(--muted); letter-spacing: -.02em; }
.transfer-description { font-size: 15px; font-weight: 630; margin-top: 4px; }
.transfer-route { margin-top: 15px; border: 1px solid var(--line); border-radius: 7px; }
.transfer-route > div { padding: 9px 12px; }
.transfer-route > div + div { border-top: 1px solid var(--line); }
.transfer-route dt { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.transfer-route dt > span { flex: 0 0 34px; color: var(--muted); font-size: 12px; font-weight: 700; }
.transfer-route dd { margin-top: 2px; }
.transfer-route code { color: #293d59; }
.program-note { margin-top: 13px; padding: 9px 12px; background: #fff9ed; border: 1px solid #f2e6ca; border-radius: 6px; color: #674913; font-size: 12px; overflow-wrap: anywhere; }
.program-note strong { font-size: 11px; letter-spacing: .045em; text-transform: uppercase; }
.program-note p + p { margin-top: 2px; }
.decision { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 23px; border-left: 1px solid var(--line); background: #fbfcff; }
.request-data { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.request-data dt, .request-id span, .detail-facts dt { color: var(--muted); font-size: 12px; font-weight: 650; }
.request-data dd { font-weight: 680; margin-top: 3px; }
.request-data small { display: block; font-weight: 450; margin-top: 1px; }
.decision-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 23px; }
.decision-actions button { width: 100%; min-height: 44px; }
.request-id { display: grid; margin-top: 22px; gap: 2px; }
.empty-body { display: flex; align-items: center; gap: 13px; padding: 27px 23px; font-weight: 630; }
.empty-icon { display: grid; place-items: center; color: var(--green); background: #e9f8ef; width: 42px; height: 42px; border-radius: 50%; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 23px 0 10px; gap: 9px; }
.section-title > span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric { min-width: 0; padding: 15px; }
.metric h4 { color: var(--muted); font-size: 12px; font-weight: 660; }
.metric p { margin: 5px 0 8px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.metric strong { color: var(--ink); font-size: 25px; letter-spacing: -.04em; }
meter { appearance: none; display: block; width: 100%; height: 5px; border: 0; border-radius: 4px; background: #e1f0ed; }
meter::-webkit-meter-bar { height: 5px; border: 0; border-radius: 4px; background: #e1f0ed; }
meter::-webkit-meter-optimum-value { border-radius: 4px; background: var(--accent); }
meter::-moz-meter-bar { border-radius: 4px; background: var(--accent); }
.metric-split, .metric-note { color: var(--muted); font-size: 11px; }
.metric-split { margin-top: 8px; font-weight: 650; }
.metric-note { margin-top: 1px; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 0 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
button, .btn, .add-wallet > summary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 12px; border: 1px solid #cdd6e2; border-radius: 6px;
  background: var(--surface); color: var(--ink); font-weight: 650; text-decoration: none;
}
button:hover, .btn:hover, .add-wallet > summary:hover { background: var(--tint); }
.primary, .add-wallet > summary { color: white; background: var(--accent); border-color: var(--accent); }
.primary:hover, .add-wallet > summary:hover { color: white; background: var(--accent-dark); border-color: var(--accent-dark); }
.reject { color: var(--red); border-color: #e3c1c7; }
.reject:hover { background: #fff4f5; }
.danger { color: white; background: #a12939; border-color: #a12939; }
.danger:hover { background: #831c2b; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
summary > svg:last-child { transition: transform .12s; }
details[open] > summary > svg:last-child { transform: rotate(90deg); }
label { display: block; font-weight: 640; }
input:not([type=hidden]), select {
  width: 100%; min-height: 40px; min-width: 0; padding: 8px 10px; margin-top: 5px;
  border: 1px solid #b2bfd0; border-radius: 6px; background: white; color: var(--ink); font-weight: 450;
}
select { padding-right: 23px; }
.muted { color: var(--muted); }
.wallet-table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; }
.wallet-table th, .wallet-table td { padding: 13px 14px; vertical-align: top; overflow-wrap: anywhere; }
.wallet-table thead th, .table-head { background: var(--tint); color: var(--muted); font-size: 12px; font-weight: 680; }
.wallet-table thead th:first-child { border-radius: 9px 0 0; width: 14.5%; }
.wallet-table thead th:nth-child(2) { width: 30%; }
.wallet-table thead th:nth-child(3) { width: 29%; }
.wallet-table thead th:last-child { border-radius: 0 9px 0 0; }
.wallet-group { position: relative; border-top: 1px solid var(--line); }
.wallet-table .wallet-expansion td { padding: 0; }
.wallet-edit { background: #fbfcff; padding: 12px 14px; border-top: 1px solid var(--line); }
.wallet-name { display: block; font-weight: 700; }
.wallet-table small { display: block; margin-top: 2px; font-weight: 450; }
.cell-label { display: none; }
.address-line { display: flex; flex-wrap: wrap; align-items: center; column-gap: 7px; row-gap: 3px; min-width: 0; }
.address-link { display: inline-flex; align-items: baseline; gap: 3px; max-width: 100%; }
.address-link svg { align-self: center; }
.qr-btn { min-height: 27px; padding: 3px 7px; font-size: 11px; }
.qr-pop {
  width: min(310px, calc(100vw - 36px)); padding: 16px; color: var(--ink); background: white;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 50px #19273f33;
}
.qr-pop::backdrop { background: #19273f44; }
.qr-pop h3 { font-size: 15px; }
.qr-square { width: 100%; aspect-ratio: 1; background: #e3e6ed; margin: 10px 0; border-radius: 5px; }
.qr-pop code { display: block; margin: 0 0 12px; }
.add-wallet { position: relative; flex: none; }
.add-wallet > summary { display: flex; }
.add-form {
  position: absolute; z-index: 1; right: 0; top: calc(100% + 6px); width: min(330px, calc(100vw - 32px));
  background: white; border: 1px solid var(--line); box-shadow: 0 8px 18px #17244020; border-radius: 8px; padding: 13px;
}
.add-form button, .inline-form button { margin-top: 10px; }
.wallet-manage { margin-top: 5px; }
.wallet-manage > summary, .minor-details > summary, .setting-details > summary, .nonce > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; font-weight: 640;
}
.wallet-manage > summary, .minor-details > summary, .setting-details > summary { color: var(--accent); }
.minor-details { border-top: 1px solid var(--line); }
.inline-form { padding: 8px 10px 12px; background: var(--tint); border-radius: 6px; font-size: 13px; }
.inline-form p { margin: 5px 0 8px; }
.inline-form label + label { margin-top: 9px; }
.warning { color: var(--amber); }
.disable { margin-top: 6px; }
.subnav { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin: -2px 0 17px; }
.subnav a { margin-bottom: -1px; }
.table-head, .payment-row > summary {
  display: grid; grid-template-columns: 1.05fr 1.12fr 2.65fr 1.31fr 1.2fr 18px; align-items: center; gap: 12px; padding-inline: 15px;
}
.table-head { border-radius: 9px 9px 0 0; padding-block: 9px; }
.payment-row { border-top: 1px solid var(--line); }
.payment-row > summary { min-height: 53px; padding-block: 5px; }
.payment-row > summary:hover, .payment-row[open] > summary { background: #f3fbfa; }
.row-amt { font-weight: 730; font-variant-numeric: tabular-nums; }
.row-route { min-width: 0; overflow-wrap: anywhere; }
.row-route svg { margin-inline: 2px; color: var(--muted); }
.row-status > small { display: block; margin: 1px 0 0; }
.row-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 15px; border-top: 1px solid var(--line); }
.row-detail h3, .setting-row h3 { font-size: 15px; letter-spacing: -.012em; font-weight: 700; }
.detail-facts > div { margin-top: 6px; }
.row-detail .btn { margin-top: 12px; }
.timeline { margin: 7px 0 0; padding: 0; list-style: none; }
.timeline li { display: flex; align-items: start; justify-content: space-between; gap: 6px 10px; padding: 0 0 8px 12px; border-left: 2px solid #c4e6e0; }
.timeline li + li { padding-top: 6px; }
.timeline-content { min-width: 0; }
.timeline time, .security-log time { color: var(--muted); font-size: 12px; }
.timeline time { white-space: nowrap; }
.transaction { display: block; margin-top: 3px; }
.transaction code { display: block; }
.security-log { margin: 0; padding: 0; list-style: none; }
.security-log li { display: grid; grid-template-columns: 175px minmax(0, 1fr); gap: 4px 12px; padding: 10px 15px; }
.security-log li + li { border-top: 1px solid var(--line); }
.setting-row { display: grid; grid-template-columns: minmax(195px, .65fr) minmax(0, 1.35fr); gap: 22px; padding: 17px 20px; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-title p, .setting-body > p { margin-top: 4px; color: var(--muted); }
.setting-body > p + p { margin-top: 7px; }
.setting-body > p + form, .setting-body > label + button { margin-top: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid + .help { margin-top: 7px; }
.rule-field small { display: block; margin-top: 3px; }
.cold-entry { display: flex; align-items: end; gap: 7px; }
.cold-entry label { flex: 1; min-width: 0; }
.cold-entry input { font-family: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: 12px; }
.cold-entry .qr-btn { min-height: 40px; }

.password-rule { margin-bottom: 8px; }
.setting-details > summary { justify-content: flex-start; }
.nonce { margin-top: 7px; border-top: 1px solid var(--line); }
.nonce > summary small { display: block; font-weight: 450; }
.lock-row { background: #fffafb; }
@media (min-width: 631px) {
  .wallet-manage { margin: 0; }
  .wallet-manage > summary { position: absolute; right: 14px; top: 9px; min-height: 29px; }
  .wallet-edit { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) auto; gap: 14px; align-items: start; }
  .wallet-edit .minor-details { border-top: 0; }
  .wallet-edit .minor-details > summary { justify-content: flex-start; }
  .wallet-edit .disable { margin-top: 0; }
}
@media (max-width: 950px) and (min-width: 631px) {
  .wallet-manage > summary { position: static; margin-inline-start: 73.5%; padding-inline: 10px; }
}
@media (max-width: 850px) {
  .frame { width: calc(100% - 32px); }
  .wallet-table code { font-size: 11.5px; }
  .wallet-table th, .wallet-table td { padding-inline: 10px; }
  .timeline li { flex-wrap: wrap; }
}
@media (max-width: 630px) {
  .brand-row { min-height: 54px; }
  .brand h1 { font-size: 17px; }
  .mark { width: 30px; height: 30px; }
  .state { gap: 7px; font-size: 11px; }
  .tabs { justify-content: space-between; gap: 0; }
  .tabs a { padding-inline: 7px; font-size: 13px; }
  .tabs a:first-child { padding-left: 0; }
  .tabs a:last-child { padding-right: 0; }
  main { padding-block: 17px 25px; }
  .page-head { flex-wrap: wrap; margin-bottom: 13px; gap: 8px; }
  .page-head h2 { font-size: 25px; }
  .overview-status { width: 100%; gap: 5px; font-size: 11px; }
  .overview-status span { padding: 3px 6px; }
  .approval-head { min-height: 46px; padding: 8px 12px; }
  .approval-head h3 { font-size: 16px; }
  .approval-layout { display: block; }
  .transfer { padding: 14px 12px 11px; }
  .transfer h4 { font-size: 37px; }
  .transfer h4 span { font-size: 21px; }
  .transfer-route { margin-top: 10px; }
  .transfer-route > div { padding: 7px 8px; }
  .transfer-route dt { gap: 4px 5px; }
  .transfer-route dd { margin-top: 0; }
  .transfer-route code { font-size: 12px; }
  .program-note { padding: 7px 8px; margin-top: 9px; }
  .decision { border-left: 0; border-top: 1px solid var(--line); padding: 10px 12px 12px; }
  .request-data dd { margin-top: 0; }
  .decision-actions { margin-top: 10px; gap: 8px; }
  .request-id { margin-top: 8px; gap: 0; }
  .empty-body { padding: 21px 12px; }
  .section-title { margin-top: 16px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 10px; }
  .metric h4 { min-height: 21px; }
  button, .btn, .add-wallet > summary, input:not([type=hidden]), select,
  .wallet-manage > summary, .minor-details > summary, .setting-details > summary, .nonce > summary { min-height: 44px; }
  .wallet-panel { border: 0; background: none; box-shadow: none; }
  .wallet-table, .wallet-table tbody, .wallet-table th, .wallet-table td { display: block; width: 100%; }
  .wallet-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .wallet-group { background: white; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; }
  .wallet-group:last-child { margin-bottom: 0; }
  .wallet-table tbody tr { display: block; }
  .wallet-table .wallet-expansion td { padding: 0 12px 5px; }
  .wallet-edit { padding: 0 0 7px; border: 0; background: white; }
  .wallet-table tbody .wallet-controls { padding-bottom: 0; }
  .wallet-table tbody th, .wallet-table td { position: relative; padding: 10px 12px; }
  .wallet-table tbody th { background: var(--tint); border-radius: 8px 8px 0 0; }
  .wallet-table td + td { border-top: 1px solid var(--line); }
  .wallet-table td:last-child:has(.feeder-status) { display: none; }
  .wallet-table .cell-label { display: block; color: var(--muted); font-size: 12px; font-weight: 630; padding-block: 6px; }
  .wallet-table code { font-size: 11.5px; }
  .address-link { min-height: 44px; align-items: center; }
  .address-line { display: block; }
  .wallet-table .qr-btn { position: absolute; top: 3px; right: 12px; min-width: 44px; min-height: 44px; }
  .cold-entry { position: relative; display: block; }
  .cold-entry label { padding-top: 7px; }
  .cold-entry input { margin-top: 13px; }
  .cold-entry .qr-btn { position: absolute; right: 0; top: -5px; min-width: 44px; min-height: 44px; }
  .wallet-manage { margin-top: 0; }
  .table-head { display: none; }
  .payment-row:first-of-type { border-top: 0; }
  .payment-row > summary {
    grid-template-columns: 1fr auto 14px; grid-template-areas: "amount status caret" "kind status caret" "route date date";
    gap: 2px 7px; padding: 9px 10px; min-height: 68px;
  }
  .payment-row > summary > svg { grid-area: caret; }
  .row-amt { grid-area: amount; }
  .row-kind { grid-area: kind; font-size: 12px; color: var(--muted); }
  .row-route { grid-area: route; font-size: 12px; }
  .row-status { grid-area: status; justify-self: end; }
  .row-status > small { text-align: right; }
  .row-date { grid-area: date; text-align: right; }
  .row-detail { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px; }
  .timeline li { display: grid; }
  .transaction { min-height: 44px; }
  .security-log li { grid-template-columns: minmax(0, 1fr); padding: 8px 10px; }
  .setting-row { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 12px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

/* ---- frame.css: shared rules the mockup's stylesheet (base.css) does not have: the flash line
   and once-only token, addresses, the QR pop-ups of qr.rs, the password dialog, and the pages
   outside the logged-in frame. Owned by the foundation (src/page.rs). */

/* iOS zooms into a field whose text is under 16 px. */
input:not([type=hidden]), select, textarea { font-size: 16px; }

/* Addresses are printed whole and may wrap anywhere (never clipped or shortened). */
.addr, code { font-family: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace; overflow-wrap: anywhere; word-break: break-all; }
.coin { font-weight: 700; }
.note { color: var(--muted); }
.untrusted { white-space: pre-wrap; overflow-wrap: anywhere; }

/* An address being typed: two rows, wrapping, so all of it stays readable. */
textarea.addr-input {
  display: block; width: 100%; min-width: 0; margin-top: 5px; padding: 8px 10px; resize: vertical;
  border: 1px solid #b2bfd0; border-radius: 6px; background: white; color: var(--ink);
  font-family: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace; line-height: 1.4; word-break: break-all;
}

/* The flash line and the once-only token, above the page. */
.msg { margin: 0 0 16px; padding: 10px 14px; border: 1px solid #bfe3cc; border-radius: 8px; background: #e9f8ef; color: var(--green); font-weight: 620; overflow-wrap: anywhere; }
.msg.err { border-color: #e3c1c7; background: #fff4f5; color: var(--red); }
.once { margin: 0 0 16px; padding: 10px 14px; border: 2px solid var(--green); border-radius: 8px; background: white; }
.once p + p { margin-top: 6px; }

/* Today's content inside the new frame, until each page is redrawn. */
main.frame h3 { margin: 22px 0 8px; font-size: 17px; }
main.frame form { margin: 10px 0; }
main.frame label { margin-top: 10px; }
main.frame button { margin-top: 8px; }
.card { margin: 12px 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.big { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.card dt { margin-top: 8px; font-weight: 650; color: var(--muted); }
ul.log { margin: 0; padding: 0 0 0 18px; }
ul.log li { margin: 4px 0; overflow-wrap: anywhere; }
.go { color: white; background: var(--accent); border-color: var(--accent); }
.stop { color: white; background: var(--red); border-color: var(--red); }
.pill.bad { background: #fff4f5; color: var(--red); border-color: #e3c1c7; }

/* QR pop-ups (qr.rs: button.qrb opens span.qr). The browser's own popover placement: centered; the code at least 260 px wide on a 320 px screen (12 px padding), as before the redesign. */
button.qrb { min-height: 27px; margin: 0 0 0 8px; padding: 3px 9px; font-size: 12px; vertical-align: middle; }
.qr { width: min(310px, calc(100vw - 30px)); padding: 12px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 50px #19273f33; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; word-break: normal; }
.qr::backdrop { background: #19273f44; }
.qr svg { display: block; width: 100%; height: auto; }
.qr span { display: block; margin-top: 8px; }

/* The password dialog (page::password_dialog): a box inside the form, shown by its link
   a.pw-open (href="#id") through :target, in the flow right under that link: it covers nothing
   and needs no room below and no z-order. The fragment navigation scrolls it to
   scroll-margin-top below the window's top, which leaves the form's text above it in view (and
   on a short window, the box's submit too). Only actions with nothing typed have a box. Tinted and barred so it reads as the password step,
   not as more of the form's fields. */
.pw { display: inline-block; vertical-align: top; max-width: 100%; }
.pwpop { display: none; }
.pwpop:target {
  display: block; margin-top: 8px; text-align: left;
  width: min(340px, calc(100vw - 40px)); max-width: 100%; padding: 12px 14px; scroll-margin-top: 200px;
  color: var(--ink); background: #effaf8; border: 1px solid #b9e2db; border-left: 4px solid var(--accent); border-radius: 8px;
}
@media (max-height: 600px) { .pwpop:target { scroll-margin-top: 110px; } }
.pwpop > p { margin: 0 0 4px; overflow-wrap: anywhere; }
.pwpop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pwpop-actions button, .pwpop-actions .btn { margin: 0; }
/* While its box is open, the opener takes the plain look, so the box's submit is the one primary
   button of that name. An engine without :has() keeps the opener's own look; nothing else changes. */
.pw:has(> .pwpop:target) > .pw-open, .pw:has(> .pwpop:target) > .pw-open:hover {
  color: var(--muted); background: var(--surface); border-color: #cdd6e2;
}

/* Log in, unlock, setup, the paper check, the page after setup: one plain centered column. */
main.plain { width: min(44rem, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 40px; font-size: 16px; }
.plain h1 { font-size: 24px; font-weight: 740; letter-spacing: -.03em; margin: 8px 0 14px; }
.plain h2 { font-size: 18px; font-weight: 710; margin: 28px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.plain p { margin: 8px 0; }
.plain label { margin-top: 12px; }
.plain label:has(> input[type=radio]) { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.plain input[type=radio] { width: auto; min-height: 0; margin: 0; }
.plain textarea { display: block; width: 100%; min-height: 5.5em; margin-top: 5px; padding: 8px 10px; border: 1px solid #b2bfd0; border-radius: 6px; font-family: inherit; }
.plain button { margin: 14px 8px 4px 0; min-height: 44px; padding: 8px 18px; }
.plain .note { font-size: 14px; }
.plain .addr { font-size: 14px; }
.plain code.pw { word-break: normal; overflow-wrap: normal; font-size: 15px; }
.plain ol.words { padding-left: 2.2em; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px; }

/* The mode dropdowns (page::limit_field) must show their longest option, "manual: each one needs
   your sign-off", whole on a 390 px phone at 16 px (smaller select text makes iOS zoom on focus).
   The engines' own arrow takes ~35 px beside the padding, so the arrow is drawn here instead
   (two gradient triangles, no image file), and the Rules rows give the field more width. */
select {
  appearance: none; padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
@media (max-width: 630px) {
  select { padding-left: 6px; padding-right: 22px; background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%; }
  .page-rules .setting-row { padding-left: 8px; padding-right: 8px; }
}

/* ---- the breeder's own rules ---- */
.brand .word { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 5px; color: white; background: var(--accent); font-size: 12px; letter-spacing: .12em; font-weight: 760; vertical-align: middle; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 4px #17244006; padding: 16px 18px; margin-bottom: 16px; }
.panel h3 { font-size: 17px; font-weight: 710; letter-spacing: -.018em; margin: 0 0 8px; }
.panel form { margin: 10px 0 0; }
.panel p + p { margin-top: 6px; }
.steps { margin: 8px 0 0; padding: 0; list-style: none; font-family: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: 12px; }
.steps li { padding: 4px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.steps time { color: var(--muted); margin-right: 8px; }
.stopline { margin-top: 10px; padding: 10px 12px; border: 1px solid #e3c1c7; border-radius: 6px; background: #fff4f5; color: var(--red); overflow-wrap: anywhere; }
.slot { margin-top: 10px; padding: 9px 12px; background: #fff9ed; border: 1px solid #f2e6ca; border-radius: 6px; color: #674913; font-size: 12px; }
.grid-table { width: 100%; border-collapse: collapse; text-align: left; }
.grid-table th, .grid-table td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.grid-table thead th { background: var(--tint); color: var(--muted); font-size: 12px; font-weight: 680; border-top: 0; overflow-wrap: normal; }
.grid-table td small { display: block; margin-top: 2px; }
.grid-table td .pill + small { margin-top: 4px; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.counts span { padding: 4px 8px; border-radius: 5px; background: var(--tint); font-size: 12px; }
.counts b { margin-right: 4px; }
.row-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.row-form button { margin-top: 0; min-height: 40px; }
@media (max-width: 630px) {
  .grid-table thead { display: none; }
  .grid-table, .grid-table tbody, .grid-table tr, .grid-table td { display: block; width: 100%; }
  .grid-table tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: white; }
  .grid-table td { border-top: 0; padding: 5px 10px; }
  .grid-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; font-weight: 630; }
}
