:root {
  color-scheme: light dark;
  --bg: #eef3ff;
  --bg-2: #f8fbff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-muted: #f4f7fb;
  --text: #0b1220;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: rgba(148, 163, 184, 0.28);
  --border: var(--line);
  --primary: #4f46e5;
  --primary-2: #2563eb;
  --primary-3: #06b6d4;
  --danger: #e11d48;
  --success: #059669;
  --warning: #d97706;
  --shadow-sm: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 24px 70px rgba(30, 41, 59, 0.16);
  --shadow-glow: 0 18px 60px rgba(79, 70, 229, 0.24);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% -10%, rgba(79, 70, 229, 0.26), transparent 34rem),
    radial-gradient(circle at 88% 6%, rgba(6, 182, 212, 0.20), transparent 30rem),
    radial-gradient(circle at 70% 92%, rgba(37, 99, 235, 0.16), transparent 34rem),
    linear-gradient(135deg, var(--bg), var(--bg-2) 46%, #ffffff);
  color: var(--text);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

.shell {
  width: min(1520px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 56px;
  position: relative;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.70);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px) saturate(160%);
}
.topbar > div:first-child {
  position: relative;
  padding-left: 60px;
}
.topbar > div:first-child::before {
  content: "IAM";
  position: absolute;
  left: 0;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: var(--shadow-glow);
}
.topbar h1 {
  margin: 0 0 5px;
  font-size: clamp(24px, 2vw, 34px);
  letter-spacing: -0.055em;
  line-height: 1;
}
.topbar p {
  margin: 0;
  max-width: 900px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.topbar p,
.muted:empty {
  display: none;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  max-width: 420px;
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 999px;
  padding: 10px 15px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.90));
  color: white;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.20);
}
.status-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.16);
}
body[data-role="signed-out"] #session-status {
  display: none;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  backdrop-filter: blur(16px) saturate(145%);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.34), transparent 36%);
}
.card > * { position: relative; z-index: 1; }
.card h2, .card h3 { margin: 0 0 16px; letter-spacing: -0.035em; }
.card h2 { font-size: 24px; }
.card h3 { font-size: 18px; }

#login-card {
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 28px;
  align-items: center;
  padding: 28px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 8% 8%, rgba(59, 130, 246, 0.28), transparent 24rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.88) 48%, rgba(17, 24, 39, 0.92));
  color: white;
  box-shadow: var(--shadow-md);
}
#login-card::before { display: none; }
.login-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: 620px;
}
.login-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.86);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.02em;
}
#login-card h2 {
  font-size: clamp(38px, 5.4vw, 72px);
  line-height: 0.98;
  max-width: 620px;
  margin: 0;
  letter-spacing: -0.06em;
}
.login-intro {
  margin: 0;
  max-width: 520px;
  color: rgba(255,255,255,0.76);
  font-size: 17px;
  font-weight: 750;
  line-height: 1.55;
}
.login-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.login-flow span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 14px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.84);
  font-size: 13px;
  font-weight: 950;
}
.login-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
#login-card form,
.passkey-panel {
  padding: 28px;
  border-radius: 28px;
  background: rgba(255,255,255,0.94);
  color: var(--text);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.34);
}
#login-card form h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 24px;
  letter-spacing: -0.035em;
}
.passkey-panel {
  padding: 16px 18px;
  background: rgba(255,255,255,0.88);
}
.passkey-panel summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #334155;
  font-weight: 950;
  list-style: none;
}
.passkey-panel summary::-webkit-details-marker { display: none; }
.passkey-panel summary::after {
  content: "+";
  color: #64748b;
  font-weight: 950;
}
.passkey-panel[open] summary::after { content: "–"; }
.passkey-panel button.secondary {
  color: #0f172a;
  background: rgba(226, 232, 240, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.36);
}
.passkey-panel form {
  margin-top: 14px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.login-message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(79, 70, 229, 0.08);
  color: #3730a3;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}
.login-message.is-error {
  background: rgba(225, 29, 72, 0.10);
  color: #be123c;
}
.login-support-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.login-support-grid div {
  padding: 13px 15px;
  border-radius: 18px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.14);
}
.login-support-grid strong,
.login-support-grid span {
  display: block;
}
.login-support-grid strong {
  margin-bottom: 4px;
  color: rgba(255,255,255,0.92);
  font-size: 14px;
}
.login-support-grid span {
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  line-height: 1.45;
}
.login-help {
  padding: 0 4px;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
}
.login-help summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 850;
  list-style: none;
}
.login-help summary::-webkit-details-marker { display: none; }
.login-help summary::after {
  content: " +";
  opacity: .72;
}
.login-help[open] summary::after { content: " –"; }
.login-help p {
  margin: 8px 0 0;
  max-width: 320px;
  line-height: 1.45;
}
#login-card .muted {
  margin: 4px 4px 0;
  color: rgba(255,255,255,0.74);
  font-size: 14px;
  line-height: 1.55;
}

.stack { display: flex; flex-direction: column; gap: 14px; }
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
input, textarea, select, button { font: inherit; }
input, textarea, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 14px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus {
  border-color: rgba(79, 70, 229, 0.64);
  box-shadow: 0 0 0 5px rgba(79, 70, 229, 0.12);
  background: #fff;
}
button, a.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  padding: 10px 15px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.25);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
button:hover, a.button-link:hover { transform: translateY(-1px); filter: saturate(1.08); box-shadow: 0 18px 40px rgba(79, 70, 229, 0.32); }
button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
  filter: grayscale(0.2);
}
button.secondary, a.button-link.secondary {
  background: rgba(226, 232, 240, 0.95);
  color: #0f172a;
  box-shadow: none;
}
button.danger { background: linear-gradient(135deg, #e11d48, #be123c); box-shadow: 0 12px 30px rgba(225, 29, 72, 0.22); }

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-md);
  padding: 14px;
  overflow: auto;
  background: linear-gradient(135deg, #0b1220, #111827);
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.hidden { display: none !important; }

.tabs {
  position: sticky;
  top: 104px;
  z-index: 18;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background: rgba(255,255,255,0.72);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px) saturate(150%);
}
.tabs button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #475569;
  box-shadow: none;
  padding: 8px 12px;
  font-size: 13px;
}
.tabs button:hover { background: rgba(79, 70, 229, 0.08); transform: none; box-shadow: none; }
.tabs button.active {
  border-color: rgba(79, 70, 229, 0.20);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.24);
}
.tab { display: none; animation: fadeUp .22s ease both; }
.tab.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.grid { display: grid; gap: 20px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact { gap: 12px; }
.metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 20px; }
.metric {
  min-height: 138px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(255,255,255,.70)),
    radial-gradient(circle at top right, rgba(79,70,229,.18), transparent 8rem);
}
.metric span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.metric span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
}
.metric strong {
  display: block;
  margin-top: 22px;
  font-size: clamp(34px, 3.2vw, 52px);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 9px;
}
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}
.table-search {
  max-width: 360px;
  margin: 0;
}
.table-pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}
.table th {
  padding: 0 12px 4px;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.table td {
  padding: 14px 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255,255,255,0.68);
  font-size: 13px;
  text-align: left;
  vertical-align: top;
}
.table td:first-child { border-left: 1px solid rgba(148, 163, 184, 0.16); border-radius: 16px 0 0 16px; }
.table td:last-child { border-right: 1px solid rgba(148, 163, 184, 0.16); border-radius: 0 16px 16px 0; }
.table tr:hover td { background: #fff; box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.45; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border: 1px solid rgba(79, 70, 229, 0.14);
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.08);
  color: #3730a3;
  font-size: 11px;
  font-weight: 900;
}
.session-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: rgba(79, 70, 229, 0.08);
}
.session-summary strong,
.session-summary span {
  display: block;
}
.session-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.session-cards {
  display: grid;
  gap: 10px;
}
.session-card {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.56);
}
.session-card button {
  justify-self: start;
  white-space: nowrap;
}
.session-technical-details {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  background: rgba(148, 163, 184, .08);
}
.session-technical-details > summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 900;
  list-style: none;
}
.session-technical-details > summary::-webkit-details-marker { display: none; }
.session-technical-details > summary::after {
  content: "+";
  margin-left: auto;
}
.session-technical-details[open] > summary::after { content: "–"; }
.session-technical-details > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}
.session-technical-details small,
.session-technical-details strong {
  display: block;
}
.session-technical-details small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.session-technical-details strong {
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.session-card.is-current {
  border-color: rgba(34, 197, 94, 0.34);
}
.session-card strong,
.session-card span,
.session-card small {
  display: block;
  min-width: 0;
  overflow-wrap: normal;
  word-break: keep-all;
}
.session-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

body[data-role="user"] #sessions-list .session-card {
  grid-template-columns: 1fr;
}
body[data-role="user"] #sessions-list .session-card strong,
body[data-role="user"] #sessions-list .session-card span,
body[data-role="user"] #sessions-list .session-card small {
  overflow-wrap: normal;
  word-break: keep-all;
}
body[data-role="user"] #sessions-list .session-card > div:first-child span {
  white-space: normal;
}

.session-history {
  margin-top: 12px;
}
.session-history > summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.session-history .compact {
  margin-top: 10px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: 460px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.94);
  color: white;
  padding: 14px 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.30);
  backdrop-filter: blur(14px);
}
.inline { flex-direction: row; align-items: center; gap: 10px; }
.inline input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--primary); }

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.app-card {
  min-height: 245px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 28px;
  padding: 20px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,255,255,.72)),
    radial-gradient(circle at 78% 4%, rgba(79,70,229,.22), transparent 10rem);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.app-icon {
  width: 58px;
  height: 58px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: white;
  font-size: 24px;
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-card h3 { margin: 0; font-size: 20px; }
.app-card p { margin: 0; min-height: 42px; }
.app-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: auto; }

@media (max-width: 1180px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  #login-card { grid-template-columns: 1fr; min-height: auto; }
  .login-copy { max-width: none; }
  .login-panel { max-width: 520px; }
  #login-card .muted { margin: 0; }
}
@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 1520px); padding-top: 12px; }
  .topbar { position: static; grid-template-columns: 1fr; }
  .topbar > div:first-child { padding-left: 0; padding-top: 56px; }
  .topbar > div:first-child::before { top: 0; transform: none; }
  .tabs { position: static; overflow-x: auto; flex-wrap: nowrap; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #login-card { padding: 24px; }
  #login-card h2 { font-size: 36px; }
  .login-intro { font-size: 15px; }
  .login-flow span { flex: 1 1 120px; justify-content: center; }
  .card { padding: 18px; }
}
.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 20px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(49, 46, 129, 0.84)),
    radial-gradient(circle at 90% 12%, rgba(6, 182, 212, 0.46), transparent 24rem);
  color: white;
}
.hero-card h2 {
  max-width: 960px;
  margin: 8px 0 10px;
  font-size: clamp(28px, 3.2vw, 52px);
  line-height: 1.02;
}
.hero-card .muted { color: rgba(255,255,255,.72); font-size: 15px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.86);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.feature-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.feature-list li {
  position: relative;
  padding-left: 30px;
  color: #334155;
  line-height: 1.5;
}
.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(5, 150, 105, .12);
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
}
body[data-role="user"] .metrics .card:nth-child(1) span::after { content: " (me)"; text-transform: none; letter-spacing: 0; }
body[data-role="user"] .metrics .card:nth-child(4),
body[data-role="user"] .metrics .card:nth-child(5) { opacity: .72; }
.info-grid, .status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.info-item {
  min-height: 104px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 18px;
  background: rgba(255,255,255,.68);
}
.info-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.info-item strong {
  display: block;
  margin-top: 10px;
  overflow: hidden;
  color: var(--text);
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.info-item small {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
}
.profile-card { display: grid; gap: 18px; }
.profile-head {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 22px;
  background: rgba(255,255,255,.68);
}
.profile-head h3 { margin: 0 0 4px; }
.avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
  color: white;
  font-size: 24px;
  font-weight: 950;
  box-shadow: var(--shadow-glow);
}
@media (max-width: 720px) {
  .info-grid, .status-grid { grid-template-columns: 1fr; }
}
.session-cluster {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.pref-select {
  width: auto;
  min-height: 40px;
  border-radius: 999px;
  padding: 8px 34px 8px 12px;
  font-weight: 800;
}
.workspace-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: 104px;
  z-index: 18;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: rgba(255,255,255,0.72);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px) saturate(150%);
  padding: 14px;
}
.sidebar-title {
  padding: 8px 10px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.content-panel { min-width: 0; }
.workspace-layout .tabs {
  position: static;
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.workspace-layout .tabs button {
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
}
.empty-state {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 132px;
  border: 1px dashed rgba(148, 163, 184, .36);
  border-radius: 18px;
  background: rgba(255,255,255,.46);
  color: var(--muted);
  text-align: center;
  padding: 18px;
}
.empty-state strong { color: var(--text); font-size: 16px; }
.empty-state span { font-size: 13px; }
.settings-list { display: grid; gap: 14px; }

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090d18;
  --bg-2: #0f172a;
  --surface: rgba(15, 23, 42, 0.78);
  --surface-solid: #111827;
  --surface-muted: #1e293b;
  --text: #e5edf8;
  --muted: #a7b3c7;
  --muted-2: #8190a7;
  --line: rgba(148, 163, 184, 0.18);
  --shadow-sm: 0 14px 36px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 28px 80px rgba(0, 0, 0, 0.38);
}
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% -8%, rgba(79, 70, 229, 0.28), transparent 34rem),
    radial-gradient(circle at 88% 4%, rgba(6, 182, 212, 0.16), transparent 30rem),
    linear-gradient(135deg, #050816, #0f172a 50%, #111827);
}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .card {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.72);
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
}
html[data-theme="dark"] label,
html[data-theme="dark"] .feature-list li { color: #cbd5e1; }
html[data-theme="dark"] .table td,
html[data-theme="dark"] .info-item,
html[data-theme="dark"] .profile-head,
html[data-theme="dark"] .empty-state {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.52);
}
html[data-theme="dark"] .table tr:hover td { background: rgba(30, 41, 59, 0.82); }
html[data-theme="dark"] .session-summary {
  background: rgba(99, 102, 241, .14);
}
html[data-theme="dark"] .session-card {
  background: rgba(15, 23, 42, .50);
}
html[data-theme="dark"] .metric,
html[data-theme="dark"] .app-card {
  background:
    linear-gradient(145deg, rgba(15,23,42,.84), rgba(30,41,59,.62)),
    radial-gradient(circle at top right, rgba(79,70,229,.22), transparent 8rem);
}
html[data-theme="dark"] #login-card form,
html[data-theme="dark"] .passkey-panel {
  background: rgba(15,23,42,.84);
  color: var(--text);
}
html[data-theme="dark"] #login-card form h3,
html[data-theme="dark"] .passkey-panel summary {
  color: var(--text);
}
html[data-theme="dark"] .passkey-panel summary::after { color: #cbd5e1; }
html[data-theme="dark"] .passkey-panel button.secondary {
  color: #f8fafc;
  background: rgba(51, 65, 85, 0.96);
  border-color: rgba(148, 163, 184, 0.28);
}
html[data-theme="dark"] .login-message {
  background: rgba(129, 140, 248, 0.16);
  color: #c7d2fe;
}
html[data-theme="dark"] .login-message.is-error {
  background: rgba(225, 29, 72, 0.16);
  color: #fecdd3;
}
html[data-theme="dark"] button.secondary,
html[data-theme="dark"] a.button-link.secondary {
  background: rgba(51, 65, 85, .92);
  color: #e2e8f0;
}
html[data-theme="dark"] .pill {
  border-color: rgba(129, 140, 248, .22);
  background: rgba(99, 102, 241, .16);
  color: #c7d2fe;
}

@media (max-width: 980px) {
  .workspace-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .workspace-layout .tabs { display: flex; overflow-x: auto; }
  .workspace-layout .tabs button { width: auto; white-space: nowrap; }
}
@media (max-width: 720px) {
  .session-cluster { justify-content: flex-start; }
}
@media (max-width: 720px) {
  body { overflow-x: hidden; }
  .shell { width: calc(100% - 24px); padding: 12px 0 32px; }
  .topbar {
    gap: 14px;
    padding: 16px;
    border-radius: 24px;
  }
  .topbar > div:first-child {
    padding-top: 58px;
  }
  .topbar h1 {
    font-size: 24px;
    letter-spacing: -0.045em;
  }
  .topbar p {
    font-size: 13px;
    line-height: 1.45;
  }
  .session-cluster {
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
    gap: 10px;
  }
  .session-cluster .status-pill {
    grid-column: 1 / -1;
    justify-self: start;
    max-width: 100%;
  }
  .pref-select,
  .session-cluster > button {
    width: 100%;
    min-width: 0;
  }
  #login-card {
    display: block;
    min-height: 0;
    margin-top: 14px;
    padding: 24px;
    border-radius: 28px;
  }
  #login-card::before { display: none; }
  #login-card h2 {
    max-width: none;
    margin-bottom: 18px;
    font-size: clamp(34px, 12vw, 44px);
    line-height: .98;
    word-break: keep-all;
  }
  #login-card form {
    padding: 18px;
    border-radius: 22px;
  }
  .login-copy { gap: 14px; }
  .login-panel { max-width: none; }
  .passkey-panel { padding: 14px 16px; border-radius: 20px; }
  #login-card .muted {
    margin-top: 18px;
    color: rgba(255,255,255,.78);
  }
  input, textarea, select { font-size: 16px; }
  .hero-card { padding: 22px; border-radius: 24px; }
  .hero-card h2 { font-size: 30px; line-height: 1.08; word-break: keep-all; }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 108px; }
  .metric strong { margin-top: 14px; font-size: 38px; }
  .app-grid { grid-template-columns: 1fr; }
  .card { border-radius: 22px; }
  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .table td, .table th { min-width: 130px; }

  .workspace-layout .tabs {
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .workspace-layout .tabs::-webkit-scrollbar { display: none; }
}

@media (max-width: 420px) {
  .shell { width: calc(100% - 18px); }
  .topbar, #login-card { border-radius: 22px; }
  #login-card { padding: 22px; }
  #login-card h2 { font-size: 36px; }
  #login-card form { padding: 16px; }
  .login-flow { display: grid; grid-template-columns: 1fr; width: 100%; }
  .session-cluster { grid-template-columns: 1fr 1fr; }
}

.sso-badge {
  align-self: flex-start;
  min-height: 26px;
  padding: 5px 10px;
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.10);
  color: #0f766e;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .02em;
}
html[data-theme="dark"] .sso-badge {
  border-color: rgba(34, 211, 238, .24);
  background: rgba(8, 145, 178, .20);
  color: #a5f3fc;
}

@media (max-width: 980px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  .shell,
  .topbar,
  #app,
  .workspace-layout,
  .sidebar,
  .content-panel,
  .tab,
  .tab.active,
  .card,
  .grid,
  .two-col,
  .compact,
  .metrics,
  .hero-card,
  .app-grid,
  .info-grid,
  .status-grid,
  .profile-card,
  form,
  label,
  input,
  textarea,
  select,
  pre {
    max-width: 100%;
    min-width: 0;
  }
  .workspace-layout {
    display: block;
    width: 100%;
  }
  .sidebar {
    position: static;
    width: 100%;
    margin-bottom: 14px;
    overflow: hidden;
  }
  .content-panel {
    width: 100%;
    overflow: hidden;
  }
  .tab:not(.active) { display: none !important; }
  .workspace-layout .tabs {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .workspace-layout .tabs button {
    flex: 0 0 auto;
    width: auto;
    max-width: 72vw;
    white-space: nowrap;
  }
  .table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
  .table td,
  .table th { min-width: 120px; }
  .session-summary {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .session-summary button {
    width: 100%;
  }
  .session-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .session-card button {
    width: 100%;
  }
  .app-actions,
  .row-actions { max-width: 100%; }
  .app-actions > *,
  .row-actions > * { min-width: 0; }
  .info-item strong,
  .muted,
  .status-pill {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .shell {
    width: calc(100% - 18px);
    padding-left: 0;
    padding-right: 0;
  }
  .topbar,
  #login-card,
  .card,
  .sidebar {
    border-radius: 20px;
  }
  .session-cluster {
    grid-template-columns: 1fr 1fr;
  }
  .session-cluster .status-pill {
    grid-column: 1 / -1;
  }
  .hero-card h2 {
    font-size: clamp(26px, 9vw, 34px);
  }
  .app-card {
    min-height: 0;
    border-radius: 22px;
  }
  button,
  a.button-link {
    width: 100%;
  }
  .workspace-layout .tabs button {
    width: auto;
  }
}

/* DSM/Synology-style application launcher: icon-first, low chrome. */
#tab-applications .card {
  overflow: visible;
}
#tab-applications .card > .muted {
  max-width: 680px;
}
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 118px));
  justify-content: start;
  align-items: start;
  gap: 24px 18px;
  margin-top: 22px;
}
.app-tile,
a.app-tile,
button.app-tile {
  width: 100%;
  min-width: 0;
  min-height: 126px;
  display: grid;
  grid-template-rows: auto auto auto;
  justify-items: center;
  align-content: start;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 10px 8px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, opacity .16s ease;
}
.app-tile:hover,
a.app-tile:hover,
button.app-tile:hover {
  border-color: rgba(148, 163, 184, .18);
  background: rgba(255, 255, 255, .42);
  box-shadow: none;
  filter: none;
  transform: translateY(-2px);
}
.app-tile .app-icon {
  width: 70px;
  height: 70px;
  border-radius: 21px;
  font-size: 30px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
}
.app-name {
  width: 100%;
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.22;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.app-status {
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(79, 70, 229, .10);
  color: #4338ca;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.app-status.is-ready {
  gap: 4px;
  background: rgba(5, 150, 105, .12);
  color: #047857;
}
.app-status small {
  font: inherit;
  opacity: .72;
}
.app-status.is-muted {
  background: transparent;
  color: var(--muted);
}
.app-tile.is-disabled {
  cursor: default;
  opacity: .62;
}
.app-tile.is-pending {
  cursor: default;
}
.app-tile.is-pending .app-status {
  background: rgba(217, 119, 6, .14);
  color: #b45309;
}
.app-tile.is-disabled .app-icon {
  filter: grayscale(.22) saturate(.72);
}
.app-tile.is-disabled:hover,
.app-tile.is-pending:hover {
  border-color: transparent;
  background: transparent;
  transform: none;
}
html[data-theme="dark"] .app-tile:hover {
  border-color: rgba(148, 163, 184, .16);
  background: rgba(30, 41, 59, .46);
}
html[data-theme="dark"] .app-status {
  background: rgba(129, 140, 248, .16);
  color: #c7d2fe;
}
html[data-theme="dark"] .app-status.is-ready {
  background: rgba(16, 185, 129, .16);
  color: #a7f3d0;
}
html[data-theme="dark"] .app-status.is-muted {
  background: transparent;
  color: var(--muted);
}

@media (max-width: 720px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 14px;
  }
  .app-tile,
  a.app-tile,
  button.app-tile {
    min-height: 138px;
    padding: 12px 8px;
  }
  .app-tile .app-icon {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    font-size: 28px;
  }
  .app-name {
    -webkit-line-clamp: 3;
    font-size: 14px;
  }
}

/* Minimal information architecture: home stays app-only; admin/settings are one step away. */
body[data-role="admin"] .topbar p,
body[data-role="user"] .topbar p {
  display: none;
}
body[data-role="admin"] #app .card::after,
body[data-role="user"] #app .card::after {
  display: none;
}
body[data-role="admin"] #language-select,
body[data-role="admin"] #theme-toggle,
body[data-role="user"] #language-select,
body[data-role="user"] #theme-toggle {
  display: none;
}
body[data-role="admin"] .topbar,
body[data-role="user"] .topbar {
  grid-template-columns: auto 1fr;
  padding: 14px 18px;
}
body[data-role="admin"] .topbar > div:first-child,
body[data-role="user"] .topbar > div:first-child {
  min-height: 44px;
  display: flex;
  align-items: center;
}
body[data-role="admin"] .topbar h1,
body[data-role="user"] .topbar h1 {
  margin: 0;
  font-size: 24px;
}
.workspace-layout {
  grid-template-columns: 1fr;
  gap: 18px;
}
.sidebar {
  position: static;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}
.sidebar-title { display: none; }
.workspace-layout .tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow-x: auto;
}
.workspace-layout .tabs button {
  width: auto;
  min-width: 0;
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 15px;
  justify-content: center;
  background: rgba(15, 23, 42, .05);
}
html[data-theme="dark"] .workspace-layout .tabs button {
  background: rgba(30, 41, 59, .42);
  color: #cbd5e1;
}
.home-screen {
  min-height: 58vh;
  padding: 10px 4px;
}
.home-app-grid,
.admin-launcher {
  margin-top: 0;
  padding: 8px 0;
}
.admin-icon {
  background: linear-gradient(135deg, #475569, #0f172a) !important;
}

@media (max-width: 720px) {
  body[data-role="admin"] .topbar,
  body[data-role="user"] .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  body[data-role="admin"] .topbar > div:first-child,
  body[data-role="user"] .topbar > div:first-child {
    padding-top: 52px;
  }
  body[data-role="admin"] .topbar h1,
  body[data-role="user"] .topbar h1 {
    font-size: 24px;
  }
  .session-cluster {
    grid-template-columns: 1fr auto;
  }
  .session-cluster > #logout-button {
    width: auto;
    min-width: 112px;
  }
  .workspace-layout .tabs {
    width: 100%;
  }
  .workspace-layout .tabs button {
    flex: 0 0 auto;
  }
  .home-screen {
    min-height: 52vh;
    padding-top: 8px;
  }
}

/* Signed-in shell: remove account/control noise from the home surface. */
body[data-role="admin"] .session-cluster,
body[data-role="user"] .session-cluster {
  display: none;
}
body[data-role="admin"] .topbar,
body[data-role="user"] .topbar {
  display: flex;
  align-items: center;
  min-height: 76px;
}
@media (max-width: 720px) {
  body[data-role="admin"] .topbar,
  body[data-role="user"] .topbar {
    min-height: 92px;
  }
}

/* DSM-inspired signed-in desktop shell. Overrides earlier portal/card chrome. */
body[data-role="admin"],
body[data-role="user"] {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(59, 130, 246, .22), transparent 28rem),
    radial-gradient(circle at 82% 18%, rgba(6, 182, 212, .16), transparent 34rem),
    linear-gradient(135deg, #0a1024 0%, #0f1b35 44%, #071225 100%);
}
body[data-role="admin"]::before,
body[data-role="user"]::before {
  opacity: .22;
}
body[data-role="admin"] .shell,
body[data-role="user"] .shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}
body[data-role="admin"] .topbar,
body[data-role="user"] .topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  height: 46px;
  min-height: 46px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, .64), rgba(15, 23, 42, .36));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 12px 28px rgba(0, 0, 0, .16);
  backdrop-filter: none;
}
body[data-role="admin"] .topbar > div:first-child,
body[data-role="user"] .topbar > div:first-child {
  width: 40px;
  min-height: 46px;
  padding: 0;
}
body[data-role="admin"] .topbar > div:first-child::before,
body[data-role="user"] .topbar > div:first-child::before {
  left: 8px;
  top: 50%;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  transform: translateY(-50%);
  font-size: 9px;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .28);
}
body[data-role="admin"] .topbar h1,
body[data-role="user"] .topbar h1,
body[data-role="admin"] .topbar p,
body[data-role="user"] .topbar p,
body[data-role="admin"] .session-cluster,
body[data-role="user"] .session-cluster {
  display: none !important;
}
body[data-role="admin"] #app,
body[data-role="user"] #app {
  min-height: 100vh;
  padding-top: 46px;
}
body[data-role="admin"] .workspace-layout,
body[data-role="user"] .workspace-layout {
  display: block;
  width: 100%;
}
body[data-role="admin"] .sidebar,
body[data-role="user"] .sidebar {
  position: fixed;
  top: 7px;
  right: 10px;
  z-index: 90;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}
body[data-role="admin"] .workspace-layout .tabs,
body[data-role="user"] .workspace-layout .tabs {
  width: auto;
  max-width: calc(100vw - 64px);
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow-x: auto;
  scrollbar-width: none;
}
body[data-role="admin"] .workspace-layout .tabs::-webkit-scrollbar,
body[data-role="user"] .workspace-layout .tabs::-webkit-scrollbar { display: none; }
body[data-role="admin"] .workspace-layout .tabs button,
body[data-role="user"] .workspace-layout .tabs button {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  padding: 6px 11px;
  background: rgba(15, 23, 42, .34);
  color: rgba(226, 232, 240, .88);
  font-size: 12px;
  font-weight: 850;
  box-shadow: none;
}
body[data-role="admin"] .workspace-layout .tabs button.active,
body[data-role="user"] .workspace-layout .tabs button.active {
  border-color: rgba(96, 165, 250, .34);
  background: rgba(37, 99, 235, .74);
  color: white;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .22);
}
body[data-role="admin"] .content-panel,
body[data-role="user"] .content-panel {
  width: 100%;
  min-height: calc(100vh - 46px);
  padding: 28px 34px 36px;
  overflow: visible;
}
body[data-role="admin"] .home-screen,
body[data-role="user"] .home-screen {
  min-height: calc(100vh - 110px);
  padding: 0;
}
body[data-role="admin"] .home-app-grid,
body[data-role="user"] .home-app-grid,
body[data-role="admin"] .admin-launcher,
body[data-role="user"] .admin-launcher {
  grid-template-columns: repeat(auto-fill, 94px);
  justify-content: start;
  align-content: start;
  gap: 28px 26px;
  margin: 0;
  padding: 10px 0 0;
}
body[data-role="admin"] .home-app-grid.compact-launcher,
body[data-role="user"] .home-app-grid.compact-launcher {
  min-height: calc(100vh - 132px);
  grid-template-columns: repeat(auto-fit, minmax(112px, 128px));
  justify-content: center;
  align-content: center;
  gap: 34px;
  padding-top: 0;
}
body[data-role="admin"] .home-app-grid.compact-launcher .app-tile,
body[data-role="user"] .home-app-grid.compact-launcher .app-tile {
  min-height: 132px;
}
body[data-role="admin"] .home-app-grid.compact-launcher .app-icon,
body[data-role="user"] .home-app-grid.compact-launcher .app-icon {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  font-size: 33px;
}
body[data-role="admin"] .app-tile,
body[data-role="admin"] a.app-tile,
body[data-role="admin"] button.app-tile,
body[data-role="user"] .app-tile,
body[data-role="user"] a.app-tile,
body[data-role="user"] button.app-tile {
  min-height: 104px;
  border-radius: 10px;
  padding: 8px 4px;
  border-color: transparent;
  background: transparent;
}
body[data-role="admin"] .app-tile:hover,
body[data-role="admin"] a.app-tile:hover,
body[data-role="admin"] button.app-tile:hover,
body[data-role="admin"] .app-tile:focus-visible,
body[data-role="user"] .app-tile:hover,
body[data-role="user"] a.app-tile:hover,
body[data-role="user"] button.app-tile:hover,
body[data-role="user"] .app-tile:focus-visible {
  border-color: rgba(147, 197, 253, .18);
  background: rgba(96, 165, 250, .10);
  outline: none;
  transform: none;
}
body[data-role="admin"] .app-tile .app-icon,
body[data-role="user"] .app-tile .app-icon {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  font-size: 28px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .16);
}
body[data-role="admin"] .app-name,
body[data-role="user"] .app-name {
  color: rgba(241, 245, 249, .86);
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .42);
  -webkit-line-clamp: 1;
}
body[data-role="admin"] .app-status,
body[data-role="user"] .app-status {
  min-height: 0;
  gap: 4px;
  padding: 0;
  background: transparent;
  color: rgba(203, 213, 225, .62);
  font-size: 10px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.guide-help {
  padding: 0 !important;
}
.guide-help > summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: rgba(241, 245, 249, .92);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}
.guide-help > summary::-webkit-details-marker { display: none; }
.guide-help > summary::after {
  content: "+";
  margin-left: auto;
  color: rgba(203, 213, 225, .72);
}
.guide-help[open] > summary::after { content: "–"; }
.compact-guide-map {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 16px 16px;
}
body[data-role="admin"] .tab:not(.home-screen):not(#tab-admin),
body[data-role="user"] .tab:not(.home-screen):not(#tab-admin) {
  max-width: 1280px;
}

@media (max-width: 720px) {
  body[data-role="admin"] .topbar,
  body[data-role="user"] .topbar {
    height: 44px;
    min-height: 44px;
  }
  body[data-role="admin"] .topbar > div:first-child,
  body[data-role="user"] .topbar > div:first-child {
    width: 38px;
    min-height: 44px;
    padding: 0;
  }
  body[data-role="admin"] .topbar > div:first-child::before,
  body[data-role="user"] .topbar > div:first-child::before {
    width: 28px;
    height: 28px;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
  }
  body[data-role="admin"] #app,
  body[data-role="user"] #app {
    padding-top: 44px;
  }
  body[data-role="admin"] .sidebar,
  body[data-role="user"] .sidebar {
    top: 6px;
    right: 8px;
    max-width: calc(100vw - 56px);
  }
  body[data-role="admin"] .workspace-layout .tabs button,
  body[data-role="user"] .workspace-layout .tabs button {
    min-height: 31px;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 12px;
  }
  body[data-role="admin"] .content-panel,
  body[data-role="user"] .content-panel {
    min-height: calc(100vh - 44px);
    padding: 24px 16px 34px;
  }
  body[data-role="admin"] .home-app-grid,
  body[data-role="user"] .home-app-grid,
  body[data-role="admin"] .admin-launcher,
  body[data-role="user"] .admin-launcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 10px;
    padding-top: 8px;
  }
  body[data-role="admin"] .home-app-grid.compact-launcher,
  body[data-role="user"] .home-app-grid.compact-launcher {
    min-height: calc(100vh - 120px);
    align-content: start;
    padding-top: 42px;
  }
  body[data-role="admin"] .app-tile,
  body[data-role="user"] .app-tile,
  body[data-role="admin"] a.app-tile,
  body[data-role="user"] a.app-tile,
  body[data-role="admin"] button.app-tile,
  body[data-role="user"] button.app-tile {
    min-height: 112px;
  }
  body[data-role="admin"] .app-tile .app-icon,
  body[data-role="user"] .app-tile .app-icon {
    width: 62px;
    height: 62px;
    border-radius: 17px;
  }
}

/* DSM Control Panel style for admin details: categories first, forms only after expand. */
body[data-role="admin"] .admin-section:not(#tab-admin),
body[data-role="user"] .admin-section:not(#tab-admin) {
  max-width: min(1180px, calc(100vw - 40px));
  min-height: calc(100vh - 98px);
  margin: 0 auto;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 16px;
  background: rgba(15, 23, 42, .54);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .24);
  backdrop-filter: blur(18px) saturate(145%);
  overflow: hidden;
}
.admin-panel-titlebar {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  background: rgba(15, 23, 42, .48);
}
.admin-panel-titlebar h2 {
  margin: 0;
  color: rgba(241, 245, 249, .92);
  font-size: 16px;
  letter-spacing: -.02em;
}
.admin-panel-titlebar .admin-back {
  width: auto;
  min-height: 34px;
  border-radius: 9px;
  padding: 6px 10px;
  background: rgba(51, 65, 85, .78);
  color: #e2e8f0;
}
body[data-role="admin"] .admin-section:not(#tab-admin) > .grid,
body[data-role="user"] .admin-section:not(#tab-admin) > .grid,
body[data-role="admin"] .admin-section:not(#tab-admin) > .card,
body[data-role="user"] .admin-section:not(#tab-admin) > .card {
  margin: 0 !important;
  padding: 14px;
}
body[data-role="admin"] .admin-section:not(#tab-admin) .grid,
body[data-role="user"] .admin-section:not(#tab-admin) .grid {
  gap: 10px;
}
body[data-role="admin"] .admin-section:not(#tab-admin) .card,
body[data-role="user"] .admin-section:not(#tab-admin) .card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: visible;
  backdrop-filter: none;
}
.admin-collapsible-card::after { display: none; }
body[data-role="admin"] .admin-section:not(#tab-admin) .card::after,
body[data-role="user"] .admin-section:not(#tab-admin) .card::after {
  display: none;
}
.admin-details {
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 12px;
  background: rgba(15, 23, 42, .34);
  overflow: hidden;
  scroll-margin-top: 76px;
}
.admin-details + .admin-details { margin-top: 10px; }
.admin-details > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: rgba(241, 245, 249, .9);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}
.admin-details > summary::-webkit-details-marker { display: none; }
.admin-details > summary::after {
  content: "+";
  margin-left: auto;
  color: rgba(203, 213, 225, .72);
  font-size: 18px;
  font-weight: 700;
}
.admin-details[open] > summary {
  border-bottom: 1px solid rgba(148, 163, 184, .12);
  background: rgba(30, 41, 59, .44);
}
.admin-details[open] > summary::after { content: "–"; }
.admin-details-body {
  padding: 14px;
}
.admin-details-body .muted {
  max-width: 760px;
}
.admin-details-body form {
  max-width: 760px;
}
.admin-details-body pre {
  margin-top: 12px;
}
body[data-role="admin"] .admin-section:not(#tab-admin) .table,
body[data-role="user"] .admin-section:not(#tab-admin) .table {
  background: transparent;
}

.guide-section {
  display: none;
  gap: 14px;
}
.guide-section.active {
  display: grid;
}
body[data-role="admin"] .guide-section .card,
body[data-role="user"] .guide-section .card {
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 16px;
  background: rgba(15, 23, 42, .34);
  box-shadow: none;
  padding: 16px;
}
.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}
.guide-hero h2 {
  margin: 4px 0 8px;
  color: rgba(241, 245, 249, .96);
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}
.guide-action {
  min-width: 160px;
  min-height: 44px;
}
.guide-flow h3,
.guide-choice h3 {
  margin: 0 0 12px;
  color: rgba(241, 245, 249, .94);
}
.guide-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.simple-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.simple-step {
  min-height: 160px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(96, 165, 250, .22);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .22), rgba(15, 23, 42, .28));
  box-shadow: none;
  text-align: left;
}
.simple-step:hover {
  transform: none;
  border-color: rgba(147, 197, 253, .56);
  background: linear-gradient(135deg, rgba(37, 99, 235, .36), rgba(15, 23, 42, .34));
  box-shadow: none;
}
.simple-step span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-size: 16px;
  font-weight: 1000;
}
.simple-step strong {
  color: rgba(241, 245, 249, .96);
  font-size: 17px;
}
.simple-step small {
  color: rgba(203, 213, 225, .76);
  font-size: 13px;
  line-height: 1.45;
}
.guide-steps article {
  min-height: 160px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 14px;
  background: rgba(30, 41, 59, .28);
}
.guide-steps article span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 10px;
  color: #dbeafe;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-weight: 900;
}
.guide-steps article strong,
.guide-map-item strong {
  display: block;
  color: rgba(241, 245, 249, .94);
  font-size: 14px;
}
.guide-steps article p,
.guide-map-item span {
  margin: 6px 0 0;
  color: rgba(203, 213, 225, .72);
  font-size: 12px;
  line-height: 1.45;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.guide-choice ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 18px;
  color: rgba(203, 213, 225, .78);
  font-size: 13px;
  line-height: 1.45;
}
.guide-choice code {
  color: #bfdbfe;
  overflow-wrap: anywhere;
}
.guide-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.guide-map-item {
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 14px;
  background: rgba(30, 41, 59, .28);
  box-shadow: none;
  text-align: left;
}
.guide-map-item:hover {
  transform: none;
  border-color: rgba(96, 165, 250, .38);
  background: rgba(37, 99, 235, .24);
  box-shadow: none;
}

@media (max-width: 720px) {
  body[data-role="admin"] .admin-section:not(#tab-admin),
  body[data-role="user"] .admin-section:not(#tab-admin) {
    max-width: 100%;
    min-height: calc(100vh - 84px);
    border-radius: 12px;
  }
  .admin-panel-titlebar {
    min-height: 50px;
    padding: 8px 10px;
  }
  .admin-panel-titlebar .admin-back {
    min-width: 0;
    width: auto;
  }
  body[data-role="admin"] .admin-section:not(#tab-admin) > .grid,
  body[data-role="user"] .admin-section:not(#tab-admin) > .grid,
  body[data-role="admin"] .admin-section:not(#tab-admin) > .card,
  body[data-role="user"] .admin-section:not(#tab-admin) > .card {
    padding: 10px;
  }
  .admin-details > summary {
    min-height: 46px;
    padding: 0 12px;
  }
  .admin-details-body {
    padding: 12px;
  }
  .guide-hero,
  .guide-grid,
  .guide-steps,
  .simple-steps,
  .guide-map {
    grid-template-columns: 1fr;
  }
  .guide-action {
    width: 100%;
  }
  .guide-steps article {
    min-height: 0;
  }
}

.service-admin-cockpit {
  margin: 14px;
  padding: 14px;
  border: 1px solid rgba(96, 165, 250, .13);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, .42), rgba(30, 41, 59, .24));
}
.service-dashboard-header {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 12px;
}
.service-select-label {
  display: grid;
  align-content: end;
  gap: 8px;
  color: rgba(203, 213, 225, .82);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.service-summary-mini {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 12px;
  background: rgba(15, 23, 42, .26);
}
.service-summary-mini strong {
  color: rgba(241, 245, 249, .94);
  font-size: 15px;
}
.service-summary-mini span,
.service-summary-mini small {
  color: rgba(203, 213, 225, .68);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.service-task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.service-easy-path {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(96, 165, 250, .14);
  border-radius: 14px;
  background: rgba(37, 99, 235, .12);
}
.service-easy-path strong {
  color: rgba(241, 245, 249, .94);
  font-size: 13px;
}
.service-easy-path > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.service-easy-path button {
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 12px;
  background: rgba(15, 23, 42, .28);
  color: #e2e8f0;
  box-shadow: none;
  font-size: 12px;
}
.service-easy-path button:hover {
  transform: none;
  background: rgba(37, 99, 235, .32);
  box-shadow: none;
}
.service-task-grid.secondary-actions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.service-task {
  min-height: 82px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 14px;
  background: rgba(30, 41, 59, .42);
  color: #e2e8f0;
  box-shadow: none;
  font-size: 13px;
  text-align: left;
}
.service-task:hover,
.service-task.active {
  transform: none;
  border-color: rgba(96, 165, 250, .42);
  background: rgba(37, 99, 235, .34);
  box-shadow: none;
}
.service-task-icon {
  font-size: 19px;
  line-height: 1;
}
.service-task span:not(.service-task-icon) {
  font-weight: 900;
}
.service-task small {
  color: rgba(203, 213, 225, .64);
  font-size: 11px;
  line-height: 1.3;
}
.service-more-actions {
  margin-top: 10px;
  border: 0;
}
.service-more-actions > summary {
  width: fit-content;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 999px;
  color: rgba(203, 213, 225, .76);
  background: rgba(15, 23, 42, .2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}
.service-more-actions > summary::-webkit-details-marker { display: none; }
.service-more-actions[open] > summary {
  margin-bottom: 10px;
  color: #e2e8f0;
  background: rgba(37, 99, 235, .22);
}
.service-active-helper {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .1);
  border-radius: 12px;
  color: rgba(203, 213, 225, .74);
  background: rgba(15, 23, 42, .18);
  font-size: 13px;
  line-height: 1.45;
}
#tab-services:not(.has-active-detail) > .grid,
#tab-services:not(.has-active-detail) > .card.admin-collapsible-card,
#tab-services.has-active-detail > .grid:not(.service-active-container),
#tab-services.has-active-detail > .card.admin-collapsible-card:not(.is-active-detail) {
  display: none !important;
}
#tab-services.has-active-detail > .grid.service-active-container {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 10px !important;
}
#tab-services .admin-collapsible-card:not(.is-active-detail) {
  display: none;
}
#tab-services .admin-collapsible-card.is-active-detail {
  display: block;
}
/* Keep the four primary service tasks visible even after a detail opens.
   Human QA showed that hiding them made admins feel trapped in one form. */
#tab-services.has-active-detail .service-task-grid.primary-actions {
  display: grid;
  margin: 10px 0 12px;
}
#tab-services.has-active-detail .service-task-grid.primary-actions .service-task {
  min-height: 64px;
}
#tab-services.has-active-detail .service-more-actions {
  display: none;
}
.advanced-fields {
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, .22);
}
.advanced-fields summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: rgba(226, 232, 240, .86);
  font-weight: 800;
}
.advanced-fields[open] summary {
  margin-bottom: 12px;
}
.plan-output {
  display: grid;
  gap: 10px;
  min-height: 0;
}
.plan-summary,
.plan-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 12px;
  background: rgba(15, 23, 42, .22);
}
.plan-summary strong,
.plan-item strong {
  color: rgba(241, 245, 249, .94);
}
.plan-summary span,
.plan-item small {
  color: rgba(203, 213, 225, .72);
  font-size: 12px;
}
.plan-list {
  display: grid;
  gap: 8px;
}
.plan-item {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}
.plan-item > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #dbeafe;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-weight: 900;
}
.manifest-builder {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(96, 165, 250, .14);
  border-radius: 16px;
  background: rgba(15, 23, 42, .2);
}
.manifest-builder-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.manifest-builder-step strong {
  display: block;
  color: rgba(241, 245, 249, .94);
  font-size: 14px;
}
.manifest-builder-step span {
  display: block;
  margin-top: 2px;
  color: rgba(203, 213, 225, .7);
  font-size: 12px;
  line-height: 1.4;
}
.step-badge {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #dbeafe;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(37, 99, 235, .18);
}
.manifest-raw-override textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}
.secret-output.hidden { display: none; }
.secret-output-card {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(96, 165, 250, .18);
  border-radius: 14px;
  background: rgba(14, 165, 233, .08);
}
.secret-output-card > strong,
.secret-output-head strong {
  color: #e0f2fe;
}
.secret-output-head {
  display: grid;
  gap: 4px;
}
.secret-output-head span,
.secret-output-card > span {
  color: rgba(203, 213, 225, .78);
  font-size: 13px;
}
.secret-field-list {
  display: grid;
  gap: 8px;
}
.secret-field {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 10px;
  background: rgba(15, 23, 42, .24);
}
.secret-field span {
  color: rgba(203, 213, 225, .74);
  font-size: 12px;
  font-weight: 800;
}
.secret-field code {
  min-width: 0;
  color: #f8fafc;
  overflow-wrap: anywhere;
  white-space: normal;
}
.copy-mini {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 9px;
}
#service-credentials-form > label:first-child,
#service-form > label:first-child,
#service-api-key-form > label:first-child,
#service-resource-form > label:first-child,
#oidc-client-form > label:first-child {
  display: none;
}

@media (max-width: 900px) {
  .service-task-grid,
  .service-task-grid.secondary-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .service-admin-cockpit { margin: 10px; padding: 10px; }
  .service-dashboard-header { grid-template-columns: 1fr; gap: 10px; }
  .service-easy-path > div { grid-template-columns: 1fr; }
  .service-task-grid,
  .service-task-grid.secondary-actions { grid-template-columns: 1fr; }
  .service-task {
    min-height: 64px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    align-content: center;
    column-gap: 10px;
  }
  .service-task small {
    grid-column: 2;
  }
  .secret-field {
    grid-template-columns: 1fr;
  }
  body[data-role="admin"] .admin-section .table,
  body[data-role="user"] .admin-section .table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    white-space: normal;
  }
  body[data-role="admin"] .admin-section .table thead,
  body[data-role="user"] .admin-section .table thead {
    display: none;
  }
  body[data-role="admin"] .admin-section .table tbody,
  body[data-role="admin"] .admin-section .table tr,
  body[data-role="admin"] .admin-section .table td,
  body[data-role="user"] .admin-section .table tbody,
  body[data-role="user"] .admin-section .table tr,
  body[data-role="user"] .admin-section .table td {
    display: block;
    width: 100%;
    min-width: 0 !important;
  }
  body[data-role="admin"] .admin-section .table tr,
  body[data-role="user"] .admin-section .table tr {
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 14px;
    background: rgba(15, 23, 42, .18);
  }
  body[data-role="admin"] .admin-section .table td,
  body[data-role="user"] .admin-section .table td {
    border: 0;
    border-radius: 10px !important;
    background: transparent;
    padding: 8px;
    overflow-wrap: anywhere;
  }
  body[data-role="admin"] .admin-section .table td::before,
  body[data-role="user"] .admin-section .table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: rgba(148, 163, 184, .8);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
}

.readiness-checklist .muted {
  max-width: 820px;
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.readiness-grid article {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.38);
  min-width: 0;
}

.readiness-grid strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
}

.readiness-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.readiness-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid var(--border);
}

.readiness-badge.ready {
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(74, 222, 128, 0.35);
}

.readiness-badge.gap {
  color: #fde68a;
  background: rgba(217, 119, 6, 0.18);
  border-color: rgba(251, 191, 36, 0.35);
}

@media (max-width: 900px) {
  .readiness-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .readiness-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .table {
    display: block;
    overflow: visible;
    white-space: normal;
    border-spacing: 0;
  }
  .table thead {
    display: none;
  }
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .table tr {
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.38);
  }
  .table td {
    display: grid;
    grid-template-columns: minmax(86px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border: 0;
    background: transparent;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
  }
  .table td:first-child,
  .table td:last-child {
    border: 0;
    border-radius: 0;
  }
  .table tr:hover td {
    background: transparent;
    box-shadow: none;
  }
}

/* Signed-in light mode must feel like a real daylight workspace, not dark mode with white cards. */
html[data-theme="light"] body[data-role="admin"],
html[data-theme="light"] body[data-role="user"] {
  background:
    radial-gradient(circle at 12% 8%, rgba(37, 99, 235, .13), transparent 30rem),
    radial-gradient(circle at 84% 14%, rgba(14, 165, 233, .14), transparent 34rem),
    linear-gradient(135deg, #f7fbff 0%, #edf4ff 48%, #ffffff 100%);
  color: #0f172a;
}
html[data-theme="light"] body[data-role="admin"]::before,
html[data-theme="light"] body[data-role="user"]::before {
  opacity: .55;
  background-image:
    linear-gradient(rgba(30, 64, 175, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 64, 175, .045) 1px, transparent 1px);
}
html[data-theme="light"] body[data-role="admin"] .topbar,
html[data-theme="light"] body[data-role="user"] .topbar {
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(241, 247, 255, .78));
  box-shadow: 0 1px 0 rgba(15, 23, 42, .06), 0 14px 34px rgba(30, 64, 175, .10);
}
html[data-theme="light"] body[data-role="admin"] .workspace-layout .tabs button,
html[data-theme="light"] body[data-role="user"] .workspace-layout .tabs button {
  border-color: rgba(30, 64, 175, .10);
  background: rgba(255, 255, 255, .74);
  color: #334155;
}
html[data-theme="light"] body[data-role="admin"] .workspace-layout .tabs button.active,
html[data-theme="light"] body[data-role="user"] .workspace-layout .tabs button.active {
  border-color: rgba(37, 99, 235, .24);
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}
html[data-theme="light"] body[data-role="admin"] .app-tile:hover,
html[data-theme="light"] body[data-role="admin"] a.app-tile:hover,
html[data-theme="light"] body[data-role="admin"] button.app-tile:hover,
html[data-theme="light"] body[data-role="admin"] .app-tile:focus-visible,
html[data-theme="light"] body[data-role="user"] .app-tile:hover,
html[data-theme="light"] body[data-role="user"] a.app-tile:hover,
html[data-theme="light"] body[data-role="user"] button.app-tile:hover,
html[data-theme="light"] body[data-role="user"] .app-tile:focus-visible {
  border-color: rgba(37, 99, 235, .16);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 14px 30px rgba(30, 64, 175, .10);
}
html[data-theme="light"] body[data-role="admin"] .app-name,
html[data-theme="light"] body[data-role="user"] .app-name {
  color: #1e293b;
  text-shadow: none;
}
html[data-theme="light"] body[data-role="admin"] .app-status,
html[data-theme="light"] body[data-role="user"] .app-status {
  color: #64748b;
  text-shadow: none;
}
html[data-theme="light"] body[data-role="admin"] .app-tile .app-icon,
html[data-theme="light"] body[data-role="user"] .app-tile .app-icon {
  box-shadow: 0 16px 32px rgba(30, 64, 175, .18), inset 0 1px 0 rgba(255, 255, 255, .35);
}
html[data-theme="light"] body[data-role="admin"] .admin-section:not(#tab-admin),
html[data-theme="light"] body[data-role="user"] .admin-section:not(#tab-admin) {
  border-color: rgba(148, 163, 184, .24);
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 24px 70px rgba(30, 64, 175, .13);
}
html[data-theme="light"] .admin-panel-titlebar {
  border-bottom-color: rgba(148, 163, 184, .22);
  background: rgba(248, 250, 252, .92);
}
html[data-theme="light"] .admin-panel-titlebar h2,
html[data-theme="light"] .guide-hero h2,
html[data-theme="light"] .guide-flow h3,
html[data-theme="light"] .guide-choice h3,
html[data-theme="light"] .admin-details > summary,
html[data-theme="light"] .simple-step strong,
html[data-theme="light"] .guide-steps article strong,
html[data-theme="light"] .guide-map-item strong,
html[data-theme="light"] .service-summary-mini strong,
html[data-theme="light"] .manifest-builder-step strong,
html[data-theme="light"] .plan-summary strong,
html[data-theme="light"] .plan-item strong,
html[data-theme="light"] .secret-output-card > strong,
html[data-theme="light"] .secret-output-head strong {
  color: #0f172a;
}
html[data-theme="light"] .admin-panel-titlebar .admin-back,
html[data-theme="light"] button.secondary,
html[data-theme="light"] a.button-link.secondary {
  background: rgba(226, 232, 240, .92);
  color: #1e293b;
}
html[data-theme="light"] .admin-details,
html[data-theme="light"] body[data-role="admin"] .guide-section .card,
html[data-theme="light"] body[data-role="user"] .guide-section .card,
html[data-theme="light"] .guide-steps article,
html[data-theme="light"] .guide-map-item,
html[data-theme="light"] .service-summary-mini,
html[data-theme="light"] .advanced-fields,
html[data-theme="light"] .plan-summary,
html[data-theme="light"] .plan-item,
html[data-theme="light"] .manifest-builder,
html[data-theme="light"] .secret-field {
  border-color: rgba(148, 163, 184, .22);
  background: rgba(255, 255, 255, .66);
}
html[data-theme="light"] .admin-details[open] > summary {
  border-bottom-color: rgba(148, 163, 184, .20);
  background: rgba(239, 246, 255, .86);
}
html[data-theme="light"] .admin-details > summary::after,
html[data-theme="light"] .guide-steps article p,
html[data-theme="light"] .guide-map-item span,
html[data-theme="light"] .simple-step small,
html[data-theme="light"] .plan-summary span,
html[data-theme="light"] .plan-item small,
html[data-theme="light"] .service-summary-mini span,
html[data-theme="light"] .service-summary-mini small,
html[data-theme="light"] .secret-output-head span,
html[data-theme="light"] .secret-output-card > span {
  color: #64748b;
}
html[data-theme="light"] .guide-choice ul,
html[data-theme="light"] .manifest-builder-step span,
html[data-theme="light"] .advanced-fields summary {
  color: #475569;
}
html[data-theme="light"] .guide-choice code,
html[data-theme="light"] .secret-field code {
  color: #1d4ed8;
}
html[data-theme="light"] .simple-step,
html[data-theme="light"] .simple-step:hover {
  border-color: rgba(37, 99, 235, .18);
  background: linear-gradient(135deg, rgba(219, 234, 254, .82), rgba(255, 255, 255, .72));
}
html[data-theme="light"] .guide-map-item:hover {
  border-color: rgba(37, 99, 235, .24);
  background: rgba(219, 234, 254, .74);
}
html[data-theme="light"] .service-admin-cockpit {
  border-color: rgba(37, 99, 235, .16);
  background: linear-gradient(135deg, rgba(239, 246, 255, .84), rgba(255, 255, 255, .70));
}
html[data-theme="light"] .service-select-label {
  color: #475569;
}
html[data-theme="light"] .service-easy-path {
  border-color: rgba(37, 99, 235, .16);
  background: rgba(219, 234, 254, .56);
}
html[data-theme="light"] .service-easy-path strong,
html[data-theme="light"] .service-task span:not(.service-task-icon) {
  color: #0f172a;
}
html[data-theme="light"] .service-easy-path button,
html[data-theme="light"] .service-task {
  border-color: rgba(148, 163, 184, .22);
  background: rgba(255, 255, 255, .76);
  color: #1e293b;
}
html[data-theme="light"] .service-easy-path button:hover,
html[data-theme="light"] .service-task:hover,
html[data-theme="light"] .service-task.active {
  border-color: rgba(37, 99, 235, .26);
  background: rgba(219, 234, 254, .82);
}
html[data-theme="light"] .service-task small,
html[data-theme="light"] .service-active-helper,
html[data-theme="light"] .service-more-actions > summary {
  color: #64748b;
}
html[data-theme="light"] .service-more-actions > summary,
html[data-theme="light"] .service-active-helper {
  border-color: rgba(148, 163, 184, .22);
  background: rgba(255, 255, 255, .66);
}
html[data-theme="light"] .service-more-actions[open] > summary {
  color: #1d4ed8;
  background: rgba(219, 234, 254, .82);
}
html[data-theme="light"] .secret-output-card {
  border-color: rgba(14, 165, 233, .22);
  background: rgba(224, 242, 254, .58);
}
@media (max-width: 640px) {
  html[data-theme="light"] .table tr,
  html[data-theme="light"] body[data-role="admin"] .admin-section .table tr,
  html[data-theme="light"] body[data-role="user"] .admin-section .table tr {
    border-color: rgba(148, 163, 184, .22);
    background: rgba(255, 255, 255, .70);
  }
}

/* Persistent trust controls: signed-in users must always see logout without opening Settings. */
body[data-role="admin"] .session-cluster,
body[data-role="user"] .session-cluster {
  position: fixed;
  left: max(52px, env(safe-area-inset-left));
  top: 7px;
  bottom: auto;
  z-index: 120;
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: calc(100vw - 104px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
body[data-role="admin"] .session-cluster #language-select,
body[data-role="admin"] .session-cluster #theme-toggle,
body[data-role="user"] .session-cluster #language-select,
body[data-role="user"] .session-cluster #theme-toggle {
  display: none !important;
}
body[data-role="admin"] .session-cluster .status-pill,
body[data-role="user"] .session-cluster .status-pill {
  display: none !important;
}
body[data-role="admin"] .session-cluster #logout-button,
body[data-role="user"] .session-cluster #logout-button {
  display: inline-flex !important;
  width: auto;
  min-height: 32px;
  min-width: 0;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(255, 255, 255, .92);
  color: #0f172a;
}

.settings-more-block {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, .48);
  overflow: hidden;
}
.settings-more-block > summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
  list-style: none;
}
.settings-more-block > summary::-webkit-details-marker { display: none; }
.settings-more-block > summary::after {
  content: "+";
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.settings-more-block[open] > summary {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .56);
}
.settings-more-block[open] > summary::after {
  content: "–";
}
.settings-more-block > .grid {
  padding: 0 16px 16px;
}

#admin-user-sessions-list {
  outline: none;
  scroll-margin-top: 72px;
}
#admin-user-sessions-list.attention-flash {
  animation: session-focus-ring 1400ms ease-out 1;
}
@keyframes session-focus-ring {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .42); border-radius: 18px; }
  100% { box-shadow: 0 0 0 18px rgba(37, 99, 235, 0); border-radius: 18px; }
}

@media (max-width: 720px) {
  body[data-role="admin"] .session-cluster,
  body[data-role="user"] .session-cluster {
    left: max(46px, env(safe-area-inset-left));
    right: auto;
    top: 6px;
    bottom: auto;
    max-width: calc(100vw - 176px);
    display: flex !important;
    border-radius: 0;
  }
  body[data-role="admin"] .session-cluster .status-pill,
  body[data-role="user"] .session-cluster .status-pill {
    max-width: 100%;
  }
  body[data-role="admin"] .session-cluster #logout-button,
  body[data-role="user"] .session-cluster #logout-button {
    width: auto;
  }
  body[data-role="admin"] #app,
  body[data-role="user"] #app {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
