:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #e8edf0;
  color: #182026;
  font-size: 16px;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(24, 32, 38, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(24, 32, 38, 0.04) 1px, transparent 1px),
    #e8edf0;
  background-size: 28px 28px;
}

button {
  border: 0;
  font: inherit;
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.phone-frame {
  position: relative;
  width: min(100%, 430px);
  height: min(900px, calc(100vh - 56px));
  min-height: 680px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(24, 32, 38, 0.12);
  border-radius: 28px;
  background: #f7f8f6;
  box-shadow: 0 24px 70px rgba(24, 32, 38, 0.2);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 22px 18px;
  background: #fff;
  border-bottom: 1px solid #e4e7e2;
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.admin-entry {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid #d9ded7;
  border-radius: 999px;
  background: #f7f8f6;
  color: #1f5d55;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

.practice-topbar {
  min-height: 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid #e4e7e2;
}

.practice-topbar strong {
  color: #182026;
  font-size: 1rem;
}

.back-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: start;
  padding: 0 10px 0 8px;
  border: 1px solid #d9ded7;
  border-radius: 999px;
  background: #f7f8f6;
  color: #1f5d55;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
}

.back-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.ai-selection-popover {
  position: absolute;
  z-index: 30;
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid #d9ded7;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 32, 38, 0.18);
}

.ai-selection-popover button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef7f4;
  color: #1f5d55;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

.ai-selection-popover button:first-child {
  background: #1f5d55;
  color: #fff;
}

.ai-selection-popover button:disabled,
.ai-dialog-actions button:disabled {
  cursor: progress;
  opacity: 0.62;
}

.ai-commented-text {
  border-bottom: 2px solid #f0b44c;
  background: #fff6df;
}

.ai-comment-marker {
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0 6px;
  border: 1px solid #e4bd67;
  border-radius: 999px;
  background: #fff;
  color: #94620a;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  vertical-align: middle;
}

.ai-modal-backdrop,
.ai-drawer-backdrop {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: grid;
  align-items: end;
  background: rgba(24, 32, 38, 0.28);
}

.ai-followup-dialog,
.ai-comment-drawer {
  max-height: 78%;
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 18px 18px 0 0;
  background: #fff;
  box-shadow: 0 -18px 42px rgba(24, 32, 38, 0.22);
}

.ai-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-dialog-header strong {
  font-size: 1rem;
}

.icon-close-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f2f4f0;
  color: #637067;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
}

.ai-followup-dialog blockquote,
.ai-comment-drawer blockquote {
  margin: 0;
  padding: 12px;
  border-left: 3px solid #f0b44c;
  border-radius: 8px;
  background: #fff8e8;
  color: #3e4841;
  font-size: 0.9rem;
  line-height: 1.5;
}

.ai-followup-dialog textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 12px;
  border: 1px solid #d9ded7;
  border-radius: 8px;
  color: #182026;
  font: inherit;
  line-height: 1.45;
}

.ai-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ai-thread-stack {
  min-height: 0;
  display: grid;
  gap: 12px;
  overflow: auto;
}

.ai-thread {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #e4e7e2;
  border-radius: 8px;
  background: #fafbf9;
}

.ai-thread > span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e1efec;
  color: #1f5d55;
  font-size: 0.74rem;
  font-weight: 900;
}

.ai-message {
  display: grid;
  gap: 4px;
}

.ai-message strong {
  color: #637067;
  font-size: 0.78rem;
}

.ai-message p {
  color: #182026;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.ai-empty {
  color: #637067;
  font-size: 0.9rem;
}

.eyebrow,
.subtitle,
.module-card p,
.question-row p,
.metric-label,
.module-meta,
.section-heading span,
.practice-header,
.prompt {
  color: #637067;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.76rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.18rem;
}

h3 {
  font-size: 1rem;
}

.subtitle {
  max-width: 310px;
  margin-top: 7px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #d9ded7;
  border-radius: 50%;
  background: #f7f8f6;
  cursor: pointer;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: #1f5d55;
}

.screen-content {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.practice-surface {
  overscroll-behavior: contain;
  touch-action: pan-x;
}

.loading-state {
  min-height: 100%;
  display: grid;
  place-content: center;
  gap: 8px;
  color: #637067;
  text-align: center;
}

.loading-state strong {
  color: #182026;
  font-size: 1.1rem;
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 8px;
  background: #1f5d55;
  color: #fff;
}

.hero-score {
  display: block;
  margin-top: 4px;
  font-size: 2.75rem;
  line-height: 1;
}

.hero-panel .metric-label {
  color: rgba(255, 255, 255, 0.78);
}

.hero-actions {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.primary-button,
.secondary-button,
.reveal-button {
  min-width: 0;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  background: #f0b44c;
  color: #1e2320;
}

.secondary-button,
.reveal-button {
  border: 1px solid #d9ded7;
  background: #fff;
  color: #1f5d55;
}

.secondary-button:disabled {
  cursor: not-allowed;
  color: #8b968e;
  background: rgba(255, 255, 255, 0.65);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 18px;
}

.stat-tile {
  min-height: 72px;
  padding: 10px 8px;
  border: 1px solid #e4e7e2;
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

button.stat-tile {
  cursor: pointer;
}

button.stat-tile:active {
  transform: translateY(1px);
}

.stat-tile span {
  display: block;
  margin-bottom: 8px;
  color: #637067;
  font-size: 0.74rem;
}

.stat-tile strong {
  font-size: 1.22rem;
}

.stat-tile.good strong,
.status-pill.good {
  color: #17745d;
}

.stat-tile.warn strong,
.status-pill.warn {
  color: #9a5a00;
}

.stat-tile.bad strong,
.status-pill.bad {
  color: #a73b35;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.module-stack,
.question-stack,
.topic-grid {
  display: grid;
  gap: 10px;
}

.list-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.list-topbar span {
  color: #637067;
  font-size: 0.86rem;
  font-weight: 800;
}

.module-card,
.question-row,
.topic-card {
  width: 100%;
  text-align: left;
  border: 1px solid #e4e7e2;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.module-card {
  padding: 15px;
}

.topic-card {
  padding: 15px;
}

.topic-card.active {
  border-color: #1f5d55;
  background: #eef7f4;
}

.topic-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.topic-card p {
  margin-top: 5px;
  color: #637067;
  font-size: 0.84rem;
  line-height: 1.4;
}

.current-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #1f5d55;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.module-card-main,
.question-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.module-card-main > div,
.question-row > div {
  min-width: 0;
}

.module-card-main p,
.question-row p {
  margin-top: 5px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.module-card-main strong {
  flex: 0 0 auto;
  color: #1f5d55;
  font-size: 1.3rem;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  margin: 13px 0 10px;
  border-radius: 99px;
  background: #edf0ec;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1f5d55;
}

.module-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid #e4e7e2;
  border-radius: 8px;
  background: #eef1ed;
}

.segmented button {
  min-height: 34px;
  border-radius: 6px;
  background: transparent;
  color: #637067;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.segmented button.active {
  background: #fff;
  color: #1f5d55;
  box-shadow: 0 1px 6px rgba(24, 32, 38, 0.08);
}

.concept-filter {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 10px -18px 13px;
  padding: 0 18px 2px;
  scrollbar-width: none;
}

.concept-filter::-webkit-scrollbar {
  display: none;
}

.concept-filter button {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid #d9ded7;
  border-radius: 999px;
  background: #fff;
  color: #637067;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.concept-filter button.active {
  border-color: #1f5d55;
  background: #e1efec;
  color: #1f5d55;
}

.question-row {
  min-height: 82px;
  padding: 14px;
}

.favorite-mark {
  margin-right: 5px;
  color: #d48a00;
}

.question-meta-line {
  color: #1f5d55;
  font-weight: 700;
}

.status-pill {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.neutral {
  color: #647067;
}

.practice-card,
.answer-panel,
.empty-state {
  border: 1px solid #e4e7e2;
  border-radius: 8px;
  background: #fff;
}

.practice-card {
  padding: 18px;
}

.practice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 0.84rem;
}

.practice-card h2 {
  margin-bottom: 12px;
  font-size: 1.45rem;
  line-height: 1.25;
}

.prompt {
  font-size: 1rem;
  line-height: 1.7;
}

.question-media {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.media-figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid #e4e7e2;
  border-radius: 8px;
  background: #f7f8f6;
}

.media-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.media-figure figcaption {
  padding: 8px 10px 10px;
  border-top: 1px solid #e4e7e2;
  color: #637067;
  font-size: 0.78rem;
  line-height: 1.45;
}

.code-sample {
  overflow: hidden;
  border: 1px solid #293238;
  border-radius: 8px;
  background: #111820;
}

.code-sample-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #cfd7d2;
  font-size: 0.74rem;
  font-weight: 800;
}

.code-sample-header strong {
  color: #f0b44c;
  text-transform: uppercase;
}

.code-sample pre {
  max-height: 190px;
  overflow: auto;
  margin: 0;
  padding: 11px 12px 13px;
  color: #edf2ee;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre;
}

.reveal-button {
  width: 100%;
  margin: 12px 0;
}

.practice-dock {
  display: grid;
  gap: 10px;
  padding: 10px 14px 14px;
  border-top: 1px solid #e4e7e2;
  background: #fff;
}

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

.tool-button {
  min-height: 40px;
  border: 1px solid #d9ded7;
  border-radius: 8px;
  background: #f7f8f6;
  color: #37423a;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
}

.tool-button span {
  margin-right: 4px;
  color: #1f5d55;
}

.tool-button.active {
  border-color: #f0b44c;
  background: #fff4da;
  color: #9a5a00;
}

.tool-button.active span {
  color: #d48a00;
}

.answer-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 17px;
}

.answer-panel p,
.answer-panel li {
  color: #37423a;
  line-height: 1.65;
}

.answer-panel ul {
  margin: 0;
  padding-left: 20px;
}

.rating-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.rating {
  min-height: 48px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.rating.good {
  background: #dff2eb;
  color: #17745d;
}

.rating.warn {
  background: #f8ead3;
  color: #9a5a00;
}

.rating.bad {
  background: #f6dfdd;
  color: #a73b35;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 18px;
  color: #637067;
  text-align: center;
}

.empty-state p {
  color: #637067;
}

.empty-state strong {
  color: #182026;
}

.empty-action {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #d9ded7;
  border-radius: 8px;
  background: #fff;
  color: #1f5d55;
  cursor: pointer;
  font-weight: 800;
}

.review-empty {
  min-height: 360px;
}

.review-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #1f5d55;
  color: #fff;
}

.review-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 2.1rem;
  line-height: 1;
}

.review-summary .metric-label {
  color: rgba(255, 255, 255, 0.78);
}

.review-summary .primary-button {
  grid-row: span 2;
  min-width: 104px;
}

.review-summary-meta {
  display: flex;
  gap: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 800;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid #e4e7e2;
  background: #fff;
}

.toast {
  position: absolute;
  right: 24px;
  bottom: 72px;
  left: 24px;
  z-index: 2;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(24, 32, 38, 0.9);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
}

.bottom-nav button {
  min-height: 42px;
  border-radius: 8px;
  background: transparent;
  color: #637067;
  cursor: pointer;
  font-weight: 800;
}

.bottom-nav button.active {
  background: #e1efec;
  color: #1f5d55;
}

.admin-shell {
  position: relative;
  width: min(1280px, calc(100vw - 48px));
  min-height: min(900px, calc(100vh - 56px));
  overflow: hidden;
  border: 1px solid rgba(24, 32, 38, 0.12);
  border-radius: 18px;
  background: #f5f6f3;
  box-shadow: 0 24px 70px rgba(24, 32, 38, 0.18);
}

.admin-topbar {
  min-height: 116px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border-bottom: 1px solid #e1e5de;
  background: #fff;
}

.admin-topbar h1 {
  font-size: 1.8rem;
}

.admin-topbar-actions {
  display: flex;
  gap: 10px;
}

.admin-source {
  margin-top: 8px;
  color: #1f5d55;
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(min(900px, calc(100vh - 56px)) - 116px);
}

.admin-sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 22px 16px;
  border-right: 1px solid #e1e5de;
  background: #182026;
  color: #fff;
}

.admin-sidebar > strong {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.admin-sidebar button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  text-align: left;
  font-weight: 800;
}

.admin-sidebar button.active {
  background: #26333b;
  color: #fff;
}

.admin-user-card {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.admin-user-card span,
.admin-user-card p {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.78rem;
}

.admin-main {
  min-width: 0;
  overflow: auto;
  padding: 22px;
}

.admin-section-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid #d8e6e1;
  border-radius: 8px;
  background: #eef7f4;
}

.admin-section-banner span {
  color: #637067;
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-section-banner h2 {
  margin-top: 3px;
  font-size: 1.12rem;
}

.admin-section-banner p {
  margin-top: 5px;
  color: #4f5f56;
  font-size: 0.86rem;
  line-height: 1.45;
}

.admin-section-banner strong {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  background: #fff;
  color: #1f5d55;
  font-size: 0.82rem;
}

.admin-card {
  border: 1px solid #e1e5de;
  border-radius: 8px;
  background: #fff;
}

.admin-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.admin-card {
  min-width: 0;
  padding: 16px;
}

.admin-main > .admin-ops-card {
  margin-bottom: 14px;
}

.admin-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-card-header p {
  margin-top: 5px;
  color: #637067;
  font-size: 0.86rem;
  line-height: 1.45;
}

.admin-topic-list,
.admin-question-table,
.admin-editor-form,
.admin-todo-list {
  display: grid;
  gap: 10px;
}

.admin-module-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e4e7e2;
}

.admin-module-filter button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e4e7e2;
  border-radius: 8px;
  background: #fafbf9;
  color: #314038;
  cursor: pointer;
  font-weight: 850;
}

.admin-module-filter button.active {
  border-color: #1f5d55;
  background: #e1efec;
  color: #1f5d55;
}

.admin-module-filter span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-module-filter strong {
  flex: 0 0 auto;
  color: inherit;
}

.admin-topic-row,
.admin-question-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e4e7e2;
  border-radius: 8px;
  background: #fafbf9;
}

.admin-topic-row {
  width: 100%;
  cursor: pointer;
  text-align: left;
}

.admin-topic-row.active {
  border-color: #1f5d55;
  background: #eef7f4;
}

.admin-topic-row p,
.admin-question-row p {
  margin-top: 5px;
  color: #637067;
  font-size: 0.82rem;
}

.admin-topic-progress {
  min-width: 128px;
}

.admin-topic-progress > span {
  display: block;
  color: #1f5d55;
  text-align: right;
  font-weight: 900;
}

.admin-topic-progress .progress-track {
  margin: 8px 0 0;
}

.admin-filter-row,
.admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-filter-row {
  margin-bottom: 10px;
}

.admin-filter-row button,
.admin-filter-row span,
.admin-chip-row span {
  padding: 6px 10px;
  border: 1px solid #d9ded7;
  border-radius: 999px;
  background: #f7f8f6;
  color: #637067;
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-filter-row button {
  cursor: pointer;
}

.admin-filter-row button.active {
  border-color: #1f5d55;
  background: #e1efec;
  color: #1f5d55;
}

.admin-list-toolbar,
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-search-field {
  flex: 1 1 auto;
  display: grid;
  gap: 5px;
}

.admin-search-field span,
.admin-pagination span {
  color: #637067;
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-search-field input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #d9ded7;
  border-radius: 8px;
  background: #fff;
  color: #182026;
  font: inherit;
}

.admin-search-field input:focus {
  outline: 2px solid #cfe9e3;
  border-color: #1f5d55;
}

.admin-pagination {
  margin: 12px 0 0;
}

.admin-pagination > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-pagination strong {
  color: #182026;
  font-size: 0.82rem;
}

.admin-empty-table {
  padding: 18px 12px;
  border: 1px dashed #d4dbd2;
  border-radius: 8px;
  color: #637067;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.admin-question-row {
  width: 100%;
  cursor: pointer;
  text-align: left;
}

.admin-question-row.active {
  border-color: #1f5d55;
  background: #eef7f4;
}

.admin-row-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: #637067;
  font-size: 0.78rem;
}

.admin-row-meta strong,
.admin-status {
  color: #1f5d55;
}

.admin-status {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-status.draft {
  color: #9a5a00;
}

.admin-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-editor-form label {
  display: grid;
  gap: 6px;
}

.admin-editor-form label span {
  color: #637067;
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-editor-form input,
.admin-editor-form textarea,
.admin-editor-form select {
  width: 100%;
  border: 1px solid #d9ded7;
  border-radius: 8px;
  background: #fff;
  color: #182026;
  font: inherit;
}

.admin-editor-form input:focus,
.admin-editor-form textarea:focus,
.admin-editor-form select:focus {
  outline: 2px solid #cfe9e3;
  border-color: #1f5d55;
}

.admin-editor-form input,
.admin-editor-form select {
  min-height: 42px;
  padding: 0 12px;
}

.admin-editor-form textarea {
  min-height: 86px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

.admin-editor-toggle {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 10px !important;
  padding: 10px 12px;
  border: 1px solid #d9ded7;
  border-radius: 8px;
  background: #f7f8f6;
  cursor: pointer;
}

.admin-editor-toggle input {
  width: auto;
  min-height: 0;
  padding: 0;
}

.admin-editor-toggle span {
  color: #182026;
}

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

.admin-todo-list div {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: #f7f8f6;
}

.admin-todo-list strong {
  font-size: 1.45rem;
}

.admin-todo-list span {
  color: #637067;
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 28px;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(11, 18, 20, 0.42);
  cursor: pointer;
}

.admin-modal-panel {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 56px));
  max-height: min(780px, calc(100vh - 56px));
  overflow: auto;
  padding: 18px;
  border: 1px solid #d8e6e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(24, 32, 38, 0.22);
}

.admin-modal-panel .admin-editor-form textarea {
  min-height: 112px;
}

.admin-editor-fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid #e3e8e2;
  border-radius: 8px;
  background: #f8faf7;
}

.admin-editor-fieldset legend {
  padding: 0 6px;
  color: #1f5d55;
  font-size: 0.82rem;
  font-weight: 900;
}

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

.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 8px;
  background: #1f5d55;
  color: #fff;
}

.profile-hero strong {
  display: block;
  margin-top: 4px;
  font-size: 2.25rem;
  line-height: 1;
}

.profile-hero > div:last-child {
  display: grid;
  gap: 6px;
  color: #d6eee8;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.profile-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-stack {
  gap: 8px;
}

.mini-empty {
  min-height: auto;
  padding: 18px;
}

.profile-topic-stack {
  display: grid;
  gap: 8px;
}

.profile-topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid #e3e8e2;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-topic-row div:first-child {
  display: grid;
  gap: 4px;
}

.profile-topic-row span {
  color: #637067;
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-topic-progress {
  display: grid;
  gap: 6px;
  text-align: right;
}

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

.danger-button {
  color: #9d2b2b;
}

.admin-toast {
  right: 28px;
  bottom: 24px;
  left: auto;
  width: min(360px, calc(100% - 56px));
}

@media (max-width: 520px) {
  .app-shell {
    padding: 0;
  }

  .phone-frame {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

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

  .hero-panel {
    align-items: stretch;
    flex-direction: column;
  }

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