/* Signed-in pages: account, portal, admin. Builds on style.css. */

body.app { min-height: 100vh; background: radial-gradient(80% 50% at 50% 0%, rgba(241, 239, 244, 0.06), transparent 70%), #000; }

/* ---------- Sign-in card ---------- */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  padding: 48px 18px;
}
.auth-brand {
  font-weight: 300;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  text-decoration: none;
  font-size: 0.95rem;
}
.auth-card {
  width: min(440px, calc(100vw - 32px));
  padding: clamp(24px, 5vw, 36px);
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
}
.auth-card[hidden] { display: none; }
.auth-card h1 { margin: 0 0 10px; font-weight: 300; font-size: 1.8rem; line-height: 1.15; }
.auth-card .eyebrow { margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 0.95rem; margin: 0 0 18px; }
.auth-form { display: grid; gap: 16px; margin-top: 18px; }
.auth-form .btn { justify-content: center; margin-top: 4px; }
.code-input { font-size: 1.6rem !important; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }

.auth-msg {
  width: min(440px, calc(100vw - 32px));
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 123, 123, 0.35);
  background: rgba(255, 123, 123, 0.08);
  color: #ffc9c9;
  font-size: 0.92rem;
}
.auth-msg.good { border-color: rgba(241, 239, 244, 0.4); background: rgba(241, 239, 244, 0.08); color: #ffffff; }
.auth-foot { margin: 0; font-size: 0.85rem; }
.auth-foot a { color: var(--muted); text-decoration: none; }

.setup-steps { margin: 0 0 14px; padding-left: 20px; color: #b9c2c6; font-size: 0.95rem; }
.setup-steps li { margin: 6px 0; }
.qr {
  width: 200px;
  margin: 6px auto 12px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
}
.qr svg { display: block; width: 100%; height: auto; }
.manual { font-size: 0.85rem; color: var(--muted); }
.manual summary { cursor: pointer; }
.manual code { display: block; margin-top: 8px; padding: 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: var(--fg); letter-spacing: 0.08em; word-break: break-all; }

/* ---------- Portal / admin shell ---------- */

.app-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 32px);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.85);
}
.app-bar .auth-brand { font-size: 0.85rem; }
.app-bar-right { display: flex; align-items: center; gap: 14px; font-size: 0.85rem; color: var(--muted); }
.app-bar .btn { padding: 9px 16px; font-size: 0.75rem; }
.role-badge {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(241, 239, 244, 0.35);
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.app-main { max-width: 1100px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) 20px 80px; }
.app-main h1 { font-weight: 200; font-size: clamp(2rem, 4.4vw, 3rem); margin: 0 0 8px; letter-spacing: -0.01em; }
.empty {
  margin-top: 28px;
  padding: 40px 28px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  text-align: center;
  color: var(--muted);
}
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff7b7b; margin-right: 8px; vertical-align: middle; }
.status-dot.on { background: var(--accent); }

/* ---------- Admin ---------- */

.app-tabs { display: flex; gap: 4px; overflow-x: auto; }
.app-tabs a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.app-tabs a:hover { color: var(--fg); }
.app-tabs a.active { background: rgba(255, 255, 255, 0.08); color: var(--fg); }

.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table[hidden] { display: none; }
.data-table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr[data-id] { cursor: pointer; }
.data-table tbody tr[data-id]:hover,
.data-table tbody tr[data-id]:focus-visible { background: rgba(255, 255, 255, 0.035); outline: none; }
.cell-main { color: var(--fg); }
.cell-sub { color: var(--muted); font-size: 0.82rem; }
.warn { color: #ffb36b; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; text-transform: capitalize; border: 1px solid var(--line); }
.pill-active { color: var(--accent); border-color: rgba(241, 239, 244, 0.35); }
.pill-invited { color: #ffd479; border-color: rgba(255, 212, 121, 0.35); }
.pill-disabled { color: #ff9b9b; border-color: rgba(255, 123, 123, 0.35); }

.sheet {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #07090a;
  color: var(--fg);
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.7); }
.sheet-form { display: grid; gap: 16px; padding: clamp(20px, 4vw, 32px); }
.sheet-form h2 { margin: 0 0 4px; font-weight: 300; font-size: 1.5rem; }
.sheet-form [hidden] { display: none !important; }
.sheet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sheet-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.spacer { flex: 1; }
.field input[readonly] { opacity: 0.7; }
.sheet .auth-msg { width: auto; }

.invite-box {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(241, 239, 244, 0.3);
  background: rgba(241, 239, 244, 0.05);
}
.invite-box p { margin: 0 0 10px; font-size: 0.9rem; color: #ffffff; }
.copy-row { display: flex; gap: 8px; }
.copy-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.5);
  color: var(--fg);
  font: 400 0.85rem/1.3 var(--font);
}

@media (max-width: 760px) {
  .app-bar { flex-wrap: wrap; }
  .app-tabs { order: 3; width: 100%; }
  .hide-sm { display: none; }
  .sheet-row { grid-template-columns: 1fr; }
}
.table-wrap[hidden] { display: none; }

/* ---------- Long-form text pages ---------- */
.prose { max-width: 720px; }
.prose h2 { margin: 44px 0 10px; font-weight: 400; font-size: 1.3rem; }
.prose ul { padding-left: 20px; color: #b9c2c6; }
.prose li { margin: 8px 0; }
.prose li strong, .prose p strong { color: var(--fg); font-weight: 500; }
.prose a { color: var(--fg); }

/* ---------- Admin: scenes ---------- */
.scene-admin-list { display: grid; gap: 16px; margin-top: 24px; }
.scene-admin {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}
.scene-admin-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: #050708;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
}
.scene-admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.scene-admin-body h3 { margin: 0 0 4px; font-weight: 400; font-size: 1.2rem; }
.scene-admin-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 14px 0; font-size: 0.88rem; color: var(--muted); }
.scene-admin-controls select,
.share select {
  margin-left: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #000;
  color: var(--fg);
  font: inherit;
}
.scene-admin-controls .btn { padding: 8px 14px; font-size: 0.75rem; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { accent-color: var(--accent); }
.share { border-top: 1px solid var(--line); padding-top: 12px; }
.share-title { margin: 0 0 8px; font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 6px 0; font-size: 0.88rem; }
.share-row > span { min-width: 140px; color: var(--fg); }
.share-row .btn { padding: 6px 12px; font-size: 0.72rem; }
.share-add { margin-top: 8px; }
.share-add select { margin-left: 0; }
.scene-admin .auth-msg { width: auto; margin-top: 10px; }
/* Who can see a scene: one switch, then the choice that goes with its state. */
.scene-public { display: grid; gap: 10px; margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--line); font-size: 0.9rem; }
.scene-public [hidden] { display: none; }
.scene-public .check { color: var(--muted); }
.who-sees { margin: 0; color: var(--muted); font-size: 0.82rem; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 42px; height: 24px; border-radius: 999px; background: rgba(255, 255, 255, 0.22); transition: background 0.15s; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) { .scene-admin { grid-template-columns: 1fr; } }

/* ---------- Portal & homepage: scene cards ---------- */
.my-scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-top: 28px; }
.scene-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene-thumb.has-img { background: #050708; -webkit-mask-image: none; mask-image: none; }
.scene-card-wrap { display: grid; gap: 10px; align-content: start; }
.scene-download { justify-content: center; font-size: 0.78rem; }
.universe-status { margin-bottom: 8px; }
.universe-status p { margin: 0 0 8px; }
.connect-pc { margin-top: 14px; }
.connect-pc summary { cursor: pointer; color: var(--fg); font-size: 0.92rem; }
.connect-pc .setup-steps { margin: 12px 0; }
.connect-pc .btn { margin-bottom: 12px; }
.app code { padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); font-size: 0.85em; }
.btn.is-disabled { opacity: 0.4; pointer-events: none; }
#local-scenes select { padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line); background: #000; color: var(--fg); font: inherit; font-size: 0.85rem; }
#local-scenes .btn { padding: 8px 14px; font-size: 0.75rem; }
.terms-check { align-items: flex-start; font-size: 0.88rem; color: var(--muted); line-height: 1.45; }
.terms-check input { margin-top: 3px; }
.terms-check a { color: var(--fg); }

/* ---------- Invoices & books ---------- */
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table th.num { text-align: right; }
.pill-inv-draft { color: #b9c2c6; }
.pill-inv-sent { color: #ffd479; border-color: rgba(255, 212, 121, 0.35); }
.pill-inv-paid { color: var(--accent); border-color: rgba(241, 239, 244, 0.35); }
.pill-inv-void { color: #ff9b9b; border-color: rgba(255, 123, 123, 0.35); text-decoration: line-through; }

.sheet-wide { width: min(860px, calc(100vw - 24px)); }
.invoice-head { display: flex; align-items: center; gap: 14px; }
.invoice-head h2 { margin: 0; }
.inv-edit { display: grid; gap: 16px; margin: 0; padding: 0; border: 0; min-width: 0; }
.inv-edit:disabled input, .inv-edit:disabled textarea, .inv-edit:disabled select { opacity: 0.75; }
.items-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.items-table th { text-align: left; font-weight: 500; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding: 6px 6px 8px; }
.items-table td { padding: 4px 6px; vertical-align: middle; }
.items-table input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.5);
  color: var(--fg);
  font: 400 0.95rem/1.3 var(--font);
}
.items-table input.short { width: 96px; text-align: right; }
.items-table input:focus { outline: none; border-color: var(--accent); }
.icon-x {
  width: 30px; height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.icon-x:hover { color: #ff9b9b; border-color: rgba(255, 123, 123, 0.4); }
.inv-edit:disabled .icon-x { display: none; }

.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; margin: 4px 0 0 auto; min-width: 260px; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; }
.totals .grand { color: var(--fg); font-size: 1.1rem; font-weight: 500; border-top: 1px solid var(--line); padding-top: 6px; }

.pay-box { border-top: 1px solid var(--line); padding-top: 14px; }
.pay-box h3 { margin: 0 0 10px; font-weight: 400; font-size: 1.05rem; }
.pay-row { display: grid; grid-template-columns: 110px 1fr auto 34px; align-items: center; gap: 10px; padding: 4px 0; font-size: 0.9rem; }

.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; font-size: 0.88rem; }
.inline-form input, .inline-form select {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.5);
  color: var(--fg);
  font: 400 0.9rem/1.2 var(--font);
  min-width: 0;
}
.inline-form input[type="date"] { color-scheme: dark; }
.inline-form input:focus, .inline-form select:focus { outline: none; border-color: var(--accent); }
.inline-form .btn { padding: 9px 16px; font-size: 0.78rem; }
.file-pick { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.file-pick input { max-width: 190px; font-size: 0.78rem; }
.file-pick.small input { max-width: 150px; }

.year-pick { color: var(--muted); font-size: 0.85rem; }
.year-pick select { margin-left: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #000; color: var(--fg); font: inherit; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 20px 0; }
.stat { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); display: grid; gap: 4px; }
.stat span { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.stat strong { font-weight: 400; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.stat small { color: var(--dim); font-size: 0.75rem; line-height: 1.35; }

.books-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.mini-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 4px 0 8px; }
.mini-table td { padding: 5px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }

.books-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.books-tabs button { padding: 8px 14px; border-radius: 999px; border: 0; background: none; color: var(--muted); font: 500 0.82rem/1 var(--font); cursor: pointer; }
.books-tabs button:hover { color: var(--fg); }
.books-tabs button.active { background: rgba(255, 255, 255, 0.08); color: var(--fg); }
[data-bpanel][hidden] { display: none; }
.log-detail { max-width: 420px; overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; font-size: 0.72rem; }
@media (max-width: 760px) {
  .books-cols { grid-template-columns: 1fr; }
  .pay-row { grid-template-columns: 1fr auto 34px; }
  .pay-row span:nth-child(2) { display: none; }
}
.mini-table th + th, .mini-table td + td { padding-left: 16px; }

/* ---------- Logo in headers ---------- */
.auth-brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.auth-wrap .auth-brand { flex-direction: column; gap: 12px; }
.auth-wrap .brand-mark { width: 56px; height: 56px; }
.terms-check[hidden] { display: none; }
.forgot-link { margin: 16px 0 0; font-size: 0.85rem; text-align: center; }
.forgot-link a { color: var(--muted); }
.forgot-link a:hover { color: var(--fg); }
html { -webkit-tap-highlight-color: transparent; }

/* Square-footage pricing (invoice editor) */
.sqft-calc { border: 1px solid rgba(241, 239, 244, 0.25); border-radius: 14px; padding: 12px 16px; background: rgba(241, 239, 244, 0.04); }
.sqft-calc[hidden] { display: none; }
.sqft-calc summary { cursor: pointer; font-size: 0.9rem; color: var(--fg); }
.sqft-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.sqft-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 0.92rem; color: #ffffff; font-variant-numeric: tabular-nums; }
.sqft-result .btn { padding: 9px 16px; font-size: 0.78rem; }
@media (max-width: 760px) { .sqft-grid { grid-template-columns: 1fr 1fr; } }
.pay-link { margin-left: 8px; color: var(--accent); font-size: 0.85rem; }

/* Portal: your account (password, two-step verification). */
.account-section { margin-top: 36px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; align-items: start; }
.account-card { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line, rgba(255, 255, 255, 0.12)); border-radius: 14px; background: rgba(255, 255, 255, 0.03); }
.account-card h4 { margin: 0; font-size: 1.05rem; font-weight: 500; }
.account-card .muted { margin: 0; }
.account-card .qr { max-width: 200px; }
.account-card .btn { justify-self: start; }
.small { font-size: 0.85rem; }

/* Sign-up: a field people don't see (a trap for form-filling robots). */
.field.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Admin Overview: storage, visits, scenes, accounts ---- */
.ov-h { margin: 40px 0 12px; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.ov-h:first-child { margin-top: 8px; }
.ov-sub { margin: 0 0 12px; font-size: 0.82rem; font-weight: 500; color: var(--fg); }
.ov-foot { margin-top: 28px; font-size: 0.82rem; }

.ov-watch { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ov-watch li { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 12px; background: var(--glass); font-size: 0.9rem; }
.ov-watch li span { color: var(--muted); font-size: 0.84rem; }
.ov-watch b { font-weight: 500; }
.ov-watch .ov-bad { border-left-color: #ff7b7b; }
.ov-watch .ov-warn { border-left-color: #ffb36b; }
.ov-watch .ov-info { border-left-color: var(--dim); }
.ov-watch .ov-ok { border-left-color: var(--accent); }

.ov-meter { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.ov-meter i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.ov-meter-text { margin: 10px 0 0; color: var(--muted); font-size: 0.9rem; }
.ov-meter-text b { color: var(--fg); font-weight: 500; }

.ov-chart-card { display: grid; gap: 6px; margin-bottom: 16px; }
.ov-chart + .ov-sub { margin-top: 18px; }
.ov-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--line); }
.ov-bar { position: relative; flex: 1; display: flex; align-items: flex-end; height: 100%; outline: none; }
.ov-bar i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--accent); }
.ov-bar:hover i, .ov-bar:focus-visible i { background: #ffffff; }
.ov-bar:hover::after, .ov-bar:focus-visible::after {
  content: attr(data-tip); position: absolute; z-index: 2; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: #0b0f11; color: var(--fg); font-size: 0.78rem; white-space: nowrap; pointer-events: none;
}
.ov-bar:first-child:hover::after, .ov-bar:first-child:focus-visible::after { left: 0; transform: none; }
.ov-bar:last-child:hover::after, .ov-bar:last-child:focus-visible::after { right: 0; left: auto; transform: none; }
.ov-axis { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; color: var(--muted); font-size: 0.75rem; }

.ov-cols { margin-bottom: 16px; }
.ov-share { width: 40%; padding-right: 12px !important; }
.ov-share i { display: block; height: 6px; border-radius: 999px; background: var(--accent); opacity: 0.75; }
.ov-dev { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 0.9rem; color: var(--muted); }
.ov-dev b { color: var(--fg); font-weight: 500; font-size: 1.15rem; margin-right: 4px; }

.ov-quota { width: 140px; height: 6px; margin-bottom: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.ov-quota i { display: block; height: 100%; background: var(--accent); }
.ov-quota.is-full i { background: #ffb36b; }

@media (max-width: 720px) {
  .ov-cols { grid-template-columns: 1fr; }
}

/* ---------- Admin: your PC's library (catalogue) and the folder upload ---------- */
.pc-library { margin-top: 20px; }
.pc-library-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pc-library-head .section-title { margin: 0; }
#pc-note { margin: 8px 0 0; }
#pc-note a { color: var(--fg); }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 16px; }
.pc-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(255, 255, 255, 0.02); }
.pc-thumb { aspect-ratio: 16 / 9; background: #050708; display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pc-body h4 { margin: 0; font-weight: 500; font-size: 1rem; color: var(--fg); }
.pc-body p { margin: 0; }
.pc-badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 500; color: #0b0f10; background: #f1eff4; vertical-align: middle; }
.pc-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.pc-controls select { flex: 1 1 120px; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #000; color: var(--fg); font: inherit; font-size: 0.85rem; }
.pc-controls .btn { padding: 8px 16px; }
.folder-fallback { margin-top: 18px; }
.folder-fallback summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.folder-fallback > p.muted { margin: 10px 0 0; }
.add-folder-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.add-folder-row label.btn { cursor: pointer; }
.add-folder-row input, .add-folder-row select {
  padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: #000; color: var(--fg); font: inherit; font-size: 0.9rem;
}
.add-folder-row #folder-name { flex: 1 1 220px; min-width: 0; }
.add-folder-row [hidden], .add-folder-row[hidden] { display: none; }

/* A small button inside a table row (Admin > Clients > View as). */
.btn.btn-small { padding: 5px 12px; font-size: 12px; white-space: nowrap; }

/* Portal: the way to a new project. */
.portal-next { margin-top: 36px; }
.portal-next .muted { max-width: 60ch; }

/* ---------- Display toggles (js/prefs.js): the top right, as on the home page ---------- */
.prefs-page { position: fixed; z-index: 20; animation: none; }
.prefs-page.in-bar { position: static; margin-left: 4px; }
@media (max-width: 560px) { .prefs-page.in-bar { margin-left: 0; } }

/* ---------- Day ---------- */
html[data-theme="light"] body.app { background: radial-gradient(80% 50% at 50% 0%, rgba(29, 28, 33, 0.08), transparent 70%), var(--bg); }
html[data-theme="light"] .app-bar { background: rgba(238, 242, 241, 0.88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
html[data-theme="light"] .auth-card,
html[data-theme="light"] .scene-admin { background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.5)); }
html[data-theme="light"] .auth-msg { color: #a12626; background: rgba(212, 60, 60, 0.07); border-color: rgba(212, 60, 60, 0.35); }
html[data-theme="light"] .auth-msg.good,
html[data-theme="light"] .invite-box p,
html[data-theme="light"] .sqft-result { color: #141317; }
html[data-theme="light"] .auth-msg.good { background: rgba(29, 28, 33, 0.08); border-color: rgba(29, 28, 33, 0.4); }
html[data-theme="light"] .setup-steps,
html[data-theme="light"] .prose ul,
html[data-theme="light"] .pill-inv-draft { color: #3e4a50; }
html[data-theme="light"] .manual code,
html[data-theme="light"] .app code { background: rgba(20, 19, 24, 0.06); }
html[data-theme="light"] .empty { border-color: rgba(20, 19, 24, 0.18); }
html[data-theme="light"] .app-tabs a.active,
html[data-theme="light"] .books-tabs button.active { background: rgba(20, 19, 24, 0.07); }
html[data-theme="light"] .data-table td,
html[data-theme="light"] .mini-table td { border-color: rgba(20, 19, 24, 0.08); }
html[data-theme="light"] .data-table tbody tr[data-id]:focus-visible { background: rgba(20, 19, 24, 0.04); }
html[data-theme="light"] .warn,
html[data-theme="light"] .pill-invited,
html[data-theme="light"] .pill-inv-sent { color: #a35a00; }
html[data-theme="light"] .pill-disabled,
html[data-theme="light"] .pill-inv-void { color: #b52f2f; }
html[data-theme="light"] .sheet { background: #fbfcfc; }
html[data-theme="light"] .sheet::backdrop { background: rgba(20, 19, 24, 0.35); }
html[data-theme="light"] :is(.copy-row input, .share select, .items-table input, .inline-form input, .inline-form select,
  #local-scenes select, .year-pick select, .pc-controls select, .add-folder-row input, .add-folder-row select) { background: rgba(255, 255, 255, 0.8); }
html[data-theme="light"] :is(.scene-admin-thumb, .scene-thumb.has-img, .pc-thumb) { background: #dfe5e4; }
html[data-theme="light"] .switch-track { background: rgba(20, 19, 24, 0.2); }
html[data-theme="light"] :is(.stat, .account-card, .pc-card) { background: rgba(255, 255, 255, 0.6); }
html[data-theme="light"] :is(.ov-meter, .ov-quota) { background: rgba(20, 19, 24, 0.08); }
html[data-theme="light"] .ov-bar:is(:hover, :focus-visible)::after { background: #fff; }
html[data-theme="light"] .ov-bar:is(:hover, :focus-visible) i { background: #141317; }
html[data-theme="light"] .icon-x:hover { color: #b52f2f; }

/* ---------- Profile: projects & quotes (js/portal.js) ---------- */
.projects { margin: 8px 0 44px; }
.project-form { margin: 16px 0; }
.project-form[hidden] { display: none; }
.project-form h4 { margin: 0; font-weight: 400; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.project-grid .full { grid-column: 1 / -1; }
.project-form .cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.project-list { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.project-item { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.025); }
.project-item.is-new { border-color: rgba(241, 239, 244, 0.45); }
.project-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-item .muted { margin: 4px 0 0; }
.project-msg { margin: 10px 0 0; white-space: pre-line; font-size: 0.95rem; }
.project-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(241, 239, 244, 0.07); font-size: 0.92rem; }
.project-thanks { margin: 10px 0 0; color: var(--accent); font-size: 0.9rem; }
.pill-project-new { color: var(--muted); }
.pill-project-quoted, .pill-project-scheduled, .pill-project-in_progress { color: var(--accent); border-color: rgba(241, 239, 244, 0.4); }
.pill-project-closed { color: var(--dim); }
@media (max-width: 640px) { .project-grid { grid-template-columns: 1fr; } }
html[data-theme="light"] .project-item { background: rgba(255, 255, 255, 0.6); }
html[data-theme="light"] .project-note { background: rgba(29, 28, 33, 0.08); }

/* ---------- Admin: requests ---------- */
.tab-count { display: inline-block; min-width: 18px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: #0b0a0d; font-size: 0.7rem; font-weight: 600; text-align: center; }
.tab-count[hidden] { display: none; }
.request-list { display: grid; gap: 14px; margin-top: 18px; }
.request-item .muted { margin: 0; }
.request-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-size: 0.9rem; }
.request-facts b { font-weight: 500; color: var(--muted); }
.request-edit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; font-size: 0.85rem; color: var(--muted); }
.request-edit label { display: grid; gap: 4px; }
.request-edit .request-note { flex: 1 1 260px; }
.request-edit :is(select, input) { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.5); color: var(--fg); font: inherit; }
html[data-theme="light"] .request-edit :is(select, input) { background: rgba(255, 255, 255, 0.8); }

/* (A hidden button stays hidden; long names wrap rather than stretch the page.) */
.btn[hidden] { display: none; }
#hello { overflow-wrap: anywhere; }
.app-bar #who { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* In a bar that also has tabs (Admin): the toggles as icons only, and buttons on one line. */
.app-bar:has(.app-tabs) .prefs-page .pref-label { display: none; }
.app-bar:has(.app-tabs) .prefs-page .pref { padding: 7px; gap: 7px; }
.app-bar .btn { white-space: nowrap; }
.app-tabs { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
