/* What the portal adds to the shared design files (tokens, base, components). */
.tabbar { grid-template-columns: repeat(3, 1fr); }
.topbar-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-md); color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); }
.who { padding: 0 var(--s3); font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.page-head > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.page-head h1 .chip { vertical-align: middle; margin-left: var(--s2); letter-spacing: 0; }
.back { display: inline-flex; align-items: center; gap: var(--s1); min-height: 44px; margin: -12px 0 var(--s1); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.back svg { width: 16px; height: 16px; }

.stack-lg { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.tiles .tile-label { padding-right: var(--s8); }
.tiles .tile-value { overflow-wrap: anywhere; }
@media (max-width: 1199px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479px) { .tiles { gap: var(--s3); } .tiles .tile { padding: var(--s3); } .tiles .tile-value { font-size: var(--fs-xl); } .tiles .tile-chip { top: var(--s3); right: var(--s3); } }

.columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); align-items: start; }
@media (min-width: 1100px) { .columns.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .columns.client { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }

.card.storage { margin-top: var(--s4); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.card-head .card-title { margin: 0; }
.card > .muted, .card form > .muted { font-size: var(--fs-sm); margin-bottom: var(--s3); }
.card .empty { padding: var(--s6) var(--s3); }
.row-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.row-actions:empty { display: none; }
#code-status { margin-top: var(--s3); }

.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; }
.facts dt, .facts dd { margin: 0; padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: var(--fs-sm); padding-right: var(--s4); }
.facts dd { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.facts dt:last-of-type, .facts dd:last-child { border-bottom: 0; }
.facts small { display: block; color: var(--muted); font-weight: 400; font-size: var(--fs-xs); }

.table td { overflow-wrap: break-word; }
.table td.cell-title { overflow-wrap: anywhere; min-width: 160px; }
/* The shared styles keep a clickable row's last cell for a chevron; here it holds a real column. */
.table tr.clickable td:last-child { color: inherit; width: auto; }
.table .nowrap { white-space: nowrap; overflow-wrap: normal; }
.table td .sub { display: block; color: var(--muted); font-size: var(--fs-xs); }
.table tr.is-void td, .table tr.is-void td .cell { color: var(--muted); }
.table tr.is-void .amount { text-decoration: line-through; }
.table a.cell-link { font-weight: 600; color: var(--ink); }
@media (min-width: 640px) { .table.tight th, .table.tight td { padding: 0 var(--s2); } }
@media (max-width: 639px) {
  .card .table.stack tr { box-shadow: none; border: 1px solid var(--line); }
  .table.stack td .cell { min-width: 0; overflow-wrap: anywhere; }
  .table.stack td.nowrap { white-space: normal; }
  .table.stack td.cell-action { justify-content: flex-end; }
  .table.stack td.cell-action::before, .table.stack td.cell-title::before { content: none; }
  .table.stack td.cell-title { justify-content: space-between; text-align: left; font-weight: 600; }
  .table.stack td.cell-action:empty { display: none; }
  .table.stack a.cell-link { display: flex; align-items: center; min-height: 44px; }
}
.table-card { padding: var(--s2) var(--s3) var(--s3); }
@media (max-width: 639px) { .table-card { background: none; box-shadow: none; padding: 0; } .table-card .table.stack tr { background: var(--surface); box-shadow: var(--shadow-1); border: 0; } }

.log li { padding: var(--s2) 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-line; }
.log li:last-child { border-bottom: 0; }
.log small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.log.scroll { max-height: 420px; overflow-y: auto; }

.list-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 56px; padding: var(--s2) 0; border-bottom: 1px solid var(--line); color: inherit; }
.list-row:hover { text-decoration: none; background: var(--surface-2); }
li:last-child > .list-row { border-bottom: 0; }
.list-row > span:first-child { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.list-row > span:last-child { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.list-row small { display: block; color: var(--muted); font-weight: 400; font-size: var(--fs-xs); }

.note { border-radius: var(--r-md); padding: var(--s3) var(--s4); font-size: var(--fs-sm); margin-bottom: var(--s4); background: var(--brand-50); color: var(--brand-700); overflow-wrap: anywhere; white-space: pre-line; }
.note.bad { background: var(--bad-50); color: var(--bad); }
.note.warn { background: var(--warn-50); color: var(--warn); }
.preview { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); font-size: var(--fs-sm); }
.preview .late { color: var(--warn); display: block; }
.secret { display: block; width: 100%; padding: var(--s3); margin: var(--s2) 0; background: var(--ink); color: #fff; border-radius: var(--r-md); font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: var(--fs-sm); line-height: 1.6; overflow-wrap: anywhere; user-select: all; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s3); }
@media (max-width: 479px) { .field-row { grid-template-columns: minmax(0, 1fr); } }
/* Hidden like a password, without being one, so no password manager fills it in. */
.input.masked:not(:placeholder-shown) { -webkit-text-security: disc; }
.btn-sm { height: 36px; font-size: var(--fs-sm); padding: 0 var(--s3); }
.btn.outline-danger { border-color: #f5c2c2; }
@media (pointer: coarse), (max-width: 1023px) { .btn-sm { height: 44px; } }
dialog.modal .modal-text strong { overflow-wrap: anywhere; }
.field label { overflow-wrap: anywhere; }
