/* Printer's account surfaces read like a clear paper ledger. */
.printer-frame #main:has(#portfolio-workspace:not([hidden])),
.printer-frame #main:has(#wallet-workspace:not([hidden])) {
  background: #fffcf5;
  color: #222c35;
  color-scheme: light;
}

.printer-frame #main .portfolio-workspace,
.printer-frame #main .wallet-workspace {
  --pf-bg: #fffcf5;
  --pf-panel: #fffefa;
  --pf-panel-raised: #f1eadc;
  --pf-rule: #e2dacb;
  --pf-ink: #222c35;
  --pf-muted: #66717b;
  --pf-soft: #7b858f;
  --pf-cobalt: #3c4fed;
  --pf-alert: #984b39;
  --ps-paper: #fffcf5;
  --ps-paper-high: #fffefa;
  --ps-ink: #222c35;
  --ps-muted: #66717b;
  --ps-rule: #e2dacb;
  --ps-cobalt: #3c4fed;
  --ps-accent: #3c4fed;
  color: #222c35;
  color-scheme: light;
  font-variant-numeric: tabular-nums;
}

.printer-frame #main .portfolio-workspace {
  gap: 20px;
  padding: 26px clamp(14px, 2.4vw, 38px) 20px;
  background: #fffcf5;
}

.portfolio-topline {
  align-items: end;
  padding: 0 0 21px;
  border-bottom: 1px solid #ddd4c6;
}

.portfolio-title > div {
  gap: 5px;
  color: #66717b;
  font-size: 12px;
  font-weight: 600;
}

.portfolio-title img {
  width: 24px;
  height: 24px;
  margin-right: 4px;
}

.portfolio-title b { color: #a69a8b; }

.portfolio-title h1 {
  margin-top: 9px;
  color: #222c35;
  font-size: clamp(31px, 2.8vw, 42px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -.052em;
}

.portfolio-title p {
  margin-top: 9px;
  color: #66717b;
  font-size: 12px;
  line-height: 1.4;
}

.portfolio-controls { gap: 8px; }
.portfolio-wallet {
  gap: 4px;
  margin-right: 7px;
  padding-right: 15px;
  border-right-color: #ddd4c6;
}
.portfolio-wallet span { font-size: 11px; }
.portfolio-wallet strong { color: #222c35; font-size: 12px; }

.printer-frame #main .portfolio-controls button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #c6bcad;
  border-radius: 3px;
  background: transparent;
  color: #222c35;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.printer-frame #main .portfolio-controls button:hover { background: #eae2d5; }
.printer-frame #main .portfolio-controls button:disabled {
  opacity: .48;
  cursor: default;
}
.printer-frame #main .portfolio-controls button[data-open-wallets] {
  border-color: #222c35;
  background: #222c35;
  color: #fffcf5;
}
.printer-frame #main .portfolio-controls button[data-open-wallets]:hover { background: #3a4651; }

.portfolio-summary {
  grid-template-columns: minmax(150px, 1.15fr) minmax(135px, .75fr) minmax(145px, .85fr) minmax(210px, 1.3fr);
  min-height: 111px;
  border: 1px solid #e2dacb;
  border-top: 3px solid #d4b494;
  border-radius: 3px;
  background: #fffefa;
}
.portfolio-summary > div { padding: 19px 21px; }
.portfolio-summary > div + div { border-left-color: #eae3d8; }
.portfolio-summary span,
.portfolio-amount small,
.portfolio-market small {
  color: #66717b;
  font-size: 11px;
}
.portfolio-summary strong {
  margin-top: 7px;
  color: #222c35;
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -.045em;
}
.portfolio-summary > div:first-child strong { font-size: clamp(24px, 2.4vw, 32px); }
.portfolio-summary small { color: #7b858f; font-size: 11px; }
.portfolio-summary .portfolio-summary-note { gap: 13px; background: #f6f0e5; }
.portfolio-summary-note img { width: 27px; height: 27px; flex-basis: 27px; }
.portfolio-summary-note span {
  max-width: 330px;
  color: #4e4941;
  font-size: 11px;
  line-height: 1.5;
}

.portfolio-panels {
  grid-template-columns: minmax(0, 1fr) minmax(310px, .37fr);
  gap: 15px;
}
.portfolio-positions,
.portfolio-activity {
  border: 1px solid #e2dacb;
  border-radius: 3px;
  background: #fffefa;
}
.portfolio-panel-header {
  min-height: 77px;
  padding: 17px 20px;
  border-bottom-color: #dcd4c8;
}
.portfolio-panel-header h2 {
  color: #222c35;
  font-size: 18px;
  font-weight: 680;
}
.portfolio-panel-header h2 span { color: #7b858f; font-size: 12px; }
.portfolio-panel-header p { margin-top: 5px; color: #66717b; font-size: 11px; }
.portfolio-tools { gap: 8px; }
.portfolio-tools input,
.portfolio-tools select {
  min-height: 36px;
  border: 1px solid #c9beaf;
  border-radius: 3px;
  background: #fffefa;
  color: #222c35;
  font-size: 12px;
}
.portfolio-tools input { width: 175px; padding: 0 11px; }
.portfolio-tools input::placeholder { color: #7b858f; }
.portfolio-tools select { max-width: 160px; padding: 0 8px; }
.portfolio-position-list,
.portfolio-activity-body { scrollbar-color: #b7ac9b transparent; }

.portfolio-position {
  min-height: 91px;
  padding: 14px 17px;
  border-bottom-color: #e4ddd1;
}
.portfolio-position:hover,
.portfolio-position:focus-within { background: #f8f5ee; }
.portfolio-position.hidden { border-left-color: #984b39; }
.portfolio-asset { gap: 11px; }
.portfolio-asset-mark {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-color: #e0d8cb;
  border-radius: 3px;
  background: #f3ede3;
  color: #433d35;
  font-size: 12px;
}
.portfolio-asset-mark.printer { border-color: #d4b494; background: #fffcf5; }
.portfolio-asset strong { color: #222c35; font-size: 13px; font-weight: 680; }
.portfolio-asset > div > span { margin-top: 3px; color: #66717b; font-size: 11px; }
.portfolio-mint { margin-top: 6px; }
.portfolio-mint code { color: #7b858f; font-size: 10px; }
.portfolio-mint button { color: #3c4fed; font-size: 10px; }
.portfolio-amount,
.portfolio-market { gap: 6px; }
.portfolio-amount strong,
.portfolio-market strong {
  color: #222c35;
  font-size: 12px;
  font-weight: 660;
}
.portfolio-signal { color: #2e394b; font-size: 11px; }
.portfolio-signal.hidden { color: #984b39; }
.portfolio-signal.unknown { color: #6d675e; }
.portfolio-verdict small { color: #7b858f; font-size: 10px; }
.printer-frame #main .portfolio-inspect,
.printer-frame #main .portfolio-empty button {
  min-height: 34px;
  border: 1px solid #222c35;
  border-radius: 3px;
  background: #222c35;
  color: #fffcf5 !important;
  font-size: 11px;
  font-weight: 660;
}
.printer-frame #main .portfolio-inspect:hover,
.printer-frame #main .portfolio-empty button:hover { background: #3a4651; }
.portfolio-panel-foot {
  min-height: 42px;
  padding: 10px 17px;
  border-top-color: #eae3d8;
  color: #716b62;
  font-size: 10px;
}
.portfolio-empty { padding: 30px; }
.portfolio-empty strong { color: #222c35; font-size: 16px; }
.portfolio-empty p { color: #625d55; font-size: 12px; }
.portfolio-activity-item { padding: 16px 18px; border-bottom-color: #e4ddd1; }
.portfolio-activity-outcome { color: #313d4a; font-size: 11px; }
.portfolio-activity-outcome.failed { color: #984b39; }
.portfolio-activity-top time,
.portfolio-activity-foot,
.portfolio-activity-unknown { color: #66717b; font-size: 11px; }
.portfolio-activity-changes {
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid #eae3d8;
  border-radius: 3px;
  background: #f8f4eb;
}
.portfolio-activity-change span { color: #66717b; font-size: 11px; }
.portfolio-activity-change strong { color: #222c35; font-size: 11px; }
.portfolio-activity-foot { margin-top: 11px; }
.portfolio-activity-foot a { color: #3c4fed; }
.portfolio-disclosure { padding-top: 0; color: #66717b; font-size: 11px; }

.printer-frame #main .wallet-workspace {
  margin: 0;
  padding: 27px clamp(14px, 2.4vw, 38px) 20px;
  border: 0;
  border-radius: 0;
  background: #fffcf5;
}
.printer-frame #main .wallet-heading,
.printer-frame #main .wallet-status,
.printer-frame #main .wallet-grid,
.printer-frame #main .wallet-provenance { max-width: 1160px; }
.printer-frame #main .wallet-heading {
  max-width: 1160px;
  margin-bottom: 18px;
  padding-bottom: 21px;
  border-bottom: 1px solid #ddd4c6;
}
.wallet-heading .context { margin-bottom: 10px; color: #66717b; font-size: 12px; font-weight: 600; }
.printer-frame #main .wallet-heading h1 {
  margin-bottom: 8px;
  color: #222c35;
  font-size: clamp(31px, 2.8vw, 42px);
  font-weight: 700;
}
.wallet-heading p { color: #66717b; font-size: 12px; }
.wallet-status { max-width: 1160px; color: #66717b; font-size: 12px; }
.wallet-grid { max-width: 1160px; gap: 15px; }
.wallet-panel {
  border: 1px solid #e2dacb;
  border-top: 3px solid #d4b494;
  border-radius: 3px;
  background: #fffefa;
  box-shadow: none;
}
.wallet-panel-head { padding: 17px 20px; border-bottom-color: #eae3d8; }
.wallet-panel-head span { display: none; }
.wallet-panel-head h2 { margin: 0; color: #222c35; font-size: 19px; font-weight: 680; }
.wallet-panel-content { padding: 20px; color: #66717b; font-size: 12px; }
.wallet-workspace .wallet-access-rule {
  margin-bottom: 15px;
  padding-left: 12px;
  border-left: 3px solid #d4b494;
  color: #222c35;
  font-size: 13px;
  line-height: 1.4;
}
.wallet-empty p,
.wallet-read-prompt { color: #66717b; font-size: 12px; }
.wallet-row { border-bottom-color: #e3dbce; font-size: 12px; }
.wallet-row > div:first-child strong { color: #222c35; font-size: 13px; }
.wallet-row > div:first-child span { color: #66717b; font-size: 11px; }
.wallet-row > div:first-child small { color: #7b858f; font-size: 10px; }
.wallet-row button,
.wallet-row a,
.wallet-token-list a,
.wallet-address-line a,
.wallet-activity-list a { color: #3c4fed; }
.tracked-wallet-form { padding: 20px; border-bottom-color: #e3dbce; }
.tracked-wallet-form label { color: #4e4942; font-size: 12px; }
.tracked-wallet-form input {
  min-height: 39px;
  border-color: #c9beaf;
  border-radius: 3px;
  background: #fffefa;
  color: #222c35;
  font-size: 12px;
}
.tracked-wallet-form input::placeholder { color: #7b858f; }
.printer-frame #main .tracked-wallet-form button,
.printer-frame #main .wallet-connect {
  min-height: 39px;
  border: 1px solid #222c35;
  border-radius: 3px;
  background: #222c35;
  color: #fffcf5;
  font-size: 12px;
}
.printer-frame #main .tracked-wallet-form button:hover,
.printer-frame #main .wallet-connect:hover { background: #3a4651; }
.printer-frame #main .tracked-wallet-form button:disabled {
  border-color: #e2dacb;
  background: #e7e0d4;
  color: #7b858f;
}
.printer-frame #main .wallet-actions button,
.printer-frame #main .wallet-choices button {
  min-height: 36px;
  border: 1px solid #bdb2a3;
  border-radius: 3px;
  background: transparent;
  color: #222c35;
  font-size: 11px;
}
.printer-frame #main .wallet-actions button:hover,
.printer-frame #main .wallet-choices button:hover { background: #eee6d8; }
.wallet-address-line { border-bottom-color: #e3dbce; }
.wallet-address-line > span { color: #66717b; font-size: 11px; }
.wallet-address-line strong { color: #222c35; font-size: 18px; }
.wallet-balance > div {
  padding: 14px;
  border: 1px solid #ded5c8;
  border-radius: 3px;
  background: #f8f4eb;
}
.wallet-balance span { color: #66717b; font-size: 11px; }
.wallet-balance strong { color: #222c35; font-size: 17px; }
.wallet-token-list li { border-bottom-color: #e3dbce; font-size: 12px; }
.wallet-token-list strong,
.wallet-activity-list span { color: #222c35; }
.wallet-observed,
.wallet-provenance { color: #66717b; font-size: 11px; }
.wallet-provenance { max-width: 1160px; border-top-color: #ddd4c6; }
.wallet-workspace:has(#tracked-wallet-address:disabled) .wallet-status {
  border-left-color: #d4b494;
  background: #efe5d4;
  color: #443a2f;
}
.wallet-workspace:has(#tracked-wallet-address:disabled) .wallet-panel:first-child { border-top-color: #d4b494; }
.wallet-row-actions button { border-color: #c9beaf; border-radius: 3px; background: transparent; }
.wallet-movement,
.wallet-activity-changes { border-color: #ded5c8; background: #f8f4eb; }
.wallet-activity,
.wallet-row-result { border-top-color: #e3dbce; }
.wallet-activity-list li { border-top-color: #e3dbce; }

.portfolio-workspace :is(button, input, select, a):focus-visible,
.wallet-workspace :is(button, input, select, a):focus-visible {
  outline: 2px solid #3c4fed;
  outline-offset: 2px;
}

@media (max-width: 1350px) {
  .portfolio-panels { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 850px) {
  .wallet-grid { grid-template-columns: minmax(0, 1fr); }
  .wallet-panel { min-height: 0; }
}

@media (max-width: 760px) {
  .printer-frame #main .portfolio-workspace,
  .printer-frame #main .wallet-workspace { padding: 21px 13px 18px; }
  .portfolio-topline { align-items: start; gap: 16px; padding-bottom: 18px; }
  .portfolio-title h1,
  .printer-frame #main .wallet-heading h1 { font-size: 34px; }
  .portfolio-controls { width: 100%; justify-content: start; }
  .portfolio-wallet { min-width: 0; margin-right: auto; }
  .portfolio-wallet strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .portfolio-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portfolio-summary > div:first-child { grid-column: 1 / -1; }
  .portfolio-summary > div:nth-child(2) { border-left: 0; border-top: 1px solid #eae3d8; }
  .portfolio-summary > div:nth-child(3) { border-top: 1px solid #eae3d8; }
  .portfolio-summary .portfolio-summary-note { grid-column: 1 / -1; border-left: 0; border-top: 1px solid #eae3d8; }
  .portfolio-summary > div { padding: 15px 17px; }
  .portfolio-panel-header { padding: 16px; }
  .portfolio-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(112px, 140px); width: 100%; }
  .portfolio-tools input,
  .portfolio-tools select,
  .portfolio-search-wrap,
  .portfolio-sort-wrap { width: 100%; max-width: none; min-width: 0; }
  .portfolio-position {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "asset asset" "amount price" "cap verdict" "action action";
    gap: 14px 12px;
    padding: 16px;
  }
  .portfolio-position > :nth-child(1) { grid-area: asset; }
  .portfolio-position > :nth-child(2) { grid-area: amount; }
  .portfolio-position > :nth-child(3) { grid-area: price; }
  .portfolio-position > :nth-child(4) { grid-area: cap; }
  .portfolio-position > :nth-child(5) { grid-area: verdict; }
  .portfolio-position > :nth-child(6) { grid-area: action; }
  .printer-frame #main .portfolio-inspect { width: 100%; justify-self: stretch; }
  .wallet-heading { padding-bottom: 18px; }
}

@media (max-width: 420px) {
  .portfolio-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; }
  .portfolio-wallet { min-width: 0; padding-right: 10px; margin-right: 0; }
  .printer-frame #main .portfolio-controls button { padding: 0 9px; }
  .portfolio-summary strong { font-size: 21px; }
  .portfolio-summary > div:first-child strong { font-size: 27px; }
  .portfolio-summary-note span { font-size: 11px; }
  .portfolio-panels { gap: 12px; }
  .portfolio-panel-header { gap: 12px; }
  .portfolio-position { gap: 13px 8px; }
  .portfolio-asset-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .wallet-panel-head,
  .wallet-panel-content,
  .tracked-wallet-form { padding: 16px; }
  .tracked-wallet-form > div { flex-direction: column; }
  .tracked-wallet-form button { width: 100%; }
  .wallet-balance { grid-template-columns: minmax(0, 1fr); }
  .wallet-row-actions { flex-wrap: wrap; }
}

@media (max-width: 360px) {
  .portfolio-tools { grid-template-columns: minmax(0, 1fr); }
}
