:root {
  --bg: #100d16;
  --bg-soft: #181320;
  --panel: rgba(39, 32, 50, 0.76);
  --panel-strong: rgba(47, 38, 60, 0.94);
  --text: #f5f1fb;
  --muted: #b8adca;
  --line: rgba(255,255,255,.09);
  --accent: #8f63ff;
  --accent-2: #b296ff;
  --danger: #ff7c8d;
  --success: #8ee6bb;
  --shadow: 0 20px 60px rgba(0,0,0,.34);
  --radius: 24px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 20% 0%, #2a1e3e 0, var(--bg) 36%, #0d0b12 100%); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow-x: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.hidden { display: none !important; }
.ambient { position: fixed; width: 340px; height: 340px; border-radius: 50%; filter: blur(90px); opacity: .17; pointer-events: none; }
.ambient-one { background: #8d5cff; top: -120px; right: -100px; }
.ambient-two { background: #5b35c8; bottom: -160px; left: -120px; }
.app-shell { width: min(1120px, calc(100% - 28px)); margin: 0 auto; min-height: 100vh; position: relative; z-index: 1; }
.center-view { min-height: 100vh; display: grid; place-items: center; padding: 28px 0; }
.boot-stack { display: grid; justify-items: center; }
.glass-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(50,41,64,.84), rgba(26,22,34,.8)); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.auth-card { width: min(440px, 100%); border-radius: 30px; padding: 28px; }
.brand-row { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.brand-mark { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-weight: 900; font-size: 28px; background: linear-gradient(145deg, var(--accent-2), #6d3fd8); box-shadow: 0 10px 28px rgba(142,99,255,.3); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 14px; font-size: 20px; flex: 0 0 auto; }
.eyebrow { margin: 0 0 4px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-2); font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 34px; }
h2 { margin-bottom: 8px; font-size: clamp(30px, 7vw, 54px); letter-spacing: -.04em; }
h3 { margin-bottom: 0; }
.muted { color: var(--muted); line-height: 1.55; }
.stack { display: grid; gap: 12px; margin-top: 28px; }
.field-label { color: #ddd4e9; font-size: 13px; font-weight: 700; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 15px; background: rgba(10,8,13,.56); color: var(--text); padding: 13px 14px; }
.code-input { text-align: center; letter-spacing: .6em; font-size: 28px; padding-left: calc(14px + .6em); font-weight: 800; }
.primary-button, .secondary-button { border: 0; border-radius: 15px; padding: 13px 16px; font-weight: 800; cursor: pointer; transition: transform .15s ease, opacity .15s ease, border-color .15s ease; }
.primary-button { background: linear-gradient(135deg, #9c74ff, #7247df); color: white; box-shadow: 0 10px 24px rgba(128,80,230,.25); }
.secondary-button { background: rgba(255,255,255,.07); border: 1px solid var(--line); }
.primary-button:hover, .secondary-button:hover, .module-card:hover { transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.error-text { color: var(--danger); font-size: 13px; text-align: center; }
.language-strip { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.language-strip button { border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 999px; padding: 7px 10px; font-size: 12px; cursor: pointer; }
.language-strip button.active { background: rgba(143,99,255,.22); border-color: rgba(178,150,255,.48); }
.portal { padding: 20px 0 44px; }
.topbar { border-radius: 22px; min-height: 72px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 12px; z-index: 10; }
.brand-button, .profile-chip { border: 0; background: transparent; display: flex; align-items: center; cursor: pointer; }
.brand-button { gap: 10px; }
.brand-copy { display: grid; text-align: left; }
.brand-copy strong { font-size: 17px; }
.brand-copy small, .profile-chip-copy small { color: var(--muted); font-size: 11px; }
.profile-chip { gap: 10px; border-radius: 16px; padding: 6px 8px; }
.profile-chip:hover { background: rgba(255,255,255,.04); }
.profile-chip-copy { display: grid; text-align: right; }
.profile-chip-copy strong { font-size: 13px; }
.chevron { color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; object-fit: cover; background: rgba(143,99,255,.18); border: 1px solid rgba(178,150,255,.28); font-weight: 900; background-size: cover; background-position: center; }
.avatar.large { width: 82px; height: 82px; font-size: 24px; }
.profile-menu { position: absolute; right: 12px; top: calc(100% + 8px); width: 200px; border-radius: 18px; padding: 8px; }
.profile-menu button { width: 100%; text-align: left; border: 0; background: transparent; padding: 11px 12px; border-radius: 11px; cursor: pointer; }
.profile-menu button:hover { background: rgba(255,255,255,.06); }
.hero { padding: 62px 8px 28px; }
.hero .muted { font-size: 17px; }
.profile-required { margin: 0 0 18px; border-radius: 18px; padding: 13px 15px; display: flex; gap: 10px; align-items: center; color: #e9e0f6; }
.profile-required strong { font-size: 13px; line-height: 1.4; }
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.module-card { min-height: 190px; border-radius: var(--radius); padding: 24px; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto; gap: 18px; align-items: start; text-align: left; cursor: pointer; border: 1px solid var(--line); color: var(--text); }
.module-icon { font-size: 34px; }
.module-copy { grid-column: 1 / 4; display: grid; gap: 7px; align-self: end; }
.module-copy strong { font-size: 22px; }
.module-copy small { color: var(--muted); line-height: 1.45; }
.module-arrow { justify-self: end; font-size: 22px; color: var(--accent-2); }
.module-status { justify-self: end; align-self: center; font-size: 11px; font-weight: 800; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; }
.module-card.profile-locked { opacity: .62; }
.module-card.profile-locked::after { content: '🔒'; justify-self: end; align-self: start; grid-column: 3; grid-row: 1; font-size: 15px; }
.module-card.profile-locked .module-arrow { display: none; }
.disabled-card { cursor: default; opacity: .72; }
.disabled-card:hover { transform: none; }
.overlay { position: fixed; inset: 0; z-index: 30; background: rgba(5,4,8,.68); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; }
.settings-panel { width: min(760px, 100%); max-height: min(88vh, 900px); overflow-y: auto; border-radius: 28px; padding: 22px; }
.settings-header { display: flex; justify-content: space-between; align-items: start; }
.settings-header h2 { font-size: 30px; margin: 0; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.05); font-size: 25px; cursor: pointer; }
.onboarding-notice { margin: 18px 0 4px; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(178,150,255,.24); background: rgba(143,99,255,.10); }
.onboarding-notice strong { display: block; margin-bottom: 4px; color: var(--accent-2); }
.onboarding-notice p { margin: 0; color: var(--muted); line-height: 1.45; font-size: 13px; }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin: 22px 0; }
.tab { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 11px 12px; color: var(--muted); cursor: pointer; font-weight: 800; }
.tab.active { color: var(--text); border-bottom-color: var(--accent-2); }
.settings-form { display: grid; gap: 12px; }
.avatar-editor { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.file-button { display: inline-block; cursor: pointer; margin-bottom: 7px; }
.readonly-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 7px 0; }
.readonly-grid > div { border: 1px solid var(--line); background: rgba(255,255,255,.03); padding: 13px; border-radius: 15px; display: grid; gap: 5px; }
.readonly-grid small { color: var(--muted); }
.form-message { border-radius: 12px; padding: 10px 12px; font-size: 13px; background: rgba(142,230,187,.1); color: var(--success); }
.form-message.error { background: rgba(255,124,141,.1); color: var(--danger); }
.section-divider { height: 1px; background: var(--line); margin: 28px 0; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.member-create { display: grid; grid-template-columns: 1.4fr .7fr 1fr auto; gap: 8px; }
.member-list { display: grid; gap: 8px; margin-top: 14px; }
.member-row { border: 1px solid var(--line); border-radius: 15px; padding: 11px 12px; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; background: rgba(255,255,255,.025); }
.member-main { display: grid; gap: 2px; }
.member-main small { color: var(--muted); }
.member-actions { display: flex; gap: 6px; }
.member-actions button { border: 1px solid var(--line); background: rgba(255,255,255,.05); border-radius: 10px; padding: 7px 9px; cursor: pointer; font-size: 12px; }
.member-actions button:disabled, .member-row select:disabled { opacity: .45; cursor: not-allowed; }
.spinner { width: 34px; height: 34px; margin-top: 18px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .app-shell { width: min(100% - 18px, 1120px); }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 150px; }
  .hero { padding-top: 42px; }
  .profile-chip-copy { display: none; }
  .settings-panel { border-radius: 24px 24px 0 0; width: 100%; max-height: 92vh; align-self: end; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .overlay { padding: 0; }
  .readonly-grid { grid-template-columns: 1fr; }
  .member-create { grid-template-columns: 1fr 1fr; }
  .member-create .primary-button { grid-column: 1 / 3; }
}
@media (max-width: 420px) {
  .auth-card { padding: 22px; }
  .brand-copy { display: none; }
  .member-create { grid-template-columns: 1fr; }
  .member-create .primary-button { grid-column: auto; }
  .member-row { grid-template-columns: 1fr; }
  .member-actions { justify-content: flex-end; }
}
