/* Viewer: accounts table dialog (phones-view-accounts.js). Uses the viewer's tokens and the guide's dialog look. */
body[data-portal="owner"] #toolAccounts { display: none !important; } /* renters only */
.va { width: min(1240px, 100vw - 32px); max-height: min(860px, 100vh - 32px); max-height: min(860px, 100dvh - 32px); }
.va[open] { height: min(860px, 100vh - 32px); height: min(860px, 100dvh - 32px); } /* the same size whatever the search finds */
.va-box { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); min-height: 0; height: 100%; }
.va-icons { display: none; }

.va-tools { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(130px, auto)) auto auto; gap: 8px; align-items: center; padding: 12px 22px; }
.va-tools input[type=search], .va-tools select { min-height: 42px; padding: 8px 12px; border-radius: 12px; }
.viewer .va-tools input[type=search], .viewer .va-tools select { font-size: 14px; }
.va-tools .btn { min-height: 42px; white-space: nowrap; }
.va-reveal { display: flex; flex-direction: row; align-items: center; gap: 8px; min-height: 42px; padding: 0 4px; font-size: 14px; color: var(--ink); white-space: nowrap; cursor: pointer; }
.va-reveal input { width: 18px; height: 18px; min-height: 0; flex: none; accent-color: var(--accent); }

.va-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / 22%) transparent; border-top: 1px solid var(--edge-soft); }
.va-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.va-table th { position: sticky; top: 0; z-index: 1; padding: 10px 8px; text-align: left; font-size: 12.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-2); background: #15212a; border-bottom: 1px solid var(--edge); white-space: nowrap; }
.va-table td { padding: 6px 8px; border-bottom: 1px solid var(--edge-soft); vertical-align: middle; }
.va-table th:first-child, .va-table td:first-child { padding-left: 22px; }
.va-table th:last-child, .va-table td:last-child { padding-right: 22px; }
.va-table tbody tr:hover { background: rgb(255 255 255 / 4%); }
.va-table[aria-busy="true"] tbody { opacity: .6; }
.va-no { width: 1%; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.va-none { color: #74839a; padding-left: 8px; }
.va-when { display: block; padding-left: 8px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.va-when.bad { color: #ff9b8f; }

/* a value: the whole cell is the copy button, its icon always shown */
.va-copy { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 34px; padding: 4px 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.va-copy.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; }
.va-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.va-copy svg { width: 16px; height: 16px; flex: none; color: #8493a5; }
.va-copy svg:last-child, .va-copy.copied svg:nth-last-child(2) { display: none; }
.va-copy.copied svg:last-child { display: block; color: var(--mint-v); }
.va-copy:hover { background: var(--fill-2); border-color: var(--edge-soft); }
.va-copy:hover svg { color: var(--mint-v); }
.viewer .va-copy:focus-visible, .viewer .va-act:focus-visible { outline: 2px solid var(--mint-v); outline-offset: 1px; }
.va-acts { white-space: nowrap; }
.va-act { min-height: 34px; padding: 4px 12px; margin: 2px 6px 2px 0; border: 1px solid var(--edge); border-radius: 10px; background: var(--fill-2); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.va-act:hover { background: rgb(255 255 255 / 16%); }
.va-act:disabled { opacity: .45; cursor: progress; }
.va-act:first-child { border-color: color-mix(in srgb, var(--mint-v) 40%, transparent); }
.va-empty { margin: 0; padding: 40px 22px; text-align: center; color: var(--ink-2); }
.va-foot { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 8px 22px; border-top: 1px solid var(--edge-soft); }
.va-status { flex: 1; min-width: 0; margin: 0; font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.va-status.bad { color: #ff9b8f; }
.va-range { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.va-foot .btn { min-height: 40px; }
.va-offscreen { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 1099.98px) {
  .va-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 10px 16px; }
  .va-tools input[type=search] { grid-column: 1 / -1; }
  .va-tools .btn { order: 2; }
  .va-reveal { order: 1; grid-column: 1 / 3; }
  .va-text { max-width: 118px; }
  .va-table td { padding: 6px 2px; }
  .va-copy { gap: 5px; padding: 4px 6px; }
  .va-act { display: block; width: 100%; margin: 3px 0; }
  .va-table th:first-child, .va-table td:first-child { padding-left: 16px; }
  .va-table th:last-child, .va-table td:last-child { padding-right: 16px; }
}
/* narrow: each account is a card */
@media (max-width: 959.98px) {
  .va-table, .va-table tr, .va-table td { display: block; }
  .va-table tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 10px; padding: 10px; }
  .va-table tr { border: 1px solid var(--edge-soft); border-radius: 16px; background: rgb(255 255 255 / 3%); }
  .va { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .va[open] { height: calc(100vh - 16px); height: calc(100dvh - 16px); }
  .viewer .va-tools input[type=search], .viewer .va-tools select { font-size: 16px; } /* iOS zooms into smaller fields */
  .va-tools select { padding: 8px; min-width: 0; text-overflow: ellipsis; }
  .va-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .va-table tr { padding: 8px 14px 12px; }
  .va-table td, .va-table td:first-child, .va-table td:last-child { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; width: auto; padding: 0; min-height: 40px; border: 0; }
  .va-table td::before { content: attr(data-label); font-size: 13px; color: var(--ink-2); }
  .va-table td.va-no { padding-left: 0; padding-right: 0; min-height: 28px; }
  .va-when { grid-column: 2; padding-bottom: 4px; }
  .va-copy { min-height: 40px; justify-content: space-between; width: 100%; }
  .va-text { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .va-acts, .va-table td.va-acts { display: flex; gap: 8px; padding-top: 6px; }
  .va-table td.va-acts::before { display: none; }
  .va-act { flex: 1; width: auto; min-height: 42px; margin: 0; }
  .va-foot { flex-wrap: wrap; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); }
  .va-status { flex: 1 0 100%; white-space: normal; }
  .va-range { flex: 1; }
}
@media (max-width: 559.98px) {
  .va-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 14px; }
  .va-tools .btn { order: 0; }
  .va-reveal { grid-column: 1 / -1; min-height: 36px; }
}
/* phones in landscape: the whole dialog scrolls, the list keeps a usable height */
@media (max-height: 519.98px) {
  .va-box { grid-template-rows: auto auto minmax(180px, 1fr) auto; overflow-y: auto; }
  .va-tools { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)) auto auto; padding: 6px 14px; }
  .va-tools input[type=search], .va-reveal { grid-column: auto; }
  .va-foot { min-height: 0; flex-wrap: nowrap; padding: 4px 14px; }
  .va-status { flex: 1 1 0; white-space: nowrap; }
}

/* ---- mailbox dialog (phones-view-mail.js) ---- */
.vm { width: min(1100px, 100vw - 32px); }
.vm-box { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; min-height: 0; }
.vm-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.vm-title h2, .vm-title .vm-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-sub { margin: 0; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.vm .guide-head .btn { min-height: 40px; }
.vm-body { display: grid; grid-template-columns: minmax(240px, 360px) minmax(0, 1fr); min-height: 0; }
.vm-list { margin: 0; padding: 10px; list-style: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / 22%) transparent; border-right: 1px solid var(--edge-soft); display: grid; gap: 4px; align-content: start; }
.vm-list[aria-busy="true"] { opacity: .6; }
.vm-item { display: grid; gap: 3px; justify-items: start; width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; transition: background .15s; }
.vm-item strong { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.vm-item:hover { background: var(--fill-2); }
.vm-item[aria-current="true"] { background: color-mix(in srgb, var(--mint-v) 12%, transparent); border-color: color-mix(in srgb, var(--mint-v) 35%, transparent); }
.viewer .vm-item:focus-visible { outline: 2px solid var(--mint-v); outline-offset: 1px; }
.vm-code { padding: 1px 8px; border-radius: 8px; background: color-mix(in srgb, var(--mint-v) 16%, transparent); color: var(--mint-v); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vm-read { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; min-width: 0; }
.vm-back { display: none; margin: 10px 14px 0; justify-self: start; min-height: 40px; }
.vm-mail { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / 22%) transparent; padding: 18px 22px 22px; display: grid; gap: 16px; align-content: start; }
.vm-mail:focus-visible { outline: 2px solid var(--mint-v); outline-offset: -2px; }
.vm-head { display: grid; gap: 4px; }
.vm-head h3 { font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.vm-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.6; color: #d3dce6; max-width: 72ch; }
.vm-none { margin: 40px 0; text-align: center; color: var(--ink-2); }
.vm-otp { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--mint-v) 35%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--mint-v) 8%, transparent); }
.vm-otp span { color: var(--ink-2); font-size: 13px; }
.vm-otp strong { font-size: 22px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.vm-links { display: grid; gap: 8px; }
.vm-links h4 { margin: 0; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.vm-link { display: flex; align-items: center; gap: 6px; padding: 8px 6px 8px 12px; border: 1px solid var(--edge-soft); border-radius: 12px; }
.vm-link-text { flex: 1; min-width: 0; display: grid; font-size: 13.5px; }
.vm-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 12.5px; }
.vm .va-act { display: inline-block; width: auto; flex: none; margin: 0; white-space: nowrap; }
@media (max-width: 759.98px) {
  .vm-body { grid-template-columns: minmax(0, 1fr); }
  .vm-list { border-right: 0; }
  .vm-read, .vm-box.reading .vm-list { display: none; }
  .vm-box.reading .vm-read { display: grid; }
  .vm-back { display: inline-flex; }
  .vm-mail { padding: 14px 16px 18px; }
  .vm-link { flex-wrap: wrap; }
  .vm-link-text { flex: 1 0 100%; }
  .vm .va-act { flex: 1; min-height: 40px; }
}
