:root {
  --purple: #7562f4;
  --purple-dark: #5947e7;
  --mint: #8fe3c1;
  --cream: #fff9ef;
  --ink: #202230;
  --yellow: #ffd65d;
  --coral: #ff8172;
  --line: #e7ded2;
  --muted: #6e7280;
  --lav: #eee9ff;
  --ice: #e9f5ff;
  --blush: #fff0ee;
  --white: #fff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, Arial, system-ui, sans-serif;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.shell { max-width: 1180px; margin: 0 auto; padding: 0 18px 64px; }
.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { width: 76px; height: 76px; display: block; object-fit: contain; }
.topnav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topnav a { text-decoration: none; font-weight: 850; font-size: 14px; padding: 9px 11px; border-radius: 10px; }
.topnav a.active, .topnav a:hover { background: var(--lav); color: var(--purple-dark); }

.card {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 7px 0 rgba(32, 34, 48, .08);
}
.pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 7px 11px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--mint);
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 45px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: var(--white);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--purple); border-color: var(--purple-dark); color: #fff; box-shadow: 0 4px 0 var(--purple-dark); }
.btn.mint { background: var(--mint); }
.btn.danger { background: var(--blush); }
.btn.small { min-height: 38px; padding: 7px 11px; font-size: 13px; }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin: 14px 0 22px; }
.page-head h1 { margin: 12px 0 0; font-size: clamp(45px, 6vw, 72px); line-height: .9; letter-spacing: -.055em; }
.page-head p { margin: 0; max-width: 480px; color: var(--muted); line-height: 1.45; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.notice { margin: 0 0 16px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--lav); font-size: 14px; line-height: 1.45; }
.notice.error { background: var(--blush); border-color: #efafa7; color: #7f2822; }
.notice.success { background: #e8faf4; border-color: #9bdcc4; color: #225e48; }
.loading { padding: 48px 24px; text-align: center; }
.spinner { width: 34px; height: 34px; margin: 0 auto 14px; border: 4px solid var(--line); border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-page { min-height: calc(100vh - 92px); display: grid; place-items: center; padding: 22px 0 60px; }
.auth-card { width: min(530px, 100%); padding: 34px; position: relative; overflow: hidden; }
.auth-card::after { content: ''; position: absolute; width: 150px; height: 150px; right: -48px; top: -58px; border-radius: 46% 54% 50% 40%; background: var(--mint); border: 3px solid var(--ink); transform: rotate(12deg); }
.auth-card h1 { margin: 20px 0 10px; max-width: 410px; font-size: clamp(43px, 7vw, 64px); line-height: .92; letter-spacing: -.055em; }
.auth-card p { color: var(--muted); line-height: 1.5; max-width: 430px; }
.auth-form { display: grid; gap: 12px; margin-top: 24px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 900; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
}
.field textarea { min-height: 112px; resize: vertical; }
.field small { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field.full { grid-column: 1 / -1; }

.dashboard-grid { display: grid; grid-template-columns: 294px minmax(0, 1fr); gap: 18px; align-items: start; }
.sidebar { position: sticky; top: 14px; padding: 24px; text-align: center; }
.avatar-wrap { width: 128px; height: 128px; margin: 0 auto 15px; padding: 6px; border: 4px solid var(--ink); border-radius: 34% 48% 42% 45%; background: var(--lav); box-shadow: 0 7px 0 rgba(32, 34, 48, .14); }
.avatar-wrap.frame-veteran { border-color: #717888; background: #eef0f4; }
.avatar-wrap.frame-legend { border-color: var(--purple); background: linear-gradient(135deg, #fff3cf, #eee9ff); box-shadow: 0 0 0 5px var(--yellow), 0 8px 0 rgba(32,34,48,.16); }
.avatar-wrap.frame-ambassador { border-color: #43b78d; background: #e8faf4; box-shadow: 0 0 0 5px var(--mint), 0 8px 0 rgba(32,34,48,.16); }
.avatar-wrap.frame-organizer { border-color: var(--purple-dark); background: #eee9ff; box-shadow: 0 0 0 5px var(--purple), 0 8px 0 rgba(32,34,48,.18); }
.avatar { width: 100%; height: 100%; overflow: hidden; display: grid; place-items: center; border-radius: 28% 43% 36% 40%; background: var(--purple); color: #fff; font-size: 42px; font-weight: 950; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar h2 { margin: 8px 0 4px; font-size: 29px; letter-spacing: -.035em; }
.member-email { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.member-city { margin: 10px 0; font-size: 14px; }
.role-badge { display: inline-flex; margin-top: 4px; padding: 7px 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 12px; font-weight: 950; }
.tag-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 13px; }
.tag { display: inline-flex; padding: 6px 9px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-size: 11px; font-weight: 850; }
.sidebar hr { height: 1px; border: 0; background: var(--line); margin: 20px 0; }
.progress { text-align: left; }
.progress-track { height: 15px; overflow: hidden; margin: 9px 0 6px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; }
.progress-track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--purple)); }
.progress small { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { min-height: 112px; padding: 18px; }
.stat:nth-child(1) { background: var(--lav); }
.stat:nth-child(2) { background: #e8faf4; }
.stat:nth-child(3) { background: #fff3cf; }
.stat:nth-child(4) { background: var(--ice); }
.stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 850; }
.stat strong { display: block; margin-top: 10px; font-size: 30px; letter-spacing: -.04em; }

.tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { padding: 9px 13px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; font-weight: 900; }
.tab.active { background: var(--ink); color: #fff; }
.panel { display: none; }
.panel.active { display: block; }
.section-card { padding: 23px; margin-bottom: 14px; }
.section-card h2 { margin: 0 0 6px; font-size: 29px; letter-spacing: -.035em; }
.section-lead { margin: 0 0 18px; color: var(--muted); line-height: 1.45; }
.empty { padding: 28px; border: 2px dashed var(--line); border-radius: 18px; text-align: center; background: #fffdf8; }
.empty .emoji { font-size: 38px; }
.empty h3 { margin: 9px 0 5px; }
.empty p { margin: 0; color: var(--muted); line-height: 1.45; }

.meeting-list, .achievement-grid, .collection-grid { display: grid; gap: 12px; }
.meeting { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 16px; padding: 14px; border: 2px solid var(--line); border-radius: 18px; background: #fff; }
.meeting-cover { width: 116px; height: 100%; min-height: 110px; object-fit: cover; border-radius: 13px; background: var(--lav); }
.meeting h3 { margin: 1px 0 7px; font-size: 20px; }
.meeting p { margin: 5px 0; color: var(--muted); line-height: 1.4; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: var(--lav); font-size: 11px; font-weight: 900; }
.status.attended { background: #e8faf4; }
.status.no_show { background: var(--blush); }
.achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.achievement { padding: 17px; border: 2px solid var(--line); border-radius: 18px; background: #fff; }
.achievement.locked { opacity: .58; filter: grayscale(.2); }
.achievement strong { display: block; margin-bottom: 6px; }
.achievement small { color: var(--muted); line-height: 1.4; }
.collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.collectible { min-height: 190px; padding: 16px; border: 3px solid var(--purple); border-radius: 20px; background: linear-gradient(145deg, #fff, var(--lav)); display: flex; flex-direction: column; justify-content: end; }
.collectible img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.collectible small { color: var(--muted); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter { padding: 8px 11px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-weight: 850; }
.filter.active { border-color: var(--ink); background: var(--mint); }
.events-list { display: grid; gap: 16px; }
.event-card { display: grid; grid-template-columns: minmax(230px, .72fr) 1.28fr; overflow: hidden; }
.event-cover { min-height: 300px; width: 100%; height: 100%; object-fit: cover; background: var(--lav); }
.event-body { padding: 24px; }
.event-body h2 { margin: 12px 0 9px; font-size: clamp(31px, 4vw, 44px); line-height: .96; letter-spacing: -.04em; }
.event-meta { display: grid; gap: 5px; margin: 14px 0; color: var(--muted); }
.event-description { line-height: 1.5; white-space: pre-line; }
.event-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.attendees { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.attendee-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.attendee { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: var(--lav); font-size: 12px; font-weight: 800; }
.attendee-actions { display: inline-flex; gap: 4px; margin-left: 3px; }
.attendee-actions button { border: 0; background: #fff; border-radius: 999px; padding: 3px 6px; font-size: 11px; }
.event-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 17px; }
.event-actions small { color: var(--muted); }
.organizer-panel { padding: 24px; margin-bottom: 20px; background: var(--lav); }
.organizer-panel h2 { margin-top: 0; }
.organizer-console { margin-bottom: 28px; padding: 24px; background: var(--lav); }
.organizer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.organizer-head h2 { margin: 13px 0 5px; font-size: 34px; letter-spacing: -.04em; }
.organizer-head p { margin: 0; color: var(--muted); }
.organizer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 14px; }
.organizer-stats div { padding: 13px 15px; border: 2px solid var(--line); border-radius: 15px; background: #fff; }
.organizer-stats strong { display: block; font-size: 25px; }
.organizer-stats span { color: var(--muted); font-size: 12px; font-weight: 800; }
.management-list { display: grid; gap: 8px; }
.management-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 15px; border: 2px solid var(--line); border-radius: 15px; background: #fff; }
.management-row > div:first-child { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 3px 9px; }
.management-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.management-row small { grid-column: 2; color: var(--muted); }
.management-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.management-actions button, .text-button { padding: 5px 7px; border: 0; background: transparent; color: var(--purple-dark); font-size: 12px; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.management-actions .danger-link { color: #a23c35; }
.status-draft { background: var(--yellow); }
.status-published { background: #e8faf4; }
.status-completed { background: var(--ice); }
.status-cancelled { background: var(--blush); }
.event-editor { margin-top: 18px; padding: 22px; border: 3px solid var(--ink); border-radius: 19px; background: #fff; box-shadow: 0 6px 0 var(--ink); scroll-margin-top: 12px; }
.editor-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.editor-head h3 { margin: 11px 0 0; font-size: 28px; letter-spacing: -.035em; }
.icon-btn { width: 39px; height: 39px; border: 2px solid var(--ink); border-radius: 50%; background: var(--blush); font-size: 25px; font-weight: 900; line-height: 1; }
.editor-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.editor-actions .notice { flex: 1 1 100%; margin: 0; }
.cover-preview { display: block; width: min(100%, 520px); max-height: 310px; object-fit: cover; border: 2px solid var(--ink); border-radius: 15px; }
.catalog-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 22px 0 17px; }
.catalog-head h2 { margin: 0 0 4px; font-size: clamp(31px, 4vw, 48px); line-height: .95; letter-spacing: -.045em; }
.catalog-head p { margin: 0; color: var(--muted); }
.catalog-head .filters { margin: 0; justify-content: flex-end; }
.event-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.event-cover-empty { display: grid; place-items: center; text-align: center; background: var(--purple); color: #fff; font-size: 36px; font-weight: 950; line-height: .8; letter-spacing: -.06em; }
.attendee-attended { background: #e8faf4; }
.attendee-no_show { background: var(--blush); }
.attendee-actions button.selected { background: var(--mint); box-shadow: inset 0 0 0 2px var(--ink); }
.attendee-actions button.selected.danger { background: var(--coral); }
.empty.compact { padding: 14px; }
.checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.check { position: relative; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check span { display: inline-flex; padding: 8px 11px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 850; cursor: pointer; }
.check input:checked + span { border-color: var(--purple); background: var(--mint); }
.check input:focus-visible + span { outline: 3px solid rgba(117, 98, 244, .35); outline-offset: 2px; }
.interest-list { margin-top: 8px; }
.interest-list .tag { background: #e8faf4; }
.profile-avatar-editor { display: grid; grid-template-columns: 122px minmax(0, 1fr); gap: 18px; align-items: center; margin: 18px 0 22px; padding: 17px; border: 2px solid var(--line); border-radius: 18px; background: var(--lav); }
.profile-avatar-editor p { margin: 5px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.avatar-preview { width: 118px; height: 118px; overflow: hidden; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 35% 47% 38% 43%; background: var(--purple); color: #fff; font-size: 40px; font-weight: 950; box-shadow: 0 5px 0 var(--ink); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.avatar-actions .danger-link { color: #a23c35; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.choice-field { margin: 0; padding: 15px; border: 2px solid var(--line); border-radius: 16px; background: #fffdf8; }
.choice-field.full { grid-column: 1 / -1; }
.choice-field legend { padding: 0 5px; font-size: 13px; font-weight: 950; }
.choice-field p { margin: -2px 0 12px; color: var(--muted); font-size: 12px; }
.checkboxes-scroll { max-height: 210px; overflow: auto; padding: 2px; }

.portal-page-head h1 { color: var(--purple); }
.portal-page-head p { max-width: 520px; font-size: 17px; }
.portal-intro-grid { display: grid; grid-template-columns: 1.18fr .82fr; gap: 16px; margin-bottom: 18px; }
.portal-weekly-card { min-height: 360px; padding: 26px; overflow: hidden; position: relative; background: var(--ink); border-color: var(--ink); color: #fff; }
.portal-weekly-card::after { content: ''; position: absolute; width: 260px; height: 260px; right: -145px; bottom: -135px; border: 32px solid var(--purple); border-radius: 50%; opacity: .7; }
.portal-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; position: relative; z-index: 1; }
.portal-card-head h2, .portal-settings-card h2, .portal-section-head h2 { margin: 14px 0 8px; font-size: clamp(30px, 4vw, 44px); line-height: .95; letter-spacing: -.045em; }
.portal-mark { width: 88px; height: 88px; object-fit: contain; filter: drop-shadow(0 5px 0 rgba(0,0,0,.25)); }
.portal-weekly-card .empty { margin-top: 24px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); }
.portal-weekly-card .empty p { color: rgba(255,255,255,.78); }
.weekly-person { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; align-items: center; margin-top: 25px; position: relative; z-index: 1; }
.portal-avatar { width: 96px; height: 96px; overflow: hidden; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 37% 48% 40% 45%; background: var(--purple); color: #fff; font-size: 35px; font-weight: 950; box-shadow: 0 5px 0 rgba(32,34,48,.22); flex: 0 0 auto; }
.portal-weekly-card .portal-avatar { border-color: #fff; background: var(--mint); color: var(--ink); box-shadow: 0 5px 0 rgba(255,255,255,.25); }
.portal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.weekly-person h3 { margin: 0 0 7px; font-size: 30px; letter-spacing: -.035em; }
.weekly-person p { margin: 4px 0; color: rgba(255,255,255,.78); line-height: 1.4; }
.portal-settings-card { padding: 25px; background: var(--lav); }
.portal-settings-card h2 { margin-bottom: 20px; }
.portal-toggle { display: grid; grid-template-columns: 47px minmax(0, 1fr); gap: 12px; align-items: center; margin: 13px 0; cursor: pointer; }
.portal-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.portal-toggle > span { width: 47px; height: 27px; padding: 3px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; transition: background .18s ease; }
.portal-toggle > span::after { content: ''; display: block; width: 17px; height: 17px; border-radius: 50%; background: var(--ink); transition: transform .18s ease; }
.portal-toggle input:checked + span { background: var(--mint); }
.portal-toggle input:checked + span::after { transform: translateX(20px); }
.portal-toggle input:focus-visible + span { outline: 3px solid rgba(117,98,244,.35); outline-offset: 2px; }
.portal-toggle strong, .portal-toggle small { display: block; }
.portal-toggle small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.portal-settings-card .field { margin: 18px 0; }
.portal-tabs { margin: 28px 0 16px; }
.count-badge { min-width: 20px; height: 20px; display: inline-grid; place-items: center; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--coral); color: var(--ink); font-size: 11px; }
.portal-panel { display: none; }
.portal-panel.active { display: block; }
.portal-finder { padding: 24px; margin-bottom: 16px; background: #fff3cf; }
.portal-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.portal-section-head h2 { margin-bottom: 6px; }
.portal-section-head p { margin: 0; color: var(--muted); line-height: 1.45; }
.portal-section-head > strong { font-size: 52px; color: var(--purple); letter-spacing: -.06em; }
.portal-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; margin-top: 20px; }
.portal-candidate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.portal-candidate { min-height: 330px; padding: 21px; display: flex; flex-direction: column; }
.portal-candidate-top { display: flex; gap: 14px; align-items: center; }
.portal-candidate .portal-avatar { width: 78px; height: 78px; font-size: 29px; }
.portal-candidate h3 { margin: 0 0 5px; font-size: 26px; letter-spacing: -.035em; }
.portal-candidate-meta { color: var(--muted); font-size: 13px; }
.portal-score { display: inline-flex; width: fit-content; margin-top: 7px; padding: 5px 8px; border-radius: 999px; background: var(--mint); font-size: 11px; font-weight: 900; }
.portal-candidate-bio { min-height: 43px; margin: 15px 0 10px; color: var(--muted); line-height: 1.45; }
.portal-match-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.portal-match-reasons span { padding: 6px 8px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-size: 11px; font-weight: 850; }
.portal-candidate-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; }
.portal-candidate-actions .danger-link { margin-left: auto; color: #a23c35; }
.portal-invite-list { display: grid; gap: 10px; }
.portal-invite { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 15px; border: 2px solid var(--line); border-radius: 17px; background: #fff; }
.portal-invite .portal-avatar { width: 58px; height: 58px; border-width: 2px; font-size: 22px; box-shadow: none; }
.portal-invite h3 { margin: 0 0 5px; font-size: 20px; }
.portal-invite p { margin: 3px 0; color: var(--muted); line-height: 1.4; white-space: pre-line; }
.portal-invite-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.portal-status { display: inline-flex; width: fit-content; padding: 5px 8px; border-radius: 999px; background: var(--lav); font-size: 11px; font-weight: 900; }
.portal-status.accepted { background: #e8faf4; }
.portal-status.declined, .portal-status.cancelled, .portal-status.expired { background: var(--blush); }
.portal-rules-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.portal-rule { min-height: 230px; padding: 20px; }
.portal-rule > span { width: 43px; height: 43px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 13px; background: var(--purple); color: #fff; font-size: 19px; font-weight: 950; box-shadow: 0 4px 0 var(--ink); }
.portal-rule h3 { margin: 22px 0 10px; font-size: 23px; }
.portal-rule p { margin: 0; color: var(--muted); line-height: 1.45; }
.portal-dialog { width: min(680px, calc(100% - 24px)); padding: 0; border: 3px solid var(--ink); border-radius: 24px; background: var(--cream); color: var(--ink); box-shadow: 0 9px 0 var(--ink); }
.portal-dialog::backdrop { background: rgba(32,34,48,.64); }
.portal-dialog form { padding: 27px; position: relative; }
.portal-dialog h2 { margin: 15px 0 22px; font-size: 37px; letter-spacing: -.04em; }
.dialog-close { position: absolute; top: 17px; right: 17px; }


@media (max-width: 920px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .event-card { grid-template-columns: 1fr; }
  .event-cover { height: 290px; min-height: 0; }
  .management-row { align-items: flex-start; flex-direction: column; }
  .management-actions { justify-content: flex-start; }
  .portal-intro-grid { grid-template-columns: 1fr; }
  .portal-candidate-grid { grid-template-columns: 1fr; }
  .portal-rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .shell { padding: 0 12px 46px; }
  .topbar { min-height: 78px; }
  .brand img { width: 64px; height: 64px; }
  .topnav a:not(.keep-mobile) { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .profile-avatar-editor { grid-template-columns: 1fr; text-align: center; }
  .avatar-preview { margin: 0 auto; }
  .avatar-actions { justify-content: center; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .auth-card { padding: 27px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .choice-field.full { grid-column: auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .achievement-grid, .collection-grid { grid-template-columns: 1fr; }
  .meeting { grid-template-columns: 1fr; }
  .meeting-cover { width: 100%; height: 190px; }
  .event-body { padding: 20px; }
  .organizer-console { padding: 17px; }
  .organizer-head, .catalog-head { align-items: stretch; flex-direction: column; }
  .organizer-head .btn { width: 100%; }
  .organizer-stats { grid-template-columns: 1fr; }
  .management-row > div:first-child { grid-template-columns: 1fr; }
  .management-row small { grid-column: 1; }
  .catalog-head .filters { justify-content: flex-start; }
  .editor-actions .btn { width: 100%; }
  .portal-filters { grid-template-columns: 1fr; }
  .portal-filters .btn { width: 100%; }
  .portal-section-head { align-items: flex-start; flex-direction: column; }
  .portal-candidate-actions .danger-link { margin-left: 0; }
  .portal-invite { grid-template-columns: 52px minmax(0, 1fr); align-items: start; }
  .portal-invite .portal-avatar { width: 50px; height: 50px; }
  .portal-invite-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .portal-rules-grid { grid-template-columns: 1fr; }
  .weekly-person { grid-template-columns: 76px minmax(0, 1fr); }
  .portal-weekly-card .portal-avatar { width: 76px; height: 76px; }
  .portal-mark { width: 66px; height: 66px; }
}
