:root {
  color-scheme: dark;
  --bg: #111015;
  --surface: rgba(31, 28, 38, .88);
  --surface-2: rgba(42, 37, 50, .9);
  --surface-3: #302a39;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #f6f2f8;
  --muted: #aaa1b2;
  --accent: #d2a7ff;
  --accent-2: #ffb3d2;
  --accent-soft: rgba(210, 167, 255, .13);
  --good: #91e0bd;
  --warn: #ffd28a;
  --danger: #ff9f9f;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
  --radius: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 15%, rgba(154, 92, 255, .12), transparent 30%),
    radial-gradient(circle at 95% 8%, rgba(255, 105, 180, .09), transparent 26%),
    linear-gradient(180deg, #151219 0%, #0f0e12 100%);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .12;
  pointer-events: none;
  z-index: 0;
}
.ambient-a { left: -180px; top: 18%; background: #9a5cff; }
.ambient-b { right: -180px; bottom: 4%; background: #ff74ad; }

#app { position: relative; z-index: 1; min-height: 100vh; }

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.loader {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  align-items: stretch;
}

.auth-hero {
  padding: 72px clamp(34px, 7vw, 110px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(210,167,255,.07), rgba(255,179,210,.025));
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 750;
  letter-spacing: .06em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(210,167,255,.42);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(210,167,255,.18), rgba(255,179,210,.08));
  box-shadow: inset 0 0 18px rgba(210,167,255,.07);
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }

.auth-copy { max-width: 760px; padding: 70px 0; }
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.auth-copy h1 {
  margin: 14px 0 18px;
  font-size: clamp(44px, 6vw, 82px);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 760;
}
.auth-copy p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 16px;
}
.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 30px;
}
.pill {
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #d9d0df;
  background: rgba(255,255,255,.025);
  font-size: 12px;
}
.auth-foot { color: #716a78; font-size: 12px; }

.auth-panel {
  display: grid;
  place-items: center;
  padding: 38px clamp(24px, 5vw, 72px);
}
.auth-card { width: min(440px, 100%); }
.auth-card h2 { margin: 0 0 8px; font-size: 27px; letter-spacing: -.02em; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); line-height: 1.6; }
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.18);
  margin-bottom: 23px;
}
.segmented button {
  border: 0;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
}
.segmented button.active {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: 0 5px 16px rgba(0,0,0,.16);
}

.field { display: grid; gap: 7px; margin-bottom: 15px; }
.field[hidden] { display: none; }
.field label { color: #d9d2df; font-size: 13px; font-weight: 650; }
.field-help { color: #776f7e; font-size: 11px; line-height: 1.5; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(14, 12, 17, .68);
  color: var(--text);
  outline: none;
  padding: 12px 13px;
  transition: border .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  border-color: rgba(210,167,255,.62);
  box-shadow: 0 0 0 3px rgba(210,167,255,.08);
  background: rgba(20, 17, 24, .9);
}

.btn {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255,255,255,.045);
  font-weight: 680;
  transition: transform .14s ease, border .14s ease, background .14s ease, opacity .14s ease;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.07); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.btn-primary {
  border-color: transparent;
  color: #151117;
  background: linear-gradient(135deg, #d7b2ff, #f5b7d0);
  box-shadow: 0 12px 28px rgba(210,167,255,.13);
}
.btn-primary:hover { background: linear-gradient(135deg, #dfc1ff, #ffc2d8); }
.btn-danger { border-color: rgba(255,159,159,.24); color: #ffc1c1; background: rgba(255,159,159,.07); }
.btn[hidden] { display: none; }
.btn-good { border-color: rgba(145,224,189,.24); color: #b7efd5; background: rgba(145,224,189,.07); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-block { width: 100%; }
.btn-small { min-height: 34px; padding: 6px 10px; border-radius: 9px; font-size: 12px; }

.app-shell {
  width: min(1450px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px 20px;
  border-right: 1px solid var(--line);
  background: rgba(17,16,21,.68);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.sidebar .brand { padding: 0 8px; }
.side-nav { display: grid; gap: 5px; }
.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #9e96a6;
  background: transparent;
  text-align: left;
  font-weight: 620;
}
.nav-button:hover { color: #ddd4e3; background: rgba(255,255,255,.035); }
.nav-button.active {
  color: #f8f4fa;
  background: rgba(210,167,255,.10);
  border-color: rgba(210,167,255,.13);
}
.nav-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  font-size: 13px;
}
.sidebar-user {
  margin-top: auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.022);
}
.user-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #171219;
  font-weight: 800;
  background: linear-gradient(135deg, #d8b6ff, #f4bdd2);
}
.user-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-account { color: #786f80; font-size: 11px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .btn { margin-top: 10px; }

.main {
  min-width: 0;
  padding: 0 34px 70px;
}
.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.page-title { font-size: 15px; font-weight: 720; }
.page-subtitle { color: var(--muted); font-size: 12px; margin-top: 4px; }
.pair-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.028);
}
.role-badge {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #171219;
  font-weight: 850;
  font-size: 11px;
  background: var(--accent);
}
.role-badge.s { background: var(--accent-2); }
.pair-chip strong { font-size: 12px; }
.pair-chip span.meta { color: var(--muted); font-size: 11px; }

.content { max-width: 1180px; margin: 0 auto; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-head h1, .section-head h2 { margin: 0; letter-spacing: -.025em; }
.section-head h1 { font-size: clamp(28px, 4vw, 42px); }
.section-head h2 { font-size: 23px; }
.section-head p { margin: 7px 0 0; color: var(--muted); line-height: 1.6; font-size: 13px; }
.section-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 15px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(40,36,48,.82), rgba(27,24,32,.78));
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card-title { margin: 0; font-size: 14px; font-weight: 730; }
.card-label { color: #8f8698; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.metric {
  padding: 18px;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.metric-value { font-size: 32px; font-weight: 780; letter-spacing: -.045em; }
.metric-foot { color: #8e8597; font-size: 11px; }
.metric.accent { background: linear-gradient(155deg, rgba(210,167,255,.17), rgba(42,37,50,.78)); }
.metric.pink { background: linear-gradient(155deg, rgba(255,179,210,.13), rgba(42,37,50,.78)); }

.pair-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 4vw, 34px);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 80% 10%, rgba(210,167,255,.18), transparent 35%),
    linear-gradient(135deg, rgba(47,40,57,.95), rgba(27,24,31,.92));
}
.pair-hero::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  right: -85px;
  bottom: -125px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 0 0 38px rgba(255,255,255,.018), 0 0 0 76px rgba(255,255,255,.012);
}
.pair-names { display: flex; align-items: baseline; gap: 13px; flex-wrap: wrap; position: relative; z-index: 1; }
.pair-names strong { font-size: clamp(26px, 4vw, 44px); letter-spacing: -.045em; }
.pair-names .link { color: #84798d; font-size: 18px; }
.pair-roles { display: flex; gap: 8px; position: relative; z-index: 1; }
.role-name {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.12);
  font-size: 11px;
  color: #bbb2c2;
}

.list { display: grid; }
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-main { min-width: 0; }
.list-main strong { display: block; font-size: 13px; }
.list-main span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.list-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.empty {
  padding: 28px 18px;
  text-align: center;
  color: #817889;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.7;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #b7aebe;
  font-size: 10px;
  font-weight: 720;
}
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #8f8796; }
.status.pending::before, .status.submitted::before { background: var(--warn); }
.status.approved::before, .status.accepted::before, .status.done::before, .status.active::before { background: var(--good); }
.status.rejected::before, .status.declined::before { background: var(--danger); }
.status.ended::before { background: #8f8796; }

.form-card { padding: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.quick-create {
  margin: -2px 0 18px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,.12);
}
.quick-create-title {
  margin-bottom: 9px;
  color: #92899a;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .06em;
}
.quick-create-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.quick-item {
  min-width: 160px;
  max-width: 230px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255,255,255,.025);
  text-align: left;
}
.quick-item:hover {
  border-color: rgba(210,167,255,.30);
  background: rgba(210,167,255,.06);
}
.quick-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.quick-item span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #887f90;
  font-size: 10px;
}

.aggregate-section { margin-bottom: 4px; }
.aggregate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.aggregate-card {
  padding: 16px;
  min-height: 142px;
  display: flex;
  flex-direction: column;
}
.aggregate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.aggregate-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.aggregate-head span {
  flex: 0 0 auto;
  color: #8f8698;
  font-size: 10px;
}
.aggregate-main {
  margin-top: 18px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.aggregate-main b {
  font-size: 28px;
  line-height: 1;
  letter-spacing: -.04em;
}
.aggregate-main span {
  color: #a49baa;
  font-size: 11px;
}
.aggregate-foot {
  margin-top: auto;
  color: #8d8495;
  font-size: 10px;
  line-height: 1.5;
}

.reward-card, .task-card, .punishment-card { padding: 18px; min-height: 190px; display: flex; flex-direction: column; }
.grouped-card { padding: 18px; min-height: 210px; display: flex; flex-direction: column; }
.group-total { margin-top: 8px; display: flex; align-items: baseline; gap: 7px; }
.group-total strong { font-size: 30px; letter-spacing: -.05em; line-height: 1; }
.group-total span { color: #a49baa; font-size: 11px; }
.group-actions { margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.group-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 11px; }
.group-details summary { cursor: pointer; color: #aaa0b2; font-size: 11px; user-select: none; }
.group-details[open] summary { margin-bottom: 10px; }
.group-detail-list { display: grid; gap: 9px; }
.group-detail-row { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.group-detail-row .item-top h3 { font-size: 13px; }
.group-detail-row .item-copy { margin: 10px 0; font-size: 11px; }
.group-detail-row .item-bottom { margin-top: 10px; }
.item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.item-top h3 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.item-meta { color: #8e8596; font-size: 11px; margin-top: 6px; }
.item-copy { color: #b0a8b7; font-size: 12px; line-height: 1.65; margin: 16px 0; white-space: pre-wrap; }
.item-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reward-value { font-size: 12px; color: #d9cfe0; font-weight: 680; }

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  margin: 13px 0 7px;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c497f7, #f3a9c8);
}
.progress-label { color: #958c9d; font-size: 10px; }

.stamp-card {
  padding: clamp(22px, 4vw, 34px);
  background:
    radial-gradient(circle at 90% 8%, rgba(255,179,210,.15), transparent 31%),
    linear-gradient(150deg, rgba(47,40,57,.96), rgba(27,24,31,.93));
}
.stamp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.stamp-count { font-size: clamp(42px, 7vw, 72px); font-weight: 820; letter-spacing: -.07em; line-height: 1; }
.stamp-count small { font-size: 14px; color: var(--muted); letter-spacing: 0; font-weight: 650; }
.stamp-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(28px, 1fr));
  gap: 8px;
  margin-top: 28px;
}
.stamp-dot {
  aspect-ratio: 1;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.15);
  color: transparent;
  background: rgba(255,255,255,.02);
  font-size: 11px;
}
.stamp-dot.filled {
  border-style: solid;
  border-color: rgba(255,179,210,.28);
  color: #241620;
  background: linear-gradient(145deg, #d8b5ff, #ffb8d4);
  box-shadow: 0 6px 15px rgba(210,167,255,.10);
}
.stamp-reward { margin-top: 20px; color: #b9b0c1; font-size: 12px; line-height: 1.6; }

.stamp-reward-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.stamp-reward-card {
  min-height: 168px;
  padding: 17px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "cost main"
    "actions actions";
  gap: 13px;
  align-items: start;
}
.stamp-reward-card.affordable {
  border-color: rgba(210,167,255,.20);
  background: linear-gradient(155deg, rgba(210,167,255,.08), rgba(27,24,31,.84));
}
.stamp-reward-cost {
  grid-area: cost;
  min-width: 54px;
  min-height: 58px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}
.stamp-reward-cost strong { font-size: 22px; line-height: 1; }
.stamp-reward-cost span { margin-top: 4px; color: #8f8698; font-size: 10px; }
.stamp-reward-main { grid-area: main; min-width: 0; }
.stamp-reward-main h3 { margin: 1px 0 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.stamp-reward-main p { margin: 7px 0 0; color: #8f8698; font-size: 11px; }
.stamp-reward-actions {
  grid-area: actions;
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.calendar-list { display: grid; gap: 12px; }
.calendar-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.022);
}
.date-box {
  min-height: 62px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 13px;
  background: rgba(210,167,255,.075);
  border: 1px solid rgba(210,167,255,.1);
  color: #ded4e5;
}
.date-box strong { font-size: 20px; line-height: 1; }
.date-box span { margin-top: 4px; color: #968c9e; font-size: 10px; }
.calendar-main h3 { margin: 0; font-size: 14px; }
.calendar-main p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.calendar-action { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }

.leaderboard { overflow: hidden; }
.rank-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.rank-row:last-child { border-bottom: 0; }
.rank-no { color: #817789; font-size: 12px; font-variant-numeric: tabular-nums; }
.rank-row.top .rank-no { color: var(--accent); font-weight: 800; }
.rank-pair strong { font-size: 13px; }
.rank-pair span { color: #847b8c; font-size: 10px; margin-left: 7px; }
.rank-score { text-align: right; font-weight: 780; font-variant-numeric: tabular-nums; }
.rank-score small { color: #847b8c; font-size: 9px; font-weight: 620; }

.audit-list { display: grid; }
.audit-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.audit-row:last-child { border-bottom: 0; }
.audit-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(210,167,255,.06);
  color: #cfc3d7;
  font-size: 12px;
  font-weight: 780;
}
.audit-main { min-width: 0; }
.audit-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.audit-title strong { font-size: 13px; }
.audit-meta { margin-top: 5px; color: #857c8d; font-size: 10px; }
.audit-details {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: #a9a0b0;
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lobby-shell { min-height: 100vh; padding: 28px clamp(18px, 5vw, 68px) 60px; }
.lobby-top { max-width: 1180px; margin: 0 auto 34px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.lobby-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 18px; }
.lobby-hero { padding: clamp(24px, 4vw, 40px); min-height: 320px; display: flex; flex-direction: column; justify-content: space-between; }
.lobby-hero h1 { max-width: 700px; margin: 12px 0; font-size: clamp(34px, 5vw, 58px); line-height: 1.06; letter-spacing: -.05em; }
.lobby-hero p { max-width: 620px; color: var(--muted); line-height: 1.7; }
.invite-form { margin-top: 26px; display: grid; grid-template-columns: minmax(0,1fr) 150px auto; gap: 10px; }
.lobby-side { display: grid; gap: 18px; }

.split-note {
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid rgba(210,167,255,.11);
  background: rgba(210,167,255,.055);
  color: #bfb4c8;
  font-size: 11px;
  line-height: 1.65;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 18px);
  z-index: 50;
  max-width: min(440px, calc(100vw - 28px));
  padding: 11px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(34,30,40,.96);
  color: #f4eff7;
  box-shadow: 0 18px 46px rgba(0,0,0,.35);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255,159,159,.24); color: #ffd0d0; }

.mobile-nav { display: none; }
.muted { color: var(--muted); }
.tiny { font-size: 10px; }
.spacer-16 { height: 16px; }
.spacer-22 { height: 22px; }
.nowrap { white-space: nowrap; }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { min-height: 430px; border-right: 0; border-bottom: 1px solid var(--line); padding: 38px 28px; }
  .auth-copy { padding: 52px 0 18px; }
  .auth-foot { display: none; }
  .auth-panel { padding: 42px 24px 70px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 0 18px 95px; }
  .topbar { min-height: 74px; margin-bottom: 22px; }
  .mobile-nav {
    position: fixed;
    z-index: 30;
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 17px;
    background: rgba(27,24,32,.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 45px rgba(0,0,0,.35);
  }
  .mobile-nav .nav-button { display: grid; place-items: center; padding: 7px 3px; gap: 2px; font-size: 8px; text-align: center; }
  .mobile-nav .nav-icon { width: 25px; height: 25px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aggregate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stamp-reward-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lobby-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .auth-copy h1 { font-size: 44px; }
  .auth-hero { min-height: 360px; }
  .topbar { align-items: flex-start; padding: 15px 0; min-height: auto; }
  .pair-chip { align-self: center; }
  .pair-chip .meta { display: none; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .section-actions { width: 100%; }
  .section-actions .btn { flex: 1; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .aggregate-grid { grid-template-columns: 1fr; }
  .stamp-reward-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .invite-form { grid-template-columns: 1fr; }
  .calendar-row { grid-template-columns: 62px minmax(0, 1fr); }
  .calendar-action { grid-column: 1 / -1; justify-content: flex-start; padding-left: 78px; }
  .stamp-grid { grid-template-columns: repeat(5, 1fr); }
  .rank-row { grid-template-columns: 38px minmax(0, 1fr) 72px; padding: 13px 12px; gap: 9px; }
  .lobby-top { align-items: flex-start; }
  .lobby-top .user-row { flex: 1; }
}
