:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  --bg: #090e15;
  --panel: #101822;
  --panel-hi: #141f2b;
  --line: #253240;
  --muted: #82909f;
  --text: #e5edf2;
  --mint: #c4a1ff;
  --blue: #b794f6;
  --gold: #ecc47a;
  --red: #ff7b86;
}

* { box-sizing: border-box; }
body { min-width: 360px; min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.ambient { position: fixed; z-index: -1; width: 520px; height: 520px; border-radius: 50%; filter: blur(120px); opacity: .1; pointer-events: none; }
.ambient-one { top: -280px; left: 32%; background: #8925ba; }
.ambient-two { right: -370px; bottom: -250px; background: #356acd; }
.layout { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 2; display: flex; width: 260px; flex-direction: column; padding: 25px 17px 20px; border-right: 1px solid #1e2935; background: #0b1119f5; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 4px 30px; color: inherit; text-decoration: none; }
.brand-mark,.login-emblem { display: grid; width: 43px; height: 43px; place-items: center; border: 1px solid #74498a; border-radius: 12px; color: #14031c; background: linear-gradient(140deg,#cb94ed,#8b43af); box-shadow: 0 7px 22px #54cdb330; font-size: 23px; font-weight: 800; }
.brand strong,.brand small { display: block; }
.brand strong { color: #edf4f8; font-size: 12px; letter-spacing: .09em; }
.brand small { margin-top: 4px; color: #6d8389; font-size: 8px; letter-spacing: .17em; }
.side-label,.banner-kicker,.eyebrow { color: #6b8790; font-size: 9px; font-weight: 700; letter-spacing: .17em; }
.side-label { padding: 19px 8px 10px; border-top: 1px solid #1d2833; }
.sidebar-stats { display: flex; align-items: center; gap: 8px; padding: 10px 8px 16px; color: #8ca0ab; font-size: 8px; font-weight: 700; letter-spacing: .11em; }
.sidebar-stats strong { margin-left: auto; color: #b8c8ce; font-size: 12px; }
.pulse { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px #77e0c188; }
.gang-list { display: grid; gap: 5px; overflow-y: auto; }
.gang-nav-item { display: flex; min-height: 56px; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; text-align: left; }
.gang-nav-item:hover { background: #ffffff08; }
.gang-nav-item.active { border-color: #392444; background: linear-gradient(100deg,#281431,#111e25); box-shadow: inset 2px 0 #b670df; }
.gang-nav-emblem { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid #314452; border-radius: 10px; color: #9bb8c2; background: #17232e; font-size: 13px; font-weight: 700; }
.active .gang-nav-emblem { border-color: #583969; color: var(--mint); background: #301c39; }
.gang-nav-copy { display: grid; min-width: 0; gap: 4px; }
.gang-nav-copy strong { overflow: hidden; color: #d8e2e8; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.gang-nav-copy small { overflow: hidden; color: #72838f; font-size: 8px; letter-spacing: .11em; text-overflow: ellipsis; white-space: nowrap; }
.gang-nav-count { display: grid; min-width: 22px; height: 21px; place-items: center; margin-left: auto; border-radius: 6px; color: #9cabb4; background: #202b35; font-size: 9px; }
.sidebar-empty { padding: 4px 8px; color: #778895; font-size: 11px; }
.sidebar-bottom { display: grid; gap: 20px; margin-top: auto; }
.security-note { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border: 1px solid #24343d; border-radius: 10px; background: #101a22; }
.security-note > span { color: var(--mint); font-size: 18px; }
.security-note p { margin: 0; color: #b5c3c9; font-size: 10px; line-height: 1.5; }
.security-note small { color: #71818a; font-size: 9px; }
.build-label { padding-left: 4px; color: #536570; font-size: 8px; letter-spacing: .12em; }
.build-label span { color: var(--mint); }
.main { min-height: 100vh; margin-left: 260px; }
.topbar { position: sticky; top: 0; z-index: 1; display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 15px; padding: 0 4.4vw; border-bottom: 1px solid #1d2833; background: #0b121aeF; backdrop-filter: blur(15px); }
.crumbs { display: flex; gap: 10px; align-items: center; color: #667783; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.crumbs i { color: #46545e; font-style: normal; }
.crumbs strong { color: #b9c7cd; }
.account-area { display: flex; align-items: center; gap: 10px; }
.account-avatar { display: grid; width: 32px; height: 32px; overflow: hidden; place-items: center; border: 1px solid #334554; border-radius: 10px; color: var(--mint); background: #162630; font-weight: 700; }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-copy { display: grid; gap: 3px; }
.account-name { color: #dce5e9; font-size: 10px; }
.role-badge { color: var(--mint); font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.role-viewer { color: #98b8d8; }
.role-manager { color: var(--gold); }
.role-owner { color: #f3d27a; }
.role-access { color: #ba80d8; }
.logout-button { margin-left: 6px; padding: 7px 9px; border: 1px solid #293743; border-radius: 7px; color: #93a2ad; background: #121c25; font-size: 9px; }
.logout-button:hover { color: #e8eff3; border-color: #4a5c67; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 8px 0 5px; color: #f1f5f7; font-size: clamp(24px,3vw,34px); font-weight: 620; letter-spacing: -.04em; }
.subheading { margin: 0; color: #7e8d98; font-size: 11px; }
.main > #dashboard { max-width: 1320px; margin: 0 auto; padding: 35px clamp(20px,4.4vw,66px) 60px; }
.personal-profile-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(280px,.75fr); gap: 16px; }
.personal-profile-card { min-width: 0; padding: 24px; border: 1px solid #263642; border-radius: 12px; background: linear-gradient(145deg,#121d27,#101820); }
.profile-card-heading { margin-bottom: 22px; }
.profile-card-heading h2 { margin: 8px 0 0; color: #e4edf1; font-size: 17px; font-weight: 600; }
.identity-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.identity-preview > div { display: grid; gap: 6px; }
.identity-preview strong { color: #e7eff2; font-size: 15px; }
.identity-preview small { color: #82919c; font-size: 10px; }
.large-profile-avatar { width: 68px; height: 68px; border: 1px solid #594563; border-radius: 50%; object-fit: cover; background: #182831; }
.profile-form { display: grid; gap: 16px; }
.profile-form > label:not(.upload-box) { display: grid; gap: 8px; color: #b7c5cb; font-size: 10px; font-weight: 600; }
.profile-form input:not([type="radio"]):not([type="file"]) { min-height: 39px; padding: 0 11px; border: 1px solid #33434e; border-radius: 7px; outline: none; color: #e2ebef; background: #0c141c; }
.profile-form input:focus { border-color: #8d5ba9; }
.avatar-choices { display: grid; gap: 11px; margin: 0; padding: 13px; border: 1px solid #283943; border-radius: 8px; }
.avatar-choices legend { padding: 0 5px; color: #98aab2; font-size: 10px; }
.avatar-choices label { display: flex; align-items: center; gap: 9px; color: #c3cfd4; font-size: 10px; }
.avatar-choices input { accent-color: #ba77e0; }
.profile-form .upload-box { background: #131e27; }
.profile-save-hint { margin: 0; color: #82929a; font-size: 10px; line-height: 1.5; }
.profile-login-meta { display: grid; gap: 7px; margin-top: 24px; padding-top: 16px; border-top: 1px solid #26343e; }
.profile-login-meta small { color: #71848e; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.profile-login-meta strong { color: #cbd7dc; font-size: 11px; font-weight: 550; }
.directory-user-avatar { width: 23px; height: 23px; margin-right: 8px; border: 1px solid #3a5158; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.profile-user-avatar { width: 68px; height: 68px; border: 1px solid #594563; border-radius: 50%; object-fit: cover; }
.intel-author { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; color: #82969e; font-size: 9px; }
.intel-author img { width: 19px; height: 19px; border: 1px solid #4a3951; border-radius: 50%; object-fit: cover; }
.record-detail-fields > .intel-author { grid-column: 1 / -1; }
.welcome-banner { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 30px; padding: 12px 16px; border: 1px solid #263840; border-radius: 10px; background: linear-gradient(100deg,#1c1221,#111a22); }
.welcome-banner > div { display: grid; gap: 6px; }
.welcome-banner strong { color: #d7c9dc; font-size: 11px; font-weight: 550; }
.secure-badge { display: flex; align-items: center; gap: 7px; color: #9b84a9; font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.button { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border: 1px solid transparent; border-radius: 7px; font-size: 10px; font-weight: 650; text-decoration: none; transition: .16s; }
.button-primary { border-color: #a568c8; color: #13061a; background: linear-gradient(110deg,#be82e3,#ac75c6); box-shadow: 0 5px 18px #52caab18; }
.button-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button-primary span { font-size: 15px; }
.button-secondary { border-color: #35434e; color: #bcc9d0; background: #19242e; }
.button-secondary:hover { border-color: #597078; }
.button-danger { border-color: #653740; color: #ff9099; background: #281a20; }
.button-danger:hover { background: #352027; }
.profile-hero { position: relative; display: flex; min-height: 190px; align-items: center; justify-content: space-between; gap: 20px; overflow: hidden; margin-bottom: 14px; padding: 28px 32px; border: 1px solid #2a3b42; border-radius: 14px; background: radial-gradient(ellipse at 82% 44%,#174a4270 0%,transparent 45%),linear-gradient(120deg,#111d26,#1e1424 80%,#201325); }
.profile-orb { position: absolute; top: -90px; right: 14%; width: 240px; height: 240px; border: 1px solid #9de5c410; border-radius: 50%; box-shadow: 0 0 0 22px #9de5c406,0 0 0 48px #9de5c404; }
.profile-copy { position: relative; z-index: 1; max-width: 75%; }
.type-pill,.intel-type { display: inline-flex; align-items: center; padding: 5px 8px; border: 1px solid #5c416c; border-radius: 5px; color: #be91da; background: #2b1934; font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.profile-copy h2 { margin: 12px 0 7px; color: #f3f1f5; font-size: clamp(22px,3vw,32px); font-weight: 620; letter-spacing: -.035em; }
.profile-copy p { max-width: 670px; margin: 0; color: #a3b2b5; font-size: 11px; line-height: 1.6; }
.profile-hero > button { position: relative; z-index: 1; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 0 0 38px; }
.stat-card { display: flex; min-height: 75px; align-items: center; gap: 12px; padding: 12px; border: 1px solid #25313d; border-radius: 10px; background: #111a24; }
.stat-icon { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border-radius: 9px; font-size: 17px; }
.stat-icon.cyan { color: #c384dc; background: #19343a; }
.stat-icon.violet { color: #b6a6ec; background: #2a263b; }
.stat-icon.lime { color: #a68bd9; background: #2d2736; }
.stat-icon.amber { color: #e9c784; background: #3b3224; }
.stat-copy { display: grid; gap: 5px; }
.stat-copy span { color: #768793; font-size: 7px; font-weight: 700; letter-spacing: .1em; }
.stat-copy strong { color: #e1e8eb; font-size: 19px; font-weight: 600; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.section-head h2 { margin-top: 6px; color: #e6edf0; font-size: 18px; font-weight: 600; letter-spacing: -.025em; }
.intel-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.intel-card { overflow: hidden; border: 1px solid #273440; border-radius: 11px; background: #111a24; transition: transform .18s,border-color .18s; }
.intel-card:hover { transform: translateY(-2px); border-color: #3b555c; }
.intel-image { position: relative; display: grid; height: 165px; overflow: hidden; place-items: center; border-bottom: 1px solid #26313c; background: radial-gradient(ellipse at 50% 100%,#291832,#151e27 70%); }
.intel-image img { width: 100%; height: 100%; object-fit: cover; }
.intel-image.image-missing::after { position: absolute; inset: auto 0 0; padding: 7px; color: #e5aa9b; background: #1c1518dd; content: "Image unavailable"; font-size: 9px; text-align: center; }
.image-placeholder { color: #9b7faa; font-size: 47px; font-weight: 200; }
.intel-card-body { padding: 13px; }
.intel-card-top { display: flex; align-items: center; justify-content: space-between; }
.intel-type { padding: 4px 6px; border-color: #3b5861; color: #96c8d2; background: #1a2a34; font-size: 7px; }
.intel-outfit { border-color: #625444; color: #e0bf8e; background: #30291f; }
.edit-record-button { padding: 5px 8px; border: 1px solid #34434e; border-radius: 5px; color: #a8b7c0; background: #17232c; font-size: 9px; }
.intel-card h3 { margin: 11px 0 6px; color: #e5edf1; font-size: 14px; font-weight: 600; }
.intel-details { min-height: 42px; margin: 0; color: #8797a2; font-size: 10px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.intel-card-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid #25313b; color: #5f717d; font-size: 7px; letter-spacing: .06em; }
.intel-empty,.empty-state { display: grid; min-height: 180px; place-content: center; justify-items: center; gap: 8px; border: 1px dashed #34414b; border-radius: 12px; color: #80909b; background: #101821a8; text-align: center; }
.intel-empty strong,.empty-state h2 { color: #cbd6db; font-size: 13px; }
.intel-empty p,.empty-state p { max-width: 420px; margin: 0; color: #7d8b96; font-size: 10px; line-height: 1.5; }
.empty-icon { color: #b284cd; font-size: 28px; }
.empty-state { min-height: 240px; }
.login-screen { display: grid; min-height: calc(100vh - 63px); place-items: center; padding: 25px; }
.login-card { width: min(100%,440px); padding: 37px; border: 1px solid #2b3c46; border-radius: 17px; background: radial-gradient(ellipse at 100% 0%,#17433c55,transparent 48%),#111a23; box-shadow: 0 20px 80px #0005; }
.login-emblem { width: 50px; height: 50px; margin-bottom: 29px; border-radius: 14px; }
.login-card h1 { margin: 12px 0; color: #f3eef5; font-size: 34px; line-height: 1.12; letter-spacing: -.04em; }
.login-card h1 em { color: var(--mint); font-style: normal; }
.login-card > p { margin: 0 0 24px; color: #92a1aa; font-size: 12px; line-height: 1.6; }
.button-discord { min-height: 43px; color: #101820; background: #c4d4df; }
.button-discord:hover { background: #e0eaf0; }
.discord-symbol { font-size: 18px; }
.error-body .login-screen { min-height: 100vh; }
.error-card .login-emblem { display: grid; place-items: center; font-size: 24px; }
.error-denied { border-color: #5a2f38; background: radial-gradient(ellipse at 100% 0%,#5a1f2c55,transparent 48%),#111a23; }
.error-denied .login-emblem { background: #4a1f29; }
.error-denied .eyebrow { color: #f08a9b; }
.error-failed .login-emblem { background: #4a3d1c; }
.error-failed .eyebrow { color: #e8c36a; }
.error-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.error-home { color: #bb8bd5; font-size: 11px; text-decoration: none; }
.error-home:hover { text-decoration: underline; }
.login-foot { display: flex; align-items: center; gap: 8px; margin-top: 26px; color: #71828c; font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 10; max-width: min(420px,calc(100vw - 50px)); padding: 12px 15px; border: 1px solid #5c416b; border-radius: 9px; opacity: 0; color: #e0d3e8; background: #1f1425; box-shadow: 0 12px 35px #0005; font-size: 11px; pointer-events: none; transform: translateY(8px); transition: .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #75414a; color: #ffd3d6; background: #2a1b20; }
.editor-dialog { width: min(100% - 30px,540px); max-height: min(90vh,800px); overflow-y: auto; padding: 0; border: 1px solid #354450; border-radius: 14px; color: var(--text); background: #101922; box-shadow: 0 25px 100px #000a; }
.editor-dialog::backdrop { background: #03070bc9; backdrop-filter: blur(5px); }
.editor-dialog form { display: grid; gap: 15px; padding: 22px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.dialog-head h2 { margin-top: 5px; color: #e8eef1; font-size: 19px; }
.icon-button { width: 30px; height: 30px; border: 1px solid #2c3943; border-radius: 7px; color: #a5b3bb; background: #17222b; font-size: 19px; }
.editor-dialog label:not(.upload-box):not(.check-row) { display: grid; gap: 7px; color: #afbec6; font-size: 10px; font-weight: 600; }
.editor-dialog input:not([type=file]):not([type=checkbox]),.editor-dialog select,.editor-dialog textarea { width: 100%; padding: 10px 11px; border: 1px solid #34434e; border-radius: 7px; outline: none; color: #e1e9ec; background: #0b1219; font-size: 11px; }
.editor-dialog input:focus,.editor-dialog select:focus,.editor-dialog textarea:focus { border-color: #9d65bd; box-shadow: 0 0 0 2px #64c4a51b; }
.editor-dialog textarea { resize: vertical; }
.record-detail-fields small { color: #758791; font-size: 7px; font-weight: 700; letter-spacing: .13em; }
.record-detail-fields strong { color: #c5d1d5; font-size: 10px; font-weight: 500; overflow-wrap: anywhere; }
.upload-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px dashed #3b4d57; border-radius: 8px; color: #c2cdd1; background: #131e27; font-size: 10px; }
.upload-box small { display: block; margin-top: 5px; color: #778992; font-size: 8px; }
.upload-box input { width: min(55%,230px); color: #8ea0a9; font-size: 9px; }
.check-row { display: flex; align-items: center; gap: 8px; color: #c0ccd1; font-size: 10px; }
.check-row input { accent-color: #a568c8; }
.image-preview { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 11px; color: #82929b; font-size: 9px; }
.image-preview img { width: 80px; height: 54px; border: 1px solid #34434e; border-radius: 6px; object-fit: cover; }
.image-preview small { overflow: hidden; text-overflow: ellipsis; }
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.dialog-actions > span { flex: 1; }
.shell { width: min(100% - 40px,1500px); min-height: 100vh; margin: 0 auto; padding-bottom: 60px; }
.masthead { display: flex; min-height: 90px; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 6px; }
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; }
.brand-text { display: grid; gap: 4px; }
.brand-text small { color: #a986bc; font-size: 8px; font-weight: 700; letter-spacing: .18em; }
.brand-text strong { color: #efe9f1; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.account-area { display: flex; align-items: center; gap: 10px; }
.account-name { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-tabs { position: relative; display: flex; min-height: 56px; align-items: stretch; gap: 5px; border-top: 1px solid #25303a; border-bottom: 1px solid #25303a; }
.tab-indicator { position: absolute; bottom: -1px; left: 0; height: 2px; width: 0; border-radius: 2px; background: #b886d8; box-shadow: 0 0 10px #86d8b680; opacity: 0; pointer-events: none; }
.tab-indicator.animated { transition: transform .38s cubic-bezier(.4,0,.2,1), width .38s cubic-bezier(.4,0,.2,1), opacity .2s; }
.account-area { position: relative; }
.account-trigger { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border: 0; border-radius: 12px; color: #dce5e9; background: transparent; cursor: pointer; }
.account-trigger:hover,.account-trigger[aria-expanded="true"] { background: #17232b; }
.account-trigger .account-name { font-size: 13px; font-weight: 600; }
.account-chevron { color: #8898a2; font-size: 15px; transition: transform .25s; }
.account-trigger[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
.account-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 250px; padding: 8px; border: 1px solid #2b3c46; border-radius: 14px; background: #111a23; box-shadow: 0 18px 50px #0008; opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s; }
.account-menu.open { opacity: 1; transform: none; visibility: visible; }
.account-menu-head { display: flex; align-items: center; gap: 11px; padding: 8px 8px 12px; }
.account-menu-head .account-avatar { width: 38px; height: 38px; flex: none; }
.account-menu-copy { display: grid; min-width: 0; gap: 3px; }
.account-menu-copy strong { overflow: hidden; color: #f3eef5; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-copy small { overflow: hidden; color: #8798a0; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-item { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 10px; border: 0; border-radius: 8px; color: #c4d0d4; background: transparent; font-size: 13px; text-align: left; cursor: pointer; }
.account-menu-item > span { width: 18px; color: #a88bb9; text-align: center; }
.account-menu-item:hover { color: #fff; background: #1b2a33; }
.account-menu-divider { height: 1px; margin: 6px 4px; background: #25303a; }
.main-tab { display: flex; min-width: 138px; align-items: center; justify-content: center; gap: 9px; margin: 0 0 -1px; padding: 0 15px; border: 0; border-bottom: 2px solid transparent; color: #8898a2; background: transparent; font-size: 11px; }
.main-tab > span { color: #baa4c8; font-size: 14px; }
.main-tab b { display: grid; min-width: 20px; height: 18px; place-items: center; border-radius: 5px; color: #9eafb7; background: #1b2731; font-size: 8px; }
.main-tab:hover { color: #e7e0ea; background: #ffffff05; }
.main-tab.active { border-bottom-color: transparent; color: #f1edf3; }
.main-tab.active b { color: #c8a1e3; background: #2f1d3a; }
.roster-overview,.coc-overview { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,410px),1fr)); gap: 14px; }
.roster-card { min-width: 0; padding: 17px; border: 1px solid #27343e; border-radius: 9px; background: #111a22; }
.roster-card-heading { display: grid; gap: 5px; margin-bottom: 15px; }
.roster-card-heading h2 { margin: 0; color: #e8e1ec; font-size: 17px; }
.roster-card-heading .eyebrow { color: #a979c8; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.roster-rank-table { display: grid; }
.roster-rank-row { display: grid; grid-template-columns: minmax(0,1fr) 95px 75px; gap: 10px; align-items: center; min-height: 37px; border-bottom: 1px solid #202c35; color: #c4b8c8; font-size: 11px; }
.roster-rank-row > :not(:first-child) { text-align: right; }
.roster-rank-header { min-height: 28px; color: #74858e; font-size: 8px; text-transform: uppercase; }
.roster-summary { margin: 12px 0 0; color: #a88eb9; font-size: 10px; }
.roster-empty { margin: 10px 0 0; color: #84939a; font-size: 11px; }
.coc-rank-group { margin-top: 15px; }
.coc-rank-group h3 { margin: 0 0 7px; color: #c4a9d6; font-size: 11px; }
.coc-member-list { display: grid; gap: 6px; }
.coc-member-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid #26333c; border-radius: 6px; color: #aebdc0; font-size: 10px; }
.coc-member-name { overflow: hidden; color: #e6e0e9; text-overflow: ellipsis; white-space: nowrap; }
.coc-member-row small { grid-column: 1 / -1; color: #74858e; font-size: 8px; }
.empty-inline { padding: 18px; border: 1px solid #27343e; border-radius: 8px; color: #becbc9; background: #111a22; }
.empty-inline strong { display: block; margin-bottom: 6px; color: #e8e2ec; }
.empty-inline p { margin: 0; color: #9aa9ad; font-size: 11px; }
.roster-loading { grid-column: 1 / -1; display: grid; gap: 8px; justify-items: center; padding: 48px 20px; border: 1px solid #27343e; border-radius: 9px; background: #111a22; text-align: center; }
.roster-loading strong { color: #e8e2ec; font-size: 14px; }
.roster-loading p { margin: 0; color: #8798a0; font-size: 11px; }
.loading-bar { position: relative; width: min(100%,360px); height: 6px; margin-top: 12px; overflow: hidden; border-radius: 99px; background: #1b2731; }
.loading-bar span { position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 99px; background: linear-gradient(90deg,#853fae,#b886d8); animation: loading-slide 1.2s ease-in-out infinite; }
@keyframes loading-slide { 0% { left: -40%; } 100% { left: 100%; } }
.tabs-spacer { flex: 1; }
.sync-database-button { display: inline-flex; min-height: 30px; align-self: center; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid #35464e; border-radius: 6px; color: #c4b6cc; background: #17232b; font-size: 9px; font-weight: 600; white-space: nowrap; }
.sync-database-button:hover:not(:disabled) { border-color: #9d65bd; color: #e6d9ee; background: #281a30; }
.sync-database-button:disabled { opacity: .65; cursor: wait; }
.sync-database-button[aria-busy="true"] span { animation: sync-spin .8s linear infinite; }
@keyframes sync-spin { to { transform: rotate(360deg); } }
.connection-status { display: flex; align-items: center; gap: 8px; color: #73858e; font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.connection-status i,.login-foot i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px #77e0c180; }
#dashboard { padding-top: 32px; }
.page-heading { margin: 0 0 25px; }
.page-heading h1 { margin: 7px 0 5px; font-size: 29px; }
.directory-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 12px; }
.search-box { display: flex; width: min(100%,370px); height: 37px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid #2b3944; border-radius: 7px; color: #8ca0a9; background: #111a23; }
.search-box > span { font-size: 17px; }
.search-box input { width: 100%; border: 0; outline: 0; color: #e2ebee; background: transparent; font-size: 10px; }
.search-box input::placeholder { color: #697a85; }
.directory-total { color: #73838c; font-size: 9px; }
.directory-list { display: grid; gap: 7px; }
.directory-row { display: grid; grid-template-columns: minmax(180px,1.2fr) minmax(120px,.8fr) minmax(100px,.65fr) minmax(110px,.65fr) auto; min-height: 67px; align-items: center; gap: 12px; padding: 10px 15px; border: 1px solid #273440; border-radius: 9px; background: linear-gradient(105deg,#131e28,#101821); transition: border-color .16s,transform .16s; }
.directory-row:hover { transform: translateY(-1px); border-color: #5a4664; }
.ally-row { grid-template-columns: minmax(180px,1fr) minmax(130px,.7fr) minmax(180px,1.4fr) auto; }
.ally-status { width: fit-content; padding: 4px 7px; border: 1px solid #40515a; border-radius: 5px; color: #b6c7ce; background: #1b2831; font-size: 8px; text-transform: uppercase; }
.status-friendly { border-color: #4c345b; color: #c49fe0; background: #281a30; }
.status-unfriendly,.status-violent { border-color: #654348; color: #f1a5a1; background: #351f25; }
.status-neutral { border-color: #52504a; color: #d0c49a; background: #2b2922; }
.directory-cell { display: grid; min-width: 0; gap: 5px; }
.directory-cell small { color: #70828d; font-size: 7px; font-weight: 700; letter-spacing: .13em; }
.directory-cell strong { overflow: hidden; color: #dfe8eb; font-size: 11px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.directory-name { display: flex; align-items: center; gap: 10px; }
.directory-emblem { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border: 1px solid #463451; border-radius: 9px; color: #c9a1e4; background: #281a30; font-size: 12px; font-weight: 700; }
.directory-open { padding: 7px 10px; border: 1px solid #33434d; border-radius: 6px; color: #b5c4ca; background: #1a252f; font-size: 9px; }
.directory-open:hover { border-color: #9a67b9; color: #dec8ed; }
.type-label { width: fit-content; padding: 4px 7px; border: 1px solid #483b51; border-radius: 5px; color: #c3a4d8; background: #281b30; font-size: 8px; text-transform: uppercase; }
.detail-view { animation: fade-in .18s ease; }
.back-button { margin: 0 0 20px; padding: 5px 0; border: 0; color: #93aaa9; background: transparent; font-size: 10px; }
.back-button:hover { color: #d8c3e5; }
.detail-heading { margin-bottom: 16px; }
.detail-heading .eyebrow { display: block; margin-bottom: 7px; }
.detail-heading h1 { color: #f4f0f5; font-size: 28px; }
.detail-heading p { margin-top: 5px; color: #82939b; font-size: 10px; }
.detail-columns { display: grid; grid-template-columns: minmax(260px,.78fr) minmax(0,1.55fr); align-items: start; gap: 15px; }
.profile-panel,.records-panel { min-width: 0; border: 1px solid #293743; border-radius: 10px; background: #111a23; }
.profile-panel { padding: 18px; }
.profile-avatar { display: grid; width: 54px; height: 54px; overflow: hidden; place-items: center; border: 1px solid #564262; border-radius: 13px; color: #c69be2; background: #2a1b33; font-size: 22px; font-weight: 700; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-panel h2 { margin: 14px 0 7px; overflow-wrap: anywhere; color: #eee8f0; font-size: 18px; font-weight: 600; }
.profile-panel .type-pill { margin-bottom: 9px; }
.profile-description { margin: 0; color: #97a7ad; font-size: 10px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #27343e; }
.profile-actions .button { min-height: 31px; padding: 0 10px; font-size: 9px; }
.profile-meta { display: grid; gap: 12px; margin-top: 17px; }
.profile-meta > div { display: grid; gap: 5px; }
.profile-meta small { color: #758791; font-size: 7px; font-weight: 700; letter-spacing: .13em; }
.profile-meta strong { color: #c5d1d5; font-size: 10px; font-weight: 500; overflow-wrap: anywhere; }
.records-panel { padding: 17px; }
.records-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.records-header h2 { margin: 0; color: #e1e9eb; font-size: 14px; font-weight: 600; }
.category-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 14px; padding-bottom: 11px; border-bottom: 1px solid #26333e; }
.category-tab { min-height: 29px; padding: 0 10px; border: 1px solid transparent; border-radius: 6px; color: #8999a3; background: transparent; font-size: 9px; }
.category-tab:hover { color: #dae4e7; background: #ffffff06; }
.category-tab.active { border-color: #594568; color: #caa9e0; background: #281b30; }
.record-list { display: grid; gap: 8px; }
.record-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 9px; border: 1px solid #293641; border-radius: 8px; background: #141e28; }
.record-open { display: grid; min-width: 0; grid-template-columns: 74px minmax(0,1fr); align-items: center; gap: 11px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.record-open:hover .record-copy h3 { color: #caa9e0; }
.record-open:focus-visible { border-radius: 6px; outline: 2px solid #9d65bd; outline-offset: 3px; }
.record-thumb { display: grid; width: 74px; height: 60px; overflow: hidden; place-items: center; border: 1px solid #2b3b45; border-radius: 6px; color: #b492c9; background: #17252b; font-size: 21px; }
.record-thumb img { width: 100%; height: 100%; object-fit: cover; }
.record-copy { min-width: 0; }
.record-copy h3 { overflow: hidden; margin: 0 0 5px; color: #e1e9ec; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.record-copy p { display: -webkit-box; overflow: hidden; margin: 0; color: #91a1a9; font-size: 9px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.record-copy small { display: block; margin-top: 6px; color: #677984; font-size: 7px; }
.record-actions { display: flex; gap: 5px; }
.record-detail-dialog { width: min(100% - 30px,760px); max-height: 90vh; overflow-y: auto; padding: 20px; border: 1px solid #354450; border-radius: 14px; color: var(--text); background: #101922; box-shadow: 0 25px 100px #000a; }
.record-detail-dialog::backdrop { background: #03070bc9; backdrop-filter: blur(5px); }
.record-detail-content { display: grid; gap: 16px; }
.record-detail-image-link { display: grid; min-height: 120px; max-height: min(58vh,560px); place-items: center; overflow: hidden; border: 1px solid #2d3d48; border-radius: 9px; background: #080e14; }
.record-detail-image { display: block; width: 100%; max-height: min(58vh,560px); object-fit: contain; }
.record-detail-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.record-detail-fields > div { padding: 10px; border: 1px solid #293843; border-radius: 7px; background: #141e28; }
.record-detail-description { grid-column: 1 / -1; margin: 0; padding: 12px; border: 1px solid #293843; border-radius: 7px; color: #c1cdd2; background: #141e28; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.member-images-dialog { width: min(100% - 30px,900px); }
.member-image-upload { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px; border: 1px solid #293843; border-radius: 8px; background: #141e28; }
.member-image-upload[hidden] { display: none; }
.member-images-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 12px; max-height: min(65vh,680px); overflow-y: auto; }
.member-image-card { display: grid; min-width: 0; gap: 7px; padding: 8px; border: 1px solid #293843; border-radius: 8px; background: #141e28; }
.member-image-link { display: grid; min-height: 150px; place-items: center; overflow: hidden; border-radius: 5px; background: #080e14; }
.member-image-link img { display: block; width: 100%; height: 180px; object-fit: contain; }
.member-image-credit { overflow: hidden; color: #8da1a9; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.member-image-remove { display: grid; width: 32px; height: 30px; justify-self: end; place-items: center; border: 1px solid #593b40; border-radius: 6px; color: #f09292; background: #2d1c22; font-size: 15px; }
.member-image-remove:hover:not(:disabled) { border-color: #b45862; color: #ffd0d0; background: #48252d; }
.member-image-remove:disabled { opacity: .55; cursor: wait; }
.empty-inline { display: grid; min-height: 125px; place-content: center; justify-items: center; gap: 7px; color: #7f9099; text-align: center; }
.empty-inline strong { color: #c4d0d4; font-size: 11px; }
.empty-inline p { margin: 0; font-size: 9px; }
.user-row { grid-template-columns: minmax(190px,1fr) minmax(160px,.8fr) minmax(100px,.55fr) auto; }
.user-id { color: #a7bbc5 !important; font-family: Consolas,monospace; font-size: 10px !important; }
.id-banner { display: flex; align-items: center; gap: 8px; margin: 0 0 13px; padding: 10px 11px; border: 1px solid #2e3d48; border-radius: 7px; color: #adbec5; background: #141f29; font-family: Consolas,monospace; font-size: 10px; overflow-wrap: anywhere; }
.id-banner span { color: #78909c; font-family: Inter,"Segoe UI",sans-serif; font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.permissions-list { display: grid; gap: 9px; margin-top: 12px; }
.user-permissions { display: grid; gap: 11px; margin: 2px 0 0; padding: 14px; border: 1px solid #2d4149; border-radius: 8px; background: #111d25; }
.user-permissions legend { padding: 0 5px; color: #a9bbc1; font-size: 10px; font-weight: 650; }
.user-permissions label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 9px !important; color: #c0cdd1 !important; font-size: 10px !important; font-weight: 500 !important; }
.user-permissions input { accent-color: #ba77e0; }
.user-permissions small { color: #81929a; font-size: 9px; line-height: 1.5; }
.permission-item { display: flex; align-items: center; gap: 8px; color: #9aabb2; font-size: 9px; }
.permission-item i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.permission-item.disabled i { background: #52616b; }
.search-box:focus-within { border-color: #8e5eaa; }
.button-discord { display: inline-flex; }
@media (max-width:850px) { .shell { width: min(100% - 26px,1500px); } .detail-columns { grid-template-columns: minmax(220px,.75fr) minmax(0,1.25fr); } .directory-row { grid-template-columns: minmax(155px,1.1fr) minmax(90px,.7fr) minmax(90px,.6fr) auto; } .directory-row .directory-cell:nth-child(4) { display:none; } }
@media (max-width:620px) { .shell { width: calc(100% - 22px); } .masthead { min-height: 73px; } .brand-text strong { font-size: 14px; } .brand-text small { font-size: 7px; } .account-name { max-width: 78px; } .main-tabs { min-height: 47px; overflow-x: auto; } .main-tab { min-width: 115px; flex: 0 0 auto; padding: 0 8px; font-size: 9px; } .connection-status { display:none; } #dashboard { padding-top: 23px; } .page-heading { align-items: start; gap: 10px; } .page-heading h1 { font-size: 23px; } .page-heading .subheading { max-width: 250px; font-size: 9px; } .page-heading > .button { min-height: 31px; padding: 0 8px; font-size: 8px; white-space: nowrap; } .directory-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 10px; } .directory-row .directory-cell:not(.directory-name) { display:none; } .detail-columns { grid-template-columns: 1fr; } .profile-panel { display:grid; grid-template-columns: 49px minmax(0,1fr); column-gap: 12px; } .profile-panel .profile-avatar { grid-row: span 2; width: 45px; height: 45px; } .profile-panel h2 { margin: 3px 0; font-size: 15px; } .profile-panel .type-pill { grid-column: 2; width: fit-content; margin: 0; } .profile-panel .profile-description,.profile-panel .profile-actions,.profile-panel .profile-meta { grid-column: 1 / -1; } .profile-panel .profile-description { margin-top: 13px; } .profile-panel .profile-actions { margin-top: 12px; padding-top: 11px; } .records-panel { padding: 12px; } .record-row { grid-template-columns: 55px minmax(0,1fr) auto; gap: 8px; padding: 7px; } .record-thumb { width: 55px; height: 48px; } .record-actions { flex-direction: column; } .dialog-actions { flex-wrap: wrap; } .directory-toolbar { align-items: start; flex-direction: column; } .directory-total { align-self: end; } .login-card { padding: 25px; } }
@media (max-width:1050px) { .sidebar { width: 225px; } .main { margin-left: 225px; } .intel-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:720px) { .sidebar { position: static; width: 100%; padding: 13px 14px; border-right: 0; border-bottom: 1px solid #1e2935; } .brand { padding-bottom: 12px; } .side-label,.sidebar-stats,.security-note,.build-label { display: none; } .gang-list { display: flex; gap: 7px; overflow-x: auto; padding-top: 8px; } .gang-nav-item { min-width: 175px; min-height: 48px; } .sidebar-bottom { display: none; } .main { margin-left: 0; } .topbar { min-height: 55px; padding: 0 16px; } .crumbs { font-size: 7px; } .logout-button { font-size: 8px; } .main > #dashboard { padding: 25px 15px 40px; } .page-heading { align-items: start; } .welcome-banner { align-items: start; flex-direction: column; } .profile-hero { min-height: 180px; align-items: start; flex-direction: column; padding: 22px; } .profile-copy { max-width: 100%; } .profile-hero > button { align-self: end; } .intel-grid { grid-template-columns: 1fr; } .intel-image { height: 205px; } .stats-grid { gap: 7px; } .stat-card { gap: 8px; padding: 9px; } .stat-icon { width: 29px; height: 29px; } .stat-copy span { font-size: 6px; } .stat-copy strong { font-size: 17px; } .section-head h2 { font-size: 15px; } .login-card { padding: 27px; } }
@media (max-width:720px) { .personal-profile-grid { grid-template-columns: 1fr; } }
@media (max-width:620px) {
  .record-row { grid-template-columns: minmax(0,1fr) auto; }
  .record-open { grid-template-columns: 55px minmax(0,1fr); gap: 8px; }
  .record-detail-fields { grid-template-columns: 1fr; }
  .record-detail-description { grid-column: 1; }
  .member-image-upload { grid-template-columns: 1fr; }
  .directory-row.ally-row .directory-cell:nth-child(2) { display: grid; }
  .coc-member-row { grid-template-columns: minmax(0,1fr) auto; }
  .coc-member-row > span:last-of-type { grid-column: 2; }
  .coc-member-row small { grid-column: 1 / -1; }
}

/* ===== Revamp: landing page, sidebar layout, home ===== */
:root { --bg: #0b0614; --violet: #a855f7; --pink: #8b3df0; --orange: #f0abfc; }
body { background: #0b0614; }
.ambient { display: none; }
.brand-mark,.login-emblem { border-color: #a855f766; color: #fff; background: linear-gradient(140deg,#6d28d9,#8b3df0 60%,#f0abfc); box-shadow: 0 7px 22px #7c3aed40; }
.shell { position: relative; }
.display-font,.landing h1,.home-hero h1,.fleet-card h3,.fleet-count strong,.home-hero-stat strong { font-family: Bahnschrift, "Segoe UI Black", "Arial Black", sans-serif; }

/* Landing */
.landing { position: fixed; inset: 0; z-index: 0; display: grid; min-height: 0; place-items: center; overflow: hidden; padding: 0 20px 9vh; background: linear-gradient(180deg,#06030d 0%,#1a0d33 36%,#2a1259 62%,#1e0f3d 80%,#07040f 100%); }
.landing::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 8% 18%,#fff9,transparent),radial-gradient(1.5px 1.5px at 22% 40%,#f0abfc99,transparent),radial-gradient(1.5px 1.5px at 35% 12%,#fff8,transparent),radial-gradient(1.5px 1.5px at 52% 30%,#fff7,transparent),radial-gradient(1.5px 1.5px at 66% 14%,#f0abfc88,transparent),radial-gradient(1.5px 1.5px at 78% 36%,#fff8,transparent),radial-gradient(1.5px 1.5px at 91% 20%,#fff7,transparent),radial-gradient(1.5px 1.5px at 14% 56%,#fff6,transparent),radial-gradient(1.5px 1.5px at 88% 52%,#f0abfc77,transparent); pointer-events: none; }
.landing::after { content: ""; position: absolute; inset: auto 0 0 0; height: 34vh; background: linear-gradient(180deg,#120a22,#07040f); clip-path: polygon(0 100%,0 62%,4% 62%,4% 48%,9% 48%,9% 58%,12% 58%,12% 34%,14% 22%,16% 34%,16% 56%,22% 56%,22% 40%,28% 40%,28% 62%,33% 62%,33% 44%,38% 44%,38% 66%,44% 66%,44% 26%,50% 26%,50% 52%,56% 52%,56% 38%,62% 38%,62% 60%,68% 60%,68% 18%,70% 8%,72% 18%,72% 54%,78% 54%,78% 42%,85% 42%,85% 64%,90% 64%,90% 48%,96% 48%,96% 60%,100% 60%,100% 100%); pointer-events: none; }
.landing-content { position: relative; z-index: 2; display: grid; justify-items: center; gap: 22px; max-width: 760px; text-align: center; animation: landing-rise .8s ease both; }
@keyframes landing-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.landing-pill { display: inline-flex; align-items: center; gap: 12px; color: #d8d3e6; font-size: 11px; font-weight: 700; letter-spacing: .3em; }
.landing-pill .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 14px; }
.landing h1 { margin: 0; color: #fff; font-size: clamp(46px,9vw,98px); font-weight: 800; line-height: .98; letter-spacing: .01em; text-transform: uppercase; }
.grad { background: linear-gradient(90deg,#a855f7,#ab7bd8 55%,#f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing-content > p { max-width: 560px; margin: 0; color: #c1bccf; font-size: 15px; line-height: 1.6; }
.landing-status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid #3d1f4d; border-radius: 99px; color: #4ade9c; background: #0d221f99; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.landing-status i { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; }
.landing-cta { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 30px; border: 0; border-radius: 12px; color: #fff; background: linear-gradient(90deg,#15803d,#8b3df0 55%,#f0abfc); box-shadow: 0 10px 36px #7c3aed55; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; transition: transform .2s, box-shadow .2s, filter .2s; }
.landing-cta:hover { filter: brightness(1.1); box-shadow: 0 14px 44px #7c3aed7a; transform: translateY(-2px); }
.landing-cta.small { min-height: 40px; padding: 0 20px; font-size: 11px; }
.landing-links { display: flex; align-items: center; gap: 12px; color: #8a849b; font-size: 12px; }
.landing-links i { width: 3px; height: 3px; border-radius: 50%; background: #6d6780; }
body:not(.authed) .masthead { position: relative; z-index: 5; }
body:not(.authed) .brand-text strong { color: #fff; font-size: 16px; font-weight: 800; letter-spacing: .06em; }
.landing-signin { display: none; padding: 9px 18px; border: 1px solid #ffffff55; border-radius: 10px; color: #fff; font-size: 12px; font-weight: 700; text-decoration: none; transition: background .2s; }
.landing-signin:hover { background: #ffffff1c; }
.landing-signin { margin-left: auto; }
body:not(.authed) .brand-mark { width: 38px; height: 38px; font-size: 20px; }
.landing { padding-top: 90px; }
@media (max-width: 520px) { .landing-pill { font-size: 9px; letter-spacing: .16em; } .landing-links { flex-wrap: wrap; justify-content: center; } }
body:not(.authed) .landing-signin { display: inline-flex; gap: 8px; }

/* Authenticated shell with sidebar */
body.authed .shell { width: auto; margin: 0; padding: 0; }
body.authed .masthead { min-height: 64px; margin-left: 248px; justify-content: flex-end; padding: 12px 32px; border-bottom: 1px solid #1b1420; }
body.authed .masthead .brand { display: none; }
body.authed #dashboard { margin-left: 248px; padding: 30px 32px 70px; }
body.authed .account-menu { z-index: 40; }
.main-tabs { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 248px; min-height: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 18px 12px 16px; overflow-y: auto; border: 0; border-right: 1px solid #1b1420; background: linear-gradient(180deg,#1b0f24 0%,#0e0812 38%,#0b0614 100%); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 10px; color: inherit; text-decoration: none; }
.sidebar-brand strong { display: block; color: #f4f1fb; font-size: 14px; font-weight: 800; letter-spacing: .1em; }
.sidebar-brand small { display: block; margin-top: 3px; color: #8a7fa8; font-size: 8px; letter-spacing: .18em; }
.nav-label { display: flex; align-items: center; gap: 8px; padding: 18px 10px 8px; color: #6b6780; font-size: 9px; font-weight: 700; letter-spacing: .2em; }
.nav-label::before { content: ""; width: 10px; height: 2px; border-radius: 2px; background: var(--pink); }
.main-tab { position: relative; z-index: 1; min-width: 0; min-height: 40px; justify-content: flex-start; margin: 0; padding: 0 12px; gap: 12px; border: 0; border-radius: 10px; color: #a7a3b5; font-size: 13px; font-weight: 500; text-align: left; transition: color .2s, background .2s; }
.main-tab > span { width: 18px; color: inherit; font-size: 15px; text-align: center; }
.main-tab b { margin-left: auto; }
.main-tab:hover:not(.active) { color: #ece9f5; background: #ffffff14; }
.main-tab.active { border-bottom-color: transparent; color: #a855f7; background: transparent; font-weight: 600; }
.main-tab.active b { color: #dec9f0; background: #6d28d933; }
.tab-indicator { top: 0; right: 12px; bottom: auto; left: 12px; z-index: 0; width: auto; height: 40px; border: 1px solid #6d28d933; border-radius: 10px; background: linear-gradient(90deg,#6d28d933,#6d28d90f); box-shadow: none; }
.tab-indicator::before { content: ""; position: absolute; top: 9px; bottom: 9px; left: -1px; width: 3px; border-radius: 3px; background: linear-gradient(180deg,#8b3df0,#f0abfc); }
.tab-indicator.animated { transition: transform .35s cubic-bezier(.4,0,.2,1), height .35s cubic-bezier(.4,0,.2,1), opacity .2s; }
.tabs-spacer { flex: 1; min-height: 16px; }
.main-tabs .sync-database-button { width: 100%; justify-content: center; align-self: stretch; }
.connection-status { justify-content: center; padding-top: 12px; }

/* Home */
.home-hero { position: relative; display: flex; min-height: 210px; align-items: flex-end; justify-content: space-between; gap: 24px; overflow: hidden; padding: 32px 36px; border: 1px solid #2e1d3a; border-radius: 22px; background: linear-gradient(180deg,#140b1a 0%,#251232 55%,#351d4a 100%); }
.home-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 52%; background: #0f0913; opacity: .8; clip-path: polygon(0 100%,0 70%,5% 70%,5% 50%,10% 50%,10% 64%,15% 64%,15% 30%,17% 18%,19% 30%,19% 60%,26% 60%,26% 44%,33% 44%,33% 66%,40% 66%,40% 36%,47% 36%,47% 58%,54% 58%,54% 42%,61% 42%,61% 64%,68% 64%,68% 24%,71% 12%,74% 24%,74% 56%,81% 56%,81% 46%,88% 46%,88% 68%,94% 68%,94% 52%,100% 52%,100% 100%); pointer-events: none; }
.home-hero > * { position: relative; z-index: 1; }
.home-kicker { color: #ab7bd8; font-size: 10px; font-weight: 700; letter-spacing: .24em; }
.home-hero h1 { margin: 8px 0 8px; color: #fff; font-size: clamp(26px,4vw,40px); font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.home-hero p { max-width: 460px; margin: 0 0 18px; color: #cfc8de; font-size: 12px; line-height: 1.6; }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ghost-button { min-height: 40px; padding: 0 18px; border: 1px solid #ffffff22; border-radius: 12px; color: #e8e4f2; background: #ffffff10; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; transition: background .2s; }
.ghost-button:hover { background: #ffffff22; }
.home-hero-stat { display: grid; justify-items: start; gap: 8px; text-align: left; }
.home-hero-stat small { color: #b6aecb; font-size: 10px; font-weight: 700; letter-spacing: .2em; }
.home-hero-stat strong { color: #fff; font-size: 64px; line-height: .9; }
.home-pill { padding: 5px 12px; border: 1px solid #3d1f4d; border-radius: 99px; color: #4ade9c; background: #1b0d22; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.home-hero-stat em { color: #9a92b0; font-size: 9px; font-style: normal; letter-spacing: .1em; }
.fleet-label { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; color: #8d86a0; font-size: 11px; font-weight: 700; letter-spacing: .24em; }
.fleet-label span { color: var(--pink); }
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,300px),1fr)); gap: 14px; }
.fleet-card { padding: 22px; border: 1px solid #241b2a; border-radius: 16px; background: #0f0913; transition: border-color .2s, transform .2s; }
.fleet-card:hover { border-color: #582e7a; transform: translateY(-2px); }
.fleet-card h3 { margin: 0 0 14px; color: #f4f1fb; font-size: 17px; letter-spacing: .03em; text-transform: uppercase; }
.fleet-count { display: flex; align-items: baseline; gap: 10px; }
.fleet-count strong { color: #fff; font-size: 44px; line-height: 1; }
.fleet-count span { color: #6f6a82; font-size: 10px; letter-spacing: .14em; }
.fleet-bar { height: 6px; margin: 16px 0 10px; overflow: hidden; border-radius: 99px; background: #241b2a; }
.fleet-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg,#6d28d9,#8b3df0 55%,#f0abfc); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.fleet-foot { display: flex; justify-content: space-between; color: #6f6a82; font-size: 9px; letter-spacing: .1em; }
.fleet-foot b.cool { color: #4ade9c; }
.fleet-foot b.warm { color: #facc15; }
.fleet-foot b.hot { color: #f87171; }
.roster-loading { grid-column: 1 / -1; }
.home-view .roster-loading { background: #0f0913; border-color: #241b2a; }

@media (max-width: 860px) {
  body.authed .masthead,body.authed #dashboard { margin-left: 0; }
  body.authed #dashboard { padding: 20px 16px 60px; }
  body.authed .masthead { padding: 10px 16px; }
  .main-tabs { position: static; width: auto; flex-direction: row; align-items: center; padding: 8px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid #1b1420; }
  .main-tabs .sidebar-brand,.nav-label,.tab-indicator,.connection-status,.tabs-spacer { display: none; }
  .main-tab { flex: 0 0 auto; }
  .main-tab.active { background: #6d28d926; }
  .main-tabs .sync-database-button { width: auto; }
  .home-hero { flex-direction: column; align-items: flex-start; padding: 24px; }
}

/* EPM branding */
.brand-mark,.login-emblem { overflow: hidden; color: transparent !important; font-size: 0 !important; border: 1px solid #a855f788; background: #07040f url("/epm-logo.png") center / cover no-repeat !important; box-shadow: 0 7px 22px #7c3aed40; }
.landing { background: linear-gradient(180deg,#06030dcc 0%,#0b061499 45%,#06030de6 100%), url("/epm-bg.png") center / cover no-repeat fixed !important; }
.landing::before, .landing::after { opacity: .25; }
.landing-pill .brand-mark { width: 34px; height: 34px; }
.landing-cta, .landing-cta:hover { background: linear-gradient(90deg,#15803d,#8b3df0 55%,#f0abfc) !important; }

/* Profile picture editor */
.large-profile-avatar { width: 112px; height: 112px; }
.avatar-edit { position: relative; display: block; width: 112px; height: 112px; flex: none; border-radius: 50%; cursor: pointer; overflow: hidden; }
.avatar-edit .large-profile-avatar { display: block; }
.avatar-edit-overlay { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #8a8a8a99; opacity: 0; transition: opacity .15s ease; }
.avatar-edit:hover .avatar-edit-overlay, .avatar-edit:focus-within .avatar-edit-overlay { opacity: 1; }
.avatar-hint { color: #7f9a88; font-size: 9px; }
.crop-dialog { width: min(92vw, 400px); }
.crop-body { display: grid; justify-items: center; gap: 14px; padding: 18px 20px; }
.crop-stage { position: relative; width: 320px; height: 320px; max-width: 100%; border-radius: 12px; overflow: hidden; background: #0b0614; touch-action: none; }
.crop-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-ring { position: absolute; inset: 0; pointer-events: none; border-radius: 50%; box-shadow: 0 0 0 999px #000000a8; outline: 2px solid #a855f7; outline-offset: -2px; }
.crop-zoom { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; width: 100%; color: #b7c5cb; font-size: 10px; }
.crop-zoom input { accent-color: #8b3df0; }
.crop-body small { color: #8a9c91; font-size: 9px; }.avatar-edit { background: linear-gradient(140deg,#15803d,#1e0f3d); border: 1px solid #a855f766; }
.avatar-edit .large-profile-avatar[hidden] { display: none; }
.crop-dialog { width: min(92vw, 380px); }
.crop-wrap { display: grid; gap: 14px; padding: 22px; }
.crop-body { padding: 0; }
.crop-stage { width: 280px; height: 280px; }
.crop-wrap .dialog-actions { margin-top: 0; }
.avatar-hint { margin: 0; color: #7f9a88; font-size: 10px; }

/* Verification, alerts, search, print, mobile */
.intel-status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.intel-status-line .stamp { color: #7f9a88; font-size: 9px; }
.verify-badge { display: inline-block; margin-left: 0; padding: 2px 7px; border-radius: 99px; border: 1px solid; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.verify-unverified { color: #fbbf24; border-color: #fbbf2455; background: #fbbf2414; }
.verify-confirmed { color: #4ade80; border-color: #4ade8055; background: #4ade8014; }
.verify-outdated { color: #94a3b8; border-color: #94a3b855; background: #94a3b814; }
.search-row-title .verify-badge { margin-left: 8px; }

.home-alerts { margin-bottom: 18px; }
.alert-list { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid; border-radius: 10px; font-size: 12px; }
.alert-item b { flex: none; font-size: 9px; letter-spacing: .12em; }
.alert-full { color: #fca5a5; border-color: #f8717155; background: #f8717112; }
.alert-near { color: #fcd34d; border-color: #fbbf2455; background: #fbbf2410; }
.alert-stale { color: #a8b8ae; border-color: #433a4a; background: #ffffff08; }

.search-view { display: grid; gap: 18px; }
.search-box-large { width: 100%; height: 50px; }
.search-box-large input { font-size: 14px; }
.search-hint { margin: 8px 0; color: #7f9a88; font-size: 13px; }
.search-results { display: grid; gap: 20px; }
.search-group { display: grid; gap: 8px; }
.search-group h3 { margin: 0; color: #ab7bd8; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.search-row { display: grid; gap: 3px; width: 100%; padding: 11px 14px; border: 1px solid #241b2a; border-radius: 10px; color: var(--text); background: #0f0913; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.search-row:hover, .search-row:focus-visible { border-color: #8b3df0; background: #190f20; }
.search-row-title { font-size: 13px; font-weight: 700; }
.search-row small { color: #8da295; font-size: 10px; }
.search-row em { color: #a8b8ae; font-size: 11px; font-style: normal; }

#print-sheet { display: none; }
@media print {
  body > *:not(#print-sheet) { display: none !important; }
  body { background: #fff !important; min-width: 0; }
  #print-sheet { display: block; padding: 0; color: #000; background: #fff; font: 12px/1.5 "Segoe UI", Arial, sans-serif; }
  #print-sheet h1 { margin: 4px 0; font-size: 26px; }
  #print-sheet h2 { margin: 18px 0 6px; padding-bottom: 3px; border-bottom: 1px solid #000; font-size: 14px; }
  #print-sheet ul { margin: 0; padding-left: 18px; }
  #print-sheet li { margin-bottom: 4px; break-inside: avoid; }
  .print-kicker { color: #444; font-size: 9px; letter-spacing: .14em; }
  .print-meta { color: #444; }
}

@media (max-width: 860px) {
  .main-tab { min-height: 40px; white-space: nowrap; }
  .page-heading { flex-wrap: wrap; }
  .fleet-grid { grid-template-columns: 1fr; }
  .home-hero-stat { align-self: stretch; }
  .search-box { width: 100%; }
  .roster-overview, .coc-overview { overflow-x: auto; }
  .alert-item { flex-wrap: wrap; gap: 6px; }
}
@media (max-width: 520px) {
  .home-hero { padding: 18px; }
  .home-hero h1 { font-size: 26px; }
  .home-hero-actions { flex-wrap: wrap; }
  .editor-dialog, .record-detail-dialog { width: calc(100% - 16px); padding-left: 0; padding-right: 0; }
  .record-detail-dialog { padding: 14px; }
  .record-row { grid-template-columns: 48px minmax(0,1fr); }
  .record-actions { grid-column: 1 / -1; flex-direction: row; }
  .intel-status-line .stamp { flex-basis: 100%; }
}
@media (max-width: 520px) { body { min-width: 0; } .main-tabs { max-width: 100vw; } .page-heading > .button { max-width: 100%; } .masthead { min-width: 0; } }

/* Manager dashboard */
.control-subnav, .feedback-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.control-subnav button { background: #150d1b; border: 1px solid #2e1f3a; color: #b8a9c4; padding: 9px 16px; border-radius: 999px; cursor: pointer; font: inherit; }
.control-subnav button:hover { background: #1f1626; }
.control-subnav button.active { background: #8b3df0; color: #0b0410; border-color: #8b3df0; font-weight: 700; }
.health-banner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-radius: 12px; margin-bottom: 16px; border: 1px solid #2e1f3a; background: #150d1b; }
.health-banner span { color: #998aa5; font-size: 13px; }
.health-banner.tone-good { border-color: #8b3df0; } .health-banner.tone-warn { border-color: #f0abfc; } .health-banner.tone-bad { border-color: #ef4444; }
.health-grid, .alert-roster-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.health-card, .alert-roster-card { background: #150d1b; border: 1px solid #2e1f3a; border-radius: 14px; padding: 18px; }
.health-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.health-head h3, .alert-roster-card h3 { margin: 0; }
.health-pill { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; background: #2e1f3a; color: #b8a9c4; }
.health-pill.tone-good { background: #2a1259; color: #ab7bd8; } .health-pill.tone-warn { background: #3a2410; color: #f0abfc; } .health-pill.tone-bad { background: #3a1414; color: #f87171; }
.health-rows { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; }
.health-rows dt { color: #998aa5; } .health-rows dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }
.health-files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.health-file { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 7px 10px; background: #0f0814; border-radius: 8px; font-size: 13px; }
.health-file small { color: #998aa5; } .health-file.file-error b { color: #f87171; }
.health-action { margin-top: 14px; width: 100%; }
.alert-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.alert-chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #2e1f3a; }
.alert-chip.alert-full { background: #3a1414; color: #f87171; } .alert-chip.alert-near { background: #3a2410; color: #f0abfc; } .alert-chip.alert-stale { background: #1c2a3a; color: #7fb4e8; } .alert-chip.none { opacity: .4; }
.alert-detail .alert-item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.alert-bar { flex: 1 1 120px; min-width: 100px; }
.alert-detail-head h2 { margin: 4px 0; }

/* Feedback board */
.feedback-filters input[type="search"], .feedback-filters input[type="text"], .feedback-filters select { background: #150d1b; border: 1px solid #2e1f3a; color: inherit; border-radius: 10px; padding: 9px 12px; font: inherit; }
.feedback-filters .search-box { flex: 1 1 220px; }
.check-row { display: flex; align-items: center; gap: 6px; color: #b8a9c4; }
.fb-card { display: flex; gap: 14px; background: #150d1b; border: 1px solid #2e1f3a; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.fb-card:hover { border-color: #8b3df0; }
.fb-votes { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 38px; }
.fb-votes strong { font-size: 16px; } .fb-votes strong.positive { color: #ab7bd8; } .fb-votes strong.negative { color: #f87171; }
.fb-vote { background: none; border: 0; color: #6b8576; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px; }
.fb-vote:hover { background: #1f1626; color: #fff; } .fb-vote.active { color: #ab7bd8; }
.fb-body { flex: 1; min-width: 0; }
.fb-open { all: unset; display: block; cursor: pointer; width: 100%; }
.fb-open h3 { margin: 8px 0 4px; }
.fb-open p { margin: 0 0 8px; color: #b8a9c4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fb-open small, .fb-badges small { color: #998aa5; }
.fb-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fb-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #2e1f3a; color: #b8a9c4; }
.fb-type-bug { background: #3a1414; color: #f87171; } .fb-type-feature { background: #2a1259; color: #ab7bd8; } .fb-type-suggestion { background: #1c2a3a; color: #7fb4e8; }
.fb-status-planned { background: #2a2040; color: #b9a2f0; } .fb-status-in-progress { background: #3a2410; color: #f0abfc; } .fb-status-resolved { background: #2a1259; color: #ab7bd8; }
.fb-detail-top { display: flex; gap: 14px; align-items: center; }
.fb-detail-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-status-row { display: block; margin: 12px 0; }
.fb-comment { background: #0f0814; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.fb-comment p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-comment small { margin-left: 8px; color: #998aa5; }
.fb-comment-form { display: flex; gap: 8px; margin-top: 10px; } .fb-comment-form textarea { flex: 1; }
.fb-delete { margin-top: 14px; }

@media (max-width: 860px) {
  .health-grid, .alert-roster-grid { grid-template-columns: 1fr; }
  .fb-card { padding: 12px; gap: 10px; }
  .fb-comment-form { flex-direction: column; }
}


.feedback-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.feedback-head h1 { margin: 6px 0; font-size: clamp(26px,4vw,38px); }
.feedback-head .subheading { max-width: 560px; margin: 0; }
.feedback-actions { display: flex; gap: 8px; align-items: center; }
.feedback-filters .search-box { width: auto; min-width: 200px; }
.feedback-filters .search-box input { font-size: 13px; }
.feedback-filters select { max-width: 100%; }
.control-panel { min-width: 0; }
.feedback-filters .search-box input { border: 0; padding: 0; background: transparent; height: auto; box-shadow: none; }
.feedback-actions { margin-top: 8px; }
.feedback-filters .search-box input[type="search"] { border: 0; padding: 0; margin: 0; min-height: 0; background: transparent; box-shadow: none; }

/* Custom text box and status box */
.fb-status-row { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.fb-field-label { color: #998aa5; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.status-box { position: relative; min-width: 200px; }
.status-trigger { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid #2e1f3a; border-radius: 10px; background: #140b1a; color: #e2ebee; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.status-trigger:hover, .status-box.open .status-trigger { border-color: #8b3df0; background: #1c1024; }
.status-trigger:focus-visible { outline: 2px solid #ab7bd8; outline-offset: 2px; }
.status-caret { margin-left: auto; font-style: normal; color: #ab7bd8; transition: transform .15s; }
.status-box.open .status-caret { transform: rotate(180deg); }
.status-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #8b3df0; }
.status-dot.fb-status-open { background: #ab7bd8; } .status-dot.fb-status-planned { background: #b9a2f0; } .status-dot.fb-status-in-progress { background: #f0abfc; } .status-dot.fb-status-resolved { background: #34d399; } .status-dot.fb-status-closed { background: #6b8576; }
.status-menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; border: 1px solid #2e1f3a; border-radius: 12px; background: #140b1a; box-shadow: 0 14px 34px rgba(0,0,0,.55); }
.status-option { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #dacfe3; font-size: 13px; cursor: pointer; }
.status-option:hover { background: #1f1626; }
.status-option.selected { background: #2a1259; color: #ab7bd8; font-weight: 700; }
.fb-comment-form textarea, #feedback-form textarea, #feedback-form input[type="text"], #feedback-form input:not([type]), #feedback-form select {
  width: 100%; box-sizing: border-box; padding: 11px 14px; border: 1px solid #2e1f3a; border-radius: 10px; background: #0f0814; color: #e2ebee; font: inherit; font-size: 13px; line-height: 1.5; resize: vertical; transition: border-color .15s, box-shadow .15s; }
.fb-comment-form textarea { min-height: 52px; }
.fb-comment-form textarea::placeholder, #feedback-form textarea::placeholder, #feedback-form input::placeholder { color: #6e5f7a; }
.fb-comment-form textarea:hover, #feedback-form textarea:hover, #feedback-form input:hover { border-color: #452b5a; }
.fb-comment-form textarea:focus, #feedback-form textarea:focus, #feedback-form input:focus, #feedback-form select:focus { outline: none; border-color: #8b3df0; box-shadow: 0 0 0 3px rgba(139,61,240,.22); }
.fb-comment { display: flex; gap: 12px; align-items: flex-start; }
.fb-comment-body { flex: 1; min-width: 0; }
.fb-comment-head { display: flex; align-items: baseline; gap: 8px; }
.fb-comment small { margin-left: 0; }
.fb-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; border: 1px solid #2e1f3a; background: #140b1a; }
.fb-avatar-fallback { display: grid; place-items: center; color: #ab7bd8; font-weight: 700; }

/* Notification bell */
.bell-wrap { position: relative; }
.bell-button { position: relative; display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #2e1f3a; border-radius: 12px; background: #140b1a; color: #dce5e9; cursor: pointer; transition: background .15s, border-color .15s; }
.bell-button:hover, .bell-button[aria-expanded="true"] { background: #1c1024; border-color: #8b3df0; }
.bell-icon { font-size: 17px; line-height: 1; }
.bell-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; line-height: 18px; text-align: center; border: 2px solid #0b0614; }
.bell-badge[hidden] { display: none; }
.bell-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 45; width: 340px; max-height: 460px; overflow-y: auto; padding: 8px; border: 1px solid #2e1f3a; border-radius: 14px; background: #140b1a; box-shadow: 0 18px 50px #000a; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right; transition: opacity .18s, transform .18s, visibility .18s; }
.bell-panel.open { opacity: 1; visibility: visible; transform: none; }
.bell-title { padding: 8px 10px 10px; color: #998aa5; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.bell-empty { margin: 0; padding: 14px 10px 18px; color: #998aa5; font-size: 13px; line-height: 1.5; }
.bell-list { display: grid; gap: 4px; }
.bell-item { display: flex; gap: 11px; align-items: flex-start; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: #dacfe3; font: inherit; text-align: left; cursor: pointer; }
.bell-item:hover { background: #1f1626; }
.bell-item.unread { background: #1e1029; box-shadow: inset 3px 0 0 #8b3df0; }
.bell-copy { min-width: 0; flex: 1; }
.bell-line { font-size: 13px; line-height: 1.4; }
.bell-line b { color: #fff; }
.bell-copy p { margin: 3px 0; color: #b8a9c4; font-size: 12px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.bell-copy small { color: #6b8576; font-size: 11px; }
@media (max-width: 520px) { .bell-panel { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; } }

/* Light theme: invert the dark palette, then restore imagery */
html[data-theme="light"] { filter: invert(1) hue-rotate(180deg); background: #fff; }
html[data-theme="light"] img,
html[data-theme="light"] canvas,
html[data-theme="light"] .brand-mark,
html[data-theme="light"] .login-emblem,
html[data-theme="light"] .landing,
html[data-theme="light"] .fb-avatar-fallback,
html[data-theme="light"] .account-avatar { filter: invert(1) hue-rotate(180deg); }
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* Settings */
.settings-view { padding: 0 4px 40px; }
.settings-panel { display: grid; gap: 18px; max-width: 760px; margin-top: 18px; }
.setting-group { padding: 18px; border: 1px solid #2e1f3a; border-radius: 12px; background: #150d1b; }
.setting-group h2 { margin: 0 0 4px; font-size: 15px; }
.setting-hint { margin: 0 0 14px; color: #9d8fa8; font-size: 12px; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-card { display: grid; justify-items: center; gap: 8px; padding: 18px 10px; border: 1px solid #2e1f3a; border-radius: 10px; color: #dacfe3; background: #0e0813; cursor: pointer; transition: .16s; }
.theme-card:hover { border-color: #5f3d7a; background: #1d1126; }
.theme-card.active { border-color: #8b3df0; background: #241232; box-shadow: 0 0 0 1px #8b3df0 inset; }
.theme-icon { font-size: 24px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid #2e1f3a; cursor: pointer; }
.setting-copy strong { font-size: 13px; }
.setting-copy p { margin: 3px 0 0; color: #9d8fa8; font-size: 12px; }
.switch { appearance: none; flex: none; width: 42px; height: 24px; border-radius: 12px; background: #2f2438; position: relative; cursor: pointer; transition: .16s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #dacfe3; transition: .16s; }
.switch:checked { background: #8b3df0; }
.switch:checked::after { left: 21px; }

/* Control: history, activity, backup */
.control-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.control-toolbar h2 { margin: 0; font-size: 16px; }
.range-switch { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid #2e1f3a; border-radius: 9px; background: #0e0813; }
.range-button { padding: 6px 12px; border: 0; border-radius: 6px; color: #aa9db5; background: transparent; font-size: 12px; cursor: pointer; }
.range-button:hover { background: #201727; }
.range-button.active { color: #f1eaf7; background: #401f5a; }
.activity-search { min-width: 200px; padding: 7px 10px; border: 1px solid #2e1f3a; border-radius: 8px; color: inherit; background: #0e0813; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.history-card { padding: 14px; border: 1px solid #2e1f3a; border-radius: 12px; background: #150d1b; }
.history-head { display: flex; align-items: baseline; justify-content: space-between; }
.history-head h3 { margin: 0; font-size: 13px; }
.history-head b { color: #ab7bd8; font-size: 12px; }
.history-svg { width: 100%; height: auto; margin-top: 8px; }
.history-line { stroke: #ab7bd8; stroke-width: 2; stroke-linejoin: round; }
.history-area { fill: #8b3df033; }
.history-cap { stroke: #f0abfc; stroke-width: 1; stroke-dasharray: 4 4; }
.history-foot { color: #9d8fa8; }
.activity-list { display: grid; gap: 8px; }
.activity-row { border: 1px solid #2e1f3a; border-radius: 10px; background: #150d1b; }
.activity-row summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.activity-row summary::-webkit-details-marker { display: none; }
.activity-row summary:hover { background: #1d1126; }
.activity-copy { display: grid; gap: 2px; font-size: 12px; }
.activity-copy small { color: #9d8fa8; }
.activity-fields { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; padding: 10px 14px 14px; border-top: 1px solid #2e1f3a; font-size: 12px; }
.activity-fields dt { color: #9d8fa8; }
.activity-fields dd { margin: 0; overflow-wrap: anywhere; }
.backup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.backup-card { padding: 18px; border: 1px solid #2e1f3a; border-radius: 12px; background: #150d1b; }
.backup-card h3 { margin: 0 0 6px; }
.backup-card p { color: #9d8fa8; font-size: 12px; }
.backup-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Feedback: pin, edit, announcements */
.fb-pinned { color: #fbbf24; border-color: #fbbf2455; background: #fbbf2414; }
.fb-type-announcement { color: #ab7bd8; border-color: #8b3df077; background: #8b3df01f; }
.fb-edited { color: #9d8fa8; font-size: 11px; }
.fb-edit, .fb-pin { margin: 8px 8px 0 0; }
.fb-pin.active { border-color: #fbbf2455; color: #fbbf24; }
.fb-edit-form { display: grid; gap: 8px; margin: 10px 0; }
.fb-edit-form input, .fb-edit-form textarea { padding: 9px 10px; border: 1px solid #2e1f3a; border-radius: 8px; color: inherit; background: #0e0813; font: inherit; }
.fb-edit-actions { display: flex; gap: 8px; }
.announce-list { display: grid; gap: 10px; margin-bottom: 18px; }
.announce-card { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid #8b3df066; border-radius: 12px; color: inherit; background: linear-gradient(110deg, #241232, #150d1b); text-align: left; cursor: pointer; transition: .16s; }
.announce-card:hover { border-color: #ab7bd8; transform: translateY(-1px); }
.announce-card h3 { margin: 0; font-size: 14px; }
.announce-card p { margin: 0; color: #bfb4c9; font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.announce-card small { color: #9d8fa8; }

@media (max-width: 520px) {
  .theme-options { grid-template-columns: 1fr; }
  .activity-search { width: 100%; }
}
/* ---- batch: accents, density, review, automation, attachments ---- */
html { --ui-scale: 1; --ui-density: 1; }
body { zoom: calc(var(--ui-scale) * var(--ui-density)); }
html[data-accent="purple"] { filter: hue-rotate(50deg); }
html[data-accent="purple"] img, html[data-accent="purple"] canvas, html[data-accent="purple"] .brand-mark, html[data-accent="purple"] .login-emblem, html[data-accent="purple"] .landing, html[data-accent="purple"] .fb-avatar-fallback, html[data-accent="purple"] .account-avatar { filter: hue-rotate(-50deg); }
html[data-theme="light"][data-accent="purple"] { filter: invert(1) hue-rotate(180deg) hue-rotate(50deg); }
html[data-theme="light"][data-accent="purple"] img, html[data-theme="light"][data-accent="purple"] canvas, html[data-theme="light"][data-accent="purple"] .brand-mark, html[data-theme="light"][data-accent="purple"] .login-emblem, html[data-theme="light"][data-accent="purple"] .landing, html[data-theme="light"][data-accent="purple"] .fb-avatar-fallback, html[data-theme="light"][data-accent="purple"] .account-avatar { filter: hue-rotate(-50deg) invert(1) hue-rotate(180deg); }
html[data-accent="red"] { filter: hue-rotate(90deg); }
html[data-accent="red"] img, html[data-accent="red"] canvas, html[data-accent="red"] .brand-mark, html[data-accent="red"] .login-emblem, html[data-accent="red"] .landing, html[data-accent="red"] .fb-avatar-fallback, html[data-accent="red"] .account-avatar { filter: hue-rotate(-90deg); }
html[data-theme="light"][data-accent="red"] { filter: invert(1) hue-rotate(180deg) hue-rotate(90deg); }
html[data-theme="light"][data-accent="red"] img, html[data-theme="light"][data-accent="red"] canvas, html[data-theme="light"][data-accent="red"] .brand-mark, html[data-theme="light"][data-accent="red"] .login-emblem, html[data-theme="light"][data-accent="red"] .landing, html[data-theme="light"][data-accent="red"] .fb-avatar-fallback, html[data-theme="light"][data-accent="red"] .account-avatar { filter: hue-rotate(-90deg) invert(1) hue-rotate(180deg); }
html[data-accent="blue"] { filter: hue-rotate(-50deg); }
html[data-accent="blue"] img, html[data-accent="blue"] canvas, html[data-accent="blue"] .brand-mark, html[data-accent="blue"] .login-emblem, html[data-accent="blue"] .landing, html[data-accent="blue"] .fb-avatar-fallback, html[data-accent="blue"] .account-avatar { filter: hue-rotate(50deg); }
html[data-theme="light"][data-accent="blue"] { filter: invert(1) hue-rotate(180deg) hue-rotate(-50deg); }
html[data-theme="light"][data-accent="blue"] img, html[data-theme="light"][data-accent="blue"] canvas, html[data-theme="light"][data-accent="blue"] .brand-mark, html[data-theme="light"][data-accent="blue"] .login-emblem, html[data-theme="light"][data-accent="blue"] .landing, html[data-theme="light"][data-accent="blue"] .fb-avatar-fallback, html[data-theme="light"][data-accent="blue"] .account-avatar { filter: hue-rotate(50deg) invert(1) hue-rotate(180deg); }
html[data-accent="teal"] { filter: hue-rotate(-90deg); }
html[data-accent="teal"] img, html[data-accent="teal"] canvas, html[data-accent="teal"] .brand-mark, html[data-accent="teal"] .login-emblem, html[data-accent="teal"] .landing, html[data-accent="teal"] .fb-avatar-fallback, html[data-accent="teal"] .account-avatar { filter: hue-rotate(90deg); }
html[data-theme="light"][data-accent="teal"] { filter: invert(1) hue-rotate(180deg) hue-rotate(-90deg); }
html[data-theme="light"][data-accent="teal"] img, html[data-theme="light"][data-accent="teal"] canvas, html[data-theme="light"][data-accent="teal"] .brand-mark, html[data-theme="light"][data-accent="teal"] .login-emblem, html[data-theme="light"][data-accent="teal"] .landing, html[data-theme="light"][data-accent="teal"] .fb-avatar-fallback, html[data-theme="light"][data-accent="teal"] .account-avatar { filter: hue-rotate(90deg) invert(1) hue-rotate(180deg); }
html[data-accent="orange"] { filter: hue-rotate(120deg); }
html[data-accent="orange"] img, html[data-accent="orange"] canvas, html[data-accent="orange"] .brand-mark, html[data-accent="orange"] .login-emblem, html[data-accent="orange"] .landing, html[data-accent="orange"] .fb-avatar-fallback, html[data-accent="orange"] .account-avatar { filter: hue-rotate(-120deg); }
html[data-theme="light"][data-accent="orange"] { filter: invert(1) hue-rotate(180deg) hue-rotate(120deg); }
html[data-theme="light"][data-accent="orange"] img, html[data-theme="light"][data-accent="orange"] canvas, html[data-theme="light"][data-accent="orange"] .brand-mark, html[data-theme="light"][data-accent="orange"] .login-emblem, html[data-theme="light"][data-accent="orange"] .landing, html[data-theme="light"][data-accent="orange"] .fb-avatar-fallback, html[data-theme="light"][data-accent="orange"] .account-avatar { filter: hue-rotate(-120deg) invert(1) hue-rotate(180deg); }
.accent-options { display: flex; gap: 10px; margin: 8px 0 14px; flex-wrap: wrap; }
.accent-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; background: #a855f7; }
.accent-swatch.accent-teal { background: #2fb7b0; }
.accent-swatch.accent-blue { background: #5a8be8; }
.accent-swatch.accent-purple { background: #e06bd0; }
.accent-swatch.accent-red { background: #e06060; }
.accent-swatch.accent-orange { background: #e0a050; }
.accent-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.setting-sub { margin: 14px 0 0; font-size: .9rem; opacity: .8; }
.setting-choice { align-items: center; gap: 12px; flex-wrap: wrap; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; overflow: hidden; }
.segment { background: transparent; color: inherit; border: 0; padding: 8px 12px; cursor: pointer; font: inherit; }
.segment.active { background: rgba(168,85,247,.28); font-weight: 700; }
.change-list { display: grid; gap: 6px; }
.change-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: rgba(255,255,255,.03); }
.change-text small { display: block; opacity: .65; margin-top: 2px; }
.review-card { padding: 14px; margin: 12px 0; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.03); }
.review-head { display: flex; align-items: center; gap: 10px; }
.review-head small { opacity: .65; }
.review-card h3 { margin: 10px 0 6px; }
.review-actions { display: flex; gap: 8px; margin-top: 12px; }
.review-toggle { margin: 10px 0 16px; }
#review-tab-count { margin-left: 6px; }
.auto-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.auto-field input[type="number"] { width: 80px; }
.fb-image { display: inline-block; margin: 8px 0; }
.fb-image img { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); display: block; }
.fb-comment-form input[type="file"] { max-width: 180px; font-size: .75rem; }
.mention { color: #d8b4fe; font-weight: 600; background: rgba(168,85,247,.14); border-radius: 4px; padding: 0 3px; }
@media (max-width: 520px) { .change-row { flex-wrap: wrap; } .fb-comment-form input[type="file"] { max-width: 100%; } }
/* ---- batch: watchlist, tags, pins, sessions, recycle bin ---- */
.social-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; background: rgba(168,85,247,.18); border: 1px solid rgba(168,85,247,.35); color: inherit; }
.watch-chip { cursor: pointer; font: inherit; font-size: .75rem; }
.social-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.social-button { padding: 6px 10px; font-size: .8rem; }
.social-button.active, .pin-toggle.active { background: rgba(168,85,247,.28); }
.pin-toggle { background: transparent; border: 1px solid rgba(255,255,255,.15); color: inherit; border-radius: 8px; padding: 4px 8px; cursor: pointer; font: inherit; font-size: .8rem; }
.fleet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pin-section { margin-bottom: 22px; }
.pin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.pin-card { position: relative; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.04); }
.pin-open { display: grid; gap: 3px; width: 100%; text-align: left; padding: 12px 34px 12px 14px; background: transparent; border: 0; color: inherit; cursor: pointer; font: inherit; }
.pin-open small { opacity: .6; letter-spacing: .08em; font-size: .65rem; }
.pin-open span { opacity: .75; font-size: .8rem; }
.pin-remove { position: absolute; top: 6px; right: 8px; background: transparent; border: 0; color: inherit; opacity: .55; cursor: pointer; font-size: 1.1rem; }
.pin-remove:hover { opacity: 1; }
.watch-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: .85rem; }
.section-gap { margin-top: 26px; }

/* ---- manager dropdown in sidebar ---- */
.nav-chevron { margin-left: auto; font-style: normal; font-size: 14px; line-height: 1; opacity: .7; transition: transform .2s; }
.main-tab.open .nav-chevron { transform: rotate(180deg); }
.main-tab.active .nav-chevron { opacity: 1; }
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 20px; padding-left: 10px; border-left: 1px solid #2e1f3a; }
.nav-sub[hidden] { display: none; }
.nav-sub .subnav-button { display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #a7a3b5; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.nav-sub .subnav-button::before { content: ''; flex: none; width: 6px; height: 6px; margin-right: 4px; border: 1px solid currentColor; border-radius: 50%; opacity: .6; }
.nav-sub .subnav-button b { margin-left: auto; min-width: 18px; padding: 1px 5px; border-radius: 5px; font-size: 9px; text-align: center; background: #1b2731; color: #9eafb7; }
.nav-sub .subnav-button:hover { background: #ffffff14; color: #ece9f5; }
.nav-sub .subnav-button.active { background: #6d28d926; color: #a855f7; font-weight: 600; }
.nav-sub .subnav-button.active::before { background: #a855f7; opacity: 1; }
@media (max-width: 900px) { .nav-sub { flex-direction: row; margin: 0; padding: 0 0 0 8px; border-left: 1px solid #2e1f3a; } .nav-sub .subnav-button { white-space: nowrap; } }
.landing-continue { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 50px; padding: 0 34px; border: 1px solid #ffffff2e; border-radius: 12px; color: #fff; background: #ffffff14; backdrop-filter: blur(6px); font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; transition: background .2s, transform .2s, border-color .2s; }
.landing-continue:hover { background: #ffffff26; border-color: #a855f7; transform: translateY(-2px); }
.landing-continue[hidden] { display: none; }

/* ---- member extras: widgets, gallery, lightbox, tour, bottom nav ---- */
.widget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; margin-bottom: 24px; }
.widget { min-width: 0; padding: 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.04); }
.widget.wide { grid-column: 1 / -1; }
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.widget-head h3 { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.widget-empty { margin: 0; opacity: .65; font-size: 13px; }
.widget-note { display: block; margin: 10px 0 6px; opacity: .65; }
.widget-link { background: transparent; border: 0; color: inherit; opacity: .6; cursor: pointer; font: inherit; font-size: 12px; text-decoration: underline; }
.new-pill { padding: 2px 8px; border-radius: 999px; background: #f0abfc; color: #1a0e02; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.rc-roster { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .65; }
.rc-rank { margin: 4px 0; font-size: 24px; font-weight: 800; color: #a855f7; }
.rc-sub { font-size: 13px; opacity: .8; margin-bottom: 12px; }
.rc-neighbour { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.rc-neighbour small { grid-row: span 2; font-size: 9px; letter-spacing: .1em; opacity: .55; align-self: center; }
.rc-neighbour span { grid-column: 2; opacity: .7; font-size: 12px; }
.rc-neighbour em { grid-row: span 2; grid-column: 3; font-style: normal; font-size: 11px; color: #a855f7; }
.contrib-top { display: flex; align-items: baseline; gap: 10px; }
.contrib-top strong { font-size: 34px; line-height: 1; color: #a855f7; }
.contrib-top span { font-size: 12px; opacity: .7; }
.stat-chips, .badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.stat-chip { padding: 3px 9px; border-radius: 8px; background: rgba(255,255,255,.07); font-size: 11px; }
.badge-chip { padding: 4px 10px; border-radius: 999px; background: rgba(168,85,247,.2); border: 1px solid rgba(168,85,247,.45); font-size: 12px; }
.badge-chip.locked { background: transparent; border-color: rgba(255,255,255,.12); opacity: .4; filter: grayscale(1); }
.board-row { display: grid; grid-template-columns: 28px 28px 1fr auto; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; font-size: 13px; }
.board-row.me { background: rgba(168,85,247,.15); }
.board-rank { text-align: center; opacity: .8; }
.board-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.feed-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; text-align: left; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.feed-row:disabled { cursor: default; opacity: .8; }
.feed-row:not(:disabled):hover { background: rgba(255,255,255,.06); }
.feed-text { display: grid; gap: 1px; min-width: 0; flex: 1; font-size: 13px; }
.feed-text span, .feed-text small { opacity: .7; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.recent-card { display: grid; gap: 2px; padding: 10px 12px; text-align: left; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.recent-card:hover { background: rgba(255,255,255,.06); }
.recent-card small { font-size: 9px; letter-spacing: .1em; opacity: .55; }
.recent-card span { font-size: 12px; opacity: .7; }

.extras-dialog { padding: 0; border: 0; background: transparent; color: var(--text, #e6edf0); max-width: 100vw; }
.extras-dialog::backdrop { background: #03070bd9; backdrop-filter: blur(5px); }
.extras-card { padding: 18px; border: 1px solid #354450; border-radius: 14px; background: #101922; box-shadow: 0 25px 100px #000a; }
.gallery-dialog { width: min(96vw, 980px); max-height: 90vh; overflow: auto; }
.gallery-tools { display: flex; align-items: center; gap: 8px; }
.gallery-tools .active { outline: 2px solid #a855f7; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.gallery-thumb { display: grid; gap: 4px; padding: 0; border: 2px solid transparent; border-radius: 10px; background: rgba(255,255,255,.04); color: inherit; font: inherit; cursor: pointer; overflow: hidden; }
.gallery-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.gallery-thumb span { padding: 0 8px 8px; font-size: 11px; opacity: .75; text-align: left; }
.gallery-grid.comparing .gallery-thumb { border-color: rgba(251,146,60,.35); }
.gallery-thumb.picked { border-color: #f0abfc !important; }
.compare-dialog { width: min(98vw, 1200px); max-height: 94vh; overflow: auto; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.compare-item { margin: 0; text-align: center; }
.compare-item img { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 10px; background: #000; }
.compare-item figcaption { margin-top: 6px; font-size: 12px; opacity: .75; }
.lightbox-dialog { width: 100vw; height: 100vh; max-height: 100vh; margin: 0; background: #000e; }
.lightbox-dialog[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox-stage { display: grid; place-items: center; max-width: 100vw; max-height: 82vh; overflow: auto; }
.lightbox-image { max-width: 92vw; max-height: 80vh; object-fit: contain; cursor: zoom-in; border-radius: 6px; }
.lightbox-dialog.zoomed .lightbox-image { max-width: none; max-height: none; width: min(200vw, 2400px); cursor: zoom-out; }
.lightbox-caption { margin: 12px 0 0; font-size: 13px; opacity: .8; }
.lightbox-close { position: fixed; top: 14px; right: 14px; z-index: 2; }
.lightbox-nav { position: fixed; top: 50%; z-index: 2; width: 44px; height: 56px; transform: translateY(-50%); font-size: 30px; }
.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }
.dup-warning { margin: -4px 0 10px; padding: 7px 10px; border: 1px solid #b7791f; border-radius: 8px; background: #b7791f26; color: #f6c453; font-size: 12px; }
.dup-warning[hidden] { display: none; }
.tour-dialog { width: min(92vw, 460px); }
.tour-card { text-align: center; padding: 26px 24px 18px; }
.tour-icon { font-size: 42px; line-height: 1; margin-bottom: 10px; }
.tour-card h2 { margin: 0 0 8px; }
.tour-text { margin: 0 auto 16px; max-width: 38ch; line-height: 1.55; opacity: .85; font-size: 14px; }
.tour-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 16px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.2); }
.tour-dots i.active { background: #a855f7; }

.bottom-nav { display: none; }
@media (max-width: 900px) {
  body.authed .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid #2e1f3a; background: #08120cf2; backdrop-filter: blur(8px); }
  body.authed { padding-bottom: 68px; }
  .bottom-nav button { flex: 1; display: grid; justify-items: center; gap: 2px; min-height: 48px; padding: 4px 0; border: 0; border-radius: 10px; background: transparent; color: #8c9a92; font: inherit; font-size: 10px; cursor: pointer; }
  .bottom-nav button span { font-size: 18px; line-height: 1; }
  .bottom-nav button.active { color: #a855f7; background: #6d28d926; }
  .widget-grid, .pin-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 86%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .widget, .pin-card { scroll-snap-align: start; }
  .widget.wide { grid-column: auto; }
  .compare-grid { grid-template-columns: 1fr; }
}

/* ---- map, quick add, banner, layout ---- */
.layout-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.layout-name { flex: 1; font-size: 14px; }
.layout-row .icon-button:disabled { opacity: .3; cursor: default; }
.banner-input, .setting-group select { width: 100%; max-width: 560px; margin: 6px 0; padding: 9px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; background: rgba(255,255,255,.05); color: inherit; font: inherit; }
.banner-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.banner-row select { width: auto; }
.banner-mirror { display: block; margin: 6px 0; font-size: 13px; opacity: .85; }
.site-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid #2e6f8c; border-radius: 12px; background: #12384a; color: #d8f1ff; }
.site-banner[hidden] { display: none; }
.site-banner-copy { display: grid; gap: 2px; }
.site-banner small { opacity: .7; }
.site-banner.level-warning { border-color: #b7791f; background: #4a3512; color: #ffe4a8; }
.site-banner.level-urgent { border-color: #b83a3a; background: #4d1717; color: #ffd0d0; }

.quick-fab { display: none; }
body.authed .quick-fab:not([hidden]) { position: fixed; right: 20px; bottom: 20px; z-index: 45; display: grid; place-items: center; width: 56px; height: 56px; border: 0; border-radius: 50%; background: #6d28d9; color: #fff; font-size: 30px; line-height: 1; cursor: pointer; box-shadow: 0 8px 26px #0008; }
.quick-fab:hover { filter: brightness(1.12); }
.quick-dialog { width: min(94vw, 460px); }
.quick-card { display: grid; gap: 12px; max-height: 90vh; overflow: auto; }
.quick-card h2 { margin: 0; }
.quick-field { display: grid; gap: 4px; font-size: 12px; opacity: .95; }
.quick-field[hidden] { display: none; }
.quick-field select, .quick-field input, .quick-field textarea { padding: 9px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; background: rgba(255,255,255,.05); color: inherit; font: inherit; font-size: 14px; }
.quick-preview { max-width: 100%; max-height: 180px; border-radius: 10px; object-fit: contain; justify-self: center; }
.quick-actions { display: flex; justify-content: flex-end; gap: 8px; }

.map-dialog { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; }
.map-dialog[open] { display: block; }
.map-shell { display: grid; grid-template-rows: auto 1fr; width: 100%; height: 100%; background: #0b141c; }
.map-header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #243442; }
.map-header h2 { margin: 0; font-size: 17px; }
.map-filter { padding: 6px 8px; border: 1px solid #354450; border-radius: 8px; background: #101922; color: inherit; font: inherit; }
.map-status { flex: 1; font-size: 12px; opacity: .65; }
.map-body { display: grid; grid-template-columns: 1fr 320px; min-height: 0; }
.map-viewport { position: relative; overflow: hidden; background: #123a63; touch-action: none; cursor: grab; user-select: none; }
.map-viewport:active { cursor: grabbing; }
.map-viewport.placing { cursor: crosshair; }
.map-layer { position: absolute; inset: 0; }
.map-tile { position: absolute; left: 0; top: 0; max-width: none; image-rendering: auto; pointer-events: none; }
.map-pins { pointer-events: none; }
.map-pin { position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; border: 0; background: transparent; color: #fff; pointer-events: auto; cursor: pointer; }
.map-pin i { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; background: var(--pin, #a855f7); box-shadow: 0 2px 8px #000a; }
.map-pin span { position: absolute; left: 12px; top: -10px; display: none; padding: 2px 7px; border-radius: 6px; background: #000b; font-size: 11px; white-space: nowrap; }
.map-viewport.labels .map-pin span, .map-pin:hover span, .map-pin.selected span { display: block; }
.map-pin.selected i { width: 24px; height: 24px; left: -12px; top: -12px; outline: 3px solid var(--pin); }
.map-zoom { position: absolute; right: 12px; top: 12px; display: grid; gap: 6px; }
.map-zoom .icon-button { width: 38px; height: 38px; border: 1px solid #354450; border-radius: 10px; background: #101922e6; color: #fff; font-size: 18px; }
.map-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: #b7791f; color: #fff; font-size: 13px; pointer-events: none; text-align: center; }
.map-hint[hidden] { display: none; }
.map-popup { position: absolute; left: 12px; bottom: 12px; display: grid; gap: 4px; width: min(320px, calc(100% - 24px)); padding: 14px; border: 1px solid #354450; border-radius: 12px; background: #101922f2; color: #e6edf0; font-size: 13px; }
.map-popup[hidden] { display: none; }
.map-popup p { margin: 4px 0 0; opacity: .8; }
.map-popup-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.map-side { display: grid; grid-template-rows: auto 1fr; min-height: 0; border-left: 1px solid #243442; background: #0e1821; }
.map-search { margin: 10px; padding: 8px 10px; border: 1px solid #354450; border-radius: 8px; background: #101922; color: inherit; font: inherit; }
.map-list { overflow: auto; padding: 0 8px 10px; }
.map-list .widget-empty { padding: 10px; }
.map-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.map-row:hover { background: rgba(255,255,255,.06); }
.map-row i { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--pin); }
.map-row.unpinned { opacity: .6; }
.map-row.unpinned i { background: transparent; border: 2px dashed var(--pin); }
.map-row-copy { display: grid; flex: 1; min-width: 0; }
.map-row-copy b, .map-row-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-row-copy small { opacity: .6; font-size: 11px; }
.map-row em { font-style: normal; font-size: 11px; color: #f6c453; }
@media (max-width: 900px) {
  .map-body { grid-template-columns: 1fr; grid-template-rows: 1fr 34vh; }
  .map-side { border-left: 0; border-top: 1px solid #243442; }
  .map-header { flex-wrap: wrap; }
  .map-status { order: 5; flex-basis: 100%; }
  body.authed .quick-fab:not([hidden]) { bottom: 84px; right: 14px; width: 52px; height: 52px; }
}

/* Council Of Idiots theme */
.landing { background: linear-gradient(180deg,#06030dcc 0%,#0b061499 45%,#06030de6 100%), url("/epm-bg.png") center / cover no-repeat fixed !important; }
.brand-mark,.login-emblem { border-radius: 50% !important; border: 2px solid #a855f7 !important; box-shadow: 0 0 18px #a855f788 !important; }
.brand strong, .sidebar-brand strong { letter-spacing: .12em; }
