:root {
  --blue: #1769ff;
  --blue-dark: #0f4fc8;
  --blue-soft: #edf4ff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d7dee9;
  --soft: #f5f8ff;
  --green: #009241;
  --red: #ef4444;
  --amber: #f59e0b;
  --bg: #f5f7fb;
  --card: #ffffff;
  --shadow: 0 18px 40px rgba(17, 24, 39, 0.08);
  --shadow-soft: 0 8px 24px rgba(17, 24, 39, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

textarea {
  min-height: 116px;
  resize: vertical;
}

.boot {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--blue);
  font-size: 24px;
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 104px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(215, 222, 233, 0.92);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  min-width: 150px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0 4px;
  font-weight: 900;
  color: var(--ink);
}

button.brand:hover,
button.brand:focus-visible {
  background: transparent;
  outline: none;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav button,
.ghost,
.chip,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #374151;
  padding: 0 13px;
  white-space: nowrap;
  font-weight: 800;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav .icon,
.ghost .icon,
.small-button .icon,
.chip .icon {
  width: 16px;
  height: 16px;
}

.nav button.active,
.chip.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.nav button:hover,
.ghost:hover,
.small-button:hover,
.chip:hover {
  border-color: #bfd3ff;
  background: #f8fbff;
  color: var(--blue);
}

.nav button.active:hover,
.chip.active:hover {
  background: var(--blue-dark);
  color: #fff;
}

.account {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
  overflow: hidden;
}

.avatar img,
.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-button,
.icon-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.question-card,
.answer-card,
.notice-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.panel {
  padding: 18px;
}

.hero {
  display: grid;
  gap: 18px;
  padding: 26px 0 10px;
}

.simple-hero {
  grid-template-columns: minmax(0, 1fr);
}

.simple-hero .search-row {
  max-width: 720px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.12);
}

.primary,
.danger,
.success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  font-weight: 800;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.primary {
  background: var(--blue);
}

.primary:hover {
  background: var(--blue-dark);
}

.success {
  background: var(--green);
}

.danger {
  background: var(--red);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 10px;
}

.section-title h2,
.panel h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.section-title h2,
.panel h2 {
  font-size: 20px;
}

.panel h3 {
  font-size: 16px;
}

.muted {
  color: var(--muted);
}

.mini {
  font-size: 13px;
}

.question-list,
.answer-list,
.notice-list {
  display: grid;
  gap: 10px;
}

.admin-user-list,
.log-list {
  display: grid;
  gap: 8px;
}

.admin-user-search {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.user-edit-form {
  padding-top: 2px;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.log-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
  color: var(--muted);
  font-size: 12px;
}

.active-note {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.08);
}

.question-card,
.answer-card,
.notice-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.question-card:hover {
  border-color: #bfd3ff;
  box-shadow: var(--shadow-soft);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.card-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3151b7;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge.waiting {
  background: #fff7ed;
  color: #c2410c;
}

.badge.reserved {
  background: #eff6ff;
  color: #1d4ed8;
}

.badge.answered,
.badge.followUp {
  background: #ecfeff;
  color: #0e7490;
}

.badge.selected,
.badge.resolved {
  background: #ecfdf5;
  color: #047857;
}

.badge.hidden,
.badge.reported {
  background: #fef2f2;
  color: #b91c1c;
}

.professional-badge {
  background: #eef2ff;
  color: #1d4ed8;
}

.level-badge {
  background: #f8fafc;
  color: #334155;
}

.level-badge .icon,
.professional-badge .icon {
  width: 14px;
  height: 14px;
}

.rank-guide,
.ranking-list {
  display: grid;
  gap: 8px;
}

.rank-row,
.ranking-row {
  display: grid;
  align-items: center;
  gap: 10px;
}

.rank-row {
  grid-template-columns: 1fr auto;
}

.ranking-row {
  grid-template-columns: 28px 1fr auto;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.ranking-row:last-child {
  border-bottom: 0;
}

.ranking-row > strong {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
}

.ranking-name {
  margin-bottom: 5px;
  font-weight: 900;
}

.space-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: none;
}

.space-tabs::-webkit-scrollbar {
  display: none;
}

.space-panel > .section-title:first-child {
  margin-top: 4px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

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

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.03);
}

.stat strong {
  display: block;
  font-size: 25px;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.storage-panel,
.admin-storage-tools {
  display: grid;
  gap: 12px;
}

.storage-meter {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(23, 105, 255, 0.14);
  border-radius: 999px;
  background: #edf4ff;
}

.storage-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1769ff, #2dd4bf);
  transition: width 0.2s ease;
}

.storage-meter.over span {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

.storage-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.storage-summary div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.storage-summary strong {
  font-size: 18px;
}

.storage-summary span {
  color: var(--muted);
  font-size: 12px;
}

.storage-user-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding-right: 2px;
}

.storage-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.8fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.storage-user-row.over {
  border-color: rgba(239, 68, 68, 0.35);
  background: #fff7f7;
}

.storage-user-usage {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #374151;
  font-size: 12px;
  font-weight: 800;
}

.form {
  display: grid;
  gap: 12px;
}

.form label {
  display: grid;
  gap: 6px;
  color: #374151;
  font-weight: 700;
}

.legal-box,
.danger-zone,
.ad-slot {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.legal-box p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.legal-preview {
  border: 1px solid #dce6f5;
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
}

.legal-preview summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.legal-preview .policy-detail {
  margin-top: 10px;
  max-height: 280px;
  overflow: auto;
}

.policy-detail {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 13px;
}

.policy-detail h3,
.policy-detail p {
  margin: 0;
}

.policy-detail p {
  color: #4b5563;
  font-size: 13px;
  line-height: 1.55;
}

.danger-zone {
  background: #fff7f7;
}

.ad-slot {
  margin-top: 22px;
  min-height: 72px;
  place-items: center;
  color: var(--muted);
}

.note-textarea {
  min-height: 420px;
  line-height: 1.75;
  background-image: linear-gradient(to bottom, transparent 31px, #e8eef8 32px);
  background-size: 100% 32px;
}

.note-tabs {
  margin-bottom: 12px;
}

.note-list {
  max-height: 650px;
  overflow: auto;
  padding-right: 2px;
}

.note-card {
  cursor: pointer;
}

.note-card .note-thumb {
  aspect-ratio: 3 / 4;
  height: min(240px, 58vw);
}

.note-preview-card {
  display: grid;
  gap: 8px;
  width: min(360px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px;
  text-align: left;
}

.note-preview-card img,
.note-thumb,
.hand-note-summary img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  object-fit: contain;
}

.note-preview-card img {
  max-height: min(72vh, 720px);
}

.note-preview-card span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.note-inspector {
  position: sticky;
  top: 88px;
}

.hand-note-summary img {
  max-height: 420px;
  object-fit: contain;
}

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

.market-card .note-thumb {
  aspect-ratio: 3 / 4;
  height: min(320px, 78vw);
}

.note-full-preview {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
}

.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-photo-preview {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 24px;
  font-weight: 900;
}

.compact-select {
  width: min(220px, 100%);
}

.note-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  background: rgba(12, 18, 32, 0.72);
}

.note-editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1280px, 100%);
  height: min(920px, 100%);
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(207, 216, 231, 0.55);
  border-radius: 12px;
  background: #f7f9fd;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.note-editor-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 10px;
}

.note-title-input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  outline: none;
}

.note-editor-body {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  min-height: 0;
}

.note-toolrail {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 10px 8px;
}

.note-toolrail.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.note-toolrail .ghost {
  justify-content: flex-start;
  min-height: 40px;
  padding: 0 8px;
}

.note-toolrail .ghost.active {
  border-color: rgba(15, 107, 255, 0.12);
  background: #eef5ff;
  color: var(--blue);
}

.note-colors {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 4px;
}

.note-colors button {
  aspect-ratio: 1;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.note-colors button.active {
  box-shadow: 0 0 0 3px rgba(15, 107, 255, 0.22);
}

.note-size {
  width: 100%;
}

.hand-canvas-stage {
  min-height: 0;
  overflow: auto;
  background:
    radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.35) 1px, transparent 0) 0 0 / 18px 18px,
    #eef2f8;
  padding: 14px;
  touch-action: none;
}

#handCanvas {
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 36px rgba(16, 24, 40, 0.18);
  touch-action: none;
}

.compact-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

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

.field-block {
  display: grid;
  gap: 8px;
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 276px;
  overflow: auto;
  padding-bottom: 2px;
}

.answer-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.unit-grid {
  max-height: 94px;
  overflow: auto;
  padding-bottom: 2px;
}

.choice-btn {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #374151;
  padding: 0 12px;
  font-weight: 800;
}

.course-choice {
  display: grid;
  min-height: 64px;
  align-content: center;
  justify-items: start;
  gap: 3px;
  text-align: left;
}

.course-choice small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.course-choice.active small {
  color: rgba(255, 255, 255, 0.82);
}

.choice-btn.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.choice-btn:hover {
  border-color: #bfd3ff;
  background: #f8fbff;
  color: var(--blue);
}

.choice-btn.active:hover {
  background: var(--blue-dark);
  color: #fff;
}

.media-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.media-actions.single {
  grid-template-columns: 1fr;
}

.media-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  border: 1px solid #bfd3ff;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--blue);
  font-weight: 900;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.media-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.inline-check {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
}

.submit-wide {
  width: 100%;
}

.big-input {
  min-height: 142px;
}

.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-item {
  position: relative;
}

.preview-item button {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.image-preview img,
.question-image {
  max-width: 180px;
  max-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.hand-image-list {
  align-items: stretch;
}

.question-image-action {
  position: relative;
  display: grid;
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
}

.question-image-action img {
  display: block;
}

.question-image-action span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border-radius: 8px;
  background: rgba(15, 107, 255, 0.94);
  color: #fff;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.question-image-action .icon {
  width: 14px;
  height: 14px;
}

.detail {
  display: grid;
  gap: 16px;
}

.detail-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.content-box {
  white-space: pre-wrap;
  line-height: 1.65;
}

.bottom-ask {
  position: fixed;
  right: max(16px, calc((100vw - 1120px) / 2));
  bottom: 18px;
  z-index: 30;
  min-width: 128px;
  box-shadow: 0 14px 30px rgba(23, 105, 255, 0.24);
}

.mobile-tabbar {
  display: none;
}

.auth-wrap {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-card .brand {
  margin-bottom: 18px;
}

.auth-hidden-button {
  width: 100%;
  justify-content: center;
  margin: -4px 0 14px;
}

.public-hidden-wrap {
  align-items: flex-start;
  padding-top: 42px;
}

.public-hidden-card {
  width: min(760px, 100%);
}

.public-hidden-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.public-hidden-head .brand {
  margin: 0;
}

.guest-login-pill {
  justify-content: center;
  min-width: 106px;
}

.login-required-panel {
  display: grid;
  gap: 12px;
  max-width: 640px;
}

.auth-invite-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  margin-bottom: 14px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.auth-invite-notice svg {
  flex: 0 0 auto;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.tabs button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-weight: 800;
}

.tabs button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.toast {
  position: fixed;
  top: 76px;
  right: 18px;
  z-index: 240;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.compact-empty {
  padding: 14px;
  text-align: left;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.34);
  padding: 20px;
}

.tutorial-modal {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow);
}

.tutorial-modal h2 {
  margin: 0;
}

.document-viewer-backdrop {
  z-index: 220;
  padding: 18px;
}

.document-viewer-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  width: min(1100px, 100%);
  height: min(820px, calc(100vh - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow);
}

.document-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.document-viewer-head strong {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-viewer-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.document-viewer-actions {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

.document-viewer-frame {
  width: 100%;
  height: min(82dvh, 860px);
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #f8fafc;
}

.tutorial-steps {
  display: grid;
  gap: 10px;
}

.tutorial-steps div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.tutorial-steps strong {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.table th {
  background: #f9fafb;
  color: #374151;
}

.hide-mobile {
  display: inline;
}

@media (max-width: 820px) {
  body {
    background: #fff;
  }

  .topbar-inner,
  .container {
    width: min(100% - 24px, 1120px);
  }

  .topbar-inner {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0 8px;
  }

  .brand {
    min-width: auto;
  }

  .brand img {
    width: 42px;
    height: 42px;
  }

  .account {
    margin-left: auto;
  }

  .nav {
    order: 3;
    width: 100%;
    padding: 2px 0 4px;
  }

  .nav button {
    min-height: 34px;
    gap: 5px;
    padding: 0 10px;
    font-size: 13px;
  }

  .nav button .icon {
    width: 15px;
    height: 15px;
  }

  .grid.two,
  .grid.three,
  .split {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .note-textarea {
    min-height: 320px;
  }

  .hero {
    gap: 12px;
    padding: 16px 0 4px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero p {
    font-size: 15px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .inline-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .panel {
    padding: 14px;
  }

  .section-title {
    margin: 18px 0 9px;
  }

  .compact-title {
    align-items: flex-end;
  }

  .subject-grid,
  .category-grid,
  .answer-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-grid {
    grid-template-columns: 1fr;
    max-height: 300px;
  }

  .choice-btn {
    min-height: 46px;
  }

  .media-button {
    min-height: 64px;
  }

  .question-card,
  .answer-card,
  .notice-card {
    padding: 13px;
  }

  .card-head {
    align-items: flex-start;
  }

  .hide-mobile {
    display: none;
  }

  .bottom-ask {
    display: none;
  }

  .mobile-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    padding: 7px 8px max(7px, env(safe-area-inset-bottom));
  }

  .mobile-tabbar button {
    display: grid;
    gap: 3px;
    place-items: center;
    min-height: 48px;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-tabbar button .icon {
    width: 20px;
    height: 20px;
  }

  .mobile-tabbar button.active,
  .mobile-tabbar button:nth-child(4) {
    color: var(--blue);
  }

  .mobile-tabbar button:nth-child(4) .icon {
    width: 24px;
    height: 24px;
  }

  .app-shell {
    padding-bottom: 92px;
  }
}

/* Professional UI pass */
:root {
  --blue: #0f6bff;
  --blue-dark: #0b4fd1;
  --blue-soft: #edf5ff;
  --blue-tint: #f6f9ff;
  --ink: #101828;
  --muted: #667085;
  --line: #e6eaf2;
  --line-strong: #cfd8e7;
  --soft: #f7f9fc;
  --green: #078849;
  --red: #dc2626;
  --amber: #d97706;
  --bg: #f4f7fb;
  --card: #ffffff;
  --shadow: 0 18px 42px rgba(16, 24, 40, 0.10);
  --shadow-soft: 0 10px 28px rgba(16, 24, 40, 0.08);
  --radius: 8px;
}

html {
  min-width: 320px;
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    linear-gradient(180deg, #f8fbff 0, #f4f7fb 300px, #f7f9fc 100%);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button:focus-visible,
.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  outline: 3px solid rgba(15, 107, 255, 0.18);
  outline-offset: 2px;
}

.topbar {
  border-bottom: 1px solid rgba(207, 216, 231, 0.84);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.04);
}

.topbar-inner,
.container {
  width: min(1180px, calc(100% - 40px));
}

.topbar-inner {
  min-height: 68px;
  padding: 10px 0;
}

.brand {
  min-width: 142px;
  color: #0b1220;
  font-size: 16px;
}

.brand img {
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 5px 12px rgba(15, 107, 255, 0.14));
}

.nav {
  flex: 1;
  justify-content: center;
  gap: 4px;
}

.nav button,
.ghost,
.chip,
.small-button {
  min-height: 38px;
  border-color: transparent;
  background: transparent;
  color: #475467;
  padding: 0 11px;
  font-size: 14px;
  font-weight: 800;
}

.nav button:hover,
.ghost:hover,
.small-button:hover,
.chip:hover {
  border-color: #dbe7ff;
  background: #f5f9ff;
  color: var(--blue);
}

.nav button.active,
.chip.active {
  border-color: rgba(15, 107, 255, 0.12);
  background: #eef5ff;
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(15, 107, 255, 0.06);
}

.nav button.active:hover,
.chip.active:hover {
  background: #e3efff;
  color: var(--blue-dark);
}

.account {
  min-width: 190px;
  justify-content: flex-end;
  color: #344054;
  font-size: 14px;
  font-weight: 750;
}

.avatar {
  width: 32px;
  height: 32px;
  background: #e8f1ff;
  box-shadow: inset 0 0 0 1px rgba(15, 107, 255, 0.12);
}

.container {
  padding: 24px 0 48px;
}

.grid {
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  align-items: start;
}

.panel,
.question-card,
.answer-card,
.notice-card,
.stat,
.auth-card,
.tutorial-modal {
  border-color: rgba(207, 216, 231, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.panel {
  padding: 20px;
}

.hero {
  gap: 16px;
  border: 1px solid rgba(207, 216, 231, 0.78);
  border-radius: var(--radius);
  background: #fff;
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.hero h1 {
  font-size: clamp(36px, 4.2vw, 54px);
  letter-spacing: 0;
}

.hero p {
  color: #475467;
}

.search-row {
  grid-template-columns: minmax(0, 1fr) 108px;
}

.input,
.textarea,
.select {
  min-height: 46px;
  border-color: #d5deeb;
  border-radius: var(--radius);
  background: #fff;
  color: #101828;
  padding: 11px 13px;
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, 0.02);
}

.input::placeholder,
.textarea::placeholder {
  color: #98a2b3;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(15, 107, 255, 0.12);
}

.primary,
.danger,
.success {
  min-height: 44px;
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.10);
}

.primary {
  background: var(--blue);
}

.primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 10px 24px rgba(15, 107, 255, 0.22);
}

.success {
  background: var(--green);
}

.danger {
  background: var(--red);
}

.ghost,
.small-button {
  border-color: #d9e2ef;
  background: #fff;
}

.section-title {
  margin: 24px 0 12px;
}

.section-title h2,
.panel h2 {
  color: #101828;
  font-size: 19px;
  font-weight: 900;
}

.panel h3 {
  color: #101828;
  font-weight: 900;
}

.question-list,
.answer-list,
.notice-list {
  gap: 12px;
}

.question-card,
.answer-card,
.notice-card {
  gap: 11px;
  padding: 16px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.question-card:hover,
.notice-card:hover,
.answer-card:hover {
  border-color: #bcd2ff;
  box-shadow: var(--shadow-soft);
}

.question-card:hover {
  transform: translateY(-1px);
}

.card-head {
  align-items: flex-start;
}

.card-head h3,
.question-card strong,
.answer-card strong,
.notice-card strong {
  color: #101828;
  font-weight: 900;
}

.badge {
  min-height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #eef4ff;
  color: #2451b2;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.badge.waiting {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #b45309;
}

.badge.reserved {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.badge.answered,
.badge.followUp {
  border-color: #a5f3fc;
  background: #ecfeff;
  color: #0e7490;
}

.badge.selected,
.badge.resolved {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: #047857;
}

.badge.hidden,
.badge.reported {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.professional-badge {
  border-color: #bfdbfe;
  background: #eaf2ff;
  color: #0f5bdd;
}

.strong-professional-badge {
  border-color: #0f6bff;
  background: #0f6bff;
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 107, 255, 0.22);
}

.strong-professional-badge .icon {
  color: #fff;
}

.level-badge {
  border-color: #d8dee9;
  background: #f8fafc;
  color: #334155;
}

.meta {
  gap: 7px 10px;
  color: #667085;
}

.stats {
  gap: 12px;
}

.stat {
  padding: 16px;
}

.stat strong {
  color: #101828;
  font-size: 24px;
  font-weight: 950;
}

.stat span {
  color: #667085;
  font-weight: 750;
}

.legal-box,
.danger-zone,
.ad-slot,
.policy-detail {
  border-color: #dce6f5;
  border-radius: var(--radius);
  background: #f8fbff;
}

.danger-zone {
  border-color: #fecaca;
  background: #fff8f8;
}

.policy-detail {
  box-shadow: inset 3px 0 0 rgba(15, 107, 255, 0.42);
}

.choice-btn,
.media-button,
.tabs button {
  border-radius: var(--radius);
}

.choice-grid,
.chips {
  gap: 7px;
}

.choice-btn {
  min-height: 44px;
  border-color: #d5deeb;
  color: #344054;
}

.choice-btn:hover {
  border-color: #bcd2ff;
  background: #f5f9ff;
}

.choice-btn.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 107, 255, 0.18);
}

.course-choice {
  min-height: 68px;
}

.media-button {
  min-height: 62px;
  border-color: #bcd2ff;
  background: #f5f9ff;
}

.media-button .icon {
  width: 22px;
  height: 22px;
}

.image-preview img,
.question-image {
  border-color: #d5deeb;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
}

.content-box {
  color: #1d2939;
  line-height: 1.72;
}

.detail {
  gap: 18px;
}

.detail-title h1 {
  margin: 12px 0 8px;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: 0;
}

.community-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.community-sidebar {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 10px;
}

.community-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border: 1px solid #d9e2ef;
  border-left: 4px solid var(--board-color, var(--blue));
  border-radius: var(--radius);
  background: #fff;
  color: #344054;
  padding: 0 12px;
  text-align: left;
  font-weight: 900;
}

.community-board span {
  color: #667085;
  font-size: 12px;
}

.community-board.active {
  border-color: #bcd2ff;
  border-left-color: var(--blue);
  background: #eef5ff;
  color: var(--blue);
}

.community-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.community-write {
  gap: 10px;
}

.compact-form {
  gap: 10px;
}

.compact-form h3 {
  margin: 0;
}

.compact-textarea {
  min-height: 92px;
}

.community-feed {
  display: grid;
  gap: 12px;
}

.compact-feed {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.community-post-card {
  display: grid;
  gap: 11px;
  border: 1px solid rgba(207, 216, 231, 0.82);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.community-post-card:hover {
  border-color: #bcd2ff;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.community-post-card h3 {
  margin: 7px 0 0;
  font-size: 18px;
  line-height: 1.35;
}

.community-thumb-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.community-thumb-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid #d5deeb;
  border-radius: var(--radius);
  object-fit: cover;
}

.document-insert-panel {
  gap: 10px;
}

.document-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(130px, 180px);
  gap: 10px;
  align-items: stretch;
}

.document-button {
  min-height: 44px;
}

.document-server-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #f8fbff;
  color: #174a8b;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.document-compress-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #bfd4f8;
  border-radius: 8px;
  background: #eef5ff;
  color: #174a8b;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 900;
}

.document-compress-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #1769ff;
}

.document-compress-toggle span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.document-preview-list,
.document-attachment-list {
  display: grid;
  gap: 8px;
}

.document-preview-item,
.document-attachment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px;
  color: #1d2939;
}

.document-attachment:hover {
  border-color: #9fc0ff;
  background: #f0f6ff;
}

.document-attachment.expired {
  opacity: 0.62;
  cursor: not-allowed;
}

.document-type {
  min-width: 48px;
  border-radius: 8px;
  background: #174a8b;
  color: #fff;
  padding: 7px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 950;
}

.document-main,
.document-preview-item div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.document-main strong,
.document-preview-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-main small,
.document-preview-item small {
  color: #667085;
  font-size: 12px;
}

.document-preview-item button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 900;
}

.document-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.document-actions a,
.document-actions button {
  min-height: 34px;
  text-decoration: none;
}

.document-inline-preview {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  height: clamp(540px, 78dvh, 900px);
  border: 1px solid #cfd9ea;
  border-radius: 10px;
  background: #f8fafc;
}

.compact-documents {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.bottom-ask {
  right: max(18px, calc((100vw - 1180px) / 2));
  bottom: 20px;
  min-width: 134px;
  box-shadow: 0 18px 36px rgba(15, 107, 255, 0.24);
}

.auth-wrap {
  background: linear-gradient(180deg, #f8fbff 0, #eef5ff 100%);
}

.auth-card {
  width: min(440px, 100%);
  padding: 26px;
  box-shadow: var(--shadow);
}

.tabs {
  border: 1px solid #dce6f5;
  border-radius: var(--radius);
  background: #f8fbff;
  padding: 4px;
}

.tabs button {
  border: 0;
  background: transparent;
}

.tabs button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
}

.empty {
  border-color: #d5deeb;
  background: #fbfcff;
}

.table {
  display: block;
  overflow-x: auto;
  border-color: #dce6f5;
  background: #fff;
}

.table th {
  background: #f8fbff;
  white-space: nowrap;
}

.table td {
  min-width: 92px;
}

.rank-row,
.ranking-row {
  border-color: #edf1f7;
}

.ranking-row > strong {
  background: #edf5ff;
}

@media (min-width: 821px) {
  .nav button span {
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .panel:has(.form),
  .panel:has(.notice-list),
  .panel:has(.question-list) {
    align-self: start;
  }
}

@media (max-width: 820px) {
  body {
    background: #fff;
    font-size: 14px;
  }

  .topbar {
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.05);
  }

  .topbar-inner,
  .container {
    width: min(100% - 24px, 1180px);
  }

  .topbar-inner {
    min-height: 60px;
    padding: 9px 0;
  }

  .brand {
    min-width: 0;
    font-size: 15px;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .account {
    min-width: 0;
    gap: 5px;
  }

  .avatar {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .nav {
    order: 3;
    justify-content: flex-start;
    width: 100%;
    gap: 6px;
    padding: 4px 0 2px;
  }

  .nav button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .container {
    padding: 16px 0 34px;
  }

  .hero {
    gap: 13px;
    padding: 18px;
    box-shadow: none;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero p {
    font-size: 14px;
  }

  .search-row,
  .grid.two,
  .grid.three,
  .split,
  .community-layout,
  .compact-feed {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat {
    padding: 13px;
  }

  .stat strong {
    font-size: 21px;
  }

  .panel {
    padding: 15px;
  }

  .question-card,
  .answer-card,
  .notice-card {
    padding: 14px;
  }

  .card-head,
  .detail-title {
    gap: 10px;
  }

  .detail-title {
    display: grid;
  }

  .detail-title h1 {
    font-size: 25px;
  }

  .section-title {
    margin: 20px 0 10px;
  }

  .section-title h2,
  .panel h2 {
    font-size: 18px;
  }

  .primary,
  .danger,
  .success,
  .input,
  .select {
    min-height: 46px;
  }

  .textarea {
    min-height: 120px;
  }

  .inline-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .inline-fields .input {
    padding-inline: 9px;
  }

  .subject-grid,
  .category-grid,
  .answer-type-grid,
  .grade-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-grid {
    grid-template-columns: 1fr;
    max-height: 312px;
  }

  .choice-btn {
    min-height: 48px;
    padding-inline: 10px;
  }

  .media-button {
    min-height: 66px;
  }

  .image-preview img,
  .question-image {
    max-width: min(46vw, 170px);
    max-height: 170px;
  }

  .ranking-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
  }

  .community-sidebar {
    position: static;
  }

  .community-board {
    min-height: 44px;
  }

  .community-post-card {
    padding: 14px;
  }

  .ranking-row .badges {
    gap: 4px;
  }

  .table {
    border-radius: var(--radius);
  }

  .hide-mobile {
    display: none;
  }

  .bottom-ask {
    display: none;
  }

  .mobile-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid rgba(207, 216, 231, 0.9);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    padding: 7px 7px max(7px, env(safe-area-inset-bottom));
  }

  .mobile-tabbar button {
    display: grid;
    gap: 3px;
    place-items: center;
    min-width: 0;
    min-height: 48px;
    border-radius: var(--radius);
    color: #667085;
    font-size: 10px;
    font-weight: 900;
  }

  .mobile-tabbar button span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tabbar button .icon {
    width: 19px;
    height: 19px;
  }

  .mobile-tabbar button.active,
  .mobile-tabbar button:nth-child(4) {
    background: #edf5ff;
    color: var(--blue);
  }

  .mobile-tabbar button:nth-child(4) .icon {
    width: 23px;
    height: 23px;
  }

  .app-shell {
    padding-bottom: 92px;
  }
}

@media (max-width: 420px) {
  .topbar-inner,
  .container {
    width: min(100% - 18px, 1180px);
  }

  .hero {
    padding: 15px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .stats {
    gap: 8px;
  }

  .stat {
    padding: 12px;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }

  .subject-grid,
  .category-grid,
  .answer-type-grid,
  .grade-grid {
    grid-template-columns: 1fr;
  }

  .mobile-tabbar {
    padding-inline: 4px;
  }

  .mobile-tabbar button {
    font-size: 9px;
  }
}

@media (max-width: 820px) {
  .topbar-inner {
    flex-wrap: nowrap;
  }

  .topbar .nav {
    display: none;
  }

  .topbar .account {
    margin-left: auto;
    min-width: 0;
  }

  .topbar .brand {
    min-width: 0;
  }

  .space-tabs .chip {
    min-height: 38px;
    padding: 0 10px;
  }

  .note-editor {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .note-editor-top {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .note-editor-top .chips {
    grid-column: 1 / -1;
  }

  .note-editor-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .note-toolrail {
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .note-toolrail .ghost span {
    display: none;
  }

  .note-colors {
    display: flex;
    min-width: 112px;
  }

  .note-colors button {
    width: 28px;
  }

  .market-grid {
    grid-template-columns: 1fr;
  }

  .note-inspector {
    position: static;
  }
}

@media (max-width: 420px) {
  .space-tabs {
    gap: 4px;
  }

  .space-tabs .chip {
    gap: 4px;
    min-height: 36px;
    padding: 0 7px;
    font-size: 12px;
  }

  .space-tabs .chip .icon {
    width: 14px;
    height: 14px;
  }
}

/* Original-logo minimalism pass */
:root {
  --blue: #174a8b;
  --blue-dark: #0d3264;
  --blue-soft: #f1f6fc;
  --ink: #121417;
  --muted: #6a7280;
  --line: #e7eaee;
  --line-strong: #d9dee6;
  --bg: #ffffff;
  --card: #ffffff;
  --shadow: none;
  --shadow-soft: none;
  --radius: 8px;
}

body {
  background: #fff;
  color: var(--ink);
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.topbar-inner,
.container {
  width: min(1040px, calc(100% - 32px));
}

.topbar-inner {
  min-height: 64px;
}

.brand {
  gap: 9px;
  min-width: 134px;
  font-size: 15px;
  font-weight: 900;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 0;
  filter: none;
}

.nav {
  gap: 2px;
}

.nav button,
.ghost,
.chip,
.small-button {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #4b5563;
}

.nav button.active,
.chip.active {
  border-color: transparent;
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: none;
}

.nav button:hover,
.ghost:hover,
.small-button:hover,
.chip:hover {
  border-color: transparent;
  background: #f7f9fb;
  color: var(--blue);
}

.hero,
.panel,
.question-card,
.answer-card,
.notice-card,
.community-post-card,
.stat,
.auth-card,
.tutorial-modal {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.hero {
  padding: 20px 0;
  border-width: 0 0 1px;
  border-radius: 0;
}

.hero h1 {
  font-size: 42px;
  line-height: 1.08;
}

.hero p {
  color: var(--muted);
}

.primary,
.danger,
.success {
  box-shadow: none;
}

.primary {
  background: var(--blue);
}

.primary:hover {
  background: var(--blue-dark);
  box-shadow: none;
}

.input,
.textarea,
.select {
  border-color: var(--line-strong);
  box-shadow: none;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 74, 139, 0.1);
}

.choice-btn {
  border-color: var(--line);
  background: #fff;
  color: #1f2937;
  box-shadow: none;
}

.choice-btn.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: none;
}

.minimal-compose {
  width: min(720px, 100%);
  margin: 0 auto;
  gap: 12px;
  padding: 18px;
}

.compose-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.compose-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 950;
}

.compose-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.simple-category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.simple-category-grid .choice-btn {
  min-height: 42px;
}

.compose-textarea {
  min-height: 132px;
  border-color: var(--line-strong);
  font-size: 16px;
  line-height: 1.55;
}

.compact-textarea.compose-textarea {
  min-height: 92px;
}

.advanced-fields {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.advanced-fields summary {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.ask-advanced-fields {
  border: 1px solid rgba(23, 105, 255, 0.22);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(23, 105, 255, 0.07), rgba(255, 255, 255, 0.96));
}

.ask-advanced-fields summary {
  width: 100%;
  min-height: 48px;
  justify-content: space-between;
  gap: 10px;
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--blue);
  box-shadow: 0 8px 24px rgba(23, 105, 255, 0.12);
  font-size: 15px;
}

.ask-advanced-fields summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.advanced-fields[open] {
  display: grid;
  gap: 12px;
}

.advanced-fields[open] summary {
  margin-bottom: 2px;
}

.media-button {
  min-height: 52px;
  border-color: var(--line);
  background: #fff;
  color: var(--blue);
  box-shadow: none;
}

.media-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.image-preview img,
.question-image {
  box-shadow: none;
}

.community-modern {
  display: grid;
  gap: 14px;
  width: min(800px, 100%);
  margin: 0 auto;
}

.community-board-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.community-board-row::-webkit-scrollbar {
  display: none;
}

.community-board {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 12px;
}

.community-board.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.board-create-details {
  width: min(720px, 100%);
  margin: 0 auto;
  border-top: 0;
  padding-top: 0;
}

.community-write {
  width: min(720px, 100%);
  margin: 0 auto;
}

.community-study-room {
  display: grid;
  gap: 14px;
  border-color: color-mix(in srgb, var(--study-color) 22%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--study-color) 7%, #fff), #fff 52%);
}

.study-room-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.study-room-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.study-room-head-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.invite-button {
  border-color: color-mix(in srgb, var(--study-color) 30%, var(--line));
  color: color-mix(in srgb, var(--study-color) 85%, #111827);
  font-weight: 800;
}

.study-summary-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.study-summary-pills span {
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  text-align: right;
}

.study-summary-pills b,
.study-summary-pills small {
  display: block;
}

.study-summary-pills b {
  font-size: 15px;
}

.study-summary-pills small {
  color: var(--muted);
  font-size: 11px;
}

.community-invite-box,
.invite-landing-panel {
  border: 1px solid color-mix(in srgb, var(--study-color, #1769ff) 24%, var(--line));
  border-radius: 10px;
  background: rgba(255, 255, 255, .9);
}

.community-invite-box {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(180px, 1.5fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.community-invite-box strong,
.community-invite-box span {
  display: block;
}

.community-invite-box strong {
  font-size: 14px;
}

.community-invite-box span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.invite-landing-panel {
  display: grid;
  gap: 6px;
  max-width: 520px;
  margin: 28px auto;
  padding: 18px;
}

.study-room-grid {
  display: grid;
  grid-template-columns: minmax(240px, .9fr) minmax(260px, 1.1fr);
  gap: 12px;
}

.study-timer-card,
.study-leaderboard {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  padding: 14px;
}

.study-timer-card {
  display: grid;
  gap: 12px;
}

.study-timer-card.is-active {
  border-color: color-mix(in srgb, var(--study-color) 48%, var(--line));
  box-shadow: 0 18px 36px rgba(15, 23, 42, .08);
}

.study-timer-ring {
  display: grid;
  place-items: center;
  min-height: 148px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 48%, transparent 49%),
    conic-gradient(from -90deg, color-mix(in srgb, var(--study-color) 76%, #111827) 0 72%, #e5e7eb 73% 100%);
  text-align: center;
}

.study-timer-ring strong,
.study-timer-ring span {
  grid-area: 1 / 1;
}

.study-timer-ring strong {
  align-self: center;
  font-size: 24px;
  letter-spacing: 0;
}

.study-timer-ring span {
  align-self: end;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 12px;
}

.study-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.study-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--study-color), #16a34a);
  transition: width .25s ease;
}

.study-confirm-alert {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffbeb, #fff7ed);
  color: #78350f;
}

.study-confirm-alert strong {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #92400e;
}

.study-confirm-alert p {
  margin: 0;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.45;
}

.study-start-warning {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(245, 158, 11, 0.26);
  border-radius: 12px;
  background: #fffbeb;
  color: #78350f;
}

.study-start-warning strong {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #92400e;
}

.study-start-warning p {
  margin: 0;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.45;
}

.study-notification-button {
  justify-content: center;
}

.study-start-form {
  display: grid;
  gap: 8px;
}

.study-start-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.study-stopwatch-face {
  display: grid;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--study-color) 28%, #dbe4f0);
  border-radius: 10px;
  background:
    linear-gradient(180deg, #0f172a, #172033),
    #0f172a;
  color: #dbeafe;
  padding: 16px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.study-stopwatch-face span,
.study-stopwatch-face small {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 900;
}

.study-stopwatch-face strong {
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 32px;
  letter-spacing: 0;
  line-height: 1.1;
}

.study-extra-timers {
  display: grid;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
}

.quick-timer-row,
.quick-timer-custom {
  display: flex;
  gap: 6px;
}

.quick-timer-row .small-button {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 6px;
}

.quick-timer-custom input {
  min-width: 0;
}

.exam-timer-list {
  display: grid;
  gap: 6px;
}

.exam-timer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid #dce6f3;
  border-radius: 8px;
  background: #fff;
  padding: 7px 8px;
}

.exam-timer span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.exam-timer strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
}

.exam-timer.done {
  border-color: rgba(239, 68, 68, .35);
  background: #fff1f2;
  color: #991b1b;
}

.board-note-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 1fr) auto;
  gap: 8px;
  align-items: end;
  border: 1px solid #d7e3f1;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.board-note-form > div:first-child {
  display: grid;
  gap: 3px;
  align-self: center;
}

.board-note-form > div:first-child span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.board-position-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.board-position-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.board-note-color-row {
  display: flex;
  gap: 5px;
  align-self: center;
}

.board-note-color-row button {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--note-color);
  padding: 0;
  box-shadow: 0 0 0 1px #cbd5e1;
}

.board-note-color-row button.active {
  box-shadow: 0 0 0 2px var(--blue);
}

.study-leaderboard {
  display: grid;
  align-content: start;
  gap: 8px;
}

.mini-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.mini-title strong {
  color: var(--text);
  font-size: 14px;
}

.study-rank {
  display: grid;
  grid-template-columns: 28px 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
}

.study-rank.me {
  border-color: color-mix(in srgb, var(--study-color) 42%, var(--line));
  background: color-mix(in srgb, var(--study-color) 8%, #fff);
}

.rank-no {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.study-rank strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-rank em {
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  padding: 3px 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.study-rank b {
  font-size: 12px;
  white-space: nowrap;
}

.study-active-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.study-active-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 6px 9px;
}

.study-active-list img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.study-active-list small {
  color: var(--muted);
}

.visual-study-grid {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 340px);
  align-items: start;
}

.study-side-stack {
  display: grid;
  gap: 12px;
}

.study-classroom {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--study-color) 25%, #cbd5e1);
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc, #ffffff 52%, #eef6ff);
  padding: 12px;
  perspective: 900px;
}

.study-classroom::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, .04) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px) 0 0 / 42px 42px;
  opacity: .45;
}

.classroom-board,
.classroom-floor,
.classroom-caption {
  position: relative;
  z-index: 2;
}

.classroom-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-height: 78px;
  align-items: stretch;
  overflow: hidden;
  border: 5px solid #8b5e34;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .08), transparent 38%),
    #17423c;
  color: #e8fff5;
  font-size: 20px;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(15, 23, 42, .16);
  transform: rotateX(3deg);
}

.board-main-area {
  position: relative;
  display: grid;
  min-height: 92px;
  place-items: center;
  overflow: hidden;
  border-radius: 5px;
}

.board-main-area > img {
  width: 100%;
  height: 100%;
  max-height: 128px;
  object-fit: cover;
}

.class-board-note {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 2px;
  width: min(148px, 30%);
  min-height: 58px;
  border: 1px solid rgba(120, 53, 15, .18);
  border-radius: 3px;
  background: var(--note-color, #fff7ad);
  color: #3b2f12;
  padding: 8px 8px 6px;
  text-align: left;
  transform: translate(-50%, -50%) rotate(-1.2deg);
  box-shadow: 0 9px 18px rgba(15, 23, 42, .22);
}

.class-board-note:nth-child(2n) {
  transform: translate(-50%, -50%) rotate(1.4deg);
}

.class-board-note strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-size: 12px;
  line-height: 1.28;
}

.class-board-note span {
  overflow: hidden;
  color: rgba(59, 47, 18, .72);
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pinned-note::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .22);
  transform: translateX(-50%);
}

.class-board-note-ghost {
  pointer-events: none;
  opacity: .72;
  outline: 2px dashed rgba(255, 255, 255, .72);
}

.board-note-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.board-note-actions button {
  min-height: 20px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #3b2f12;
  padding: 0 6px;
  font-size: 9px;
  font-weight: 950;
}

.study-classroom-set {
  display: grid;
  gap: 12px;
}

.classroom-floor {
  overflow: auto;
  max-height: 540px;
  border: 1px solid rgba(100, 116, 139, .24);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(180, 122, 62, .16) 0 18px, rgba(145, 94, 45, .18) 18px 20px),
    linear-gradient(180deg, #fff7ed, #eef6ff);
  padding: 18px 14px 22px;
  box-shadow: inset 0 8px 22px rgba(15, 23, 42, .08);
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 14px 12px;
  min-width: 0;
}

.study-seat {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 30px;
  grid-template-rows: auto auto;
  gap: 5px 8px;
  align-items: center;
  min-height: 96px;
  border: 1px solid rgba(120, 79, 37, .32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .5), transparent 40%),
    linear-gradient(135deg, #f4c27a, #b8793c);
  color: #22160b;
  padding: 10px 9px 8px;
  box-shadow: 0 10px 0 #825329, 0 16px 24px rgba(15, 23, 42, .16);
  transform: translateZ(0);
}

.study-seat::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -13px;
  height: 10px;
  border-radius: 0 0 8px 8px;
  background: rgba(77, 48, 24, .34);
}

.study-seat strong,
.study-seat small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-seat strong {
  font-size: 13px;
}

.study-seat small {
  color: rgba(34, 22, 11, .72);
  font-size: 11px;
  font-weight: 900;
}

.seat-rank {
  position: absolute;
  top: 6px;
  right: 7px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: #6b3f16;
  font-size: 10px;
  font-weight: 950;
}

.desk-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  overflow: hidden;
  grid-row: 1 / 3;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  background: #eef6ff;
  color: var(--study-color);
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .16);
}

.desk-avatar img,
.desk-avatar span {
  width: 100%;
  height: 100%;
}

.desk-avatar img {
  object-fit: cover;
}

.desk-avatar span {
  display: grid;
  place-items: center;
}

.desk-note {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  overflow: hidden;
  grid-row: 1 / 3;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 6px;
  background: rgba(255, 255, 255, .55);
  color: #17423c;
  padding: 0;
}

.desk-note img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ghost-note {
  opacity: .45;
}

.studying-seat {
  border-color: color-mix(in srgb, var(--study-color) 58%, #a16207);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .45), transparent 44%),
    linear-gradient(135deg, #ffd38d, color-mix(in srgb, var(--study-color) 24%, #b8793c));
}

.sleeping-seat {
  filter: saturate(.74);
  opacity: .72;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55), transparent 42%),
    linear-gradient(135deg, #dec7ad, #9a7a5d);
}

.my-seat {
  outline: 3px solid rgba(23, 105, 255, .22);
  outline-offset: 2px;
}

.focus-spark,
.sleep-mark {
  position: absolute;
  left: 10px;
  bottom: 7px;
  font-size: 10px;
  font-weight: 950;
}

.focus-spark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
  animation: focusPulse 1.5s infinite;
}

.sleep-mark {
  display: inline-flex;
  gap: 1px;
  color: #334155;
  letter-spacing: 0;
}

.sleep-mark i {
  font-style: normal;
  animation: sleepFloat 2.4s ease-in-out infinite;
}

.sleep-mark i:nth-child(2) {
  animation-delay: .22s;
}

.sleep-mark i:nth-child(3) {
  animation-delay: .44s;
}

.empty-seat {
  min-height: 78px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .4), transparent),
    rgba(255, 255, 255, .42);
  border-style: dashed;
  box-shadow: inset 0 -6px 0 rgba(148, 163, 184, .18);
  color: rgba(71, 85, 105, .52);
}

.empty-seat::after {
  display: none;
}

.desk-line {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .28);
}

.desk-empty-label {
  grid-column: 1 / -1;
  min-height: 16px;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.classroom-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

@keyframes focusPulse {
  70% {
    box-shadow: 0 0 0 9px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@keyframes sleepFloat {
  0%, 100% {
    opacity: .35;
    transform: translateY(2px) scale(.88);
  }
  45% {
    opacity: 1;
    transform: translateY(-7px) scale(1.08);
  }
}

.wordmaster-page {
  display: grid;
  gap: 14px;
}

.wordmaster-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-color: #c7d2fe;
  background: linear-gradient(135deg, #eef2ff 0%, #fff 58%);
}

.wordmaster-notice h3 {
  margin: 4px 0 6px;
  font-size: 20px;
}

.wordmaster-board {
  display: grid;
  gap: 12px;
}

.wordmaster-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wordmaster-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 74px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 12px 14px;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--liquid-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.wordmaster-stat strong {
  color: var(--blue-dark);
  font-size: 24px;
  font-weight: 950;
}

.wordmaster-stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.wordmaster-stat.action {
  cursor: pointer;
}

.wordmaster-stat.action .icon {
  color: var(--amber);
}

.wordmaster-days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.wordmaster-days::-webkit-scrollbar {
  display: none;
}

.word-day-chip {
  min-height: 44px;
}

.word-day-chip span {
  font-weight: 900;
}

.word-day-chip b,
.word-day-chip small {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.24);
  padding: 0 6px;
  font-size: 12px;
  font-weight: 900;
}

.word-day-chip:not(.active) b,
.word-day-chip:not(.active) small {
  background: rgba(20, 104, 255, 0.08);
  color: var(--blue-dark);
}

.wordmaster-test {
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.wordmaster-test-head {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.word-question-card {
  display: grid;
  gap: 14px;
}

.word-question-card h3 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
}

.word-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.word-options button {
  min-height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 850;
}

.word-options button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.word-options button.correct {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
}

.word-options button.wrong {
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}

.word-spell-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.word-prefix {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
}

.word-result {
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 900;
}

.word-result.ok {
  background: #dcfce7;
  color: #166534;
}

.word-result.bad {
  background: #fee2e2;
  color: #991b1b;
}

.wordmaster-next-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.word-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.word-table div {
  display: grid;
  grid-template-columns: 30px minmax(90px, .7fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.word-table b {
  color: var(--muted);
}

.word-table strong {
  color: #111827;
}

.word-table span {
  color: #475569;
  font-size: 13px;
  line-height: 1.35;
}

.titleless-input {
  font-weight: 850;
}

.community-post-card:hover,
.question-card:hover,
.notice-card:hover,
.answer-card:hover {
  transform: none;
  box-shadow: none;
}

.bottom-ask {
  box-shadow: none;
}

@media (max-width: 820px) {
  .topbar-inner,
  .container {
    width: min(100% - 20px, 1040px);
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .minimal-compose,
  .community-write {
    padding: 14px;
  }

  .simple-category-grid {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    overflow-x: auto;
  }

  .simple-category-grid .choice-btn {
    padding-inline: 8px;
  }

  .compose-head {
    align-items: flex-start;
  }

  .compose-head h2 {
    font-size: 20px;
  }

  .mobile-tabbar {
    box-shadow: none;
  }
}

@media (max-width: 420px) {
  .simple-category-grid {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
  }

  .compose-textarea {
    min-height: 116px;
  }
}

.community-list-row {
  padding: 2px 1px 4px;
}

.community-hero {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 170px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--community-color, var(--blue)) 18%, var(--line));
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 10%, color-mix(in srgb, var(--community-color, var(--blue)) 12%, transparent), transparent 36%),
    linear-gradient(135deg, #ffffff, color-mix(in srgb, var(--community-color, var(--blue)) 7%, #ffffff));
  padding: 18px;
}

.community-banner {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 14px;
  background: #fff;
}

.community-hero-text {
  display: grid;
  gap: 7px;
  align-content: end;
  max-width: 560px;
}

.community-hero h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

.community-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.community-setting-preview {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.community-setting-preview::-webkit-scrollbar {
  display: none;
}

.community-setting-preview img {
  flex: 0 0 auto;
  width: 92px;
  height: 62px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, .32);
  border-radius: 12px;
  background: #fff;
}

.community-customize {
  width: min(720px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  background: #fff;
}

.community-customize summary {
  gap: 6px;
}

.blog-compose {
  gap: 10px;
}

.blog-body {
  min-height: 150px;
  background: #fff;
}

.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.blog-toolbar .media-actions {
  flex: 1 1 180px;
}

.compose-attachment-details {
  border: 1.5px solid #d7e2f2;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.compose-attachment-details > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  cursor: pointer;
  list-style: none;
  padding: 0 13px;
  color: #27364a;
  font-weight: 950;
}

.compose-attachment-details > summary::-webkit-details-marker {
  display: none;
}

.compose-attachment-details > summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-attachment-details > summary b {
  border-radius: 999px;
  background: #eef5ff;
  color: #174a8b;
  padding: 4px 8px;
  font-size: 12px;
}

.compose-attachment-details[open] > summary {
  border-bottom: 1px solid #e1e8f3;
  background: #f8fbff;
}

.compose-attachment-details > .insert-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.blog-note-select {
  flex: 1 1 180px;
  min-height: 42px;
}

.community-note-preview {
  width: 100%;
  margin-top: 10px;
  border-color: var(--line);
  background: #fff;
  text-align: left;
}

.compact-note-preview {
  max-width: 360px;
}

.community-note-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: #f8fafc;
}

@media (max-width: 820px) {
  .community-hero {
    border-radius: 16px;
    padding: 14px;
  }

  .community-hero h1 {
    font-size: 24px;
  }

  .community-banner {
    max-height: 132px;
  }

  .blog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

.primary,
.ghost,
.small-button,
.chip,
.nav button,
.media-button,
.community-board,
.choice-btn,
.tabs button,
.icon-button,
.danger,
.success {
  border-width: 1.5px;
  box-shadow: 0 1px 0 rgba(17, 24, 39, .06), 0 8px 18px rgba(17, 24, 39, .05);
  transform: translateY(0);
}

.primary,
.success,
.danger {
  min-height: 42px;
  border-style: solid;
  border-radius: 11px;
  font-weight: 900;
}

.primary {
  border-color: #0f4fc8;
  background: linear-gradient(180deg, #2f7bff 0%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 2px 0 #0d46b2, 0 12px 24px rgba(23, 105, 255, .22);
}

.ghost,
.small-button,
.chip,
.nav button,
.media-button,
.community-board,
.choice-btn,
.tabs button,
.icon-button {
  border-color: #cfd9ea;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 0 rgba(17, 24, 39, .05), 0 7px 16px rgba(17, 24, 39, .04);
}

.primary:hover,
.success:hover,
.danger:hover,
.ghost:hover,
.small-button:hover,
.chip:hover,
.nav button:hover,
.media-button:hover,
.community-board:hover,
.choice-btn:hover,
.tabs button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 0 rgba(17, 24, 39, .08), 0 12px 24px rgba(17, 24, 39, .08);
}

.primary:active,
.success:active,
.danger:active,
.ghost:active,
.small-button:active,
.chip:active,
.nav button:active,
.media-button:active,
.community-board:active,
.choice-btn:active,
.tabs button:active,
.icon-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(17, 24, 39, .04);
}

.nav button.active,
.chip.active,
.community-board.active,
.choice-btn.active,
.tabs button.active {
  border-color: #0f4fc8;
  background: linear-gradient(180deg, #2f7bff 0%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 2px 0 #0d46b2, 0 10px 20px rgba(23, 105, 255, .18);
}

.danger {
  border-color: #dc2626;
  background: linear-gradient(180deg, #ff5d5d 0%, var(--red) 100%);
  color: #fff;
  box-shadow: 0 2px 0 #b91c1c, 0 12px 24px rgba(239, 68, 68, .18);
}

.success {
  border-color: #087a39;
  background: linear-gradient(180deg, #10b95d 0%, var(--green) 100%);
  color: #fff;
  box-shadow: 0 2px 0 #087a39, 0 12px 24px rgba(0, 146, 65, .16);
}

button:disabled,
.primary:disabled,
.ghost:disabled,
.small-button:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
  box-shadow: none;
}

.insert-panel {
  display: grid;
  gap: 10px;
  border: 1.5px solid #d7e2f2;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
  padding: 12px;
}

.insert-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
}

.insert-panel-head strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.insert-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.note-insert-panel {
  width: 100%;
  grid-column: 1 / -1;
}

.note-search-input {
  min-height: 42px;
}

.selected-note-large {
  min-height: 180px;
  border: 1px solid #e0e7f2;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.selected-note-empty {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 180px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.selected-note-empty strong {
  color: var(--ink);
}

.selected-note-content {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.selected-note-content img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 10px;
  background: #f8fafc;
}

.selected-note-content p {
  min-height: 180px;
  margin: 0;
  color: #374151;
  line-height: 1.65;
  white-space: pre-wrap;
}

.selected-note-content > div {
  display: grid;
  gap: 3px;
}

.selected-note-content span {
  color: var(--muted);
  font-size: 13px;
}

.note-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

.note-choice-card {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 158px;
  border: 1.5px solid #d7e2f2;
  border-radius: 14px;
  background: #fff;
  padding: 8px;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 8px 16px rgba(17, 24, 39, .04);
}

.note-choice-card:hover {
  border-color: #9dbbff;
  background: #f7fbff;
}

.note-choice-card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 255, .14), 0 10px 20px rgba(23, 105, 255, .12);
}

.note-choice-card img,
.note-choice-text {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: #f1f5f9;
  object-fit: cover;
}

.note-choice-text {
  display: block;
  overflow: hidden;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.45;
  padding: 10px;
}

.note-choice-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.note-choice-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .level-hero {
    grid-template-columns: 1fr;
  }

  .activity-stats,
  .trophy-grid,
  .trophy-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-stat-grid {
    grid-template-columns: repeat(3, 74px);
  }

  .level-up-pop {
    left: 12px;
    right: 12px;
    bottom: 82px;
    width: auto;
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .level-up-pop button {
    grid-column: 1 / -1;
  }

  .note-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

/* Naver-cafe inspired clarity pass */
.primary,
.ghost,
.small-button,
.chip,
.community-board,
.profile-pill {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 2px rgba(17, 24, 39, .08);
}

.primary:active,
.ghost:active,
.small-button:active,
.chip:active,
.community-board:active,
.profile-pill:active {
  transform: translateY(1px);
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 230px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: #1f2937;
  padding: 2px 10px 2px 2px;
  font-weight: 850;
}

.account-label {
  display: block;
  max-width: 174px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-pill:hover {
  border-color: #bfd3ff;
  background: #f8fbff;
  color: var(--blue);
}

.author-link,
.answer-author-link,
.post-author-avatar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #374151;
  padding: 0 4px 0 0;
  font-weight: 850;
}

.author-link:hover,
.answer-author-link:hover,
.post-author-avatar:hover {
  color: var(--blue);
  background: #f5f9ff;
}

.mini-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dbe6f5;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.answer-author-link {
  font-size: 16px;
}

.post-author-avatar {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 54px;
  color: var(--muted);
  font-size: 12px;
}

.post-author-avatar .mini-avatar {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

.profile-page {
  display: grid;
  gap: 14px;
  width: min(960px, 100%);
  margin: 0 auto;
}

.profile-cover {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  border: 1px solid #d9e4f2;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f7fbff);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.profile-avatar-xl {
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid #cfe0f5;
  border-radius: 28px;
  background: #edf4ff;
  color: var(--blue);
  font-size: 32px;
  font-weight: 950;
}

.profile-avatar-xl img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-identity h1 {
  margin: 8px 0 6px;
  font-size: 30px;
  line-height: 1.14;
}

.profile-identity p {
  max-width: 580px;
  margin: 0 0 8px;
  color: #4b5563;
  line-height: 1.55;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 74px);
  gap: 8px;
  align-self: end;
}

.profile-stat-grid div {
  display: grid;
  gap: 3px;
  justify-items: center;
  border: 1px solid #dfe8f5;
  border-radius: 10px;
  background: #fff;
  padding: 10px 8px;
}

.profile-stat-grid strong {
  color: var(--blue);
  font-size: 20px;
}

.profile-stat-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.profile-edit-link {
  position: absolute;
  right: 16px;
  top: 16px;
}

.profile-tabs {
  border-bottom: 1px solid #dfe8f5;
  padding-bottom: 8px;
}

.profile-activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-section-card {
  min-width: 0;
}

.profile-row-card {
  cursor: pointer;
}

.profile-community-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-community-card {
  display: grid;
  gap: 8px;
  border: 1px solid #dbe5f1;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  color: var(--ink);
  text-align: left;
}

.profile-community-card:hover {
  border-color: var(--board-color, var(--blue));
  background: #f8fbff;
}

.profile-community-card img,
.community-color-block {
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: 9px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--board-color, var(--blue)), #dbeafe);
}

.profile-community-card span {
  color: var(--muted);
  font-size: 13px;
}

.ai-filter-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #111827 0%, #1769ff 58%, #22c55e 100%);
  color: #fff;
  padding: 0 16px;
  font-weight: 950;
  box-shadow: 0 14px 30px rgba(23, 105, 255, .24);
}

.ai-filter-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(23, 105, 255, .3);
}

.ai-filter-button .icon {
  width: 18px;
  height: 18px;
}

.level-hero {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) minmax(220px, 340px);
  gap: 16px;
  align-items: center;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff 0%, #fff 50%, #ecfdf5 100%);
  padding: 16px;
  box-shadow: 0 16px 36px rgba(23, 105, 255, .08);
}

.level-ring {
  display: grid;
  width: 118px;
  aspect-ratio: 1;
  place-items: center;
  border: 10px solid #1769ff;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 6px #dbeafe, 0 14px 30px rgba(23, 105, 255, .16);
  text-align: center;
}

.level-ring strong {
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
}

.level-ring span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.level-main {
  display: grid;
  gap: 10px;
}

.level-main h3 {
  font-size: 28px;
}

.level-progress {
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: #e2e8f0;
}

.level-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1769ff, #22c55e);
}

.level-trophy-preview,
.trophy-mini-row {
  display: grid;
  gap: 8px;
}

.activity-stats {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.level-roadmap {
  display: grid;
  gap: 8px;
}

.roadmap-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 70px;
  gap: 10px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 9px;
}

.roadmap-row.done {
  border-color: rgba(34, 197, 94, .35);
  background: #f0fdf4;
}

.roadmap-row > span,
.roadmap-row > b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.trophy-grid,
.trophy-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.trophy-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.trophy-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 104px;
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff 0%, #eef4ff 100%);
  padding: 13px;
  opacity: .9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 8px 18px rgba(15, 23, 42, .08);
}

.trophy-card.earned {
  border-color: rgba(245, 158, 11, .48);
  background: linear-gradient(135deg, #fff 0%, #fff2bf 52%, #e8f3ff 100%);
  opacity: 1;
  box-shadow: 0 18px 38px rgba(234, 179, 8, .22), inset 0 1px 0 rgba(255,255,255,.95);
}

.trophy-card strong,
.trophy-card p,
.trophy-card span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.trophy-card strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  white-space: nowrap;
}

.trophy-card p {
  display: -webkit-box;
  margin: 3px 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.trophy-card span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.trophy-art {
  position: relative;
  width: 66px;
  height: 66px;
  overflow: hidden;
  border: 2px solid rgba(15, 23, 42, .14);
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.95) 0 8%, transparent 9%),
    linear-gradient(145deg, #ffffff 0%, #edf4ff 44%, #dbeafe 100%);
  box-shadow: inset 0 -12px 22px rgba(15, 23, 42, .14), 0 12px 24px rgba(15, 23, 42, .18);
}

.trophy-svg-art {
  display: grid;
  place-items: center;
  color: var(--trophy-color);
}

.trophy-svg-art::before,
.trophy-svg-art::after,
.trophy-svg-art span {
  display: none !important;
}

.trophy-svg {
  width: 58px;
  height: 58px;
  color: var(--trophy-color);
  filter: drop-shadow(0 4px 4px rgba(15, 23, 42, .26));
}

.trophy-card:not(.earned) .trophy-svg {
  opacity: .96;
  filter: drop-shadow(0 3px 3px rgba(15, 23, 42, .2));
}

.trophy-art::before,
.trophy-art::after {
  filter: drop-shadow(0 3px 3px rgba(15,23,42,.22));
}

.trophy-art::before,
.trophy-art::after,
.trophy-art span {
  left: 13px;
  top: 10px;
  width: 18px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  transform: rotate(-28deg);
}

.trophy-cup::before {
  left: 15px;
  top: 12px;
  width: 36px;
  height: 28px;
  border-radius: 9px 9px 17px 17px;
  background: linear-gradient(135deg, #fff7c2 0%, var(--trophy-color) 42%, #9a5a05 100%);
  box-shadow: -7px 4px 0 -3px transparent, 7px 4px 0 -3px transparent, inset 6px 0 8px rgba(255,255,255,.28);
}

.trophy-cup::after {
  left: 27px;
  bottom: 8px;
  width: 13px;
  height: 20px;
  border-radius: 3px;
  background: #334155;
  box-shadow: -12px 16px 0 -3px #334155, 12px 16px 0 -3px #334155, 0 -1px 0 8px rgba(255,255,255,.22);
}

.trophy-star::before {
  inset: 9px;
  clip-path: polygon(50% 0,61% 34%,98% 35%,68% 56%,79% 92%,50% 70%,21% 92%,32% 56%,2% 35%,39% 34%);
  background: linear-gradient(135deg, #fff7a8 0%, var(--trophy-color) 52%, #854d0e 100%);
  filter: drop-shadow(0 4px 4px rgba(15,23,42,.22));
}

.trophy-medal::before {
  left: 18px;
  top: 6px;
  width: 30px;
  height: 30px;
  clip-path: polygon(0 0,42% 0,56% 42%,70% 0,100% 0,74% 58%,95% 100%,58% 100%,50% 72%,42% 100%,5% 100%,26% 58%);
  background: linear-gradient(180deg, #334155, #64748b);
}

.trophy-medal::after {
  left: 15px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff 0 10%, var(--trophy-color) 11% 62%, #92400e 100%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.32);
}

.trophy-shield::before {
  inset: 8px 13px;
  clip-path: polygon(50% 0,100% 18%,88% 72%,50% 100%,12% 72%,0 18%);
  background: linear-gradient(145deg, #fff 0%, var(--trophy-color) 24%, #0f172a 120%);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.2);
}

.trophy-shield::after {
  left: 31px;
  top: 16px;
  width: 5px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255,255,255,.48);
}

.trophy-crown::before {
  left: 10px;
  top: 16px;
  width: 46px;
  height: 31px;
  clip-path: polygon(0 28%,22% 0,50% 34%,78% 0,100% 28%,88% 100%,12% 100%);
  background: linear-gradient(135deg, #fff6a4 0%, var(--trophy-color) 48%, #854d0e 100%);
  filter: drop-shadow(0 4px 4px rgba(15,23,42,.22));
}

.trophy-crown::after {
  left: 18px;
  bottom: 13px;
  width: 31px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.62);
}

.trophy-spark::before {
  inset: 8px;
  clip-path: polygon(50% 0,62% 36%,100% 50%,62% 64%,50% 100%,38% 64%,0 50%,38% 36%);
  background: linear-gradient(135deg, #fff 0%, var(--trophy-color) 46%, #7e22ce 100%);
  filter: drop-shadow(0 5px 5px rgba(15,23,42,.18));
}

.trophy-spark::after {
  left: 26px;
  top: 26px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,.62);
}

.trophy-flag::before {
  left: 19px;
  top: 10px;
  width: 6px;
  height: 46px;
  border-radius: 3px;
  background: #334155;
}

.trophy-flag::after {
  left: 25px;
  top: 12px;
  width: 32px;
  height: 27px;
  border-radius: 4px 10px 10px 4px;
  background: linear-gradient(135deg, #fff 0%, var(--trophy-color) 28%, #1e293b 130%);
  box-shadow: 0 13px 0 -7px rgba(255,255,255,.42);
}

.trophy-book::before {
  left: 13px;
  top: 14px;
  width: 41px;
  height: 38px;
  border-radius: 4px 10px 10px 4px;
  background: linear-gradient(135deg, #fff 0%, var(--trophy-color) 22%, #7f1d1d 115%);
  box-shadow: inset 6px 0 0 rgba(255,255,255,.38), inset 12px 0 0 rgba(15,23,42,.12);
}

.trophy-book::after {
  left: 38px;
  top: 19px;
  width: 10px;
  height: 25px;
  border-radius: 999px;
  background: rgba(255,255,255,.44);
}

.trophy-chat::before {
  left: 12px;
  top: 15px;
  width: 43px;
  height: 32px;
  border-radius: 15px;
  background: linear-gradient(135deg, #fff 0%, var(--trophy-color) 24%, #075985 115%);
}

.trophy-chat::after {
  left: 22px;
  top: 40px;
  width: 15px;
  height: 14px;
  clip-path: polygon(0 0,100% 0,20% 100%);
  background: var(--trophy-color);
}

.trophy-chat span {
  left: 20px;
  top: 27px;
  width: 26px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 7px 0 rgba(255,255,255,.52);
  transform: none;
}

.trophy-silver { filter: saturate(.86) brightness(1.08); }
.trophy-gold { filter: saturate(1.15); }
.trophy-platinum { filter: saturate(.95) hue-rotate(18deg); }

.trophy-card:not(.earned) .trophy-art {
  filter: grayscale(.2) saturate(.9);
}

.trophy-card:not(.earned) .trophy-art::before,
.trophy-card:not(.earned) .trophy-art::after {
  opacity: .86;
}

.level-up-pop {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 260;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: min(430px, calc(100vw - 36px));
  border: 1px solid rgba(250, 204, 21, .55);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 24px 54px rgba(15, 23, 42, .22);
}

.level-up-pop strong {
  color: #0f172a;
  font-size: 18px;
}

.level-up-pop p {
  margin: 2px 0 0;
  color: var(--muted);
  font-weight: 850;
}

.admin-trophy-tools {
  display: grid;
  gap: 14px;
}

.cafe-layout {
  width: min(1120px, 100%);
  gap: 16px;
}

.community-shell {
  display: grid;
  grid-template-columns: minmax(248px, 304px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.community-left-rail {
  position: sticky;
  top: 86px;
  min-width: 0;
}

.community-main-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.community-left-rail .community-control-panel {
  overflow: visible;
}

.community-left-rail .community-search-row {
  grid-template-columns: 1fr;
}

.community-left-rail .enhanced-board-list {
  display: grid;
  grid-template-columns: 1fr;
  max-height: min(52vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.community-left-rail .community-board {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  width: 100%;
  min-height: 58px;
  border-radius: 12px;
}

.community-control-panel {
  display: grid;
  gap: 12px;
  border-color: #d8e4f3;
  background: #fbfdff;
}

.community-control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.community-control-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.community-control-head p {
  margin: 0;
}

.community-create-menu {
  position: relative;
  flex: 0 0 auto;
}

.community-create-menu > summary {
  list-style: none;
}

.community-create-menu > summary::-webkit-details-marker {
  display: none;
}

.community-create-menu[open] > form {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 12;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid #d7e3f1;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(17, 24, 39, .14);
}

.community-board-row {
  padding: 2px 1px;
}

.community-board {
  border-radius: 10px;
  border-color: #d8e2ef;
  background: #fff;
  color: #27364a;
  padding: 0 13px;
}

.community-board.active {
  border-color: var(--board-color, var(--blue));
  background: color-mix(in srgb, var(--board-color, var(--blue)) 10%, #fff);
  color: color-mix(in srgb, var(--board-color, var(--blue)) 76%, #0f172a);
}

.community-hero {
  border-radius: 12px;
  background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--community-color, var(--blue)) 7%, #fff));
}

.community-hero h1 {
  font-size: 30px;
}

.community-hero-actions {
  position: absolute;
  right: 16px;
  top: 16px;
  display: flex;
  gap: 8px;
}

.community-join-gate {
  display: grid;
  gap: 9px;
  border-color: #d8e4f3;
  background: #fbfdff;
}

.community-join-gate strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.community-join-gate p {
  margin: 0;
}

.community-section-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid #d8e4f3;
  border-radius: 12px;
  background: #f8fbff;
  padding: 8px;
}

.community-section-tabs button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1.5px solid #cfdaeb;
  border-radius: 10px;
  background: #fff;
  color: #344054;
  padding: 0 12px;
  font-weight: 950;
}

.community-section-tabs button.active {
  border-color: #0f4fc8;
  background: linear-gradient(180deg, #2f7bff 0%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 2px 0 #0d46b2, 0 10px 20px rgba(23, 105, 255, .18);
}

.community-section-tabs button span {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-section-tabs button b {
  min-width: 20px;
  border-radius: 999px;
  background: rgba(23, 105, 255, .11);
  padding: 2px 7px;
  color: inherit;
  font-size: 12px;
  text-align: center;
}

.community-section-tabs button.active b {
  background: rgba(255, 255, 255, .18);
}

.compact-gate {
  padding: 14px;
}

.join-request-box {
  display: grid;
  gap: 9px;
  border: 1px solid #dce6f3;
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
}

.join-request-list {
  display: grid;
  gap: 8px;
}

.join-request-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #e3eaf5;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.join-request-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.join-request-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.community-customize,
.community-write,
.board-create-details {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.community-write {
  border-color: #d7e3f1;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.community-modern .community-control-panel,
.community-modern .community-hero,
.community-modern .community-study-room,
.community-modern .feed-tab-panel,
.community-modern .community-feed {
  width: 100%;
}

.community-modern .community-banner {
  aspect-ratio: 16 / 5;
  max-height: 220px;
}

.notice-action {
  width: fit-content;
  margin-top: 4px;
}

.feed-tab-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #dfe8f5;
  padding: 4px 0 10px;
}

.board-note-buttons {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1fr);
  gap: 8px;
}

.feed-tab-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.feed-tab-row::-webkit-scrollbar {
  display: none;
}

.feed-tab-row .chip {
  border-radius: 10px;
}

.feed-tab-row .chip span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  padding: 0 5px;
  font-size: 11px;
}

.feed-tab-row .chip.active span {
  background: rgba(255, 255, 255, .2);
}

.community-post-card {
  border-color: #d9e4f2;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.community-post-card:hover {
  border-color: #a9c3ff;
  background: #fbfdff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, .07);
}

@media (max-width: 820px) {
  .profile-cover {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .profile-identity {
    align-items: flex-start;
  }

  .profile-avatar-xl {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    font-size: 26px;
  }

  .profile-identity h1 {
    font-size: 24px;
  }

  .profile-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-edit-link {
    position: static;
    width: max-content;
  }

  .profile-activity-grid,
  .profile-community-grid {
    grid-template-columns: 1fr;
  }

  .community-control-head,
  .feed-tab-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .community-hero-actions {
    position: static;
  }

  .join-request-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .join-request-row .success,
  .join-request-row .danger {
    grid-column: span 1;
  }

  .community-create-menu[open] > form {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }

  .post-author-avatar span {
    display: none;
  }
}

.auth-card .brand {
  justify-content: center;
  min-height: 92px;
  margin-bottom: 22px;
  font-size: 24px;
}

.auth-card .brand img {
  width: 76px;
  height: 76px;
}

.home-notice-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
  gap: 12px;
  margin: 4px 0 18px;
}

.home-notice-main,
.home-event-side {
  border: 1px solid #d8e4f3;
  border-radius: 14px;
  background: #fbfdff;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.home-notice-main {
  cursor: pointer;
}

.notice-feature-card {
  display: grid;
  gap: 9px;
}

.notice-feature-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.notice-feature-card p {
  margin: 0;
  color: #4b5563;
  line-height: 1.55;
}

.mini-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.notice-mini-list {
  display: grid;
  gap: 8px;
}

.notice-mini {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid #dce6f3;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.notice-mini:hover {
  border-color: #adc8ff;
  background: #f6faff;
}

.notice-mini strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-mini small {
  color: var(--muted);
  font-weight: 800;
}

.notice-manage-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.notice-manage-actions.compact-actions {
  justify-content: flex-start;
}

.notice-mini .notice-manage-actions {
  grid-column: 1 / -1;
}

.site-event-banner {
  width: min(1120px, calc(100% - 32px));
  margin: 10px auto 0;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(23, 105, 255, .12);
  overflow: hidden;
}

.event-banner-main {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  padding: 0;
  cursor: pointer;
}

.event-banner-main img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: cover;
}

.event-banner-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid #dbeafe;
  background: #f8fbff;
  padding: 8px 10px;
}

.event-banner-actions .event-banner-dismiss {
  min-height: 36px;
  background: #fff;
  color: #344054;
  border-color: #d0d5dd;
}

.event-banner-actions .event-banner-dismiss-forever {
  color: #b42318;
  border-color: #fecaca;
  background: #fffafa;
}

.study-start-verify {
  width: fit-content;
  margin: 2px 0 0;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
}

.crawler-home {
  width: min(1040px, calc(100% - 32px));
  margin: 28px auto;
  color: #101828;
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", sans-serif);
}

.crawler-hero,
.crawler-grid article {
  border: 1px solid #dbe7ff;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(23, 105, 255, 0.08);
}

.crawler-hero {
  display: grid;
  gap: 14px;
  padding: 32px;
}

.crawler-hero img {
  width: 64px;
  height: 64px;
}

.crawler-kicker {
  margin: 0;
  color: #1769ff;
  font-weight: 900;
}

.crawler-hero h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 62px);
  letter-spacing: 0;
}

.crawler-hero p {
  max-width: 680px;
  margin: 0;
  color: #475467;
  font-size: 17px;
  line-height: 1.7;
}

.crawler-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.crawler-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 12px;
  background: #1769ff;
  color: #fff;
  padding: 0 16px;
  text-decoration: none;
  font-weight: 900;
}

.crawler-actions a:not(:first-child) {
  background: #eef5ff;
  color: #175cd3;
}

.crawler-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.crawler-grid article {
  padding: 18px;
}

.crawler-grid h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.crawler-grid p {
  margin: 0;
  color: #667085;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .crawler-home {
    width: min(100% - 24px, 520px);
    margin: 18px auto 110px;
  }

  .crawler-hero {
    padding: 24px;
  }

  .crawler-grid {
    grid-template-columns: 1fr;
  }
}

.event-grid,
.reward-box-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.event-card,
.inventory-card {
  display: grid;
  grid-template-columns: minmax(140px, .85fr) minmax(0, 1.15fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}

.event-card img,
.inventory-card > img,
.inventory-gift {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  object-fit: cover;
  background: #eef5ff;
}

.event-card h3,
.inventory-card h3 {
  margin: 7px 0 5px;
}

.event-card p,
.inventory-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.event-detail-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(280px, .85fr);
  gap: 16px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff, #fff);
  padding: 14px;
  box-shadow: 0 12px 30px rgba(23, 105, 255, .1);
}

.event-detail-hero > img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.event-detail-copy h1 {
  margin: 6px 0 8px;
  font-size: 28px;
}

.event-detail-copy p {
  color: var(--muted);
  line-height: 1.55;
}

.event-actions,
.event-invite-share,
.admin-event-tools,
.admin-reward-tools,
.event-admin-list,
.reward-admin-list,
.event-rank-list,
.reward-preview-list {
  display: grid;
  gap: 10px;
}

.event-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.event-invite-share {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.event-rank,
.reward-preview {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 9px;
}

.event-rank.me {
  border-color: #60a5fa;
  background: #eff6ff;
}

.event-rank small {
  grid-column: 3 / -1;
  color: var(--muted);
  font-size: 12px;
}

.rank-no {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #1769ff;
  color: #fff;
  font-weight: 900;
}

.reward-preview {
  grid-template-columns: auto 58px minmax(0, 1fr);
}

.reward-preview img,
.reward-fallback {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  background: #f1f5f9;
}

.reward-fallback,
.inventory-gift {
  display: grid;
  place-items: center;
  color: #1769ff;
}

.gift-card-image {
  width: min(260px, 100%);
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.gift-code {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  border: 1px dashed #93c5fd;
  border-radius: 10px;
  background: #eff6ff;
  padding: 9px;
}

.gift-code span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.gift-code strong {
  word-break: break-all;
}

.event-admin-preview img,
.reward-image-previews img {
  width: 100%;
  max-height: 130px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.reward-image-previews {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.notice-write-panel {
  margin-bottom: 14px;
}

.notice-compose-form .split {
  align-items: center;
}

.notice-html-uploader {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #b8c7dc;
  border-radius: 10px;
  background: #f8fbff;
}

.notice-html-uploader strong,
.notice-html-uploader small {
  display: block;
}

.notice-html-uploader small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.notice-html-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.notice-pin {
  min-height: 44px;
  border: 1px solid #dce6f3;
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.school-notice-list {
  gap: 12px;
}

.school-notice-card {
  border-left: 4px solid var(--blue);
}

.school-notice-card.event-notice {
  border-left-color: var(--green);
}

.school-notice-card.urgent-notice {
  border-left-color: var(--red);
}

.school-notice-card h3 {
  margin: 6px 0 0;
}

.notice-html-panel {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid #dbe5f2;
  border-radius: 10px;
  background: #fff;
}

.notice-html-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e5edf7;
  background: #f8fbff;
}

.notice-html-panel-head strong {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.notice-html-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.notice-html-panel iframe {
  display: block;
  width: 100%;
  min-height: 360px;
  border: 0;
  background: #fff;
}

@media (max-width: 820px) {
  .auth-card .brand img {
    width: 70px;
    height: 70px;
  }

  .home-notice-panel {
    grid-template-columns: 1fr;
  }

  .notice-mini {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .notice-mini small {
    grid-column: 2;
  }

  .notice-html-panel iframe {
    height: min(900px, 78vh) !important;
  }
}

.community-search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1.5px solid #d8e4f3;
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset;
}

.searchbox input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.compact-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.compact-tabs::-webkit-scrollbar {
  display: none;
}

.enhanced-board-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 9px;
  overflow: visible;
}

.enhanced-board-list .community-board {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
}

.board-type-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--board-color, var(--blue)) 10%, #f8fbff);
  color: var(--board-color, var(--blue));
}

.board-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.board-main strong,
.board-main small,
.board-stat small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-main small,
.board-stat small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.board-stat {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.board-stat b {
  color: var(--ink);
  font-size: 16px;
}

.board-pending {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.split-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.note-editor {
  width: min(1380px, calc(100vw - 20px));
  height: min(940px, calc(100vh - 20px));
}

.note-editor-body {
  grid-template-columns: clamp(96px, 12vw, 152px) minmax(0, 1fr);
}

.note-toolrail {
  gap: 10px;
  padding: 10px;
}

.note-tool-group {
  display: grid;
  gap: 7px;
}

.shape-tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #e6edf6;
  border-bottom: 1px solid #e6edf6;
  padding: 10px 0;
}

.shape-tool-grid .ghost,
.action-tools .ghost {
  justify-content: center;
  min-width: 0;
}

.note-size-wrap {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.shape-fill-button.active {
  border-color: rgba(15, 107, 255, .18);
  background: #eef5ff;
  color: var(--blue);
}

#handCanvas {
  max-width: none;
  height: auto;
  border: 1px solid #d6e2f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .13);
  touch-action: none;
}

@media (max-width: 980px) {
  .community-search-row {
    grid-template-columns: 1fr;
  }

  .enhanced-board-list {
    grid-template-columns: 1fr;
  }

  .split-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .note-editor {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .note-editor-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .note-toolrail {
    display: grid;
    grid-template-columns: auto auto minmax(150px, 1fr) auto auto;
    align-items: center;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .note-toolrail::-webkit-scrollbar {
    display: none;
  }

  .primary-tools,
  .shape-tool-grid,
  .action-tools {
    display: flex;
    flex-wrap: nowrap;
    border: 0;
    padding: 0;
  }

  .note-toolrail .ghost {
    flex: 0 0 42px;
    min-height: 40px;
    justify-content: center;
    padding: 0 9px;
  }

  .note-toolrail .ghost span,
  .note-size-wrap span {
    display: none;
  }

  .note-colors {
    display: flex;
    min-width: 150px;
  }

  .note-colors button {
    width: 28px;
  }
}

@media (max-width: 560px) {
  .note-editor-top {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .note-editor-top .chips {
    grid-column: 1 / -1;
  }

  .note-toolrail {
    grid-template-columns: auto auto minmax(120px, 1fr) auto auto;
    gap: 7px;
    padding: 8px;
  }

  .note-colors {
    min-width: 132px;
  }
}

/* Mobile completion overrides */
html,
body {
  overscroll-behavior-y: none;
}

.has-note-editor .bottom-ask,
.has-note-editor .mobile-tabbar {
  display: none !important;
}

.pen-only-button.active {
  border-color: rgba(15, 107, 255, .18);
  background: #eef5ff;
  color: var(--blue);
}

.hand-canvas-stage {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (pointer: coarse) {
  button,
  .primary,
  .ghost,
  .small-button,
  .chip,
  .input,
  .select {
    min-height: 46px;
  }
}

@media (max-width: 760px) {
  body {
    background: #f7f9fd;
  }

  .app-shell {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .container {
    width: 100%;
    padding: 10px 10px calc(96px + env(safe-area-inset-bottom));
  }

  .topbar {
    border-bottom-color: #e7edf6;
  }

  .topbar-inner {
    width: calc(100% - 16px);
    min-height: 58px;
    padding: 7px 0;
  }

  .brand {
    min-width: 0;
    gap: 7px;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .brand span {
    max-width: 90px;
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .account {
    gap: 6px;
  }

  .profile-pill {
    gap: 6px;
    max-width: min(44vw, 154px);
    min-width: 0;
    padding: 2px 9px 2px 2px;
  }

  .account-label {
    max-width: 92px;
    font-size: 12px;
    line-height: 1.1;
  }

  .account .ghost {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }

  .panel,
  .question-card,
  .answer-card,
  .notice-card,
  .community-post-card {
    border-radius: 12px;
    box-shadow: 0 1px 0 rgba(17, 24, 39, .04);
  }

  .panel {
    padding: 13px;
  }

  .hero {
    border-radius: 14px;
    padding: 14px 0 4px;
  }

  .home-actions,
  .feed-tab-row,
  .blog-toolbar,
  .form-actions {
    gap: 8px;
  }

  .input,
  .textarea,
  .select {
    border-radius: 10px;
    font-size: 16px;
  }

  .community-modern {
    display: grid;
    gap: 12px;
  }

  .community-shell {
    grid-template-columns: 1fr;
  }

  .community-left-rail {
    position: static;
  }

  .community-left-rail .community-control-panel {
    max-height: none;
    overflow: visible;
  }

  .community-left-rail .enhanced-board-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-right: 0;
  }

  .community-left-rail .community-board {
    flex: 0 0 min(320px, 86vw);
  }

  .compose-head {
    padding: 0 2px;
  }

  .compose-head h2 {
    font-size: 22px;
  }

  .community-control-panel {
    gap: 10px;
  }

  .community-search-row {
    grid-template-columns: 1fr;
  }

  .compact-tabs {
    margin-inline: -2px;
    padding-bottom: 2px;
  }

  .enhanced-board-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .enhanced-board-list .community-board {
    min-height: 64px;
    border-radius: 12px;
    padding: 9px 10px;
  }

  .board-type-icon {
    width: 34px;
    height: 34px;
  }

  .community-hero {
    min-height: 126px;
    border-radius: 14px;
    padding: 14px;
  }

  .community-hero h1 {
    font-size: 24px;
  }

  .community-hero p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .community-write {
    gap: 9px;
  }

  .blog-body,
  .compose-textarea {
    min-height: 118px;
  }

  .selected-note-large {
    min-height: 150px;
  }

  .note-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 260px;
  }

  .mobile-tabbar {
    border-top-color: #dfe7f2;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, .08);
  }

  .mobile-tabbar button {
    min-height: 52px;
    border-radius: 13px;
  }

  .mobile-tabbar button:nth-child(4) {
    background: #eef5ff;
    box-shadow: inset 0 0 0 1px rgba(23, 105, 255, .12);
  }

  .note-editor-backdrop {
    background: #f7f9fd;
  }

  .note-editor {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .note-editor-top {
    min-height: calc(58px + env(safe-area-inset-top));
    padding: max(8px, env(safe-area-inset-top)) 9px 8px;
    box-shadow: 0 1px 0 rgba(17, 24, 39, .06);
  }

  .note-title-input {
    font-size: 16px;
  }

  .note-editor-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .hand-canvas-stage {
    order: 1;
    padding: 10px;
    background:
      radial-gradient(circle at 1px 1px, rgba(148, 163, 184, .28) 1px, transparent 0) 0 0 / 16px 16px,
      #eef3fa;
  }

  .note-toolrail {
    order: 2;
    display: grid;
    grid-template-columns: auto auto minmax(120px, 1fr) auto auto auto;
    gap: 7px;
    max-height: 122px;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid #dfe7f2;
    border-right: 0;
    border-bottom: 0;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -12px 26px rgba(15, 23, 42, .08);
    scrollbar-width: none;
  }

  .note-toolrail::-webkit-scrollbar {
    display: none;
  }

  .primary-tools,
  .shape-tool-grid,
  .action-tools {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    border: 0;
    padding: 0;
  }

  .note-toolrail .ghost {
    flex: 0 0 42px;
    min-width: 42px;
    min-height: 42px;
    justify-content: center;
    border-radius: 12px;
    padding: 0;
  }

  .note-toolrail .ghost span,
  .note-size-wrap span {
    display: none;
  }

  .note-colors {
    display: flex;
    align-items: center;
    min-width: 148px;
    padding: 0;
  }

  .note-colors button {
    width: 28px;
    height: 28px;
  }

  .note-size-wrap {
    min-width: 112px;
    align-self: center;
  }

  .note-size {
    min-width: 104px;
  }

  #handCanvas {
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .16);
  }
}

@media (max-width: 380px) {
  .brand span {
    max-width: 60px;
  }

  .profile-pill {
    max-width: 118px;
    padding-right: 7px;
  }

  .account-label {
    max-width: 66px;
  }

  .account .ghost {
    width: 34px;
    min-width: 34px;
  }
}

@media (max-width: 720px) {
  .study-room-head {
    display: grid;
  }

  .study-room-head-actions {
    justify-items: stretch;
  }

  .study-summary-pills {
    justify-content: stretch;
  }

  .study-summary-pills span {
    flex: 1 1 90px;
    text-align: left;
  }

  .community-invite-box {
    grid-template-columns: 1fr;
  }

  .study-room-grid {
    grid-template-columns: 1fr;
  }

  .study-rank {
    grid-template-columns: 24px 28px minmax(0, 1fr) auto;
  }

  .study-rank em {
    display: none;
  }

  .wordmaster-notice,
  .word-spell-form {
    grid-template-columns: 1fr;
    display: grid;
  }

  .wordmaster-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wordmaster-stat {
    min-height: 66px;
    padding: 10px;
  }

  .wordmaster-stat strong {
    font-size: 20px;
  }

  .word-options,
  .word-table {
    grid-template-columns: 1fr;
  }

  .word-question-card h3 {
    font-size: 24px;
  }
}

@media (max-width: 900px) {
  .visual-study-grid {
    grid-template-columns: 1fr;
  }

  .study-side-stack {
    grid-template-columns: minmax(0, 1fr) minmax(240px, .8fr);
  }
}

@media (max-width: 760px) {
  .cafe-layout,
  .profile-page {
    width: 100%;
  }

  .community-modern {
    gap: 10px;
  }

  .community-modern .community-control-panel,
  .community-modern .community-hero,
  .community-modern .community-study-room,
  .community-modern .feed-tab-panel,
  .community-modern .community-feed {
    border-radius: 10px;
  }

  .community-board {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .feed-tab-panel {
    display: grid;
    gap: 8px;
    padding-bottom: 8px;
  }

  .feed-tab-row,
  .space-tabs,
  .profile-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .feed-tab-row::-webkit-scrollbar,
  .space-tabs::-webkit-scrollbar,
  .profile-tabs::-webkit-scrollbar {
    display: none;
  }

  .feed-tab-row .chip,
  .space-tabs .chip,
  .profile-tabs .chip {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .profile-cover {
    grid-template-columns: 1fr;
    gap: 12px;
    border-radius: 10px;
    padding: 14px;
  }

  .profile-identity {
    align-items: flex-start;
    gap: 10px;
  }

  .profile-avatar-xl {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    font-size: 24px;
  }

  .profile-identity h1 {
    margin: 5px 0 4px;
    font-size: 22px;
  }

  .profile-identity p {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 6px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.42;
  }

  .profile-stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    align-self: stretch;
  }

  .profile-stat-grid div {
    padding: 8px 4px;
  }

  .profile-stat-grid strong {
    font-size: 16px;
  }

  .profile-stat-grid span {
    font-size: 10px;
  }

  .profile-edit-link {
    position: static;
    width: fit-content;
  }

  .profile-activity-grid,
  .profile-community-grid,
  .activity-grid {
    grid-template-columns: 1fr;
  }

  .level-hero {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    border-radius: 10px;
    padding: 12px;
  }

  .level-ring {
    width: 72px;
    border-width: 6px;
    box-shadow: inset 0 0 0 4px #dbeafe, 0 8px 16px rgba(23, 105, 255, .14);
  }

  .level-ring strong {
    font-size: 18px;
  }

  .level-main h3 {
    font-size: 22px;
  }

  .level-trophy-preview {
    grid-column: 1 / -1;
  }

  .activity-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trophy-grid {
    grid-template-columns: 1fr;
  }

  .study-side-stack {
    grid-template-columns: 1fr;
  }

  .study-classroom {
    min-height: 360px;
    border-radius: 10px;
    padding: 8px;
  }

  .classroom-board {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    min-height: 54px;
    border-width: 4px;
    font-size: 15px;
  }

  .board-main-area {
    min-height: 62px;
  }

  .class-board-note {
    width: 34%;
    min-height: 46px;
    padding: 6px;
  }

  .class-board-note strong {
    font-size: 10px;
  }

  .class-board-note span,
  .board-note-actions button {
    font-size: 8px;
  }

  .classroom-floor {
    max-height: 58vh;
    padding: 12px 8px 18px;
  }

  .seat-grid {
    grid-template-columns: repeat(3, minmax(78px, 1fr));
    gap: 12px 8px;
  }

  .study-seat {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 86px;
    padding: 9px 7px 7px;
    box-shadow: 0 7px 0 #825329, 0 12px 18px rgba(15, 23, 42, .13);
  }

  .desk-avatar {
    width: 29px;
    height: 29px;
  }

  .desk-note {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 24px;
    height: 24px;
  }

  .study-seat strong {
    padding-right: 20px;
    font-size: 12px;
  }

  .classroom-caption {
    display: grid;
    font-size: 11px;
  }

  .study-stopwatch-face {
    padding: 12px;
  }

  .study-stopwatch-face strong {
    font-size: 28px;
  }

  .board-note-form {
    grid-template-columns: 1fr;
  }

  .board-position-controls {
    grid-template-columns: 1fr;
  }
}

/* Community UI final pass */
.community-modern.cafe-layout {
  width: min(1180px, 100%);
  gap: 12px;
}

.community-modern .compose-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #dfe8f5;
  padding: 0 2px 12px;
}

.community-modern .compose-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.community-shell {
  grid-template-columns: minmax(270px, 318px) minmax(0, 1fr);
  gap: 16px;
}

.community-main-panel {
  gap: 12px;
}

.community-left-rail .community-control-panel {
  gap: 14px;
  border-radius: 14px;
  padding: 14px;
}

.community-control-head {
  align-items: center;
}

.community-control-head h3 {
  font-size: 16px;
}

.community-control-head p {
  display: none;
}

.community-search-row {
  display: grid;
  gap: 9px;
}

.community-left-rail .compact-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  overflow: visible;
}

.community-left-rail .compact-tabs .chip {
  min-height: 34px;
  border-radius: 999px;
  padding-inline: 10px;
  font-size: 12px;
}

.community-left-rail .enhanced-board-list {
  gap: 8px;
  max-height: min(58vh, 560px);
  scrollbar-width: thin;
}

.community-left-rail .community-board {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  min-height: 62px;
  border-left-width: 5px;
  padding: 9px 10px;
}

.community-left-rail .community-board.active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--board-color, var(--blue)) 18%, transparent);
}

.board-type-icon {
  width: 34px;
  height: 34px;
}

.board-main strong {
  font-size: 14px;
}

.board-main small {
  max-width: 100%;
  font-size: 12px;
}

.board-stat {
  min-width: 42px;
}

.community-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 0;
  border-radius: 14px;
  padding: 16px;
}

.community-hero.no-banner {
  grid-template-columns: minmax(0, 1fr) auto;
}

.community-banner {
  width: 92px;
  height: 92px;
  aspect-ratio: 1 / 1;
  max-height: none;
  border-radius: 12px;
}

.community-hero-text {
  min-width: 0;
  gap: 6px;
}

.community-hero h1 {
  overflow: hidden;
  font-size: 26px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-hero p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.community-hero-actions {
  position: static;
  justify-content: end;
}

.community-study-room,
.community-write,
.community-customize,
.feed-tab-panel,
.community-feed {
  border-radius: 14px;
}

.community-write {
  padding: 14px;
}

.community-write .titleless-input {
  min-height: 46px;
  font-size: 18px;
  font-weight: 900;
}

.community-write .blog-body {
  min-height: 112px;
}

.feed-tab-panel {
  border: 1px solid #d9e4f2;
  background: #fbfdff;
  padding: 9px 10px;
}

.feed-tab-row .chip {
  min-height: 36px;
  border-radius: 999px;
}

.community-feed {
  gap: 10px;
}

.community-post-card {
  gap: 9px;
  border-radius: 12px;
  padding: 14px;
}

.community-post-card h3 {
  margin-top: 5px;
  font-size: 17px;
}

.community-thumb-strip img {
  border-radius: 10px;
}

@media (max-width: 960px) {
  .event-grid,
  .reward-box-grid,
  .event-detail-hero {
    grid-template-columns: 1fr;
  }

  .event-card,
  .inventory-card {
    grid-template-columns: 1fr;
  }

  .event-invite-share {
    grid-template-columns: 1fr;
  }

  .event-actions {
    grid-template-columns: 1fr;
  }

  .community-section-tabs {
    grid-template-columns: 1fr;
  }

  .document-toolbar,
  .compact-documents {
    grid-template-columns: 1fr;
  }

  .document-attachment {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .document-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .document-actions a,
  .document-actions button {
    flex: 1;
    justify-content: center;
  }

  .document-inline-preview {
    height: min(72dvh, 620px);
    min-height: 440px;
  }

  .document-viewer-head {
    align-items: stretch;
    flex-direction: column;
  }

  .document-viewer-actions {
    justify-content: space-between;
  }

  .community-shell {
    grid-template-columns: 1fr;
  }

  .community-left-rail {
    position: static;
  }

  .community-left-rail .enhanced-board-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }

  .community-left-rail .community-board {
    flex: 0 0 min(320px, 86vw);
  }
}

@media (max-width: 760px) {
  .community-modern.cafe-layout {
    gap: 10px;
  }

  .community-modern .compose-head {
    align-items: start;
    padding-bottom: 8px;
  }

  .community-modern .compose-head h2 {
    font-size: 22px;
  }

  .community-left-rail .community-control-panel,
  .community-hero,
  .community-study-room,
  .community-write,
  .community-customize,
  .feed-tab-panel {
    border-radius: 12px;
  }

  .community-hero {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .community-hero.no-banner {
    grid-template-columns: 1fr;
  }

  .community-banner {
    width: 64px;
    height: 64px;
    border-radius: 10px;
  }

  .community-hero h1 {
    font-size: 21px;
  }

  .community-hero-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .feed-tab-panel {
    display: grid;
    gap: 8px;
  }

  .community-write .titleless-input {
    font-size: 16px;
  }
}

/* Desktop topbar final pass */
@media (min-width: 761px) {
  .topbar-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: min(1180px, calc(100% - 40px));
    min-height: 64px;
    padding: 8px 0;
  }

  .brand {
    min-width: 0;
    max-width: 158px;
    white-space: nowrap;
  }

  .brand img {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
  }

  .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav {
    min-width: 0;
    max-width: 100%;
    justify-content: center;
    gap: 4px;
    overflow-x: auto;
    flex: none;
  }

  .nav button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 9px;
    font-size: 13px;
  }

  .nav button span {
    display: block;
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .account {
    min-width: 0;
    justify-content: flex-end;
    gap: 6px;
  }

  .profile-pill {
    flex: 0 1 auto;
    max-width: 170px;
    min-width: 0;
    padding: 2px 9px 2px 2px;
  }

  .account-label {
    max-width: 114px;
  }

  .account .ghost {
    flex: 0 0 auto;
    min-width: 38px;
    padding: 0 10px;
  }
}

@media (min-width: 761px) and (max-width: 1080px) {
  .topbar-inner {
    gap: 8px;
    width: calc(100% - 24px);
  }

  .brand {
    max-width: 128px;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .nav {
    justify-content: center;
  }

  .nav button {
    padding: 0 7px;
    font-size: 12px;
  }

  .nav button span {
    max-width: 46px;
  }

  .profile-pill {
    max-width: 124px;
  }

  .account-label {
    max-width: 70px;
  }

  .account .ghost {
    width: 38px;
    min-width: 38px;
    padding: 0;
  }

  .account .ghost span {
    display: none;
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  .brand {
    max-width: 48px;
  }

  .brand span,
  .account-label {
    display: none;
  }

  .nav {
    justify-content: flex-start;
  }

  .profile-pill {
    max-width: 44px;
    padding: 0;
  }
}

/* Community study room anti-overlap pass */
.community-main-panel .visual-study-grid {
  grid-template-columns: 1fr !important;
}

.study-room-grid,
.study-classroom-set,
.study-side-stack,
.study-timer-card,
.study-leaderboard {
  min-width: 0;
}

.study-classroom-set {
  overflow: hidden;
}

.study-side-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .72fr);
  gap: 12px;
  align-items: start;
}

.community-main-panel .study-timer-card,
.community-main-panel .study-leaderboard {
  position: static;
  width: 100%;
  max-width: none;
}

.community-main-panel .study-stopwatch-face {
  min-height: 0;
}

.community-main-panel .study-stopwatch-face strong {
  font-size: 28px;
}

.community-main-panel .quick-timer-row {
  flex-wrap: wrap;
}

.community-main-panel .quick-timer-row .small-button {
  flex: 1 1 74px;
}

@media (max-width: 1100px) {
  .study-side-stack {
    grid-template-columns: 1fr;
  }
}

.auth-card .brand {
  max-width: none;
  justify-content: center;
}

.auth-card .brand span {
  display: inline;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

/* Liquid class UI refresh */
:root {
  --blue: #1468ff;
  --blue-dark: #0b4fd8;
  --blue-soft: #eaf3ff;
  --ink: #102033;
  --muted: #617187;
  --line: rgba(146, 166, 194, 0.28);
  --line-strong: rgba(86, 112, 150, 0.28);
  --soft: rgba(248, 251, 255, 0.78);
  --bg: #f4f8ff;
  --card: rgba(255, 255, 255, 0.74);
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --liquid-shadow: 0 22px 54px rgba(35, 62, 105, 0.12);
  --liquid-shadow-soft: 0 10px 26px rgba(35, 62, 105, 0.1);
}

body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(232, 244, 255, 0.98), rgba(250, 252, 255, 0.96) 34%, rgba(246, 243, 255, 0.94) 68%, rgba(255, 248, 236, 0.92));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.22) 42%, rgba(255, 255, 255, 0.58)),
    repeating-linear-gradient(90deg, rgba(20, 104, 255, 0.025) 0 1px, transparent 1px 88px);
}

.app-shell {
  background: transparent;
}

.topbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(248, 252, 255, 0.68);
  backdrop-filter: saturate(175%) blur(26px);
  box-shadow: 0 14px 36px rgba(23, 45, 82, 0.08);
}

.topbar-inner {
  width: min(1240px, calc(100% - 32px));
  min-height: 72px;
}

.brand {
  min-width: 132px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 8px 20px rgba(28, 74, 140, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  padding: 4px 9px;
}

.brand img {
  filter: drop-shadow(0 7px 16px rgba(20, 104, 255, 0.18));
}

button.brand:hover,
button.brand:focus-visible {
  border-color: rgba(20, 104, 255, 0.18);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 24px rgba(28, 74, 140, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.nav {
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  padding: 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 10px 26px rgba(31, 67, 121, 0.08);
}

.nav button {
  min-height: 42px;
  border-color: transparent;
  background: transparent;
  color: #42556f;
  padding: 0 12px;
}

.nav button.active,
.chip.active,
.mobile-tabbar button.active,
.mobile-tabbar button:nth-child(4) {
  border-color: rgba(20, 104, 255, 0.1);
  background: linear-gradient(180deg, rgba(43, 126, 255, 0.98), rgba(10, 86, 224, 0.98));
  color: #fff;
  box-shadow: 0 12px 24px rgba(20, 104, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.nav button:hover,
.ghost:hover,
.small-button:hover,
.chip:hover {
  border-color: rgba(20, 104, 255, 0.28);
  background: rgba(255, 255, 255, 0.84);
  color: var(--blue);
  transform: translateY(-1px);
}

.account,
.profile-pill {
  min-width: 0;
}

.profile-pill {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 8px 22px rgba(31, 67, 121, 0.08);
}

.container {
  width: min(1240px, calc(100% - 32px));
  padding-top: 24px;
}

.panel,
.question-card,
.answer-card,
.notice-card,
.stat,
.community-board,
.post-card,
.event-card,
.inventory-card,
.home-notice-main,
.home-event-side,
.notice-feature-card,
.notice-mini,
.home-guide-card {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: var(--glass);
  backdrop-filter: saturate(165%) blur(22px);
  box-shadow: var(--liquid-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.panel,
.notice-card,
.question-card,
.answer-card {
  border-color: rgba(255, 255, 255, 0.72);
}

.question-card:hover,
.notice-card:hover,
.event-card:hover,
.home-guide-card:hover,
.notice-mini:hover {
  transform: translateY(-2px);
  box-shadow: var(--liquid-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.input,
.textarea,
.select {
  border: 1px solid rgba(95, 123, 163, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  color: var(--ink);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(20, 104, 255, 0.62);
  box-shadow: 0 0 0 4px rgba(20, 104, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.primary,
.success,
.danger {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(20, 104, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.primary {
  background: linear-gradient(180deg, #2b7eff, #0b55e0);
}

.success {
  background: linear-gradient(180deg, #17b66f, #07864e);
}

.danger {
  background: linear-gradient(180deg, #ff5b62, #dd2530);
}

.ghost,
.small-button,
.chip {
  border-color: rgba(95, 123, 163, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 8px 18px rgba(31, 67, 121, 0.06);
  color: #42556f;
}

.liquid-home-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(237, 247, 255, 0.74) 52%, rgba(255, 248, 234, 0.66));
  box-shadow: var(--liquid-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  padding: 28px;
}

.liquid-home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.5), transparent 28%, rgba(255, 255, 255, 0.26) 54%, transparent 72%);
}

.liquid-home-hero > * {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  border: 1px solid rgba(20, 104, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--blue-dark);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 900;
}

.liquid-home-hero h1 {
  max-width: 720px;
  font-size: clamp(34px, 4.8vw, 58px);
}

.liquid-home-hero p {
  max-width: 680px;
  color: #50627c;
  font-size: 18px;
  font-weight: 700;
}

.home-primary-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.jumbo-action {
  justify-content: flex-start;
  min-height: 76px;
  padding: 12px 16px;
  text-align: left;
}

.jumbo-action .icon {
  width: 24px;
  height: 24px;
}

.jumbo-action span,
.home-event-callout span {
  display: grid;
  gap: 3px;
}

.jumbo-action strong,
.home-event-callout strong,
.home-guide-card strong {
  font-size: 16px;
}

.jumbo-action small,
.home-event-callout small,
.home-guide-card small {
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  opacity: 0.78;
}

.home-event-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  min-height: 58px;
  border: 1px solid rgba(255, 171, 64, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.86), rgba(255, 236, 210, 0.72));
  color: #9a4700;
  padding: 10px 14px;
  box-shadow: 0 12px 26px rgba(230, 122, 31, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.84);
  text-align: left;
}

.home-search-row {
  max-width: 780px;
}

.home-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.home-guide-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  min-height: 86px;
  padding: 14px;
  color: var(--ink);
  text-align: left;
}

.home-guide-card small {
  grid-column: 2;
  color: var(--muted);
}

.guide-step {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(43, 126, 255, 0.98), rgba(10, 86, 224, 0.98));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(20, 104, 255, 0.22);
}

.section-title h2 {
  font-size: 22px;
  color: #16263b;
}

.stats {
  gap: 12px;
}

.stat {
  padding: 15px;
}

.stat strong {
  color: var(--blue-dark);
}

.badge {
  border-color: rgba(95, 123, 163, 0.2);
  background: rgba(255, 255, 255, 0.68);
}

.toast,
.level-up-pop,
.modal-backdrop > section {
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(165%) blur(22px);
  box-shadow: var(--liquid-shadow);
}

.mobile-tabbar {
  border-top: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(248, 252, 255, 0.72);
  backdrop-filter: saturate(175%) blur(24px);
  box-shadow: 0 -16px 34px rgba(31, 67, 121, 0.1);
}

.mobile-tabbar button {
  border-radius: 8px;
}

.mobile-tabbar button span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .home-primary-actions,
  .home-guide-grid {
    grid-template-columns: 1fr;
  }

  .liquid-home-hero {
    padding: 20px;
  }
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(135deg, rgba(238, 247, 255, 0.98), rgba(252, 254, 255, 0.96) 48%, rgba(255, 250, 239, 0.94));
  }

  .topbar-inner {
    min-height: 62px;
  }

  .topbar .nav {
    display: none;
  }

  .brand {
    min-width: 0;
  }

  .brand span {
    max-width: 104px;
  }

  .container {
    width: min(100% - 20px, 1240px);
    padding-top: 16px;
  }

  .liquid-home-hero h1 {
    font-size: 34px;
  }

  .liquid-home-hero p {
    font-size: 15px;
  }

  .jumbo-action {
    min-height: 70px;
  }

  .home-event-callout {
    width: 100%;
  }

  .event-banner-actions {
    justify-content: stretch;
  }

  .event-banner-actions button {
    flex: 1 1 130px;
  }

  .home-search-row {
    grid-template-columns: 1fr;
  }

  .mobile-tabbar {
    display: grid;
  }
}

/* Spacing correction pass */
.space-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.space-panel > .section-title:first-child,
.activity-page > .section-title:first-child {
  margin-top: 10px;
}

.activity-page {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.activity-page .level-hero {
  gap: 20px;
  padding: 22px;
}

.activity-page .level-main {
  gap: 12px;
  min-width: 0;
}

.activity-page .level-main .card-head {
  gap: 10px;
}

.activity-page .level-trophy-preview {
  min-width: 0;
}

.activity-page .activity-stats {
  gap: 10px;
  margin: 0;
}

.activity-page .activity-stats .stat {
  min-width: 0;
  min-height: 82px;
  padding: 16px 12px;
}

.activity-page .activity-grid {
  gap: 16px;
}

.activity-page .panel {
  padding: 20px;
}

.activity-page .panel > h2 {
  margin-bottom: 14px;
}

.activity-page .level-roadmap {
  gap: 10px;
}

.activity-page .roadmap-row {
  min-width: 0;
  padding: 12px;
}

.activity-page .trophy-grid {
  gap: 12px;
}

.activity-page .table {
  display: block;
  overflow-x: auto;
  width: 100%;
}

@media (max-width: 900px) {
  .activity-page .level-hero {
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    padding: 18px;
  }

  .activity-page .level-ring {
    width: 88px;
  }

  .activity-page .level-trophy-preview {
    grid-column: 1 / -1;
  }

  .activity-page .activity-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .space-tabs {
    padding: 4px 2px 10px;
  }

  .space-panel {
    gap: 12px;
  }

  .activity-page {
    gap: 12px;
  }

  .activity-page > .section-title:first-child {
    align-items: center;
    margin-top: 6px;
    margin-bottom: 0;
  }

  .activity-page .level-hero {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .activity-page .level-ring {
    width: 74px;
    border-width: 6px;
  }

  .activity-page .level-ring strong {
    font-size: 18px;
  }

  .activity-page .level-ring span {
    font-size: 11px;
  }

  .activity-page .level-main h3 {
    font-size: 21px;
  }

  .activity-page .level-progress {
    height: 12px;
  }

  .activity-page .level-trophy-preview {
    padding-top: 2px;
  }

  .activity-page .activity-stats {
    gap: 8px;
  }

  .activity-page .activity-stats .stat {
    min-height: 74px;
    padding: 12px 8px;
  }

  .activity-page .activity-stats .stat strong {
    font-size: 22px;
  }

  .activity-page .activity-stats .stat span {
    font-size: 12px;
  }

  .activity-page .panel {
    padding: 14px;
  }

  .activity-page .roadmap-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
  }

  .activity-page .roadmap-row .level-badge {
    min-width: 0;
  }
}

/* Final UI polish: keep transient alerts readable and make the ask tab reflect real selection only. */
.toast {
  color: #111827;
  text-shadow: none;
}

.toast strong,
.toast span {
  color: inherit;
}

.topbar .account,
.topbar .account .profile-pill,
.topbar .account .ghost {
  color: #102033;
}

.topbar .account .profile-pill,
.topbar .account .ghost {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(95, 123, 163, 0.24);
}

.topbar .account .profile-pill:hover,
.topbar .account .ghost:hover {
  color: var(--blue);
  background: rgba(255, 255, 255, 0.94);
}

.topbar .account .icon {
  color: currentColor;
}

.mobile-tabbar button:not(.active):nth-child(4) {
  border-color: transparent;
  background: transparent;
  color: #667085;
  box-shadow: none;
}

.mobile-tabbar button:not(.active):nth-child(4) .icon {
  width: 19px;
  height: 19px;
}

.mobile-tabbar button.active,
.mobile-tabbar button:nth-child(4).active {
  border-color: rgba(20, 104, 255, 0.14);
  background: linear-gradient(180deg, rgba(43, 126, 255, 0.98), rgba(10, 86, 224, 0.98));
  color: #fff;
  box-shadow: 0 12px 24px rgba(20, 104, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.mobile-tabbar button.active .icon,
.mobile-tabbar button:nth-child(4).active .icon {
  width: 21px;
  height: 21px;
}

/* Growth pass: calmer navigation, clearer home starting points, separated community management. */
.topbar-inner {
  gap: 12px;
}

.primary-nav {
  flex: 1 1 auto;
  max-width: 520px;
  justify-content: center;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.topbar-ask-cta,
.topbar-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border: 1px solid rgba(95, 123, 163, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: #42556f;
  padding: 0 12px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 8px 18px rgba(31, 67, 121, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.topbar-ask-cta {
  border-color: rgba(20, 104, 255, 0.16);
  background: linear-gradient(180deg, rgba(43, 126, 255, 0.98), rgba(10, 86, 224, 0.98));
  color: #fff;
  box-shadow: 0 12px 24px rgba(20, 104, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.topbar-mini.active {
  border-color: rgba(20, 104, 255, 0.18);
  background: rgba(232, 242, 255, 0.9);
  color: var(--blue-dark);
}

.topbar-ask-cta:hover,
.topbar-mini:hover {
  transform: translateY(-1px);
}

.topbar-ask-cta .icon,
.topbar-mini .icon {
  width: 16px;
  height: 16px;
}

.home-today-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.today-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  padding: 14px;
  text-align: left;
  box-shadow: var(--liquid-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.today-card.primary-today {
  background: linear-gradient(180deg, rgba(43, 126, 255, 0.98), rgba(10, 86, 224, 0.98));
  color: #fff;
  box-shadow: 0 14px 28px rgba(20, 104, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.today-card .icon {
  width: 24px;
  height: 24px;
}

.today-card span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.today-card strong {
  overflow: hidden;
  color: inherit;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-card small {
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  opacity: 0.76;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.liquid-home-hero h1 {
  font-size: 48px;
}

.community-section-tabs {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  padding: 6px;
}

.community-section-tabs button {
  min-height: 62px;
  padding: 10px 12px;
}

.community-section-tabs button span {
  font-size: 14px;
}

.community-section-tabs button b {
  min-width: 22px;
  height: 22px;
}

.community-main-panel > .community-customize {
  margin-top: 0;
}

@media (max-width: 1120px) {
  .primary-nav {
    max-width: 430px;
  }

  .topbar-mini span {
    display: none;
  }

  .topbar-mini {
    width: 42px;
    padding: 0;
  }

  .home-today-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar-actions {
    display: none;
  }

  .topbar-inner {
    width: min(100% - 20px, 1240px);
  }

  .account-label {
    display: inline;
    max-width: 116px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-pill {
    max-width: 178px;
    padding: 4px 8px;
  }

  .home-today-panel {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .today-card {
    min-height: 72px;
  }

  .liquid-home-hero h1 {
    font-size: 34px;
  }

  .community-section-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-section-tabs button {
    min-height: 56px;
  }
}

/* Notes refresh: clearer library controls and more reliable selected states. */
.note-command-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 0.7fr)) minmax(280px, 1.6fr);
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
}

.note-stat {
  display: grid;
  place-items: center;
  min-height: 66px;
  border: 1px solid rgba(95, 123, 163, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 20px rgba(31, 67, 121, 0.06);
}

.note-stat strong {
  color: var(--blue-dark);
  font-size: 22px;
  line-height: 1;
}

.note-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.note-command-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 8px;
  min-width: 0;
}

.note-command-search .input,
.note-command-search .select {
  height: 100%;
  min-height: 48px;
}

.chip-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  color: inherit;
  font-size: 11px;
  padding: 0 6px;
}

.chip.active .chip-count {
  background: rgba(255, 255, 255, 0.22);
}

.note-layout {
  align-items: start;
}

.note-card {
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.note-card:hover,
.note-card:focus-visible {
  border-color: rgba(20, 104, 255, 0.28);
  transform: translateY(-1px);
}

.note-card.active-note {
  border-color: rgba(20, 104, 255, 0.76);
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.12), 0 14px 28px rgba(23, 105, 255, 0.1);
}

.note-inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.note-empty {
  display: grid;
  gap: 6px;
}

.note-empty strong {
  color: var(--ink);
}

.note-list[data-empty="true"]::after {
  content: "검색 결과가 없습니다.";
  display: grid;
  min-height: 120px;
  place-items: center;
  border: 1px dashed rgba(95, 123, 163, 0.32);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.note-choice-grid[data-empty="true"]::after {
  content: "검색 결과가 없습니다.";
  display: grid;
  min-height: 112px;
  place-items: center;
  grid-column: 1 / -1;
  border: 1px dashed rgba(95, 123, 163, 0.32);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 920px) {
  .note-command-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .note-command-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .note-command-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .note-command-search {
    grid-template-columns: 1fr;
  }

  .note-stat {
    min-height: 58px;
  }

  .note-list {
    max-height: none;
  }
}

/* Hand note input pass: pen-friendly, finger-friendly, no accidental text selection. */
.note-editor-backdrop,
.note-editor,
.note-editor-body,
.hand-canvas-stage,
.note-toolrail,
#handCanvas {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.note-title-input {
  -webkit-user-select: text;
  user-select: text;
}

body.is-drawing-note,
body.is-drawing-note * {
  -webkit-user-select: none !important;
  user-select: none !important;
}

.hand-canvas-stage {
  touch-action: none;
}

#handCanvas {
  cursor: crosshair;
}

.shape-detail-tools {
  border-top: 1px solid #e6edf6;
  padding-top: 10px;
}

.shape-dash-button.active,
.shape-fill-button.active,
.pen-only-button.active {
  border-color: rgba(15, 107, 255, 0.22);
  background: #eef5ff;
  color: var(--blue);
}

.shape-radius-wrap {
  min-width: 0;
}

.shape-radius {
  min-width: 88px;
}

@media (max-width: 980px) {
  .shape-detail-tools {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    border-top: 0;
    padding-top: 0;
  }

  .shape-radius-wrap {
    min-width: 112px;
  }
}

/* Site-native input overlays for edits, confirms, and compact text prompts. */
.ui-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: grid;
  place-items: start center;
  overflow: auto;
  background: rgba(13, 24, 45, 0.26);
  backdrop-filter: saturate(160%) blur(14px);
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.ui-dialog-card {
  display: grid;
  gap: 14px;
  width: min(620px, 100%);
  margin-top: min(9vh, 72px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(23, 45, 86, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.94);
  padding: 16px;
}

.small-dialog .ui-dialog-card {
  width: min(430px, 100%);
}

.ui-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ui-dialog-head strong {
  color: var(--ink);
  font-size: 18px;
}

.ui-dialog-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ui-dialog-form {
  display: grid;
  gap: 12px;
}

.dialog-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.dialog-field-wide {
  grid-column: 1 / -1;
}

.dialog-check {
  justify-content: flex-start;
  border: 1px solid rgba(95, 123, 163, 0.18);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.76);
  padding: 10px 12px;
}

.ui-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.danger-dialog {
  border-color: rgba(255, 215, 215, 0.9);
}

.note-title-edit {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid rgba(95, 123, 163, 0.22);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.82);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.note-title-edit span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 900;
}

.note-title-edit small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--blue);
  font-weight: 900;
}

.note-title-edit .icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 620px) {
  .storage-summary {
    grid-template-columns: 1fr;
  }

  .storage-user-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ui-dialog-card {
    margin-top: 8px;
    border-radius: 14px;
    padding: 14px;
  }

  .ui-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* Topbar layout lock: three stable desktop zones. */
@media (min-width: 761px) {
  .topbar-inner {
    display: grid;
    grid-template-columns: auto minmax(360px, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: min(1240px, calc(100% - 40px));
    min-height: 68px;
    padding: 8px 0;
  }

  .brand {
    grid-column: 1;
    width: 148px;
    min-width: 148px;
    max-width: 148px;
  }

  .brand img {
    width: 42px;
    height: 42px;
  }

  .brand span {
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .primary-nav {
    grid-column: 2;
    justify-self: center;
    width: min(100%, 540px);
    max-width: 540px;
    min-width: 0;
    justify-content: center;
  }

  .primary-nav button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 10px;
  }

  .primary-nav button span {
    max-width: none;
  }

  .topbar-right {
    grid-column: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
  }

  .topbar-actions,
  .account {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 7px;
    min-width: 0;
  }

  .profile-pill {
    max-width: 190px;
  }

  .account-label {
    display: inline-block;
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .topbar-inner {
    grid-template-columns: auto minmax(300px, 1fr) auto;
    width: calc(100% - 24px);
    gap: 10px;
  }

  .brand {
    width: 128px;
    min-width: 128px;
    max-width: 128px;
  }

  .primary-nav {
    max-width: 460px;
  }

  .topbar-ask-cta span,
  .topbar-mini span,
  .account .ghost span {
    display: none;
  }

  .topbar-ask-cta,
  .topbar-mini,
  .account .ghost {
    width: 42px;
    min-width: 42px;
    padding: 0;
  }

  .profile-pill {
    max-width: 142px;
  }

  .account-label {
    max-width: 84px;
  }
}

@media (min-width: 761px) and (max-width: 920px) {
  .topbar-inner {
    grid-template-columns: auto minmax(240px, 1fr) auto;
  }

  .brand {
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    padding: 4px;
  }

  .brand span {
    display: none;
  }

  .primary-nav {
    max-width: 390px;
  }

  .profile-pill {
    width: 42px;
    max-width: 42px;
    padding: 3px;
  }

  .profile-pill .account-label {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    display: flex;
    justify-content: space-between;
  }

  .topbar-right {
    display: flex;
    align-items: center;
    min-width: 0;
  }
}

.wordmaster-activity-panel {
  display: grid;
  gap: 14px;
}

.wordmaster-activity-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wordmaster-activity-stats div {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(95, 123, 163, 0.16);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.76);
  padding: 12px;
}

.wordmaster-activity-stats strong {
  color: var(--blue-dark);
  font-size: 24px;
  font-weight: 950;
}

.wordmaster-activity-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.wordmaster-activity-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wordmaster-activity-list button {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(95, 123, 163, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  padding: 11px 12px;
  text-align: left;
}

.wordmaster-activity-list button:hover {
  border-color: rgba(20, 104, 255, 0.3);
  background: rgba(239, 246, 255, 0.86);
}

.wordmaster-activity-list span,
.wordmaster-activity-list strong,
.wordmaster-activity-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wordmaster-activity-list span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

.wordmaster-activity-list strong {
  font-size: 14px;
}

.wordmaster-activity-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.post-quiz-gate {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid rgba(20, 104, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.94), rgba(255, 255, 255, 0.96)),
    var(--surface);
  box-shadow: 0 12px 30px rgba(24, 67, 130, 0.08);
  padding: 18px;
}

.post-quiz-gate h3 {
  margin: 3px 0 5px;
  color: var(--blue-dark);
  font-size: 20px;
}

.post-quiz-gate p,
.post-quiz-gate small,
.quiz-empty-state span {
  color: var(--muted);
  font-weight: 800;
}

.post-quiz-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.post-quiz-form input,
.post-quiz-question input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  padding: 12px 13px;
}

.post-quiz-window {
  border-color: rgba(16, 185, 129, 0.24);
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.94), rgba(255, 255, 255, 0.96)),
    var(--surface);
}

.quiz-empty-state,
.post-quiz-question {
  display: grid;
  gap: 8px;
  border: 1px dashed rgba(20, 104, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
}

.quiz-empty-state strong,
.post-quiz-question strong {
  color: var(--ink);
  font-size: 15px;
}

.post-quiz-question-list {
  display: grid;
  gap: 10px;
}

.post-quiz-question > span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

.quiz-passage {
  white-space: pre-wrap;
  border-left: 3px solid rgba(20, 104, 255, 0.28);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
  padding-left: 10px;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.notice-quiz-gate {
  margin-top: 14px;
  box-shadow: none;
}

.korean-quiz-app {
  word-break: keep-all;
}

.korean-quiz-hero,
.korean-question-card,
.korean-answer-panel {
  display: grid;
  gap: 12px;
}

.korean-quiz-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.korean-quiz-stats div {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(20, 104, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  padding: 12px;
}

.korean-quiz-stats strong {
  color: var(--blue-dark);
  font-size: 24px;
  font-weight: 950;
}

.korean-quiz-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.korean-quiz-actions,
.korean-quiz-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.korean-quiz-toolbar .select {
  flex: 1 1 190px;
  min-width: 0;
}

.korean-work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.korean-work-card,
.korean-concept-card,
.korean-question-card,
.korean-wrong-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(95, 123, 163, 0.17);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
}

.korean-work-card h4,
.korean-question-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.korean-work-card p,
.korean-question-card p,
.korean-concept-card p,
.korean-wrong-card p {
  white-space: pre-wrap;
  line-height: 1.65;
}

.korean-concept-list,
.korean-result-list {
  display: grid;
  gap: 10px;
}

.korean-concept-card summary {
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 950;
}

.korean-answer-form {
  display: grid;
  gap: 10px;
}

.korean-ox-buttons,
.korean-grade-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.korean-ox-buttons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.korean-answer-panel {
  border: 1px solid rgba(95, 123, 163, 0.18);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.84);
  padding: 14px;
}

.answer-ok {
  color: #047857;
}

.answer-bad {
  color: #b91c1c;
}

.warning-button {
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(254, 243, 199, 0.86);
  color: #92400e;
}

.secret-feature-panel details {
  border: 1px dashed rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.72);
  padding: 10px 12px;
}

.secret-feature-panel summary {
  cursor: pointer;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.secret-feature-body {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.volley-page,
.volley-controller-page {
  display: grid;
  gap: 16px;
}

.volley-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 3px solid #111827;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7ed 0%, #dbeafe 52%, #fee2e2 100%);
  box-shadow: 0 12px 0 #111827;
  padding: 28px;
}

.volley-hero h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(34px, 5vw, 70px);
  letter-spacing: 0;
}

.volley-hero p {
  max-width: 620px;
  color: #334155;
  font-weight: 800;
}

.volley-open-button,
.volley-ready-big {
  min-height: 54px;
  border: 3px solid #111827;
  box-shadow: 0 7px 0 #111827;
  font-size: 18px;
  font-weight: 950;
}

.volley-scoreboard {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(180px, 1.4fr) minmax(110px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.volley-scoreboard > div {
  display: grid;
  place-items: center;
  border: 3px solid #111827;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 7px 0 #111827;
  padding: 10px;
}

.volley-scoreboard > div:first-child {
  background: #fee2e2;
  color: #991b1b;
}

.volley-scoreboard > div:last-child {
  background: #dbeafe;
  color: #1d4ed8;
}

.volley-scoreboard strong {
  font-size: clamp(36px, 6vw, 76px);
  line-height: 1;
}

.volley-title b {
  color: #0f172a;
  font-size: 24px;
  font-weight: 950;
}

.volley-title small {
  color: #475569;
  font-weight: 900;
}

.volley-host-grid {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.volley-lobby-card,
.volley-stage-card,
.volley-controller-card {
  border: 3px solid #111827;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 0 #111827;
}

.volley-lobby-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.volley-room-code {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 10px;
}

.volley-room-code span {
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 900;
}

.volley-room-code strong {
  font-size: 48px;
  line-height: 1;
}

.volley-qr {
  width: min(100%, 300px);
  justify-self: center;
  border: 2px solid #111827;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.volley-join-link {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.volley-host-actions,
.volley-controller-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.volley-team-card {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
}

.volley-team-card.red {
  background: #fff1f2;
}

.volley-team-card.blue {
  background: #eff6ff;
}

.volley-team-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 950;
}

.volley-team-slots {
  display: grid;
  gap: 8px;
}

.volley-player-chip {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 7px;
}

.volley-player-chip.ready {
  border-color: #22c55e;
  box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.18);
}

.volley-player-face {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 950;
}

.volley-player-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.volley-player-chip strong,
.volley-player-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.volley-player-chip small {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.volley-stage-card {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background: #bfdbfe;
}

#volleyCanvas {
  display: block;
  width: 100%;
  height: min(62vh, 620px);
  min-height: 420px;
  touch-action: none;
}

.volley-broadcast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  min-width: 240px;
  border: 3px solid #111827;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  box-shadow: 0 6px 0 #111827;
  padding: 10px 18px;
  text-align: center;
  font-size: 18px;
  font-weight: 950;
}

.volley-controller-page {
  min-height: 72vh;
  place-items: center;
}

.volley-controller-page.live {
  background: linear-gradient(180deg, #eff6ff, #fff7ed);
  margin: -18px;
  padding: 18px;
}

.volley-controller-card {
  display: grid;
  gap: 14px;
  width: min(100%, 520px);
  padding: 18px;
}

.volley-controller-card h2 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
}

.volley-team-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.volley-team-picker button {
  min-height: 50px;
  border: 3px solid #111827;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-weight: 950;
}

.volley-team-picker button:first-child.active {
  background: #ef4444;
  color: #fff;
}

.volley-team-picker button:last-child.active {
  background: #2563eb;
  color: #fff;
}

.volley-avatar-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0 12px;
  font-weight: 900;
}

.volley-avatar-preview {
  width: 86px;
  height: 86px;
  border: 3px solid #111827;
  border-radius: 50%;
  object-fit: cover;
}

.volley-phone-status {
  display: grid;
  gap: 4px;
  border: 3px solid #111827;
  border-radius: 8px;
  background: #fee2e2;
  color: #111827;
  padding: 14px;
}

.volley-phone-status.ready {
  background: #dcfce7;
}

.volley-phone-status strong {
  font-size: 34px;
  line-height: 1;
}

.volley-phone-status span {
  font-size: 13px;
  font-weight: 900;
}

.volley-action-pad {
  min-height: 118px;
  border: 4px solid #111827;
  border-radius: 8px;
  background: #f97316;
  color: #fff;
  box-shadow: 0 9px 0 #111827;
  font-size: 24px;
  font-weight: 950;
  touch-action: none;
}

.volley-action-pad:active {
  transform: translateY(5px);
  box-shadow: 0 4px 0 #111827;
}

.volley-gamepad {
  display: grid;
  grid-template-columns: minmax(118px, .85fr) minmax(92px, .68fr) 1fr;
  gap: 14px;
  align-items: center;
}

.volley-joystick {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 132px;
  border: 4px solid #111827;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.95) 0 19%, transparent 20%),
    linear-gradient(145deg, #dbeafe, #93c5fd 48%, #60a5fa);
  box-shadow: inset 0 -10px 0 rgba(15,23,42,.16), 0 8px 0 #111827;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
  touch-action: none;
  user-select: none;
}

.volley-joystick span {
  position: absolute;
  width: 58px;
  height: 58px;
  border: 4px solid #111827;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff, #fef3c7);
  box-shadow: 0 5px 0 rgba(17,24,39,.9);
  transition: transform .05s linear;
}

.volley-joystick b {
  position: relative;
  z-index: 1;
  transform: translateY(46px);
}

.volley-center-hit {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 5px solid #111827;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 26%, #ffffff 0 16%, #f97316 17% 72%, #c2410c 73%);
  color: #fff;
  box-shadow: 0 10px 0 #111827;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.08;
  touch-action: none;
  user-select: none;
}

.volley-center-hit:active {
  transform: translateY(5px);
  box-shadow: 0 5px 0 #111827;
}

.volley-mega-swing {
  display: grid;
  place-items: center;
  min-height: clamp(180px, 34vh, 300px);
  border: 7px solid #111827;
  border-radius: 28px;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.95) 0 11%, transparent 12%),
    linear-gradient(145deg, #ffedd5 0%, #fb923c 33%, #f97316 62%, #c2410c 100%);
  color: #ffffff;
  box-shadow: 0 14px 0 #111827, inset 0 -16px 0 rgba(127,29,29,.2);
  font-size: clamp(44px, 14vw, 88px);
  font-weight: 1000;
  letter-spacing: 0;
  touch-action: none;
  user-select: none;
}

.volley-mega-swing:active {
  transform: translateY(7px) scale(.985);
  box-shadow: 0 7px 0 #111827, inset 0 -10px 0 rgba(127,29,29,.22);
}

.volley-pad-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.volley-pad-button {
  min-height: 64px;
  border: 4px solid #111827;
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 7px 0 #111827;
  font-size: 18px;
  font-weight: 950;
  touch-action: none;
  user-select: none;
}

.volley-pad-button:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #111827;
}

.volley-pad-button.jump {
  background: #22c55e;
}

.volley-pad-button.block {
  background: #2563eb;
}

.volley-pad-button.swing {
  grid-column: 1 / -1;
  min-height: 82px;
  background: #f97316;
  font-size: 23px;
}

.volley-dive-button {
  min-height: 58px;
  border: 3px solid #111827;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}

.volley-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.volley-help-grid span {
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  padding: 9px;
  font-size: 12px;
  font-weight: 900;
}

.korean-wrong-card > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.korean-wrong-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

@media (max-width: 760px) {
  .volley-hero,
  .volley-host-grid {
    grid-template-columns: 1fr;
  }

  .volley-hero {
    display: grid;
    padding: 20px;
  }

  .volley-scoreboard {
    grid-template-columns: 1fr 1.2fr 1fr;
  }

  .volley-host-grid {
    display: grid;
  }

  #volleyCanvas {
    height: 52vh;
    min-height: 340px;
  }

  .volley-lobby-card {
    order: 2;
  }

  .volley-stage-card {
    min-height: 340px;
  }

  .volley-controller-page.live {
    margin: -10px;
    padding: 10px;
  }

  .volley-gamepad {
    grid-template-columns: 1fr;
  }

  .volley-joystick {
    width: min(58vw, 220px);
    min-height: 150px;
    justify-self: center;
  }

  .volley-center-hit {
    width: min(54vw, 210px);
    min-height: 112px;
    justify-self: center;
  }

  .volley-mega-swing {
    min-height: min(42vh, 300px);
    border-radius: 22px;
  }

  .volley-pad-button {
    min-height: 60px;
  }

  .volley-help-grid {
    grid-template-columns: 1fr;
  }

  .wordmaster-activity-stats,
  .wordmaster-activity-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-quiz-form,
  .quiz-options {
    grid-template-columns: 1fr;
  }

  .korean-work-grid,
  .korean-quiz-stats,
  .korean-grade-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .wordmaster-activity-stats,
  .wordmaster-activity-list {
    grid-template-columns: 1fr;
  }
}

.quiz-hero,
.quiz-start,
.quiz-play,
.quiz-result {
  --quiz-a: #1769ff;
  --quiz-b: #ffb000;
  --quiz-c: #0f172a;
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 28px;
  color: #fff;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--quiz-a) 92%, #111827), color-mix(in srgb, var(--quiz-b) 78%, #111827));
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.quiz-theme-neon { --quiz-a: #7c3aed; --quiz-b: #06b6d4; }
.quiz-theme-fire { --quiz-a: #ef4444; --quiz-b: #f59e0b; }
.quiz-theme-ocean { --quiz-a: #0ea5e9; --quiz-b: #22c55e; }

.quiz-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: center;
}

.quiz-hero h1,
.quiz-start h1,
.quiz-play h1,
.quiz-result h1 {
  margin: 8px 0;
  color: #fff;
}

.quiz-hero p,
.quiz-start p,
.quiz-result p,
.quiz-help {
  color: rgba(255, 255, 255, 0.86);
}

.quiz-hero-actions,
.quiz-start-actions,
.quiz-result-actions,
.quiz-card-actions,
.quiz-editor-actions,
.quiz-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.quiz-stage-preview {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  border-radius: 18px;
}

.quiz-stage-code,
.quiz-code {
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  color: #0f172a;
  background: #fff;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.quiz-stage-question {
  min-height: 110px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: rgba(15, 23, 42, 0.32);
  font-size: 34px;
  font-weight: 900;
}

.quiz-stage-answers,
.quiz-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quiz-stage-answers span {
  min-height: 52px;
  border-radius: 14px;
}

.quiz-stage-answers span:nth-child(1),
.answer-0 { background: #e21b3c; }
.quiz-stage-answers span:nth-child(2),
.answer-1 { background: #1368ce; }
.quiz-stage-answers span:nth-child(3),
.answer-2 { background: #d89e00; }
.quiz-stage-answers span:nth-child(4),
.answer-3 { background: #26890c; }

.quiz-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.quiz-section-tabs {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.quiz-section-tabs button {
  flex: 1;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.quiz-section-tabs button.active {
  color: #fff;
  background: var(--primary);
}

.quiz-toolbar .search-field {
  flex: 1;
  min-width: 240px;
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.quiz-card {
  display: grid;
  gap: 9px;
  min-height: 190px;
  padding: 14px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--quiz-a), var(--quiz-b));
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.13);
}

.quiz-cover-image {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.18);
}

.quiz-card h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  line-height: 1.25;
}

.quiz-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quiz-card-head,
.quiz-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.quiz-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
}

.quiz-mini-rank {
  padding: 8px 10px;
  border-radius: 10px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.92);
  font-size: 12px;
}

.quiz-card-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.quiz-editor {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.quiz-maker-help {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
}

.quiz-maker-presets,
.quiz-add-row,
.quiz-live-actions,
.quiz-live-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.quiz-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
}

.quiz-editor-wide {
  grid-column: 1 / -1;
}

.quiz-question-editor-list {
  display: grid;
  gap: 14px;
}

.quiz-question-editor {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.quiz-question-editor-head,
.quiz-option-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.quiz-question-editor-head > div {
  display: flex;
  gap: 8px;
  align-items: center;
}

.quiz-option-editor {
  display: grid;
  gap: 8px;
}

.quiz-option-row .input {
  flex: 1;
}

.mini-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.mini-input {
  width: 74px;
}

.mini-select {
  width: 110px;
  min-height: 36px;
}

.quiz-start,
.quiz-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 20px;
}

.quiz-start-card,
.quiz-result-card {
  position: relative;
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 420px;
}

.quiz-start-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(10px);
}

.quiz-back-button {
  width: fit-content;
  justify-self: start;
  background: rgba(255, 255, 255, 0.94) !important;
  color: #111827 !important;
}

.quiz-result-stack {
  display: grid;
  gap: 14px;
}

.quiz-start-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quiz-start-meta span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-weight: 800;
}

.quiz-start label,
.quiz-start-card label {
  color: rgba(255, 255, 255, 0.94);
  font-weight: 800;
}

.quiz-start .ghost,
.quiz-play .ghost,
.quiz-result .ghost,
.quiz-live-head .ghost {
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
}

.quiz-start .ghost .icon,
.quiz-play .ghost .icon,
.quiz-result .ghost .icon,
.quiz-live-head .ghost .icon {
  color: currentColor;
}

.quiz-start .badge,
.quiz-play .badge,
.quiz-result .badge {
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
}

.quiz-name-input {
  max-width: 360px;
}

.quiz-start-image,
.quiz-question-image {
  width: min(520px, 100%);
  max-height: 280px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.quiz-start-button {
  min-width: 170px;
  min-height: 52px;
  font-size: 18px;
}

.quiz-play {
  display: grid;
  gap: 18px;
  min-height: calc(100vh - 190px);
}

.quiz-play-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.quiz-question-stage {
  display: grid;
  gap: 14px;
  place-items: center;
  text-align: center;
  padding: 22px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.24);
}

.quiz-question-stage h1 {
  max-width: 940px;
  font-size: 38px;
  line-height: 1.18;
}

.quiz-progress,
.quiz-timer {
  width: min(760px, 100%);
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.quiz-progress span,
.quiz-timer span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #fff;
}

.quiz-timer span {
  animation: quiz-timer var(--quiz-seconds, 20s) linear forwards;
}

.quiz-timer.static span {
  animation: none;
  transition: width 0.18s linear;
}

.quiz-stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.quiz-countdown.danger {
  color: #fff;
  background: #dc2626;
  animation: quiz-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes quiz-timer {
  from { width: 100%; }
  to { width: 0; }
}

@keyframes quiz-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.quiz-answer {
  min-height: 118px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, filter 0.12s ease;
}

.quiz-answer:hover {
  transform: translateY(-2px);
}

.quiz-answer:disabled {
  cursor: default;
}

.quiz-answer span {
  font-size: 28px;
}

.quiz-answer strong {
  font-size: 20px;
  text-align: left;
}

.quiz-answer.correct {
  outline: 5px solid #fff;
  filter: saturate(1.15);
}

.quiz-answer.wrong {
  opacity: 0.46;
  filter: grayscale(0.3);
}

.quiz-feedback {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 16px;
  color: #0f172a;
  background: #fff;
}

.quiz-effect-pop {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.quiz-effect-pop span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #facc15;
  animation: quiz-pop 720ms ease-out forwards;
}

.quiz-effect-pop span:nth-child(1) { left: 18%; top: 45%; }
.quiz-effect-pop span:nth-child(2) { left: 40%; top: 30%; animation-delay: 80ms; background: #38bdf8; }
.quiz-effect-pop span:nth-child(3) { left: 64%; top: 42%; animation-delay: 120ms; background: #22c55e; }
.quiz-effect-pop span:nth-child(4) { left: 78%; top: 58%; animation-delay: 40ms; background: #fb7185; }

@keyframes quiz-pop {
  from { transform: scale(0.4) translateY(0); opacity: 1; }
  to { transform: scale(2.5) translateY(-26px); opacity: 0; }
}

.quiz-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.quiz-confetti span {
  position: absolute;
  top: -16px;
  width: 9px;
  height: 18px;
  border-radius: 3px;
  background: #fff;
  animation: quiz-fall 1.6s ease-in infinite;
}

.quiz-confetti span:nth-child(1) { left: 10%; background: #facc15; animation-delay: 0ms; }
.quiz-confetti span:nth-child(2) { left: 28%; background: #38bdf8; animation-delay: 180ms; }
.quiz-confetti span:nth-child(3) { left: 45%; background: #22c55e; animation-delay: 80ms; }
.quiz-confetti span:nth-child(4) { left: 62%; background: #fb7185; animation-delay: 260ms; }
.quiz-confetti span:nth-child(5) { left: 78%; background: #a78bfa; animation-delay: 120ms; }
.quiz-confetti span:nth-child(6) { left: 90%; background: #f97316; animation-delay: 320ms; }

@keyframes quiz-fall {
  from { transform: translateY(0) rotate(0); opacity: 0; }
  12% { opacity: 1; }
  to { transform: translateY(280px) rotate(220deg); opacity: 0; }
}

.quiz-feedback strong {
  font-size: 22px;
}

.quiz-feedback p {
  flex-basis: 100%;
  margin: 0;
  text-align: center;
  color: #334155;
}

.quiz-feedback.correct strong {
  color: #15803d;
}

.quiz-feedback.wrong strong {
  color: #dc2626;
}

.quiz-leaderboard {
  color: var(--text);
}

.quiz-review {
  color: var(--text);
}

.quiz-review-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.quiz-review-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid #dc2626;
  border-radius: 12px;
  background: var(--surface);
}

.quiz-review-item.correct {
  border-left-color: #16a34a;
}

.quiz-review-head,
.quiz-review-answers {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.quiz-review-head strong {
  line-height: 1.35;
}

.quiz-review-answers {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.quiz-review-item p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.quiz-rank-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.quiz-rank-row:last-child {
  border-bottom: 0;
}

.quiz-rank-row strong {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
}

.quiz-live-host {
  display: grid;
  gap: 18px;
}

.quiz-live-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 22px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, #111827, #1769ff);
}

.quiz-live-head h1 {
  margin: 10px 0 4px;
  color: #fff;
}

.quiz-live-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  word-break: break-all;
}

.quiz-live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.quiz-live-stage {
  display: grid;
  gap: 16px;
}

@media (max-width: 760px) {
  .quiz-hero,
  .quiz-start,
  .quiz-result,
  .quiz-editor-grid {
    grid-template-columns: 1fr;
  }

  .quiz-hero,
  .quiz-start,
  .quiz-play,
  .quiz-result {
    padding: 18px;
    border-radius: 18px;
  }

  .quiz-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .quiz-section-tabs,
  .quiz-maker-help,
  .quiz-live-head {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-live-grid {
    grid-template-columns: 1fr;
  }

  .quiz-answer-grid,
  .quiz-stage-answers {
    grid-template-columns: 1fr;
  }

  .quiz-question-stage h1 {
    font-size: 27px;
  }

  .quiz-answer {
    min-height: 82px;
    padding: 16px;
  }

  .quiz-start-card,
  .quiz-result-card {
    min-height: auto;
  }

  .quiz-review-head {
    flex-direction: column;
  }
}

/* Final brand/icon polish: vanilla-JS pointer variables drive the highlight. */
.brand,
.nav button,
.topbar-mini,
.topbar-ask-cta,
.profile-pill,
.mobile-tabbar button,
.primary,
.ghost,
.small-button,
.quiz-answer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-clip: padding-box;
}

.brand::before,
.nav button::before,
.topbar-mini::before,
.topbar-ask-cta::before,
.profile-pill::before,
.mobile-tabbar button::before,
.primary::before,
.ghost::before,
.small-button::before,
.quiz-answer::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.72), transparent 34%);
  transition: opacity 0.16s ease;
}

.brand:hover::before,
.nav button:hover::before,
.topbar-mini:hover::before,
.topbar-ask-cta:hover::before,
.profile-pill:hover::before,
.mobile-tabbar button:hover::before,
.primary:hover::before,
.ghost:hover::before,
.small-button:hover::before,
.quiz-answer:hover::before {
  opacity: 1;
}

.brand .icon,
.nav button .icon,
.topbar-mini .icon,
.topbar-ask-cta .icon,
.profile-pill .icon,
.mobile-tabbar button .icon,
.primary .icon,
.ghost .icon,
.small-button .icon {
  position: relative;
  z-index: 1;
}

.brand span,
.nav button span,
.topbar-mini span,
.topbar-ask-cta span,
.profile-pill span,
.mobile-tabbar button span,
.primary span,
.ghost span,
.small-button span,
.quiz-answer strong {
  position: relative;
  z-index: 1;
  background: transparent;
  color: inherit;
  text-shadow: none;
}

.brand {
  gap: 9px;
  width: 196px;
  min-width: 196px;
  max-width: 196px;
  padding: 5px 10px;
}

.brand-icons {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  height: 44px;
}

.brand-logo {
  display: block;
  object-fit: contain;
  grid-area: 1 / 1;
  transform-origin: center;
}

.brand .brand-logo.tutor-logo {
  width: 42px;
  height: 42px;
  opacity: 0;
  animation: brand-tutor-phase 8s ease-in-out infinite;
}

.brand .brand-logo.school-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  filter: drop-shadow(0 8px 16px rgba(0, 146, 65, 0.22));
  animation: brand-school-main-phase 8s ease-in-out infinite;
}

.brand-title {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: center;
  min-width: 0;
  width: 108px;
  height: 20px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: clip;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1;
}

.brand-title-main,
.brand-title-school {
  grid-area: 1 / 1;
  display: block;
  white-space: nowrap;
}

.brand-title-main {
  color: var(--ink);
  opacity: 0;
  animation: brand-tutor-phase 8s ease-in-out infinite;
}

.brand-title-school {
  color: #009241;
  font-weight: 950;
  animation: brand-school-main-phase 8s ease-in-out infinite;
}

@keyframes brand-school-main-phase {
  0%, 57%, 92%, 100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  63%, 86% {
    opacity: 0;
    transform: translateY(-5px) scale(0.96);
  }
}

@keyframes brand-tutor-phase {
  0%, 57%, 92%, 100% {
    opacity: 0;
    transform: translateY(5px) scale(0.96);
  }
  63%, 86% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-card .brand,
.auth-card .auth-brand {
  width: fit-content;
  min-width: 210px;
  max-width: none;
  margin: 0 auto 18px;
  justify-content: center;
}

.auth-card .brand-title {
  display: grid;
  max-width: none;
  overflow: visible;
}

.nav button,
.topbar-mini,
.topbar-ask-cta {
  line-height: 1;
}

.nav button span,
.topbar-mini span,
.topbar-ask-cta span,
.mobile-tabbar button span {
  display: inline-flex;
  align-items: center;
  min-height: 1em;
}

@media (min-width: 761px) {
  .topbar .brand {
    width: 196px;
    min-width: 196px;
    max-width: 196px;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .topbar .brand {
    width: 174px;
    min-width: 174px;
    max-width: 174px;
  }

  .topbar .brand-icons {
    width: 44px;
    min-width: 44px;
  }

  .topbar .brand-title {
    width: 96px;
    font-size: 14px;
  }
}

@media (min-width: 761px) and (max-width: 920px) {
  .topbar .brand {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    padding: 4px 6px;
  }

  .topbar .brand-icons {
    display: inline-grid;
  }

  .topbar .brand-title {
    display: none;
  }
}

@media (max-width: 760px) {
  .brand {
    width: auto;
    min-width: 0;
    max-width: none;
  }

  .brand-icons {
    width: 46px;
    min-width: 46px;
    height: 38px;
  }

  .brand .brand-logo.tutor-logo {
    width: 36px;
    height: 36px;
  }

  .brand .brand-logo.school-logo {
    width: 34px;
    height: 34px;
  }
}

/* Site redesign pass: crisp school-service UI, no framework required. */
:root {
  --bg: #f3f7fb;
  --ink: #101826;
  --muted: #5b6b80;
  --line: rgba(127, 146, 171, 0.24);
  --line-strong: rgba(78, 101, 133, 0.24);
  --card: rgba(255, 255, 255, 0.82);
  --surface: rgba(255, 255, 255, 0.86);
  --surface-muted: rgba(244, 248, 252, 0.9);
  --primary: #1769ff;
  --primary-dark: #0f4fc8;
  --school-green: #009241;
  --shadow: 0 18px 46px rgba(33, 55, 86, 0.12);
  --shadow-soft: 0 10px 28px rgba(33, 55, 86, 0.08);
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.14) 36%, rgba(255, 255, 255, 0.5)),
    linear-gradient(135deg, #eef7ff 0%, #f8fbff 42%, #f5fff8 100%);
}

body::before {
  background:
    linear-gradient(90deg, rgba(23, 105, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 146, 65, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}

.app-shell,
.auth-wrap {
  opacity: 0;
  transform: translateY(8px);
}

.app-shell.is-mounted,
.auth-wrap.is-mounted {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.topbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(248, 251, 255, 0.76);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 14px 34px rgba(31, 58, 94, 0.08);
}

.topbar-inner {
  min-height: 70px;
}

.container {
  width: min(1240px, calc(100% - 32px));
  padding-top: 22px;
}

.panel,
.question-card,
.answer-card,
.notice-card,
.post-card,
.community-card,
.profile-card,
.inventory-card,
.quiz-card,
.word-card,
.study-timer-card,
.study-leaderboard {
  border: 1px solid rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 252, 255, 0.78));
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.panel,
.question-card,
.notice-card,
.post-card,
.community-card,
.profile-card {
  border-radius: 12px;
}

.question-card,
.notice-card,
.post-card,
.community-card,
.quiz-card {
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.question-card:hover,
.notice-card:hover,
.post-card:hover,
.community-card:hover,
.quiz-card:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 105, 255, 0.24);
  box-shadow: 0 18px 42px rgba(30, 63, 112, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.section-title {
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
}

.section-title h1,
.section-title h2,
.section-title h3,
.panel h2,
.panel h3 {
  color: #122033;
  letter-spacing: 0;
}

.muted,
.meta,
.mini {
  color: var(--muted);
}

.input,
.textarea,
.select {
  min-height: 42px;
  border: 1px solid rgba(88, 111, 142, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.input:focus,
.textarea:focus,
.select:focus,
.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  border-color: rgba(23, 105, 255, 0.48);
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23, 105, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.primary,
.ghost,
.small-button,
.chip,
.nav button,
.topbar-mini,
.topbar-ask-cta,
.profile-pill {
  border-radius: 10px;
}

.primary {
  border: 1px solid rgba(23, 105, 255, 0.2);
  background: linear-gradient(180deg, #2d7dff, #0f5fe8);
  box-shadow: 0 12px 26px rgba(23, 105, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.primary:hover {
  background: linear-gradient(180deg, #438cff, #1158d7);
}

.ghost,
.small-button,
.chip {
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.badge {
  border: 1px solid rgba(89, 112, 146, 0.16);
  background: rgba(255, 255, 255, 0.76);
  color: #405067;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.badge.selected,
.chip.active {
  border-color: rgba(23, 105, 255, 0.22);
  background: rgba(232, 242, 255, 0.92);
  color: var(--primary-dark);
}

.nav {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.nav button.active {
  color: #fff;
  background: linear-gradient(180deg, #2e7fff, #1059d8);
}

.topbar-ask-cta {
  background: linear-gradient(180deg, #16a34a, #087a36);
  border-color: rgba(0, 146, 65, 0.24);
  box-shadow: 0 12px 26px rgba(0, 146, 65, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.auth-card {
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 252, 255, 0.84));
  box-shadow: 0 24px 70px rgba(30, 55, 90, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.tabs {
  border-radius: 12px;
  background: rgba(238, 245, 252, 0.88);
  padding: 5px;
}

.tabs button {
  border-radius: 9px;
}

.tabs button.active {
  background: #fff;
  box-shadow: 0 8px 18px rgba(30, 55, 90, 0.1);
}

.mobile-tabbar {
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(250, 252, 255, 0.86);
  backdrop-filter: blur(20px);
  box-shadow: 0 -14px 34px rgba(31, 58, 94, 0.1);
}

.mobile-tabbar button.active {
  background: linear-gradient(180deg, #2d7dff, #0f5fe8);
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(16, 24, 38, 0.92);
  box-shadow: 0 16px 40px rgba(16, 24, 38, 0.2);
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 20px, 1240px);
    padding-top: 14px;
  }

  .panel,
  .question-card,
  .notice-card,
  .post-card,
  .community-card {
    border-radius: 12px;
  }

  .section-title {
    margin: 14px 0 10px;
  }
}

/* Class timer priority pass */
.community-study-room .visual-study-grid {
  gap: 14px;
}

.study-priority-stack {
  order: -1;
}

.study-priority-stack .study-timer-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(0, 146, 65, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(242, 255, 247, 0.88)),
    radial-gradient(circle at 15% 0%, rgba(0, 146, 65, 0.12), transparent 34%);
  box-shadow: 0 22px 56px rgba(0, 91, 42, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.study-priority-stack .study-timer-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--study-color), #009241);
  opacity: 0.95;
}

.study-stopwatch-face {
  min-height: 150px;
  border-color: rgba(0, 146, 65, 0.28);
  background:
    radial-gradient(circle at 50% 0%, rgba(34, 197, 94, 0.24), transparent 38%),
    linear-gradient(180deg, #071525, #122238);
}

.study-stopwatch-face span {
  color: #86efac;
  font-size: 12px;
}

.study-stopwatch-face strong {
  font-size: clamp(38px, 6vw, 58px);
  text-shadow: 0 0 24px rgba(134, 239, 172, 0.24);
}

.study-stopwatch-face small {
  color: rgba(219, 234, 254, 0.84);
  font-size: 12px;
}

.study-start-form {
  gap: 12px;
}

.study-start-copy {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(0, 146, 65, 0.18);
  border-radius: 12px;
  background: rgba(236, 253, 245, 0.72);
}

.study-start-copy strong {
  color: #075f2b;
  font-size: 18px;
}

.study-start-copy span {
  color: #315440;
  font-size: 13px;
  line-height: 1.45;
}

.study-goal-select {
  grid-template-columns: minmax(0, 1fr);
}

.study-start-main-button {
  width: 100%;
  min-height: 62px;
  border-radius: 14px;
  background: linear-gradient(180deg, #19b85a, #087a36);
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  box-shadow: 0 18px 34px rgba(0, 146, 65, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.study-start-main-button:hover {
  background: linear-gradient(180deg, #20c765, #087a36);
}

.study-tools-toggle {
  width: 100%;
  min-height: 44px;
  border-style: dashed;
  color: #25603b;
  background: rgba(255, 255, 255, 0.72);
}

.study-advanced-panel,
.study-advanced-start-fields {
  display: grid;
  gap: 10px;
}

.study-advanced-panel {
  padding: 12px;
  border: 1px solid rgba(89, 112, 146, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.study-advanced-panel .study-extra-timers {
  border-top: 0;
  padding-top: 0;
}

.study-advanced-panel .board-note-form {
  margin-top: 4px;
  border: 1px solid rgba(89, 112, 146, 0.16);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.86);
  padding: 12px;
}

.study-leaderboard {
  border-color: rgba(23, 105, 255, 0.14);
}

@media (min-width: 900px) {
  .study-priority-stack {
    grid-template-columns: minmax(360px, 0.92fr) minmax(280px, 0.55fr);
  }
}

@media (max-width: 760px) {
  .study-stopwatch-face {
    min-height: 128px;
  }

  .study-start-main-button {
    min-height: 58px;
    font-size: 16px;
  }
}

/* Mobile/tabbar and brand recovery: keep these after later redesign passes. */
.topbar .brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  overflow: hidden;
}

.topbar .brand-icons {
  display: grid !important;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  overflow: visible !important;
}

.topbar .brand-logo {
  grid-area: 1 / 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.topbar .brand-title {
  display: grid !important;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: 116px;
  height: 20px;
  overflow: hidden;
}

.topbar .brand-title-main,
.topbar .brand-title-school {
  display: block !important;
  min-width: 0;
  max-width: 100%;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap;
}

@media (min-width: 1181px) {
  .topbar .brand {
    width: 188px !important;
    min-width: 188px !important;
    max-width: 188px !important;
    padding: 5px 10px;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .topbar .brand {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    padding: 4px 6px !important;
    justify-content: center;
  }

  .topbar .brand-title {
    display: none !important;
  }

  .topbar .brand-icons {
    flex-basis: 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
  }
}

@media (max-width: 760px) {
  .topbar .brand {
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    padding: 4px !important;
    justify-content: center;
  }

  .topbar .brand-title {
    display: none !important;
  }

  .topbar .brand-icons {
    flex-basis: 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  .bottom-ask {
    display: none !important;
  }

  .mobile-tabbar {
    position: fixed !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    z-index: 80 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    min-height: 64px;
    border-radius: 18px;
    padding: 7px;
  }

  .mobile-tabbar button {
    display: grid !important;
    place-items: center;
    gap: 3px;
    min-width: 0;
    min-height: 50px;
  }

  .mobile-tabbar button span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-shell {
    padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
  }
}

@media (min-width: 761px) {
  .mobile-tabbar {
    display: none !important;
  }
}

/* Auth contrast recovery: the login surface must not collapse into a white sheet. */
.auth-wrap {
  min-height: 100dvh;
  place-items: center;
  padding: clamp(20px, 4vw, 42px);
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 146, 65, 0.16), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(23, 105, 255, 0.18), transparent 32%),
    linear-gradient(135deg, #eef7ff 0%, #f7fbff 46%, #eefbf3 100%);
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid rgba(86, 112, 150, 0.2) !important;
  border-radius: 22px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 255, 0.92)) !important;
  color: #102033;
  padding: 24px !important;
  box-shadow: 0 28px 80px rgba(30, 55, 90, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
}

.auth-card .brand,
.auth-card .auth-brand {
  display: inline-flex !important;
  width: fit-content !important;
  min-width: 214px !important;
  max-width: none !important;
  min-height: 70px;
  margin: 0 auto 20px !important;
  padding: 6px 10px !important;
  justify-content: center;
  overflow: visible !important;
}

.auth-card .brand-icons {
  display: grid !important;
  flex: 0 0 54px;
  width: 54px;
  min-width: 54px;
  height: 54px;
  overflow: visible !important;
}

.auth-card .brand-logo.tutor-logo {
  width: 50px;
  height: 50px;
}

.auth-card .brand-logo.school-logo {
  width: 48px;
  height: 48px;
}

.auth-card .brand-title {
  display: grid !important;
  width: 128px !important;
  max-width: 128px !important;
  height: 24px;
  overflow: hidden !important;
  font-size: 17px;
}

.auth-card .form {
  display: grid;
  gap: 13px;
}

.auth-card label {
  display: grid;
  gap: 7px;
  color: #25344d;
  font-size: 13px;
  font-weight: 900;
}

.auth-card .input {
  min-height: 46px;
  border: 1px solid rgba(67, 90, 123, 0.26);
  border-radius: 12px;
  background: #fff;
  color: #101826;
  padding: 0 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.auth-card .input:focus,
.auth-card .input:focus-visible {
  border-color: rgba(23, 105, 255, 0.52);
  outline: none;
  box-shadow: 0 0 0 4px rgba(23, 105, 255, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.auth-card .tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 16px;
  border: 1px solid rgba(86, 112, 150, 0.18);
  border-radius: 14px;
  background: #eaf2ff;
  padding: 5px;
}

.auth-card .tabs button {
  min-height: 42px;
  border-radius: 10px;
  color: #36516e;
  font-weight: 950;
}

.auth-card .tabs button.active {
  background: linear-gradient(180deg, #2378ff, #0f5fe8) !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(23, 105, 255, 0.24);
}

.auth-card .primary {
  min-height: 48px;
  color: #fff !important;
  font-weight: 950;
}

.signup-quiz-box {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid rgba(23, 105, 255, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(237, 246, 255, 0.96), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.signup-quiz-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.signup-quiz-head strong {
  color: #0f4fc8;
  font-size: 14px;
}

.signup-quiz-head span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(23, 105, 255, 0.12);
  color: #0f4fc8;
  font-size: 11px;
  font-weight: 950;
}

.signup-quiz-box p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.signup-quiz-box h3 {
  margin: 0;
  color: #111827;
  font-size: 15px;
  line-height: 1.42;
}

.signup-quiz-options,
.signup-quiz-admin-options {
  display: grid;
  gap: 8px;
}

.signup-quiz-option {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px !important;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid rgba(67, 90, 123, 0.18);
  border-radius: 12px;
  background: #fff;
  color: #25344d;
}

.signup-quiz-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.signup-quiz-short-input {
  min-height: 48px;
}

.signup-quiz-settings-form {
  gap: 11px;
}

@media (max-width: 760px) {
  .auth-wrap {
    align-items: start;
    padding: 44px 18px 24px;
  }

  .auth-card {
    padding: 20px !important;
  }
}

/* Interaction recovery: no full-page white flash on every in-app action. */
.app-shell,
.auth-wrap,
.app-shell.is-mounted,
.auth-wrap.is-mounted {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.auth-wrap {
  display: grid !important;
}

/* Study extra tools must scroll independently, especially on mobile. */
.study-advanced-panel {
  max-height: min(460px, 48dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.study-advanced-panel .board-note-form {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 760px) {
  .mobile-tabbar {
    position: fixed !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    z-index: 220 !important;
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .container {
    padding-bottom: calc(124px + env(safe-area-inset-bottom)) !important;
  }

  .study-priority-stack,
  .study-side-stack {
    min-height: 0;
  }

  .study-advanced-panel {
    max-height: min(390px, 44dvh);
    padding-right: 10px;
  }

  .study-advanced-panel .quick-timer-row,
  .study-advanced-panel .quick-timer-custom {
    flex-wrap: wrap;
  }

  .study-advanced-panel .quick-timer-row .small-button {
    flex: 1 1 72px;
  }
}

/* Topbar action sizing recovery: keep desktop/iPad right actions from crushing each other. */
.topbar-ask-cta span,
.topbar-mini span,
.account-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 761px) {
  .topbar-right {
    max-width: min(470px, 42vw);
    overflow: hidden;
  }

  .topbar-actions {
    flex: 0 1 auto;
    gap: 6px;
    overflow: hidden;
  }

  .topbar-ask-cta,
  .topbar-mini,
  .topbar .account .ghost {
    flex: 0 0 auto;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0 10px;
  }

  .topbar-action-ask {
    width: 92px;
  }

  .topbar-action-tutor {
    width: 74px;
  }

  .topbar-action-apply {
    width: 72px;
  }

  .topbar-action-admin {
    width: 74px;
  }

  .topbar-action-hidden {
    width: 82px;
  }

  .topbar .profile-pill {
    flex: 1 1 132px;
    min-width: 44px;
    max-width: 158px;
  }
}

@media (min-width: 761px) and (max-width: 1280px) {
  .topbar-inner {
    grid-template-columns: auto minmax(330px, 1fr) minmax(210px, auto) !important;
    gap: 8px !important;
    width: calc(100% - 20px) !important;
  }

  .topbar-right {
    max-width: 360px;
    gap: 6px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar-ask-cta span,
  .topbar-mini span,
  .topbar .account .ghost span {
    display: none !important;
  }

  .topbar-action-ask,
  .topbar-action-tutor,
  .topbar-action-apply,
  .topbar-action-admin,
  .topbar-action-hidden,
  .topbar .account .ghost {
    width: 42px !important;
    min-width: 42px !important;
    padding: 0 !important;
  }

  .topbar .profile-pill {
    width: 118px;
    max-width: 118px;
    padding-right: 8px;
  }

  .topbar .account-label {
    max-width: 72px !important;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .topbar-inner {
    grid-template-columns: auto minmax(260px, 1fr) auto !important;
  }

  .topbar-right {
    max-width: 250px;
  }

  .topbar .profile-pill {
    width: 42px !important;
    max-width: 42px !important;
    padding: 3px !important;
  }

  .topbar .profile-pill .account-label {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .topbar-actions {
    display: none !important;
  }
}

/* Notification action contrast: keep the top-right notice action on a white surface. */
.notification-read-button,
.section-title .notification-read-button {
  border-color: rgba(95, 123, 163, 0.24) !important;
  background: #fff !important;
  color: #111827 !important;
  box-shadow: 0 8px 18px rgba(31, 67, 121, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
}

.notification-read-button .icon {
  color: #111827 !important;
}

.notification-read-button:hover {
  border-color: rgba(23, 105, 255, 0.28) !important;
  background: #f8fbff !important;
  color: #0f5fe8 !important;
}

/* Toast message contrast recovery: keep save/error panels on a white surface. */
.toast {
  border: 1px solid rgba(95, 123, 163, 0.22) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #111827 !important;
  text-shadow: none !important;
  box-shadow: 0 16px 38px rgba(31, 67, 121, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: saturate(170%) blur(18px);
}

.toast strong,
.toast span {
  color: inherit !important;
}

.admin-analytics-panel {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.analytics-export-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tiny-btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.analytics-live-stats {
  margin: 0;
}

.analytics-insights {
  display: grid;
  gap: 8px;
}

.analytics-insight {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(89, 112, 146, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

.analytics-insight strong {
  flex: 0 0 auto;
  color: #0f766e;
}

.analytics-insight.warning strong {
  color: #b45309;
}

.analytics-insight.danger strong {
  color: #dc2626;
}

.analytics-insight span {
  color: #334155;
  font-size: 13px;
  line-height: 1.35;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.analytics-grid h3,
.analytics-days h3,
.analytics-breakdown-card h3,
.analytics-hourly h3,
.analytics-errors h3 {
  margin: 0 0 10px;
  color: #122033;
  font-size: 16px;
}

.compact-head {
  margin-bottom: 10px;
}

.analytics-trend,
.analytics-hourly,
.analytics-errors,
.analytics-breakdown-card {
  padding: 12px;
  border: 1px solid rgba(89, 112, 146, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.analytics-trend-bars,
.analytics-hour-grid {
  display: grid;
  align-items: end;
  gap: 7px;
  min-height: 126px;
}

.analytics-trend-bars {
  grid-template-columns: repeat(14, minmax(18px, 1fr));
}

.analytics-hour-grid {
  grid-template-columns: repeat(24, minmax(10px, 1fr));
}

.analytics-trend-item,
.analytics-hour-item {
  display: grid;
  grid-template-rows: minmax(80px, 1fr) auto;
  gap: 6px;
  align-items: end;
  min-width: 0;
  text-align: center;
}

.analytics-trend-item span,
.analytics-hour-item span {
  display: block;
  width: 100%;
  min-height: 4px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #2563eb, #22c55e);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.analytics-hour-item span {
  background: linear-gradient(180deg, #0ea5e9, #6366f1);
}

.analytics-trend-item small,
.analytics-hour-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.analytics-bar-row {
  display: grid;
  gap: 5px;
  margin-top: 9px;
}

.analytics-bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.analytics-bar-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-bar-meta b {
  flex: 0 0 auto;
  color: #122033;
}

.analytics-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.analytics-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22c55e);
}

.analytics-today {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.analytics-today div {
  padding: 10px;
  border-radius: 10px;
  background: rgba(244, 248, 252, 0.86);
}

.analytics-today strong {
  display: block;
  color: #122033;
  font-size: 18px;
}

.analytics-today span,
.analytics-path-row small,
.analytics-day-row {
  color: var(--muted);
  font-size: 12px;
}

.analytics-path-list {
  display: grid;
  gap: 7px;
}

.analytics-path-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(244, 248, 252, 0.86);
}

.analytics-path-row span {
  overflow: hidden;
  color: #122033;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-path-row b {
  color: var(--primary);
}

.analytics-path-row small {
  grid-column: 1 / -1;
}

.analytics-day-table {
  display: grid;
  gap: 6px;
}

.analytics-day-row {
  display: grid;
  grid-template-columns: 1.25fr repeat(7, minmax(54px, 0.7fr));
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(244, 248, 252, 0.72);
}

.analytics-day-row.head {
  background: transparent;
  color: #334155;
  font-weight: 900;
}

.analytics-error-list {
  display: grid;
  gap: 8px;
}

.analytics-error-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(254, 242, 242, 0.78);
  color: #7f1d1d;
}

.analytics-error-row b {
  color: #dc2626;
}

.analytics-error-row code {
  overflow: hidden;
  color: #122033;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-error-row small {
  grid-column: 1 / -1;
  color: #64748b;
}

@media (max-width: 760px) {
  .analytics-export-actions {
    justify-content: flex-start;
  }

  .analytics-grid,
  .analytics-today,
  .analytics-breakdown-grid {
    grid-template-columns: 1fr;
  }

  .analytics-trend-bars,
  .analytics-hour-grid {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .analytics-trend-bars {
    grid-template-columns: repeat(14, 28px);
  }

  .analytics-hour-grid {
    grid-template-columns: repeat(24, 18px);
  }

  .analytics-day-table {
    overflow-x: auto;
  }

  .analytics-day-row {
    min-width: 720px;
  }
}

.quiz-live-qr-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: min(100%, 290px);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.quiz-live-qr {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  border: 6px solid #fff;
  background: #fff;
}

.quiz-live-qr-card span,
.quiz-live-qr-card small {
  display: block;
  color: rgba(255, 255, 255, 0.76);
}

.quiz-live-qr-card strong {
  display: block;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.quiz-live-qr-card small {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-feedback.pending strong {
  color: #1769ff;
}

.quiz-winner-stage {
  background:
    radial-gradient(circle at 20% 20%, rgba(250, 204, 21, 0.26), transparent 32%),
    radial-gradient(circle at 78% 24%, rgba(56, 189, 248, 0.24), transparent 30%),
    rgba(255, 255, 255, 0.18);
}

.quiz-card,
.quiz-card h3,
.quiz-card p,
.quiz-card-meta span {
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.26);
}

/* Quiz hub cards must stay colorful; the global glass-card pass makes them white. */
.quiz-grid .quiz-card {
  border: 1px solid rgba(255, 255, 255, 0.34) !important;
  color: #fff !important;
  background: linear-gradient(135deg, var(--quiz-a, #1769ff), var(--quiz-b, #22c55e)) !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.26) !important;
}

.quiz-grid .quiz-card h3,
.quiz-grid .quiz-card p,
.quiz-grid .quiz-card-meta span {
  color: #fff !important;
}

.quiz-grid .quiz-card p,
.quiz-grid .quiz-card-meta span {
  color: rgba(255, 255, 255, 0.9) !important;
}

.quiz-grid .quiz-card .quiz-code {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(15, 23, 42, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.quiz-grid .quiz-card .badge,
.quiz-grid .quiz-card .quiz-mini-rank {
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.9) !important;
  text-shadow: none;
}

.quiz-section-tabs {
  background: rgba(246, 250, 255, 0.88);
}

.quiz-section-tabs button {
  color: #334155;
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-shell,
  .app-shell.is-mounted {
    transform: none !important;
  }

  .mobile-tabbar {
    position: fixed !important;
    inset: auto max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
    transform: translateZ(0) !important;
    will-change: transform;
    z-index: 1000 !important;
    contain: layout paint;
  }

  .quiz-live-qr-card {
    grid-template-columns: 76px minmax(0, 1fr);
    min-width: 0;
  }

  .quiz-live-qr {
    width: 76px;
    height: 76px;
  }

  .quiz-live-qr-card strong {
    font-size: 28px;
  }
}

/* Admin/developer panel mobile pass */
@media (max-width: 760px) {
  .admin-analytics-panel,
  .admin-storage-tools,
  .storage-panel {
    gap: 10px;
    min-width: 0;
  }

  .admin-analytics-panel .card-head,
  .admin-storage-tools .card-head {
    align-items: stretch;
    gap: 10px;
  }

  .analytics-export-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .analytics-export-actions .tiny-btn,
  .analytics-export-actions .badge {
    width: 100%;
    justify-content: center;
  }

  .analytics-live-stats.compact-stats,
  .admin-analytics-panel .compact-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .admin-analytics-panel .stat {
    min-height: 72px;
    padding: 10px;
  }

  .admin-analytics-panel .stat strong {
    font-size: 20px;
  }

  .analytics-insight {
    align-items: flex-start;
    padding: 10px;
  }

  .analytics-insight strong,
  .analytics-insight span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .analytics-grid,
  .analytics-breakdown-grid,
  .storage-summary {
    grid-template-columns: 1fr !important;
  }

  .analytics-today {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .analytics-trend,
  .analytics-hourly,
  .analytics-errors,
  .analytics-breakdown-card {
    padding: 10px;
    border-radius: 12px;
  }

  .analytics-bar-meta {
    align-items: flex-start;
  }

  .analytics-bar-meta span {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .analytics-path-row {
    grid-template-columns: 1fr auto;
    padding: 10px;
  }

  .analytics-path-row span {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .analytics-error-row {
    grid-template-columns: auto 1fr;
    gap: 6px 8px;
  }

  .analytics-error-row code,
  .analytics-error-row small {
    grid-column: 1 / -1;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .analytics-day-table {
    margin-inline: -2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .analytics-day-row {
    min-width: 620px;
    grid-template-columns: 1.1fr repeat(7, minmax(46px, 0.7fr));
  }

  .storage-user-list {
    max-height: 360px;
  }

  .storage-user-row {
    grid-template-columns: 1fr !important;
    align-items: stretch;
  }

  .storage-user-row .meta,
  .storage-user-row .actions {
    justify-content: flex-start;
  }

  .log-row {
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
  }
}

@media (max-width: 420px) {
  .analytics-export-actions {
    grid-template-columns: 1fr;
  }

  .analytics-live-stats.compact-stats,
  .admin-analytics-panel .compact-stats,
  .analytics-today {
    grid-template-columns: 1fr !important;
  }
}

/* Product UI refresh: mobile-first learning Q&A surface. */
:root {
  --primary: #1769ff;
  --primary-strong: #0f4fc8;
  --primary-soft: #edf5ff;
  --surface-bg: #f7f9fc;
  --surface-card: #ffffff;
  --surface-line: #e8edf5;
  --surface-line-strong: #d8e1ee;
  --text-main: #111827;
  --text-subtle: #667085;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-card: 0 10px 28px rgba(15, 23, 42, 0.06);
  --shadow-focus: 0 0 0 4px rgba(23, 105, 255, 0.12);
}

body {
  background:
    linear-gradient(180deg, #ffffff 0, var(--surface-bg) 260px),
    var(--surface-bg);
  color: var(--text-main);
}

.container {
  width: min(1060px, calc(100% - 32px));
  padding-top: 18px;
}

.panel,
.question-card,
.answer-card,
.notice-card,
.note-command-panel,
.home-today-panel,
.home-guide-card,
.stat,
.today-card {
  border: 1px solid var(--surface-line) !important;
  border-radius: var(--radius-lg) !important;
  background: var(--surface-card) !important;
  box-shadow: var(--shadow-card) !important;
}

.panel {
  padding: 18px;
}

.section-title {
  align-items: end;
  margin: 4px 0 14px;
}

.section-title h2,
.compose-head h2,
.detail-title h1 {
  color: #101828;
  letter-spacing: 0;
}

.section-title h2 {
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
}

.muted,
.mini,
.meta,
.section-title p {
  color: var(--text-subtle) !important;
}

.primary,
button.primary,
.success,
.submit-wide {
  border: 0 !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, #2f7dff, var(--primary)) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(23, 105, 255, 0.22) !important;
  font-weight: 950;
}

.ghost,
.small-button,
.chip,
.nav button {
  border-color: var(--surface-line-strong) !important;
  border-radius: 14px !important;
  background: #fff !important;
  color: #344054 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.ghost:hover,
.small-button:hover,
.chip:hover,
.nav button:hover {
  border-color: rgba(23, 105, 255, 0.26) !important;
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
}

.nav button.active,
.chip.active,
.choice-btn.active {
  border-color: rgba(23, 105, 255, 0.3) !important;
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
}

.input,
.select,
.textarea {
  border: 1px solid var(--surface-line-strong) !important;
  border-radius: 16px !important;
  background: #fff !important;
  color: var(--text-main) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.input:focus,
.select:focus,
.textarea:focus,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  border-color: rgba(23, 105, 255, 0.55) !important;
  outline: none;
  box-shadow: var(--shadow-focus) !important;
}

.topbar {
  border-bottom: 1px solid rgba(232, 237, 245, 0.9);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.topbar-inner {
  width: min(1120px, calc(100% - 28px));
  padding: 10px 0;
}

.brand {
  min-width: 128px;
  border-radius: 16px;
}

.brand img {
  width: 42px;
  height: 42px;
}

.topbar-ask-cta {
  border: 0 !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, #20bf6b, #079455) !important;
  color: #fff !important;
  box-shadow: 0 12px 22px rgba(7, 148, 85, 0.22) !important;
}

.profile-pill {
  min-height: 42px;
  border: 1px solid var(--surface-line) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #1d2939 !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.hero.simple-hero,
.liquid-home-hero {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(23, 105, 255, 0.1);
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 12%, rgba(23, 105, 255, 0.12), transparent 32%),
    linear-gradient(180deg, #ffffff, #f4f8ff);
  box-shadow: 0 16px 44px rgba(23, 105, 255, 0.08);
}

.hero-kicker,
.eyebrow {
  color: var(--primary) !important;
  font-weight: 950;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 8px 0;
  color: #101828;
  font-size: clamp(32px, 5.4vw, 56px);
  line-height: 1.05;
}

.hero-copy p {
  max-width: 620px;
  margin: 0;
  color: #475467;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.55;
}

.home-primary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.jumbo-action {
  justify-content: flex-start;
  min-height: 88px;
  padding: 18px !important;
  border-radius: 22px !important;
  text-align: left;
}

.jumbo-action strong,
.today-card strong,
.home-guide-card strong {
  color: inherit;
  font-size: 16px;
}

.jumbo-action small,
.today-card small,
.home-guide-card small {
  display: block;
  margin-top: 3px;
  color: inherit;
  opacity: 0.72;
  line-height: 1.35;
}

.home-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 2px;
}

.home-today-panel,
.home-guide-grid,
.stats.compact-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.home-guide-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.today-card,
.home-guide-card {
  justify-content: flex-start;
  min-height: 96px;
  padding: 16px;
  text-align: left;
}

.primary-today {
  border-color: rgba(23, 105, 255, 0.24) !important;
  background: var(--primary-soft) !important;
}

.guide-step {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 950;
}

.question-index-title .primary {
  min-height: 46px;
  padding: 0 18px;
}

.question-list,
.answer-list,
.notice-list {
  display: grid;
  gap: 12px;
}

.question-card {
  display: grid;
  gap: 12px;
  padding: 18px !important;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.question-card:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 105, 255, 0.28) !important;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.09) !important;
}

.card-head {
  align-items: start;
  gap: 12px;
}

.question-card h3,
.answer-card h3,
.notice-card strong {
  color: #101828;
  font-size: 17px;
  line-height: 1.35;
}

.badge {
  border: 1px solid rgba(23, 105, 255, 0.1) !important;
  border-radius: 999px !important;
  background: #f2f6ff !important;
  color: #175cd3 !important;
  font-weight: 900;
}

.badge.waiting,
.badge.unsolved {
  background: #fff7ed !important;
  color: #c2410c !important;
}

.badge.answered,
.badge.reserved {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

.badge.selected,
.badge.resolved {
  background: #ecfdf3 !important;
  color: #047857 !important;
}

.badges {
  gap: 6px;
}

.meta {
  gap: 10px;
  font-size: 12px;
}

.minimal-compose {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(18px, 3.5vw, 28px) !important;
}

.compose-head {
  display: grid;
  gap: 4px;
}

.compose-head h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
}

.compose-head span {
  color: var(--text-subtle);
  font-weight: 800;
}

.choice-grid {
  gap: 8px;
}

.choice-btn {
  min-height: 44px;
  border: 1px solid var(--surface-line-strong) !important;
  border-radius: 14px !important;
  background: #fff !important;
  color: #344054 !important;
  font-weight: 900;
}

.course-choice {
  justify-content: flex-start;
  min-height: 66px;
  text-align: left;
}

.ask-advanced-fields {
  border: 1px solid var(--surface-line);
  border-radius: 18px;
  background: #fbfdff;
  padding: 4px 12px 12px;
}

.ask-advanced-fields summary {
  min-height: 50px;
  color: #344054;
  font-weight: 950;
}

.compose-submit {
  min-height: 54px;
  font-size: 16px;
}

.detail {
  display: grid;
  gap: 16px;
  max-width: 860px;
  margin: 0 auto;
}

.detail > .ghost {
  justify-self: start;
}

.detail-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.detail-title h1 {
  margin: 12px 0 8px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.16;
}

.content-box {
  border: 1px solid var(--surface-line);
  border-radius: 18px;
  background: #fbfdff;
  color: #1f2937;
  line-height: 1.65;
}

.answer-card {
  display: grid;
  gap: 12px;
  padding: 18px !important;
  border-left: 4px solid rgba(23, 105, 255, 0.38) !important;
}

.answer-card:has(.professional-badge),
.answer-card:has(.badge.selected) {
  border-color: rgba(4, 120, 87, 0.42) !important;
  background: linear-gradient(180deg, #ffffff, #f8fffb) !important;
}

.professional-badge {
  background: #ecfdf3 !important;
  color: #047857 !important;
}

.answer-author-link {
  color: #101828 !important;
}

.note-command-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 0.45fr)) minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px !important;
  margin-bottom: 12px;
}

.note-stat {
  border-radius: 16px !important;
  background: #f8fbff !important;
}

.note-layout {
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr) !important;
}

.note-card {
  padding: 16px !important;
  border-color: var(--surface-line) !important;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.note-card.active-note {
  border-color: rgba(23, 105, 255, 0.45) !important;
  background: linear-gradient(180deg, #ffffff, #f5f9ff) !important;
  box-shadow: 0 14px 30px rgba(23, 105, 255, 0.1) !important;
}

.note-inspector {
  position: sticky;
  top: 86px;
}

.note-title-edit {
  border: 1px solid var(--surface-line);
  border-radius: 18px;
  background: #fff;
  color: #101828;
}

.tutor-dashboard .stat,
.wordmaster-activity-panel,
.rank-guide,
.leaderboard-panel {
  border-radius: var(--radius-lg) !important;
}

.auth-wrap {
  background:
    radial-gradient(circle at 18% 10%, rgba(23, 105, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff, #f7f9fc);
}

.auth-card {
  border: 1px solid var(--surface-line) !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.1) !important;
}

.auth-card .tabs {
  border-radius: 18px !important;
  background: #f1f5fb !important;
}

@media (max-width: 920px) {
  .home-primary-actions {
    grid-template-columns: 1fr 1fr;
  }

  .home-today-panel,
  .stats.compact-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .note-command-panel,
  .note-layout,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr !important;
  }

  .note-inspector {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding-bottom: 92px;
  }

  .container {
    width: min(100% - 28px, 520px);
    padding-top: 14px;
  }

  .topbar-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
  }

  .brand {
    min-width: 0;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .primary-nav {
    grid-column: 1 / -1;
    order: 3;
    padding-bottom: 2px;
  }

  .primary-nav button {
    min-height: 40px;
    padding: 0 12px;
  }

  .topbar-right {
    justify-content: end;
    min-width: 0;
  }

  .topbar-actions .topbar-mini span,
  .account .hide-mobile,
  .account-label {
    display: none;
  }

  .profile-pill {
    width: 44px;
    min-width: 44px;
    padding: 0 !important;
  }

  .hero.simple-hero,
  .liquid-home-hero {
    padding: 22px;
    border-radius: 26px;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .home-primary-actions,
  .home-guide-grid,
  .home-search-row {
    grid-template-columns: 1fr;
  }

  .jumbo-action {
    min-height: 74px;
  }

  .home-today-panel {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: start;
    gap: 10px;
  }

  .section-title > .primary,
  .question-index-title .primary {
    width: 100%;
  }

  .question-card,
  .answer-card,
  .panel {
    padding: 16px !important;
  }

  .question-card .card-head,
  .detail-title {
    grid-template-columns: 1fr;
  }

  .question-card h3 {
    font-size: 16px;
  }

  .badges {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .badges::-webkit-scrollbar {
    display: none;
  }

  .minimal-compose {
    padding: 18px !important;
  }

  .simple-category-grid,
  .grade-grid,
  .answer-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .course-grid,
  .unit-grid {
    grid-template-columns: 1fr !important;
  }

  .note-command-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .note-command-search {
    grid-column: 1 / -1;
  }

  .auth-card {
    border-radius: 24px !important;
  }
}

/* Toss-inspired simplification pass: one clear job per screen. */
:root {
  --app-bg-clean: #f8fafc;
  --app-blue: #1b64da;
  --app-blue-soft: #eef5ff;
  --app-text: #191f28;
  --app-subtext: #6b7684;
  --app-border: #edf1f5;
  --app-card-shadow: 0 8px 22px rgba(25, 31, 40, 0.045);
}

body {
  background: var(--app-bg-clean) !important;
}

.container {
  width: min(1040px, calc(100% - 40px));
}

.topbar {
  border-bottom: 1px solid rgba(237, 241, 245, 0.92) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: none !important;
}

.topbar-inner {
  min-height: 68px;
}

.brand {
  gap: 9px;
  min-height: 48px;
  color: var(--app-text) !important;
}

.brand-title {
  font-size: 16px;
  font-weight: 950;
}

.primary-nav {
  padding: 4px;
  border-radius: 18px;
  background: #f3f6fa;
}

.primary-nav button {
  min-height: 42px;
  border: 0 !important;
  border-radius: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #4e5968 !important;
}

.primary-nav button.active {
  background: #fff !important;
  color: var(--app-text) !important;
  box-shadow: 0 4px 14px rgba(25, 31, 40, 0.08) !important;
}

.topbar-ask-cta {
  min-height: 44px;
  padding: 0 16px !important;
  border-radius: 14px !important;
  background: var(--app-blue) !important;
  box-shadow: 0 8px 18px rgba(27, 100, 218, 0.22) !important;
}

.topbar-mini {
  min-height: 40px;
  border: 0 !important;
  background: #f3f6fa !important;
  box-shadow: none !important;
}

.profile-pill {
  border: 0 !important;
  background: #f3f6fa !important;
  box-shadow: none !important;
}

.hero.simple-hero,
.liquid-home-hero {
  position: relative;
  gap: 22px;
  padding: clamp(28px, 6vw, 58px) 0 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.hero-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--app-blue-soft);
  color: var(--app-blue) !important;
  font-size: 13px;
}

.hero-copy h1 {
  max-width: 680px;
  margin: 12px 0 10px;
  color: var(--app-text);
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 950;
  line-height: 1.02;
  word-break: keep-all;
}

.hero-copy p {
  max-width: 520px;
  color: var(--app-subtext);
  font-size: 18px;
  line-height: 1.55;
  word-break: keep-all;
}

.home-primary-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 0.85fr));
  gap: 10px;
  max-width: 980px;
}

.home-primary-actions .jumbo-action {
  min-height: 76px;
  border: 0 !important;
  border-radius: 22px !important;
  background: #fff !important;
  color: var(--app-text) !important;
  box-shadow: var(--app-card-shadow) !important;
}

.home-primary-actions .jumbo-action:first-child {
  min-height: 112px;
  padding: 24px !important;
  background: var(--app-blue) !important;
  color: #fff !important;
  box-shadow: 0 18px 36px rgba(27, 100, 218, 0.25) !important;
}

.home-primary-actions .jumbo-action:first-child .icon {
  width: 28px;
  height: 28px;
}

.home-primary-actions .jumbo-action:not(:first-child) {
  align-content: start;
}

.home-primary-actions .jumbo-action:not(:first-child) .icon {
  width: 18px;
  height: 18px;
  color: var(--app-blue);
}

.jumbo-action strong {
  font-size: 17px;
  letter-spacing: 0;
}

.jumbo-action small {
  font-size: 12px;
}

.home-search-row {
  max-width: 680px;
  padding: 8px;
  border: 1px solid var(--app-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--app-card-shadow);
}

.home-search-row .input {
  border: 0 !important;
  box-shadow: none !important;
}

.home-search-row .primary {
  min-width: 96px;
  border-radius: 14px !important;
  background: var(--app-blue) !important;
  box-shadow: none !important;
}

.home-guide-grid {
  display: none !important;
}

.home-today-panel {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 18px !important;
}

.today-card {
  min-height: 74px;
  border: 0 !important;
  border-radius: 20px !important;
  box-shadow: none !important;
  background: #fff !important;
}

.today-card.primary-today {
  background: var(--app-blue-soft) !important;
  color: var(--app-blue) !important;
}

.stats.compact-stats {
  gap: 10px;
}

.stats.compact-stats .stat {
  min-height: 76px;
  border: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
}

.section-title {
  margin-top: 24px;
}

.section-title h2 {
  color: var(--app-text);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 950;
}

.panel.form {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
}

.panel.form > .input,
.panel.form > .split,
.panel.form > .chips {
  margin-bottom: 10px;
}

.question-card {
  position: relative;
  gap: 10px;
  padding: 20px !important;
  border: 0 !important;
  border-radius: 22px !important;
  background: #fff !important;
  box-shadow: var(--app-card-shadow) !important;
}

.question-card::after {
  content: "";
  position: absolute;
  inset: auto 20px 0;
  height: 1px;
  background: transparent;
}

.question-card h3 {
  color: var(--app-text);
  font-size: 18px;
  font-weight: 900;
  word-break: keep-all;
}

.question-card .badge {
  font-size: 11px;
  font-weight: 900;
}

.question-card .badges .badge:nth-child(n+3) {
  background: #f7f8fa !important;
  color: #6b7684 !important;
}

.question-card .meta {
  padding-top: 2px;
  color: #8b95a1 !important;
}

.minimal-compose {
  max-width: 720px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.minimal-compose .field-block,
.minimal-compose .compose-textarea,
.minimal-compose .ask-advanced-fields {
  margin-top: 12px;
}

.compose-head {
  margin-bottom: 10px;
}

.compose-head h2 {
  color: var(--app-text);
  font-size: clamp(34px, 6vw, 48px);
  font-weight: 950;
}

.compose-head span {
  color: var(--app-subtext);
}

.choice-btn {
  border: 0 !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.choice-btn.active {
  background: var(--app-blue-soft) !important;
  color: var(--app-blue) !important;
  box-shadow: inset 0 0 0 1px rgba(27, 100, 218, 0.16) !important;
}

.compose-textarea {
  min-height: 180px !important;
  padding: 18px !important;
  border: 0 !important;
  border-radius: 22px !important;
  box-shadow: var(--app-card-shadow) !important;
  font-size: 16px;
}

.ask-advanced-fields {
  border: 0 !important;
  background: #fff !important;
  box-shadow: var(--app-card-shadow);
}

.compose-submit {
  min-height: 58px;
  border-radius: 18px !important;
  background: var(--app-blue) !important;
  box-shadow: 0 14px 28px rgba(27, 100, 218, 0.24) !important;
}

.detail {
  max-width: 820px;
}

.detail > .panel,
.answer-card {
  border: 0 !important;
  background: #fff !important;
  box-shadow: var(--app-card-shadow) !important;
}

.detail-title h1 {
  color: var(--app-text);
  font-weight: 950;
  word-break: keep-all;
}

.content-box {
  border: 0 !important;
  background: #f8fafc !important;
}

.answer-card {
  border-left: 0 !important;
}

.answer-card .card-head {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--app-border);
}

.answer-card:has(.professional-badge),
.answer-card:has(.badge.selected) {
  background: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(0, 180, 120, 0.14), var(--app-card-shadow) !important;
}

.note-command-panel,
.note-card,
.note-inspector {
  border: 0 !important;
  background: #fff !important;
  box-shadow: var(--app-card-shadow) !important;
}

.note-command-panel {
  border-radius: 24px !important;
}

.note-stat {
  background: #f8fafc !important;
}

.note-card.active-note {
  background: var(--app-blue-soft) !important;
  box-shadow: inset 0 0 0 1px rgba(27, 100, 218, 0.18) !important;
}

.auth-card {
  border: 0 !important;
  box-shadow: 0 24px 80px rgba(25, 31, 40, 0.12) !important;
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 32px, 480px);
  }

  .topbar-inner {
    display: flex !important;
    min-height: 60px;
  }

  .topbar .primary-nav {
    display: none !important;
  }

  .topbar-actions .topbar-mini,
  .topbar .account .ghost {
    display: none !important;
  }

  .topbar-ask-cta {
    min-width: 44px;
    padding: 0 12px !important;
  }

  .topbar-ask-cta span {
    display: none !important;
  }

  .hero.simple-hero,
  .liquid-home-hero {
    padding: 18px 0 8px !important;
  }

  .hero-copy h1 {
    max-width: 320px;
    font-size: 38px;
    line-height: 1.04;
  }

  .hero-copy p {
    max-width: 330px;
    font-size: 15px;
  }

  .home-primary-actions {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .home-primary-actions .jumbo-action:first-child {
    min-height: 96px;
  }

  .home-primary-actions .jumbo-action:not(:first-child) {
    min-height: 54px;
    padding: 14px 16px !important;
  }

  .home-primary-actions .jumbo-action:not(:first-child) small {
    display: none;
  }

  .home-search-row {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .home-search-row .primary {
    width: 100%;
  }

  .home-today-panel,
  .stats.compact-stats {
    grid-template-columns: 1fr 1fr !important;
  }

  .today-card,
  .stats.compact-stats .stat {
    min-height: 64px;
    padding: 13px !important;
  }

  .question-index-title {
    gap: 12px;
  }

  .question-index-title .primary {
    width: auto !important;
    min-width: 132px;
  }

  .question-card {
    padding: 18px !important;
  }

  .question-card .badges .badge:nth-child(n+4) {
    display: none;
  }

  .question-card .meta span:nth-child(n+4) {
    display: none;
  }

  .compose-head h2 {
    font-size: 38px;
  }

  .compose-textarea {
    min-height: 170px !important;
  }

  .note-command-panel {
    grid-template-columns: 1fr 1fr !important;
  }

  .mobile-tabbar {
    border: 1px solid rgba(237, 241, 245, 0.92) !important;
    border-radius: 24px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 18px 40px rgba(25, 31, 40, 0.14) !important;
    backdrop-filter: blur(18px);
  }

  .mobile-tabbar button {
    border-radius: 18px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #8b95a1 !important;
  }

  .mobile-tabbar button.active {
    background: var(--app-blue-soft) !important;
    color: var(--app-blue) !important;
  }
}

/* UI detail repair: keep icons aligned and quiz surfaces readable after global theme passes. */
.icon {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  box-shadow: none !important;
  vertical-align: middle;
}

button,
.primary,
.ghost,
.small-button,
.chip,
.badge,
.topbar-mini,
.topbar-ask-cta,
.profile-pill,
.quiz-card-actions button,
.quiz-live-control-row button,
.quiz-section-tabs button,
.notification-read-button {
  align-items: center;
  line-height: 1.05;
}

.primary,
button.primary,
.ghost,
.small-button,
.chip,
.topbar-mini,
.topbar-ask-cta,
.profile-pill,
.notification-read-button {
  display: inline-flex;
  justify-content: center;
  gap: 7px;
}

.badge .icon,
.chip .icon,
.primary .icon,
.ghost .icon,
.small-button .icon,
.topbar-mini .icon,
.topbar-ask-cta .icon,
.profile-pill .icon,
.notification-read-button .icon,
.quiz-card-meta .icon {
  width: 16px;
  height: 16px;
}

.icon-ghost {
  width: 40px;
  min-width: 40px;
  padding: 0 !important;
}

.quiz-section-tabs button {
  display: inline-flex !important;
  justify-content: center;
  min-width: 0;
  gap: 7px;
}

.quiz-code-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: 18px;
  align-items: center;
  margin-top: 16px;
  border: 1px solid rgba(23, 105, 255, 0.1) !important;
  background: linear-gradient(135deg, #ffffff, #f4f8ff) !important;
}

.quiz-code-entry h2,
.quiz-code-entry p,
.quiz-code-entry .hero-kicker {
  color: #101828 !important;
}

.quiz-code-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.quiz-code-input {
  min-height: 52px;
  font-size: 17px;
  font-weight: 900;
  text-transform: uppercase;
}

.quiz-grid .quiz-card,
.quiz-card {
  border: 1px solid rgba(255, 255, 255, 0.36) !important;
  color: #fff !important;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(135deg, var(--quiz-a, #1769ff), var(--quiz-b, #22c55e)) !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.26) !important;
}

.quiz-grid .quiz-card h3,
.quiz-grid .quiz-card p,
.quiz-grid .quiz-card-meta span,
.quiz-card h3,
.quiz-card p,
.quiz-card-meta span {
  color: #fff !important;
}

.quiz-grid .quiz-card p,
.quiz-card p,
.quiz-card-meta span {
  color: rgba(255, 255, 255, 0.9) !important;
}

.quiz-card .quiz-code {
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
  background: rgba(15, 23, 42, 0.22) !important;
  text-shadow: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}

.quiz-card .badge,
.quiz-grid .quiz-card .badge {
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.92) !important;
  text-shadow: none !important;
}

.quiz-mini-rank {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  color: #101828 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  text-shadow: none !important;
}

.quiz-mini-rank strong,
.quiz-mini-rank span {
  color: #101828 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-leaderboard.panel,
.quiz-review.panel,
.quiz-live-stage.panel {
  border: 1px solid rgba(208, 213, 221, 0.92) !important;
  color: #101828 !important;
  background: #fff !important;
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.08) !important;
}

.quiz-leaderboard .section-title {
  align-items: center;
  margin-bottom: 12px;
}

.quiz-leaderboard .section-title h2,
.quiz-review .section-title h2,
.quiz-live-stage .section-title h2 {
  color: #101828 !important;
  font-size: 22px;
}

.quiz-leaderboard .muted,
.quiz-review .muted,
.quiz-live-stage .muted {
  color: #667085 !important;
}

.quiz-rank-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 48px;
  margin-top: 8px;
  padding: 9px 10px !important;
  border: 1px solid #eef2f7 !important;
  border-radius: 14px;
  background: #f8fafc;
}

.quiz-rank-row strong {
  color: #fff !important;
  background: #1769ff !important;
  box-shadow: 0 6px 14px rgba(23, 105, 255, 0.18);
}

.quiz-rank-row span {
  min-width: 0;
  overflow: hidden;
  color: #101828 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.quiz-rank-row b {
  color: #175cd3 !important;
  white-space: nowrap;
}

.quiz-leaderboard .empty,
.quiz-grid .empty {
  border-color: #d0d5dd !important;
  color: #475467 !important;
  background: #f8fafc !important;
}

.quiz-review-item {
  background: #fff !important;
}

.quiz-review-head strong,
.quiz-review-item p {
  color: #101828 !important;
}

.quiz-review-answers span {
  color: #475467 !important;
}

.quiz-answer {
  align-items: center;
  line-height: 1.2;
}

.quiz-answer span {
  flex: 0 0 auto;
}

.quiz-feedback {
  border: 1px solid rgba(208, 213, 221, 0.88);
  color: #101828 !important;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.1);
}

.quiz-feedback span,
.quiz-feedback p {
  color: #344054 !important;
}

.toast {
  border: 1px solid rgba(208, 213, 221, 0.92) !important;
  color: #101828 !important;
  background: rgba(255, 255, 255, 0.98) !important;
}

@media (max-width: 760px) {
  .quiz-code-entry {
    grid-template-columns: 1fr;
  }

  .quiz-code-form {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-section-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quiz-card-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quiz-card-actions button {
    width: 100%;
    min-width: 0;
  }

  .quiz-rank-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .mobile-tabbar {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 6px !important;
  }

  .mobile-tabbar button {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: 54px;
    padding: 6px 2px !important;
    gap: 3px;
    line-height: 1.05;
  }

  .mobile-tabbar button .icon {
    width: 19px;
    height: 19px;
  }

  .mobile-tabbar button span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px !important;
  }
}

/* UI detail repair 2: ranking hierarchy, brand sizing, and dense control polish. */
.topbar .brand {
  overflow: visible !important;
}

.topbar .brand-icons {
  flex: 0 0 46px;
}

.topbar .brand-title {
  width: clamp(96px, 9vw, 128px) !important;
  min-width: 0;
  line-height: 1.05;
}

.topbar .brand-title-main,
.topbar .brand-title-school {
  overflow: hidden;
  text-overflow: ellipsis;
}

.primary-nav button,
.topbar-mini,
.topbar-ask-cta,
.profile-pill {
  min-width: 0;
  height: 42px;
}

.primary-nav button {
  padding: 0 13px !important;
}

.primary-nav button .icon,
.topbar-mini .icon,
.topbar-ask-cta .icon,
.profile-pill .icon {
  width: 17px;
  height: 17px;
}

.primary-nav button span,
.topbar-mini span,
.topbar-ask-cta span,
.profile-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-list,
.rank-guide,
.study-leaderboard,
.event-rank-list {
  border-radius: 18px;
}

.ranking-row,
.rank-row,
.study-rank,
.event-rank,
.reward-preview {
  border: 1px solid #edf2f7 !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.04);
}

.ranking-row,
.rank-row {
  padding: 10px 12px !important;
}

.ranking-row > strong,
.rank-no {
  width: 30px;
  height: 30px;
  border-radius: 11px;
  color: #175cd3 !important;
  background: #eff6ff !important;
  box-shadow: inset 0 0 0 1px rgba(23, 105, 255, 0.12);
}

.ranking-name,
.study-rank strong,
.event-rank strong {
  min-width: 0;
  overflow: hidden;
  color: #101828 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-row .badges,
.study-rank .badges {
  min-width: 0;
}

.ranking-row:nth-child(1),
.event-rank-list .event-rank:nth-child(1),
.study-leaderboard .study-rank:nth-child(2),
.quiz-leaderboard .quiz-rank-row:nth-of-type(2) {
  border-color: rgba(245, 158, 11, 0.34) !important;
  background: linear-gradient(135deg, #fff7db, #ffffff 60%) !important;
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.1);
}

.ranking-row:nth-child(1) > strong,
.event-rank-list .event-rank:nth-child(1) .rank-no,
.study-leaderboard .study-rank:nth-child(2) .rank-no,
.quiz-leaderboard .quiz-rank-row:nth-of-type(2) strong {
  color: #78350f !important;
  background: linear-gradient(180deg, #fde68a, #f59e0b) !important;
  box-shadow: 0 8px 16px rgba(245, 158, 11, 0.22);
}

.quiz-leaderboard .quiz-rank-row:nth-of-type(3),
.event-rank-list .event-rank:nth-child(2),
.study-leaderboard .study-rank:nth-child(3) {
  border-color: rgba(148, 163, 184, 0.34) !important;
  background: linear-gradient(135deg, #f8fafc, #ffffff 62%) !important;
}

.quiz-leaderboard .quiz-rank-row:nth-of-type(4),
.event-rank-list .event-rank:nth-child(3),
.study-leaderboard .study-rank:nth-child(4) {
  border-color: rgba(180, 83, 9, 0.22) !important;
  background: linear-gradient(135deg, #fff7ed, #ffffff 62%) !important;
}

.quiz-leaderboard .quiz-rank-row {
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.quiz-leaderboard .quiz-rank-row:hover,
.ranking-row:hover,
.study-rank:hover,
.event-rank:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.08);
}

.quiz-card-actions .primary,
.quiz-card-actions .ghost,
.quiz-card-actions .danger {
  min-height: 38px;
  border-radius: 12px !important;
  padding: 0 11px !important;
  font-size: 12px;
}

.quiz-card-actions .ghost {
  border-color: rgba(255, 255, 255, 0.42) !important;
  color: #101828 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: none !important;
}

.quiz-card-actions .danger {
  color: #fff !important;
  background: #ef4444 !important;
}

.quiz-live-head {
  align-items: center !important;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 44px rgba(23, 105, 255, 0.18);
}

.quiz-live-actions {
  justify-content: flex-end;
}

.quiz-live-actions .ghost {
  color: #101828 !important;
  background: rgba(255, 255, 255, 0.94) !important;
}

.quiz-live-qr-card {
  border-color: rgba(255, 255, 255, 0.42) !important;
  background: rgba(255, 255, 255, 0.2) !important;
}

.quiz-live-stage .quiz-question-stage {
  border: 1px solid #edf2f7;
  color: #101828 !important;
  background: linear-gradient(180deg, #f8fbff, #ffffff) !important;
}

.quiz-live-stage .quiz-question-stage h1,
.quiz-live-stage .quiz-help {
  color: #101828 !important;
}

.quiz-live-stage .quiz-progress,
.quiz-live-stage .quiz-timer {
  background: #e9eef7 !important;
}

.quiz-live-stage .quiz-progress span,
.quiz-live-stage .quiz-timer span {
  background: #1769ff !important;
}

.quiz-start .quiz-leaderboard,
.quiz-result .quiz-leaderboard {
  align-self: stretch;
}

.quiz-start-card,
.quiz-result-card {
  border-color: rgba(255, 255, 255, 0.42) !important;
}

.quiz-code,
.quiz-stage-code {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  line-height: 1;
}

.empty {
  min-height: 52px;
  display: grid;
  place-items: center;
  color: #667085 !important;
  text-align: center;
}

@media (max-width: 1180px) and (min-width: 761px) {
  .primary-nav button {
    padding: 0 10px !important;
  }

  .topbar .brand-title {
    width: 100px !important;
  }
}

@media (max-width: 920px) and (min-width: 761px) {
  .topbar .brand {
    width: 74px !important;
    min-width: 74px !important;
    max-width: 74px !important;
  }

  .topbar .brand-title {
    display: none !important;
  }

  .topbar .brand-icons {
    flex-basis: 44px;
  }
}

@media (max-width: 760px) {
  .quiz-live-head {
    align-items: stretch !important;
  }

  .quiz-live-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ranking-row,
  .rank-row,
  .study-rank,
  .event-rank {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .topbar .account .mobile-logout-button {
    display: inline-flex !important;
    width: auto !important;
    min-width: 86px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 12px !important;
    gap: 6px !important;
    border-radius: 14px !important;
    background: #fff !important;
    color: #1d2939 !important;
    border: 1px solid #d0d5dd !important;
  }

  .topbar .account .mobile-logout-button span {
    display: inline !important;
    font-size: 13px !important;
    font-weight: 900 !important;
  }

  .topbar .account .mobile-logout-button .icon {
    width: 17px !important;
    height: 17px !important;
  }
}

/* Ask screen color repair: separate the compose surface from the page background. */
.ask-form.minimal-compose {
  max-width: 760px;
  padding: clamp(18px, 3vw, 28px) !important;
  border: 1px solid rgba(23, 105, 255, 0.12) !important;
  border-radius: 28px !important;
  background:
    linear-gradient(180deg, rgba(237, 245, 255, 0.92), rgba(255, 255, 255, 0.98) 48%),
    #ffffff !important;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08) !important;
}

.ask-form .compose-head {
  padding: 2px 2px 6px;
}

.ask-form .compose-head h2 {
  color: #0f172a !important;
}

.ask-form .compose-head span {
  color: #475467 !important;
}

.ask-form .field-block,
.ask-form .ask-advanced-fields {
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.78) !important;
}

.ask-form .simple-category-grid {
  padding: 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.ask-form .choice-btn {
  background: #ffffff !important;
  color: #344054 !important;
  border: 1px solid rgba(208, 213, 221, 0.9) !important;
}

.ask-form .choice-btn.active {
  background: #1769ff !important;
  color: #ffffff !important;
  border-color: #1769ff !important;
  box-shadow: 0 10px 22px rgba(23, 105, 255, 0.22) !important;
}

.ask-form .compose-textarea,
.ask-form .input,
.ask-form .textarea {
  background: #ffffff !important;
  border-color: rgba(208, 213, 221, 0.95) !important;
}

.ask-form .compose-submit,
.topbar-ask-cta.topbar-action-ask {
  background: linear-gradient(180deg, #2f7dff, #1769ff) !important;
  color: #ffffff !important;
}
