:root {
  --bg: #06111f;
  --bg-2: #0a1829;
  --surface: rgba(12, 29, 48, 0.88);
  --surface-2: rgba(18, 39, 62, 0.9);
  --surface-3: #112943;
  --text: #f4f8fd;
  --muted: #9fb1c6;
  --line: rgba(184, 207, 230, 0.13);
  --brand: #16b6ff;
  --brand-2: #2bd8be;
  --brand-3: #57df74;
  --danger: #ff6b7a;
  --warning: #ffca5c;
  --success: #35d18a;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  --radius: 22px;
  --left: 246px;
  --right: 320px;
  --top: 74px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 15% 0%, rgba(13, 159, 232, .12), transparent 31rem),
    radial-gradient(circle at 100% 16%, rgba(44, 216, 190, .09), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #1e3e5c; border-radius: 20px; border: 2px solid #081522; }
::-webkit-scrollbar-track { background: transparent; }

.noscript { margin: 2rem; padding: 1rem; background: #3c1420; border: 1px solid #7f2e3f; border-radius: 14px; }

/* auth */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(380px, .8fr);
}
.auth-art {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 52px clamp(28px, 6vw, 92px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(135deg, rgba(3, 18, 34, .85), rgba(4, 29, 49, .72)),
    radial-gradient(circle at 76% 20%, rgba(38, 222, 185, .22), transparent 25rem),
    radial-gradient(circle at 15% 90%, rgba(17, 166, 245, .28), transparent 28rem);
}
.auth-art::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .2;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}
.auth-art > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 800; }
.auth-brand img { width: 48px; height: 48px; object-fit: contain; border-radius: 13px; }
.auth-message { max-width: 680px; }
.auth-message h1 { font-size: clamp(44px, 6vw, 84px); line-height: .96; margin: 0 0 22px; letter-spacing: -.055em; }
.auth-message h1 span { background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand-3)); -webkit-background-clip: text; color: transparent; }
.auth-message p { max-width: 600px; font-size: 19px; color: #c6d6e6; }
.auth-proof { display: flex; gap: 12px; flex-wrap: wrap; color: #cfe4f4; }
.auth-proof span { padding: 10px 13px; background: rgba(6, 23, 40, .55); border: 1px solid rgba(255,255,255,.09); border-radius: 999px; backdrop-filter: blur(12px); }
.auth-panel { display: grid; place-items: center; padding: 28px; background: #071321; border-left: 1px solid var(--line); }
.auth-card { width: min(100%, 460px); padding: clamp(24px, 4vw, 38px); background: rgba(14, 32, 51, .84); border: 1px solid var(--line); border-radius: 30px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.auth-card h2 { font-size: 32px; margin: 0 0 8px; letter-spacing: -.03em; }
.auth-card > p { margin: 0 0 26px; color: var(--muted); }
.auth-switch { margin-top: 20px; text-align: center; color: var(--muted); }
.auth-switch button { color: #5fd8ff; background: none; border: 0; cursor: pointer; font-weight: 700; }
.divider { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 20px 0; color: #70859c; font-size: 13px; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); }

/* forms */
.form-grid { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; color: #c8d6e4; font-weight: 650; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid rgba(169, 198, 224, .16);
  background: rgba(4, 18, 32, .62);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  transition: .2s ease;
}
.input:focus, .textarea:focus, .select:focus { border-color: rgba(26, 188, 255, .7); box-shadow: 0 0 0 4px rgba(20, 176, 245, .1); }
.textarea { min-height: 120px; resize: vertical; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-help { font-size: 12px; color: var(--muted); }
.form-error { color: #ff97a3; font-size: 13px; min-height: 18px; }

.btn {
  appearance: none;
  border: 0;
  min-height: 44px;
  border-radius: 13px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 750;
  color: var(--text);
  cursor: pointer;
  transition: transform .16s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(105deg, #168ff8, #18c9d2 55%, #31d991); color: #03151f; box-shadow: 0 12px 30px rgba(20, 187, 210, .18); }
.btn-secondary { background: rgba(20, 46, 72, .8); border: 1px solid var(--line); }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-danger { background: rgba(255, 89, 111, .12); color: #ff96a6; border: 1px solid rgba(255, 89, 111, .2); }
.btn-block { width: 100%; }
.btn-icon { width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 12px; }
.google-mark { width: 20px; height: 20px; border-radius: 50%; background: conic-gradient(#4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0); box-shadow: inset 0 0 0 5px #fff; }

/* app shell */
.app-shell { min-height: 100vh; }
.topbar {
  position: fixed;
  z-index: 40;
  top: 0; left: 0; right: 0;
  height: var(--top);
  display: grid;
  grid-template-columns: var(--left) minmax(0, 1fr) var(--right);
  align-items: center;
  background: rgba(6, 17, 31, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.topbar-brand { padding-left: 24px; display: flex; align-items: center; gap: 9px; font-weight: 850; font-size: 21px; }
.topbar-brand img { width: 39px; height: 39px; object-fit: contain; border-radius: 11px; }
.topbar-center { padding: 0 22px; }
.global-search { position: relative; max-width: 660px; margin: 0 auto; }
.global-search input { width: 100%; height: 45px; padding: 0 45px 0 43px; border-radius: 999px; border: 1px solid var(--line); background: rgba(15, 35, 56, .72); color: var(--text); outline: 0; }
.global-search input:focus { border-color: rgba(36, 202, 226, .55); box-shadow: 0 0 0 4px rgba(36, 202, 226, .08); }
.global-search .search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #8ca1b8; }
.global-search .search-kbd { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); border: 1px solid var(--line); background: #0b1d30; border-radius: 7px; padding: 3px 7px; color: #8297ae; font-size: 11px; }
.topbar-actions { padding-right: 22px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.icon-button { position: relative; width: 42px; height: 42px; border: 1px solid var(--line); background: rgba(13, 31, 50, .74); color: var(--text); border-radius: 13px; cursor: pointer; display: grid; place-items: center; }
.icon-button:hover { background: #142c46; }
.badge-dot { position: absolute; right: 6px; top: 5px; min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center; background: var(--danger); color: white; border: 2px solid var(--bg); border-radius: 99px; font-size: 9px; font-weight: 800; }
.top-avatar { width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line); overflow: hidden; cursor: pointer; background: #173a5a; display: grid; place-items: center; font-weight: 800; color: #b7ebff; }
.top-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar {
  position: fixed;
  z-index: 30;
  top: var(--top); bottom: 0; left: 0;
  width: var(--left);
  padding: 18px 14px 22px;
  border-right: 1px solid var(--line);
  background: rgba(6, 17, 31, .8);
  overflow-y: auto;
}
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 0 14px; color: #afc0d2; border-radius: 14px; border: 0; background: transparent; cursor: pointer; font-weight: 680; text-align: left; }
.nav-item:hover { color: #f4fbff; background: rgba(21, 52, 80, .56); }
.nav-item.active { color: #eaffff; background: linear-gradient(90deg, rgba(14, 161, 247, .18), rgba(34, 211, 183, .1)); border: 1px solid rgba(51, 198, 223, .13); }
.nav-icon { width: 22px; text-align: center; font-size: 18px; }
.nav-divider { height: 1px; background: var(--line); margin: 14px 8px; }
.sidebar-cta { margin: 8px 2px 16px; }
.sidebar-profile { margin-top: 14px; padding: 13px; display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 16px; background: rgba(14, 33, 53, .65); cursor: pointer; }
.sidebar-profile .avatar { flex: 0 0 auto; }
.sidebar-profile b, .sidebar-profile small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-profile small { color: var(--muted); font-size: 11px; margin-top: 2px; }

.rightbar {
  position: fixed;
  z-index: 20;
  top: var(--top); right: 0; bottom: 0;
  width: var(--right);
  padding: 20px 18px 30px;
  border-left: 1px solid var(--line);
  background: rgba(6, 17, 31, .55);
  overflow-y: auto;
}
.main-area { padding-top: var(--top); padding-left: var(--left); padding-right: var(--right); min-height: 100vh; }
.content-wrap { width: min(100%, 760px); margin: 0 auto; padding: 24px 20px 110px; }
.content-wrap.wide { width: min(100%, 1040px); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 40px rgba(0,0,0,.12); }
.section-card { padding: 20px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.panel-title h2, .panel-title h3 { margin: 0; letter-spacing: -.02em; }
.panel-title small { color: var(--muted); }

.demo-banner { margin-bottom: 16px; padding: 12px 14px; border-radius: 15px; background: rgba(255, 190, 77, .09); border: 1px solid rgba(255, 190, 77, .18); color: #ffd890; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 13px; }
.demo-banner a { font-weight: 800; color: #fff0bd; text-decoration: underline; }

/* feed */
.feed-tabs { display: flex; gap: 6px; padding: 6px; margin-bottom: 16px; background: rgba(12, 29, 48, .7); border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; }
.feed-tab { white-space: nowrap; flex: 1; min-width: 86px; height: 39px; border: 0; border-radius: 11px; background: transparent; color: #93a8be; font-weight: 750; cursor: pointer; }
.feed-tab.active { color: #eaffff; background: linear-gradient(100deg, rgba(17, 149, 245, .2), rgba(31, 210, 183, .15)); }
.composer-mini { display: flex; align-items: center; gap: 12px; padding: 15px; margin-bottom: 16px; }
.composer-mini button.fake-input { flex: 1; text-align: left; height: 45px; border-radius: 999px; padding: 0 16px; border: 1px solid var(--line); background: #0a1d30; color: #8fa4ba; cursor: pointer; }
.composer-mini .ask-btn { height: 43px; border-radius: 13px; border: 0; padding: 0 15px; font-weight: 780; color: #061824; background: linear-gradient(100deg, #1eb8ff, #2bd6bb); cursor: pointer; }
.feed-list { display: grid; gap: 15px; }
.post-card { padding: 18px; overflow: hidden; }
.post-head { display: flex; gap: 11px; align-items: center; }
.post-head-main { min-width: 0; flex: 1; }
.post-head b { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.post-head small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.role-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 99px; font-size: 9px; font-weight: 850; letter-spacing: .02em; text-transform: uppercase; background: rgba(36, 160, 255, .13); color: #78d0ff; }
.role-pill.school { background: rgba(58, 218, 126, .11); color: #6ce79e; }
.role-pill.admin { background: rgba(255, 100, 120, .12); color: #ff8b9b; }
.verified { color: #2dc9ff; font-size: 13px; }
.post-menu { width: 36px; height: 36px; border: 0; background: transparent; color: #8fa4b9; border-radius: 10px; cursor: pointer; }
.post-menu:hover { background: #132d48; }
.avatar { width: 43px; height: 43px; border-radius: 14px; background: linear-gradient(135deg, #146cc9, #24d7a8); display: grid; place-items: center; color: white; font-weight: 850; overflow: hidden; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 68px; height: 68px; border-radius: 20px; font-size: 20px; }
.avatar.sm { width: 36px; height: 36px; border-radius: 11px; font-size: 12px; }
.post-body { margin-top: 15px; cursor: pointer; }
.post-subject { display: inline-flex; align-items: center; min-height: 25px; padding: 0 10px; border-radius: 999px; color: #62d9ff; background: rgba(20, 178, 244, .1); font-size: 11px; font-weight: 750; }
.post-body h3 { margin: 10px 0 8px; font-size: 20px; line-height: 1.3; letter-spacing: -.02em; }
.post-body p { margin: 0; color: #c2d0df; font-size: 14px; white-space: pre-wrap; }
.post-image { display: block; width: 100%; max-height: 520px; object-fit: cover; margin-top: 15px; border-radius: 17px; border: 1px solid var(--line); background: #0d2237; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.tag { color: #8ecfe9; font-size: 12px; }
.post-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.action-btn { height: 38px; border: 0; background: transparent; color: #8fa5bb; border-radius: 10px; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.action-btn:hover { background: #102a44; color: #e7f7ff; }
.action-btn.active { color: #49d6f7; background: rgba(27, 192, 225, .08); }
.action-btn.like.active { color: #ff7791; }

/* right widgets */
.widget { margin-bottom: 16px; padding: 17px; background: rgba(12, 29, 48, .74); border: 1px solid var(--line); border-radius: 18px; }
.widget h3 { margin: 0 0 13px; font-size: 15px; }
.widget-link { display: flex; gap: 10px; align-items: center; padding: 9px 0; }
.widget-link + .widget-link { border-top: 1px solid rgba(180, 210, 235, .08); }
.widget-link div { min-width: 0; flex: 1; }
.widget-link b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-link small { color: var(--muted); font-size: 11px; }
.trend-number { color: #53728e; font-weight: 900; font-size: 12px; width: 22px; }
.footer-mini { color: #647d95; font-size: 11px; line-height: 1.7; }
.footer-mini a:hover { color: #a8c7db; }

/* generic page */
.page-head { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 15px; }
.page-head h1 { margin: 0; font-size: clamp(27px, 4vw, 36px); letter-spacing: -.04em; }
.page-head p { margin: 5px 0 0; color: var(--muted); }
.empty-state { padding: 46px 22px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 15px; display: grid; place-items: center; font-size: 26px; background: rgba(24, 180, 239, .09); color: #55d6f7; }
.empty-state h3 { color: var(--text); margin: 0 0 6px; }
.loading-card { height: 180px; border-radius: 22px; background: linear-gradient(90deg, #0d2236 25%, #15304a 38%, #0d2236 52%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border: 1px solid var(--line); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* modal composer */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; padding: 18px; display: grid; place-items: center; background: rgba(1, 8, 15, .72); backdrop-filter: blur(8px); }
.modal { width: min(100%, 650px); max-height: calc(100vh - 36px); overflow-y: auto; background: #0b1d2f; border: 1px solid rgba(173, 207, 233, .16); border-radius: 24px; box-shadow: 0 30px 100px rgba(0,0,0,.45); }
.modal-head { position: sticky; top: 0; z-index: 2; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; background: rgba(11, 29, 47, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-body { padding: 20px; }
.close-btn { width: 36px; height: 36px; border: 0; border-radius: 11px; background: #142d47; color: #d3e5f3; cursor: pointer; }
.file-drop { position: relative; padding: 18px; text-align: center; border: 1px dashed rgba(112, 199, 235, .34); border-radius: 15px; color: var(--muted); background: rgba(19, 49, 75, .26); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.image-preview { margin-top: 12px; position: relative; }
.image-preview img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 14px; }

/* post detail */
.detail-card { padding: 22px; }
.detail-card .post-body h1 { font-size: clamp(24px, 4vw, 34px); margin: 11px 0; }
.answers-head { margin: 18px 0 12px; display: flex; justify-content: space-between; align-items: center; }
.answer-card { padding: 18px; margin-bottom: 12px; }
.answer-card p { color: #cad7e3; white-space: pre-wrap; }
.answer-form { padding: 18px; margin: 18px 0; }

/* profile */
.profile-cover { height: 190px; border-radius: 24px 24px 0 0; background: radial-gradient(circle at 75% 20%, rgba(74, 231, 174, .5), transparent 22rem), linear-gradient(135deg, #0a67be, #0e314e 60%, #17224b); }
.profile-main { position: relative; padding: 0 22px 22px; margin-top: -40px; }
.profile-main .avatar.lg { width: 94px; height: 94px; border-radius: 25px; border: 5px solid #0d2034; }
.profile-topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; }
.profile-info h1 { margin: 14px 0 2px; font-size: 27px; }
.profile-info .handle { color: #8ba2b8; }
.profile-info p { max-width: 620px; color: #c5d3e0; }
.profile-stats { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 15px; }
.profile-stats b { display: block; font-size: 17px; }
.profile-stats span { color: var(--muted); font-size: 12px; }
.profile-tabs { display: flex; gap: 6px; margin: 16px 0; }

/* notifications */
.notification-item { display: flex; gap: 12px; padding: 15px 17px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notification-item:last-child { border-bottom: 0; }
.notification-item.unread { background: rgba(22, 173, 239, .045); }
.notification-item p { margin: 1px 0 4px; color: #d1deea; font-size: 14px; }
.notification-item small { color: var(--muted); }
.notification-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: 0 0 auto; background: rgba(29, 188, 239, .1); color: #5fdcff; }

/* messages */
.messages-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); height: calc(100vh - var(--top) - 48px); min-height: 560px; overflow: hidden; }
.conversation-list { border-right: 1px solid var(--line); overflow-y: auto; }
.conversation-list-head { padding: 17px; border-bottom: 1px solid var(--line); }
.conversation-item { display: flex; gap: 11px; padding: 13px 15px; cursor: pointer; border-bottom: 1px solid rgba(180, 210, 235, .06); }
.conversation-item:hover, .conversation-item.active { background: rgba(23, 60, 91, .42); }
.conversation-item div { min-width: 0; flex: 1; }
.conversation-item b, .conversation-item small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-item small { color: var(--muted); margin-top: 3px; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-messages { flex: 1; padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; }
.bubble { max-width: min(78%, 520px); padding: 10px 13px; border-radius: 16px 16px 16px 4px; background: #15334f; color: #dbe7f2; align-self: flex-start; }
.bubble.mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: linear-gradient(120deg, #117fd3, #17b4bf); color: white; }
.bubble small { display: block; opacity: .65; font-size: 9px; margin-top: 4px; }
.chat-form { padding: 13px; border-top: 1px solid var(--line); display: flex; gap: 9px; }
.chat-form input { flex: 1; }

/* leaderboard */
.leaderboard-row { display: grid; grid-template-columns: 50px 1fr auto; gap: 12px; align-items: center; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.leaderboard-row:last-child { border-bottom: 0; }
.rank { font-size: 15px; font-weight: 900; color: #728da6; text-align: center; }
.rank.top { color: #ffd366; }
.user-inline { display: flex; gap: 10px; align-items: center; min-width: 0; }
.user-inline div { min-width: 0; }
.user-inline b, .user-inline small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-inline small { color: var(--muted); }
.points { color: #5edaf3; font-weight: 850; }

/* settings */
.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.settings-nav { padding: 8px; height: fit-content; }
.settings-nav button { width: 100%; text-align: left; padding: 11px 12px; border: 0; background: transparent; color: #9cb0c4; border-radius: 10px; cursor: pointer; }
.settings-nav button.active { background: #14314c; color: white; }
.settings-section { padding: 22px; }
.setting-row { display: flex; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.toggle { width: 46px; height: 26px; border-radius: 999px; border: 0; background: #29445d; padding: 3px; cursor: pointer; }
.toggle::after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: white; transition: .2s; }
.toggle.on { background: #18bda5; }
.toggle.on::after { transform: translateX(20px); }

/* search */
.search-results { display: grid; gap: 12px; }
.search-user { padding: 14px; display: flex; align-items: center; gap: 11px; }
.search-user .btn { margin-left: auto; min-height: 36px; }

/* mobile nav */
.mobile-bottom { display: none; }
.mobile-top-brand { display: none; }

/* toast */
.toast-root { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 9px; width: min(360px, calc(100vw - 36px)); }
.toast { padding: 13px 15px; background: #122b44; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); animation: toastIn .22s ease; }
.toast.error { background: #3a1722; border-color: rgba(255, 111, 130, .22); }
.toast.success { background: #0f352e; border-color: rgba(66, 218, 155, .2); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* dropdown */
.dropdown { position: absolute; z-index: 80; right: 18px; top: calc(var(--top) - 5px); width: 240px; padding: 8px; background: #0d2237; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.dropdown button { width: 100%; min-height: 40px; text-align: left; padding: 0 11px; color: #c5d5e3; background: transparent; border: 0; border-radius: 9px; cursor: pointer; }
.dropdown button:hover { background: #15334e; }

@media (max-width: 1180px) {
  :root { --right: 0px; }
  .rightbar { display: none; }
  .topbar { grid-template-columns: var(--left) minmax(0,1fr) 180px; }
}

@media (max-width: 860px) {
  :root { --left: 0px; --top: 64px; }
  .topbar { grid-template-columns: 1fr auto; height: var(--top); }
  .topbar-brand { display: none; }
  .topbar-center { padding: 0 10px 0 14px; }
  .topbar-actions { padding-right: 12px; gap: 7px; }
  .topbar-actions .desktop-only { display: none; }
  .sidebar { display: none; }
  .main-area { padding-left: 0; padding-right: 0; }
  .content-wrap, .content-wrap.wide { width: 100%; padding: 16px 12px 94px; }
  .mobile-top-brand { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; font-weight: 850; }
  .mobile-top-brand img { width: 34px; height: 34px; border-radius: 10px; }
  .global-search { display: flex; align-items: center; max-width: none; }
  .global-search input { height: 42px; }
  .search-kbd { display: none; }
  .mobile-bottom { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; height: calc(66px + env(safe-area-inset-bottom)); padding: 7px 8px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(6, 17, 31, .94); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
  .mobile-bottom button { border: 0; background: transparent; color: #7f95aa; border-radius: 12px; display: grid; place-items: center; font-size: 19px; cursor: pointer; }
  .mobile-bottom button.active { color: #5bdcf1; background: rgba(30, 195, 220, .08); }
  .mobile-bottom .create-mobile { width: 46px; height: 46px; align-self: center; justify-self: center; border-radius: 15px; color: #061a24; background: linear-gradient(135deg, #16b9ff, #32d99b); font-size: 26px; }
  .post-card { border-radius: 18px; padding: 15px; }
  .post-actions { gap: 2px; }
  .action-btn { font-size: 0; }
  .action-btn span { font-size: 15px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { min-height: 100vh; border-left: 0; }
  .messages-layout { grid-template-columns: 1fr; height: calc(100vh - var(--top) - 90px); }
  .conversation-list { border-right: 0; }
  .messages-layout.chat-open .conversation-list { display: none; }
  .messages-layout:not(.chat-open) .chat-pane { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; }
  .settings-nav button { white-space: nowrap; width: auto; }
}

@media (max-width: 560px) {
  .topbar-actions .hide-small { display: none; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .global-search input { padding-right: 12px; }
  .global-search .search-icon { left: 13px; }
  .page-head { align-items: flex-start; }
  .page-head .btn { min-height: 40px; padding: 0 12px; }
  .composer-mini .ask-btn { display: none; }
  .input-row { grid-template-columns: 1fr; }
  .profile-topline { align-items: center; }
  .profile-main { padding-left: 16px; padding-right: 16px; }
  .profile-cover { height: 150px; }
  .profile-main .avatar.lg { width: 82px; height: 82px; }
  .profile-stats { gap: 15px; }
  .demo-banner { align-items: flex-start; flex-direction: column; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; }
}

/* Tefsen identity + avatar reliability patch */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-left: 3px;
  vertical-align: -3px;
  flex: 0 0 auto;
}
.verified-badge svg { display: block; overflow: visible; }
.verified-badge-fill { fill: #21a7ff; stroke: #65d7ff; stroke-width: .45; }
.verified-badge-check { fill: none; stroke: #fff; stroke-width: 2.45; stroke-linecap: round; stroke-linejoin: round; }

.avatar {
  position: relative;
  border-radius: 50%;
  border: 1px solid rgba(104, 211, 255, .30);
  box-shadow: 0 0 0 2px rgba(8, 25, 42, .92), 0 8px 24px rgba(0, 0, 0, .16);
  isolation: isolate;
}
.avatar.sm { border-radius: 50%; }
.avatar.lg { border-radius: 50%; }
.avatar-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 0;
  color: #fff;
  font: inherit;
  font-weight: 850;
  background: linear-gradient(135deg, #148fe8, #20d7b0);
}
.avatar img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
  background: #0d2034;
}
.profile-main .avatar.lg {
  border-radius: 50%;
  border: 3px solid rgba(75, 202, 255, .74);
  box-shadow: 0 0 0 5px rgba(13, 32, 52, .98), 0 14px 34px rgba(0, 0, 0, .24);
}
.top-avatar {
  border-radius: 50%;
  border-color: rgba(92, 209, 255, .42);
}
.top-avatar img { border-radius: 50%; object-position: center; }
.top-avatar { position: relative; isolation: isolate; }
.top-avatar-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #148fe8, #20d7b0);
  color: #fff;
  font-weight: 850;
}
.top-avatar img { position: absolute; inset: 0; z-index: 1; }

/* UI polish + responsive interaction speed patch */
.widget {
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(13, 32, 52, .88), rgba(10, 27, 45, .82));
  box-shadow: 0 12px 36px rgba(0, 0, 0, .10);
}
.widget h3 { margin-bottom: 11px; letter-spacing: -.015em; }
.widget-link {
  min-height: 48px;
  padding: 10px 0;
  gap: 11px;
  border-radius: 12px;
}
.widget-link > .avatar,
.widget-link > .avatar.sm {
  width: 38px;
  height: 38px;
  min-width: 38px;
  flex: 0 0 38px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
}
.widget-link > div:not(.avatar) {
  min-width: 0;
  flex: 1 1 auto;
}
.widget-link b { line-height: 1.25; }
.widget-link small { display: block; margin-top: 3px; line-height: 1.3; }
.rightbar .notification-icon { flex: 0 0 40px; }
.footer-mini { padding: 2px 2px 14px; }

.action-btn {
  transition: color .14s ease, background-color .14s ease, transform .12s ease, opacity .14s ease;
  will-change: transform;
}
.action-btn:active { transform: scale(.96); }
.action-btn.like.active { color: #ff7791; background: rgba(255, 119, 145, .075); }
.action-btn.like.is-pending { opacity: .78; }
.action-btn:disabled { cursor: default; }
.action-btn.like.is-pending svg { animation: tefsen-like-pulse .62s ease-in-out infinite alternate; }
@keyframes tefsen-like-pulse { from { transform: scale(.94); } to { transform: scale(1.08); } }

/* Keep compact side widgets tidy on medium desktop widths. */
@media (max-width: 1280px) and (min-width: 981px) {
  :root { --right: 292px; }
  .rightbar { padding: 18px 14px; }
  .widget { padding: 14px; }
  .widget-link b { font-size: 12.5px; }
}


/* Subscription limits, multi-image posts, and role-coloured verification */
.verified-badge.verified-student .verified-badge-fill { fill: #22c873; stroke: #74efad; }
.verified-badge.verified-university .verified-badge-fill { fill: #249cff; stroke: #7dd8ff; }
.verified-badge.verified-admin .verified-badge-fill { fill: #ef476f; stroke: #ff8ca5; }

.composer-plan {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid rgba(100, 180, 225, .16);
  border-radius: 13px;
  background: rgba(17, 48, 74, .62);
}
.composer-plan b { color: #d9e9f5; white-space: nowrap; }
.composer-plan span { color: var(--muted); font-size: 11px; text-align: right; line-height: 1.35; }
.composer-plan.subscribed { background: linear-gradient(135deg, rgba(29, 155, 255, .12), rgba(42, 216, 155, .10)); border-color: rgba(72, 216, 190, .24); }

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.image-preview-grid figure { margin: 0; position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: #081b2d; }
.image-preview-grid img { width: 100%; height: 180px; object-fit: cover; display: block; }
.image-preview-grid figcaption { position: absolute; right: 7px; bottom: 7px; padding: 4px 7px; border-radius: 999px; background: rgba(5, 15, 27, .82); color: #d9e8f3; font-size: 10px; }
.image-preview-grid.hidden { display: none; }

.post-image-grid { display: grid; gap: 7px; margin-top: 14px; overflow: hidden; border-radius: 16px; }
.post-image-grid.one { grid-template-columns: 1fr; }
.post-image-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-image-grid .post-image { width: 100%; height: 100%; min-height: 220px; max-height: 460px; margin: 0; object-fit: cover; border-radius: 0; }
.post-image-grid.two .post-image { aspect-ratio: 1 / 1; min-height: 0; max-height: none; }

.subscription-widget-link { width: 100%; border: 0; border-top: 1px solid var(--line); color: inherit; background: transparent; text-align: left; cursor: pointer; }
.subscription-widget-link:hover { background: rgba(39, 150, 206, .06); }
.subscription-hero { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 24px; margin-bottom: 16px; }
.subscription-hero.is-subscribed { background: linear-gradient(135deg, rgba(22, 131, 232, .14), rgba(35, 211, 152, .10)); border-color: rgba(65, 213, 180, .24); }
.subscription-kicker { display: block; color: #6ad8f2; font-size: 10px; font-weight: 900; letter-spacing: .12em; margin-bottom: 7px; }
.subscription-hero h2 { margin: 0 0 7px; }
.subscription-hero p { margin: 0; color: var(--muted); }
.subscription-status { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; background: rgba(44, 210, 155, .12); color: #63e2b4; font-weight: 850; }
.subscription-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.subscription-card { padding: 20px; }
.subscription-card h3 { margin: 0 0 10px; }
.subscription-card > b { display: block; font-size: 23px; letter-spacing: -.03em; }
.subscription-card p { color: var(--muted); line-height: 1.55; }
.subscription-card small { color: #65d8f2; }
.subscription-note { padding: 20px; }
.subscription-note h3 { margin-top: 0; }
.subscription-note p { color: var(--muted); line-height: 1.6; }

@media (max-width: 700px) {
  .composer-plan { align-items: flex-start; flex-direction: column; }
  .composer-plan span { text-align: left; }
  .subscription-grid { grid-template-columns: 1fr; }
  .subscription-hero { align-items: flex-start; }
  .post-image-grid .post-image { min-height: 180px; }
}


/* Settings tabs, Google Play subscription CTA, and role badge polish */
.settings-panel { display: none; }
.settings-panel.active { display: block; animation: settings-panel-in .16s ease; }
@keyframes settings-panel-in { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.settings-nav button { cursor: pointer; }
.settings-nav button.active { background: rgba(42, 157, 214, .18); color: #f3f9fd; }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.toggle.active { background: linear-gradient(135deg, #25a7ff, #2bd79b); border-color: transparent; }
.toggle.active::after { transform: translateX(20px); background: #041522; }
.pref-compact .post-card { padding-top: 14px; padding-bottom: 14px; }
.pref-reduced-motion *, .pref-reduced-motion *::before, .pref-reduced-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
.subscription-price-wrap { display: flex; align-items: baseline; gap: 5px; flex: 0 0 auto; }
.subscription-price { font-size: clamp(28px, 4vw, 42px); line-height: 1; letter-spacing: -.045em; color: #f2fbff; }
.subscription-price-wrap span { color: var(--muted); font-size: 12px; font-weight: 700; }
.subscription-play-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.subscription-play-card > div:first-child { min-width: 0; }
.subscription-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.verified-badge.verified-university .verified-badge-fill { fill: #168dff; stroke: #7bcfff; }
@media (max-width: 760px) {
  .subscription-play-card { align-items: flex-start; flex-direction: column; }
  .subscription-actions { width: 100%; justify-content: stretch; }
  .subscription-actions .btn { flex: 1 1 180px; }
}


/* Follow + profile navigation polish */
.user-name-link,
.avatar-route-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.user-name-link { display: inline-flex; align-items: center; max-width: 100%; }
.user-name-link b { display: inline-flex; align-items: center; gap: 4px; }
.user-name-link:hover b { color: #7fe3ff; }
.avatar-route-button { display: inline-grid; place-items: center; border-radius: 999px; }
.avatar-route-button:focus-visible,
.user-name-link:focus-visible { outline: 2px solid var(--cyan, #32d9ff); outline-offset: 3px; }
.profile-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn.is-following { border-color: rgba(74, 215, 255, .28); }
.admin-access-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
  color: #ffd2dc;
  background: rgba(239, 68, 101, .13);
  border: 1px solid rgba(239, 68, 101, .28);
  white-space: nowrap;
}
.subscription-hero.is-admin { box-shadow: inset 0 0 0 1px rgba(239, 68, 101, .12); }
@media (max-width: 640px) {
  .profile-actions { width: 100%; justify-content: stretch; }
  .profile-actions .btn { flex: 1 1 140px; }
}

/* Mobile quality pass: header, profile, action counts, menu and spacing */
.profile-dropdown {
  position: fixed;
  top: calc(var(--top) + 8px);
  right: 12px;
  width: min(280px, calc(100vw - 24px));
  padding: 9px;
}
.dropdown-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px 10px;
  min-width: 0;
}
.dropdown-user > div:last-child { min-width: 0; }
.dropdown-user b,
.dropdown-user small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dropdown-user small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.dropdown-separator { height: 1px; margin: 5px 4px; background: var(--line); }
.profile-dropdown button { display: flex; align-items: center; gap: 10px; }
.profile-dropdown button span { min-width: 0; }
.profile-dropdown .dropdown-danger { color: #ff8da3; }
.profile-dropdown .dropdown-danger:hover { background: rgba(239, 68, 101, .10); }

.action-btn { min-width: 0; overflow: hidden; }
.action-btn .action-icon { display: inline-grid; place-items: center; flex: 0 0 auto; }
.action-btn .action-count {
  display: inline-block;
  min-width: 1ch;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: currentColor;
  line-height: 1;
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0 10px;
  }
  .topbar-brand {
    display: flex;
    padding-left: 0;
    gap: 7px;
    min-width: 0;
    font-size: 17px;
    letter-spacing: -.02em;
  }
  .topbar-brand img { width: 30px; height: 30px; border-radius: 9px; }
  .topbar-center { min-width: 0; padding: 0; }
  .mobile-top-brand { display: none !important; }
  .global-search { width: 100%; min-width: 0; max-width: none; }
  .global-search input {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 12px 0 38px;
    font-size: 13.5px;
  }
  .global-search .search-icon { left: 12px; }
  .topbar-actions { padding-right: 0; gap: 6px; }
  .top-avatar { width: 40px; height: 40px; flex: 0 0 40px; }
  .profile-dropdown { top: calc(var(--top) + 6px); right: 8px; }
}

@media (max-width: 640px) {
  .content-wrap { padding: 12px 11px calc(88px + env(safe-area-inset-bottom)); }

  .topbar { gap: 7px; padding-inline: 8px; }
  .topbar-brand { font-size: 16px; gap: 5px; }
  .topbar-brand img { width: 28px; height: 28px; }
  .global-search input { height: 38px; font-size: 13px; }
  .top-avatar { width: 38px; height: 38px; flex-basis: 38px; }

  /* Compact, native-feeling mobile profile instead of an oversized card. */
  .profile-cover { height: 112px; border-radius: 18px 18px 0 0; }
  .profile-main { margin-top: -31px; padding: 0 14px 15px; }
  .profile-main .avatar.lg { width: 72px; height: 72px; border-width: 3px; box-shadow: 0 0 0 4px rgba(13, 32, 52, .98), 0 10px 25px rgba(0,0,0,.22); }
  .profile-topline { align-items: flex-end; gap: 9px; }
  .profile-topline > div:last-child { min-width: 0; }
  .profile-topline > div:last-child > .btn,
  .profile-actions .btn {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 12.5px;
    white-space: nowrap;
  }
  .profile-actions { width: auto; justify-content: flex-end; gap: 7px; }
  .profile-actions .btn { flex: 0 1 auto; }
  .profile-info h1 { margin: 10px 0 2px; font-size: 23px; line-height: 1.15; }
  .profile-info .handle { font-size: 13px; }
  .profile-info p { margin: 12px 0; font-size: 14px; line-height: 1.48; }
  .profile-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 13px;
  }
  .profile-stats span {
    min-width: 0;
    padding: 8px 2px;
    text-align: center;
    border: 1px solid rgba(103, 180, 224, .10);
    border-radius: 11px;
    background: rgba(10, 29, 48, .44);
    font-size: 10px;
    line-height: 1.2;
  }
  .profile-stats b { margin-bottom: 3px; font-size: 16px; }
  .profile-tabs { margin: 11px 0; }
  .profile-tabs .feed-tab { min-height: 42px; }

  /* Keep engagement numbers visible on narrow screens. */
  .post-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .action-btn { min-height: 40px; padding: 0 5px; gap: 5px; font-size: 11.5px; }
  .action-btn .action-count { display: inline-block !important; font-size: 11.5px; }
  .post-card { padding: 14px; border-radius: 18px; }
  .post-head { gap: 9px; }
  .post-head-main small { font-size: 10.5px; }
  .post-body h3 { font-size: 17px; line-height: 1.3; }
  .post-body p { font-size: 13.5px; line-height: 1.55; }

  .mobile-bottom { height: calc(62px + env(safe-area-inset-bottom)); padding-top: 6px; }
  .mobile-bottom .create-mobile { width: 44px; height: 44px; border-radius: 14px; }
}

@media (max-width: 430px) {
  .topbar-brand span { font-size: 15px; }
  .global-search input { padding-left: 34px; font-size: 12.5px; }
  .global-search input::placeholder { color: #7d93aa; }
  .profile-topline > div:last-child > .btn,
  .profile-actions .btn { padding-inline: 10px; }
  .profile-info h1 { font-size: 21px; }
  .profile-stats span { font-size: 9.5px; }
  .action-btn { gap: 4px; font-size: 10.5px; }
  .action-btn svg { width: 16px; height: 16px; }
}


/* Mobile account menu reliability + luxury subscription experience */
.profile-menu-backdrop {
  position: fixed;
  z-index: 88;
  inset: 0;
  background: rgba(2, 9, 17, .28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.profile-dropdown {
  z-index: 90;
  overflow: hidden;
  border-color: rgba(112, 196, 236, .20);
  background:
    radial-gradient(circle at 90% -10%, rgba(34, 218, 194, .14), transparent 42%),
    linear-gradient(180deg, rgba(15, 37, 59, .985), rgba(8, 25, 42, .99));
  box-shadow: 0 26px 80px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.05);
}
.dropdown-user-premium { padding-bottom: 7px; }
.dropdown-plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 8px 7px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #7de9ff;
  background: rgba(33, 178, 228, .10);
  border: 1px solid rgba(71, 205, 238, .15);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .03em;
}
.profile-dropdown button {
  display: grid;
  grid-template-columns: 20px minmax(0,1fr);
  align-items: center;
  column-gap: 10px;
  min-height: 49px;
  padding: 7px 10px;
}
.profile-dropdown button svg { grid-row: 1 / span 2; }
.profile-dropdown button span { font-weight: 760; color: #e7f4fd; }
.profile-dropdown button small {
  display: block;
  grid-column: 2;
  color: #829bb2;
  font-size: 9.5px;
  line-height: 1.25;
}
.profile-dropdown .dropdown-danger { display: flex; min-height: 43px; }
html.profile-menu-open { overflow: hidden; }

.subscription-luxury-page { display: grid; gap: 18px; padding-bottom: 18px; }
.subscription-luxury-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 4px 2px 2px;
}
.subscription-luxury-head h1 {
  margin: 5px 0 7px;
  font-size: clamp(31px, 5vw, 54px);
  line-height: .98;
  letter-spacing: -.05em;
  background: linear-gradient(105deg, #ffffff 4%, #cceeff 48%, #7af2d2 96%);
  -webkit-background-clip: text;
  color: transparent;
}
.subscription-luxury-head p { max-width: 680px; margin: 0; color: #98aec2; font-size: 15px; }
.lux-overline,
.lux-card-kicker,
.lux-plan-eyebrow {
  color: #69dcf7;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .15em;
}
.lux-secure-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid rgba(92, 223, 188, .16);
  border-radius: 999px;
  color: #9fead4;
  background: rgba(25, 151, 125, .08);
  font-size: 11px;
  font-weight: 800;
}
.lux-plan-hero {
  position: relative;
  overflow: hidden;
  min-height: 270px;
  padding: clamp(24px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  border: 1px solid rgba(111, 203, 238, .18);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(16, 56, 86, .94), rgba(8, 30, 51, .97) 52%, rgba(9, 47, 56, .92)),
    #0c2136;
  box-shadow: 0 28px 80px rgba(0,0,0,.26), inset 0 1px rgba(255,255,255,.06);
}
.lux-plan-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(110deg, #000, transparent 78%);
}
.lux-plan-hero.is-plus { border-color: rgba(79, 232, 195, .27); }
.lux-plan-hero.is-admin { border-color: rgba(255, 111, 143, .25); background: linear-gradient(135deg, rgba(67, 25, 49, .94), rgba(13, 31, 50, .97) 58%, rgba(26, 23, 48, .95)); }
.lux-glow { position: absolute; width: 360px; height: 360px; border-radius: 50%; filter: blur(28px); opacity: .22; pointer-events: none; }
.lux-glow-a { right: -130px; top: -170px; background: #20d7b8; }
.lux-glow-b { left: -210px; bottom: -250px; background: #1a9cff; }
.lux-plan-content,
.lux-plan-price { position: relative; z-index: 1; }
.lux-plan-content h2 { margin: 8px 0 10px; font-size: clamp(30px, 4.2vw, 48px); letter-spacing: -.045em; line-height: 1; }
.lux-plan-content > p { max-width: 620px; margin: 0; color: #a9bdce; font-size: 15px; line-height: 1.65; }
.lux-plan-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.btn.lux-primary { color: #051721; font-weight: 900; background: linear-gradient(115deg, #20b9ff, #2cdeaa); box-shadow: 0 12px 30px rgba(24, 197, 204, .18); }
.btn.lux-secondary { color: #d7edf8; background: rgba(8, 28, 45, .55); border: 1px solid rgba(141, 205, 235, .16); }
.lux-plan-price { min-width: 190px; text-align: right; }
.lux-price { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; }
.lux-price strong { font-size: clamp(42px, 6vw, 66px); letter-spacing: -.06em; line-height: .9; }
.lux-price span { color: #a8bccd; font-size: 12px; font-weight: 750; }
.lux-plan-price > small { display: block; margin-top: 10px; color: #7491a8; }
.lux-access-token { display: inline-flex; align-items: center; gap: 8px; padding: 11px 15px; border-radius: 999px; color: #ffd8e2; background: rgba(236, 71, 111, .12); border: 1px solid rgba(255, 116, 151, .21); font-weight: 900; }

.lux-usage-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.lux-usage-card {
  position: relative;
  padding: 22px;
  border: 1px solid rgba(141, 196, 226, .13);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(15, 39, 62, .92), rgba(8, 26, 44, .90));
  box-shadow: inset 0 1px rgba(255,255,255,.03);
}
.lux-icon-orb { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 13px; color: #6ce6ff; background: linear-gradient(145deg, rgba(28, 169, 231, .17), rgba(43, 220, 172, .09)); border: 1px solid rgba(85, 207, 239, .13); }
.lux-usage-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lux-usage-top span { font-weight: 780; }
.lux-usage-top strong { font-size: 22px; letter-spacing: -.035em; }
.lux-usage-card p { min-height: 42px; margin: 9px 0 16px; color: #91a8bb; font-size: 13px; }
.lux-meter { overflow: hidden; height: 6px; border-radius: 999px; background: rgba(145, 190, 216, .09); }
.lux-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #16b8ff, #2bdcab); box-shadow: 0 0 16px rgba(37, 211, 189, .35); }
.lux-usage-card small { display: block; margin-top: 9px; color: #6fdcf2; }

.lux-compare-section { padding: clamp(22px, 4vw, 34px); border: 1px solid rgba(140, 198, 229, .12); border-radius: 28px; background: rgba(10, 28, 46, .62); }
.lux-section-title h2 { margin: 6px 0 20px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.04em; }
.lux-section-title span { color: #6adcf5; font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.lux-compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.lux-plan-card { position: relative; padding: 22px; border-radius: 22px; border: 1px solid rgba(145, 197, 225, .12); background: rgba(7, 23, 40, .66); }
.lux-plan-card-plus { background: linear-gradient(145deg, rgba(15, 61, 79, .85), rgba(8, 32, 49, .9)); border-color: rgba(70, 219, 190, .18); }
.lux-plan-card.is-current { box-shadow: inset 0 0 0 1px rgba(75, 216, 236, .16), 0 14px 36px rgba(0,0,0,.14); }
.lux-plan-card h3 { margin: 6px 0 6px; font-size: 24px; letter-spacing: -.035em; }
.lux-plan-card h3 small { color: #879db0; font-size: 11px; }
.lux-plan-card p { margin: 0; color: #8fa6ba; font-size: 13px; }
.lux-plan-card ul { display: grid; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; color: #c5d9e8; font-size: 13px; }
.lux-plan-card li { display: flex; align-items: center; gap: 8px; }
.lux-plan-card li svg { color: #58dec0; }
.lux-current-pill { display: inline-flex; margin-top: 20px; padding: 7px 10px; border-radius: 999px; color: #79e6ca; background: rgba(50, 195, 158, .10); font-size: 10px; font-weight: 850; }
.lux-card-cta { display: inline-block; margin-top: 20px; color: #70e8ff; font-size: 12px; font-weight: 850; }

.lux-billing-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 22px; border-radius: 24px; border: 1px solid rgba(129, 193, 225, .13); background: linear-gradient(120deg, rgba(17, 39, 61, .84), rgba(7, 24, 41, .92)); }
.lux-billing-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 17px; color: #061924; background: linear-gradient(135deg, #5ad8ff, #55e5a4); font-size: 22px; font-weight: 1000; box-shadow: 0 10px 28px rgba(32, 202, 201, .16); }
.lux-billing-card h3 { margin: 4px 0 5px; }
.lux-billing-card p { margin: 0; color: #91a8ba; font-size: 13px; line-height: 1.55; }

@media (max-width: 860px) {
  .profile-menu-backdrop { background: rgba(1, 8, 15, .54); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
  .profile-dropdown {
    position: fixed;
    top: calc(var(--top) + 8px);
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100dvh - var(--top) - 24px);
    overflow-y: auto;
    border-radius: 22px;
    animation: mobile-account-menu-in .18s ease-out;
  }
  @keyframes mobile-account-menu-in { from { opacity: 0; transform: translateY(-7px) scale(.985); } to { opacity: 1; transform: none; } }
  .dropdown-user { padding: 10px 10px 9px; }
  .dropdown-user .avatar.sm { width: 46px; height: 46px; }
  .profile-dropdown button { min-height: 54px; }

  .subscription-luxury-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .lux-plan-hero { min-height: 0; grid-template-columns: 1fr; padding: 26px 22px; }
  .lux-plan-price { min-width: 0; text-align: left; }
  .lux-price { justify-content: flex-start; }
  .lux-usage-grid,
  .lux-compare-grid { grid-template-columns: 1fr; }
  .lux-billing-card { grid-template-columns: auto 1fr; }
  .lux-billing-card > .btn { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 560px) {
  .subscription-luxury-page { gap: 13px; }
  .subscription-luxury-head { padding-top: 2px; }
  .subscription-luxury-head h1 { font-size: 34px; }
  .subscription-luxury-head p { font-size: 13px; line-height: 1.55; }
  .lux-secure-note { padding: 7px 9px; font-size: 10px; }
  .lux-plan-hero { border-radius: 24px; padding: 24px 18px; }
  .lux-plan-content h2 { font-size: 32px; }
  .lux-plan-content > p { font-size: 13px; }
  .lux-plan-actions { display: grid; grid-template-columns: 1fr; }
  .lux-plan-actions .btn { width: 100%; }
  .lux-price strong { font-size: 50px; }
  .lux-usage-card,
  .lux-plan-card { padding: 18px; }
  .lux-compare-section { padding: 20px 15px; border-radius: 24px; }
  .lux-billing-card { padding: 18px; border-radius: 22px; }
  .lux-billing-mark { width: 44px; height: 44px; border-radius: 14px; }
}

/* v10: reliable mobile account menu + avatar privacy hardening */
.topbar-actions {
  position: relative;
  z-index: 220;
}
.top-avatar {
  position: relative;
  z-index: 230;
  pointer-events: auto !important;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}
.top-avatar::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 999px;
}
.top-avatar img,
.avatar img,
.protected-avatar-image {
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none !important;
  -webkit-touch-callout: none !important;
}
.avatar,
.top-avatar {
  -webkit-touch-callout: none !important;
  user-select: none;
}
.profile-menu-backdrop { z-index: 3990 !important; }
.profile-dropdown { z-index: 4000 !important; }

@media (max-width: 760px) {
  .topbar-center { min-width: 0; }
  .topbar-actions { flex: 0 0 auto; }
  .top-avatar {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    flex: 0 0 48px !important;
  }
  .profile-dropdown {
    position: fixed !important;
    top: 82px !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(72vh, 620px);
    overflow: auto;
    border-radius: 24px !important;
    box-shadow: 0 26px 80px rgba(0,0,0,.58), 0 0 0 1px rgba(92,220,255,.10) inset !important;
  }
}
