/* Wise × Wolf presentation layer.
   This file intentionally contains no application logic or data rules. */

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7f3;
  --bg2: #ffffff;
  --bg3: #edf1eb;
  --raise: #e4ebe0;
  --line: #d8ded5;
  --line2: #b9c4b5;
  --text: #11200d;
  --dim: #465243;
  --faint: #596555;
  --gold: #80510f;
  --gold-soft: #fff1d8;
  --green: #28631c;
  --green-soft: #e4f5dc;
  --red: #bf303b;
  --red-soft: #ffe6e8;
  --blue: #245f78;
  --blue-soft: #e1f1f6;
  --accent-fill: #9fe870;
  --accent-ink: #163300;
  --note-bg: #f1f4ef;
  --note-text: #263224;
  --note-label: #566253;
  --status-reset-bg: #fff0d4;
  --status-reset-text: #744a0d;
  --status-lock-bg: #ffe6e8;
  --status-lock-text: #982432;
  --status-ok-bg: #e4f5dc;
  --status-ok-text: #245c1b;
  --shadow: 0 22px 55px -42px rgba(35, 58, 29, .36);
  --soft-shadow: 0 12px 30px -26px rgba(35, 58, 29, .28);
  --r: 26px;
  --ws-panel: var(--bg2);
  --ws-warm-panel: var(--gold-soft);
  --ws-heading: Inter, system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11150f;
  --bg2: #1a2017;
  --bg3: #232b20;
  --raise: #2c3628;
  --line: #354132;
  --line2: #61705d;
  --text: #f7fbf4;
  --dim: #c5d0c1;
  --faint: #a7b4a2;
  --gold: #efc779;
  --gold-soft: #392e1b;
  --green: #a7eb7a;
  --green-soft: #263d20;
  --red: #ff9ea6;
  --red-soft: #46252a;
  --blue: #9fd1e2;
  --blue-soft: #243940;
  --accent-fill: #9fe870;
  --accent-ink: #163300;
  --note-bg: #232b20;
  --note-text: #f7fbf4;
  --note-label: #c5d0c1;
  --status-reset-bg: #392e1b;
  --status-reset-text: #ffd99a;
  --status-lock-bg: #46252a;
  --status-lock-text: #ffbbc0;
  --status-ok-bg: #263d20;
  --status-ok-text: #c6f4a7;
  --shadow: 0 25px 65px -42px rgba(0, 0, 0, .92);
  --soft-shadow: 0 14px 34px -25px rgba(0, 0, 0, .78);
  --ws-panel: var(--bg2);
}

html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body {
  min-width: 320px;
  background:
    radial-gradient(circle at 88% 5%, color-mix(in srgb, var(--green-soft) 72%, transparent), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

button, input, textarea, select { font-family: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-fill) 65%, transparent);
  outline-offset: 2px;
}

/* Navigation: a quiet Wise-like rail with one warm Wall Street signature. */
.top {
  background: color-mix(in srgb, var(--bg2) 94%, transparent);
  border-color: var(--line);
  box-shadow: none;
}
.top-inner { max-width: 1560px; }
.brand { gap: 12px; }
.mark {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  color: #291b08;
  background: linear-gradient(145deg, #ffd17d, #eaa447);
  box-shadow: 0 12px 24px -17px rgba(154, 103, 30, .75);
}
.mark svg { width: 28px; height: 28px; }
.brand h1 {
  color: var(--text);
  font: 800 17px/1.15 var(--ws-heading);
  letter-spacing: -.045em;
}
.brand span {
  color: var(--gold);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .16em;
}
.nav {
  gap: 5px;
  padding: 5px;
  background: transparent;
  border: 0;
  border-radius: 22px;
  box-shadow: none;
}
.nav button {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--dim);
  font-size: 14px;
  font-weight: 650;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav button:hover:not(.on) { color: var(--text); background: var(--bg3); }
.nav button.on {
  color: var(--status-ok-text);
  background: var(--green-soft);
  box-shadow: none;
}
.nav-icon { width: 19px; height: 19px; stroke-width: 1.8; }
.user-tools { gap: 8px; }
.user-email, .signout { color: var(--dim); font-size: 13px; }
.signout { border-radius: 999px; padding: 9px 12px; }
.signout:hover { color: var(--red); background: var(--red-soft); }
.themebtn, .iconbtn, .xbtn, .capital-edit {
  color: var(--dim);
  background: var(--bg3);
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;
}
.themebtn:hover, .iconbtn:hover, .xbtn:hover, .capital-edit:hover {
  color: var(--text);
  background: var(--raise);
  border-color: var(--line);
}

/* Page frame and typography. */
.wrap { max-width: 1500px; padding: 44px clamp(24px, 3.2vw, 52px) 34px; }
.view { animation: wise-view-in .24s ease both; }
@keyframes wise-view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.acc-head { margin-bottom: 28px; gap: 20px; }
.eyebrow {
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .17em;
}
.eyebrow:before { flex-basis: 27px; background: var(--gold); }
.eyebrow:after { display: none; }
.ws-heading h2, .ws-page-heading h2, .tech-head h2, .archive-title,
#view-acc .ws-page-heading h2 {
  color: var(--text);
  font: 780 clamp(34px, 4vw, 52px)/1.05 var(--ws-heading);
  letter-spacing: -.055em;
}
.ws-heading p, .ws-page-heading p, .tech-head p, .archive-copy {
  max-width: 700px;
  margin-top: 12px;
  color: var(--dim);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.65;
}
.head-actions { gap: 10px; }

/* Dashboard: one cinematic moment, surrounded by calm working surfaces. */
#app > .ws-banner {
  width: auto;
  min-height: 300px;
  margin: 30px clamp(24px, 3.2vw, 52px) 0;
  padding: 36px 40px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(90deg, #edf5e9 0%, #edf5e9 42%, rgba(237,245,233,.84) 58%, rgba(237,245,233,.12) 82%),
    url('./hero-broker.jpg') right 22% center / cover no-repeat;
  box-shadow: var(--soft-shadow);
}
[data-theme="dark"] #app > .ws-banner {
  background:
    linear-gradient(90deg, #1a2017 0%, #1a2017 42%, rgba(26,32,23,.86) 60%, rgba(26,32,23,.18) 84%),
    url('./hero-broker.jpg') right 22% center / cover no-repeat;
}
#app > .ws-banner:before { display: none; }
#app > .ws-banner .ws-hero-content { max-width: 620px; }
#app > .ws-banner .ws-kicker { color: var(--gold); font: 750 10px/1.5 "JetBrains Mono", monospace; }
#app > .ws-banner h2 {
  max-width: 510px;
  margin: 18px 0 25px;
  color: var(--text);
  font: 790 clamp(30px, 3.8vw, 50px)/1.03 var(--ws-heading);
  letter-spacing: -.06em;
}
#app > .ws-banner .hero-label { color: var(--dim); font-size: 13px; font-weight: 650; }
#app > .ws-banner .hero-val {
  margin: 5px 0 8px;
  color: var(--status-ok-text);
  font: 800 clamp(43px, 5.6vw, 68px)/1 var(--ws-heading);
}
#app > .ws-banner .hero-sub,
#app > .ws-banner .hero-sub b { color: var(--dim); font-size: 13px; font-weight: 600; }
#app > .ws-banner .ws-hero-side {
  right: 24px;
  bottom: 22px;
  max-width: calc(100% - 48px);
  padding: 9px 13px;
  color: #fff7e8;
  background: rgba(30, 23, 13, .82);
  border: 1px solid rgba(255, 228, 179, .38);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  font-size: 8px;
}
#app > .ws-banner .ws-hero-side > :last-child { color: #f0cf9a; border-color: rgba(255,228,179,.28); }

.stats, .ledger-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ledger-stats { margin-bottom: 22px; }
.stat {
  min-height: 142px;
  padding: 22px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 25px;
  box-shadow: var(--soft-shadow);
}
.stat:hover { border-color: var(--line2); box-shadow: var(--shadow); transform: translateY(-2px); }
.stat .ic {
  width: 38px;
  height: 38px;
  margin-bottom: 19px;
  border-radius: 50%;
  font-size: 17px;
}
.stat .k { color: var(--dim); font-size: 13px; font-weight: 600; }
.stat .v { color: var(--text); font: 760 clamp(25px, 2.6vw, 34px)/1.15 var(--ws-heading); }
.capital-edit { top: 16px; right: 16px; }
.mini { margin-top: 30px; }
.mini > .eyebrow { color: var(--gold); font-size: 10px; }
.mini-row {
  margin-bottom: 8px;
  padding: 18px 20px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--soft-shadow);
}
.mini-head { padding-block: 9px; background: transparent; border-color: transparent; box-shadow: none; }
.mini-head span { color: var(--faint); font-size: 11px; font-weight: 750; }
.mini-row:not(.mini-head) .cell { color: var(--text); font-weight: 650; }

/* Actions and controls. */
.btn-gold {
  min-height: 48px;
  padding: 12px 20px;
  color: var(--accent-ink);
  background: var(--accent-fill);
  border: 1px solid var(--accent-fill);
  border-radius: 999px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 760;
}
.btn-gold:hover { filter: brightness(.96); box-shadow: 0 12px 28px -20px color-mix(in srgb, var(--accent-fill) 70%, #000); transform: translateY(-1px); }
.btn-ghost, .small-btn {
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-ghost { min-height: 46px; padding: 11px 16px; border-radius: 999px; font-size: 14px; font-weight: 650; }
.small-btn { min-height: 34px; padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.btn-ghost:hover, .small-btn:hover { color: var(--status-ok-text); background: var(--green-soft); border-color: var(--green-soft); }
.btn-gold:disabled, .btn-ghost:disabled, .account-status-select:disabled {
  color: var(--faint);
  background: var(--bg3);
  border-color: var(--line);
}

/* Accounts: a single readable record instead of a stack of dark boxes. */
#view-acc > .acc-head {
  min-height: 0;
  padding: 4px 0 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}
#view-acc > .acc-head:before,
#view-acc > .acc-head:after { display: none; }
#view-acc .acc-head > .btn-gold { align-self: center; box-shadow: none; }
#acc-grid { gap: 18px; }
.account-card,
.archive-card {
  padding: 28px 30px 18px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--soft-shadow);
}
.account-card:hover, .archive-card:hover { border-color: var(--line2); box-shadow: var(--shadow); }
.account-card:before { display: none; }
.account-card .av, .archive-card .av {
  width: 50px;
  height: 50px;
  color: var(--status-reset-text);
  background: var(--gold-soft);
  border: 0;
  border-radius: 17px;
}
.account-card .meta .account-caption { color: var(--dim); font-size: 13px; font-weight: 650; }
.account-card .meta .nm { color: var(--text); font-size: 22px; font-weight: 780; }
.loc, .card-dates, .workflow-note { color: var(--dim); font-size: 13px; }
.account-status-select {
  min-height: 42px;
  padding: 9px 38px 9px 13px;
  color: var(--text);
  background: var(--bg3);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.account-status-select[data-status="reset"] { color: var(--status-reset-text); background: var(--status-reset-bg); border-color: transparent; }
.account-status-select[data-status="locked"] { color: var(--status-lock-text); background: var(--status-lock-bg); border-color: transparent; }
.account-status-select[data-status="ok"] { color: var(--status-ok-text); background: var(--status-ok-bg); border-color: transparent; }
.account-summary > .account-note-preview {
  padding: 13px 16px;
  color: var(--note-text);
  background: var(--note-bg);
  border: 0;
  border-radius: 16px;
  font-size: 13px;
}
.account-summary > .account-note-preview:before { color: var(--note-label); }
.account-card .card-fin {
  gap: 16px;
  padding: 20px;
  background: var(--bg3);
  border: 0;
  border-radius: 20px;
}
.account-card .card-fin .fin-profit { border-color: var(--line2); }
.fin-c .l { margin-bottom: 7px; color: var(--dim); font-size: 12px; font-weight: 650; }
.fin-c .n { color: var(--text); font-size: 25px; font-weight: 760; }
.account-card .fin-profit .l { color: var(--status-ok-text); }
.fin-hint { color: var(--faint); }
.account-section-label { color: var(--dim); font-size: 13px; font-weight: 700; }
.account-card .workflow {
  gap: 18px;
  padding: 2px 0 0;
  background: transparent;
  border: 0;
}
.account-card .workflow-steps { padding: 8px 0 2px; }
.account-card .workflow-step { color: var(--dim); font-size: 12px; font-weight: 560; }
.account-card .workflow-step:not(:first-child):before { background: var(--line2); }
.account-card .workflow-step.done:before,
.account-card .workflow-step.current:before { background: var(--accent-fill); }
.account-card .workflow-step i {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  color: var(--dim);
  background: var(--bg2);
  border-color: var(--line2);
  border-radius: 50%;
}
.account-card .workflow-step.current { color: var(--status-ok-text); }
.account-card .workflow-step.current i {
  color: var(--accent-ink);
  background: var(--accent-fill);
  border-color: var(--accent-fill);
}
.account-card .workflow-step.done { color: var(--status-ok-text); }
.account-card .workflow-step.done i { color: var(--status-ok-text); background: var(--green-soft); border-color: var(--green-soft); }
.workflow-actions .workflow-action:not(:disabled) {
  min-height: 42px;
  color: var(--accent-ink);
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  border-radius: 999px;
}
.workflow-actions .workflow-action:hover:not(:disabled) { color: var(--accent-ink); background: color-mix(in srgb, var(--accent-fill) 88%, #fff); }
.account-card .workflow-back { border-radius: 50%; }
.account-card .workflow-return {
  padding: 10px 14px;
  color: var(--note-text);
  background: var(--note-bg);
  border: 0;
  border-radius: 14px;
}
.account-card .timer { padding: 13px 15px; background: var(--bg3); border-radius: 16px; }
.account-footer { margin-top: 18px; padding-top: 15px; border-color: var(--line); }
.account-footer .card-actions .btn-ghost { background: var(--bg2); border-color: var(--line); border-radius: 999px; }

/* Bookkeeping, technical inventory and archive share the same calm surface. */
.ledger-panel, .tech-panel {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--soft-shadow);
}
.ledger-title, .tech-panel-head {
  padding: 20px 22px;
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}
.ledger-title, .tech-panel-head h3 { font: 750 18px/1.35 var(--ws-heading); }
.ledger-title span, .tech-panel-head span { color: var(--faint); font-size: 12px; font-weight: 600; }
.ledger-list, .tech-list { padding: 9px; }
.ledger-row, .tech-row { border-radius: 17px; }
.ledger-row { padding: 15px 14px; border-bottom-color: var(--line); }
.ledger-row:hover, .tech-row:hover { background: var(--bg3); }
.ledger-row .title, .expense-folder-name, .tech-title { color: var(--text); font-size: 15px; font-weight: 720; }
.ledger-row .sub, .ledger-note, .tech-sub, .tech-note { color: var(--dim); font-size: 13px; font-weight: 500; }
.ledger-row .sum, .expense-folder-sum { color: var(--text); font-size: 21px; font-weight: 760; }
.ledger-note { background: var(--bg3); }
.expense-folder { background: var(--bg3); border-radius: 18px; }
.expense-folder-body { background: var(--bg2); }
.tech-head { margin-bottom: 28px; }
.tech-head:before {
  width: 36%;
  opacity: .1;
  background: url('./desk-detail.jpg') center 52% / cover;
  mask-image: linear-gradient(90deg, transparent, #000 45%);
  border-radius: 28px;
}
[data-theme="dark"] .tech-head:before { opacity: .16; }
.tech-actions { gap: 8px; max-width: 820px; }
.tech-actions button { min-height: 42px; font-size: 12px; }
.tech-status { gap: 10px; }
.tech-source {
  padding: 12px 15px;
  color: var(--dim);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--soft-shadow);
}
.tech-layout { grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.tech-panel.wide { grid-column: 1 / -1; }
.tech-row { padding: 14px 12px; }
.tech-icon { border-radius: 50%; background: var(--bg3); }
.tech-code, .live-notice-code { color: var(--accent-ink); background: var(--accent-fill); border-color: var(--accent-fill); }
.tech-binding, .archive-badge { color: var(--status-ok-text); background: var(--status-ok-bg); border-color: transparent; }
.tech-binding.free { color: var(--dim); background: var(--bg3); }
.archive-count { color: var(--dim); background: var(--bg3); border-radius: 999px; }
.archive-resource { background: var(--bg3); border-radius: 15px; }

/* Forms and overlays. */
.scrim { background: rgba(17, 27, 14, .42); backdrop-filter: blur(10px); }
.modal {
  max-width: 820px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: 0 35px 90px -36px rgba(17, 32, 13, .55);
}
.modal-head { padding: 24px 28px; background: var(--bg2); border-color: var(--line); border-radius: 30px 30px 0 0; }
.modal-head input.title, .modal-head h2, .modal-head h3 { color: var(--text); font-family: var(--ws-heading); }
.modal-body { padding: 26px 28px 30px; }
.modal-foot { padding: 0 28px 28px; }
.sect-t { color: var(--gold); font-size: 11px; font-weight: 800; }
.field label, .tech-field label, .auth-form label { color: var(--dim); font-size: 13px; font-weight: 650; }
.field input, .field select, .account-note-field textarea,
.auth-form input, .auth-form textarea,
.tech-field input, .tech-field textarea, .tech-secret-row input, .consumable-row input {
  min-height: 48px;
  color: var(--text);
  background: var(--bg3);
  border: 1px solid transparent;
  border-radius: 14px;
  box-shadow: none;
  font-size: 15px;
}
.field input:focus, .field select:focus, .account-note-field textarea:focus,
.auth-form input:focus, .auth-form textarea:focus,
.tech-field input:focus, .tech-field textarea:focus, .tech-secret-row input:focus,
.consumable-row input:focus {
  outline: 0;
  border-color: var(--green);
  background: var(--bg2);
  box-shadow: 0 0 0 4px var(--green-soft);
}
input::placeholder, textarea::placeholder { color: var(--faint); opacity: .86; }
.password-history, .consumable-row, .folder { background: var(--bg3); border-color: var(--line); border-radius: 18px; }
.profit-box { color: var(--status-ok-text); background: var(--green-soft); border-color: transparent; border-radius: 17px; }
.profit-box .l, .profit-box .n { color: var(--status-ok-text); }
.drop { border-color: var(--line2); border-radius: 16px; }
.drop:hover { color: var(--status-ok-text); background: var(--green-soft); border-color: var(--green); }
.toast, .live-notice {
  color: var(--text);
  background: var(--bg2);
  border-color: var(--line);
  border-radius: 19px;
  box-shadow: var(--shadow);
}

/* Login: light and calm, with the film still used only as atmosphere. */
.auth-shell { background: var(--bg); }
.auth-shell:has(.ws-auth-scene) { gap: clamp(28px, 4vw, 64px); }
.ws-auth-scene {
  min-height: 620px;
  padding: 44px;
  color: #fffaf0;
  border: 0;
  border-radius: 34px;
  background: #1d170e url('./desk-detail.jpg') center / cover no-repeat;
  box-shadow: var(--shadow);
}
.ws-auth-scene:before { background: linear-gradient(180deg, rgba(14,12,8,.9), rgba(14,12,8,.28) 68%, rgba(14,12,8,.82)); }
.ws-auth-scene h2 { color: #fffaf0; }
.ws-auth-scene p { color: #eee3d4; }
.auth-card {
  max-width: 480px;
  padding: 38px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--soft-shadow);
}
.auth-tabs { padding: 5px; background: var(--bg3); border: 0; border-radius: 999px; }
.auth-tabs button { border-radius: 999px; font-size: 13px; }
.auth-tabs button.on { color: var(--status-ok-text); background: var(--green-soft); }
.auth-message { background: var(--bg3); border-radius: 15px; }
.auth-message.err { color: var(--status-lock-text); background: var(--status-lock-bg); border-color: transparent; }

.ws-footer { color: var(--faint); border-color: var(--line); }
.ws-footer strong { color: var(--dim); }
.ws-footer i { color: var(--gold); }

/* Desktop: persistent navigation rail. */
@media (min-width: 1101px) {
  #app { min-height: 100vh; padding-left: 248px; }
  #app > .top {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    height: 100dvh;
    background: var(--bg2);
    border: 0;
    border-right: 1px solid var(--line);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  #app > .top > .top-inner {
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 26px 18px 22px;
    display: flex;
    flex-flow: column nowrap;
    align-items: stretch;
    gap: 28px;
  }
  #app .brand { margin: 0 8px; }
  #app .nav {
    position: static;
    order: initial;
    width: auto;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: visible;
  }
  #app .nav button {
    width: 100%;
    flex: none;
    justify-content: flex-start;
    padding-inline: 15px;
  }
  #app .user-tools {
    width: 100%;
    margin: auto 0 0;
    padding: 14px 8px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    border-top: 1px solid var(--line);
  }
  #app .user-email { grid-column: 1 / -1; max-width: 100%; }
  #app .signout { justify-self: start; }
  #app .themebtn { justify-self: end; }
}

/* Tablet keeps navigation near the top and gives the content room to breathe. */
@media (min-width: 761px) and (max-width: 1100px) {
  #app { padding-left: 0; }
  #app > .top { position: sticky; width: auto; height: auto; }
  #app > .top > .top-inner { padding: 15px 24px; gap: 12px 18px; flex-wrap: wrap; }
  #app .brand { margin-right: auto; }
  #app .user-tools { margin-left: auto; }
  #app .nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  #app .nav::-webkit-scrollbar { display: none; }
  #app .nav button { flex: 0 0 auto; }
  #app > .ws-banner { margin: 24px 24px 0; }
  .stats, .ledger-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 78px; }
  body { padding-bottom: calc(98px + env(safe-area-inset-bottom, 0px)); }
  #app { padding-left: 0; }
  #app > .top { background: color-mix(in srgb, var(--bg2) 96%, transparent); }
  #app > .top > .top-inner { padding: 13px 16px; }
  #app .brand .mark { width: 42px; height: 42px; }
  #app .brand h1 { font-size: 15px; }
  #app .brand span { font-size: 7px; }
  #app .nav {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    padding: 6px;
    background: color-mix(in srgb, var(--bg2) 94%, transparent);
    border: 1px solid var(--line);
    border-radius: 25px;
    box-shadow: 0 16px 36px -20px rgba(17,32,13,.5);
  }
  #app .nav button { flex-basis: 70px; min-height: 62px; padding: 9px 7px; border-radius: 20px; font-size: 9px; }
  #app .nav button.on { color: var(--status-ok-text); background: var(--green-soft); }
  .wrap { padding: 28px 16px 16px; }
  #app > .ws-banner {
    min-height: 278px;
    margin: 14px 12px 0;
    padding: 25px 22px 55px;
    border-radius: 26px;
    background:
      linear-gradient(90deg, #edf5e9 0%, rgba(237,245,233,.94) 55%, rgba(237,245,233,.35) 100%),
      url('./hero-broker.jpg') 68% center / cover no-repeat;
  }
  [data-theme="dark"] #app > .ws-banner {
    background:
      linear-gradient(90deg, #1a2017 0%, rgba(26,32,23,.94) 55%, rgba(26,32,23,.4) 100%),
      url('./hero-broker.jpg') 68% center / cover no-repeat;
  }
  #app > .ws-banner h2 { max-width: 300px; margin: 14px 0 19px; font-size: 31px; }
  #app > .ws-banner .hero-val { font-size: 45px; }
  #app > .ws-banner .hero-sub { max-width: 270px; font-size: 11px; }
  #app > .ws-banner .ws-hero-side { left: 20px; right: auto; bottom: 17px; font-size: 7px; }
  #app > .ws-banner .ws-hero-side > :last-child { display: none; }
  .ws-heading h2, .ws-page-heading h2, .tech-head h2, .archive-title,
  #view-acc .ws-page-heading h2 { font-size: 34px; }
  .ws-heading p, .ws-page-heading p, .tech-head p, .archive-copy { font-size: 14px; }
  .acc-head { gap: 17px; }
  #view-acc > .acc-head { padding: 0; min-height: 0; }
  #view-acc .acc-head > .btn-gold { align-self: flex-start; }
  .stats, .ledger-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { min-height: 135px; padding: 17px; border-radius: 21px; }
  .stat .ic { width: 34px; height: 34px; margin-bottom: 15px; }
  .stat .k { font-size: 12px; }
  .stat .v { font-size: 26px; }
  .mini-row { padding: 18px; border-radius: 20px; }
  .account-card, .archive-card { padding: 21px 18px 14px; border-radius: 24px; }
  .account-card .card-fin { padding: 17px; gap: 16px 14px; border-radius: 18px; }
  .account-card .card-fin .fin-profit { border-top-color: var(--line2); }
  .account-card .workflow-steps { padding-bottom: 12px; }
  .account-card .workflow-step { font-size: 11px; }
  .account-card .workflow-step i { width: 27px; height: 27px; }
  .account-summary > .account-note-preview { border-radius: 15px; }
  .ledger-panel, .tech-panel { border-radius: 23px; }
  .tech-head:before { display: none; }
  .tech-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech-actions button { font-size: 11px; border-radius: 18px; }
  .modal { border-radius: 25px; }
  .modal-head { padding: 20px; border-radius: 25px 25px 0 0; }
  .modal-body { padding: 22px 20px; }
  .modal-foot { padding: 0 20px 22px; }
  .auth-shell:has(.ws-auth-scene) { gap: 16px; padding: 18px 14px; }
  .ws-auth-scene { min-height: 245px; padding: 25px; border-radius: 27px; }
  .ws-auth-scene h2 { font-size: 34px; }
  .auth-card { padding: 27px 23px; border-radius: 27px; }
}

@media (max-width: 410px) {
  .wrap { padding-inline: 12px; }
  .stats, .ledger-stats { gap: 8px; }
  .stat { padding: 15px 13px; }
  .stat .v { font-size: 23px; }
  .account-card, .archive-card { padding-inline: 15px; }
  .tech-actions { grid-template-columns: 1fr; }
}

/* Account portfolio: compact, readable cards instead of full-width records. */
@media (min-width: 761px) {
  #acc-grid {
    grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
    justify-content: start;
    align-items: start;
    gap: 20px;
  }

  .account-card {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    align-items: start;
    padding: 26px;
    border-radius: 28px;
  }
  .account-summary { display: contents; }
  .account-summary > .card-top {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }
  .account-summary > .account-status-row {
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
  }
  .account-summary > .account-note-preview {
    grid-column: 1;
    grid-row: 4;
    margin: 20px 0 0;
    padding: 14px 16px;
    border-radius: 16px;
  }
  .account-card .card-top { gap: 14px; }
  .account-card .av {
    width: 58px;
    height: 58px;
    border-radius: 19px;
    font-size: 23px;
  }
  .account-card .meta .account-caption {
    display: block;
    margin: 0 0 2px;
    color: var(--dim);
    font: 700 12px/1.4 Inter, sans-serif;
  }
  .account-card .meta .nm {
    display: block;
    color: var(--text);
    font-size: 25px;
    line-height: 1.18;
  }
  .account-card .meta .loc {
    margin-top: 5px;
    color: var(--dim);
    font-size: 14px;
    font-weight: 550;
  }
  .account-status-control { min-width: 144px; }
  .account-status-control > span, .card-last-four {
    color: var(--dim);
    font-size: 12px;
    font-weight: 650;
  }
  .account-status-select {
    min-height: 44px;
    padding-inline: 15px 38px;
    font-size: 13px;
  }
  .card-last-four b { font-size: 14px; }

  .account-body {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
    margin-top: 24px;
  }
  .account-card .card-fin {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 16px;
    padding: 20px 18px;
    border-radius: 20px;
  }
  .account-card .card-fin .fin-profit {
    grid-column: 1 / -1;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 14px;
    align-items: end;
    padding: 15px 0 0;
    border-top: 1px solid var(--line2);
    border-left: 0;
  }
  .account-card .fin-c .l {
    min-height: 0;
    margin-bottom: 4px;
    color: var(--dim);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.4;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .account-card .fin-c .n {
    color: var(--text);
    font-size: 24px;
    font-weight: 790;
    line-height: 1.15;
    white-space: nowrap;
  }
  .account-card .fin-profit:has(.fin-hint) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .account-card .fin-profit:has(.fin-hint) .l {
    grid-column: 1;
  }
  .account-card .fin-profit .n {
    grid-column: 2;
    grid-row: 1 / 3;
  }
  .account-card .fin-profit .fin-hint {
    grid-column: 1;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: normal;
  }

  .account-progress { padding-top: 22px; }
  .account-section-label {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 14px;
    font-weight: 760;
  }
  .account-card .workflow,
  .account-card .workflow:has(.timer) {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 19px;
    background: var(--bg3);
    border: 1px solid var(--line);
    border-radius: 22px;
  }
  .account-card .workflow-steps {
    grid-column: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 8px;
    padding: 0;
    overflow: visible;
  }
  .account-card .workflow-step {
    min-width: 0;
    padding: 0 3px;
    color: var(--dim);
    font-size: 12px;
    font-weight: 620;
    line-height: 1.35;
  }
  .account-card .workflow-step:not(:first-child):before { display: none; }
  .account-card .workflow-step i {
    width: 29px;
    height: 29px;
    margin-bottom: 7px;
    font-size: 12px;
  }
  .account-card .workflow-note {
    grid-column: 1;
    width: 100%;
    margin: 0;
    padding: 13px 15px;
    align-items: center;
    justify-content: space-between;
    color: var(--dim);
    background: var(--bg2);
    border-radius: 14px;
  }
  .account-card .workflow-note b { font-size: 13px; }
  .account-card .timer {
    grid-column: 1;
    padding: 15px 16px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 16px;
  }
  .account-card .timer-top > span { font-size: 13px; font-weight: 650; }
  .account-card .tval { font-size: 15px; }
  .account-card .tbar { height: 5px; margin-top: 13px; }
  .account-card .workflow-return {
    grid-column: 1;
    padding: 14px 15px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent-fill);
    border-radius: 14px;
  }
  .account-card .workflow-actions {
    grid-column: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    justify-content: stretch;
    flex-wrap: nowrap;
  }
  .account-card .workflow-action {
    flex: 1 1 auto;
    width: auto;
    min-height: 48px;
    padding: 11px 16px;
    font-size: 13px;
  }
  .account-card .workflow-back {
    flex: 0 0 48px;
    min-height: 48px;
    padding: 0;
  }

  .account-footer {
    grid-column: 1;
    grid-row: 5;
    margin-top: 20px;
    padding-top: 17px;
  }
  .account-footer .card-dates {
    width: 100%;
    justify-content: space-between;
    font-size: 13px;
  }
  .account-footer .card-actions {
    width: 100%;
    margin-top: 4px;
  }
  .account-footer .card-actions .btn-ghost:first-child { flex: 1 1 auto; }
  .account-footer .card-actions .danger { flex: 0 0 46px; }
}

@media (min-width: 761px) and (max-width: 1120px) {
  #acc-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1121px) and (max-width: 1439px) {
  #acc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A 1470px Mac viewport gets three useful cards, not three tiny previews. */
@media (min-width: 1440px) {
  #acc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
  .account-card {
    padding: 20px;
    border-radius: 24px;
  }
  .account-card .card-top { gap: 11px; }
  .account-card .av {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    font-size: 20px;
  }
  .account-card .meta .nm {
    font-size: 21px;
    line-height: 1.2;
  }
  .account-card .meta .loc { font-size: 12px; }
  .account-summary > .account-status-row {
    gap: 10px;
    margin-top: 15px;
  }
  .account-status-control { min-width: 132px; }
  .account-status-select {
    min-height: 40px;
    padding: 8px 34px 8px 12px;
    font-size: 12px;
  }
  .account-status-control > span, .card-last-four { font-size: 11px; }
  .card-last-four b { font-size: 13px; }

  .account-body { margin-top: 19px; }
  .account-card .card-fin {
    gap: 14px 12px;
    padding: 16px;
    border-radius: 17px;
  }
  .account-card .fin-c .l {
    font-size: 10px;
    letter-spacing: .035em;
  }
  .account-card .fin-c .n { font-size: 21px; }
  .account-card .card-fin .fin-profit { padding-top: 13px; }
  .account-card .fin-profit .fin-hint { font-size: 10px; }

  .account-progress { padding-top: 18px; }
  .account-section-label {
    margin-bottom: 9px;
    font-size: 13px;
  }
  .account-card .workflow,
  .account-card .workflow:has(.timer) {
    gap: 13px;
    padding: 15px;
    border-radius: 18px;
  }
  .account-card .workflow-steps {
    gap: 15px 4px;
  }
  .account-card .workflow-step {
    padding-inline: 1px;
    font-size: 10.5px;
    line-height: 1.28;
  }
  .account-card .workflow-step i {
    width: 26px;
    height: 26px;
    margin-bottom: 6px;
  }
  .account-card .timer {
    padding: 13px;
    border-radius: 14px;
  }
  .account-card .timer-top > span { font-size: 12px; }
  .account-card .tval { font-size: 13px; }
  .account-card .workflow-note,
  .account-card .workflow-return {
    padding: 12px 13px;
    font-size: 11px;
  }
  .account-card .workflow-note {
    flex-direction: column;
    align-items: flex-start;
  }
  .account-card .timer-top { flex-wrap: wrap; }
  .account-card .workflow-actions {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
  }
  .account-card .workflow-actions > .workflow-action:only-child,
  .account-card .workflow-actions > .workflow-action:nth-child(3) {
    grid-column: 1 / -1;
  }
  .account-card .workflow-action {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 9px 10px;
    font-size: 11px;
    line-height: 1.3;
  }
  .account-card .workflow-back {
    width: 44px;
    min-height: 44px;
  }
  .account-summary > .account-note-preview {
    margin-top: 16px;
    padding: 12px 13px;
    font-size: 12px;
  }
  .account-footer {
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
  }
  .account-footer .card-dates { font-size: 11px; }
  .account-footer .card-actions .btn-ghost {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 11px;
  }
  .account-footer .card-actions .danger { flex-basis: 42px; }
}

/* Banks and pickup points: compact operational directories. */
.directory-summary {
  display: flex;
  gap: 9px;
  margin: -12px 0 20px;
  flex-wrap: wrap;
}
.directory-summary span {
  padding: 8px 12px;
  color: var(--dim);
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  align-items: start;
}
.directory-card {
  min-width: 0;
  padding: 22px;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--soft-shadow);
}
.directory-card-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
}
.directory-card-head > div:nth-child(2) { min-width: 0; }
.directory-card-head span {
  display: block;
  margin-bottom: 2px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.directory-card-head h3 {
  overflow-wrap: anywhere;
  font: 780 21px/1.2 var(--ws-heading);
  letter-spacing: -.025em;
}
.directory-card-head p {
  margin-top: 4px;
  color: var(--dim);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.directory-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--status-reset-text);
  background: var(--gold-soft);
  border-radius: 15px;
  font-size: 19px;
  font-weight: 800;
}
.directory-icon.point { color: var(--status-ok-text); background: var(--green-soft); }
.capacity-badge {
  min-width: 50px;
  padding: 8px 10px;
  color: var(--status-ok-text);
  background: var(--green-soft);
  border-radius: 999px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}
.capacity-badge.full { color: var(--status-lock-text); background: var(--red-soft); }
.capacity-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 20px 0 10px; }
.capacity-track i { height: 7px; background: var(--bg3); border-radius: 999px; }
.capacity-track i.used { background: var(--accent-fill); }
.is-full .capacity-track i.used { background: var(--red); }
.capacity-copy { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.capacity-copy b { color: var(--text); font-size: 13px; }
.capacity-copy span { color: var(--faint); font-size: 11px; text-align: right; }
.bank-usage-copy { margin-top: 18px; }
.bank-card-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.bank-card-list span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg3); color: var(--dim); font-size: 11px; overflow-wrap: anywhere; }
.bank-card-editor { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg3); }
.bank-card-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bank-card-editor-head strong { font-size: 13px; }
#bank-card-rows { display: grid; gap: 10px; }
.bank-card-edit-row { display: grid; grid-template-columns: minmax(130px,1fr) minmax(130px,1fr) auto; gap: 10px; align-items: end; }
.bank-card-edit-row .small-btn { min-height: 40px; }
.account-bank-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 11px; }
.account-bank-heading strong { font-size: 13px; }
.account-bank-heading span, .account-bank-card-empty, .account-bank-card-hint { color: var(--faint); font-size: 11px; line-height: 1.5; }
.account-bank-cards { display: grid; gap: 9px; }
.account-bank-card-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 9px; align-items: end; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg3); }
.account-bank-card-row .field select { background: var(--bg2); }
.account-bank-card-remove { min-height: 40px; }
.account-bank-card-hint { grid-column: 1 / -1; }
.account-bank-card-hint button { color: var(--gold); text-decoration: underline; }
.account-code-panel { margin: 18px 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg3); }
.account-code-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 11px; }
.account-code-heading strong { font-size: 13px; }
#account-incoming-codes { display: grid; gap: 8px; }
.account-incoming-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg2); }
.account-incoming-code > div { min-width: 0; display: grid; gap: 3px; }
.account-incoming-code b { font-size: 12px; }
.account-incoming-code span { color: var(--faint); font-size: 11px; overflow-wrap: anywhere; }
.access-tabs { display: flex; gap: 5px; padding: 4px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg3); }
.access-tab { flex: 1; padding: 10px 13px; border-radius: 9px; color: var(--dim); font-size: 13px; font-weight: 700; }
.access-tab.on { color: var(--text); background: var(--raise); box-shadow: 0 2px 8px -3px #0006; }
.access-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[role="tabpanel"][hidden] { display: none !important; }
@media (max-width: 540px) { .bank-card-edit-row, .account-bank-card-row { grid-template-columns: minmax(0,1fr) auto; } .bank-card-edit-row .tech-field:nth-child(2), .account-bank-card-row .field:nth-child(2) { grid-column: 1; } .bank-card-edit-row .small-btn, .account-bank-card-remove { grid-column: 2; grid-row: 1 / 3; } }
.directory-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}
.directory-details > div {
  min-width: 0;
  padding: 12px 13px;
  background: var(--bg3);
  border-radius: 15px;
}
.directory-details > .wide { grid-column: 1 / -1; }
.directory-details dt {
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.directory-details dd {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.directory-details .secure-value { color: var(--status-ok-text); }
.directory-long-value {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  white-space: pre-wrap;
}
.directory-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}
.directory-actions .btn-ghost:first-child { flex: 1; }
.directory-actions .danger:not(:disabled) { color: var(--red); }
.directory-empty {
  grid-column: 1 / -1;
  min-height: 270px;
  padding: 44px 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--dim);
  background: var(--bg2);
  border: 1px dashed var(--line2);
  border-radius: 26px;
  text-align: center;
}
.directory-empty b { color: var(--text); font: 760 22px/1.2 var(--ws-heading); }
.directory-empty span { max-width: 480px; font-size: 13px; line-height: 1.55; }
.directory-empty .btn-gold { margin-top: 9px; }
.account-resource-pills { display: flex; justify-content: flex-end; align-items: center; gap: 9px; flex-wrap: wrap; }
.account-bank-pill, .card-last-four {
  padding: 7px 10px;
  color: var(--dim);
  background: var(--bg3);
  border-radius: 999px;
  font-size: 11px;
}
.account-bank-pill b, .card-last-four b { color: var(--text); }
.account-primary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-resource-status.ready { color: var(--status-ok-text); }
.field-resource-status.limit { color: var(--red); }
.directory-form .tech-form-hint { margin-top: 7px; }

@media (min-width: 1101px) {
  #app .nav { min-height: 0; overflow-y: auto; scrollbar-width: none; }
  #app .nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 900px) {
  .account-primary-grid { grid-template-columns: 1fr 1fr; }
  .account-bank-field { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  #app .nav { overflow-x: auto; scrollbar-width: none; }
  #app .nav::-webkit-scrollbar { display: none; }
  #app .nav button { flex: 0 0 70px; }
  .directory-grid { grid-template-columns: 1fr; gap: 13px; }
  .directory-card { padding: 18px; border-radius: 22px; }
  .directory-details { grid-template-columns: 1fr; }
  .directory-details > .wide { grid-column: auto; }
  .account-primary-grid { grid-template-columns: 1fr; }
  .account-bank-field { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
}

#app .profile-tools { display: grid; gap: 7px; min-width: 0; }
#app .profile-tools label { color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
#app .profile-controls { display: flex; gap: 7px; min-width: 0; }
#app .profile-controls select, #app .profile-controls button { border: 1px solid var(--line2); border-radius: 11px; background: var(--bg3); color: var(--text); font: 600 13px Inter, sans-serif; }
#app .profile-controls select { flex: 1; min-width: 0; height: 42px; padding: 0 11px; cursor: pointer; }
#app .profile-controls button { flex: none; width: 42px; height: 42px; color: var(--gold); font-size: 21px; }
#app .profile-controls select:focus-visible, #app .profile-controls button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#app .profile-controls button:hover { background: var(--gold-soft); border-color: var(--gold); }
#app .profile-controls :disabled { opacity: .6; cursor: wait; }
#app.profile-loading .wrap, #app.profile-loading > .ws-banner { pointer-events: none; opacity: .65; }

/* Account transfer and loss closure. */
.account-footer .card-actions,
.archive-card .card-actions { flex-wrap: wrap; }
.account-footer .card-actions .btn-ghost { flex: 1 1 142px; }
.account-footer .card-actions .loss-action,
.modal-foot .loss-action {
  color: var(--status-lock-text);
  background: var(--status-lock-bg);
  border-color: transparent;
}
.account-footer .card-actions .loss-action:hover,
.modal-foot .loss-action:hover {
  color: var(--status-lock-text);
  background: color-mix(in srgb, var(--status-lock-bg) 82%, var(--red));
  border-color: var(--red);
}
.archive-card.loss-closed { border-color: color-mix(in srgb, var(--red) 42%, var(--line)); }
.archive-card.loss-closed .av { color: var(--status-lock-text); background: var(--status-lock-bg); }
.archive-badge.loss { color: var(--status-lock-text); background: var(--status-lock-bg); }
.account-loss-summary {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 15px 17px;
  color: var(--status-lock-text);
  background: var(--status-lock-bg);
  border: 1px solid color-mix(in srgb, var(--red) 28%, transparent);
  border-radius: 16px;
}
.account-loss-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.account-loss-summary span { font-size: 12px; font-weight: 760; text-transform: uppercase; letter-spacing: .045em; }
.account-loss-summary strong { flex: none; font: 780 20px/1 var(--ws-heading); }
.account-loss-summary p { color: var(--text); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.account-loss-summary small { color: var(--dim); font-size: 11px; }
.workflow-modal.loss { color: var(--status-lock-text); background: var(--status-lock-bg); border-color: transparent; }
.workflow-modal.loss span { color: var(--dim); }
.workflow-loss .workflow-note { margin: 0; padding: 12px 14px; color: var(--status-lock-text); background: var(--status-lock-bg); border-radius: 14px; }
.workflow-loss .workflow-note b { color: var(--status-lock-text); }
.tech-field select {
  width: 100%;
  min-height: 48px;
  padding: 11px 38px 11px 13px;
  color: var(--text);
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 14px;
}
.tech-field select:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.account-move-warning { margin: 0; }
.account-loss-confirmation {
  padding: 13px 15px;
  color: var(--status-lock-text);
  background: var(--status-lock-bg);
  border-radius: 13px;
  font-size: 12px;
  line-height: 1.55;
}
.loss-submit { color: #fff; background: var(--red); border-color: var(--red); }
.loss-submit:hover { filter: brightness(.94); }
.loss-expense-row { background: color-mix(in srgb, var(--status-lock-bg) 64%, transparent); }
.loss-expense-row .title { color: var(--status-lock-text); }
.account-readonly input:disabled,
.account-readonly textarea:disabled,
.account-readonly select:disabled { color: var(--text); opacity: .82; cursor: default; }
.account-readonly .modal-head input.title:disabled { background: transparent; }

@media (max-width: 760px) {
  .account-footer .card-actions .btn-ghost { flex-basis: calc(50% - 5px); }
  .archive-card .card-actions .btn-ghost { flex: 1 1 100%; }
  .account-loss-summary > div { align-items: flex-start; flex-direction: column; gap: 6px; }
}

@media (min-width: 1101px) {
  #app .profile-tools { width: 100%; padding: 0 8px; }
}
@media (max-width: 1100px) {
  #app .profile-tools { order: 2; width: 100%; }
  #app .user-tools { order: 1; }
  #app .nav { order: 3; }
}

/* Phone links connect the technical inventory with the owning account. */
.account-phone {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.account-phone span,
.account-phone i { color: var(--gold); font-style: normal; font-weight: 800; }
.account-card .account-phone { margin-top: 5px; font-size: 13px; font-weight: 650; }
.mini-account-main { min-width: 0; display: grid; gap: 2px; }
.mini-row .account-phone { font-size: 11px; font-weight: 600; }
.tech-row-actions .tech-account-link {
  color: var(--status-ok-text);
  background: var(--status-ok-bg);
  border-color: transparent;
}
.tech-row-actions .tech-account-link:hover { border-color: var(--green); }
