
:root {
  font-family: "SF Pro Display", "SF Pro Text", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  color: #effaff;
  background: #071019;
  font-synthesis: none;
  --text: #effaff;
  --muted: rgba(239,250,255,.68);
  --soft: rgba(239,250,255,.48);
  --line: rgba(255,255,255,.14);
  --accent: #8af4d0;
  --accent-2: #5fcaff;
  --danger: #ff9c9c;
  --shadow: 0 24px 80px rgba(0,0,0,.34);
}
* { box-sizing: border-box; }
html, body { width: 100%; min-width: 0; min-height: 100%; margin: 0; overflow-x: hidden; }
body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1100px 760px at 14% 18%, rgba(118,221,255,.20), transparent 42%),
    radial-gradient(980px 640px at 82% 16%, rgba(138,244,208,.20), transparent 38%),
    radial-gradient(820px 700px at 84% 86%, rgba(35,145,255,.16), transparent 40%),
    radial-gradient(840px 580px at 10% 84%, rgba(16,162,143,.18), transparent 44%),
    linear-gradient(145deg, #071019 0%, #0a1f29 16%, #0f3240 36%, #0f5d62 58%, #0f3744 77%, #08121a 100%);
  background-attachment: fixed;
}
body::before, body::after { content: ""; position: fixed; inset: -10%; pointer-events: none; z-index: -1; }
body::before { background: linear-gradient(120deg,transparent 8%,rgba(255,255,255,.08) 20%,transparent 34%,rgba(255,255,255,.06) 53%,transparent 70%),conic-gradient(from 140deg at 30% 35%,rgba(255,255,255,.10),transparent 14%,rgba(255,255,255,.14) 26%,transparent 40%,rgba(255,255,255,.08) 58%,transparent 76%); mix-blend-mode: screen; opacity:.58; filter:blur(52px); transform:scale(1.08) rotate(-6deg); }
body::after { background:radial-gradient(40% 40% at 22% 24%,rgba(255,255,255,.16),transparent 62%),radial-gradient(36% 32% at 74% 54%,rgba(255,255,255,.11),transparent 64%); filter:blur(90px); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(138,244,208,.72); outline-offset: 3px; }
button:disabled { opacity:.58; cursor:not-allowed; }
.is-hidden { display:none !important; }

.loading-shell, .login-shell { min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:40px 22px; }
.loading-card { display:grid; justify-items:center; gap:20px; padding:30px; }
.loading-card h1 { margin:0; font-size:clamp(26px,5vw,38px); }
.loading-logo { width:min(170px,52vw); height:auto; filter:drop-shadow(0 14px 30px rgba(0,0,0,.25)); }
.spinner { width:30px; height:30px; border:3px solid rgba(255,255,255,.20); border-top-color:#8af4d0; border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

.login-logo { margin-bottom:30px; }
.login-logo-image { display:block; width:min(240px,62vw); height:auto; filter:drop-shadow(0 18px 34px rgba(0,0,0,.28)); }
.login-card { width:min(1040px,100%); padding:26px; border-radius:32px; background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,.04)),linear-gradient(135deg,rgba(8,18,28,.74),rgba(13,37,46,.62)); border:1px solid rgba(255,255,255,.16); box-shadow:var(--shadow); backdrop-filter:blur(24px) saturate(145%); }
.login-panel { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,.82fr); gap:18px; }
.login-fields { display:grid; gap:14px; min-width:0; }
.floating-field { position:relative; height:64px; border:1px solid var(--line); border-radius:20px; background:rgba(4,10,16,.34); overflow:hidden; transition:.2s ease; }
.floating-field:focus-within { border-color:rgba(138,244,208,.44); box-shadow:0 0 0 5px rgba(138,244,208,.08); transform:translateY(-1px); }
.floating-field label { position:absolute; left:20px; top:10px; color:rgba(255,255,255,.54); font-size:12px; letter-spacing:.12em; text-transform:uppercase; pointer-events:none; }
.floating-field input { width:100%; height:100%; border:0; outline:0; background:transparent; color:#fff; padding:28px 20px 9px; font-size:18px; font-weight:500; }
.login-submit { min-height:142px; border:1px solid rgba(255,255,255,.14); border-radius:26px; background:linear-gradient(155deg,rgba(138,244,208,.94),rgba(95,202,255,.92)); color:#04222d; font-size:clamp(22px,2.5vw,29px); font-weight:750; box-shadow:inset 0 1px 0 rgba(255,255,255,.55),0 18px 42px rgba(5,32,42,.24); }
.login-submit:hover { transform:translateY(-2px); }
.login-error { min-height:22px; margin:14px 4px 0; color:#ffd0d0; }

.profile-shell { position:relative; min-height:100vh; padding:18px 24px 28px; display:flex; flex-direction:column; }
.profile-brand { display:grid; justify-items:center; margin-bottom:-20px; flex:0 0 auto; }
.profile-logo-image { display:block; width:min(152px,34vw); height:auto; filter:drop-shadow(0 12px 24px rgba(0,0,0,.24)); }
.profile-layout { width:min(1280px,100%); margin:0 auto; display:grid; grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr); gap:26px; align-items:center; flex:1; min-height:0; transform:translateY(-1cm); }
.avatar-column { min-width:0; display:grid; justify-items:center; align-content:center; padding:16px; }
.avatar-drop { width:min(68vh,680px,100%); aspect-ratio:1; border:0; border-radius:999px; padding:0; background:transparent; position:relative; overflow:hidden; box-shadow:0 26px 80px rgba(0,0,0,.20); transition:.2s ease; }
.avatar-drop.is-dragover { transform:scale(1.012); box-shadow:0 0 0 6px rgba(138,244,208,.14),0 26px 80px rgba(0,0,0,.20); }
.profile-avatar, .avatar-fallback { width:100%; height:100%; border-radius:999px; object-fit:cover; display:grid; place-items:center; }
.avatar-fallback { background:linear-gradient(160deg,var(--avatar-color),rgba(255,255,255,.12)); color:#fff; font-size:clamp(94px,14vw,170px); font-weight:750; }
.avatar-hint { margin:20px auto 0; max-width:560px; text-align:center; color:rgba(255,255,255,.82); font-size:17px; line-height:1.45; }
.text-action { border:0; background:transparent; color:rgba(255,255,255,.76); padding:6px 8px; text-decoration:none; }
.text-action:hover { color:#fff; }
#delete-avatar { margin-top:7px; color:rgba(255,190,190,.84); }
.inline-error, .field-error, .global-error { min-height:20px; color:var(--danger); margin:6px 0 0; font-size:14px; }
.global-error { position:fixed; bottom:16px; left:50%; transform:translateX(-50%); }
.profile-form .field-error:empty { display:none; }
.profile-panel { min-width:0; min-height:0; align-self:center; padding:24px; border-radius:34px; border:1px solid rgba(255,255,255,.14); background:linear-gradient(180deg,rgba(255,255,255,.11),rgba(255,255,255,.05)),linear-gradient(135deg,rgba(9,17,24,.78),rgba(10,26,36,.62)); box-shadow:var(--shadow); backdrop-filter:blur(24px) saturate(145%); display:flex; flex-direction:column; }
.profile-panel h1 { margin:4px 0 18px; text-align:center; font-size:clamp(34px,4vw,48px); line-height:1.04; }
.profile-form { display:grid; gap:8px; }
.profile-form label { text-align:center; }
.profile-form label, .modal-form label { color:rgba(255,255,255,.64); font-size:13px; font-weight:650; letter-spacing:.10em; text-transform:uppercase; margin-top:8px; }
.profile-field, .modal-field { min-height:60px; display:flex; align-items:center; padding:10px 18px; border-radius:18px; border:1px solid var(--line); background:rgba(4,10,16,.30); }
.profile-field:focus-within, .modal-field:focus-within { border-color:rgba(138,244,208,.40); box-shadow:0 0 0 5px rgba(138,244,208,.08); transform:translateY(-1px); }
.profile-field input, .profile-field textarea, .modal-field input { width:100%; min-width:0; border:0; outline:0; background:transparent; color:#fff; resize:none; }
.profile-field input { font-size:22px; font-weight:620; }
.profile-field textarea { min-height:92px; line-height:1.5; padding-top:5px; font-size:16px; }
.autosave-status { min-height:20px; text-align:center; color:var(--soft); font-size:14px; }
.autosave-status strong { color:#fff; }
.autosave-status.is-error strong { color:var(--danger); }
.profile-footer { margin-top:18px; padding-top:0; display:grid; gap:15px; }
.continue-button, .primary-button { min-height:58px; border:0; border-radius:19px; color:#04222d; background:linear-gradient(155deg,rgba(138,244,208,.94),rgba(95,202,255,.92)); font-size:18px; font-weight:750; box-shadow:inset 0 1px 0 rgba(255,255,255,.55),0 20px 44px rgba(4,34,45,.24); }
.profile-links { display:flex; justify-content:center; gap:22px; flex-wrap:wrap; }

.modal { position:fixed; inset:0; z-index:60; display:none; place-items:center; padding:22px; background:rgba(4,9,15,.58); backdrop-filter:blur(12px); }
.modal.is-open { display:grid; }
.modal-card { width:min(620px,100%); max-height:calc(100vh - 44px); overflow:auto; padding:22px; border-radius:30px; background:linear-gradient(180deg,rgba(255,255,255,.11),rgba(255,255,255,.05)),linear-gradient(135deg,rgba(8,18,28,.92),rgba(10,26,36,.84)); border:1px solid rgba(255,255,255,.14); box-shadow:var(--shadow); }
.modal-header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:18px; }
.modal-header h2 { margin:0; font-size:28px; }
.icon-button { width:44px; height:44px; border-radius:14px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.07); color:#fff; font-size:27px; line-height:1; }
.crop-modal-card { width:min(720px,100%); display:grid; gap:18px; }
.cropper { position:relative; width:min(72vh,560px,100%); aspect-ratio:1; margin:auto; overflow:hidden; border-radius:28px; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.10); cursor:grab; touch-action:none; user-select:none; }
.cropper:active { cursor:grabbing; }
.cropper img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transform-origin:center; pointer-events:none; }
.cropper::before { content:""; position:absolute; z-index:2; width:78%; aspect-ratio:1; left:50%; top:50%; transform:translate(-50%,-50%); border-radius:999px; background:transparent; box-shadow:0 0 0 9999px rgba(0,0,0,.74); pointer-events:none; }
.cropper::after { content:""; position:absolute; z-index:3; width:78%; aspect-ratio:1; left:50%; top:50%; transform:translate(-50%,-50%); border-radius:999px; border:2px solid rgba(255,255,255,.84); pointer-events:none; }
.crop-save { width:min(300px,100%); justify-self:center; }
.modal-form { display:grid; gap:7px; }
.checkbox-row { display:flex; align-items:center; gap:10px; text-transform:none !important; letter-spacing:0 !important; font-size:15px !important; }
.checkbox-row input { width:auto; accent-color:#8af4d0; }
.secondary-button { min-height:44px; padding:0 15px; border-radius:15px; border:1px solid rgba(255,255,255,.15); background:rgba(255,255,255,.07); color:#fff; font-weight:650; }
.sessions-list { display:grid; gap:10px; }
.session-row { display:flex; justify-content:space-between; align-items:center; gap:15px; padding:15px; border:1px solid rgba(255,255,255,.11); border-radius:18px; background:rgba(255,255,255,.045); }
.session-title { display:flex; align-items:center; gap:10px; font-weight:650; }
.session-row p { margin:5px 0 0; color:var(--soft); font-size:13px; }
.current-session { padding:3px 8px; border-radius:999px; background:rgba(138,244,208,.14); color:#aaf8dc; font-size:12px; }
.empty-state { color:var(--muted); }
.toast { position:fixed; left:50%; bottom:26px; transform:translate(-50%,20px); min-width:260px; max-width:calc(100vw - 24px); padding:14px 18px; border-radius:18px; background:rgba(7,16,24,.90); border:1px solid rgba(255,255,255,.12); color:#fff; text-align:center; opacity:0; pointer-events:none; transition:.22s ease; z-index:80; backdrop-filter:blur(18px); }
.toast.is-visible { opacity:1; transform:translate(-50%,0); }
body.modal-open { overflow:hidden; }

@media (max-width: 900px) {
  body { overflow-y:auto; }
  .login-shell { justify-content:flex-start; padding-top:28px; }
  .login-card { padding:18px; border-radius:26px; }
  .login-panel { grid-template-columns:1fr; }
  .login-submit { min-height:64px; }
  .profile-shell { padding:14px 14px 28px; }
  .profile-brand { margin-bottom:6px; }
  .profile-logo-image { width:min(132px,34vw); }
  .profile-layout { grid-template-columns:1fr; align-items:start; transform:none; padding-top:24px; }
  .avatar-column { padding:16px 0 4px; }
  .avatar-drop { width:min(84vw,520px); }
  .profile-panel { min-height:auto; width:100%; padding:18px; }
}
@media (max-width: 600px) {
  .login-shell { padding-inline:14px; }
  .login-logo { margin-bottom:20px; }
  .profile-layout { gap:16px; padding-top:28px; }
  .avatar-drop { width:min(86vw,420px); }
  .avatar-hint { font-size:15px; padding-inline:8px; }
  .profile-panel h1 { font-size:36px; }
  .modal { padding:12px; }
  .modal-card { padding:17px; border-radius:24px; max-height:calc(100vh - 24px); }
  .cropper { min-height:0; }
  .session-row { align-items:stretch; flex-direction:column; }
  .session-row .secondary-button { width:100%; }
}

/* WNT-045: approved account-lifecycle master-detail surface. */
.forced-password-card { width:min(640px,100%); }
.forced-password-heading { margin-bottom:18px; }
.forced-password-heading h1 { margin:4px 0 10px; font-size:clamp(30px,5vw,42px); }
.forced-password-heading > p:last-child { margin:0; color:var(--muted); line-height:1.55; }
/* A class that sets display outranks the browser's own [hidden] rule, so an
   element marked hidden stays on screen. Both panels below are laid out with
   grid, so they say it explicitly. */
.modal-form[hidden], .invite-panel[hidden], .requests-panel[hidden] { display:none; }
.requests-panel { margin:0 0 16px; padding:14px 16px; border:1px solid rgba(138,244,208,.28); border-radius:18px; background:rgba(138,244,208,.06); }
.requests-title { margin:0 0 10px; font-size:15px; display:flex; align-items:center; gap:8px; }
.requests-count { display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 6px; border-radius:11px; background:var(--accent); color:#04262a; font-size:12px; font-weight:800; }
.requests-list { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.request-row { display:grid; grid-template-columns:minmax(120px,1fr) auto auto; gap:12px; align-items:center; }
.request-login { font-weight:700; overflow:hidden; text-overflow:ellipsis; }
.request-when { color:var(--muted); font-size:13px; }
.request-actions { display:flex; gap:8px; }
.request-actions button { min-height:38px; padding:0 14px; font-size:14px; }
@media (max-width:640px) { .request-row { grid-template-columns:1fr; gap:6px; } .request-actions { justify-content:flex-end; } }
.create-user-modes { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:16px; }
.mode-button { min-height:44px; border-radius:14px; border:1px solid var(--line); background:rgba(4,10,16,.32); color:var(--muted); font-size:14px; font-weight:700; cursor:pointer; }
.mode-button.is-current { border-color:rgba(138,244,208,.45); background:rgba(138,244,208,.10); color:#fff; }
.invite-panel { display:grid; gap:12px; }
.invite-note { margin:0; color:var(--muted); font-size:13px; line-height:1.5; }
.invite-panel input { font-size:14px; }
.join-message { margin-bottom:18px; }
.join-message h1 { margin:4px 0 12px; font-size:clamp(28px,4.6vw,40px); }
.join-message p { margin:0 0 12px; color:var(--muted); line-height:1.6; }
.join-message p:last-child { margin-bottom:0; }
.join-message .join-from { color:#fff; line-height:1.4; }
.join-message .join-role { color:var(--muted); font-size:14px; }
.join-message a { color:var(--accent); }
.forced-password-actions { display:grid; grid-template-columns:minmax(130px,.55fr) minmax(220px,1fr); gap:10px; margin-top:8px; }
.forced-password-actions .primary-button { min-height:52px; }
.modal-eyebrow { margin:0 0 5px; color:var(--accent); font-size:11px; font-weight:750; letter-spacing:.12em; text-transform:uppercase; }
.user-admin-card { position:relative; width:min(1280px,100%); height:min(820px,calc(100vh - 44px)); overflow:hidden; display:flex; flex-direction:column; }
.user-admin-toolbar { display:grid; grid-template-columns:minmax(240px,1fr) auto; gap:14px; align-items:end; margin-bottom:16px; }
.user-search { display:grid; gap:7px; color:var(--muted); font-size:12px; font-weight:700; letter-spacing:.09em; text-transform:uppercase; }
.user-search input { width:100%; min-height:52px; border:1px solid var(--line); border-radius:17px; outline:0; background:rgba(4,10,16,.32); color:#fff; padding:0 15px; font-size:16px; text-transform:none; letter-spacing:0; }
.user-search input:focus { border-color:rgba(138,244,208,.40); box-shadow:0 0 0 5px rgba(138,244,208,.08); }
.compact-primary { min-height:52px; padding:0 20px; white-space:nowrap; }
.user-admin-layout { min-height:0; flex:1; display:grid; grid-template-columns:minmax(410px,.9fr) minmax(430px,1.1fr); gap:16px; }
.user-admin-master { min-width:0; min-height:0; display:flex; flex-direction:column; }
.user-table-wrap { min-height:260px; flex:1; overflow:auto; border:1px solid rgba(255,255,255,.11); border-radius:20px; background:rgba(3,10,16,.28); }
.user-table { width:100%; border-collapse:collapse; min-width:410px; }
.user-table th { position:sticky; top:0; z-index:1; height:46px; padding:0 16px; text-align:left; background:rgba(11,24,34,.98); color:rgba(255,255,255,.52); font-size:11px; letter-spacing:.10em; text-transform:uppercase; }
.user-table td { height:70px; padding:8px 14px; border-top:1px solid rgba(255,255,255,.075); color:var(--soft); transition:.18s ease; }
.user-row:hover td { background:rgba(255,255,255,.035); }
.user-row.is-selected td { background:rgba(138,244,208,.075); border-top-color:rgba(138,244,208,.16); }
.user-select { width:100%; min-width:0; display:grid; gap:3px; padding:5px 2px; border:0; background:transparent; color:inherit; text-align:left; }
.user-select strong { min-width:0; overflow:hidden; text-overflow:ellipsis; color:#fff; font-size:14px; }
.user-select span { min-width:0; overflow:hidden; text-overflow:ellipsis; color:var(--soft); font-size:12px; }
.role-badge { display:inline-flex; align-items:center; min-height:26px; padding:0 9px; border-radius:999px; border:1px solid rgba(255,255,255,.11); background:rgba(255,255,255,.06); font-size:12px; }
.role-badge.is-admin { border-color:rgba(103,207,255,.22); background:rgba(103,207,255,.10); color:#c5efff; }
.status-badge { display:inline-flex; align-items:center; min-height:26px; padding:0 9px; border-radius:999px; border:1px solid rgba(255,255,255,.10); font-size:12px; white-space:nowrap; }
.status-badge.is-enabled { border-color:rgba(138,244,208,.18); background:rgba(138,244,208,.09); color:#b5f8e2; }
.status-badge.is-disabled { border-color:rgba(255,156,156,.18); background:rgba(255,156,156,.08); color:#ffc1c1; }
.status-badge.is-warning { border-color:rgba(255,195,100,.22); background:rgba(255,195,100,.10); color:#ffdca7; }
.table-loading, .user-empty { padding:34px 16px !important; text-align:center; color:var(--muted) !important; }
.user-detail { min-width:0; min-height:0; overflow:auto; border:1px solid rgba(255,255,255,.11); border-radius:22px; background:linear-gradient(165deg,rgba(255,255,255,.065),rgba(3,10,16,.34)); }
.user-detail-empty { min-height:100%; display:grid; place-content:center; gap:6px; padding:30px; text-align:center; color:var(--soft); }
.user-detail-empty p { margin:0; color:var(--muted); font-size:20px; font-weight:700; }
.user-detail-content { display:grid; gap:14px; padding:20px; }
.user-detail-back { display:none; width:max-content; border:0; background:transparent; color:var(--accent); padding:4px 0; font-weight:700; }
.user-detail-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.user-detail-header h3 { margin:2px 0 5px; font-size:clamp(25px,3vw,34px); line-height:1.05; overflow-wrap:anywhere; }
.user-detail-header p { margin:0; color:var(--soft); overflow-wrap:anywhere; }
.user-detail-badges { display:flex; justify-content:flex-end; gap:6px; flex-wrap:wrap; }
.user-detail-summary { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:0; }
.user-detail-summary div { padding:12px 14px; border:1px solid rgba(255,255,255,.08); border-radius:15px; background:rgba(3,10,16,.24); }
.user-detail-summary dt { color:var(--soft); font-size:11px; letter-spacing:.08em; text-transform:uppercase; }
.user-detail-summary dd { margin:5px 0 0; color:#fff; font-weight:700; }
.user-detail-section { display:grid; gap:11px; padding:16px; border:1px solid rgba(255,255,255,.09); border-radius:19px; background:rgba(3,10,16,.22); }
.detail-section-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.detail-section-heading h4 { margin:0; font-size:18px; }
.detail-section-heading p, .detail-action-row p { margin:4px 0 0; color:var(--soft); font-size:13px; line-height:1.4; }
.detail-action-row { display:flex; justify-content:space-between; align-items:center; gap:16px; padding-top:11px; border-top:1px solid rgba(255,255,255,.07); }
.detail-action-row strong { color:#fff; }
.detail-action-row .secondary-button { flex:0 0 auto; }
.danger-button { border-color:rgba(255,156,156,.22); background:rgba(255,156,156,.08); color:#ffd0d0; }
.admin-sessions-list { display:grid; gap:8px; }
.admin-session-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px; border:1px solid rgba(255,255,255,.08); border-radius:15px; background:rgba(255,255,255,.035); }
.admin-session-row strong { display:block; color:#fff; }
.admin-session-row p, .admin-session-row span { margin:3px 0 0; color:var(--soft); font-size:12px; line-height:1.4; }
.admin-session-row .session-current { margin:0; color:#bdeecf; font-weight:700; }
.account-delete-section { justify-items:stretch; border-color:rgba(255,156,156,.14); }
.account-delete-section .danger-button { width:100%; }
.admin-confirmation { position:sticky; bottom:0; z-index:3; display:grid; gap:12px; padding:15px; border:1px solid rgba(255,156,156,.30); border-radius:17px; background:rgba(31,19,24,.96); box-shadow:0 14px 38px rgba(0,0,0,.30); }
.admin-confirmation[hidden] { display:none; }
.admin-confirmation p { margin:0; color:#ffe1e1; line-height:1.45; }
.admin-confirmation > div { display:flex; justify-content:flex-end; gap:8px; }
.user-detail.is-busy { cursor:progress; }
.create-user-modal { z-index:70; background:rgba(3,8,13,.70); }
.create-user-card { width:min(560px,100%); }
.form-note { margin:9px 0 2px; color:var(--muted); font-size:13px; line-height:1.5; }
.create-user-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:8px; }
#management-link-slot { display:contents; }

@media (max-width: 800px) {
  .user-admin-card { width:100%; height:calc(100vh - 24px); max-height:calc(100vh - 24px); border-radius:24px; }
  .user-admin-toolbar { grid-template-columns:1fr; }
  .compact-primary { width:100%; }
  .user-admin-layout { display:block; flex:1; min-height:0; }
  .user-admin-master { height:100%; }
  .user-table-wrap { flex:1; max-height:none; }
  .user-detail { position:absolute; inset:0; z-index:5; display:none; border:0; border-radius:inherit; background:linear-gradient(155deg,#0b1d28,#0a252d 60%,#08141d); }
  .user-detail.is-mobile-open { display:block; }
  .user-detail-content { padding:18px; }
  .user-detail-back { display:block; }
}
@media (max-width: 470px) {
  .forced-password-actions { grid-template-columns:1fr; }
  .create-user-actions { grid-template-columns:1fr; }
  .user-table { min-width:0; }
  .user-table th:nth-child(2), .user-table td:nth-child(2) { display:none; }
  .user-table th, .user-table td { padding-inline:10px; }
  .user-detail-header, .detail-action-row, .admin-session-row { align-items:stretch; flex-direction:column; }
  .user-detail-badges { justify-content:flex-start; }
  .detail-action-row .secondary-button, .admin-session-row .secondary-button { width:100%; }
  .detail-section-heading { flex-direction:column; }
  #admin-revoke-all { width:100%; }
  .admin-confirmation > div { display:grid; grid-template-columns:1fr 1fr; }
}

/* WNT-047: routing and application shell. */
.app-shell { min-height:100vh; display:grid; grid-template-columns:232px minmax(0,1fr); align-items:stretch; }
.app-nav { position:sticky; top:0; align-self:start; z-index:40; height:100vh; display:flex; flex-direction:column; gap:22px; padding:18px 14px; border-right:1px solid var(--line); background:linear-gradient(180deg,rgba(255,255,255,.09),rgba(255,255,255,.03)),linear-gradient(150deg,rgba(8,18,28,.62),rgba(13,37,46,.48)); backdrop-filter:blur(22px) saturate(140%); }
.app-nav-head { display:flex; align-items:center; justify-content:center; flex:0 0 auto; min-height:44px; }
.app-nav-brand { min-width:0; display:grid; justify-items:center; }
.app-nav-logo { display:block; width:min(118px,100%); height:auto; filter:drop-shadow(0 12px 24px rgba(0,0,0,.24)); }
.app-nav-list { list-style:none; margin:0; padding:0; display:grid; gap:6px; align-content:start; }
.app-nav-item { display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:16px; border:1px solid transparent; color:var(--muted); font-size:16px; font-weight:600; text-decoration:none; transition:.18s ease; }
.app-nav-icon-wrap { flex:0 0 auto; display:grid; place-items:center; width:34px; height:34px; border-radius:12px; transition:.18s ease; }
.app-nav-icon { width:22px; height:22px; }
.app-nav-label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.app-nav-item:hover { color:var(--text); background:rgba(255,255,255,.07); }
.app-nav-item.is-current { color:#04222d; background:linear-gradient(155deg,rgba(138,244,208,.94),rgba(95,202,255,.92)); border-color:rgba(255,255,255,.18); box-shadow:inset 0 1px 0 rgba(255,255,255,.5); }
.app-section { min-width:0; min-height:100vh; outline:0; }
.app-section .profile-shell { min-height:100vh; }
.home-shell { min-height:100vh; display:grid; place-items:center; padding:24px; }
.home-card { width:min(680px,100%); padding:30px; border-radius:30px; text-align:center; background:linear-gradient(180deg,rgba(255,255,255,.11),rgba(255,255,255,.04)),linear-gradient(135deg,rgba(8,18,28,.70),rgba(13,37,46,.58)); border:1px solid rgba(255,255,255,.15); box-shadow:var(--shadow); backdrop-filter:blur(22px) saturate(145%); }
.home-card h1 { margin:0 0 10px; font-size:clamp(30px,4vw,42px); }
.home-card .empty-state { margin:0; font-size:18px; }
.user-admin-shell { min-height:100vh; padding:22px 24px 28px; display:flex; }
.app-section .user-admin-card { width:min(1280px,100%); height:auto; min-height:0; flex:1; margin:0 auto; padding:22px; border-radius:30px; background:linear-gradient(180deg,rgba(255,255,255,.11),rgba(255,255,255,.04)),linear-gradient(135deg,rgba(8,18,28,.70),rgba(13,37,46,.58)); border:1px solid rgba(255,255,255,.15); box-shadow:var(--shadow); backdrop-filter:blur(22px) saturate(145%); }
.user-admin-header { margin-bottom:18px; }
.user-admin-header h1 { margin:0; font-size:clamp(28px,3.4vw,38px); }
.user-select { grid-template-columns:auto minmax(0,1fr); align-items:center; gap:12px; }
.user-avatar { flex:0 0 auto; width:40px; height:40px; display:grid; place-items:center; border-radius:999px; background:linear-gradient(160deg,var(--avatar-color),rgba(255,255,255,.14)); color:#fff; font-size:17px; font-weight:750; line-height:1; }
.user-identity { min-width:0; display:grid; gap:3px; }

/* The rail collapses to icons on its own when the window is too narrow for labels. */
@media (min-width: 901px) and (max-width: 1199px) {
  .app-shell { grid-template-columns:78px minmax(0,1fr); }
  .app-nav { padding-inline:12px; }
  .app-nav-head { display:none; }
  .app-nav-label { display:none; }
  .app-nav-item { justify-content:center; padding:9px 0; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns:1fr; }
  .app-nav { position:fixed; top:auto; left:12px; right:12px; bottom:calc(12px + env(safe-area-inset-bottom)); height:auto; flex-direction:row; gap:0; padding:0; border:1px solid rgba(255,255,255,.16); border-radius:26px; box-shadow:0 18px 46px rgba(0,0,0,.42); overflow:hidden; }
  .app-nav-head { display:none; }
  .app-nav-list { flex:1; grid-auto-flow:column; grid-auto-columns:1fr; gap:0; padding:8px 6px 7px; }
  .app-nav-item { flex-direction:column; justify-content:center; gap:4px; padding:0; border:0; border-radius:0; background:none; box-shadow:none; color:var(--soft); font-size:11px; font-weight:600; }
  .app-nav-item.is-current { background:none; border:0; box-shadow:none; color:var(--accent); }
  .app-nav-item:hover { background:none; }
  .app-nav-label { display:block; max-width:100%; }
  .app-nav-icon-wrap { width:58px; height:32px; border-radius:999px; }
  .app-nav-item.is-current .app-nav-icon-wrap { background:linear-gradient(155deg,rgba(138,244,208,.94),rgba(95,202,255,.92)); color:#04222d; box-shadow:inset 0 1px 0 rgba(255,255,255,.5); }
  .app-nav-item:active .app-nav-icon-wrap { transform:scale(.94); }
  .app-nav-icon { width:21px; height:21px; }
  .app-section { min-height:auto; padding-bottom:104px; }
  .app-section .profile-shell, .home-shell, .user-admin-shell { min-height:auto; }
  .user-admin-shell { padding:14px 14px 8px; }
  .app-section .user-admin-card { padding:16px; border-radius:24px; min-height:calc(100vh - 126px); backdrop-filter:none; }
  .user-detail.is-mobile-open { position:fixed; inset:0; z-index:50; border-radius:0; }
}

/* WNT-048: direct chat surface. */
.action-icon { flex:0 0 auto; width:18px; height:18px; }
.text-action { display:inline-flex; align-items:center; gap:8px; }
.chat-shell { height:100%; min-height:0; display:grid; grid-template-columns:minmax(280px,340px) minmax(0,1fr); align-items:stretch; overflow:hidden; }
body[data-section="home"] .app-shell { height:100vh; min-height:0; overflow:hidden; }
body[data-section="home"] .app-section { height:100vh; min-height:0; overflow:hidden; }
.chat-list-column { position:relative; min-width:0; min-height:0; display:flex; flex-direction:column; border-right:1px solid var(--line); background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.02)); }
.chat-list-head { flex:0 0 auto; min-width:0; padding:20px 20px 12px; }
.chat-list-head h1 { margin:0; font-size:clamp(24px,2.6vw,30px); }
.chat-list { flex:1; min-height:0; overflow:auto; padding:0 10px 96px; display:grid; gap:4px; align-content:start; }
.chat-list-empty { padding:22px 12px; margin:0; }
.chat-row { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:12px; width:100%; padding:10px 12px; border:1px solid transparent; border-radius:18px; background:transparent; color:inherit; text-align:left; transition:.16s ease; }
.chat-row:hover { background:rgba(255,255,255,.06); }
.chat-row.is-current { background:rgba(138,244,208,.10); border-color:rgba(138,244,208,.20); }
.chat-row-avatar { width:46px; height:46px; border-radius:999px; object-fit:cover; }
.chat-avatar-fallback { display:grid; place-items:center; background:linear-gradient(160deg,var(--avatar-color),rgba(255,255,255,.14)); color:#fff; font-weight:750; line-height:1; }
.chat-row-body { min-width:0; display:grid; gap:3px; }
.chat-row-top { min-width:0; display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.chat-row-top strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:15px; }
.chat-row-time { flex:0 0 auto; color:var(--soft); font-size:12px; }
.chat-row-bottom { min-width:0; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.chat-row-preview { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--soft); font-size:13px; }
.chat-row-unread { flex:0 0 auto; min-width:22px; height:22px; padding:0 7px; display:grid; place-items:center; border-radius:999px; background:linear-gradient(155deg,rgba(138,244,208,.94),rgba(95,202,255,.92)); color:#04222d; font-size:12px; font-weight:750; }
.chat-new { position:absolute; right:18px; bottom:18px; z-index:6; display:grid; justify-items:end; gap:10px; }
.chat-fab { width:60px; height:60px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.18); border-radius:22px; background:linear-gradient(155deg,rgba(138,244,208,.94),rgba(95,202,255,.92)); color:#04222d; box-shadow:inset 0 1px 0 rgba(255,255,255,.5),0 16px 34px rgba(4,34,45,.34); transition:.16s ease; }
.chat-fab:hover { transform:translateY(-2px); }
.chat-fab-icon { width:26px; height:26px; stroke-width:2.2; }
.chat-menu { display:grid; gap:4px; padding:6px; border:1px solid rgba(255,255,255,.14); border-radius:18px; background:rgba(9,20,29,.96); box-shadow:var(--shadow); backdrop-filter:blur(18px); }
.chat-menu[hidden] { display:none; }
.chat-menu-item { display:flex; align-items:center; gap:10px; width:100%; padding:10px 14px; border:0; border-radius:13px; background:transparent; color:var(--text); font-size:15px; font-weight:600; white-space:nowrap; }
.chat-menu-item:hover { background:rgba(255,255,255,.08); }
.chat-menu-icon { flex:0 0 auto; width:18px; height:18px; }
.chat-thread-column { position:relative; min-width:0; min-height:0; display:flex; flex-direction:column; }
.chat-thread-empty { flex:1; display:grid; place-items:center; padding:24px; }
.chat-thread-empty[hidden] { display:none; }
.chat-conversation { flex:1; min-height:0; display:flex; flex-direction:column; }
.chat-conversation[hidden] { display:none; }
.chat-thread-head { flex:0 0 auto; display:flex; align-items:center; gap:10px; padding:12px 18px; border-bottom:1px solid var(--line); background:rgba(6,14,21,.42); backdrop-filter:blur(18px); }
.chat-back { display:none; width:40px; height:40px; place-items:center; border:0; border-radius:13px; background:rgba(255,255,255,.07); color:#fff; }
.chat-back-icon { width:20px; height:20px; }
.chat-peer { display:flex; align-items:center; gap:12px; min-width:0; padding:4px 8px; border:0; border-radius:14px; background:transparent; color:inherit; text-align:left; }
.chat-peer:hover { background:rgba(255,255,255,.06); }
.chat-peer-avatar { width:42px; height:42px; border-radius:999px; object-fit:cover; font-size:17px; }
.chat-peer-identity { min-width:0; display:grid; gap:2px; }
.chat-peer-identity strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:16px; }
.chat-peer-identity span { color:var(--soft); font-size:12px; }
/* The site gradient stays visible; the veil only lifts text contrast over it. */
.chat-thread, .chat-list, .user-table-wrap, .user-detail, .modal-card { scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.16) transparent; }
.chat-thread::-webkit-scrollbar, .chat-list::-webkit-scrollbar, .user-table-wrap::-webkit-scrollbar, .user-detail::-webkit-scrollbar, .modal-card::-webkit-scrollbar { width:8px; height:8px; }
.chat-thread::-webkit-scrollbar-track, .chat-list::-webkit-scrollbar-track, .user-table-wrap::-webkit-scrollbar-track, .user-detail::-webkit-scrollbar-track, .modal-card::-webkit-scrollbar-track { background:transparent; }
.chat-thread::-webkit-scrollbar-thumb, .chat-list::-webkit-scrollbar-thumb, .user-table-wrap::-webkit-scrollbar-thumb, .user-detail::-webkit-scrollbar-thumb, .modal-card::-webkit-scrollbar-thumb { border:2px solid transparent; border-radius:999px; background:rgba(255,255,255,.16); background-clip:content-box; }
.chat-thread:hover::-webkit-scrollbar-thumb, .chat-list:hover::-webkit-scrollbar-thumb { background:rgba(255,255,255,.26); background-clip:content-box; }
.chat-thread { position:relative; flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; padding:18px 18px 10px; display:flex; flex-direction:column; gap:4px; background:linear-gradient(180deg,rgba(3,10,16,.34),rgba(3,10,16,.46)); outline:0; }
.chat-thread-note { margin:auto; }
.chat-day { align-self:center; margin:14px 0 8px; padding:4px 14px; border-radius:999px; background:rgba(6,16,24,.72); border:1px solid rgba(255,255,255,.10); color:var(--muted); font-size:12px; }
.chat-bubble { position:relative; max-width:min(640px,74%); padding:9px 14px 7px; border-radius:20px; font-size:15px; line-height:1.45; box-shadow:0 10px 26px rgba(0,0,0,.16); }
.chat-bubble.is-grouped { margin-top:-2px; }
.chat-bubble.is-own { align-self:flex-end; border:1px solid rgba(255,255,255,.16); background:linear-gradient(155deg,rgba(138,244,208,.94),rgba(95,202,255,.92)); color:#04222d; border-bottom-right-radius:8px; }
.chat-bubble.is-peer { align-self:flex-start; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.09); color:var(--text); backdrop-filter:blur(14px); border-bottom-left-radius:8px; }
.chat-bubble.is-pending { opacity:.72; }
.chat-bubble.is-failed { border-color:rgba(255,156,156,.52); }
.chat-bubble-retry { margin-left:6px; padding:0 6px; border:0; border-radius:8px; background:rgba(4,34,45,.16); color:inherit; font:inherit; font-size:11px; text-decoration:underline; }
.chat-bubble-retry:hover { background:rgba(4,34,45,.26); }
.chat-bubble-text { display:block; white-space:pre-wrap; overflow-wrap:anywhere; }
.chat-bubble-meta { display:flex; align-items:center; justify-content:flex-end; gap:5px; margin-top:2px; font-size:11px; opacity:.72; }
.chat-bubble.is-own .chat-bubble-meta { color:#04222d; }
.chat-composer { flex:0 0 auto; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:10px; padding:12px 18px calc(14px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:rgba(6,14,21,.42); backdrop-filter:blur(18px); }
.chat-input { min-height:48px; max-height:160px; padding:13px 16px; border:1px solid var(--line); border-radius:18px; outline:0; background:rgba(4,10,16,.34); color:#fff; font-size:15px; line-height:1.4; resize:none; }
.chat-input:focus { border-color:rgba(138,244,208,.44); box-shadow:0 0 0 5px rgba(138,244,208,.08); }
.chat-send { width:48px; height:48px; display:grid; place-items:center; border:0; border-radius:16px; background:linear-gradient(155deg,rgba(138,244,208,.94),rgba(95,202,255,.92)); color:#04222d; box-shadow:inset 0 1px 0 rgba(255,255,255,.5); }
.chat-send-icon { width:21px; height:21px; }
.peer-profile-card { width:min(460px,100%); }
.peer-profile-body { display:grid; gap:18px; }
.peer-identity { display:flex; align-items:center; gap:14px; }
.peer-avatar { width:64px; height:64px; border-radius:999px; object-fit:cover; font-size:26px; }
.peer-identity h3 { margin:0 0 3px; font-size:22px; overflow-wrap:anywhere; }
.peer-identity p { margin:0; color:var(--soft); overflow-wrap:anywhere; }
.share-block { display:grid; justify-items:center; gap:12px; padding:16px; border:1px solid rgba(255,255,255,.10); border-radius:20px; background:rgba(3,10,16,.28); }
.share-label { color:var(--soft); font-size:11px; font-weight:700; letter-spacing:.09em; text-transform:uppercase; }
.share-qr { width:min(220px,64vw); }
.qr-code { display:block; width:100%; height:auto; border-radius:12px; }
.share-copy { display:inline-flex; align-items:center; justify-content:center; gap:8px; width:100%; }

@media (min-width: 901px) and (max-width: 1199px) {
  .chat-shell { grid-template-columns:minmax(240px,292px) minmax(0,1fr); }
}
@media (max-width: 900px) {
  .chat-shell { height:100dvh; grid-template-columns:1fr; }
  body[data-section="home"] .app-shell,
  body[data-section="home"] .app-section { height:100dvh; }
  .chat-list-column { border-right:0; }
  .chat-list { padding-bottom:180px; }
  .chat-new { position:fixed; right:16px; bottom:calc(92px + env(safe-area-inset-bottom)); }
  body[data-chat-thread="open"] .chat-new { display:none; }
  .chat-thread-column { position:fixed; inset:0; z-index:45; display:none; background:linear-gradient(155deg,#0b1d28,#0a252d 60%,#08141d); }
  .chat-shell[data-thread="open"] .chat-thread-column { display:flex; }
  .chat-back { display:grid; }
  .chat-thread { padding:14px 12px 8px; }
  .chat-bubble { max-width:86%; }
  .chat-composer { padding:10px 12px calc(12px + env(safe-area-inset-bottom)); }
  /* The bottom navigation would compete with the composer, so it steps aside. */
  body[data-chat-thread="open"] .app-nav { display:none; }
  body[data-chat-thread="open"] .app-section { padding-bottom:0; }
}

/* WNT-049 notifications, per-chat mute and the settings section. */
.chat-row-muted { flex:0 0 auto; display:inline-flex; align-items:center; color:var(--soft); }
.chat-row-muted-icon { width:15px; height:15px; }
.chat-row-top strong { flex:0 1 auto; }
.chat-row-time { margin-left:auto; }

.notify-offer { display:flex; align-items:center; gap:10px; margin:0 0 10px; padding:10px 12px; border-radius:18px; border:1px solid rgba(255,255,255,.14); background:linear-gradient(165deg,rgba(255,255,255,.09),rgba(3,10,16,.30)); }
.notify-offer-icon { flex:0 0 auto; display:inline-flex; color:var(--accent); }
.notify-offer-text { min-width:0; flex:1 1 auto; font-size:13px; color:var(--muted); }
.notify-offer-enable { flex:0 0 auto; min-height:34px; padding:0 14px; border:0; border-radius:13px; color:#04222d; background:linear-gradient(155deg,rgba(138,244,208,.94),rgba(95,202,255,.92)); font-weight:750; font-size:13px; }
.notify-offer-close { flex:0 0 auto; width:34px; height:34px; border-radius:12px; font-size:22px; }

.mute-block { position:relative; margin-top:14px; }
.peer-action { width:100%; min-height:48px; display:flex; align-items:center; gap:11px; padding:0 14px; border-radius:16px; border:1px solid rgba(255,255,255,.13); background:rgba(255,255,255,.06); color:var(--text); font-weight:650; font-size:15px; text-align:left; }
.peer-action.is-muted { color:var(--accent); }
.mute-menu { position:absolute; left:0; right:0; top:calc(100% + 6px); z-index:6; display:flex; flex-direction:column; padding:6px; border-radius:16px; border:1px solid rgba(255,255,255,.14); background:linear-gradient(180deg,rgba(16,32,42,.98),rgba(9,20,28,.98)); box-shadow:var(--shadow); }
.mute-option { min-height:42px; padding:0 12px; border:0; border-radius:12px; background:transparent; color:var(--text); font-size:14px; font-weight:600; text-align:left; }
.mute-option:hover { background:rgba(255,255,255,.08); }

.settings-shell { min-width:0; min-height:0; display:flex; justify-content:center; align-items:flex-start; }
.settings-card { width:min(680px,100%); padding:24px; border-radius:30px; background:linear-gradient(180deg,rgba(255,255,255,.11),rgba(255,255,255,.04)),linear-gradient(135deg,rgba(8,18,28,.70),rgba(13,37,46,.58)); border:1px solid rgba(255,255,255,.15); box-shadow:var(--shadow); backdrop-filter:blur(22px) saturate(145%); }
.settings-head h1 { margin:0 0 16px; font-size:23px; font-weight:700; }
.settings-list { display:flex; flex-direction:column; gap:8px; }
.settings-row { width:100%; min-height:56px; display:flex; align-items:center; gap:12px; padding:0 15px; border-radius:18px; border:1px solid rgba(255,255,255,.11); background:rgba(255,255,255,.05); color:var(--text); font-size:15px; font-weight:600; text-align:left; }
.settings-row-icon { flex:0 0 auto; display:inline-flex; color:var(--accent); }
.settings-row-label { min-width:0; flex:1 1 auto; }
.settings-switch { flex:0 0 auto; width:46px; height:27px; padding:3px; border-radius:999px; background:rgba(255,255,255,.16); transition:background .18s ease; }
.settings-knob { display:block; width:21px; height:21px; border-radius:999px; background:#eaf7ff; transition:transform .18s ease; }
.settings-row[aria-checked="true"] .settings-switch { background:linear-gradient(155deg,rgba(138,244,208,.94),rgba(95,202,255,.92)); }
.settings-row[aria-checked="true"] .settings-knob { transform:translateX(19px); background:#04222d; }
.settings-note { margin:14px 2px 0; color:var(--danger); font-size:13px; }
