:root {
  --bg: #f7f5fb;
  --surface: #ffffff;
  --surface-soft: #f1edf8;
  --surface-warm: #fff4f9;
  --ink: #241b2f;
  --muted: #70667c;
  --line: #e5def0;
  --line-strong: #d2c7e2;
  --primary: #6f42c1;
  --primary-dark: #563092;
  --primary-soft: #eee6fa;
  --accent: #cf568b;
  --accent-soft: #fbe4ef;
  --danger: #b23c3c;
  --danger-soft: #f9e3e3;
  --warning: #93631c;
  --warning-soft: #f9edcf;
  --info: #2c6195;
  --info-soft: #e4eef8;
  --shadow: 0 12px 30px rgba(70, 45, 96, 0.11);
  --sidebar: 224px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { letter-spacing: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.public-shell { min-height: 100vh; display: flex; flex-direction: column; background: #fbfafc; }
.site-header { position: sticky; top: 0; z-index: 40; height: 72px; color: white; background: #28153d; border-bottom: 1px solid #49305f; }
.site-header-inner { width: min(1280px, 100%); height: 100%; margin: 0 auto; padding: 0 28px; display: flex; align-items: stretch; }
.site-logo { width: 176px; padding: 10px 22px 10px 0; border: 0; background: transparent; cursor: pointer; }
.site-logo img { width: 154px; height: 52px; object-fit: contain; object-position: left center; }
.site-nav { display: flex; align-items: stretch; }
.site-nav a { min-width: 128px; padding: 0 22px; border-left: 1px solid #49305f; display: flex; align-items: center; justify-content: center; color: #ded4e8; text-decoration: none; }
.site-nav a:last-child { border-right: 1px solid #49305f; }
.site-nav a:hover, .site-nav a.active { color: white; background: #3d2258; }
.site-nav a.active { box-shadow: inset 0 -3px 0 #cf568b; font-weight: 700; }
.site-account { margin-left: auto; display: flex; align-items: center; }
.site-login { min-width: 72px; height: 40px; padding: 0 14px; border: 1px solid #705588; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: white; background: #3d2258; cursor: pointer; text-decoration: none; }
.site-login:hover { background: #53306f; }
.site-login svg { width: 18px; }
.homepage-main { width: min(880px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 90px; flex: 1; }
.markdown-article { color: #2d2635; font-size: 16px; line-height: 1.82; overflow-wrap: anywhere; }
.markdown-article h1 { margin: 0 0 32px; padding-bottom: 18px; border-bottom: 1px solid var(--line); color: #21182a; font-size: 34px; line-height: 1.3; }
.markdown-article h2 { margin: 42px 0 16px; color: #2d1c3e; font-size: 24px; line-height: 1.4; }
.markdown-article h3 { margin: 32px 0 12px; font-size: 19px; }
.markdown-article h4, .markdown-article h5, .markdown-article h6 { margin: 26px 0 10px; font-size: 16px; }
.markdown-article p { margin: 0 0 18px; }
.markdown-article ul, .markdown-article ol { margin: 0 0 20px; padding-left: 26px; }
.markdown-article li + li { margin-top: 7px; }
.markdown-article blockquote { margin: 24px 0; padding: 2px 0 2px 18px; border-left: 4px solid var(--accent); color: var(--muted); }
.markdown-article blockquote p:last-child { margin-bottom: 0; }
.markdown-article a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.markdown-article pre { margin: 22px 0; padding: 16px; overflow-x: auto; border-radius: 6px; color: #f2edf6; background: #261c2e; }
.markdown-article code { padding: 2px 5px; border-radius: 4px; color: #6d2f89; background: var(--primary-soft); font-size: 0.9em; }
.markdown-article pre code { padding: 0; color: inherit; background: transparent; }
.markdown-article table { width: 100%; margin: 22px 0; border-collapse: collapse; }
.markdown-article th, .markdown-article td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.markdown-article th { background: var(--surface-soft); }
.markdown-article hr { margin: 36px 0; border: 0; border-top: 1px solid var(--line); }
.site-footer { padding: 20px; border-top: 1px solid var(--line); color: var(--muted); background: white; }
.site-footer a { width: fit-content; margin: 0 auto; display: flex; align-items: center; gap: 8px; font-size: 13px; text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.site-footer svg { width: 19px; height: 19px; }
.app-loading {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--primary);
  font-size: 20px;
  font-weight: 800;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  padding: 32px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-logo-band { height: 82px; margin: -32px -32px 18px; padding: 14px 32px; display: flex; align-items: center; background: #28153d; }
.login-logo-band img { width: 154px; height: 54px; object-fit: contain; object-position: left center; }
.login-home { height: 34px; margin: 0 0 18px -10px; padding: 0 10px; }
.login-panel h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: 0; }
.login-panel > p { margin: 0 0 24px; color: var(--muted); line-height: 1.65; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 22px 14px;
  background: #21152f;
  color: #f5effb;
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; }
.sidebar-brand .brand-mark { background: #8a63cf; }
.sidebar-brand strong { font-size: 18px; display: block; }
.sidebar-brand small { display: block; color: #b9a9ca; margin-top: 2px; }
.nav-label { color: #9b86b2; font-size: 11px; padding: 14px 12px 7px; }
.nav-list { display: grid; gap: 4px; }
.nav-item {
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #d6c9e3;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.nav-item:hover { background: #352249; color: white; }
.nav-item.active { background: #5f3a91; color: white; font-weight: 700; }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.sidebar-user { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid #432c59; }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user small { color: #b6a6c8; margin-top: 4px; }

.main-shell { margin-left: var(--sidebar); min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  height: 66px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(247, 245, 251, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  z-index: 15;
}
.topbar-title { min-width: 0; }
.topbar-title h1 { margin: 0; font-size: 20px; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.page { width: min(1240px, 100%); margin: 0 auto; padding: 26px 28px 80px; }
.page.narrow { width: min(900px, 100%); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  min-height: 42px;
}
.toolbar-spacer { flex: 1; }
.search-field { position: relative; flex: 1 1 320px; min-width: 240px; max-width: 420px; }
.search-field svg { position: absolute; left: 12px; top: 11px; width: 18px; color: var(--muted); }
.search-field input { padding-left: 40px; }
.toolbar > select { width: auto; min-width: 160px; flex: 0 0 180px; }
.compact-date { display: grid; gap: 3px; color: var(--muted); font-size: 11px; }
.compact-date input { width: 150px; padding-block: 7px; }

.form-field { display: grid; gap: 7px; min-width: 0; }
.form-field > label, .field-label { font-size: 13px; font-weight: 700; color: #44394f; }
.required::after { content: " *"; color: var(--danger); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}
input, select { height: 42px; padding: 0 12px; }
input[type="checkbox"] { width: 14px; height: 14px; padding: 0; flex: none; accent-color: var(--primary); }
textarea { min-height: 96px; padding: 11px 12px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.14); }
input:disabled { color: #62586d; background: #f0edf4; cursor: not-allowed; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.temperature-grid { display: grid; grid-template-columns: 80px 1fr auto 1fr; align-items: center; gap: 8px; }

.btn {
  height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { color: white; background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-soft); }
.btn-danger { color: var(--danger); background: var(--danger-soft); border-color: #eccaca; }
.btn-quiet { color: var(--muted); background: transparent; }
.btn-quiet:hover { color: var(--ink); background: var(--surface-soft); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { height: 34px; padding: 0 11px; font-size: 12px; }
.icon-btn { width: 40px; padding: 0; }
.icon-btn svg { width: 19px; height: 19px; }

.segmented {
  flex: none;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.segmented button { height: 32px; padding: 0 12px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; white-space: nowrap; }
.segmented button.active { color: var(--primary-dark); background: var(--primary-soft); font-weight: 700; }

.roommate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.load-more { display: flex; justify-content: center; margin-top: 18px; padding: 24px 0 4px; }
.load-more .btn { min-width: 112px; }
.roommate-card {
  position: relative;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.roommate-card:hover { transform: translateY(-2px); border-color: #bca6dc; box-shadow: var(--shadow); }
.roommate-card.gender-female { background: #fff6fa; border-color: #efc4d8; }
.roommate-card.gender-female:hover { border-color: #dc8fb2; }
.roommate-card.gender-male { background: #f5f9ff; border-color: #bed5ef; }
.roommate-card.gender-male:hover { border-color: #7eacd9; }
.card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--surface-soft); flex: none; }
.avatar-sm { width: 38px; height: 38px; }
.avatar-lg { width: 82px; height: 82px; }
.card-title { min-width: 0; flex: 1; }
.card-title h3 { margin: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-city { margin: 14px 0 0; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.card-city svg { width: 14px; height: 14px; }
.tag { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 4px; color: #5d3b91; background: var(--primary-soft); font-size: 11px; }
.tag svg { width: 12px; height: 12px; margin-right: 4px; }
.tag.accent { color: #963f68; background: var(--accent-soft); }
.card-note { margin: 13px 0 0; min-height: 42px; color: #62586d; font-size: 12px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-team { margin-top: 13px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.status-badge svg { width: 13px; height: 13px; }
.status-active, .status-published, .status-confirmed, .status-resolved { color: var(--primary-dark); background: var(--primary-soft); }
.status-roommate_confirmed { color: var(--primary-dark); background: var(--primary-soft); }
.status-draft, .status-forming, .status-pending { color: var(--warning); background: var(--warning-soft); }
.status-pending_activation { color: var(--warning); background: var(--warning-soft); }
.status-hidden, .status-banned, .status-dissolved, .status-rejected { color: var(--danger); background: var(--danger-soft); }
.status-suspended { color: var(--muted); background: #e9edeb; }
.status-open, .status-approved { color: var(--primary-dark); background: var(--primary-soft); }
.status-full { color: var(--info); background: var(--info-soft); }
.status-closed, .status-cancelled { color: var(--muted); background: #e9edeb; }

.section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.section:first-child { padding-top: 0; }
.section:last-child { border-bottom: 0; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 16px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.detail-header { display: flex; align-items: center; gap: 18px; }
.detail-header h2 { margin: 0 0 5px; font-size: 24px; }
.detail-header p { margin: 0; color: var(--muted); }
.detail-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 26px; }
.detail-item dt { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.detail-item dd { margin: 0; line-height: 1.65; }

.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.profile-form, .preview-panel, .panel, .table-wrap, .message-workspace {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.profile-form { padding: 24px; }
.preview-panel { position: sticky; top: 90px; padding: 18px; }
.preview-panel h3 { margin: 0 0 14px; font-size: 14px; }
.avatar-upload { display: flex; align-items: center; gap: 14px; }
.avatar-upload input { display: none; }
.size-guide { border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.size-guide summary { padding: 11px 13px; color: var(--primary-dark); font-size: 13px; font-weight: 700; cursor: pointer; }
.size-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.size-table { width: 100%; min-width: 580px; border-collapse: collapse; background: var(--surface); }
.size-table th, .size-table td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: center; font-size: 12px; }
.size-table th { color: var(--muted); background: #faf8fc; }
.size-table tr:last-child td { border-bottom: 0; }
.form-actions { position: sticky; bottom: 0; margin: 24px -24px -24px; padding: 14px 24px; background: rgba(255,255,255,0.95); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }

.page.message-page { height: calc(100vh - 66px); height: calc(100dvh - 66px); padding-bottom: 26px; overflow: hidden; }
.message-workspace { height: 100%; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); overflow: hidden; }
.conversation-list { min-height: 0; border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; }
.conversation-list-head { padding: 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; font-weight: 800; }
.conversation-list-head .search-field { min-width: 0; width: 100%; }
.conversation-list-head .search-field input { height: 36px; }
.conversation-list-head .search-field svg { top: 9px; }
.conversation-item { width: 100%; padding: 13px 15px; border: 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; text-align: left; background: white; cursor: pointer; }
.conversation-item:hover, .conversation-item.active { background: var(--surface-soft); }
.conversation-copy { min-width: 0; flex: 1; }
.conversation-copy strong { display: block; font-size: 13px; }
.conversation-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; color: white; background: var(--accent); font-size: 10px; }
.chat { min-width: 0; min-height: 0; display: grid; grid-template-rows: 60px minmax(0, 1fr) auto; overflow: hidden; }
.chat-head { padding: 0 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.chat-messages { min-height: 0; padding: 18px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; }
.message { max-width: min(72%, 560px); padding: 10px 12px; border-radius: 7px; overflow-wrap: anywhere; white-space: pre-wrap; background: var(--surface-soft); line-height: 1.55; font-size: 13px; }
.message.mine { align-self: flex-end; color: white; background: var(--primary); }
.message-time { display: block; margin-top: 5px; opacity: 0.65; font-size: 10px; }
.application-compose { padding: 12px 14px; display: flex; align-items: center; gap: 12px; justify-content: space-between; border: 1px solid #d5c2ed; border-radius: 7px; background: var(--primary-soft); }
.application-compose strong, .application-compose span { display: block; }
.application-compose span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.application-card { width: min(520px, 82%); padding: 14px; border: 1px solid #d5c2ed; border-radius: 7px; background: white; }
.application-card.mine { align-self: flex-end; }
.application-card-head { display: flex; align-items: center; gap: 10px; }
.application-card-head > svg { width: 24px; color: var(--primary); }
.application-card-head > div { min-width: 0; flex: 1; }
.application-card-head strong, .application-card-head span { display: block; }
.application-card-head span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.application-card p { margin: 13px 0; line-height: 1.6; font-size: 13px; }
.application-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.application-card-foot > div { display: flex; gap: 7px; }
.chat-compose { min-width: 0; padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; background: var(--surface); }
.chat-compose textarea { min-width: 0; min-height: 44px; max-height: 110px; }

.stage-banner { margin-bottom: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 7px; }
.stage-banner.open { color: var(--primary-dark); background: var(--primary-soft); border-color: #d5c2ed; }
.stage-banner.closed { color: var(--muted); background: #e9edeb; }
.stage-banner > svg { width: 24px; flex: none; }
.stage-banner strong, .stage-banner span { display: block; }
.stage-banner span { margin-top: 3px; font-size: 12px; }
.dormitory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dormitory-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: flex; flex-direction: column; }
.dormitory-card.current { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(111, 66, 193, 0.1); }
.dormitory-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dormitory-card-head span { color: var(--muted); font-size: 11px; }
.dormitory-card-head h2 { margin: 4px 0 0; font-size: 17px; }
.dormitory-badges { display: flex; align-items: flex-end; gap: 5px; flex-direction: column; }
.dormitory-card > p { min-height: 22px; color: var(--muted); font-size: 12px; }
.dormitory-owner { margin: 14px 0; padding: 10px; display: flex; align-items: center; gap: 7px; color: #5e5369; background: var(--surface-soft); border-radius: 6px; font-size: 12px; }
.dormitory-owner svg { width: 16px; }
.dormitory-members { flex: 1; padding-top: 12px; border-top: 1px solid var(--line); }
.dormitory-members > strong { font-size: 12px; }
.dormitory-member { min-width: 0; padding: 9px 0; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.dormitory-member:last-child { border-bottom: 0; }
.dormitory-member > div { min-width: 0; flex: 1; }
.dormitory-member b, .dormitory-member span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dormitory-member b { font-size: 12px; }
.dormitory-member span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.dormitory-card-action { margin-top: 14px; }
.dormitory-card-action .btn { width: 100%; }
.dorm-applications { margin-bottom: 16px; padding: 18px; }
.member-list { display: grid; gap: 10px; margin-top: 18px; }
.member-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-copy { min-width: 0; flex: 1; }
.member-copy strong, .member-copy span { display: block; }
.member-copy span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.candidate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 330px; overflow-y: auto; }
.candidate { position: relative; }
.candidate input { position: absolute; opacity: 0; }
.candidate label { padding: 10px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.candidate input:checked + label { border-color: var(--primary); background: var(--primary-soft); }
.candidate label span, .candidate label small { display: block; }
.candidate label small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.person-picker-tools { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.person-picker-tools .search-field { max-width: none; min-width: 180px; }
.person-picker-tools select { width: min(280px, 100%); }
.selection-group-list { display: grid; gap: 10px; }
.selection-group-item { padding: 14px; border: 1px solid var(--line); border-radius: 7px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.selection-group-item > div:first-child { min-width: 0; }
.selection-group-item strong, .selection-group-item span { display: block; }
.selection-group-item p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.selection-group-item span { line-height: 1.6; font-size: 12px; }
.inline-person-search { max-width: 360px; }
.toolbar-note { margin: -12px 0 18px; }
[hidden] { display: none !important; }
.round-history-list { display: grid; gap: 12px; }
.round-history-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.round-history-item strong { font-size: 16px; }
.round-history-item p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.history-result-heading { margin-top: 28px; }
.round-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.round-admin-card { display: flex; flex-direction: column; gap: 16px; }
.round-admin-card .section-heading { margin-bottom: 0; }
.round-admin-card .cell-actions { margin-top: auto; }
.round-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.round-metrics span { padding: 10px; color: var(--muted); background: var(--surface-soft); border-radius: 6px; font-size: 11px; }
.round-metrics strong { display: block; margin-top: 4px; color: var(--ink); font-size: 18px; }
.toolbar-select { width: min(360px, 100%); }
.access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.access-card { display: flex; flex-direction: column; gap: 16px; }
.access-card > .btn { align-self: flex-start; }
.access-summary { display: grid; gap: 12px; margin: 0; }
.access-summary dt { color: var(--muted); font-size: 11px; }
.access-summary dd { margin: 3px 0 0; line-height: 1.6; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { padding: 18px; border-left: 3px solid var(--primary); background: var(--surface); border-radius: 6px; }
.stat:nth-child(2) { border-color: var(--accent); }
.stat:nth-child(3) { border-color: var(--info); }
.stat:nth-child(4) { border-color: var(--warning); }
.stat span { color: var(--muted); font-size: 12px; }
.stat strong { display: block; margin-top: 8px; font-size: 28px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th, .data-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: middle; }
.data-table th { color: var(--muted); background: #faf8fc; font-size: 11px; }
.data-table tr:last-child td { border-bottom: 0; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; }
.panel { padding: 20px; }
.panel + .panel { margin-top: 16px; }

.treehole-hero { margin-bottom: 22px; padding: 28px 30px; border: 1px solid #dfd2ef; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #30203f; background: linear-gradient(130deg, #f2eafb 0%, #fff0f7 100%); box-shadow: var(--shadow); }
.treehole-hero .eyebrow { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.treehole-hero h2 { margin: 7px 0 8px; font-size: 24px; }
.treehole-hero p { margin: 0; color: var(--muted); line-height: 1.7; }
.treehole-hero .btn { flex: none; }
.treehole-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.treehole-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 5px 16px rgba(70,45,96,.06); cursor: pointer; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.treehole-card:hover, .treehole-card:focus-visible { border-color: #bda8d8; outline: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.treehole-card-head { display: flex; align-items: center; gap: 12px; }
.treehole-symbol { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.treehole-symbol svg { width: 20px; }
.treehole-card h2, .treehole-mine-item h2, .treehole-admin-item h2 { margin: 0; font-size: 17px; line-height: 1.45; }
.treehole-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.treehole-summary { min-height: 74px; margin: 17px 0; color: #4b4056; line-height: 1.7; overflow-wrap: anywhere; }
.treehole-card footer { padding-top: 13px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.treehole-card footer span { display: inline-flex; align-items: center; gap: 5px; }
.treehole-card footer svg { width: 14px; }
.treehole-mine-list, .treehole-admin-list { display: grid; gap: 12px; }
.treehole-mine-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.treehole-mine-item:hover, .treehole-admin-item:hover { border-color: #baa4d3; }
.treehole-mine-item > svg { width: 20px; color: var(--muted); }
.treehole-mine-item p, .treehole-admin-item p { margin: 7px 0 0; color: var(--muted); line-height: 1.65; }
.treehole-item-status { margin-bottom: 9px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.treehole-admin-item { cursor: pointer; }
.treehole-admin-item footer { margin-top: 12px; color: var(--muted); font-size: 12px; }
.treehole-detail > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
.treehole-detail > header > div { display: flex; align-items: center; gap: 9px; }
.treehole-author { color: var(--muted); font-weight: 700; }
.treehole-body { max-width: 100%; margin: 22px 0; color: #382d43; font-size: 16px; line-height: 1.82; overflow-x: auto; overflow-wrap: anywhere; }
.treehole-body h1, .treehole-body h2, .treehole-body h3, .treehole-body h4, .treehole-body h5, .treehole-body h6 { margin: 26px 0 12px; color: #2d1c3e; line-height: 1.4; }
.treehole-body h1 { margin-top: 0; font-size: 26px; }
.treehole-body h2 { font-size: 22px; }
.treehole-body h3 { font-size: 19px; }
.treehole-body p { margin: 0 0 14px; }
.treehole-body p:last-child { margin-bottom: 0; }
.treehole-body ul, .treehole-body ol { margin: 0 0 16px; padding-left: 26px; }
.treehole-body li + li { margin-top: 5px; }
.treehole-body blockquote { margin: 18px 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--accent); color: var(--muted); }
.treehole-body blockquote p:last-child { margin-bottom: 0; }
.treehole-body a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.treehole-body code { padding: 2px 5px; border-radius: 4px; color: #6d2f89; background: var(--primary-soft); font-size: .9em; }
.treehole-body pre { margin: 18px 0; padding: 14px; overflow-x: auto; border-radius: 6px; color: #f2edf6; background: #261c2e; }
.treehole-body pre code { padding: 0; color: inherit; background: transparent; }
.treehole-body table { width: 100%; margin: 18px 0; border-collapse: collapse; }
.treehole-body th, .treehole-body td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.treehole-body th { background: var(--surface-soft); }
.treehole-body del, .treehole-body s { color: var(--muted); }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.treehole-markdown-preview { min-height: 188px; margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fcfbfd; }
.treehole-markdown-preview[hidden] { display: none; }
.treehole-unavailable { min-height: 150px; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.treehole-unavailable svg { width: 30px; }
.treehole-discussion { margin: 24px -20px -20px; padding: 22px 20px 2px; border-top: 1px solid var(--line); background: #fcfbfd; }
.treehole-comment { padding: 15px 0; border-top: 1px solid var(--line); }
.treehole-comment:first-of-type { border-top: 0; }
.treehole-comment > header { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--primary-dark); font-size: 12px; }
.treehole-comment > header time { margin-left: auto; color: var(--muted); font-weight: 400; }
.treehole-comment > p { margin: 9px 0; color: #43394d; line-height: 1.72; overflow-wrap: anywhere; }
.treehole-comment.official { padding-left: 12px; border-left: 3px solid #9b77ce; }
.official-label { padding: 2px 6px; border-radius: 3px; color: white; background: var(--primary); font-size: 10px; font-weight: 700; }
.reply-target { color: var(--muted); font-weight: 400; }
.treehole-replies { margin: 12px 0 0 22px; padding-left: 14px; border-left: 2px solid var(--line); }
.treehole-comment-actions { min-height: 28px; display: flex; justify-content: flex-end; gap: 5px; }
.treehole-comment-form { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; display: grid; gap: 10px; background: white; }
.treehole-comment-form label { font-size: 13px; font-weight: 700; }
.treehole-comment-form textarea { min-height: 96px; resize: vertical; }
.treehole-comment-form .btn { justify-self: end; }

/* Activity plaza */
.activity-toolbar,
.activity-page-actions,
.activity-date-nav,
.activity-card-badges,
.activity-detail-meta,
.activity-heat-legend { display: flex; align-items: center; gap: 8px; }
.activity-toolbar { max-width: 1160px; min-height: 44px; margin: 0 auto 14px; flex-wrap: wrap; gap: 10px; }
.activity-date-nav h2 { min-width: 210px; margin: 0 0 0 6px; font-size: 22px; }
.activity-view-switch button { min-width: 48px; }
.activity-view-switch button.active { color: var(--primary-dark); background: var(--primary-soft); }
.activity-filter-toggle { display: none; }
.activity-filters { max-width: 1160px; display: flex; align-items: end; gap: 10px; margin: 0 auto 14px; }
.activity-filters label { min-width: 150px; color: var(--muted); font-size: 10px; }
.activity-filters label > span { display: block; margin: 0 0 4px 2px; }
.activity-filters select { min-width: 0; height: 40px; }
.activity-search-field { min-width: 290px !important; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: white; }
.activity-search-field svg { width: 17px; color: var(--muted); }
.activity-search-field input { min-width: 0; height: auto; flex: 1; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.activity-heat-legend { color: var(--muted); font-size: 11px; }
.activity-heat-legend i,
.activity-heat { width: 15px; height: 15px; display: inline-block; border: 1px solid rgba(86, 48, 146, .08); border-radius: 4px; }
.heat-0 { background: #fbfafd !important; }
.heat-1 { background: #f1eafa !important; }
.heat-2 { background: #dfcff3 !important; }
.heat-3 { background: #c3a5e8 !important; }
.heat-4 { color: white !important; background: #6f42c1 !important; }
.heat-5 { color: white !important; background: var(--accent) !important; }
.activity-calendar-content { max-width: 1160px; margin: 0 auto; }
.activity-month { overflow: hidden; padding: 0; }
.activity-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: #fbfafd; }
.activity-weekdays span { padding: 10px; color: var(--muted); text-align: center; font-size: 12px; font-weight: 700; }
.activity-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(112px, 1fr)); }
.activity-month-day { position: relative; min-width: 0; overflow: hidden; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; }
.activity-month-day:nth-child(7n) { border-right: 0; }
.activity-month-day:hover { background: #faf7ff; }
.activity-month-day.outside { color: #655b70; background: #eeeaf3; }
.activity-month-day.selected { box-shadow: inset 0 0 0 2px var(--primary); background: #faf7ff; }
.activity-day-number { width: 100%; min-height: 25px; display: flex; align-items: center; justify-content: space-between; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.activity-day-number span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 750; }
.activity-month-day.today .activity-day-number span { color: white; background: var(--primary); }
.activity-day-number small { color: var(--muted); font-size: 10px; }
.activity-month-event { position: relative; z-index: 1; width: 100%; display: flex; align-items: center; gap: 4px; margin-top: 3px; padding: 4px 5px; overflow: hidden; border: 0; border-radius: 4px; color: #57358b; background: var(--primary-soft); text-align: left; }
.activity-month-event time { flex: none; font-size: 10px; }
.activity-month-event span { min-width: 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.activity-month-event.importance-4 { color: #3f1f72; background: #dfcff3; font-weight: 700; }
.activity-month-event.importance-5 { color: #9e3262; background: var(--accent-soft); font-weight: 700; }
.activity-more { position: relative; z-index: 1; margin-top: 4px; padding: 0; border: 0; color: var(--primary-dark); background: transparent; font-size: 10px; font-weight: 750; }
.activity-year-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.activity-mini-month { min-width: 0; padding: 13px; }
.activity-mini-title { width: 100%; display: flex; justify-content: space-between; margin-bottom: 9px; padding: 0; border: 0; background: transparent; }
.activity-mini-title small { color: var(--muted); }
.activity-mini-weekdays,
.activity-mini-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.activity-mini-weekdays span { color: var(--muted); text-align: center; font-size: 8px; }
.activity-mini-days span,
.activity-mini-days button { aspect-ratio: 1; min-width: 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 3px; color: #40394a; font-size: 8px; }
.activity-mini-days button:hover { outline: 2px solid var(--primary); }
.activity-mini-days button.today { outline: 2px solid var(--primary); outline-offset: 1px; }
.activity-week-scroll { overflow-x: auto; padding: 0; }
.activity-week { min-width: 900px; overflow: hidden; }
.activity-week-head { display: grid; grid-template-columns: 55px repeat(7, 1fr); border-bottom: 1px solid var(--line); background: #fbfafd; }
.activity-week-head button { height: 60px; display: grid; place-content: center; gap: 3px; border: 0; border-right: 1px solid var(--line); background: transparent; }
.activity-week-head small { color: var(--muted); }
.activity-week-head strong { font-size: 17px; }
.activity-week-head button.selected { color: var(--primary-dark); background: var(--primary-soft); }
.activity-week-all-day { display: grid; grid-template-columns: 55px repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.activity-week-all-day > span { display: grid; place-items: center; border-right: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.activity-week-all-day-cell { min-height: 36px; padding: 4px; border-right: 1px solid var(--line); }
.activity-week-all-day-cell button { width: 100%; padding: 4px 5px; overflow: hidden; border: 0; border-radius: 4px; color: var(--primary-dark); background: var(--primary-soft); text-align: left; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 700; }
.activity-week-body { display: grid; grid-template-columns: 55px repeat(7, 1fr); height: 650px; }
.activity-time-axis { position: relative; border-right: 1px solid var(--line); background: #fbfafd; }
.activity-time-axis span { position: absolute; right: 7px; color: var(--muted); font-size: 9px; transform: translateY(-6px); }
.activity-week-column { position: relative; border-right: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 64px, var(--line) 64px, var(--line) 65px); }
.activity-week-column.selected { background-color: #fcfaff; }
.activity-week-cluster { position: absolute; right: 4px; left: 4px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; z-index: 1; }
.activity-week-cluster > button { min-width: 0; min-height: 35px; overflow: hidden; padding: 5px; border: 0; border-left: 3px solid var(--primary); border-radius: 5px; color: #42216f; background: #eadff7; text-align: left; }
.activity-week-cluster > button time,
.activity-week-cluster > button span { display: block; overflow: hidden; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.activity-week-cluster > button.importance-4 { border-left-color: #7950b0; background: #dfcff3; }
.activity-week-cluster > button.importance-5 { border-left-color: var(--accent); color: #8d2f5a; background: var(--accent-soft); }
.activity-week-cluster .activity-cluster-more { grid-column: 1 / -1; min-height: 24px; color: var(--primary-dark); border: 1px dashed #8a66bd; background: rgba(238, 230, 250, .97); text-align: center; }
.activity-day-layout { display: grid; gap: 14px; }
.activity-day-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 7px; }
.activity-day-picker { position: relative; min-height: 62px; display: grid; place-items: center; align-content: center; gap: 3px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; }
.activity-day-picker:hover { background: var(--surface-soft); }
.activity-day-picker span,
.activity-day-picker small { font-size: 9px; }
.activity-day-picker strong { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; }
.activity-day-picker small { position: absolute; top: 7px; right: 8px; }
.activity-day-picker.active { color: var(--primary-dark); font-weight: 700; }
.activity-day-picker.active strong { color: white; background: var(--primary); }
.activity-day-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.activity-day-stats > div { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.activity-day-stats strong,
.activity-day-stats span { display: block; }
.activity-day-stats strong { font-size: 20px; }
.activity-day-stats span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.activity-day-list { padding: 4px 18px 18px; }
.activity-time-group { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; padding-top: 16px; }
.activity-time-label strong,
.activity-time-label span { display: block; }
.activity-time-label strong { font-size: 15px; }
.activity-time-label span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.activity-time-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.activity-time-actions { grid-column: 2; }
.activity-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-left: 4px solid #9f7bd1; border-radius: 7px; color: var(--ink); background: white; cursor: pointer; }
.activity-card.activity-importance-4 { border-left-color: #7950b0; }
.activity-card.activity-importance-5 { border-left-color: var(--accent); background: #fffafd; }
.activity-card:hover { border-color: #cbb8e3; box-shadow: 0 5px 15px rgba(70, 45, 96, .08); }
.activity-card h3 { margin: 5px 0 7px; overflow-wrap: anywhere; font-size: 14px; }
.activity-card p { display: flex; align-items: center; gap: 5px; margin: 4px 0; color: var(--muted); font-size: 10px; }
.activity-card p svg { width: 12px; height: 12px; }
.activity-card-badges { flex-wrap: wrap; }
.activity-badge { display: inline-flex; align-items: center; min-height: 20px; padding: 3px 6px; border-radius: 5px; color: var(--primary-dark); background: var(--primary-soft); font-size: 9px; font-weight: 750; }
.activity-badge.official { color: #9c3764; background: var(--accent-soft); }
.activity-badge.joined { color: var(--success); background: var(--success-soft); }
.activity-badge.full { color: var(--warning); background: var(--warning-soft); }
.activity-capacity { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.activity-capacity > span { height: 5px; flex: 1; overflow: hidden; border-radius: 3px; background: var(--surface-soft); }
.activity-capacity > span i { height: 100%; display: block; background: var(--primary); }
.activity-capacity small { flex: none; color: var(--muted); font-size: 9px; }
.activity-card-action { width: 100%; margin-top: 10px; }
.activity-drawer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.activity-drawer-stats span { padding: 10px; border-radius: 7px; background: var(--surface-soft); text-align: center; }
.activity-drawer-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.activity-page-actions { max-width: 1160px; margin: 0 auto 14px; }
.activity-detail-hero { max-width: 1160px; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; margin: 0 auto; padding: 24px; border-top: 4px solid var(--primary); background: linear-gradient(135deg, white 0, #fff8fc 100%); }
.activity-detail-eyebrow { display: block; margin-top: 18px; color: var(--primary); font-size: 11px; letter-spacing: .16em; font-weight: 800; }
.activity-detail-hero h2 { max-width: 760px; margin: 10px 0; font-size: clamp(24px, 3vw, 31px); letter-spacing: 0; overflow-wrap: anywhere; }
.activity-detail-summary { max-width: 720px; margin: 6px 0; color: var(--muted); line-height: 1.7; }
.activity-detail-meta { flex-wrap: wrap; gap: 12px 22px; margin-top: 22px; }
.activity-detail-meta span { display: inline-flex; align-items: center; gap: 7px; color: #554a61; font-size: 13px; }
.activity-detail-meta svg { width: 16px; }
.activity-registration-panel { align-self: start; padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.activity-capacity-title { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.activity-capacity-title > div > span:first-child,
.activity-capacity-title > span { color: var(--muted); font-size: 11px; }
.activity-capacity-title strong { font-size: 24px; }
.activity-registration-panel .activity-capacity { margin: 11px 0 17px; }
.activity-registration-panel .activity-capacity > span { height: 8px; }
.activity-registration-panel > .btn { width: 100%; }
.activity-registration-panel > small { display: block; margin-top: 8px; color: var(--muted); text-align: center; }
.activity-detail-grid { max-width: 1160px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: 18px; margin: 18px auto 0; }
.activity-description,
.activity-participants { padding: 22px; }
.activity-description > h3 { display: flex; align-items: center; gap: 7px; margin-top: 0; }
.activity-description > h3 svg { width: 18px; }
.activity-participants .section-heading h2 { display: flex; align-items: center; gap: 7px; }
.activity-participants .section-heading h2 svg { width: 17px; }
.activity-participant { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.activity-participant:last-child { border-bottom: 0; }
.activity-participant .avatar { width: 34px; height: 34px; }
.activity-participant strong,
.activity-participant span { display: block; }
.activity-participant span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.activity-participant .activity-participant-own { margin: 0 0 0 auto; color: var(--success); }
.activity-cancel-reason { margin-top: 18px; padding: 12px; border-left: 3px solid #bd4650; background: #fff2f3; }
.activity-cancel-reason p { margin-bottom: 0; }
.activity-form-layout { max-width: 1160px; display: grid; grid-template-columns: minmax(0, 1fr) 290px; align-items: start; gap: 18px; margin: 0 auto; }
.activity-form-main { padding: 22px; }
.activity-form-section { padding: 4px 0 18px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.activity-form-section:last-child { margin-bottom: 0; border-bottom: 0; }
.activity-form-section > h2,
.activity-publish-panel h2 { margin: 0 0 13px; font-size: 15px; }
.activity-form-section .form-field + .form-field { margin-top: 13px; }
.activity-form-layout .checkbox-row { width: fit-content; display: flex; align-items: center; gap: 7px; margin-bottom: 12px; font-weight: 650; }
.activity-template-note { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding: 14px; border: 1px solid #d4c1ee; border-radius: 8px; background: var(--primary-soft); }
.activity-template-note svg { flex: none; }
.activity-template-note p { margin: 4px 0 0; color: var(--muted); }
.activity-template-note .btn { margin-left: auto; }
.activity-publish-panel { position: sticky; top: 82px; padding: 18px; }
.activity-publish-panel .btn { width: 100%; margin-top: 8px; }
.activity-publish-panel > .field-hint { margin-bottom: 0; }
.activity-check-row { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; color: #51465c; font-size: 11px; }
.activity-check { width: 18px; height: 18px; display: grid; place-items: center; flex: none; border-radius: 50%; color: var(--success); background: var(--success-soft); }
.activity-target-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.activity-target-grid label,
.activity-target-groups label { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fcfcfc; }
.activity-target-grid label.disabled { opacity: .42; }
.activity-target-groups { display: grid; gap: 7px; }
.activity-target-groups span,
.activity-target-groups strong,
.activity-target-groups small { min-width: 0; display: block; }
.activity-target-groups small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.activity-importance-options { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; }
.activity-importance-options label { position: relative; }
.activity-importance-options input { position: absolute; opacity: 0; }
.activity-importance-options span { min-width: 38px; height: 32px; display: grid; place-items: center; border-radius: 5px; font-weight: 800; }
.activity-importance-options input:checked + span { color: var(--primary-dark); background: var(--primary-soft); }
.activity-importance-options input:disabled + span { opacity: .35; }
.activity-group-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.activity-group-card { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; }
.activity-group-card h2 { margin: 8px 0 4px; font-size: 15px; }
.activity-group-card p,
.activity-group-card small { color: var(--muted); }

@media (max-width: 1100px) {
  .activity-toolbar > .toolbar-spacer { display: none; }
  .activity-heat-legend { margin-left: auto; }
  .activity-year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .activity-filters { flex-wrap: wrap; }
  .activity-search-field { flex: 1 1 320px; }
  .activity-filters label:not(.activity-search-field) { flex: 1; }
  .activity-time-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .activity-shell .topbar { padding-inline: 10px; gap: 8px; }
  .activity-shell .topbar-actions { gap: 4px; }
  .activity-shell .topbar-actions .btn { width: 36px; padding: 0; }
  .activity-shell .page { padding-top: 12px; }
  .activity-toolbar { align-items: stretch; }
  .activity-date-nav { width: 100%; }
  .activity-date-nav h2 { min-width: 0; order: 1; flex: 1; margin-left: 2px; font-size: 18px; }
  .activity-date-nav .btn:first-child { order: 2; margin-left: auto; }
  .activity-date-nav .btn:nth-child(2) { order: 3; }
  .activity-date-nav .btn:nth-child(3) { order: 4; }
  .activity-toolbar > .toolbar-spacer { display: none; }
  .activity-heat-legend { display: none; }
  .activity-view-switch { order: 2; flex: 1; }
  .activity-view-switch button { flex: 1; }
  .activity-filter-toggle { order: 3; display: inline-flex; width: 40px; padding: 0; }
  .activity-toolbar > [data-activity-groups] { order: 4; width: 40px; padding: 0; }
  .activity-toolbar > [data-activity-create] { order: 5; width: 40px; padding: 0; }
  .activity-toolbar > [data-activity-groups] span,
  .activity-toolbar > [data-activity-create] span { display: none; }
  .activity-filters { display: none; grid-template-columns: 1fr 1fr; gap: 8px; }
  .activity-filters.open { display: grid; }
  .activity-filters label { min-width: 0; }
  .activity-search-field { min-width: 0 !important; grid-column: 1 / -1; }
  .activity-filters [data-activity-clear] { width: 100%; }
  .activity-year-grid { grid-template-columns: 1fr; }
  .activity-mini-month { padding: 15px; }
  .activity-mini-days button,
  .activity-mini-weekdays span { font-size: 10px; }
  .activity-month-grid { grid-template-rows: repeat(6, 68px); }
  .activity-weekdays span { padding: 8px 2px; font-size: 10px; }
  .activity-month-day { padding: 5px; }
  .activity-month-event,
  .activity-more { display: none; }
  .activity-day-number { align-items: flex-start; }
  .activity-day-number small { display: none; }
  .activity-week { min-width: 740px; }
  .activity-time-group { grid-template-columns: 1fr; gap: 7px; }
  .activity-time-label { display: flex; align-items: center; gap: 7px; }
  .activity-time-label span { margin-top: 0; }
  .activity-time-cards { grid-template-columns: 1fr; }
  .activity-time-actions { grid-column: 1; }
  .activity-day-stats { gap: 5px; }
  .activity-day-stats > div { padding: 10px; }
  .activity-day-list { padding: 4px 14px 14px; }
  .activity-detail-hero { grid-template-columns: 1fr; padding: 18px; }
  .activity-detail-hero h2 { font-size: 24px; }
  .activity-detail-meta { display: grid; gap: 8px; }
  .activity-detail-grid,
  .activity-form-layout { grid-template-columns: 1fr; }
  .activity-form-main { padding: 16px; }
  .activity-template-note { flex-wrap: wrap; }
  .activity-template-note .btn { margin-left: 29px; }
  .activity-publish-panel { position: static; }
  .activity-target-grid,
  .activity-target-groups,
  .activity-group-list,
  .activity-drawer-list { grid-template-columns: 1fr; }
  .activity-group-card { align-items: flex-start; flex-direction: column; }
  .activity-page-actions { flex-wrap: wrap; }
}

.official-dormitory-hero { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 4px solid var(--primary); background: linear-gradient(135deg, #fbf8ff, #fff7fb); }
.official-dormitory-hero h2 { margin: 6px 0 8px; font-size: 25px; }
.official-dormitory-hero p { margin: 0; color: var(--muted); }
.official-dormitory-hero .eyebrow { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.official-dormitory-selector { margin-bottom: 16px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; }
.official-dormitory-selector select { width: min(360px, 100%); }
.official-content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.official-content-card { min-width: 0; cursor: pointer; transition: border-color 160ms ease, box-shadow 160ms ease; }
.official-content-card:hover, .official-content-card:focus-visible { border-color: #bda8d8; outline: none; box-shadow: var(--shadow); }
.official-content-card > header { display: flex; align-items: center; gap: 9px; }
.official-content-card > header svg { width: 19px; color: var(--primary); }
.official-content-card > header h2 { margin: 0; font-size: 17px; }
.official-content-summary { min-height: 68px; margin: 16px 0 0; color: #4b4056; line-height: 1.7; overflow-wrap: anywhere; }
.official-content-hidden { min-height: 120px; display: grid; place-content: center; color: var(--muted); text-align: center; }
.official-member-section { margin-top: 26px; }
.official-member-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.official-member-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-top: 4px solid #879bc5; border-radius: 8px; background: #f2f6ff; cursor: pointer; }
.official-member-card.gender-female { border-top-color: #d989ac; background: #fff3f8; }
.official-member-card.leader { border-color: #6b4a8c; border-top-color: #6b4a8c; box-shadow: 0 8px 20px rgba(75, 45, 103, .13); }
.official-member-card.unavailable { border-top-color: #bbb2c2; background: var(--surface-soft); cursor: default; }
.official-member-head { display: flex; align-items: center; gap: 10px; }
.official-member-head > div { min-width: 0; }
.official-member-head h3 { margin: 0 0 4px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.official-member-head p, .official-member-card > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.official-member-card > p { margin-top: 12px; }
.official-member-card .status-badge { margin-top: 10px; }
.official-garden { margin-top: 26px; border: 1px dashed #bca8d0; background: #fbf8fe; text-align: center; }
.official-garden h2 { margin: 8px 0 4px; }
.official-garden p { margin: 0; color: var(--muted); }
.official-garden svg { color: var(--primary); }
.official-visit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.official-visit-card { min-width: 0; cursor: pointer; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.official-visit-card:hover, .official-visit-card:focus-visible { border-color: #bda8d8; outline: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.official-visit-card header, .official-visit-card footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.official-visit-card header span, .official-visit-card footer { color: var(--muted); font-size: 11px; }
.official-visit-card h2 { margin: 4px 0 0; font-size: 17px; }
.official-visit-card > p { min-height: 68px; margin: 18px 0; color: #4b4056; line-height: 1.7; overflow-wrap: anywhere; }
.official-member-avatars { display: flex; padding-left: 7px; }
.official-member-avatars .avatar, .official-hidden-avatar { width: 30px; height: 30px; margin-left: -7px; border: 2px solid white; border-radius: 50%; }
.official-hidden-avatar { display: grid; place-items: center; color: var(--muted); background: #eee9f2; }
.official-hidden-avatar svg { width: 13px; }
.official-back { margin-bottom: 15px; }
.official-import-preview { margin-top: 20px; }
.official-import-preview .round-metrics { margin-bottom: 14px; }
.official-import-preview > .modal-actions { margin: 16px -20px -20px; }
.official-admin-detail > .detail-header { margin-bottom: 20px; }
.official-admin-detail .section { margin: 0 -20px; padding: 20px; border-top: 1px solid var(--line); }
.official-admin-detail .section + .section { margin-top: 0; }
.official-moderation-grid { display: grid; gap: 10px; }
.official-moderation-grid > div { padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; }
.official-moderation-grid .cell-actions { margin-left: auto; }
.admin-pagination { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 12px; }

.empty-state { min-height: 260px; display: grid; place-content: center; justify-items: center; text-align: center; padding: 30px; color: var(--muted); }
.empty-state svg { width: 38px; height: 38px; margin-bottom: 12px; color: #9b83b5; }
.empty-state h3 { margin: 0 0 7px; color: var(--ink); font-size: 16px; }
.empty-state p { margin: 0 0 16px; max-width: 420px; line-height: 1.65; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 24px; display: grid; place-items: center; background: rgba(28, 18, 38, 0.56); }
.modal { width: min(620px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; overflow: hidden; background: white; border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,0.24); }
.modal.wide { width: min(860px, 100%); }
.modal-head { flex: none; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: white; border-bottom: 1px solid var(--line); }
.modal-head h2 { min-width: 0; margin: 0; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.modal-head [data-close] { flex: 0 0 40px; }
.modal-body { min-height: 0; padding: 20px; overflow-y: auto; }
.modal-actions { position: sticky; bottom: 0; padding: 14px 20px; display: flex; justify-content: flex-end; gap: 8px; background: white; border-top: 1px solid var(--line); }

.toast-root { position: fixed; top: 18px; right: 18px; z-index: 150; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 400px; padding: 12px 14px; display: flex; align-items: flex-start; gap: 9px; color: white; background: #352642; border-radius: 7px; box-shadow: var(--shadow); animation: toast-in 180ms ease; }
.toast.error { background: #8f3333; }
.toast svg { width: 18px; height: 18px; flex: none; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }

.mobile-nav { display: none; }
.only-mobile { display: none; }
.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; }

@media (max-width: 1050px) {
  .roommate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-layout { grid-template-columns: 1fr; }
  .dormitory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-grid { grid-template-columns: 1fr; }
  .round-admin-grid { grid-template-columns: 1fr; }
  .treehole-grid { grid-template-columns: 1fr; }
  .official-member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .official-visit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-panel { position: static; }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .main-shell { margin-left: 0; }
  .topbar { height: 60px; padding: 0 16px; }
  .topbar-title p { display: none; }
  .topbar-actions .btn span { display: none; }
  .page { padding: 18px 14px 88px; }
  .roommate-grid { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }
  .search-field { max-width: none; min-width: 100%; }
  .toolbar > select { flex: 1 1 180px; width: auto; }
  .compact-date { flex: 1 1 150px; }
  .compact-date input { width: 100%; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .profile-form { padding: 18px; }
  .form-actions { margin: 20px -18px -18px; padding: 12px 18px; }
  .temperature-grid { grid-template-columns: 70px 1fr auto 1fr; }
  .detail-header { align-items: flex-start; flex-wrap: wrap; }
  .detail-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  .page.message-page { height: calc(100vh - 60px); height: calc(100dvh - 60px); padding-bottom: 84px; }
  .message-workspace { grid-template-columns: 1fr; }
  .message-workspace.chat-open .conversation-list { display: none; }
  .message-workspace:not(.chat-open) .chat { display: none; }
  .chat-head .only-mobile { display: inline-flex; }
  .candidate-grid { grid-template-columns: 1fr; }
  .person-picker-tools { align-items: stretch; flex-direction: column; }
  .person-picker-tools .search-field, .person-picker-tools select, .person-picker-tools .btn { width: 100%; max-width: none; }
  .selection-group-item { align-items: stretch; flex-direction: column; }
  .selection-group-item .cell-actions { justify-content: flex-start; }
  .round-history-item { align-items: stretch; flex-direction: column; }
  .round-history-item .btn { align-self: flex-start; }
  .round-metrics { grid-template-columns: 1fr; }
  .dormitory-grid { grid-template-columns: 1fr; }
  .application-card { width: 92%; }
  .treehole-hero { padding: 22px; align-items: flex-start; flex-direction: column; }
  .treehole-hero .btn { width: 100%; }
  .treehole-replies { margin-left: 8px; padding-left: 10px; }
  .treehole-comment > header time { width: 100%; margin-left: 0; }
  .official-dormitory-hero { align-items: flex-start; flex-direction: column; }
  .official-content-grid, .official-member-grid, .official-visit-grid { grid-template-columns: 1fr; }
  .official-dormitory-selector { align-items: stretch; flex-direction: column; }
  .official-dormitory-selector select { width: 100%; }
  .official-moderation-grid > div { align-items: flex-start; flex-direction: column; }
  .official-moderation-grid .cell-actions { margin-left: 0; }
  .admin-pagination { justify-content: space-between; }
  .admin-pagination span { text-align: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat { padding: 14px; }
  .stat strong { font-size: 23px; }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    height: 66px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: white;
    border-top: 1px solid var(--line);
  }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); display: grid; place-content: center; justify-items: center; gap: 3px; font-size: 10px; }
  .mobile-nav button.active { color: var(--primary); font-weight: 700; }
  .mobile-nav svg { width: 19px; height: 19px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 8px 8px 0 0; }
  .login-panel { padding: 26px 22px; }
  .login-logo-band { margin: -26px -22px 18px; padding: 12px 22px; }
  .site-header { height: 62px; }
  .site-header-inner { padding: 0 12px; }
  .site-logo { width: 112px; padding: 8px 10px 8px 0; }
  .site-logo img { width: 102px; height: 46px; }
  .site-nav { flex: 1; }
  .site-nav a { min-width: 0; flex: 1; padding: 0 8px; font-size: 13px; }
  .site-nav a:first-child { display: none; }
  .site-account { margin-left: 8px; }
  .site-login { min-width: 56px; padding: 0 10px; }
  .homepage-main { width: min(100% - 32px, 880px); padding: 34px 0 72px; }
  .markdown-article { font-size: 15px; line-height: 1.76; }
  .markdown-article h1 { margin-bottom: 24px; font-size: 28px; }
  .markdown-article h2 { margin-top: 34px; font-size: 21px; }
}

@media (max-width: 430px) {
  .stats-grid { grid-template-columns: 1fr; }
  .temperature-grid { grid-template-columns: 1fr 1fr; }
  .temperature-grid > span { display: none; }
}
