/* Akdira Account — Fluent-inspired UI (Outlook People style) in Akdira purple → cyan. */
:root {
  --brand: #7c3aed;
  --brand-hover: #6d28d9;
  --brand-pressed: #5b21b6;
  --brand-fg: #6d28d9;
  --brand-tint: #f5f3ff;
  --brand-tint-2: #ede9fe;
  --accent: #06b6d4;
  --grad: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --hover: #f5f5f5;
  --selected: #efeafd;
  --stroke: #e0e0e0;
  --stroke-2: #d1d1d1;
  --stroke-input: #8a8a8a;
  --text: #242424;
  --text-2: #424242;
  --text-3: #616161;
  --text-4: #707070;
  --danger: #c50f1f;
  --danger-tint: #fdf3f4;
  --success: #0e700e;
  --success-tint: #f1faf1;
  --info-tint: #f0f9ff;
  --warn-tint: #fffbeb;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .14), 0 0 2px rgba(0, 0, 0, .12);
  --shadow-4: 0 2px 4px rgba(0, 0, 0, .14), 0 0 2px rgba(0, 0, 0, .12);
  --shadow-16: 0 8px 16px rgba(0, 0, 0, .14), 0 0 2px rgba(0, 0, 0, .12);
  --shadow-64: 0 32px 64px rgba(0, 0, 0, .24), 0 0 8px rgba(0, 0, 0, .2);
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --topbar-h: 48px;
  --rail-w: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/20px var(--font); color: var(--text); background: var(--bg); }
a { color: var(--brand-fg); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--brand-tint); color: #4c1d95; padding: 1px 5px; border-radius: 3px; word-break: break-all; }
pre code { background: none; color: inherit; padding: 0; word-break: normal; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.muted { color: var(--text-3); }
.small { font-size: 12px; line-height: 16px; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 4px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.i { flex: none; display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--stroke-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .1s, border-color .1s;
}
.btn:hover { background: var(--hover); border-color: #c7c7c7; }
.btn:active { background: #e0e0e0; }
.btn .i { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); border-color: transparent; color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: transparent; }
.btn-primary:active { background: var(--brand-pressed); }
.btn-secondary { background: var(--surface); }
.btn-subtle { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-subtle:hover { background: rgba(0, 0, 0, .05); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger:hover { background: #a80d1a; border-color: transparent; }
.btn-danger-subtle { color: var(--danger); }
.btn-danger-subtle:hover { background: var(--danger-tint); border-color: #f1bbbc; }
.btn-icon { width: 32px; padding: 0; }
.btn-sm { height: 28px; padding: 0 8px; font-size: 13px; }
.btn-sm.btn-icon { width: 28px; }
.btn-wide { min-width: 108px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-fg); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Avatars ---------- */
.av { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; overflow: hidden; font-weight: 600; user-select: none; background: #e0e0e0; color: #424242; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-xs { width: 24px; height: 24px; font-size: 10px; }
.av-sm { width: 32px; height: 32px; font-size: 12px; }
.av-md { width: 40px; height: 40px; font-size: 15px; }
.av-lg { width: 56px; height: 56px; font-size: 20px; }
.av-xl { width: 96px; height: 96px; font-size: 34px; }
.av-xl .i { width: 44px; height: 44px; }
.av-lg .i { width: 28px; height: 28px; }
.av-c0 { background: #ede9fe; color: #5b21b6; } .av-c1 { background: #cffafe; color: #155e75; }
.av-c2 { background: #dcfce7; color: #166534; } .av-c3 { background: #fef3c7; color: #92400e; }
.av-c4 { background: #fee2e2; color: #991b1b; } .av-c5 { background: #e0e7ff; color: #3730a3; }
.av-c6 { background: #fce7f3; color: #9d174d; } .av-c7 { background: #ccfbf1; color: #115e59; }
.av-c8 { background: #ffedd5; color: #9a3412; } .av-c9 { background: #f3e8ff; color: #6b21a8; }
.av-c10 { background: #e0f2fe; color: #075985; } .av-c11 { background: #ecfccb; color: #3f6212; }
.av-group { background: var(--grad); color: #fff; border-radius: 12px; }
.av-plain { background: var(--surface-2); color: var(--text-3); border: 1px dashed var(--stroke-2); }
.stack-avatars { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.stack-avatars .av { margin-right: -14px; box-shadow: 0 0 0 2px #fff; }
.stack-avatars .av + .muted, .stack-avatars .muted { margin-left: 18px; }

/* ---------- Pills, chips ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; background: #f0f0f0; color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.pill .i { width: 14px; height: 14px; }
.pill-brand { background: var(--brand-tint-2); color: #5b21b6; }
.pill-danger { background: #fde7e9; color: var(--danger); }
.pill-muted { background: #f0f0f0; color: var(--text-3); height: 18px; font-size: 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--stroke); border-radius: 15px; color: var(--text); background: var(--surface); }
.chip:hover { background: var(--brand-tint); border-color: #c4b5fd; text-decoration: none; }
.chip .i { width: 16px; height: 16px; color: var(--brand-fg); }

/* ---------- Flash ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid; margin: 0 0 12px; font-size: 14px; }
.flash .i { margin-top: 1px; }
.flash-body { flex: 1; min-width: 0; }
.flash-success { background: var(--success-tint); border-color: #9fd89f; color: #0b5a0b; }
.flash-error { background: var(--danger-tint); border-color: #eeacb2; color: #a00d1a; }
.flash-info { background: var(--info-tint); border-color: #b4d6fa; color: #0c4a6e; }
.secret { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; padding: 8px; background: #fff; border: 1px solid var(--stroke); border-radius: var(--radius-sm); color: var(--text); }
.secret code { font-size: 14px; padding: 4px 8px; user-select: all; }
.secret-label { font-weight: 600; font-size: 12px; color: var(--text-3); }
.hint { font-size: 12px; margin-top: 4px; }

/* ================= Sign-in pages (Microsoft-style card) ================= */
.auth-body { min-height: 100vh; display: flex; flex-direction: column; background: #f2f2f6; overflow-x: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-bg span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.auth-bg span:nth-child(1) { width: 560px; height: 560px; left: -140px; top: -180px; background: #c4b5fd; }
.auth-bg span:nth-child(2) { width: 520px; height: 520px; right: -160px; bottom: -200px; background: #a5f3fc; }
.auth-bg span:nth-child(3) { width: 300px; height: 300px; right: 18%; top: 12%; background: #ddd6fe; opacity: .4; }
.auth-main { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); border-radius: 8px; padding: 44px; }
.auth-card-wide { max-width: 600px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; color: #3b3b3b; margin-bottom: 20px; letter-spacing: -.2px; }
.auth-title { font-size: 24px; line-height: 28px; font-weight: 600; color: #1b1b1b; margin: 0 0 8px; }
.auth-sub { margin: 0 0 16px; color: var(--text-2); font-size: 15px; }
.auth-text { color: var(--text-2); font-size: 15px; line-height: 22px; margin: 8px 0 16px; }
.auth-form { margin-top: 16px; }
.field-line { display: block; margin-bottom: 16px; }
.field-line input {
  width: 100%; height: 36px; padding: 6px 0; border: 0; border-bottom: 1px solid #666; border-radius: 0; outline: none;
  font: 15px var(--font); color: var(--text); background: transparent;
}
.field-line input:focus { border-bottom: 2px solid var(--brand); padding-bottom: 5px; }
.field-line input::placeholder { color: #707070; }
.auth-error { color: #d0021b; font-size: 14px; margin: 8px 0 12px; }
.field-hint { display: block; margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--text-3); }
.auth-switch { margin: 0 0 8px; font-size: 13px; color: var(--text-2); }
.auth-switch a, .auth-link { color: var(--brand-fg); font-size: 13px; }
.auth-actions-split { justify-content: space-between; align-items: center; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.auth-help { margin: 4px 0 12px; font-size: 13px; color: var(--text-2); }
.auth-help summary { color: var(--brand-fg); cursor: pointer; list-style: none; display: inline; }
.auth-help summary::-webkit-details-marker { display: none; }
.auth-help summary:hover { text-decoration: underline; }
.auth-help p { margin: 8px 0 0; }
.auth-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.auth-actions .btn { height: 34px; min-width: 108px; }
.auth-note { display: flex; align-items: center; gap: 10px; max-width: 440px; width: 100%; margin-top: 16px; padding: 12px 16px; background: rgba(255, 255, 255, .85); border-radius: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); color: var(--text-2); font-size: 14px; }
.auth-note .i { color: var(--brand-fg); }
.auth-account { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--text-2); font-size: 14px; }
.auth-account .i { width: 18px; height: 18px; }
.auth-footer { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; padding: 12px 20px; font-size: 12px; color: var(--text-3); }
.auth-footer a { color: var(--text-3); }

.account-list { list-style: none; margin: 8px -44px 0; padding: 0; }
.account-list li + li { border-top: 1px solid #f0f0f0; }
.account-list form { margin: 0; }
.account-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 44px; background: none; border: 0; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.account-row:hover { background: #f2f2f2; text-decoration: none; }
.account-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.account-name { font-size: 15px; font-weight: 600; }
.account-mail { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.account-state { color: var(--text-4); font-size: 12px; }
.account-chev { color: var(--text-4); }

.app-ident { display: flex; align-items: center; gap: 12px; margin: 12px 0 8px; }
.app-tile { width: 44px; height: 44px; border-radius: 10px; background: var(--grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.app-ident-name { font-size: 16px; font-weight: 600; }
.perm-list { list-style: none; padding: 0; margin: 0 0 16px; }
.perm-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14px; color: var(--text-2); }
.perm-list .i { color: var(--success); margin-top: 0; }
.kv.small dt { font-weight: 600; }

/* ================= Application shell (Outlook-like) ================= */
.app-body { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 12px; padding: 0 8px 0 0;
  background: linear-gradient(90deg, #4c1d95 0%, #6d28d9 45%, #0e7490 100%); color: #fff; position: relative; z-index: 20;
}
.topbar-left { display: flex; align-items: center; min-width: 0; }
.waffle { width: var(--topbar-h); height: var(--topbar-h); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.waffle:hover { background: rgba(255, 255, 255, .12); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none !important; padding-right: 8px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
.brand-product { font-weight: 400; font-size: 16px; opacity: .92; }
.topbar .logo-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); border-radius: 6px; }
.topsearch { flex: 1; max-width: 560px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.topsearch-spacer { flex: 1; }
.topsearch .i { position: absolute; left: 10px; width: 18px; height: 18px; color: var(--brand-fg); pointer-events: none; }
.topsearch input {
  width: 100%; height: 32px; border: 0; border-radius: var(--radius-sm); padding: 0 12px 0 36px; font: 14px var(--font);
  background: rgba(255, 255, 255, .92); color: var(--text); outline: none;
}
.topsearch input:focus { background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.top-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: #fff; border-radius: 4px; }
.top-icon:hover { background: rgba(255, 255, 255, .12); }
.me-menu { position: relative; }
.me-menu summary { list-style: none; cursor: pointer; padding: 4px; border-radius: 50%; display: block; }
.me-menu summary::-webkit-details-marker { display: none; }
.me-menu summary .av { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.me-pop { position: absolute; right: 0; top: 44px; width: 320px; max-width: calc(100vw - 16px); background: #fff; color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-16); padding: 0 0 16px; }
.me-pop-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; font-size: 13px; }
.me-pop-head form { margin: 0; }
.me-org { font-weight: 600; color: var(--text-3); }
.me-pop-id { display: flex; gap: 16px; align-items: center; padding: 8px 16px 0; }
.me-pop-id .av-lg { width: 72px; height: 72px; font-size: 26px; }
.me-name { font-size: 18px; font-weight: 600; line-height: 24px; }
.me-mail { color: var(--text-3); font-size: 13px; word-break: break-all; }

.shell { flex: 1; min-height: 0; display: flex; }
.rail { width: var(--rail-w); flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; background: var(--bg); overflow-y: auto; }
.rail-item { width: 60px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 6px; color: var(--text-3); font-size: 10.5px; line-height: 13px; text-align: center; position: relative; }
.rail-item:hover { background: #ebebeb; color: var(--text); text-decoration: none; }
.rail-item .i { width: 22px; height: 22px; }
.rail-item.active { color: var(--brand-fg); background: #fff; box-shadow: var(--shadow-2); font-weight: 600; }
.rail-item.active::before { content: ""; position: absolute; left: -4px; top: 14px; width: 3px; height: 20px; border-radius: 2px; background: var(--brand); }
.content { flex: 1; min-width: 0; min-height: 0; overflow: auto; padding: 8px 8px 8px 0; }

/* ---------- People hub: folders | list | detail ---------- */
.hub { height: 100%; display: grid; grid-template-columns: 220px minmax(280px, 340px) minmax(0, 1fr); gap: 8px; }
.folders, .list-pane, .detail-pane { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-2); min-height: 0; overflow: auto; }
.folders { padding: 12px 8px; }
.folder-section { margin-top: 16px; }
.folder-title { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 0 8px 4px; text-transform: none; }
.folder { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: var(--radius-sm); color: var(--text); position: relative; }
.folder:hover { background: var(--hover); text-decoration: none; }
.folder .i { width: 18px; height: 18px; color: var(--text-3); }
.folder span:nth-of-type(1) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder.active { background: var(--selected); font-weight: 600; }
.folder.active .i { color: var(--brand-fg); }
.folder.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--brand); }
.folder-add { color: var(--brand-fg); }
.folder-add .i { color: var(--brand-fg); }
.count { font-size: 12px; color: var(--text-3); font-weight: 400; }

.list-pane { display: flex; flex-direction: column; overflow: hidden; }
.list-pane > .flash { margin: 0 12px 8px; }
.list-head { padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid #f0f0f0; }
.list-title { display: flex; align-items: baseline; gap: 8px; }
.list-title h1 { font-size: 18px; line-height: 24px; text-transform: capitalize; }
.list-filter { position: relative; display: flex; align-items: center; }
.list-filter .i { position: absolute; left: 8px; width: 16px; height: 16px; color: var(--text-3); }
.list-filter input { width: 100%; height: 30px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); padding: 0 8px 0 30px; font: 13px var(--font); background: var(--surface-2); outline: none; }
.list-filter input:focus { border-color: var(--brand); background: #fff; }
.list { flex: 1; overflow-y: auto; padding: 4px 0 12px; }
.letter { position: sticky; top: 0; z-index: 1; background: rgba(255, 255, 255, .96); padding: 10px 16px 4px; font-size: 12px; font-weight: 700; color: var(--brand-fg); }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; margin: 0 4px; border-radius: 6px; color: var(--text); position: relative; }
.row:hover { background: var(--hover); text-decoration: none; }
.row.selected { background: var(--selected); }
.row.selected::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--brand); }
.row-main { min-width: 0; display: flex; flex-direction: column; }
.row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--text-3); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.detail-pane { padding: 0; }
.detail-pane.loading { opacity: .55; transition: opacity .15s; }
.empty { height: 100%; min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; color: var(--text-3); }
.empty h2 { font-size: 16px; color: var(--text); margin-top: 12px; }
.empty p { margin: 4px 0 0; }
.small-empty { min-height: 160px; }
.small-empty .i { width: 28px; height: 28px; }

.persona { padding: 24px 28px 32px; position: relative; }
.detail-back { display: none; margin: -8px 0 8px -8px; }
.persona-head { display: flex; gap: 20px; align-items: center; }
.persona-id { min-width: 0; }
.persona-id h2 { font-size: 24px; line-height: 30px; word-break: break-word; }
.persona-title { color: var(--text-2); font-size: 15px; margin-top: 2px; }
.persona-meta { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.persona-actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 20px 0 20px -6px; }
.action { width: 76px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 2px; background: none; border: 0; border-radius: 6px; color: var(--text-2); font: 12px var(--font); cursor: pointer; }
.action .i { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-fg); box-sizing: border-box; }
.action:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.action:hover .i { background: var(--brand-tint-2); }
.action.copied .i { background: var(--success-tint); color: var(--success); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 16px; }
.card h3 { font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 .i { color: var(--brand-fg); }
.kv { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.kv-row { display: flex; gap: 12px; align-items: flex-start; }
.kv-row > .i { color: var(--text-3); margin-top: 8px; }
.kv dt { font-size: 12px; color: var(--text-3); line-height: 16px; }
.kv dd { margin: 0; word-break: break-word; }
.kv-plain .kv-row { padding: 2px 0; }
.org-label { font-size: 12px; color: var(--text-3); margin: 4px 0 4px; }
.org-label ~ .org-label { margin-top: 12px; }
.mini { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 -8px; border-radius: 6px; color: var(--text); }
.mini:hover { background: var(--hover); text-decoration: none; }
.mini > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.mini-name { font-weight: 600; }
.mini-sub { font-size: 12px; color: var(--text-3); line-height: 16px; }
.about { margin: 0; white-space: pre-line; color: var(--text-2); }
.member-list { list-style: none; margin: 0 0 12px; padding: 0; }
.member-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.member-list li .mini { flex: 1; margin: 0; }
.member-list form { margin: 0; }

/* ---------- Panel pages (forms / settings) ---------- */
.panel-page { max-width: 880px; margin: 0 auto; padding: 16px 20px 48px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-2); min-height: 100%; }
.panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; min-height: 40px; }
.panel-head h1 { font-size: 20px; line-height: 28px; flex: 1; min-width: 0; }
.panel-actions { display: flex; gap: 8px; }
.title-with-avatar { display: inline-flex; align-items: center; gap: 12px; }
.settings-card { margin-top: 16px; }
.settings-card > p { margin-top: 0; }
.danger-zone { border-color: #f1bbbc; }
.danger-zone h3 .i { color: var(--danger); }
.profile-hero { display: flex; gap: 24px; align-items: center; }
.profile-hero h2 { font-size: 22px; line-height: 28px; }
.photo-edit { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.photo-edit form { margin: 0; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form.narrow { max-width: 420px; }
.form-section { border: 0; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 12px; }
.form-section legend { font-size: 15px; font-weight: 600; padding: 0; margin-bottom: 8px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; border-top: 1px solid #f0f0f0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--text-3); font-size: 12px; }
.field input, .field select, .field textarea, .inline-form input, .inline-form select {
  width: 100%; min-height: 32px; padding: 5px 10px; border: 1px solid var(--stroke-2); border-bottom-color: var(--stroke-input);
  border-radius: var(--radius-sm); font: 14px var(--font); color: var(--text); background: #fff; outline: none;
}
.field textarea { resize: vertical; line-height: 20px; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-form input:focus, .inline-form select:focus { border-bottom: 2px solid var(--brand); padding-bottom: 4px; }
.field input:disabled, .field input[readonly], .field textarea[readonly] { background: var(--surface-2); color: var(--text-3); }
.radio, .check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; line-height: 20px; }
.radio input, .check input { margin: 3px 0 0; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.inline-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.inline-form input, .inline-form select { flex: 1; width: auto; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack + form { margin-top: 16px; }

.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.group-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--stroke); border-radius: var(--radius); color: var(--text); transition: box-shadow .15s, border-color .15s; }
.group-card:hover { text-decoration: none; box-shadow: var(--shadow-4); border-color: #c4b5fd; }
.group-card .av { margin-bottom: 6px; }
.group-card-name { font-weight: 600; font-size: 15px; }
.group-card-desc { color: var(--text-3); font-size: 13px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--stroke); border-radius: var(--radius); margin: 12px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.table thead th { background: var(--surface-2); font-weight: 600; color: var(--text-2); }
.table tbody th { width: 200px; color: var(--text-2); font-weight: 600; }
.table tr:last-child td, .table tr:last-child th { border-bottom: 0; }
.row-warn td { background: #fffaf0; }

/* ================= Docs / developers / demo ================= */
.docs-body { min-height: 100vh; display: flex; flex-direction: column; background: #fbfbfd; }
.docs-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--stroke); position: sticky; top: 0; z-index: 5; }
.docs-top .brand { color: var(--text); }
.docs-nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.docs-nav a:not(.btn) { color: var(--text-2); }
.docs-main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 24px 64px; }
.docs-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 16px 0 32px; }
.docs-hero h1 { font-size: 36px; line-height: 44px; letter-spacing: -.5px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 16px; line-height: 26px; color: var(--text-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.button-preview { display: flex; flex-direction: column; gap: 0; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-4); }
.bp-row { padding: 32px; display: flex; justify-content: center; background: #fff; }
.bp-dark { background: #1f1f1f; }
.docs-section { padding: 24px 0; border-top: 1px solid var(--stroke); }
.docs-section h2 { font-size: 22px; line-height: 28px; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.docs-section h3 { font-size: 16px; margin: 20px 0 8px; }
.docs-section p { color: var(--text-2); line-height: 22px; }
.step { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.code { border-radius: var(--radius); overflow: hidden; margin: 12px 0; background: #1e1b2e; box-shadow: var(--shadow-2); }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 4px 14px; background: #2b2640; color: #c4b5fd; font-size: 12px; font-weight: 600; }
.code-head .btn { color: #e9e5ff; }
.code-head .btn:hover { background: rgba(255, 255, 255, .1); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; color: #ece9f8; font: 13px/20px var(--mono); }
.json { background: #1e1b2e; color: #ece9f8; padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; font: 12.5px/19px var(--mono); }
.json.wrap { white-space: pre-wrap; word-break: break-all; }

.demo { display: flex; justify-content: center; }
.demo-app { width: 100%; max-width: 760px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-16); overflow: hidden; }
.demo-app-bar { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: #0f172a; color: #fff; flex-wrap: wrap; }
.demo-app-bar .muted { color: #94a3b8; }
.demo-app-logo { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #f59e0b, #ef4444); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.demo-signin, .demo-signed { padding: 32px; }
.demo-signin { text-align: center; }
.demo-signin h1, .demo-signed h1 { font-size: 26px; line-height: 34px; margin-bottom: 8px; }
.demo-signed h2 { font-size: 15px; margin: 24px 0 8px; }
.demo-button { margin: 28px 0 12px; display: flex; justify-content: center; }
.demo-signed form { margin: 16px 0; }
.demo-signed details { margin-top: 16px; }

/* ================= Responsive ================= */
@media (max-width: 1180px) {
  .hub { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .folders { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 6px 8px; overflow-x: auto; overflow-y: hidden; }
  .folders .btn-block { width: auto; flex: none; }
  .folder-section { margin: 0; display: flex; gap: 4px; align-items: center; }
  .folder-title { display: none; }
  .folder { flex: none; white-space: nowrap; }
  .folder.active::before { display: none; }
}
@media (max-width: 760px) {
  :root { --rail-w: 0px; }
  .app-body { height: 100dvh; }
  .topbar { gap: 4px; }
  .brand-product, .top-icon { display: none; }
  .topsearch { margin: 0 4px; }
  .shell { flex-direction: column-reverse; }
  .rail { width: 100%; flex-direction: row; justify-content: space-around; padding: 4px; border-top: 1px solid var(--stroke); background: #fff; overflow: visible; }
  .rail-item { width: auto; flex: 1; padding: 6px 0 4px; }
  .rail-item.active { box-shadow: none; background: var(--brand-tint); }
  .rail-item.active::before { display: none; }
  .content { padding: 0; }
  .hub { display: flex; flex-direction: column; gap: 0; }
  .folders, .list-pane, .detail-pane, .panel-page { border-radius: 0; box-shadow: none; }
  .folders { flex: none; border-bottom: 1px solid var(--stroke); }
  .list-pane { flex: 1; }
  .detail-pane { display: none; }
  .has-detail .folders, .has-detail .list-pane { display: none; }
  .has-detail .detail-pane { display: block; flex: 1; }
  .detail-back { display: inline-flex; }
  .persona { padding: 16px 16px 32px; }
  .persona-head { flex-direction: column; text-align: center; gap: 12px; }
  .persona-head .pills { justify-content: center; }
  .persona-actions { justify-content: center; margin-left: 0; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .panel-page { padding: 12px 16px 40px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .profile-hero { flex-direction: column; text-align: center; }
  .profile-hero .pills { justify-content: center; }
  .auth-card { padding: 28px 24px; box-shadow: 0 2px 6px rgba(0, 0, 0, .14); }
  .account-list { margin: 8px -24px 0; }
  .account-row { padding: 12px 24px; }
  .docs-top { padding: 0 16px; }
  .docs-nav { gap: 10px; }
  .docs-nav a:not(.btn) { display: none; }
  .docs-main { padding: 20px 16px 48px; }
  .docs-hero { grid-template-columns: minmax(0, 1fr); }
  .docs-hero h1 { font-size: 28px; line-height: 36px; }
  .bp-row { padding: 24px 12px; }
  .demo-signin, .demo-signed { padding: 24px 16px; }
  .table tbody th { width: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- legal documents & consent ---------- */
.auth-card-legal { max-width: 860px; }
@media (max-width: 600px) { .auth-card { padding: 28px 20px; } }
.legal-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.legal-lang { display: flex; gap: 4px; font-size: 13px; }
.legal-lang a { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--stroke); color: var(--text-2); }
.legal-lang a[aria-current] { background: var(--brand-tint-2); border-color: transparent; color: var(--brand-pressed); font-weight: 600; }
.legal-note { display: flex; gap: 8px; align-items: flex-start; background: var(--info-tint); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; color: var(--text-2); }
.legal-note .i { flex: none; margin-top: 1px; }
.legal { font-size: 14.5px; line-height: 23px; color: var(--text-2); }
.legal h2 { font-size: 17px; line-height: 24px; color: var(--text); margin: 28px 0 8px; scroll-margin-top: 16px; }
.legal p { margin: 8px 0; }
.legal ol, .legal ul { margin: 8px 0; padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal-lead { font-size: 15.5px; color: var(--text); }
.legal-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13.5px; line-height: 20px; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--stroke); }
.legal-table th { background: var(--surface-2); color: var(--text); font-weight: 600; }
@media (max-width: 600px) { .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; } .legal-table thead { display: none; } .legal-table td { border: 0; padding: 4px 0; } .legal-table tr { border-bottom: 1px solid var(--stroke); padding: 8px 0; } .legal-table td:first-child { font-weight: 600; color: var(--text); } }
.legal-foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--stroke); font-size: 13px; }
.consent { display: grid; gap: 10px; margin: 4px 0 16px; font-size: 13px; line-height: 19px; color: var(--text-2); }
.danger-card { border: 1px solid #f1bbbc; }
.danger-card h3 { color: var(--danger); }
