* {
  box-sizing: border-box;
}

:root {
  --brand-ink: #352f3f;
  --brand-splash: #393442;
  --brand-ink-soft: #443d50;
  --brand-accent: #12c8b2;
  --brand-accent-dark: #0a9e8c;
  --page-bg: #f6f8f8;
  --surface: #ffffff;
  --border: #e2e8eb;
  --text: #1f2933;
  --muted: #64748b;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

.centered-icon-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
  line-height: 0;
}

.centered-icon-button > svg {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 48%, rgba(18, 200, 178, 0.1), rgba(18, 200, 178, 0) 34%),
    linear-gradient(135deg, #302b3a 0%, var(--brand-splash) 48%, #2f2a38 100%);
  color: var(--brand-accent);
  animation: splash-hold 5s ease forwards;
}

.splash-stage {
  position: absolute;
  display: grid;
  justify-items: center;
  width: min(620px, 92vw);
}

.splash-logo-card {
  position: relative;
  width: min(537px, 86vw);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(.96);
  animation: original-logo-rise 1.45s cubic-bezier(.2, .8, .2, 1) .45s forwards, original-logo-breathe 2.7s ease-in-out 1.9s 1;
  filter: drop-shadow(0 0 28px rgba(18, 200, 178, 0.2));
}

.splash-logo-card::before {
  display: none;
}

.splash-logo-image {
  display: block;
  width: 100%;
  height: auto;
}

.splash-logo-shine {
  position: absolute;
  inset: -20% auto -20% -36%;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(18, 200, 178, .34), rgba(255, 255, 255, .2), transparent);
  transform: skewX(-16deg);
  animation: original-logo-shine 1.55s ease 2.2s forwards;
}

.splash-copy {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  letter-spacing: 6px;
  opacity: 0;
  transform: translateY(12px);
  animation: copy-rise .85s ease 3.35s forwards;
}

.splash-scan {
  position: relative;
  width: min(460px, 70vw);
  height: 2px;
  margin-top: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0;
  animation: scan-appear .4s ease 2.1s forwards;
}

.splash-scan span {
  display: block;
  width: 36%;
  height: 100%;
  background: var(--brand-accent);
  box-shadow: 0 0 18px rgba(18, 200, 178, 0.9);
  animation: scan-run 2.15s ease-in-out 2.15s forwards;
}

.app-splash.splash-out {
  pointer-events: none;
  animation: splash-out .62s ease forwards;
}

@keyframes original-logo-rise {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes original-logo-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.01);
  }
}

@keyframes original-logo-shine {
  to {
    transform: translateX(420%) skewX(-16deg);
  }
}

@keyframes copy-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scan-appear {
  to {
    opacity: 1;
  }
}

@keyframes scan-run {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(320%);
  }
}

@keyframes splash-hold {
  to {
    opacity: 1;
  }
}

@keyframes splash-out {
  to {
    opacity: 0;
    transform: scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-splash,
  .app-splash *,
  .app-splash *::before,
  .app-splash *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Shared B+C upload control: dropzone first, selected-file queue below. */
.file-upload-field { position: relative; display: grid; min-width: 0; gap: 8px; }
.file-upload-label { color: var(--heading); font-size: 13px; }
.file-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.file-upload-dropzone {
  display: grid;
  min-height: 148px;
  padding: 22px;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px dashed color-mix(in srgb, var(--brand) 46%, var(--rule));
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-soft) 88%, var(--brand-soft));
  color: var(--copy);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.file-upload-dropzone:hover,
.file-upload-dropzone:focus-visible,
.file-upload-dropzone.is-dragging {
  outline: 0;
  border-color: var(--brand);
  background: var(--brand-soft);
}
.file-upload-dropzone strong { color: var(--heading); font-size: 14px; }
.file-upload-dropzone > span:not(.file-upload-plus) { font-size: 11px; }
.file-upload-plus {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 2px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 23px;
  line-height: 1;
}
.file-upload-button {
  width: auto !important;
  margin-top: 3px;
  padding: 8px 13px;
  border: 1px solid color-mix(in srgb, var(--brand) 38%, var(--rule));
  border-radius: 6px;
  background: var(--control);
  color: var(--heading);
  font-size: 12px;
  font-weight: 700;
}
.file-upload-list { overflow: hidden; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); }
.file-upload-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 30px; align-items: center; gap: 10px; min-height: 62px; padding: 9px 11px; border-bottom: 1px solid var(--rule); }
.file-upload-row:last-child { border-bottom: 0; }
.file-upload-badge { display: grid; width: 36px; height: 40px; place-items: center; border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--rule)); border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 9px; font-weight: 800; }
.file-upload-copy { display: grid; min-width: 0; gap: 3px; }
.file-upload-copy strong,
.file-upload-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-upload-copy strong { color: var(--heading); font-size: 12px; }
.file-upload-copy span { color: var(--copy); font-size: 10px; }
.file-upload-remove {
  display: grid;
  width: 28px !important;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--copy);
  font-size: 17px;
}
.file-upload-remove:hover { background: #f8e7e7; color: #b42323; }
.circle-composer-actions { justify-content: flex-end; }

/* Read-only season honor card, loaded only after an avatar is selected. */
.member-card-trigger {
  display: inline-grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  margin: -9px;
  padding: 9px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.member-card-trigger:hover { background: var(--brand-soft); }
.member-card-trigger:focus-visible { outline: 3px solid #087c6e; outline-offset: 2px; }
.member-card-trigger .member-avatar { display: block; }
.member-identity > .member-card-trigger { width:60px; margin-inline:0; padding:9px 0; }
.member-card-leader-trigger { margin: -6px; padding: 6px; }
:root[data-theme="dark"] .member-card-trigger:focus-visible { outline-color: #69e3d1; }

.member-card-dialog {
  --member-card-profile-bg: #f2faf8;
  --member-card-profile-accent: #087c6e;
  --member-card-profile-rule: #cddfda;
  --member-card-focus: #087c6e;
  --member-card-status-accent: #087c6e;
  --member-card-status-border: #d9e6e2;
  --member-card-status-surface: #f2faf8;
  --member-card-status-icon: #d9f2ed;
  width: min(640px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--panel);
  color: var(--heading);
  box-shadow: 0 24px 80px rgba(8, 22, 20, .28);
}
.member-card-dialog::backdrop { background: rgba(8, 18, 17, .58); backdrop-filter: blur(3px); }
:root[data-theme="dark"] .member-card-dialog {
  --member-card-profile-bg: #162d29;
  --member-card-profile-accent: #69e3d1;
  --member-card-profile-rule: #30514b;
  --member-card-focus: #69e3d1;
  --member-card-status-accent: #69e3d1;
  --member-card-status-border: #35514c;
  --member-card-status-surface: #1d312e;
  --member-card-status-icon: #234a44;
}
.member-card-address { padding-top: 16px; border-top: 1px solid var(--border); }
.member-card-address p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--copy); }
.member-card-shell { position: relative; min-height: 390px; padding: 0; }
.member-card-shell::before { position: absolute; z-index: 2; top: 0; left: 0; width: 100%; height: 5px; background: var(--brand); content: ""; }
.member-card-close {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--copy);
  cursor: pointer;
  touch-action: manipulation;
}
.member-card-close:hover { color: var(--heading); background: var(--surface-muted); }
.member-card-close:focus-visible { outline: 3px solid var(--member-card-focus); outline-offset: 2px; }
.member-card-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.member-card-loading,
.member-card-error { display: flex; min-height: 390px; align-items: center; justify-content: center; gap: 14px; padding: 32px; text-align: left; }
.member-card-loading[hidden],
.member-card-error[hidden],
.member-card-content[hidden] { display: none; }
.member-card-loading > div,
.member-card-error { color: var(--copy); }
.member-card-error { flex-direction: column; gap: 4px; text-align: center; }
.member-card-loading strong,
.member-card-error strong { display: block; color: var(--heading); font-size: 15px; }
.member-card-loading span,
.member-card-error span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.member-card-loading-avatar { width: 56px; height: 56px; margin: 0; border-radius: 50%; background: linear-gradient(90deg, var(--surface-muted), var(--brand-soft), var(--surface-muted)); background-size: 220% 100%; animation: member-card-loading 1.1s linear infinite; }

.member-card-profile-layout { display: grid; grid-template-columns: 184px minmax(0, 1fr); min-height: 390px; }
.member-card-profile-rail { display: flex; min-width: 0; flex-direction: column; padding: 36px 24px 28px; border-right: 1px solid var(--member-card-profile-rule); background: var(--member-card-profile-bg); }
.member-card-profile-avatar { display: grid; width: 104px; min-height: 104px; place-items: center; overflow: visible; }
.member-card-profile-avatar > img { width: 92px; height: 92px; border: 3px solid var(--panel); border-radius: 50%; outline: 2px solid var(--member-card-profile-accent); background: var(--surface-muted); object-fit: cover; }
.member-card-profile-avatar > .season-honor-avatar-card { width: 92px; height: 92px; }
.member-card-profile-copy { min-width: 0; margin-top: 14px; }
.member-card-profile-kicker { display: flex; flex-wrap: wrap; gap: 3px 5px; margin: 0; color: var(--member-card-profile-accent); font-size: 12px; font-weight: 800; line-height: 1.4; letter-spacing: .02em; }
.member-card-profile-rail h2 { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--heading); font-size: 34px; line-height: 1.08; letter-spacing: -.035em; }
.member-card-profile-period { display: grid; gap: 6px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--member-card-profile-rule); color: var(--copy); font-size: 12px; line-height: 1.45; }
.member-card-profile-period strong { color: var(--heading); font-size: 12px; font-variant-numeric: tabular-nums; }
.member-card-profile-period b { color: inherit; font-weight: 800; }

.member-card-profile-main { display: flex; min-width: 0; flex-direction: column; padding: 76px 24px 24px; }
.member-card-profile-status { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 76px; padding: 13px 14px; border: 1px solid var(--member-card-status-border); border-radius: 9px; background: var(--member-card-status-surface); box-shadow: inset 4px 0 0 var(--member-card-status-accent); }
.member-card-profile-status.is-overall { --member-card-status-accent: #8a5b0f; --member-card-status-border: #dfc379; --member-card-status-surface: #fff9e9; --member-card-status-icon: #f4dea1; }
.member-card-profile-status.is-count { --member-card-status-accent: #56656b; --member-card-status-border: #c4ced2; --member-card-status-surface: #f6f8f9; --member-card-status-icon: #e2e8eb; }
.member-card-profile-status.is-calorie { --member-card-status-accent: #a84b20; --member-card-status-border: #e8aa8a; --member-card-status-surface: #fff4ee; --member-card-status-icon: #f9d9c8; }
.member-card-profile-status-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: var(--member-card-status-icon); color: var(--member-card-status-accent); }
.member-card-profile-status-icon svg { width: 21px; height: 21px; fill: currentColor; }
.member-card-profile-status > div { min-width: 0; }
.member-card-profile-status > div > span { display: block; color: var(--copy); font-size: 12px; font-weight: 800; line-height: 1.35; }
.member-card-profile-status strong { display: block; margin-top: 2px; overflow-wrap: anywhere; color: var(--member-card-status-accent); font-size: 15px; line-height: 1.35; }
.member-card-profile-status small { display: block; margin-top: 3px; overflow-wrap: anywhere; color: var(--copy); font-size: 12px; line-height: 1.4; }

.member-card-profile-stats { display: grid; flex: 1; grid-template-rows: repeat(2, minmax(0, 1fr)); min-height: 210px; margin-top: 20px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.member-card-profile-stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; gap: 7px 14px; min-width: 0; padding: 18px 0; }
.member-card-profile-stat + .member-card-profile-stat { border-top: 1px solid var(--rule); }
.member-card-profile-stat-title { display: flex; min-width: 0; align-items: center; gap: 8px; color: var(--copy); font-size: 12px; font-weight: 800; }
.member-card-profile-stat-icon { display: grid; flex: 0 0 auto; width: 28px; height: 28px; place-items: center; border-radius: 7px; background: #e8edef; color: #68747a; font-size: 11px; font-weight: 900; }
.member-card-profile-stat-icon.is-calorie { background: #fff0e7; color: #ce602b; }
.member-card-profile-stat-icon svg { width: 17px; height: 17px; fill: currentColor; }
.member-card-profile-stat-number { display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; margin: 0; color: var(--heading); font-size: 36px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.member-card-profile-stat-number small { color: var(--copy); font-size: 13px; letter-spacing: 0; white-space: nowrap; }
.member-card-profile-stat p { grid-column: 1 / -1; margin: 0; overflow-wrap: anywhere; color: var(--copy); font-size: 12px; line-height: 1.55; }

:root[data-theme="dark"] .member-card-profile-status.is-overall { --member-card-status-accent: #f1c65d; --member-card-status-border: #7e672f; --member-card-status-surface: #332a18; --member-card-status-icon: #54421e; }
:root[data-theme="dark"] .member-card-profile-status.is-count { --member-card-status-accent: #cbd4d8; --member-card-status-border: #59666d; --member-card-status-surface: #293236; --member-card-status-icon: #3b474d; }
:root[data-theme="dark"] .member-card-profile-status.is-calorie { --member-card-status-accent: #ff9a74; --member-card-status-border: #8d5033; --member-card-status-surface: #39261e; --member-card-status-icon: #563223; }
:root[data-theme="dark"] .member-card-profile-stat-icon { background: #34413f; color: #c3ced1; }
:root[data-theme="dark"] .member-card-profile-stat-icon.is-calorie { background: #4b2f24; color: #ff9a74; }

@keyframes member-card-loading { to { background-position: -220% 0; } }

@media (max-width: 640px) {
  .member-card-dialog { width: 100%; max-height: calc(100dvh - 24px); margin: auto 0 0; border-width: 1px 0 0; border-radius: 12px 12px 0 0; }
  .member-card-shell { min-height: 0; }
  .member-card-close { top: 14px; right: 14px; }
  .member-card-loading,
  .member-card-error { min-height: 340px; padding: 28px 20px max(28px, env(safe-area-inset-bottom)); }
  .member-card-profile-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .member-card-profile-rail { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center; gap: 14px; padding: 28px 68px 20px 20px; border-right: 0; border-bottom: 1px solid var(--member-card-profile-rule); }
  .member-card-profile-avatar { width: 80px; min-height: 80px; }
  .member-card-profile-avatar > img,
  .member-card-profile-avatar > .season-honor-avatar-card { width: 72px; height: 72px; }
  .member-card-profile-copy { margin-top: 0; }
  .member-card-profile-rail h2 { font-size: 28px; }
  .member-card-profile-period { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 10px; padding-top: 9px; }
  .member-card-profile-period strong { flex-basis: 100%; }
  .member-card-profile-main { padding: 20px 20px max(24px, env(safe-area-inset-bottom)); }
  .member-card-profile-stats { min-height: 250px; }
  .member-card-profile-stat { padding: 17px 0; }
}

@media (max-width: 360px) {
  .member-card-profile-rail { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding-right: 62px; padding-left: 16px; }
  .member-card-profile-avatar { width: 72px; }
  .member-card-profile-main { padding-right: 16px; padding-left: 16px; }
  .member-card-profile-stat { grid-template-columns: minmax(0, 1fr); }
  .member-card-profile-stat-number { justify-content: flex-start; font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .member-card-loading-avatar { animation: none; }
  .member-card-dialog::backdrop { backdrop-filter: none; }
}

/* PM-01 member home */
.member-home {
  --member-blue: #1c72cf;
  --member-blue-soft: #e9f3ff;
  --member-orange: #e87518;
  --member-orange-soft: #fff1e5;
  display: grid;
  gap: 22px;
  max-width: 1420px;
  margin: 0 auto;
}

.member-home-head,
.member-home-section-head,
.member-home-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.member-home-head { padding: 10px 2px 0; }
.member-home-head h1 { margin: 8px 0 6px; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.13; letter-spacing: -.04em; }
.member-home-head p,
.member-home-section-head p,
.member-home-card-head p { margin: 0; color: var(--copy); line-height: 1.65; }
.member-home-eyebrow { color: #087b70; font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }

.member-home-overview-link,
.member-home-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--panel);
  color: var(--heading);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(22, 57, 50, .08);
}

.member-home-overview-link { flex: 0 0 auto; margin-top: 28px; border: 1px solid var(--rule); }
.member-home-overview-link:hover,
.member-home-primary-link:hover { transform: translateY(-1px); }

.member-home-week-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 18px; }
.member-home-week-card,
.member-home-summary-card,
.member-home-honors,
.member-home-character,
.member-home-trends { border: 1px solid var(--rule); border-radius: 26px; background: var(--panel); box-shadow: 0 18px 48px rgba(28, 49, 44, .07); }

.member-home-week-card {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: center;
  padding: 42px 36px;
  border-color: transparent;
  background: linear-gradient(125deg, #075b51, #079081 58%, #14a797);
  color: #fff;
}

.member-home-week-card::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -150px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
}

.member-home-week-copy { position: relative; z-index: 1; }
.member-home-kicker { color: rgba(255, 255, 255, .78); font-size: 13px; font-weight: 800; }
.member-home-week-copy h2 { max-width: 680px; margin: 18px 0 8px; color: #fff; font-size: clamp(27px, 3vw, 42px); line-height: 1.22; letter-spacing: -.035em; }
.member-home-week-copy h2 em { color: #bff9ee; font-style: normal; }
.member-home-week-copy p { max-width: 640px; margin: 0; color: rgba(255, 255, 255, .78); line-height: 1.7; }
.member-home-primary-link { margin-top: 38px; background: #fff; color: #0a4f47; }

.member-home-ring {
  position: relative;
  z-index: 1;
  display: grid;
  width: 164px;
  height: 164px;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  background: conic-gradient(#c8fff5 var(--member-progress), rgba(255, 255, 255, .22) 0);
}

.member-home-ring::before { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: #075b51; }
.member-home-ring div { position: relative; display: grid; justify-items: center; }
.member-home-ring strong { color: #fff; font-size: 34px; line-height: 1; }
.member-home-ring strong span { font-size: 22px; }
.member-home-ring small { margin-top: 8px; color: rgba(255, 255, 255, .72); font-size: 11px; }

.member-home-summary-card { padding: 28px; }
.member-home-card-head h2,
.member-home-section-head h2 { margin: 4px 0 5px; font-size: 26px; }
.member-home-status,
.member-home-season-cutoff span { display: inline-flex; min-height: 34px; align-items: center; padding: 0 12px; border-radius: 999px; background: var(--brand-soft); color: #087b70; font-size: 12px; font-weight: 800; }
.member-home-metrics { display: grid; gap: 10px; margin-top: 24px; }
.member-home-metrics > div { display: flex; align-items: center; justify-content: space-between; min-height: 70px; padding: 14px 16px; border-radius: 16px; background: var(--panel-soft); }
.member-home-metrics span { color: var(--copy); }
.member-home-metrics strong { font-size: 20px; }
.member-home-summary-note { margin: 18px 0 0; color: var(--copy); font-size: 12px; line-height: 1.65; }

.member-home-honors,
.member-home-trends { padding: 30px; }
.member-home-season-cutoff { display: grid; flex: 0 0 auto; justify-items: end; gap: 8px; text-align: right; }
.member-home-season-cutoff small { color: var(--copy); }
.member-home-medal-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 22px; margin-top: 26px; }
.member-home-season-medal { display: grid; min-height: 330px; place-items: center; align-content: center; padding: 28px; border-radius: 24px; background: linear-gradient(145deg, #de8a12, #a95209); color: #fff4d3; text-align: center; box-shadow: inset 0 1px rgba(255, 255, 255, .24); }
.member-home-season-medal svg { width: 62px; height: 62px; margin-bottom: 8px; }
.member-home-season-medal span { font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.member-home-season-medal strong { margin-top: 10px; color: #fff; font-size: 72px; line-height: .95; }
.member-home-season-medal b { margin-top: 8px; color: #fff; font-size: 18px; }
.member-home-season-medal small { margin-top: 14px; color: rgba(255, 255, 255, .76); line-height: 1.55; }
.member-home-medal-details { display: grid; gap: 12px; }
.member-home-medal-row { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 138px; padding: 20px; border: 1px solid var(--rule); border-radius: 21px; background: var(--panel-soft); }
.member-home-medal-icon { display: grid; width: 62px; min-height: 76px; place-items: center; align-content: center; gap: 5px; color: var(--member-blue); }
.member-home-medal-icon svg { width: 32px; height: 32px; }
.member-home-medal-icon b { font-size: 11px; }
.member-home-medal-row > div > span { color: var(--copy); font-size: 12px; font-weight: 800; }
.member-home-medal-row strong { display: block; margin: 5px 0; font-size: 23px; }
.member-home-medal-row strong b { color: var(--member-blue); font-size: 34px; }
.member-home-medal-row p { margin: 0; color: var(--copy); font-size: 12px; }
.member-home-medal-row em { padding: 8px 11px; border-radius: 999px; background: var(--member-blue-soft); color: var(--member-blue); font-size: 11px; font-style: normal; font-weight: 800; }
.member-home-medal-row.calorie .member-home-medal-icon,
.member-home-medal-row.calorie strong b { color: var(--member-orange); }
.member-home-medal-row.calorie em { background: var(--member-orange-soft); color: var(--member-orange); }
.member-home-medal-note { margin: 0; padding: 13px 16px; border-radius: 15px; background: var(--brand-soft); color: var(--copy); font-size: 12px; line-height: 1.6; }

.member-home-character { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(0, 1.25fr); overflow: hidden; }
.member-home-character-current { display: grid; align-content: start; min-height: 590px; padding: 26px; background: linear-gradient(160deg, #084f47, #0c897b); color: #fff; }
.member-home-character-current > span { font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.member-home-character-current img { width: 100%; height: 500px; margin-top: 16px; object-fit: contain; border-radius: 20px; background: rgba(255, 255, 255, .08); }
.member-home-character-copy { padding: 34px; }
.member-home-character-copy h2 { margin: 8px 0; font-size: 32px; }
.member-home-character-copy > p { margin: 0; color: var(--copy); line-height: 1.75; }
.member-home-character-status { display: grid; gap: 4px; margin: 22px 0; padding: 15px 18px; border-radius: 16px; background: var(--brand-soft); }
.member-home-character-status b { color: #087b70; }
.member-home-character-status span { color: var(--copy); font-size: 12px; line-height: 1.55; }
.member-home-character-copy h3 { margin: 0 0 12px; font-size: 17px; }
.member-home-character-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.member-home-character-options figure { overflow: hidden; margin: 0; border: 1px solid var(--rule); border-radius: 18px; background: var(--panel-soft); }
.member-home-character-options img { display: block; width: 100%; height: 285px; object-fit: contain; background: linear-gradient(180deg, rgba(7, 123, 112, .08), transparent); }
.member-home-character-options figcaption { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; }
.member-home-character-options figcaption span { color: var(--copy); font-size: 12px; }

.member-home-trend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.member-home-trend-card { padding: 22px; border: 1px solid var(--rule); border-radius: 20px; background: var(--panel-soft); }
.member-home-trend-card > div:first-child { display: flex; align-items: baseline; gap: 9px; }
.member-home-trend-card > div:first-child > span { color: var(--copy); font-weight: 800; }
.member-home-trend-card > div:first-child strong { margin-left: auto; font-size: 24px; }
.member-home-trend-card > div:first-child small { color: var(--copy); }
.member-home-bars { display: grid; grid-template-columns: repeat(8, minmax(28px, 1fr)); align-items: end; height: 250px; gap: 7px; margin-top: 18px; padding-top: 25px; border-bottom: 1px solid var(--rule); }
.member-home-bars > span { display: grid; height: 100%; grid-template-rows: 1fr 24px; align-items: end; gap: 7px; text-align: center; }
.member-home-bars b { position: relative; display: block; width: 100%; min-height: 3px; height: max(3px, var(--bar-value)); border-radius: 9px 9px 3px 3px; background: #8ec3fb; }
.member-home-bars em { position: absolute; left: 50%; bottom: calc(100% + 5px); transform: translateX(-50%); color: var(--heading); font-size: 10px; font-style: normal; font-weight: 800; white-space: nowrap; }
.member-home-bars small { color: var(--copy); font-size: 9px; }
.member-home-bars .current b { background: var(--member-blue); }
.member-home-trend-card.calorie .member-home-bars b { background: #f6bb86; }
.member-home-trend-card.calorie .member-home-bars .current b { background: var(--member-orange); }

:root[data-theme="dark"] .member-home {
  --member-blue: #72b4ff;
  --member-blue-soft: #193754;
  --member-orange: #ffad67;
  --member-orange-soft: #4b2f1c;
}
:root[data-theme="dark"] .member-home-eyebrow,
:root[data-theme="dark"] .member-home-status,
:root[data-theme="dark"] .member-home-season-cutoff span,
:root[data-theme="dark"] .member-home-character-status b { color: #62dfcd; }
:root[data-theme="dark"] .member-home-week-card { background: linear-gradient(125deg, #083c37, #075c53 58%, #087d71); }
:root[data-theme="dark"] .member-home-ring::before { background: #083c37; }

@media (max-width: 1100px) {
  .member-home-week-grid,
  .member-home-medal-layout,
  .member-home-character { grid-template-columns: 1fr; }
  .member-home-summary-card { padding: 24px; }
  .member-home-metrics { grid-template-columns: repeat(3, 1fr); }
  .member-home-metrics > div { display: grid; justify-content: stretch; }
  .member-home-character-current { min-height: 0; }
  .member-home-character-current img { height: 390px; }
}

@media (max-width: 720px) {
  .member-home { gap: 16px; }
  .member-home-head,
  .member-home-section-head { display: grid; gap: 12px; }
  .member-home-overview-link { width: 100%; margin: 0; }
  .member-home-week-card { grid-template-columns: 1fr; min-height: 0; padding: 26px 22px; gap: 28px; }
  .member-home-week-copy h2 { font-size: 28px; }
  .member-home-primary-link { width: 100%; margin-top: 24px; }
  .member-home-ring { width: 142px; height: 142px; }
  .member-home-metrics,
  .member-home-trend-grid,
  .member-home-character-options { grid-template-columns: 1fr; }
  .member-home-honors,
  .member-home-trends,
  .member-home-character-copy { padding: 20px; }
  .member-home-season-cutoff { justify-items: start; text-align: left; }
  .member-home-season-medal { min-height: 270px; }
  .member-home-medal-row { grid-template-columns: 58px minmax(0, 1fr); gap: 11px; padding: 16px; }
  .member-home-medal-icon { width: 56px; }
  .member-home-medal-row em { grid-column: 2; justify-self: start; }
  .member-home-character-current { min-height: 0; padding: 20px; }
  .member-home-character-current img { height: 330px; }
  .member-home-character-options img { height: 300px; }
  .member-home-bars { gap: 4px; height: 230px; }
  .member-home-bars em { font-size: 9px; }
}

@media print {
  .member-home-overview-link { display: none; }
  .member-home-week-card,
  .member-home-summary-card,
  .member-home-honors,
  .member-home-character,
  .member-home-trends { break-inside: avoid; box-shadow: none; }
}

/* Global action feedback: option A, top-center toast. */
.action-feedback {
  position: fixed;
  z-index: 1200;
  top: 18px;
  left: 50%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 28px;
  align-items: center;
  width: min(430px, calc(100vw - 32px));
  min-height: 66px;
  padding: 10px 12px;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 14px 36px rgba(22, 31, 37, .18);
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: opacity .18s ease, transform .18s ease;
}

.action-feedback[hidden] { display: none; }
.action-feedback.is-visible { opacity: 1; transform: translate(-50%, 0); }
.action-feedback.is-success { border-color: rgba(0, 171, 149, .48); }
.action-feedback.is-error { border-color: rgba(210, 61, 61, .52); }

.action-feedback-icon {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 171, 149, .13);
  color: var(--brand);
}

.action-feedback.is-success .action-feedback-icon::before {
  content: "";
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.action-feedback.is-error .action-feedback-icon {
  background: rgba(210, 61, 61, .12);
  color: #d23d3d;
}

.action-feedback.is-error .action-feedback-icon::before,
.action-feedback.is-error .action-feedback-icon::after,
.action-feedback-close::before,
.action-feedback-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
}

.action-feedback.is-error .action-feedback-icon::before,
.action-feedback-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.action-feedback.is-error .action-feedback-icon::after,
.action-feedback-close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.action-feedback-copy { display: grid; min-width: 0; gap: 2px; }
.action-feedback-copy strong { font-size: 14px; line-height: 1.35; }
.action-feedback-copy > span { color: var(--muted); font-size: 12px; line-height: 1.45; }

.action-feedback-close {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.action-feedback-close:hover { background: var(--surface); color: var(--text); }

@media (max-width: 600px) {
  .action-feedback { top: 12px; width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  .action-feedback { transition: none; }
}

.upload-progress-open { overflow: hidden; }

.upload-progress-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 15, 14, .56);
  backdrop-filter: blur(6px);
}

.upload-progress-modal[hidden] { display: none; }

.upload-progress-panel {
  display: grid;
  width: min(440px, 100%);
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--panel);
  color: var(--heading);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  outline: none;
}

.upload-progress-symbol {
  width: 38px;
  height: 38px;
  border: 4px solid color-mix(in srgb, var(--brand) 18%, var(--rule));
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: upload-progress-spin .8s linear infinite;
}

.upload-progress-modal.is-error .upload-progress-symbol {
  position: relative;
  border: 0;
  background: color-mix(in srgb, #d23d3d 12%, var(--panel));
  animation: none;
}

.upload-progress-modal.is-error .upload-progress-symbol::before,
.upload-progress-modal.is-error .upload-progress-symbol::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: #d23d3d;
}

.upload-progress-modal.is-error .upload-progress-symbol::before { transform: translate(-50%, -50%) rotate(45deg); }
.upload-progress-modal.is-error .upload-progress-symbol::after { transform: translate(-50%, -50%) rotate(-45deg); }

.upload-progress-copy { display: grid; gap: 4px; }
.upload-progress-copy h2 { margin: 0; color: var(--heading); font-size: 20px; line-height: 1.3; }
.upload-progress-copy p { color: var(--copy); font-size: 13px; line-height: 1.5; }

.upload-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-soft);
}

.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .18s ease;
}

.upload-progress-modal.is-processing .upload-progress-track span {
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 52%, #fff), var(--brand));
  background-size: 200% 100%;
  animation: upload-progress-saving 1.1s linear infinite;
}

.upload-progress-modal.is-error .upload-progress-track span { background: #d23d3d; }
.upload-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--copy); font-size: 12px; }
.upload-progress-meta strong { color: var(--heading); font-size: 14px; }
.upload-progress-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.upload-progress-actions button { min-width: 92px; }

@keyframes upload-progress-spin { to { transform: rotate(360deg); } }
@keyframes upload-progress-saving { to { background-position: -200% 0; } }

@media (max-width: 640px) {
  .file-upload-dropzone { min-height: 126px; padding: 18px 12px; }
  .file-upload-row { grid-template-columns: 36px minmax(0, 1fr) 28px; padding-inline: 9px; }
  .upload-progress-modal { align-items: end; padding: 12px; }
  .upload-progress-panel { padding: 20px; border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .upload-progress-symbol,
  .upload-progress-modal.is-processing .upload-progress-track span { animation: none; }
  .upload-progress-track span { transition: none; }
}

.topbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--brand-ink);
  color: #fff;
  border-bottom: 3px solid var(--brand-accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.brand img {
  width: 112px;
  height: 34px;
  object-fit: cover;
  object-position: left center;
  border-radius: 4px;
}

.brand span {
  letter-spacing: 0;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

nav a {
  color: #d9e5e8;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
}

nav a.active,
nav a:hover {
  background: rgba(18, 200, 178, 0.14);
  border-color: rgba(18, 200, 178, 0.38);
  color: #fff;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

h1,
h2 {
  margin: 0 0 10px;
}

p {
  margin: 0;
  color: var(--muted);
}

.toolbar,
.form-panel,
section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(53, 47, 63, 0.04);
}

.toolbar,
.form-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.range-toolbar {
  grid-template-columns: minmax(110px, .55fr) minmax(300px, 1.45fr) repeat(auto-fit, minmax(150px, 1fr));
}

.range-toolbar .period-picker {
  min-width: 0;
}

.range-toolbar .period-anchor-control {
  min-width: 300px;
}

.form-panel .wide {
  grid-column: span 2;
}

[hidden] {
  display: none !important;
}

label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 13px;
}

.range-hint {
  color: var(--brand-accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.range-date-field {
  display: grid;
  width: 100%;
}

.range-date-field input {
  width: 100%;
}

.range-date-field.has-range {
  position: relative;
  display: block;
  height: 36px;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  padding: 0 42px 0 10px;
}

.range-date-field.has-range:focus-within {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(18, 200, 178, 0.16);
}

.range-date-field.has-range input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  box-shadow: none;
  padding: 0;
}

.range-date-field.has-range input:focus {
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

.range-date-field.has-range .range-hint {
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.range-calendar-button {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 34px;
  border-left: 1px solid #e2e8f0;
  background:
    linear-gradient(#1f2933, #1f2933) 50% 62% / 12px 2px no-repeat,
    linear-gradient(#1f2933, #1f2933) 50% 42% / 12px 2px no-repeat,
    linear-gradient(90deg, #1f2933 2px, transparent 2px, transparent 10px, #1f2933 10px) 50% 33% / 12px 4px no-repeat;
  opacity: .82;
  pointer-events: none;
}

.range-date-field.has-range:focus-within .range-calendar-button {
  border-left-color: rgba(18, 200, 178, 0.34);
  opacity: 1;
}

input,
select,
button {
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
}

input:focus,
select:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(18, 200, 178, 0.16);
  outline: none;
}

button {
  border-color: var(--brand-accent-dark);
  background: var(--brand-accent-dark);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: #087f72;
}

button[formaction="/sync"] {
  border-color: var(--brand-ink);
  background: var(--brand-ink);
}

.danger-button {
  height: 28px;
  border-color: #dc2626;
  background: #dc2626;
  padding: 0 8px;
  font-size: 12px;
}

.danger-button:hover {
  background: #b91c1c;
}

.inline-sync {
  margin: 0;
}

.inline-action {
  display: inline;
  margin: 0;
}

.manual-history-row {
  cursor: pointer;
}

.manual-history-row:hover {
  background: #f4fbfa;
}

.compact-panel {
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) auto;
}

.notice {
  border: 1px solid #fca5a5;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 14px;
}

.status {
  display: inline-block;
  min-width: 82px;
  border-radius: 999px;
  padding: 3px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.status-queued {
  background: #f0fdfa;
  color: #0f766e;
}

.status-running {
  background: #eef2ff;
  color: #4338ca;
}

.status-succeeded {
  background: #ecfdf5;
  color: #047857;
}

.status-failed,
.status-needs_login {
  background: #fef2f2;
  color: #b91c1c;
}

.muted-tag {
  display: inline-block;
  margin-left: 6px;
  border-radius: 999px;
  background: #eef7f6;
  color: #0f766e;
  padding: 2px 6px;
  font-size: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-accent);
  border-radius: 8px;
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  color: var(--brand-ink);
}

.current-member-row td {
  background: color-mix(in srgb, var(--brand-accent) 12%, var(--surface));
}

.current-member-row td:first-child {
  box-shadow: inset 3px 0 0 var(--brand-accent);
}

.current-member-row td:nth-child(2) {
  color: var(--brand-ink);
  font-weight: 700;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  background: transparent;
  border: 0;
  padding: 0;
}

.grid-two > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.stack-form button {
  width: max-content;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.secondary-action,
.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--brand-ink);
  background: #f8fbfb;
  padding: 0 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.secondary-action:hover,
.table-action:hover {
  border-color: rgba(18, 200, 178, 0.48);
  color: var(--brand-accent-dark);
}

.form-note {
  color: var(--muted);
  font-size: 12px;
}

.member-multi-picker {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.member-multi-picker legend {
  padding: 0 4px;
  font-weight: 600;
}

.member-multi-picker-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px 12px;
  max-height: 190px;
  overflow-y: auto;
}

.member-multi-picker-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin: 0;
  cursor: pointer;
}

.member-multi-picker-options input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand-accent);
}

.member-multi-picker .form-note {
  margin: 8px 0 0;
}

.activity-file-grid {
  display: grid;
  align-items: start;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.activity-file-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.activity-file-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.activity-file-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-preview-image,
.activity-preview-media,
.activity-preview-doc {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fbfb;
}

.activity-preview-frame {
  position: relative;
  height: clamp(200px, 15vw, 240px);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fbfb;
  overflow: hidden;
}

.activity-preview-frame .activity-preview-image,
.activity-preview-frame .activity-preview-media {
  height: 100%;
  border: 0;
  border-radius: 0;
  object-fit: contain;
}

.activity-preview-trigger {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: zoom-in;
}

.activity-preview-trigger:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 3px;
}

.activity-preview-audio {
  width: 100%;
}

.activity-preview-doc {
  min-height: 360px;
}

.activity-preview-fallback {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fbfb;
  padding: 20px;
  text-align: center;
}

.activity-preview-fallback span {
  color: var(--brand-ink);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-album-grid {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

.activity-album-groups { display: grid; gap: 0; }
.activity-album-group { border-top: 1px solid var(--rule); }
.activity-album-group:last-child { border-bottom: 1px solid var(--rule); }
.activity-album-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px 2px;
  gap: 16px;
  color: var(--heading);
  cursor: pointer;
  list-style: none;
}
.activity-album-group > summary::-webkit-details-marker { display: none; }
.activity-album-group > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.activity-album-group-title { display: grid; min-width: 0; gap: 4px; }
.activity-album-group-title strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.activity-album-group-title small { color: var(--copy); font-size: 11px; }
.activity-album-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; color: var(--brand); font-size: 12px; font-weight: 700; }
.activity-album-toggle::before { content: "收起"; }
.activity-album-toggle::after { content: "⌃"; font-size: 15px; line-height: 1; }
.activity-album-group:not([open]) .activity-album-toggle::before { content: "展开"; }
.activity-album-group:not([open]) .activity-album-toggle::after { content: "⌄"; }
.activity-album-group[open] > .activity-album-grid { padding: 2px 0 18px; }
.activity-album-more-row { display: flex; justify-content: center; padding: 0 0 18px; }

.activity-list-ledger { display: grid; overflow: hidden; border: 1px solid var(--rule); border-radius: 14px; background: var(--panel); }
.activity-ledger-event { position: relative; border-bottom: 1px solid var(--rule); background: var(--panel); }
.activity-ledger-event:last-child { border-bottom: 0; }
.activity-ledger-event > summary { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto 10px; align-items: center; gap: 18px; min-height: 88px; padding: 14px 20px; cursor: pointer; list-style: none; }
.activity-ledger-event > summary::-webkit-details-marker,
.activity-ledger-more > summary::-webkit-details-marker { display: none; }
.activity-ledger-event > summary:focus-visible,
.activity-ledger-more > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.activity-ledger-event[open] > summary { background: var(--panel-soft); }
.activity-ledger-date { display: grid; place-items: center; min-height: 58px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.activity-ledger-date strong { font-size: 20px; line-height: 1; }
.activity-ledger-date small { margin-top: 5px; font-size: 10px; }
.activity-ledger-summary-copy { display: grid; min-width: 0; gap: 5px; }
.activity-ledger-summary-copy > strong { color: var(--heading); font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.activity-ledger-summary-copy > small,
.activity-ledger-count { color: var(--copy); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.activity-ledger-count { min-width: 72px; text-align: right; }
.activity-ledger-toggle { width: 9px; height: 9px; border-right: 2px solid var(--copy); border-bottom: 2px solid var(--copy); transform: rotate(45deg); transition: transform .18s ease; }
.activity-ledger-event[open] > summary .activity-ledger-toggle { transform: rotate(225deg); }
.activity-ledger-body { display: grid; gap: 18px; padding: 4px 20px 20px 108px; }
.activity-ledger-body dl { display: grid; grid-template-columns: 1.35fr 1fr 1fr .65fr; gap: 20px; margin: 0; }
.activity-ledger-field { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-content: start; align-items: start; gap: 10px; min-width: 0; }
.activity-ledger-field-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.activity-ledger-field-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.activity-ledger-field-copy { display: grid; min-width: 0; gap: 3px; }
.activity-ledger-body dt,
.activity-ledger-body dd { margin: 0; font-size: 12px; line-height: 1.5; }
.activity-ledger-body dt { color: var(--copy); }
.activity-ledger-body dd { color: var(--heading); overflow-wrap: anywhere; }
.activity-ledger-actions { position: relative; display: flex; justify-content: flex-end; gap: 8px; }
.activity-ledger-actions > .table-action,
.activity-ledger-more > summary { min-height: 38px; }
.activity-ledger-actions > .activity-ledger-view { border-color: transparent; background: var(--brand); color: #fff; }
.activity-ledger-more > summary { display: grid; place-items: center; width: 40px; border: 1px solid var(--rule); border-radius: 7px; background: var(--panel-soft); color: var(--heading); cursor: pointer; font-size: 15px; letter-spacing: 1px; list-style: none; }
.activity-ledger-more-panel { position: absolute; right: 0; bottom: 46px; z-index: 4; display: grid; gap: 7px; min-width: 138px; padding: 8px; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.activity-ledger-more-panel form { margin: 0; }
.activity-ledger-more-panel button { width: 100%; min-height: 36px; }

@media (max-width: 760px) {
  .activity-list-ledger { gap: 10px; overflow: visible; border: 0; background: transparent; }
  .activity-ledger-event { border: 1px solid var(--rule); border-radius: 14px; }
  .activity-ledger-event:last-child { border-bottom: 1px solid var(--rule); }
  .activity-ledger-event > summary { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 11px; min-height: 74px; padding: 12px; }
  .activity-ledger-date { min-height: 48px; border-radius: 11px; }
  .activity-ledger-date strong { font-size: 18px; }
  .activity-ledger-date small { margin-top: 3px; font-size: 9px; }
  .activity-ledger-summary-copy > strong { font-size: 14px; }
  .activity-ledger-summary-copy > small { font-size: 11px; }
  .activity-ledger-count { display: none; }
  .activity-ledger-body { gap: 13px; padding: 0 12px 12px 67px; }
  .activity-ledger-body dl { grid-template-columns: 1fr; gap: 8px; padding-top: 2px; }
  .activity-ledger-field { grid-template-columns: 28px minmax(0, 1fr); gap: 9px; }
  .activity-ledger-field-icon { width: 28px; height: 28px; border-radius: 8px; }
  .activity-ledger-field-icon svg { width: 15px; height: 15px; }
  .activity-ledger-field-copy { grid-template-columns: 66px minmax(0, 1fr); gap: 8px; }
  .activity-ledger-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; }
  .activity-ledger-actions > .table-action,
  .activity-ledger-more > summary { min-height: 40px; }
  .activity-ledger-actions > .activity-ledger-view { width: 100%; }
  .activity-ledger-more-panel { bottom: 48px; }
}

@media (max-width: 420px) {
  .activity-ledger-body { padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .activity-ledger-toggle { transition: none; }
}

@media (max-width: 640px) {
  .activity-album-group > summary { min-height: 62px; }
  .activity-album-group-title strong { font-size: 15px; }
}

.activity-album-item {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: #111827;
  padding: 0;
  cursor: pointer;
}

.activity-album-item[hidden] { display: none; }

.activity-album-item:hover,
.activity-album-item:focus-visible {
  outline: 3px solid rgba(18, 200, 178, 0.5);
  outline-offset: -3px;
}

.activity-album-item img,
.activity-album-item video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity-album-item > span:not(.activity-video-mark) {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  padding: 18px 8px 7px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-video-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
}

.activity-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: block;
  padding: 54px 24px 24px;
  background: rgba(15, 23, 42, 0.92);
}

.activity-lightbox[hidden] {
  display: none;
}

.activity-detail-lightbox {
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
}

.activity-detail-lightbox:not([hidden]) {
  display: grid;
}

.activity-detail-lightbox .activity-lightbox-stage {
  height: 100%;
  overflow: hidden;
}

.activity-detail-lightbox .activity-lightbox-stage video.activity-maximized-video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
}

html.activity-preview-open { overflow: hidden; overscroll-behavior: none; }
body.activity-preview-open {
  position: fixed;
  right: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
.activity-lightbox-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  width: min(1480px, 100%);
  height: calc(100vh - 78px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #080d0c;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
}
.activity-gallery-lightbox:not(.activity-media-fullscreen) {
  padding: 42px 16px 16px;
}
.activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-lightbox-layout {
  grid-template-columns: minmax(0, 1fr) clamp(280px, 17vw, 320px);
  width: min(1840px, 100%);
  height: calc(100vh - 58px);
}
.activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-lightbox-media-pane {
  padding: 14px;
}
.activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-interaction-comments {
  padding: 10px 22px;
}
.activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-comment-form {
  padding: 14px 22px 20px;
}
.activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-comment-compose textarea {
  min-height: 86px;
}
.activity-lightbox-media-pane { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; padding: 20px; }
.activity-media-nav { display: none; }
.activity-lightbox-stage {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
}

.activity-lightbox-stage.activity-zoom-stage {
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

.activity-lightbox-stage img,
.activity-lightbox-stage video {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

.activity-lightbox-stage img.activity-zoomable {
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.activity-lightbox-close {
  position: absolute;
  z-index: 10005;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  top: 14px;
  right: 18px;
  min-width: 88px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.activity-gallery-lightbox.activity-media-fullscreen { padding: 0; background: #000; }
.activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-layout {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-media-pane {
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
}
.activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-stage {
  width: 100%;
  height: 100%;
  place-items: center;
}
.activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-stage img.activity-zoomable,
.activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-stage video.activity-gallery-video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  place-self: center;
  border-radius: 0;
  object-fit: contain;
  object-position: center center;
  box-shadow: none;
  transform-origin: center center;
}
.activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-stage video.activity-gallery-video {
  background: #000;
}
@media (min-width: 901px) {
  .activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-media-nav:not([hidden]) {
    position: absolute;
    z-index: 4;
    top: 50%;
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    background: rgba(8, 13, 12, 0.72);
    color: #fff;
    line-height: 0;
    transform: translateY(-50%);
    backdrop-filter: blur(10px);
  }
  .activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-media-nav-prev { left: 18px; }
  .activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-media-nav-next { right: 18px; }
  .activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-media-nav:hover:not(:disabled) {
    background: rgba(0, 176, 148, 0.88);
  }
  .activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-media-nav:disabled {
    cursor: not-allowed;
    opacity: 0.28;
  }
  .activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-lightbox-stage img.activity-zoomable {
    cursor: zoom-in;
  }
  .activity-gallery-lightbox.activity-media-zoomed:not(.activity-media-fullscreen) .activity-lightbox-stage img.activity-zoomable {
    cursor: grab;
  }
  .activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-stage {
    position: relative;
    isolation: isolate;
    overflow: hidden;
  }
  .activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-stage::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: -36px;
    background: var(--activity-media-backdrop, #000) center / cover no-repeat;
    filter: blur(24px) brightness(0.34) saturate(0.82);
    transform: scale(1.06);
  }
  .activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-stage img.activity-zoomable {
    position: relative;
    z-index: 1;
    width: min(88vw, 1680px);
    height: min(88vh, 1080px);
  }
  .activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-stage video.activity-gallery-video {
    position: relative;
    z-index: 1;
    width: min(88vw, 1600px);
    height: min(86vh, 960px);
    background: transparent;
  }
}
.activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-caption { display: none; }
.activity-gallery-lightbox.activity-media-fullscreen .activity-interaction-drawer { display: none; }

.activity-lightbox-caption {
  max-width: min(900px, 92vw);
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-interaction-drawer { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: var(--surface); color: var(--copy); }
.activity-interaction-drawer > header { display: flex; align-items: center; justify-content: space-between; min-height: 70px; padding: 14px 16px; gap: 12px; border-bottom: 1px solid var(--rule); }
.activity-interaction-drawer > header > div { display: grid; gap: 2px; }
.activity-interaction-drawer > header span { color: var(--brand); font-size: 11px; font-weight: 700; }
.activity-interaction-drawer > header strong { color: var(--heading); font-size: 16px; }
.activity-drawer-close { display: none; min-height: 32px; padding: 5px 9px; border-color: var(--border); background: var(--surface-muted); color: var(--copy); }
.activity-interaction-comments { min-height: 0; padding: 6px 16px; overflow-y: auto; overscroll-behavior: contain; }
.activity-interaction-state { margin: 26px 0; color: var(--muted); font-size: 13px; text-align: center; }
.activity-interaction-state.error, .activity-comment-error { color: var(--danger); }
.activity-media-comment { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; padding: 12px 0; border-bottom: 1px solid var(--rule); scroll-margin: 20px; }
.activity-media-comment.targeted { margin: 0 -8px; padding-right: 8px; padding-left: 8px; border-radius: 6px; background: var(--brand-soft); }
.activity-media-comment-body { min-width: 0; }
.activity-media-comment-body > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.activity-media-comment-body strong { overflow: hidden; color: var(--heading); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.activity-media-comment-body time { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.activity-media-comment-body p { margin: 4px 0 0; color: var(--copy); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.activity-comment-mentions { display: block; margin-top: 5px; color: var(--brand); font-size: 11px; }
.activity-comment-delete { min-height: 26px; margin-top: 4px; padding: 3px 0; border: 0; background: transparent; color: var(--danger); font-size: 10px; box-shadow: none; }
.activity-comment-form { position: relative; padding: 12px 16px 16px; border-top: 1px solid var(--rule); background: var(--surface); }
.activity-comment-compose { position: relative; }
.activity-comment-compose textarea { width: 100%; min-height: 64px; margin: 0; resize: vertical; }
.activity-comment-compose > div { display: flex; justify-content: space-between; margin-top: 8px; gap: 8px; }
.activity-comment-compose button { min-height: 34px; padding: 6px 12px; }
.activity-comment-at { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--rule); border-radius: 50%; background: var(--surface-muted); color: var(--brand); font-size: 16px; font-weight: 800; }
.activity-comment-error { margin: 7px 0 0; font-size: 11px; }
.activity-mention-picker { position: absolute; z-index: 4; right: 0; bottom: calc(100% + 7px); left: 0; max-height: 190px; margin: 0; overflow-y: auto; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }
.activity-mention-picker > div { display: grid; }
.activity-mention-option { display: flex; align-items: center; justify-content: flex-start; min-height: 38px; padding: 7px 11px; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: transparent; color: var(--copy); font-size: 12px; box-shadow: none; }
.activity-mention-option:hover, .activity-mention-option:focus-visible { background: var(--brand-soft); color: var(--brand-strong); }
.activity-mention-empty { margin: 0; padding: 12px; color: var(--muted); font-size: 12px; text-align: center; }
.activity-inline-mention { color: var(--brand-strong); font-weight: 700; }

.flat-form {
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.target-manager {
  border-top: 3px solid var(--brand-accent);
}

.target-form {
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.target-history-toggle {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbfb;
}

.target-history-toggle summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--brand-ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.target-history-toggle summary::-webkit-details-marker {
  display: none;
}

.target-history-toggle summary::after {
  color: var(--brand-accent-dark);
  content: "展开";
  font-weight: 700;
}

.target-history-toggle[open] summary {
  border-bottom: 1px solid var(--border);
}

.target-history-toggle[open] summary::after {
  content: "收起";
}

.target-history-toggle summary span {
  color: var(--muted);
  font-weight: 400;
  margin-left: auto;
}

.target-history {
  overflow: auto;
  padding: 8px 12px 12px;
}

.finance-board {
  border-top: 3px solid var(--brand-accent);
}

.finance-metrics {
  margin-bottom: 12px;
}

.donation-panel > .metric-grid {
  margin-bottom: 12px;
}

.table-scroll {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #475569;
  background: #f4fbfa;
  font-weight: 700;
}

.rank-badge,
.rank-plain {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
}

.rank-badge {
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(53, 47, 63, 0.16);
}

.rank-1 {
  background: linear-gradient(135deg, #f7c948, #d97706);
}

.rank-2 {
  background: linear-gradient(135deg, #cbd5e1, #64748b);
}

.rank-3 {
  background: linear-gradient(135deg, #d99058, #92400e);
}

.rank-plain {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    padding: 12px 16px;
  }

  .brand img {
    width: 96px;
    height: 30px;
  }

  .grid-two {
    grid-template-columns: 1fr;
  }

  .form-panel .wide {
    grid-column: span 1;
  }
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-actions form {
  margin: 0;
}


/* Global Apple-inspired theme system. Business templates keep their existing structure. */
:root {
  color-scheme: light;
  --brand-ink: #15211f;
  --brand-splash: #15211f;
  --brand-ink-soft: #243330;
  --brand-accent: #0bb89f;
  --brand-accent-dark: #078c7b;
  --page-bg: #f4f5f6;
  --surface: #ffffff;
  --surface-muted: #f8f9f9;
  --surface-hover: #f1f5f4;
  --border: #dce2e1;
  --border-strong: #cbd4d1;
  --text: #17201f;
  --muted: #667471;
  --topbar-bg: rgba(255, 255, 255, .84);
  --topbar-text: #182220;
  --topbar-link: #52605d;
  --shadow: 0 1px 2px rgba(21, 33, 31, .04), 0 8px 24px rgba(21, 33, 31, .045);
  --field-bg: #ffffff;
  --table-head: #f6f8f7;
  --notice-bg: #fef2f2;
  --notice-text: #a12424;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-ink: #eff8f6;
  --brand-splash: #0e1716;
  --brand-ink-soft: #dbe8e4;
  --brand-accent: #25d5bd;
  --brand-accent-dark: #18ae9b;
  --page-bg: #101716;
  --surface: #182220;
  --surface-muted: #202c29;
  --surface-hover: #24312e;
  --border: #31413d;
  --border-strong: #465854;
  --text: #edf5f2;
  --muted: #9eafaa;
  --topbar-bg: rgba(17, 25, 23, .86);
  --topbar-text: #f5fbf9;
  --topbar-link: #b4c5bf;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 12px 32px rgba(0, 0, 0, .18);
  --field-bg: #1d2926;
  --table-head: #202c29;
  --notice-bg: #3b2021;
  --notice-text: #fecaca;
}

.upcoming-study-hero {
  position: relative;
  display: flex;
  min-height: 184px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 32px 30px;
  border: 1px solid #263936;
  border-radius: 8px;
  background: linear-gradient(115deg, #101a18 0%, #172421 76%);
  color: #f3faf8;
  box-shadow: 0 14px 30px rgba(18, 29, 27, .16);
}

.upcoming-study-hero::after {
  content: attr(data-month);
  position: absolute;
  top: -34px;
  right: 26px;
  color: rgba(60, 213, 191, .15);
  font-size: 180px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.upcoming-study-copy,
.upcoming-study-link { position: relative; z-index: 1; }
.upcoming-study-link { align-self: flex-end; }
.upcoming-study-label { display: block; color: #72e6d3; font-size: 12px; font-weight: 800; }
.upcoming-study-copy h2 { max-width: 860px; margin: 12px 0 0; color: inherit; font-size: 27px; line-height: 1.25; }
.upcoming-study-copy p { margin: 8px 0 0; color: #b9c9c5; font-size: 13px; }
.upcoming-study-link { flex: 0 0 auto; padding: 9px 12px; border: 1px solid rgba(114, 230, 211, .28); border-radius: 6px; background: rgba(60, 213, 191, .1); color: #8aebdb; font-size: 13px; font-weight: 800; text-decoration: none; }
.upcoming-study-link:hover { border-color: #72e6d3; color: #a8f4e8; }

:root[data-theme="dark"] .upcoming-study-hero {
  border-color: #b9ded7;
  background: linear-gradient(115deg, #e8f8f4 0%, #ffffff 76%);
  color: #13201e;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .24);
}
:root[data-theme="dark"] .upcoming-study-hero::after { color: rgba(0, 169, 143, .12); }
:root[data-theme="dark"] .upcoming-study-label { color: #087f70; }
:root[data-theme="dark"] .upcoming-study-copy p { color: #596864; }
:root[data-theme="dark"] .upcoming-study-link { border-color: #88cfc2; background: #e5f7f3; color: #087f70; }
:root[data-theme="dark"] .upcoming-study-link:hover { border-color: #087f70; color: #05695e; }

@media (max-width: 700px) {
  .upcoming-study-hero { min-height: 190px; align-items: flex-start; flex-direction: column; padding: 22px 20px; }
  .upcoming-study-hero::after { top: -6px; right: 12px; font-size: 126px; }
  .upcoming-study-copy h2 { max-width: calc(100% - 48px); font-size: 22px; }
  .upcoming-study-link { align-self: flex-start; margin-top: auto; }
}

body {
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
  transition: background-color .2s ease, color .2s ease;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 64px;
  padding: 0 32px;
  background: var(--topbar-bg);
  color: var(--topbar-text);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(18px);
}

nav a {
  color: var(--topbar-link);
  border-radius: 7px;
}

nav a.active,
nav a:hover {
  background: color-mix(in srgb, var(--brand-accent) 13%, transparent);
  border-color: color-mix(in srgb, var(--brand-accent) 34%, transparent);
  color: var(--topbar-text);
}

.theme-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  height: 32px;
  margin-left: 16px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.theme-toggle:hover { background: var(--surface-hover); }

.theme-toggle-icon {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: -4px -2px 0 -2px var(--surface-muted);
}

:root[data-theme="dark"] .theme-toggle-icon {
  border-radius: 50% 50% 50% 0;
  transform: rotate(-28deg);
}

.page {
  max-width: 1280px;
  padding: 28px 32px 40px;
}

.toolbar,
.form-panel,
section {
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow);
}

label { color: var(--muted); }

.range-date-field.has-range {
  border-color: var(--border-strong);
  border-radius: 7px;
  background: var(--field-bg);
}

.range-calendar-button {
  border-left-color: var(--border);
  background:
    linear-gradient(var(--text), var(--text)) 50% 62% / 12px 2px no-repeat,
    linear-gradient(var(--text), var(--text)) 50% 42% / 12px 2px no-repeat,
    linear-gradient(90deg, var(--text) 2px, transparent 2px, transparent 10px, var(--text) 10px) 50% 33% / 12px 4px no-repeat;
}

input,
select,
button {
  border-color: var(--border-strong);
  border-radius: 7px;
  background: var(--field-bg);
  color: var(--text);
}

button { background: var(--brand-accent-dark); }

.notice {
  border-color: color-mix(in srgb, var(--notice-text) 38%, transparent);
  border-radius: 10px;
  background: var(--notice-bg);
  color: var(--notice-text);
}

.metric {
  border-left-width: 3px;
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.grid-two > div {
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.secondary-action,
.table-action {
  border-radius: 7px;
  color: var(--brand-ink);
  background: var(--surface-muted);
}

.activity-file-card {
  border-radius: 10px;
  background: var(--surface-muted);
}

.activity-preview-image,
.activity-preview-media,
.activity-preview-doc,
.activity-preview-fallback {
  border-radius: 7px;
  background: var(--surface-muted);
}

.activity-preview-fallback { border-color: var(--border-strong); }

th {
  color: var(--muted);
  background: var(--table-head);
}

.target-history-toggle { background: var(--surface-muted); }

@media (max-width: 760px) {
  .topbar { padding: 10px 16px; }
  .page { padding: 20px 16px 32px; }
  .theme-toggle { margin-left: 0; }

  .range-toolbar,
  .toolbar,
  .form-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .range-toolbar .period-anchor-control,
  .form-panel .wide {
    min-width: 0;
    grid-column: auto;
  }

  section,
  .grid-two > div {
    min-width: 0;
  }

  section:not(.grid-two),
  .grid-two > div {
    overflow-x: auto;
  }

  .login-a-page .login-a-brand {
    overflow: hidden;
  }

  table {
    width: max-content;
    min-width: 100%;
  }

  th,
  td {
    white-space: nowrap;
  }
}

/* A/C concept implementation: one operational layout, two color schemes. */
:root {
  --sidebar-width: 232px;
  --canvas: #f5f5f7;
  --panel: #ffffff;
  --panel-soft: #f8f9fa;
  --rule: #e4e5e7;
  --brand: #00a98f;
  --brand-soft: #e8f8f4;
  --heading: #1d1d1f;
  --copy: #60646c;
  --control: #ffffff;
  --table-row: #fbfbfc;
  --button-text: #ffffff;
  --sidebar: #ffffff;
}

:root[data-theme="dark"] {
  --canvas: #111817;
  --panel: #192321;
  --panel-soft: #202d2a;
  --rule: #34423e;
  --brand: #3cd5bf;
  --brand-soft: #173f38;
  --heading: #f2f7f5;
  --copy: #aab8b4;
  --control: #202d2a;
  --table-row: #1d2926;
  --button-text: #0a2924;
  --sidebar: #101716;
}

html,
body { min-height: 100%; background: var(--canvas); }

body {
  background: var(--canvas);
  color: var(--heading);
  font-family: "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

.app-shell { min-height: 100vh; }

.topbar {
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: var(--sidebar-width);
  min-height: 100vh;
  padding: 20px 14px 16px;
  background: var(--sidebar);
  border: 0;
  border-right: 1px solid var(--rule);
  box-shadow: none;
  backdrop-filter: none;
}

.brand {
  gap: 10px;
  padding: 4px 8px 22px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: #11bfa5;
  color: #052b27;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.brand-title {
  color: var(--heading);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.topbar nav { display: grid; gap: 3px; width: 100%; margin: 0; }
.topbar nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--copy);
  font-size: 14px;
  font-weight: 600;
}

.topbar nav a:hover,
.topbar nav a.active {
  border-color: transparent;
  background: var(--brand-soft);
  color: var(--brand);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid var(--rule);
  color: var(--copy);
  font-size: 12px;
}

.theme-toggle {
  justify-content: center;
  width: 100%;
  height: 34px;
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--heading);
  box-shadow: none;
}

.theme-toggle:hover { background: var(--brand-soft); color: var(--brand); }
.theme-toggle-icon { width: 13px; height: 13px; }

.page {
  max-width: none;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 34px 42px 48px;
  background: var(--canvas);
}

.section-head {
  display: flex;
  align-items: end;
  min-height: 76px;
  margin: 0 0 20px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

h1, h2, h3 { color: var(--heading); letter-spacing: 0; }
h1 { margin: 0; font-size: 28px; line-height: 1.2; }
h2 { margin: 0 0 4px; font-size: 16px; line-height: 1.35; }
p, .subtle, label { color: var(--copy); }
.section-head p { margin: 7px 0 0; font-size: 13px; }

section,
.toolbar,
.form-panel,
.year-overview,
.target-manager {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.year-overview { padding-bottom: 18px; }
.section-title-row { margin-bottom: 16px; }
.section-title-row p { margin: 3px 0 0; font-size: 13px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.metric span { color: var(--copy); font-size: 13px; font-weight: 600; }
.metric strong { margin-top: 10px; color: var(--heading); font-size: 27px; line-height: 1; }

.week-target-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.week-target-panel span {
  color: var(--copy);
  font-size: 14px;
  font-weight: 700;
}

.week-target-panel strong {
  color: var(--brand-ink);
  font-size: 28px;
  line-height: 1;
}

.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 0; border: 0; background: transparent; }
.grid-two > div { padding: 20px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); box-shadow: none; }
.grid-two.grid-one { grid-template-columns: minmax(0, 1fr); }

input,
select,
textarea,
button,
.range-date-field.has-range {
  min-height: 36px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--control);
  color: var(--heading);
  box-shadow: none;
}

input:focus,
select:focus,
textarea:focus { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 20%, transparent); }

button,
.button,
.primary-action {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--button-text);
  font-weight: 700;
}

button:hover,
.button:hover,
.primary-action:hover { filter: brightness(.96); }

.secondary-action,
.table-action,
.target-history-toggle {
  border-color: var(--rule);
  background: var(--panel-soft);
  color: var(--heading);
}

table { width: 100%; border-collapse: collapse; }
th {
  padding: 11px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--panel-soft);
  color: var(--copy);
  font-size: 12px;
  font-weight: 700;
}
td { padding: 13px 12px; border-bottom: 1px solid var(--rule); color: var(--heading); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--table-row); }

.status,
.tag,
.rank-badge { border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.notice { border-radius: 8px; box-shadow: none; }

@media (max-width: 900px) {
  .topbar { position: static; width: auto; min-height: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .brand { padding: 0 0 10px; }
  .topbar nav { grid-auto-flow: column; grid-auto-columns: max-content; display: grid; overflow-x: auto; padding-bottom: 8px; }
  .topbar nav a { min-height: 34px; white-space: nowrap; }
  .sidebar-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 0; }
  .theme-toggle { width: auto; padding: 0 10px; }
  .page { margin-left: 0; padding: 24px 20px 36px; }
  .section-head { align-items: flex-start; text-align: left; }
}

@media (max-width: 640px) {
  .page { padding: 20px 14px 32px; }
  .section-head { min-height: auto; margin-bottom: 16px; }
  h1 { font-size: 24px; }
  section, .toolbar, .form-panel, .year-overview, .target-manager, .grid-two > div { padding: 16px; }
  .grid-two { grid-template-columns: minmax(0, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { min-height: 96px; padding: 14px; }
  .metric strong { font-size: 23px; }
}

/* Shared desktop time-range picker: B precise calendar interaction. */
.range-toolbar {
  position: relative;
  grid-template-columns: minmax(140px, .55fr) minmax(360px, 2.45fr);
  grid-template-areas: "period range";
  align-items: end;
  overflow: visible;
}

.range-toolbar-sync {
  grid-template-columns: minmax(140px, .55fr) minmax(360px, 1.45fr) minmax(150px, 1fr);
  grid-template-areas: "period range actions";
}

.range-toolbar-records {
  grid-template-columns: minmax(140px, .55fr) minmax(360px, 1.45fr) minmax(150px, 1fr);
  grid-template-areas:
    "period range range"
    "extras extras actions";
}

.range-toolbar .period-picker,
.range-picker { min-width: 0; }

.range-toolbar .period-picker {
  grid-area: period;
  display: grid;
  gap: 6px;
}

.range-toolbar .period-picker select,
.range-extra-filters select {
  width: 100%;
  min-height: 44px;
}

.range-picker {
  grid-area: range;
  position: relative;
  display: grid;
  gap: 6px;
}

.range-picker-label {
  color: var(--copy);
  font-size: 13px;
}

.range-picker-trigger {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 0 14px;
  border-color: var(--rule);
  background: var(--control);
  color: var(--brand);
  font-weight: 700;
  text-align: left;
}

.range-picker-trigger:hover,
.range-picker-trigger:focus-visible {
  border-color: var(--brand);
  background: var(--control);
  color: var(--brand);
  filter: none;
}

.range-picker-trigger:focus-visible,
.range-preset-button:focus-visible,
.range-picker-close:focus-visible,
.range-picker-secondary:focus-visible,
.range-picker-apply:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 30%, transparent);
  outline-offset: 2px;
}

#range-picker-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.range-picker-calendar-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-right: -7px;
  border-left: 1px solid var(--rule);
  color: var(--heading);
}

.range-picker-calendar-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.range-picker-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  width: min(680px, calc(100vw - var(--sidebar-width) - 100px));
  grid-template-columns: 150px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(20, 35, 32, .16);
}

:root[data-theme="dark"] .range-picker-popover {
  box-shadow: 0 20px 48px rgba(0, 0, 0, .34);
}

.range-preset-panel {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 16px 12px;
  border-right: 1px solid var(--rule);
  background: var(--panel-soft);
}

.range-preset-panel > strong {
  margin: 0 8px 8px;
  color: var(--copy);
  font-size: 12px;
}

.range-preset-button {
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--heading);
  font-weight: 600;
  text-align: left;
}

.range-preset-button:hover {
  background: var(--brand-soft);
  color: var(--brand);
  filter: none;
}

.range-precise-panel { min-width: 0; padding: 18px; }

.range-picker-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.range-picker-heading > div { display: grid; gap: 4px; }
.range-picker-heading strong { color: var(--heading); font-size: 15px; }
.range-picker-heading span { color: var(--copy); font-size: 12px; }

.range-picker-close {
  display: grid;
  width: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border-color: var(--rule);
  background: var(--panel-soft);
  color: var(--copy);
  font-size: 20px;
  font-weight: 400;
}

.range-picker-close:hover {
  background: var(--brand-soft);
  color: var(--brand);
  filter: none;
}

.range-precise-fields,
.range-custom-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.range-precise-fields > .period-control:not(.range-custom-fields) { grid-column: 1 / -1; }
.range-precise-fields input,
.range-precise-fields select { width: 100%; min-height: 44px; }

.range-picker-error {
  margin: 10px 0 0;
  color: #b42318;
  font-size: 12px;
}

:root[data-theme="dark"] .range-picker-error { color: #ffaaa2; }

.range-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.range-picker-secondary,
.range-picker-apply {
  min-height: 40px;
  padding: 0 16px;
}

.range-picker-secondary {
  border-color: var(--rule);
  background: var(--panel-soft);
  color: var(--heading);
}

.range-picker-secondary:hover { background: var(--brand-soft); color: var(--brand); filter: none; }

.range-toolbar-actions {
  grid-area: actions;
  display: flex;
  align-items: end;
  gap: 8px;
}

.range-extra-filters {
  grid-area: extras;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.range-extra-filters > label { min-width: 0; }

.range-toolbar-actions > button {
  flex: 1 1 120px;
  min-height: 44px;
  white-space: nowrap;
}

.range-toolbar-actions .range-sync-button {
  border-color: var(--rule);
  background: var(--panel-soft);
  color: var(--heading);
}

.range-toolbar-actions .range-sync-button:hover { background: var(--brand-soft); color: var(--brand); filter: none; }

.range-picker-popover button:disabled,
.range-toolbar-actions button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

@media (max-width: 900px) {
  .range-picker-popover { width: min(680px, calc(100vw - 80px)); }
}

@media (max-width: 760px) {
  .range-toolbar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "period"
      "range";
  }
  .range-toolbar-sync {
    grid-template-areas:
      "period"
      "range"
      "actions";
  }
  .range-toolbar-records {
    grid-template-areas:
      "period"
      "range"
      "extras"
      "actions";
  }
  .range-picker-popover {
    position: static;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 8px;
    box-shadow: none;
  }
  .range-preset-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .range-preset-panel > strong { grid-column: 1 / -1; }
  .range-preset-button { text-align: center; }
  .range-picker-popover.is-native-picker-open .range-preset-panel {
    visibility: hidden;
    pointer-events: none;
  }
  .range-extra-filters { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .range-preset-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .range-custom-fields { grid-template-columns: minmax(0, 1fr); }
  .range-toolbar-actions { flex-wrap: wrap; }
}

.auth-page { min-height: 100vh; display: grid; place-items: center; background: var(--page-bg); }
.auth-panel { width: min(440px, calc(100% - 32px)); padding: 36px; background: var(--panel-bg); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.auth-mark { margin-bottom: 18px; }
.auth-form { margin-top: 22px; }
.narrow-panel { max-width: 520px; }
.small-text { font-size: .85rem; }
.form-error { color: #b42318; background: #fff1f0; border: 1px solid #f5c2c0; padding: 10px 12px; border-radius: 8px; }
.notice.warning { margin-bottom: 16px; color: #7a4b00; background: #fff8e6; border: 1px solid #f2d49b; padding: 12px 14px; border-radius: 10px; }
.status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: .78rem; }
.status-warning { color: #7a4b00; background: #fff1c2; }
.status-ok { color: #176b4d; background: #dff7eb; }
.account-link { color: inherit; text-decoration: none; font-size: .85rem; }
.account-link-button { border: 0; background: transparent; color: inherit; padding: 0; font: inherit; cursor: pointer; font-size: .85rem; }

.member-identity { display: inline-flex; align-items: center; gap: 7px; min-width: 0; vertical-align: middle; }
.member-avatar { flex: 0 0 auto; width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-muted); object-fit: cover; }
.member-identity-nav .member-avatar { width: 28px; height: 28px; }
.season-honor-avatar { --season-honor-color:#b3c0c8; --season-honor-badge:#56646d; position:relative; display:inline-grid; flex:0 0 auto; place-items:center; color:var(--season-honor-color); vertical-align:middle; isolation:isolate; margin-inline:12px; }
.season-honor-avatar.season-honor-count { --season-honor-color:#92a0a8; --season-honor-badge:#66737b; }
.season-honor-avatar.season-honor-calorie { --season-honor-color:#d1aa59; --season-honor-badge:#b74332; }
.season-honor-avatar > img { position:relative; z-index:1; border:0; box-shadow:none; }
.season-honor-orbit { position:absolute; z-index:2; inset:-30%; width:160%; height:160%; background:url('/static/season-winged-silver.svg?v=1') center/contain no-repeat; pointer-events:none; filter:drop-shadow(0 1px 1px rgb(20 24 22 / 35%)); }
.season-honor-calorie > .season-honor-orbit { background-image:url('/static/season-winged-gold.svg?v=1'); }
.season-honor-medals { position:absolute; z-index:3; bottom:-8px; left:50%; transform:translateX(-50%); display:flex; gap:1px; pointer-events:none; filter:drop-shadow(0 1px 1px #10191899); }
.season-honor-medallion { display:grid; grid-template-rows:10px 10px; justify-items:center; align-content:center; width:25px; height:25px; padding:1px 0 3px; box-sizing:border-box; clip-path:polygon(0 8%,25% 6%,50% 0,75% 6%,100% 8%,94% 73%,50% 100%,6% 73%); background:linear-gradient(135deg,#fff 0%,#71818c 24%,#f5f8fa 40%,#52606b 58%,#eff4f8 78%,#71818c); color:#fff; font-size:8px; font-weight:900; line-height:1; position:relative; }
.season-honor-medallion::before { content:""; position:absolute; inset:1.5px; background:linear-gradient(145deg,#26323b,#e4ebef 48%,#394852 52%,#e4ebef); clip-path:inherit; z-index:-1; }
.season-honor-medallion::after { content:""; position:absolute; inset:3px; background:linear-gradient(120deg,#152029,#43525d 45%,#1c272e); clip-path:inherit; z-index:-1; }
.season-honor-medallion.is-calorie { background:linear-gradient(135deg,#fff0b2,#c79735 45%,#fff0b2); }
.season-honor-medallion.is-calorie::before { background:linear-gradient(145deg,#623810,#fff1ac 48%,#a36b1a 52%,#ffdf86); }
.season-honor-medallion.is-calorie::after { background:linear-gradient(120deg,#5e140e,#b9432c 45%,#68180f); }
.season-honor-symbol { display:grid; place-items:center; width:100%; height:100%; }
.season-honor-medallion b { font:inherit; font-family:Arial,sans-serif; white-space:nowrap; }
.season-honor-medallion svg { display:block; width:9px; height:9px; fill:#ffe2a0; }
.season-honor-medallion svg.season-calendar { fill:none; stroke:currentColor; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
.season-honor-avatar-profile .season-honor-medals, .season-honor-avatar-card .season-honor-medals { bottom:-10px; gap:2px; }
.season-honor-avatar-profile .season-honor-medallion, .season-honor-avatar-card .season-honor-medallion { width:38px; height:38px; grid-template-rows:16px 14px; font-size:11px; }
.season-honor-avatar-profile .season-honor-medallion svg, .season-honor-avatar-card .season-honor-medallion svg { width:13px; height:13px; }
.season-honor-avatar-card { width:72px; height:72px; }
.season-honor-avatar-card > img { width:100%; height:100%; border-radius:50%; background:var(--surface-muted); object-fit:cover; }
[data-theme="dark"] .season-honor-avatar { --season-honor-color:#d3dee5; --season-honor-badge:#78868d; }
[data-theme="dark"] .season-honor-avatar.season-honor-count { --season-honor-color:#c5d0d5; --season-honor-badge:#78868d; }
[data-theme="dark"] .season-honor-avatar.season-honor-calorie { --season-honor-color:#f0cc7b; --season-honor-badge:#c7523e; }

.assessment-section { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 24px; align-items: stretch; }
.assessment-main { min-width: 0; }
.assessment-main .section-title-row { margin-bottom: 14px; }
.assessment-table-wrap { width: 100%; }
.assessment-table { width: 100%; min-width: 760px; }
.assessment-table th, .assessment-table td { white-space: nowrap; }
.assessment-table th:nth-child(1) { width: 56px; }
.assessment-table th:nth-child(2) { width: 236px; }
.assessment-table th:nth-child(3), .assessment-table th:nth-child(4), .assessment-table th:nth-child(5) { width: 94px; }
.assessment-table th:nth-last-child(3), .assessment-table th:nth-last-child(2) { width: 104px; }
.assessment-table th:last-child { width: 112px; }
.assessment-leave-count { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.assessment-member-entry { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; }
.assessment-member-entry .member-identity { min-width: 0; }
.assessment-records-trigger { flex: 0 0 auto; width: auto; min-height: 30px; padding: 5px 8px; white-space: nowrap; font-size: 11px; }
.assessment-records-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: none;
  max-height: min(820px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--panel);
  color: var(--heading);
  box-shadow: 0 24px 80px rgba(8, 22, 20, .28);
}
.assessment-records-dialog::backdrop { background: rgba(8, 18, 17, .58); backdrop-filter: blur(3px); }
.assessment-records-shell { display: grid; grid-template-rows: auto minmax(0, 1fr); max-height: min(820px, calc(100dvh - 48px)); }
.assessment-records-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; border-bottom: 1px solid var(--rule); }
.assessment-records-header > div { min-width: 0; }
.assessment-records-header span { color: var(--brand); font-size: 11px; font-weight: 800; }
.assessment-records-header h2 { margin: 4px 0; font-size: 22px; }
.assessment-records-header p { margin: 0; color: var(--muted); font-size: 12px; }
.assessment-records-close { display: grid; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; place-items: center; border: 1px solid var(--rule); border-radius: 50%; background: var(--panel-soft); color: var(--copy); }
.assessment-records-close:hover { background: var(--brand-soft); color: var(--brand); filter: none; }
.assessment-records-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.assessment-records-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.assessment-records-loading, .assessment-records-error, .assessment-records-empty { margin: 0; padding: 48px 24px; color: var(--muted); text-align: center; }
.assessment-records-error { color: #c43232; }
.assessment-records-content { min-height: 0; overflow-y: auto; padding: 18px 24px 24px; }
.assessment-records-summary { margin-bottom: 12px; color: var(--copy); font-size: 12px; }
.assessment-records-list { display: grid; gap: 10px; }
.assessment-record-card { padding: 14px 16px; border: 1px solid var(--rule); border-radius: 7px; background: var(--panel-soft); }
.assessment-record-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.assessment-record-card-head strong { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.assessment-record-validity { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.assessment-record-validity.is-valid { background: var(--brand-soft); color: var(--brand); }
.assessment-record-validity.is-invalid { background: #fde7e7; color: #c43232; }
:root[data-theme="dark"] .assessment-record-validity.is-invalid { background: #492727; color: #ff9a9a; }
.assessment-record-card-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.assessment-record-card-metrics > span { display: grid; min-width: 0; gap: 3px; }
.assessment-record-card-metrics small { color: var(--muted); font-size: 10px; }
.assessment-record-card-metrics strong { overflow-wrap: anywhere; font-size: 12px; }
.assessment-record-override { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); color: var(--copy); font-size: 11px; }
.assessment-aside { display: grid; align-content: start; border-left: 1px solid var(--rule); }
.assessment-aside > div { padding: 14px 0 14px 20px; border-bottom: 1px solid var(--rule); }
.assessment-aside > div:first-child { padding-top: 0; }
.assessment-aside > div:last-child { padding-bottom: 0; border-bottom: 0; }
.assessment-cycle-progress { min-height:148px; padding:4px 0 20px 20px !important; }
.assessment-cycle-heading span { color:var(--heading); font-size:15px; font-weight:700; }
.assessment-cycle-value { display:block; margin-top:10px; color:var(--heading); font-size:32px; line-height:1; letter-spacing:0; }
.assessment-progress-track { height:10px; margin:16px 0 10px; overflow:hidden; border-radius:999px; background:var(--surface-muted); }
.assessment-progress-track span { display:block; height:100%; min-width:2px; border-radius:inherit; background:var(--brand); }
.assessment-cycle-progress p { color:var(--muted); font-size:13px; }
.assessment-aside-title h3 { margin: 0; color: var(--heading); font-size: 15px; }
.assessment-aside-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.assessment-summary-row { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:48px; }
.assessment-summary-row > span, .assessment-attention-heading > span { color: var(--copy); font-size: 13px; font-weight: 600; }
.assessment-summary-row > strong { margin: 0; color: var(--heading); font-size: 14px; line-height: 1; }
.assessment-leader { display:inline-flex; align-items:center; gap:8px; min-width:0; }
.assessment-summary-row > .assessment-leader { flex:0 0 162px; justify-content:flex-start; }
.assessment-leader em { margin-left:4px; color:var(--muted); font-size:11px; font-style:normal; font-weight:600; white-space:nowrap; }
.assessment-leader-avatar { position:relative; display:inline-flex; width:32px; height:32px; padding:2px; border:2px solid var(--brand); border-radius:50%; background:var(--panel); }
.assessment-leader-avatar img { width:100%; height:100%; border-radius:50%; object-fit:cover; }
.assessment-leader-avatar::after { position:absolute; right:-8px; bottom:-4px; display:grid; place-items:center; min-width:16px; height:16px; padding:0 3px; border:2px solid var(--panel); border-radius:999px; color:#fff; font-size:8px; font-weight:800; line-height:1; }
.assessment-leader-avatar-calorie { border-color:#c77a12; }
.assessment-leader-avatar-calorie::after { content:"K"; background:#c77a12; }
.assessment-leader-avatar-count { border-color:#9aa1a6; }
.assessment-leader-avatar-count::after { content:""; background:#7a858d url('/static/count-calendar.svg') center/12px 12px no-repeat; }
.count-calendar-icon { display:block; width:16px; height:16px; background:currentColor; -webkit-mask:url('/static/count-calendar.svg') center/contain no-repeat; mask:url('/static/count-calendar.svg') center/contain no-repeat; }
.assessment-attention-list ul { display:grid; gap:9px; margin:11px 0 0; padding:0; list-style:none; }
.assessment-attention-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.assessment-attention-heading strong { color:#bd3131; font-size:13px; }
.assessment-attention-list li { display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; }
.assessment-attention-list .member-avatar { width:24px; height:24px; }
.assessment-rapid-list ul { display:grid; gap:9px; margin:11px 0 0; padding:0; list-style:none; }
.assessment-rapid-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.assessment-rapid-heading > span { color:var(--copy); font-size:13px; font-weight:600; }
.assessment-rapid-heading small { color:var(--muted); font-size:11px; }
.assessment-rapid-list li { display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; }
.assessment-rapid-list .member-avatar { width:24px; height:24px; }
.assessment-rapid-reason { color:#087669; font-size:12px; font-weight:700; white-space:nowrap; }
.assessment-empty { color:var(--muted); font-size:12px; }

.assessment-status { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 15px; font-weight: 800; line-height: 1; }
.assessment-status-pass { color: #087669; background: #d9f3ed; }
.assessment-status-fail { color: #bd3131; background: #fde3e3; }
.assessment-status-leave { color: var(--muted); background: var(--surface-muted); }
.assessment-gap { margin-left: 6px; color: #bd3131; font-size: 12px; font-weight: 700; }

.manual-edit-dialog {
  width: min(620px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--panel);
  color: var(--heading);
  box-shadow: 0 24px 80px rgba(8, 22, 20, .28);
}
.manual-edit-dialog::backdrop { background: rgba(8, 18, 17, .58); backdrop-filter: blur(3px); }
.manual-edit-shell { max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; }
.manual-edit-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; border-bottom: 1px solid var(--rule); }
.manual-edit-header > div { min-width: 0; }
.manual-edit-header span { color: var(--brand); font-size: 11px; font-weight: 800; }
.manual-edit-header h2 { margin: 4px 0; font-size: 22px; }
.manual-edit-header p { margin: 0; color: var(--muted); font-size: 12px; }
.manual-edit-close { display: grid; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; place-items: center; border: 1px solid var(--rule); border-radius: 50%; background: var(--panel-soft); color: var(--copy); }
.manual-edit-close:hover { background: var(--brand-soft); color: var(--brand); filter: none; }
.manual-edit-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.manual-edit-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.manual-edit-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 22px 24px; }
.manual-edit-fields label { display: grid; min-width: 0; gap: 7px; color: var(--copy); font-size: 13px; font-weight: 700; }
.manual-edit-fields label[hidden] { display: none; }
.manual-edit-fields input, .manual-edit-fields select { width: 100%; }
.manual-edit-fields .wide { grid-column: 1 / -1; }
.manual-edit-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px max(18px, env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); background: var(--panel-soft); }
.manual-edit-actions button { min-height: 38px; }

.member-baseline-manager { padding: 0; overflow: hidden; }
.member-baseline-manager > .section-title-row { align-items: flex-start; margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--rule); }
.member-baseline-manager .section-title-row h2 { margin-bottom: 5px; }
.member-baseline-admin-badge { flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--brand-border); border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; }
.member-baseline-list { display: grid; }
.member-baseline-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) repeat(3, minmax(115px, .72fr)) minmax(150px, 1fr) 168px; gap: 12px; align-items: end; padding: 14px 20px; border-bottom: 1px solid var(--rule); }
.member-baseline-row:last-child { border-bottom: 0; }
.member-baseline-row:hover { background: var(--panel-soft); }
.member-baseline-row label { min-width: 0; color: var(--copy); font-size: 12px; font-weight: 700; }
.member-baseline-row input { width: 100%; min-width: 0; }
.member-baseline-member { display: grid; align-self: center; min-width: 0; gap: 5px; }
.member-baseline-member .member-identity { min-width: 0; font-weight: 800; }
.member-baseline-member small { width: max-content; color: var(--muted); font-size: 11px; font-weight: 700; }
.member-baseline-member small.is-custom { color: var(--brand); }
.member-baseline-actions { display: flex; min-width: 0; justify-content: flex-end; gap: 8px; }
.member-baseline-actions button { min-height: 38px; white-space: nowrap; }
.member-baseline-empty { padding: 20px; }

.profile-panel { display: grid; grid-template-columns: 132px minmax(0, 520px); gap: 24px; align-items: start; }
.profile-avatar-wrap { display: flex; justify-content: center; }
.profile-avatar { width: 112px; height: 112px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-muted); object-fit: cover; }
.profile-form textarea { resize: vertical; }

@media (max-width: 1000px) {
  .member-baseline-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .member-baseline-member, .member-baseline-note { grid-column: 1 / -1; }
  .member-baseline-actions { grid-column: 2 / -1; }
}

@media (max-width: 640px) {
  .assessment-section { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .assessment-records-dialog { width: 100%; max-height: calc(100dvh - 20px); margin: auto 0 0; border-width: 1px 0 0; border-radius: 8px 8px 0 0; }
  .assessment-records-shell { max-height: calc(100dvh - 20px); }
  .assessment-records-header { padding: 18px 16px 14px; }
  .assessment-records-content { padding: 14px 16px max(20px, env(safe-area-inset-bottom)); }
  .assessment-record-card-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-edit-dialog { width: 100%; max-height: calc(100dvh - 20px); margin: auto 0 0; border-width: 1px 0 0; border-radius: 8px 8px 0 0; }
  .manual-edit-shell { max-height: calc(100dvh - 20px); }
  .manual-edit-header { padding: 18px 16px 14px; }
  .manual-edit-fields { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 16px; }
  .manual-edit-fields .wide { grid-column: auto; }
  .manual-edit-actions { position: sticky; bottom: 0; padding-right: 16px; padding-left: 16px; }
  .manual-edit-actions button { flex: 1; min-height: 44px; }
  .member-baseline-manager > .section-title-row { padding: 16px; }
  .member-baseline-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; }
  .member-baseline-member, .member-baseline-note, .member-baseline-actions { grid-column: 1 / -1; }
  .member-baseline-actions button { flex: 1; min-height: 44px; }
  .assessment-aside { grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--rule); border-left: 0; }
  .assessment-aside > div, .assessment-aside > div:first-child { padding: 14px 0 0; border-bottom: 0; }
  .assessment-aside > div:first-child { padding-left: 0; }
  .assessment-cycle-progress { min-height:132px; padding-top:0 !important; }
  .assessment-cycle-value { font-size:28px; }
  .profile-panel { grid-template-columns: 1fr; }
  .profile-avatar-wrap { justify-content: flex-start; }
}

/* Login A: pulse-track layout with the B1 team-gathering intro. */
.login-a-page {
  display: block;
  min-height: 100vh;
  background: #f5f7f6;
  color: #16211f;
}

.login-a-shell {
  display: grid;
  grid-template-columns: minmax(0, 14fr) minmax(420px, 11fr);
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 100vh;
}

.login-a-brand {
  position: relative;
  overflow: hidden;
  padding: 46px;
  background: #393241;
  color: #f8fbfa;
}

.login-a-wordmark {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
}

.login-a-wordmark .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #14c8b3;
  color: #082e2a;
  letter-spacing: -.05em;
}

.login-a-wordmark small {
  display: block;
  margin-top: 3px;
  color: rgba(248, 251, 250, .62);
  font-size: 12px;
  font-weight: 400;
}

.login-a-copy {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin-top: clamp(110px, 19vh, 210px);
}

.login-a-copy h1 {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(44px, 5vw, 76px);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.login-a-copy p {
  margin: 0;
  color: rgba(248, 251, 250, .78);
  font-size: 16px;
}

.login-a-signal { display: flex; gap: 8px; margin-top: 30px; }
.login-a-signal span { width: 38px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .2); }
.login-a-signal span:first-child { width: 92px; background: #14c8b3; }

.login-a-track {
  position: absolute;
  right: -15%;
  bottom: -18%;
  width: min(68vw, 760px);
  aspect-ratio: 1;
  border: 2px solid rgba(20, 200, 179, .48);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(20, 200, 179, .08), 0 0 0 70px rgba(20, 200, 179, .05);
}

.login-a-form-side {
  display: grid;
  align-items: center;
  padding: 44px;
  background: #f5f7f6;
}

.login-a-form-wrap { width: min(410px, 100%); margin: auto; }
.login-a-form-wrap h2 { margin: 10px 0 8px; color: #16211f; font-size: 32px; }
.login-a-form-wrap > .muted { margin: 0 0 28px; color: #67736f; }
.login-a-form.form-panel { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.login-a-form label { display: grid; gap: 7px; color: #283532; }
.login-a-form input { min-height: 50px; border-color: #d5ddda; border-radius: 13px; background: #fff; color: #16211f; }
.login-a-form button { min-height: 50px; border-radius: 13px; background: #14c8b3; color: #082e2a; }
.login-a-form-wrap .small-text { margin-top: 14px; color: #71807c; }

.login-gather-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #17433f 0, #27242d 45%, #1a1a20 100%);
  color: #f5f8f7;
  transition: opacity .5s ease, transform .5s ease;
}

.login-gather-splash.is-finished { pointer-events: none; opacity: 0; transform: scale(1.025); }

.login-gather-skip {
  position: absolute;
  right: 24px;
  top: 24px;
  z-index: 5;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  color: #fff;
  cursor: pointer;
}

.login-gather-ring {
  position: absolute;
  width: min(58vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(20, 200, 179, .2);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(20, 200, 179, .04), 0 0 0 86px rgba(20, 200, 179, .025);
  animation: login-gather-ring 4s ease-in-out both;
}

.login-gather-members { position: absolute; inset: 0; }

.login-gather-member {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: -21px;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 50%;
  background: #14c8b3;
  color: #082e2a;
  box-shadow: 0 0 24px rgba(20, 200, 179, .38);
  font-weight: 700;
  animation: login-gather-member 4s cubic-bezier(.55, .05, .18, 1) both;
  animation-delay: var(--member-delay, 0s);
}

.login-gather-member:nth-child(even) { background: #e9f8f4; color: #12312e; }
.login-gather-member-1 { --member-sx: -42vw; --member-sy: -32vh; --member-tx: -158px; --member-ty: -92px; --member-delay: 0s; }
.login-gather-member-2 { --member-sx: 40vw; --member-sy: -34vh; --member-tx: -56px; --member-ty: -170px; --member-delay: -.08s; }
.login-gather-member-3 { --member-sx: -44vw; --member-sy: 12vh; --member-tx: 62px; --member-ty: -166px; --member-delay: -.16s; }
.login-gather-member-4 { --member-sx: 43vw; --member-sy: 15vh; --member-tx: 152px; --member-ty: -78px; --member-delay: -.24s; }
.login-gather-member-5 { --member-sx: -30vw; --member-sy: 38vh; --member-tx: 154px; --member-ty: 68px; --member-delay: -.32s; }
.login-gather-member-6 { --member-sx: 31vw; --member-sy: 39vh; --member-tx: 56px; --member-ty: 158px; --member-delay: -.4s; }
.login-gather-member-7 { --member-sx: 0; --member-sy: -46vh; --member-tx: -64px; --member-ty: 154px; --member-delay: -.48s; }
.login-gather-member-8 { --member-sx: 0; --member-sy: 46vh; --member-tx: -154px; --member-ty: 68px; --member-delay: -.56s; }

.login-gather-logo { position: relative; z-index: 3; text-align: center; opacity: 0; transform: scale(.78); animation: login-gather-logo 4s ease both; }
.login-gather-logo strong { display: block; font-size: clamp(68px, 13vw, 148px); line-height: .86; letter-spacing: -.08em; }
.login-gather-logo span { display: block; margin-top: 22px; color: rgba(245, 248, 247, .7); font-size: 13px; letter-spacing: .3em; }

@keyframes login-gather-ring {
  0%, 12% { opacity: 0; transform: scale(.7); }
  48%, 84% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.04); }
}

@keyframes login-gather-member {
  0%, 12% { opacity: 0; transform: translate(var(--member-sx), var(--member-sy)) scale(.66); }
  48%, 72% { opacity: 1; transform: translate(var(--member-tx), var(--member-ty)) scale(1); }
  88%, 100% { opacity: 0; transform: translate(0, 0) scale(.2); }
}

@keyframes login-gather-logo {
  0%, 56% { opacity: 0; transform: scale(.78); }
  70%, 92% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.03); }
}

@media (max-width: 760px) {
  .login-a-shell { grid-template-columns: 1fr; }
  .login-a-brand { min-height: 300px; padding: 28px; }
  .login-a-copy { margin-top: 52px; }
  .login-a-copy h1 { font-size: 42px; }
  .login-a-form-side { padding: 34px 22px 42px; }
  .login-a-track { width: 96vw; right: -36%; bottom: -62%; }
  .login-gather-ring { width: min(78vw, 420px); }
  .login-gather-member { width: 36px; height: 36px; margin: -18px; }
  .login-gather-member-1 { --member-tx: -112px; --member-ty: -68px; }
  .login-gather-member-2 { --member-tx: -40px; --member-ty: -122px; }
  .login-gather-member-3 { --member-tx: 44px; --member-ty: -118px; }
  .login-gather-member-4 { --member-tx: 108px; --member-ty: -56px; }
  .login-gather-member-5 { --member-tx: 110px; --member-ty: 48px; }
  .login-gather-member-6 { --member-tx: 40px; --member-ty: 112px; }
  .login-gather-member-7 { --member-tx: -46px; --member-ty: 108px; }
  .login-gather-member-8 { --member-tx: -110px; --member-ty: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-gather-splash,
  .login-gather-splash * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Study sharing library */
.study-overview-grid { grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); }
.meeting-date-fields { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.meeting-date-fields legend { margin-bottom: 8px; color: var(--copy); font-size: 13px; }
.segmented-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel-soft); }
.segmented-control label { margin: 0; cursor: pointer; }
.segmented-control input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segmented-control span { display: grid; place-items: center; min-height: 34px; border-radius: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.segmented-control input:checked + span { background: var(--panel); color: var(--brand-ink); box-shadow: var(--shadow-soft); }
.study-session-list { display: grid; }
.study-session-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.study-session-item:first-child { padding-top: 0; }
.study-session-item:last-child { padding-bottom: 0; border-bottom: 0; }
.study-session-link { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; align-items: center; gap: 16px; flex: 1; min-width: 0; color: var(--heading); text-decoration: none; }
.study-session-link time { color: var(--brand-ink); font-size: 13px; font-weight: 700; }
.study-session-link > div { min-width: 0; }
.study-session-link strong,
.study-session-link span { display: block; }
.study-session-link strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.study-session-link > div > span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.study-session-counts { display: flex; align-items: center; gap: 8px; }
.study-session-counts span { padding: 5px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 11px; font-weight: 700; white-space: nowrap; }
.study-empty-state { padding: 34px 18px; border: 1px dashed var(--rule); border-radius: 8px; color: var(--copy); text-align: center; }
.study-empty-state strong { color: var(--heading); }
.study-empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.study-session-description,
.study-share-summary { white-space: pre-wrap; }
.study-admin-grid { align-items: start; }
.study-share-section { overflow: hidden; }
.study-share-list { display: grid; }
.study-share-card { min-width: 0; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.study-share-card:first-child { padding-top: 0; }
.study-share-card:last-child { padding-bottom: 0; border-bottom: 0; }
.study-share-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.study-share-head > div { display: flex; align-items: center; gap: 16px; min-width: 0; }
.study-share-head h3 { margin: 0; font-size: 17px; }
.study-share-summary { max-width: 980px; margin: 14px 0 0; color: var(--copy); line-height: 1.7; }
.study-share-editor { margin-top: 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel-soft); }
.study-share-editor summary { padding: 12px 14px; color: var(--heading); cursor: pointer; font-size: 13px; font-weight: 700; }
.study-share-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .55fr); gap: 16px; padding: 0 14px 14px; }
.study-file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 340px)); gap: 12px; margin-top: 18px; }
.study-file-card { min-width: 0; overflow: hidden; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel-soft); }
.study-file-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 9px 10px; border-bottom: 1px solid var(--rule); }
.study-file-head > strong { min-width: 0; overflow: hidden; color: var(--heading); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.study-file-head .table-actions { flex: 0 0 auto; }
.study-file-head .table-action,
.study-file-head .danger-button { min-height: 30px; padding: 5px 8px; font-size: 11px; }
.study-media-frame { display: grid; place-items: center; width: 100%; height: clamp(210px, 18vw, 280px); margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: color-mix(in srgb, var(--canvas) 82%, #000); }
.study-media-frame img,
.study-media-frame video { width: 100%; height: 100%; object-fit: contain; }
.study-image-trigger { cursor: zoom-in; }
.study-audio-preview { display: block; width: calc(100% - 24px); margin: 34px 12px; }
.study-document-preview { display: block; width: 100%; height: 300px; border: 0; background: #fff; }
.study-file-fallback { display: grid; place-items: center; min-height: 210px; padding: 24px; text-align: center; }
.study-file-fallback span { display: grid; place-items: center; min-width: 64px; height: 64px; padding: 0 10px; border: 1px solid var(--brand); border-radius: 8px; background: var(--brand-soft); color: var(--brand-ink); font-size: 15px; font-weight: 800; }
.study-file-fallback p { max-width: 220px; margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.study-no-files { margin: 0; color: var(--muted); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.circle-composer { max-width: 760px; margin: 0 auto 16px; }
.circle-composer-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.circle-composer-title strong { color: var(--heading); font-size: 15px; }
.circle-composer textarea { resize: vertical; }
.circle-composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.circle-file-picker { min-width: 0; color: var(--brand-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.circle-file-picker input { display: block; max-width: 100%; margin-top: 7px; color: var(--copy); font-weight: 400; }
.circle-feed { display: grid; max-width: 760px; margin: 0 auto; gap: 14px; }
.circle-post { padding: 20px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow-soft); }
.circle-post-self { border-color: color-mix(in srgb, var(--brand) 36%, var(--rule)); }
.circle-post-head, .circle-author, .circle-post-meta { display: flex; align-items: center; }
.circle-post-head { justify-content: space-between; gap: 16px; }
.circle-author { min-width: 0; gap: 9px; }
.circle-author > strong { overflow: hidden; color: var(--heading); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.circle-source { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 10px; font-weight: 800; }
.circle-post-title { margin: 15px 0 0; font-size: 17px; }
.circle-post-content { margin-top: 13px; color: var(--copy); line-height: 1.75; white-space: pre-wrap; }
.circle-workout { display: inline-flex; margin-top: 12px; padding: 7px 10px; border-left: 3px solid var(--brand); background: var(--panel-soft); color: var(--heading); font-size: 12px; font-weight: 700; }
.circle-media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: 15px; overflow: hidden; border-radius: 6px; }
.circle-media-count-1 { grid-template-columns: minmax(0, 1fr); }
.circle-media-grid button { width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: var(--canvas); cursor: zoom-in; }
.circle-media-grid img, .circle-media-grid video { display: block; width: 100%; height: 260px; object-fit: cover; background: var(--canvas); }
.circle-media-count-1 img, .circle-media-count-1 video { height: min(520px, 58vw); object-fit: contain; }
.circle-post-meta { gap: 14px; margin-top: 13px; color: var(--muted); font-size: 11px; }
.circle-interactions { margin-top: 12px; border-top: 1px solid var(--rule); }
.circle-action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.circle-like-button { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 10px; gap: 6px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; box-shadow: none; }
.circle-like-button:hover { background: var(--panel-soft); color: var(--heading); }
.circle-like-button.active { background: color-mix(in srgb, #e84b5f 12%, transparent); color: #cf3048; }
.circle-like-button > span { font-size: 16px; line-height: 1; }
.circle-like-button b, .circle-comment-count b { color: inherit; font-variant-numeric: tabular-nums; }
.circle-comment-count { color: var(--muted); font-size: 12px; font-weight: 600; }
.circle-comments { border-top: 1px solid var(--rule); }
.circle-comment-panel { display: grid; gap: 12px; padding: 12px 0 4px; }
.circle-comment-list { display: grid; gap: 2px; }
.circle-comment-item { display: grid; grid-template-columns: minmax(150px, auto) minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 24px; }
.circle-comment-item:target { margin: 0 -8px; padding-right: 8px; padding-left: 8px; border-radius: 6px; background: var(--brand-soft); }
.circle-comment-avatar { display: flex; align-items: center; min-width: 0; gap: 7px; }
.circle-comment-avatar .member-identity { min-width: 0; }
.circle-comment-avatar strong { overflow: hidden; color: var(--heading); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.circle-comment-body { min-width: 0; }
.circle-comment-body p { margin: 0; color: var(--copy); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.circle-comment-body time { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.circle-comment-delete { min-height: 28px; padding: 4px 7px; border: 0; background: transparent; color: var(--danger); font-size: 11px; box-shadow: none; }
.circle-comment-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.circle-comment-form input { margin: 0; }
.circle-comment-form button { min-width: 72px; }
.circle-keep-comment-note { margin: 0; color: var(--muted); font-size: 11px; }
.circle-notification-tab { display: flex; align-items: center; width: max-content; max-width: min(360px, 100%); min-height: 52px; padding: 9px 12px; gap: 9px; border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--rule)); border-radius: 7px; background: var(--brand-soft); color: var(--heading); font: inherit; text-align: left; text-decoration: none; box-shadow: var(--shadow-soft); cursor: pointer; }
.circle-notification-tab:hover { border-color: var(--brand); color: var(--heading); }
.circle-notification-copy { display: grid; min-width: 0; gap: 2px; }
.circle-notification-copy strong { font-size: 12px; }
.circle-notification-copy > span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.circle-notification-count { display: grid; flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border-radius: 10px; background: #d9485f; color: #fff; font-size: 10px; font-variant-numeric: tabular-nums; }
.global-interaction-notification { position: fixed; z-index: 70; top: 116px; right: 22px; width: min(310px, calc(100vw - 44px)); }
.global-interaction-notification .circle-notification-tab { width: 100%; max-width: none; }
.circle-map-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); }
.circle-map-form label { margin: 0; }
.circle-map-form select { margin-top: 5px; }

@media (max-width: 900px) {
  .study-overview-grid,
  .study-admin-grid,
  .study-share-edit-grid { grid-template-columns: minmax(0, 1fr); }
  .global-interaction-notification { top: auto; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); width: min(340px, calc(100vw - 28px)); }
  .activity-lightbox { padding: 0; }
  .activity-lightbox { top: var(--activity-viewport-top, 0); bottom: auto; height: var(--activity-viewport-height, 100dvh); }
  .activity-lightbox-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(240px, 68%) minmax(0, 32%); width: 100%; height: 100%; border: 0; border-radius: 0; }
  .activity-gallery-lightbox:not(.activity-media-fullscreen) { padding: 0; }
  .activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-lightbox-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(190px, 42%) minmax(0, 58%); width: 100%; height: 100%; }
  .activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-lightbox-media-pane { padding: 46px 8px 4px; }
  .activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-interaction-comments { padding: 4px 14px; }
  .activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-comment-form { padding: 8px 14px max(12px, env(safe-area-inset-bottom)); }
  .activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-comment-compose textarea { min-height: 56px; }
  .activity-lightbox-media-pane { padding: 46px 8px 6px; }
  .activity-lightbox-stage img { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
  .activity-gallery-lightbox .activity-lightbox-stage video.activity-gallery-video { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; background: #000; }
  .activity-gallery-lightbox:not(.activity-media-fullscreen) .activity-lightbox-stage video.activity-gallery-video { place-self: start center; }
  .activity-lightbox-caption { margin: 6px 0 0; font-size: 11px; line-height: 1.3; }
  .activity-gallery-lightbox .activity-lightbox-close,
  .activity-detail-lightbox .activity-lightbox-close {
    position: fixed;
    z-index: 10003;
    top: calc(var(--activity-viewport-top, 0px) + max(12px, env(safe-area-inset-top)));
    right: max(12px, env(safe-area-inset-right));
    min-width: 76px;
  }
  .activity-drawer-close { display: none; }
  .activity-image-preview-action { display: none; }
  .activity-interaction-drawer > header { min-height: 48px; padding: 7px 12px; }
  .activity-interaction-drawer > header strong { font-size: 14px; }
  .activity-interaction-comments { padding: 2px 12px; }
  .activity-media-comment { padding: 8px 0; }
  .activity-comment-form { padding: 8px 12px max(10px, env(safe-area-inset-bottom)); }
  .activity-comment-compose textarea { min-height: 48px; resize: none; }
  .activity-comment-compose > div { margin-top: 6px; }
  .activity-gallery-lightbox.activity-comment-focused .activity-lightbox-layout { grid-template-rows: 70px minmax(0, 1fr); }
  .activity-comment-focused .activity-lightbox-media-pane { display: block; padding: 8px 60px 8px 12px; }
  .activity-comment-focused .activity-lightbox-stage { display: none; }
  .activity-comment-focused .activity-lightbox-caption { margin: 16px 0 0; text-align: left; }
  .activity-comment-focused .activity-interaction-drawer > header { min-height: 54px; padding-top: 8px; padding-bottom: 8px; }
  .activity-comment-focused .activity-interaction-comments { padding-top: 0; }
  .activity-gallery-lightbox.activity-media-zoomed .activity-lightbox-layout { grid-template-rows: minmax(0, 1fr); }
  .activity-gallery-lightbox.activity-media-zoomed .activity-lightbox-media-pane { display: grid; padding: 46px 8px 8px; }
  .activity-gallery-lightbox.activity-media-zoomed .activity-lightbox-stage { display: grid; }
  .activity-gallery-lightbox.activity-media-zoomed .activity-interaction-drawer { display: none; }
  .activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-media-pane { display: grid; padding: 0; }
  .activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-stage { display: grid; }
  .activity-gallery-lightbox.activity-media-fullscreen .activity-lightbox-layout { grid-template-rows: minmax(0, 1fr); }
  .activity-comment-form { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .study-session-link { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .study-session-counts { margin-top: 5px; }
  .study-session-item { align-items: flex-start; }
  .study-share-head,
  .study-share-head > div { align-items: flex-start; }
  .study-share-head > div { flex-direction: column; gap: 8px; }
  .study-file-grid { grid-template-columns: minmax(0, 1fr); }
  .study-media-frame { height: 230px; }
  .circle-composer-actions { align-items: stretch; flex-direction: column; }
  .circle-media-grid img, .circle-media-grid video { height: 170px; }
  .circle-media-count-1 img, .circle-media-count-1 video { height: min(430px, 110vw); }
  .circle-map-form { grid-template-columns: minmax(0, 1fr); }
  .circle-comment-item { grid-template-columns: minmax(0, 1fr) auto; }
  .circle-comment-avatar { grid-column: 1 / -1; }
  .circle-comment-form { grid-template-columns: minmax(0, 1fr); }
}

/* C menu: compact performance rail with hover/focus expansion. */
:root {
  --c-rail-bg: #fbfcfc;
  --c-rail-border: #dce6e3;
  --c-rail-shadow: rgba(35, 57, 51, .16);
  --c-rail-heading: #17322d;
  --c-rail-text: #587069;
  --c-rail-muted: #7d918b;
  --c-rail-hover: #edf6f3;
  --c-rail-accent: #10bba5;
  --c-rail-active-text: #053c35;
  --c-rail-avatar-border: #cadbd6;
  --c-rail-avatar-bg: #edf4f2;
  --c-rail-avatar-text: #36574f;
  --c-rail-live-glow: rgba(16, 187, 165, .28);
}

:root[data-theme="dark"] {
  --c-rail-bg: #101e1b;
  --c-rail-border: #29413b;
  --c-rail-shadow: rgba(4, 18, 15, .22);
  --c-rail-heading: #edf9f6;
  --c-rail-text: #8fa7a1;
  --c-rail-muted: #718a83;
  --c-rail-hover: #192c28;
  --c-rail-accent: #13c6b2;
  --c-rail-active-text: #073a34;
  --c-rail-avatar-border: #38534c;
  --c-rail-avatar-bg: #20342f;
  --c-rail-avatar-text: #cfe2dd;
  --c-rail-live-glow: rgba(19, 198, 178, .38);
}

body.c-menu-shell {
  font-family: "Segoe UI Variable", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.c-menu-shell .topbar.c-rail {
  z-index: 100;
  width: 78px;
  padding: 18px 13px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--c-rail-border);
  background: var(--c-rail-bg);
  color: var(--c-rail-heading);
  box-shadow: none;
  scrollbar-width: none;
  transition: width .34s cubic-bezier(.2, .75, .2, 1), box-shadow .34s ease;
}

.c-menu-shell .topbar.c-rail::-webkit-scrollbar { width: 0; }
.c-menu-shell .topbar.c-rail:hover,
.c-menu-shell .topbar.c-rail:focus-within {
  width: 238px;
  box-shadow: 18px 0 44px var(--c-rail-shadow);
}

.c-menu-shell .c-rail-brand {
  display: flex;
  align-items: center;
  width: 210px;
  gap: 12px;
  padding: 0 8px 22px;
  color: var(--c-rail-heading);
}

.c-menu-shell .c-rail-brand .brand-mark {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--c-rail-accent);
  color: var(--c-rail-active-text);
  font-size: 12px;
  font-weight: 800;
}

.c-rail-brand-copy {
  display: grid;
  gap: 2px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .2s ease .08s, transform .2s ease .08s;
}

.c-rail-brand-copy .brand-title {
  color: var(--c-rail-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
}

.c-rail-brand-copy small {
  color: var(--c-rail-muted);
  font-size: 9px;
  letter-spacing: .17em;
  white-space: nowrap;
}

.c-rail:hover .c-rail-brand-copy,
.c-rail:focus-within .c-rail-brand-copy {
  opacity: 1;
  transform: none;
}

.c-rail-status {
  display: flex;
  align-items: center;
  width: 210px;
  min-height: 34px;
  margin: 0 0 14px;
  padding: 0 13px;
  gap: 13px;
  color: var(--c-rail-muted);
  font-size: 10px;
  white-space: nowrap;
}

.c-rail-status > span {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-rail-accent);
  box-shadow: 0 0 0 0 var(--c-rail-live-glow);
  animation: c-rail-live 2.2s ease-out infinite;
}

.c-rail-status b {
  opacity: 0;
  font-weight: 600;
  transform: translateX(-8px);
  transition: opacity .18s ease .08s, transform .18s ease .08s;
}

.c-rail:hover .c-rail-status b,
.c-rail:focus-within .c-rail-status b {
  opacity: 1;
  transform: none;
}

.c-menu-shell .topbar.c-rail nav {
  display: grid;
  width: 210px;
  gap: 3px;
  margin: 0;
}

.c-menu-shell .topbar.c-rail nav a {
  position: relative;
  display: flex;
  align-items: center;
  width: 210px;
  min-height: 44px;
  margin: 0;
  padding: 0 10px;
  gap: 14px;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--c-rail-text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.c-menu-shell .topbar.c-rail nav a:hover {
  border: 0;
  background: var(--c-rail-hover);
  color: var(--c-rail-heading);
  transform: translateX(3px);
}

.c-menu-shell .topbar.c-rail nav a.active {
  border: 0;
  background: var(--c-rail-accent);
  color: var(--c-rail-active-text);
  animation: c-rail-active .34s cubic-bezier(.2, .75, .2, 1) both;
}

.c-nav-icon {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
}

.c-nav-icon svg {
  width: 18px;
  height: 18px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.c-nav-label {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .18s ease .08s, transform .18s ease .08s;
}

.c-rail:hover .c-nav-label,
.c-rail:focus-within .c-nav-label {
  opacity: 1;
  transform: none;
}

.c-menu-shell .topbar.c-rail .sidebar-footer {
  display: grid;
  width: 210px;
  gap: 5px;
  margin-top: auto;
  padding: 14px 0 0;
  overflow: hidden;
  border-top: 1px solid var(--c-rail-border);
  color: var(--c-rail-text);
}

.c-rail-user {
  display: flex;
  align-items: center;
  width: 210px;
  min-height: 42px;
  padding: 0 10px;
  gap: 13px;
}

.c-rail-user .member-identity {
  width: 190px;
  gap: 13px;
  color: var(--c-rail-heading);
  white-space: nowrap;
}

.c-rail-user .member-avatar,
.c-rail-admin-avatar {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--c-rail-avatar-border);
  border-radius: 50%;
  background: var(--c-rail-avatar-bg);
  color: var(--c-rail-avatar-text);
  font-size: 10px;
  object-fit: cover;
}

.c-rail-user .member-identity > span,
.c-rail-user-copy {
  display: grid;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .18s ease .08s, transform .18s ease .08s;
}

.c-rail-user small {
  color: var(--c-rail-muted);
  font-size: 10px;
}

.c-rail:hover .c-rail-user .member-identity > span,
.c-rail:focus-within .c-rail-user .member-identity > span,
.c-rail:hover .c-rail-user-copy,
.c-rail:focus-within .c-rail-user-copy {
  opacity: 1;
  transform: none;
}

.c-menu-shell .topbar.c-rail .c-rail-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 210px;
  min-height: 36px;
  margin: 0;
  padding: 0 14px;
  gap: 17px;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--c-rail-text);
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}

.c-menu-shell .topbar.c-rail .c-rail-action:hover {
  background: var(--c-rail-hover);
  color: var(--c-rail-heading);
}

.c-menu-shell .c-rail-action > span:last-child {
  opacity: 0;
  transition: opacity .18s ease .08s;
}

.c-menu-shell .c-rail:hover .c-rail-action > span:last-child,
.c-menu-shell .c-rail:focus-within .c-rail-action > span:last-child {
  opacity: 1;
}

.c-menu-shell .c-rail-action.theme-toggle {
  height: 36px;
  box-shadow: none;
}

.c-utility-icon,
.c-menu-shell .c-rail-action .theme-toggle-icon {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  margin: 0;
  color: currentColor;
  font-size: 12px;
}

.c-utility-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.c-menu-shell .topbar.c-rail .inline-action { display: block; margin: 0; }
.c-menu-shell .page { margin-left: 78px; }

@keyframes c-rail-live {
  70% { box-shadow: 0 0 0 8px rgba(19, 198, 178, 0); }
  100% { box-shadow: 0 0 0 0 rgba(19, 198, 178, 0); }
}

@keyframes c-rail-active {
  from { opacity: .35; transform: translateX(-7px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .c-menu-shell .topbar.c-rail,
  .c-menu-shell .topbar.c-rail:hover,
  .c-menu-shell .topbar.c-rail:focus-within {
    position: static;
    width: auto;
    min-height: auto;
    padding: 12px 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--c-rail-border);
    box-shadow: none;
  }

  .c-menu-shell .c-rail-brand { width: 100%; padding: 0 0 10px; }
  .c-menu-shell .c-rail-brand-copy,
  .c-menu-shell .c-rail-status b,
  .c-menu-shell .c-nav-label,
  .c-menu-shell .c-rail-user .member-identity > span,
  .c-menu-shell .c-rail-user-copy,
  .c-menu-shell .c-rail-action > span:last-child {
    opacity: 1;
    transform: none;
  }

  .c-menu-shell .c-rail-status { display: none; }
  .c-menu-shell .topbar.c-rail nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    width: 100%;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .c-menu-shell .topbar.c-rail nav a {
    display: grid;
    grid-template-columns: 24px auto;
    width: auto;
    min-height: 38px;
    padding: 0 10px;
    gap: 6px;
    border-radius: 10px;
  }

  .c-menu-shell .topbar.c-rail nav a:hover { transform: none; }
  .c-menu-shell .c-nav-icon { width: 24px; height: 24px; flex-basis: 24px; }
  .c-menu-shell .c-nav-icon svg { width: 16px; height: 16px; }
  .c-menu-shell .topbar.c-rail .sidebar-footer {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 3px;
    margin: 0;
    padding: 8px 0 0;
    overflow-x: auto;
  }

  .c-menu-shell .c-rail-user { width: auto; min-width: max-content; padding: 0 8px; }
  .c-menu-shell .c-rail-user .member-identity { width: auto; }
  .c-menu-shell .topbar.c-rail .c-rail-action { width: auto; min-width: max-content; padding: 0 9px; gap: 5px; }
  .c-menu-shell .page { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .c-menu-shell .topbar.c-rail,
  .c-menu-shell .topbar.c-rail *,
  .c-menu-shell .topbar.c-rail *::before,
  .c-menu-shell .topbar.c-rail *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.circle-composer-actions { justify-content: flex-end; }
.cloud-replica-banner {
  position: relative;
  z-index: 50;
  padding: 9px 20px;
  background: #fff4d8;
  border-bottom: 1px solid #e8c773;
  color: #684a00;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

[data-theme="dark"] .cloud-replica-banner { background: #342b14; border-bottom-color: #675524; color: #ffe3a0; }

.admin-action-card {
  margin: 0 0 22px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}
.admin-action-card.needs-attention { border-color: color-mix(in srgb, #d97706 42%, var(--border)); }
.admin-action-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.admin-action-heading span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.admin-action-heading h2 { margin: 4px 0 0; }
.admin-action-heading > small { color: var(--muted); }
.admin-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.admin-action-item { display: grid; gap: 5px; min-height: 104px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-muted); color: var(--text); text-decoration: none; }
.admin-action-item span, .admin-action-item small { color: var(--muted); }
.admin-action-item strong { font-size: 18px; }
.admin-action-item.is-ok { border-color: color-mix(in srgb, #17936f 35%, var(--border)); }
.admin-action-item.is-warn { border-color: color-mix(in srgb, #dc6b32 52%, var(--border)); background: color-mix(in srgb, #dc6b32 8%, var(--surface-muted)); }
.admin-action-item:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

.circle-filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.circle-filter-tabs a { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--muted); font-weight: 800; text-decoration: none; }
.circle-filter-tabs a:hover, .circle-filter-tabs a:focus-visible { border-color: var(--accent); color: var(--accent); }
.circle-filter-tabs a.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.circle-load-more { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 22px 0; }
.circle-load-more .secondary-action { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.circle-load-more span { color: var(--muted); font-size: 13px; }

.member-home-trend-note { margin: 14px 0 0; padding: 11px 14px; border-radius: 12px; background: var(--surface-muted); color: var(--muted); font-size: 13px; line-height: 1.65; }

@media (max-width: 900px) {
  .admin-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .cloud-replica-banner { padding-inline: 12px; text-align: left; }
  .admin-action-heading { align-items: start; flex-direction: column; }
  .admin-action-grid { grid-template-columns: 1fr; }
  .admin-action-item { min-height: 92px; }
  .circle-filter-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
