:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f7;
  --text: #18202a;
  --muted: #667085;
  --line: #d9e0e7;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0f766e;
  --danger: #dc2626;
  --warning: #b45309;
  --ok: #15803d;
  --shadow: 0 12px 28px rgba(24, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  font-weight: 800;
  font-size: 1.05rem;
}

.nav-links,
.actions,
.admin-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-links a,
.admin-tabs a {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.nav-links a:hover,
.admin-tabs a:hover {
  color: var(--primary);
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-menu-group a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.admin-menu-group a:hover {
  background: var(--surface-soft);
  color: var(--primary);
}

.admin-menu-group {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.admin-menu-group h2 {
  margin: 0 0 4px;
  padding: 0 10px;
  color: var(--text);
  font-size: 0.9rem;
}

.admin-content {
  min-width: 0;
}

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

  .admin-sidebar {
    position: static;
  }
}


.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 24px 56px;
}

.narrow {
  max-width: 760px;
}

.stack {
  display: grid;
  gap: 18px;
}

.section {
  margin-top: 34px;
}

.home-hero {
  justify-items: center;
  text-align: center;
}

.home-hero p {
  margin: 0 auto;
}

.home-section-title {
  align-items: center;
}

.notice-compact-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notice-compact-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.notice-compact-item:hover {
  background: var(--surface-soft);
}

.notice-compact-item:last-child {
  border-bottom: 0;
}

.world-review-section {
  display: grid;
  gap: 12px;
}

.review-list {
  display: grid;
  gap: 10px;
}

.review-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.review-summary-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.review-stars {
  color: #f59e0b;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.review-text {
  margin: 0;
  color: var(--text);
}

@media (max-width: 560px) {
  .review-summary-row {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .review-summary-row .btn {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.notice-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.hero {
  display: grid;
  gap: 22px;
  padding: 42px 0 28px;
}

.hero h1,
.page-title h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-title p,
.hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card-body {
  padding: 18px;
}

.card h2,
.card h3 {
  margin: 0 0 8px;
  line-height: 1.25;
}

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

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.badge.ok {
  background: #dcfce7;
  color: var(--ok);
}

.badge.warn {
  background: #fef3c7;
  color: var(--warning);
}

.badge.danger {
  background: #fee2e2;
  color: var(--danger);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

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

.btn.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.btn.secondary:hover {
  background: var(--surface-soft);
}

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

.btn.warning {
  background: var(--warning);
}

.btn.small {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 0.86rem;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.field-action-row .btn {
  white-space: nowrap;
}

@media (max-width: 520px) {
  .field-action-row {
    grid-template-columns: 1fr;
  }

  .field-action-row .btn {
    width: 100%;
  }
}

.inline-form {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: center;
  vertical-align: middle;
}

th {
  background: var(--surface-soft);
  font-size: 0.86rem;
  color: var(--muted);
}

td.text-cell {
  text-align: left;
  line-height: 1.55;
}

td.actions {
  display: table-cell;
  text-align: center;
  white-space: nowrap;
}

td.actions > a,
td.actions > form,
td.actions > button {
  display: inline-flex;
  margin: 4px;
  vertical-align: middle;
}

td.actions form {
  margin: 4px;
}

td.actions .btn {
  min-width: 82px;
  justify-content: center;
}

.table-action-stack {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.table-action-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
}

.table-action-row > a,
.table-action-row > form {
  margin: 0;
}

.admin-config-table th,
.admin-config-table td {
  vertical-align: middle;
}

.admin-config-table input,
.admin-config-table select {
  width: 120px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px 9px;
}

.admin-config-table .table-row-form {
  margin: 0;
}

tr:last-child td {
  border-bottom: 0;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
}

.alert.error {
  border-color: #fecaca;
  color: var(--danger);
}

.alert.message {
  border-color: #bbf7d0;
  color: var(--ok);
}

.story-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.chat-log {
  display: grid;
  gap: 12px;
}

.message {
  border-left: 4px solid var(--primary);
  padding: 12px 14px;
  background: #fff;
  border-radius: 0 8px 8px 0;
}

.message.user {
  border-left-color: var(--accent);
}

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

.stat {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .nav,
  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .story-shell {
    grid-template-columns: 1fr;
  }

  .page {
    padding-inline: 16px;
  }
}

.demo-login-box {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.demo-login-box strong {
  color: var(--primary-dark);
}

.demo-login-box dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.demo-login-box dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.demo-login-box dt {
  color: var(--muted);
  font-weight: 800;
}

.demo-login-box dd {
  margin: 0;
  font-weight: 900;
}


.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.star-rating-button {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d1d5db;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.star-rating-button:hover,
.star-rating-button:focus-visible {
  color: #facc15;
  outline: none;
  transform: translateY(-1px);
}

.star-rating-button.filled {
  color: #facc15;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field-hint.ok {
  color: var(--ok);
}

.field-hint.error {
  color: var(--danger);
}

.field-hint.checking {
  color: var(--primary);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.story-page {
  max-width: 1280px;
}

.story-title h1 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.story-main {
  min-width: 0;
  align-content: start;
}

.story-current p,
.live-story {
  white-space: pre-wrap;
}

.live-story:empty {
  display: none;
}

.choice-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.choice-list:empty {
  display: none;
}

.choice-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.choice-text {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
}

.choice-text small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.choice-text:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

.story-input-card {
  position: sticky;
  bottom: 16px;
  z-index: 5;
}

.story-input-card .card-body {
  padding: 14px;
}

.story-text-field textarea {
  min-height: 96px;
  border-color: transparent;
  background: var(--surface-soft);
  box-shadow: none;
}

.story-text-field textarea:focus {
  border-color: transparent;
  outline: 2px solid rgba(37, 99, 235, 0.22);
}

.story-side-panel {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 98px);
  overflow-y: auto;
  align-self: start;
}

.input-actions {
  justify-content: flex-end;
}

.chat-log.chronological {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-anchor: auto;
}

.epilogue-log {
  align-content: start;
}

.chat-log.chronological .message {
  width: 100%;
}

.story-progress-card {
  border-color: #bfdbfe;
}

.story-progress-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.story-progress-summary strong {
  color: var(--primary-dark);
  font-size: 1.65rem;
  line-height: 1;
}

.story-progress-summary span {
  color: var(--muted);
  font-weight: 900;
}

.story-progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.story-progress-bar span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.story-stat-bars {
  gap: 11px;
}

.story-stat-bars .persona-stat-row {
  grid-template-columns: 44px minmax(120px, 1fr) 34px;
}

@media (max-width: 820px) {
  .story-input-card,
  .story-side-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .choice-item {
    grid-template-columns: 1fr;
  }

  .input-actions {
    justify-content: stretch;
  }

  .input-actions .btn {
    width: 100%;
  }
}

.demo-login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.demo-login-grid .demo-login-box {
  margin: 0;
}

.demo-login-box .btn {
  width: 100%;
}

.social-login-stack {
  display: grid;
  gap: 10px;
}

.social-login-btn {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
  text-align: center;
}

.social-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.social-login-btn.google {
  border: 1px solid #747775;
  background: #fff;
  color: #1f1f1f;
}

.social-login-btn.google .social-mark {
  color: #4285f4;
}

.social-login-btn.kakao {
  border-radius: 12px;
  background: #fee500;
  color: rgba(0, 0, 0, 0.85);
}

.social-login-btn.kakao .social-mark {
  color: #000;
}

.social-login-btn.naver {
  background: #03c75a;
  color: #fff;
}

@media (max-width: 640px) {
  .demo-login-grid {
    grid-template-columns: 1fr;
  }
}

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

.auth-link-actions .btn {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  font-size: 0.98rem;
}

@media (max-width: 520px) {
  .auth-link-actions {
    grid-template-columns: 1fr;
  }
}

.field-guide {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: help;
}

.help-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 30;
  width: max-content;
  max-width: min(280px, 78vw);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #18202a;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.help-tip:hover .help-bubble,
.help-tip:focus .help-bubble,
.help-tip:focus-within .help-bubble {
  opacity: 1;
  transform: translate(-50%, 0);
}

.auth-link-actions.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 520px) {
  .auth-link-actions.two-column {
    grid-template-columns: 1fr;
  }
}

.auth-link-actions.one-column {
  grid-template-columns: 1fr;
}

.mypage-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.mypage-sidebar {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mypage-menu-link,
.mypage-menu-group a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.mypage-menu-link:hover,
.mypage-menu-group a:hover,
.mypage-menu-group a.active,
.mypage-menu-link.active {
  background: var(--surface-soft);
  color: var(--primary);
}

.mypage-menu-group {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.mypage-menu-group h2 {
  margin: 0 0 4px;
  padding: 0 10px;
  color: var(--text);
  font-size: 0.9rem;
}

.mypage-content {
  min-width: 0;
}

.mypage-title {
  align-items: center;
}

.mypage-section-first {
  margin-top: 0;
}

.compact-title {
  margin-bottom: 14px;
}

.compact-title h2 {
  margin: 0;
}

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

  .mypage-sidebar {
    position: static;
  }
}

.mypage-menu-link.danger-link,
.mypage-menu-group a.danger-link {
  color: var(--danger);
}

.mypage-menu-link.danger-link:hover,
.mypage-menu-link.danger-link.active,
.mypage-menu-group a.danger-link:hover,
.mypage-menu-group a.danger-link.active {
  background: #fee2e2;
  color: var(--danger);
}

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

.social-account-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.social-link-grid {
  display: grid;
  gap: 10px;
}

.social-login-btn.linked {
  opacity: 0.65;
  pointer-events: none;
}

.stat-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.stat-help-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stat-help-item strong {
  display: block;
  margin-bottom: 3px;
}

.stat-help-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.persona-stat-bars {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.persona-stat-row {
  display: grid;
  grid-template-columns: 44px minmax(120px, 1fr) 34px;
  gap: 10px;
  align-items: center;
}

.persona-stat-name {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
  white-space: nowrap;
}

.persona-stat-bar {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
}

.persona-stat-bar span {
  display: block;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-soft);
}

.persona-stat-bar span.filled {
  border-color: var(--primary);
  background: var(--primary);
}

.persona-stat-value {
  justify-self: end;
  min-width: 24px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 420px) {
  .persona-stat-row {
    grid-template-columns: 38px minmax(96px, 1fr) 28px;
    gap: 8px;
  }

  .persona-stat-bar {
    gap: 2px;
  }
}

.stat-wisdom { --stat-color: #2563eb; }
.stat-strength { --stat-color: #dc2626; }
.stat-agility { --stat-color: #16a34a; }
.stat-charisma { --stat-color: #9333ea; }
.stat-luck { --stat-color: #d97706; }

.persona-stat-bar span.filled,
.persona-stat-bar button.filled {
  border-color: var(--stat-color, var(--primary));
  background: var(--stat-color, var(--primary));
}

.persona-stat-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.persona-stat-editor .persona-stat-row {
  grid-template-columns: 44px minmax(140px, 1fr) 72px;
}

.persona-stat-bar button {
  display: block;
  width: 100%;
  height: 14px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}

.persona-stat-bar button:hover,
.persona-stat-bar button:focus-visible {
  border-color: var(--stat-color, var(--primary));
  outline: 2px solid color-mix(in srgb, var(--stat-color, var(--primary)) 28%, transparent);
  outline-offset: 1px;
}

.persona-stat-input {
  width: 72px;
  min-height: 34px;
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px 8px;
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 420px) {
  .persona-stat-editor .persona-stat-row {
    grid-template-columns: 38px minmax(96px, 1fr) 58px;
  }

  .persona-stat-input {
    width: 58px;
  }
}

.story-progress-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.story-progress-actions .btn {
  min-height: 34px;
}

.choice-text:disabled,
.story-text-field textarea:disabled {
  cursor: wait;
  opacity: 0.65;
}

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

.story-progress-header h2 {
  margin: 0;
}

.story-progress-header .story-progress-actions {
  margin-top: 0;
}

.story-stat-bars .persona-stat-row {
  grid-template-columns: 44px minmax(112px, 1fr) 32px 24px;
}

.story-stat-help {
  justify-self: end;
  width: 20px;
  height: 20px;
}

.story-stat-help .help-bubble {
  left: auto;
  right: 0;
  bottom: calc(100% + 8px);
  transform: translate(0, 4px);
}

.story-stat-help:hover .help-bubble,
.story-stat-help:focus .help-bubble,
.story-stat-help:focus-within .help-bubble {
  transform: translate(0, 0);
}

@media (max-width: 420px) {
  .story-stat-bars .persona-stat-row {
    grid-template-columns: 38px minmax(80px, 1fr) 28px 22px;
  }
}


.stats-filter [hidden] {
  display: none;
}

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

.stats-summary-grid h2 {
  margin: 4px 0 0;
  font-size: 1.8rem;
}

.stats-summary-grid article:first-child h2 {
  font-size: 1.1rem;
  line-height: 1.35;
}

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

.chart-box {
  height: 280px;
}

.chart-box-wide {
  height: 360px;
}

@media (max-width: 980px) {
  .stats-summary-grid,
  .stats-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .stats-summary-grid,
  .stats-chart-grid {
    grid-template-columns: 1fr;
  }
}

.admin-help-panel {
  margin: 12px 0 16px;
}

.admin-help-panel strong {
  display: block;
  margin-bottom: 4px;
}

.admin-help-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.report-target-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 18px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.report-table-wrap {
  overflow-x: visible;
}

.report-summary-table {
  table-layout: fixed;
  width: 100%;
}

.report-summary-table th:nth-child(1),
.report-summary-table td:nth-child(1) {
  width: 72px;
}

.report-summary-table th:nth-child(2),
.report-summary-table td:nth-child(2) {
  width: 92px;
}

.report-summary-table th:nth-child(4),
.report-summary-table td:nth-child(4),
.report-summary-table th:nth-child(5),
.report-summary-table td:nth-child(5) {
  width: 120px;
}

.report-target-text {
  max-width: 0;
}

.report-target-text,
.report-target-text a,
.report-target-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-target-text a {
  display: block;
  color: #1d4ed8;
  font-weight: 700;
}

.report-processing-table {
  margin-top: 14px;
}

.report-actions {
  min-width: 280px;
}

.report-context-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.report-chat-table .highlighted-row td {
  background: #fff7ed;
  border-top: 2px solid #f59e0b;
  border-bottom: 2px solid #f59e0b;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td,
.clickable-row:focus td {
  background: #f1f5f9;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(1080px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-body {
  padding: 20px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 18px 0;
}

.report-history-section {
  margin-top: 20px;
}

.report-history-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}
