:root {
  color-scheme: light dark;
  --app-bg: #09111f;
  --app-bg-soft: #13233f;
  --app-surface: rgba(15, 22, 38, 0.72);
  --app-surface-soft: rgba(255, 255, 255, 0.06);
  --app-border: rgba(255, 255, 255, 0.1);
  --app-border-strong: rgba(120, 169, 255, 0.34);
  --app-text: #f3f4f6;
  --app-text-muted: rgba(243, 244, 246, 0.76);
  --app-accent: #78a9ff;
  --app-accent-warm: #ffbc75;
  --app-danger: #ff8a8a;
  --app-shadow: 0 24px 48px rgba(3, 8, 18, 0.24);
}

body {
  margin: 0;
  position: relative;
  min-height: 100vh;
  font-family: Aptos, "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(circle at top left, rgba(255, 188, 117, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(120, 169, 255, 0.12), transparent 28%),
    linear-gradient(180deg, var(--app-bg), #0c1424 42%, #111b2f 100%);
  color: var(--app-text);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.28;
  z-index: 0;
}

body::before {
  top: 90px;
  left: -90px;
  background: rgba(255, 188, 117, 0.2);
}

body::after {
  right: -100px;
  bottom: 80px;
  background: rgba(120, 169, 255, 0.18);
}

@media (prefers-color-scheme: light) {
  :root {
    --app-surface: rgba(255, 255, 255, 0.74);
    --app-surface-soft: rgba(255, 255, 255, 0.72);
    --app-border: rgba(26, 39, 66, 0.12);
    --app-shadow: 0 24px 48px rgba(95, 114, 145, 0.16);
  }

  body {
    background:
      radial-gradient(circle at top left, rgba(255, 188, 117, 0.12), transparent 24%),
      radial-gradient(circle at top right, rgba(120, 169, 255, 0.12), transparent 28%),
      linear-gradient(180deg, #f4f5fb, #edf1f9 42%, #e8edf7 100%);
    color: #101114;
  }
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--app-border);
  background: rgba(8, 14, 28, 0.7);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(4, 10, 22, 0.12);
}

@media (prefers-color-scheme: light) {
  .navbar {
    background: rgba(255, 255, 255, 0.72);
  }

  .btn {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 246, 251, 0.76)),
      rgba(255, 255, 255, 0.72);
  }

  .nav-dropdown-menu {
    background:
      radial-gradient(circle at top left, rgba(255, 188, 117, 0.14), transparent 40%),
      radial-gradient(circle at bottom right, rgba(120, 169, 255, 0.14), transparent 44%),
      rgba(255, 255, 255, 0.98);
  }
}

.navbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.navbar-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.navbar-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.navbar-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(127, 127, 127, 0.3);
  background: rgba(127, 127, 127, 0.08);
  cursor: pointer;
  user-select: none;
}

.navbar-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.navbar-toggle-text {
  font-size: 14px;
  font-weight: 700;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  opacity: 0.95;
}

.navbar-links a {
  position: relative;
  padding: 8px 0;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  list-style: none;
  cursor: pointer;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--app-accent-warm), var(--app-accent));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.16s ease;
}

.nav-dropdown summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.16s ease;
}

.nav-dropdown:hover summary::before,
.nav-dropdown summary:focus-visible::before,
.nav-dropdown[open] summary::before {
  transform: scaleX(1);
}

.nav-dropdown[open] summary::after {
  transform: translateY(1px) rotate(-135deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  display: none;
  min-width: 180px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--app-border);
  background:
    radial-gradient(circle at top left, rgba(255, 188, 117, 0.14), transparent 40%),
    radial-gradient(circle at bottom right, rgba(120, 169, 255, 0.16), transparent 44%),
    rgba(12, 19, 34, 0.96);
  box-shadow: 0 20px 40px rgba(4, 10, 22, 0.28);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
  z-index: 20;
}

.nav-dropdown[open] .nav-dropdown-menu {
  display: grid;
  gap: 4px;
}

.nav-dropdown-menu a {
  padding: 10px 12px;
  border-radius: 12px;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
}

.navbar-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--app-accent-warm), var(--app-accent));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.16s ease;
}

.navbar-links a:hover::after,
.navbar-links a:focus-visible::after {
  transform: scaleX(1);
}

.nav-user {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(127, 127, 127, 0.35);
  background: rgba(127, 127, 127, 0.14);
  font-weight: 700;
  opacity: 0.85;
}

.nav-model-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
  min-width: 152px;
  border-radius: 999px;
  border: 1px solid rgba(120, 169, 255, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 188, 117, 0.14), rgba(120, 169, 255, 0.18)),
    rgba(127, 127, 127, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-decoration: none;
  box-sizing: border-box;
}

.nav-model-badge:hover,
.nav-model-badge:focus-visible {
  text-decoration: none;
  border-color: rgba(120, 169, 255, 0.48);
  transform: translateY(-1px);
}

.nav-model-badge::after {
  display: none;
}

.nav-model-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.74;
}

@media (max-width: 720px) {
  .scene-chapter-menu-panel {
    left: 0;
    right: auto;
    min-width: min(280px, calc(100vw - 56px));
  }

  .navbar-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .navbar-toggle {
    display: inline-flex;
    margin-left: auto;
    border-color: rgba(255, 255, 255, 0.12);
    background:
      radial-gradient(circle at top left, rgba(255, 188, 117, 0.14), transparent 48%),
      rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  .navbar-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 12px;
    padding: 14px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
      radial-gradient(circle at top left, rgba(255, 188, 117, 0.16), transparent 28%),
      radial-gradient(circle at bottom right, rgba(120, 169, 255, 0.18), transparent 34%),
      linear-gradient(135deg, rgba(8, 14, 28, 0.96), rgba(22, 35, 58, 0.94));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 18px 40px rgba(4, 10, 22, 0.28);
    backdrop-filter: blur(18px);
  }

  .navbar-links a,
  .navbar-links .nav-dropdown summary,
  .navbar-links .nav-model-badge,
  .navbar-links .nav-user {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
  }

  .navbar-links .nav-dropdown {
    width: 100%;
  }

  .navbar-links .nav-dropdown summary {
    display: flex;
    justify-content: space-between;
  }

  .navbar-links .nav-dropdown summary::before {
    left: 14px;
    right: 14px;
    bottom: 8px;
  }

  .navbar-links .nav-dropdown-menu {
    position: static;
    min-width: 0;
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    transform: none;
  }

  .navbar-links .nav-dropdown-menu a {
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
  }

  .navbar-links .nav-model-badge {
    justify-content: space-between;
    background:
      linear-gradient(135deg, rgba(255, 188, 117, 0.18), rgba(120, 169, 255, 0.2)),
      rgba(255, 255, 255, 0.06);
  }

  .navbar-links .nav-user {
    display: inline-flex;
    justify-content: center;
    margin-top: 2px;
    background:
      linear-gradient(135deg, rgba(255, 188, 117, 0.18), rgba(120, 169, 255, 0.2)),
      rgba(255, 255, 255, 0.06);
  }

  .navbar-links a:hover,
  .navbar-links .nav-dropdown summary:hover,
  .navbar-links .nav-dropdown-menu a:hover,
  .navbar-links .nav-model-badge:hover {
    text-decoration: none;
    background:
      linear-gradient(135deg, rgba(255, 188, 117, 0.14), rgba(120, 169, 255, 0.18)),
      rgba(255, 255, 255, 0.08);
    border-color: rgba(120, 169, 255, 0.22);
  }

  .navbar-links a::after {
    left: 14px;
    right: 14px;
    bottom: 8px;
  }

  .navbar-toggle-input:checked + .navbar-toggle + .navbar-links {
    display: flex;
  }

  .navbar-toggle-input:checked + .navbar-toggle .navbar-toggle-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .navbar-toggle-input:checked + .navbar-toggle .navbar-toggle-line:nth-child(2) {
    opacity: 0;
  }

  .navbar-toggle-input:checked + .navbar-toggle .navbar-toggle-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}

@media (max-width: 720px) and (prefers-color-scheme: light) {
  .navbar-toggle {
    border-color: rgba(26, 39, 66, 0.12);
    background:
      radial-gradient(circle at top left, rgba(255, 188, 117, 0.16), transparent 48%),
      rgba(255, 255, 255, 0.74);
  }

  .navbar-links {
    background:
      radial-gradient(circle at top left, rgba(255, 188, 117, 0.16), transparent 28%),
      radial-gradient(circle at bottom right, rgba(120, 169, 255, 0.18), transparent 34%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 244, 251, 0.96));
  }

  .navbar-links a,
  .navbar-links .nav-dropdown summary,
  .navbar-links .nav-dropdown-menu a,
  .navbar-links .nav-model-badge,
  .navbar-links .nav-user {
    border-color: rgba(26, 39, 66, 0.08);
    background: rgba(255, 255, 255, 0.74);
  }

  .navbar-links a:hover,
  .navbar-links .nav-dropdown summary:hover,
  .navbar-links .nav-dropdown-menu a:hover,
  .navbar-links .nav-model-badge:hover {
    background:
      linear-gradient(135deg, rgba(255, 188, 117, 0.14), rgba(120, 169, 255, 0.14)),
      rgba(255, 255, 255, 0.84);
  }
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
}

.message {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(127, 127, 127, 0.25);
  background: rgba(127, 127, 127, 0.08);
}

.message-success {
  border-color: rgba(40, 180, 99, 0.45);
  background: rgba(40, 180, 99, 0.14);
}

.message-error {
  border-color: rgba(212, 68, 68, 0.45);
  background: rgba(212, 68, 68, 0.14);
}

.message-warning {
  border-color: rgba(241, 196, 15, 0.45);
  background: rgba(241, 196, 15, 0.14);
}

.message-info {
  border-color: rgba(90, 140, 255, 0.55);
  background: rgba(90, 140, 255, 0.16);
}

.card {
  border: 1px solid var(--app-border);
  border-radius: 24px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    var(--app-surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    var(--app-shadow);
  backdrop-filter: blur(14px);
}

.card + .card {
  margin-top: 18px;
}

h1 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.04em;
}

h2.h2 {
  margin: 18px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  letter-spacing: -0.03em;
}

p {
  margin: 0 0 12px;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(127, 127, 127, 0.15);
}

ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

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

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scene-chapter-menu {
  position: relative;
}

.scene-chapter-menu summary {
  list-style: none;
}

.scene-chapter-menu summary::-webkit-details-marker {
  display: none;
}

.scene-chapter-menu-toggle::after {
  content: "▾";
  margin-left: 8px;
  font-size: 12px;
  opacity: 0.8;
}

.scene-chapter-menu[open] .scene-chapter-menu-toggle::after {
  content: "▴";
}

.scene-chapter-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 240px;
  max-width: min(340px, 82vw);
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--app-border);
  background:
    radial-gradient(circle at top left, rgba(255, 188, 117, 0.1), transparent 34%),
    radial-gradient(circle at bottom right, rgba(120, 169, 255, 0.14), transparent 42%),
    rgba(10, 16, 29, 0.96);
  box-shadow: var(--app-shadow);
}

.scene-chapter-menu-link {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
}

.scene-chapter-menu-link:hover,
.scene-chapter-menu-link:focus-visible {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.scene-chapter-menu-link.is-current {
  border: 1px solid rgba(120, 169, 255, 0.28);
  background: rgba(120, 169, 255, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.06);
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.16s ease, border-color 0.16s ease, filter 0.16s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-primary {
  border-color: rgba(120, 169, 255, 0.38);
  background: linear-gradient(135deg, rgba(255, 188, 117, 0.24), rgba(120, 169, 255, 0.28));
}

.btn-secondary {
  opacity: 0.95;
}

.muted {
  opacity: 0.75;
  font-size: 14px;
}

.list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(120, 169, 255, 0.08), transparent 32%),
    rgba(255, 255, 255, 0.04);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.list-item:hover,
.list-item:focus-within {
  transform: translateY(-2px);
  border-color: rgba(120, 169, 255, 0.24);
}

.character-card-has-portrait {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.character-card-has-portrait:hover {
  transform: translateY(-2px);
  border-color: rgba(90, 140, 255, 0.34);
  background: rgba(90, 140, 255, 0.08);
}

.list-title {
  font-weight: 700;
}

.updates-list {
  display: grid;
  gap: 14px;
}

.update-note {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(127, 127, 127, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 245, 157, 0.12), rgba(127, 127, 127, 0.05)),
    rgba(127, 127, 127, 0.04);
}

.update-date {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.72;
}

.update-title {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 700;
}

.update-body {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(127, 127, 127, 0.22);
  background: rgba(15, 15, 18, 0.22);
  white-space: pre-wrap;
}

@media (prefers-color-scheme: light) {
  .update-note {
    background:
      linear-gradient(180deg, rgba(255, 244, 184, 0.55), rgba(255, 255, 255, 0.72)),
      rgba(255, 255, 255, 0.92);
  }

  .update-body {
    background: rgba(255, 255, 255, 0.88);
  }
}

.location-list-item {
  align-items: flex-start;
}

.location-tree-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.location-tree-node {
  position: relative;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(120, 169, 255, 0.08), transparent 30%),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 24px rgba(5, 10, 22, 0.12);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.location-tree-node:hover,
.location-tree-node:focus-within {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(120, 169, 255, 0.24);
  background:
    radial-gradient(circle at top right, rgba(120, 169, 255, 0.14), transparent 32%),
    rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 18px 38px rgba(5, 10, 22, 0.18);
}

.location-tree-node[draggable="true"] {
  cursor: grab;
}

.location-tree-node[draggable="true"]:active {
  cursor: grabbing;
}

.location-tree-node.is-location-dragging {
  opacity: 0.6;
}

.location-tree-node.location-drop-over {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(90, 140, 255, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 4px rgba(90, 140, 255, 0.12);
}

.location-tree-node.is-root {
  border-color: rgba(120, 169, 255, 0.28);
  background:
    radial-gradient(circle at top left, rgba(255, 188, 117, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(120, 169, 255, 0.12), transparent 34%),
    rgba(120, 169, 255, 0.05);
}

.location-tree-node-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.location-tree-node-title {
  font-size: 18px;
  font-weight: 700;
}

.location-tree-node-meta {
  margin-top: 6px;
  line-height: 1.4;
}

.location-tree-children {
  position: relative;
  display: grid;
  gap: 14px;
  margin-top: 16px;
  margin-left: 18px;
  padding-top: 8px;
  padding-left: 18px;
}

.location-tree-children::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(rgba(120, 169, 255, 0.34), rgba(120, 169, 255, 0.06));
}

.location-tree-children > .location-tree-node::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 26px;
  width: 18px;
  height: 2px;
  background: rgba(120, 169, 255, 0.28);
}

.page-shell {
  display: grid;
  gap: 22px;
}

.page-shell .card + .card {
  margin-top: 0;
}

.page-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 32px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(255, 188, 117, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(120, 169, 255, 0.2), transparent 32%),
    linear-gradient(135deg, rgba(8, 14, 28, 0.96), rgba(21, 33, 56, 0.94));
  border-color: rgba(255, 255, 255, 0.08);
}

.page-hero::before {
  content: "";
  position: absolute;
  right: -80px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(10px);
}

.page-hero-compact {
  padding: 28px;
}

.page-hero-has-scene-menu {
  overflow: visible;
  z-index: 3;
}

.page-hero-has-scene-menu .page-hero-head {
  z-index: 4;
}

.page-hero-head,
.page-panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.page-kicker,
.page-panel-kicker {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}

.page-title,
.page-panel-title {
  margin: 8px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.05em;
}

.page-title {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 0.96;
}

.page-panel-title {
  font-size: 30px;
  line-height: 1.02;
}

.page-lead {
  position: relative;
  z-index: 1;
  max-width: 70ch;
  margin: 0;
  font-size: 16px;
  line-height: 1.72;
  color: rgba(255, 255, 255, 0.82);
}

.page-hero .muted,
.page-hero .page-meta {
  color: rgba(255, 255, 255, 0.76);
}

.page-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.page-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.page-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.page-summary-card {
  position: relative;
  z-index: 1;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.page-summary-card strong {
  display: block;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.page-summary-card span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.66);
}

.page-panel {
  padding: 28px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(120, 169, 255, 0.1), transparent 30%),
    rgba(255, 255, 255, 0.05);
}

.billing-status-grid,
.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.billing-status-card,
.billing-plan-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at top right, rgba(120, 169, 255, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.04);
}

.billing-status-card strong,
.billing-plan-kicker {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}

.billing-status-card span {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.billing-plan-title {
  margin: 0 0 10px;
  font-size: 22px;
}

.billing-plan-price {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.billing-plan-vat-badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d9f3df;
  border: 1px solid rgba(96, 213, 120, 0.55);
  background: rgba(39, 116, 58, 0.45);
}

.billing-plan-vat-note {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(214, 228, 255, 0.84);
}

.billing-plan-card form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.billing-plan-terms-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
}

.billing-plan-terms-check input[type="checkbox"] {
  margin-top: 2px;
  width: 15px;
  height: 15px;
}

.billing-plan-terms-check a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.billing-invoice-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.billing-status-actions {
  margin-top: 16px;
  justify-content: flex-end;
}

.billing-invoice-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at top right, rgba(120, 169, 255, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.04);
}

.billing-invoice-meta {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: 180px;
}

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

@media (max-width: 720px) {
  .billing-invoice-card {
    flex-direction: column;
  }

  .billing-invoice-meta {
    justify-items: start;
    min-width: 0;
  }
}

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

.page-prose,
.page-panel-copy {
  margin: 0;
  line-height: 1.78;
}

.page-confirm {
  background:
    radial-gradient(circle at top left, rgba(255, 138, 138, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(255, 188, 117, 0.12), transparent 26%),
    linear-gradient(135deg, rgba(40, 15, 20, 0.95), rgba(58, 21, 28, 0.92));
}

.page-confirm .page-kicker,
.page-confirm .page-lead,
.page-confirm .page-meta,
.page-confirm .muted {
  color: rgba(255, 240, 240, 0.78);
}

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

.account-email-list {
  margin-top: 16px;
  margin-bottom: 18px;
}

.account-email-item {
  padding: 0;
}

.account-email-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
}

.account-email-choice input[type="radio"] {
  flex: 0 0 auto;
  accent-color: var(--app-accent);
}

.account-email-copy {
  display: grid;
  gap: 8px;
}

.account-email-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-email-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.account-email-badge-success {
  background: rgba(111, 211, 159, 0.16);
  color: #8fe0b3;
}

.account-email-badge-warning {
  background: rgba(255, 188, 117, 0.16);
  color: #ffd29c;
}

.token-usage-list {
  margin-top: 16px;
}

.token-usage-model-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 22px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(127, 127, 127, 0.2);
  background:
    radial-gradient(circle at top left, rgba(90, 140, 255, 0.16), transparent 32%),
    rgba(127, 127, 127, 0.05);
}

.token-usage-model-copy {
  display: grid;
  gap: 8px;
}

.token-usage-model-note {
  margin: 0;
}

.token-usage-model-form {
  min-width: min(100%, 360px);
}

.token-usage-model-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-usage-model-controls select {
  flex: 1 1 auto;
}

.token-usage-item {
  align-items: center;
}

.token-usage-copy {
  display: grid;
  gap: 6px;
}

.token-usage-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  text-align: right;
}

.token-usage-total {
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.location-map-panel {
  margin: 16px 0 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(127, 127, 127, 0.2);
  background:
    radial-gradient(circle at top left, rgba(90, 140, 255, 0.18), transparent 34%),
    rgba(127, 127, 127, 0.05);
}

.location-map {
  --bubble-indent: 56px;
  margin-top: 16px;
  display: grid;
  gap: 16px;
}

.location-map-row {
  position: relative;
  padding-left: calc(var(--location-depth) * var(--bubble-indent));
}

.location-map-row::before {
  content: "";
  position: absolute;
  left: calc((var(--location-depth) * var(--bubble-indent)) - 24px);
  top: 50%;
  width: 24px;
  height: 2px;
  background: rgba(90, 140, 255, 0.45);
}

.location-map-row[style*="--location-depth: 0"]::before {
  display: none;
}

.location-bubble {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 132px;
  min-height: 132px;
  padding: 18px;
  border-radius: 999px;
  border: 1px solid rgba(127, 127, 127, 0.22);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 36%),
    radial-gradient(circle at 70% 75%, rgba(90, 140, 255, 0.14), transparent 34%),
    rgba(127, 127, 127, 0.08);
  color: inherit;
  text-align: center;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.location-bubble:hover,
.location-bubble:focus-visible {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(90, 140, 255, 0.45);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.location-bubble.is-root {
  width: 154px;
  min-height: 154px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.28), transparent 38%),
    radial-gradient(circle at 72% 75%, rgba(90, 140, 255, 0.22), transparent 38%),
    rgba(90, 140, 255, 0.1);
  border-color: rgba(90, 140, 255, 0.38);
}

.location-map-row:not([style*="--location-depth: 0"]) .location-bubble::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 50%;
  width: 30px;
  height: 30px;
  border-left: 2px solid rgba(90, 140, 255, 0.3);
  border-bottom: 2px solid rgba(90, 140, 255, 0.3);
  border-bottom-left-radius: 20px;
  transform: translateY(-80%);
}

.location-bubble-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
}

.location-bubble-meta {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.76;
}

.location-map-path {
  margin-top: 8px;
  margin-left: 6px;
  max-width: 300px;
  line-height: 1.35;
}

.world-map-card {
  overflow: hidden;
}

.world-map-canvas {
  margin-top: 18px;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid rgba(127, 127, 127, 0.18);
  background:
    radial-gradient(circle at top left, rgba(90, 140, 255, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(90, 140, 255, 0.1), transparent 30%),
    rgba(127, 127, 127, 0.04);
}

.world-location-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 132px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(127, 127, 127, 0.22);
  outline: 2px solid rgba(90, 140, 255, 0.22);
  outline-offset: 3px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 55%),
    radial-gradient(circle at 82% 20%, rgba(90, 140, 255, 0.14), transparent 32%),
    rgba(127, 127, 127, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 26px rgba(0, 0, 0, 0.08);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.world-map-canvas > .world-location-box {
  max-width: 360px;
}

.world-location-box[draggable="true"] {
  cursor: grab;
}

.world-location-box[draggable="true"]:active {
  cursor: grabbing;
}

.world-location-box.is-location-dragging {
  opacity: 0.6;
}

.world-location-box.location-drop-over {
  border-color: rgba(90, 140, 255, 0.58);
  outline-color: rgba(90, 140, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 4px rgba(90, 140, 255, 0.12);
}

.world-location-box:hover,
.world-location-box:focus-within {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(90, 140, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 14px 34px rgba(0, 0, 0, 0.14);
}

.world-location-box::before {
  display: none;
}

.world-location-box.is-root {
  min-height: 148px;
  max-width: 100%;
  outline-color: rgba(90, 140, 255, 0.34);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 55%),
    radial-gradient(circle at 82% 20%, rgba(90, 140, 255, 0.22), transparent 34%),
    rgba(90, 140, 255, 0.1);
  border-color: rgba(90, 140, 255, 0.36);
}

.world-location-name {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
}

.world-location-meta {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.76;
}

.world-location-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.world-location-drag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px dashed rgba(90, 140, 255, 0.35);
  font-size: 12px;
  opacity: 0.8;
  user-select: none;
}

.world-map-caption {
  margin-top: 10px;
  max-width: 340px;
  line-height: 1.35;
}

.world-location-children {
  position: relative;
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 16px;
  padding-top: 16px;
  padding-left: 28px;
}

.world-location-children::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(rgba(90, 140, 255, 0.28), rgba(90, 140, 255, 0.06));
}

.world-location-children > .world-location-box::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 24px;
  width: 20px;
  height: 2px;
  background: rgba(90, 140, 255, 0.28);
}

@media (max-width: 640px) {
  .location-map {
    --bubble-indent: 30px;
  }

  .location-bubble {
    width: 110px;
    min-height: 110px;
    padding: 14px;
  }

  .location-bubble.is-root {
    width: 126px;
    min-height: 126px;
  }

  .location-map-path {
    max-width: none;
  }

  .world-map-canvas {
    padding: 16px;
  }

  .world-location-box {
    min-height: 118px;
    padding: 14px;
  }

  .world-location-box.is-root {
    min-height: 128px;
  }

  .world-location-name {
    font-size: 15px;
  }

  .world-map-caption {
    max-width: none;
    font-size: 13px;
  }

  .world-location-children {
    padding-left: 18px;
  }

  .world-location-children > .world-location-box::before {
    left: -14px;
    width: 14px;
  }

  .location-tree-node {
    padding: 14px;
  }

  .location-tree-node-title {
    font-size: 16px;
  }

  .location-tree-children {
    margin-left: 10px;
    padding-left: 14px;
  }

  .location-tree-children > .location-tree-node::before {
    left: -14px;
    width: 14px;
  }
}

.form {
  margin-top: 12px;
}

.form-row {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.form-label-row .form-label {
  margin-bottom: 0;
}

.reject-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  opacity: 0.8;
  position: relative;
  cursor: help;
}

.reject-toggle input {
  accent-color: rgba(212, 68, 68, 0.85);
}

.reject-tooltip {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(127, 127, 127, 0.35);
  background: #000000;
  color: #f3f4f6;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

.reject-toggle:hover .reject-tooltip,
.reject-toggle:focus-within .reject-tooltip {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-color-scheme: light) {
  .reject-tooltip {
    background: #000000;
    color: #f3f4f6;
    box-shadow: 0 6px 18px rgba(10, 10, 10, 0.12);
  }
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(127, 127, 127, 0.35);
  background: rgba(127, 127, 127, 0.08);
  color: inherit;
  font: inherit;
}

@media (prefers-color-scheme: dark) {
  select,
  option {
    background-color: #14141a;
    color: #f3f4f6;
    font: inherit;
  }

  select {
    color-scheme: dark;
  }
}

@media (prefers-color-scheme: light) {
  select,
  option {
    background-color: #ffffff;
    color: #101114;
    font: inherit;
  }

  select {
    color-scheme: light;
  }
}

.field-error {
  margin-top: 6px;
  color: #d44;
  font-size: 14px;
}

.form-errors {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(212, 68, 68, 0.35);
  background: rgba(212, 68, 68, 0.12);
}

.dl {
  margin: 12px 0 0;
}

.dl-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(127, 127, 127, 0.15);
}

.dl-row:first-child {
  border-top: 0;
}

dt {
  font-weight: 700;
  opacity: 0.8;
}

dd {
  margin: 0;
}

.pre {
  white-space: pre-wrap;
}

.collapsible {
  margin: 0;
}

.collapsible-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 6px 8px;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.collapsible-summary::-webkit-details-marker {
  display: none;
}

.collapsible-title {
  font-size: 24px;
  font-weight: 700;
}

.btn-sm {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}

.outline-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0;
  padding: 4px 6px;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.outline-sep {
  border: 0;
  border-top: 1px solid rgba(127, 127, 127, 0.18);
  margin: 12px 0;
}

.multi-select {
  width: 100%;
}

.multi-select-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.multi-select-summary::-webkit-details-marker {
  display: none;
}

.multi-select-summary::after {
  content: "▾";
  font-size: 12px;
  opacity: 0.7;
}

.multi-select[open] .multi-select-summary::after {
  content: "▴";
}

.multi-select-list {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(127, 127, 127, 0.28);
  background: rgba(127, 127, 127, 0.06);
}

.checkbox-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.checkbox-list li {
  margin: 0;
}

.checkbox-list label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.draft-editor {
  position: relative;
}

.draft-highlight,
.draft-input {
  font: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.draft-highlight {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(127, 127, 127, 0.35);
  background: rgba(127, 127, 127, 0.08);
  color: inherit;
  overflow: hidden;
  pointer-events: none;
  scrollbar-width: none;
}

.draft-editor-synonym-mode .draft-highlight {
  z-index: 3;
  pointer-events: auto;
}

.draft-highlight::-webkit-scrollbar {
  display: none;
}

.draft-input {
  position: relative;
  z-index: 2;
  background: transparent;
  color: transparent;
  caret-color: #f3f4f6;
  border-color: transparent;
  overflow: hidden;
}

.draft-editor-synonym-mode .draft-input {
  visibility: hidden;
  pointer-events: none;
}

.draft-highlight-token {
  background: rgba(46, 204, 113, 0.35);
  border-radius: 4px;
}

.draft-highlight-token-targeted {
  background: rgba(220, 38, 38, 0.38);
}

.draft-highlight-regenerated {
  background: rgba(250, 204, 21, 0.42);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.55);
}

.draft-placeholder {
  opacity: 0.5;
}

.draft-synonym-btn[aria-pressed="true"] {
  border-color: rgba(120, 169, 255, 0.5);
  background:
    linear-gradient(135deg, rgba(255, 188, 117, 0.24), rgba(120, 169, 255, 0.3)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(120, 169, 255, 0.22);
}

.draft-synonym-word {
  border-radius: 4px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.draft-editor-synonym-mode .draft-synonym-word {
  cursor: help;
}

.draft-editor-synonym-mode .draft-synonym-word:hover {
  background: rgba(120, 169, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(120, 169, 255, 0.4);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.draft-synonym-popover {
  position: absolute;
  z-index: 4;
  width: min(280px, calc(100% - 24px));
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(120, 169, 255, 0.26);
  background:
    radial-gradient(circle at top left, rgba(255, 188, 117, 0.16), transparent 36%),
    rgba(9, 17, 31, 0.96);
  box-shadow: 0 16px 34px rgba(3, 8, 18, 0.35);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.draft-synonym-popover.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.draft-synonym-title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 244, 246, 0.72);
}

.draft-synonym-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.draft-synonym-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(120, 169, 255, 0.24);
  background: rgba(120, 169, 255, 0.12);
  font-size: 13px;
  line-height: 1.2;
}

.draft-synonym-status {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(243, 244, 246, 0.8);
}

textarea.auto-grow {
  overflow: hidden;
  resize: none;
  min-height: 260px;
}

.auto-grow {
  scrollbar-width: none;
}

.auto-grow::-webkit-scrollbar {
  display: none;
}

@media (prefers-color-scheme: light) {
  .draft-input {
    caret-color: #101114;
  }

  .draft-synonym-popover {
    border-color: rgba(49, 87, 200, 0.18);
    background:
      radial-gradient(circle at top left, rgba(255, 188, 117, 0.2), transparent 34%),
      rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 34px rgba(95, 114, 145, 0.18);
  }

  .draft-synonym-title {
    color: rgba(16, 17, 20, 0.62);
  }

  .draft-synonym-chip {
    border-color: rgba(49, 87, 200, 0.16);
    background: rgba(49, 87, 200, 0.08);
  }

  .draft-synonym-status {
    color: rgba(16, 17, 20, 0.78);
  }
}

.object-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 10px;
  align-items: start;
  margin: 10px 0;
}

.is-hidden {
  display: none;
}

.character-portrait {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 18px;
}

.portrait-frame {
  width: 180px;
  height: 220px;
  border-radius: 16px;
  border: 1px solid rgba(127, 127, 127, 0.28);
  background: rgba(127, 127, 127, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-placeholder {
  padding: 12px;
  text-align: center;
  font-size: 14px;
  opacity: 0.7;
}

.portrait-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.location-image {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 18px;
}

.location-banner-frame {
  width: min(720px, 100%);
  height: 220px;
  border-radius: 16px;
  border: 1px solid rgba(127, 127, 127, 0.28);
  background: rgba(127, 127, 127, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.location-banner-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-tooltip {
  position: fixed;
  width: 180px;
  height: 220px;
  border-radius: 14px;
  border: 1px solid rgba(127, 127, 127, 0.35);
  background: rgba(15, 15, 15, 0.98);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
  z-index: 9999;
}

.portrait-tooltip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #0f0f0f;
  color: #f5f5f5;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
  z-index: 20;
}

.tooltip-wrap:hover .tooltip-bubble,
.tooltip-wrap:focus-within .tooltip-bubble {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .object-row {
    grid-template-columns: 1fr;
  }
}

.scene-list-empty {
  margin: 10px 0 0;
}

.scene-drag {
  display: inline-flex;
  align-items: baseline;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: grab;
  user-select: none;
}

.scene-drag:hover {
  background: rgba(127, 127, 127, 0.08);
}

.scene-drag:active {
  cursor: grabbing;
}

.scene-dropzone {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(127, 127, 127, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  opacity: 0.85;
}

.scene-item.is-dragging {
  opacity: 0.55;
}

.collapsible-summary:hover,
.outline-row:hover,
.scene-item:hover {
  background: rgba(127, 127, 127, 0.08);
}

.scene-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.scene-title-input {
  width: min(520px, 70vw);
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(127, 127, 127, 0.28);
  background: rgba(127, 127, 127, 0.06);
  color: inherit;
  font: inherit;
}

.scene-title-input:focus {
  outline: 2px solid rgba(90, 140, 255, 0.55);
  outline-offset: 2px;
}

.drop-over {
  outline: 2px solid rgba(90, 140, 255, 0.55);
  outline-offset: 4px;
  border-radius: 12px;
}

.scene-item.drop-over,
.scene-dropzone.drop-over,
.scene-list.drop-over {
  background: rgba(90, 140, 255, 0.12);
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: stretch;
  padding: 32px;
  background:
    radial-gradient(circle at top left, rgba(255, 188, 117, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(90, 140, 255, 0.2), transparent 42%),
    linear-gradient(135deg, rgba(12, 18, 32, 0.94), rgba(28, 41, 69, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 48px rgba(8, 14, 28, 0.28);
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: auto -80px -110px auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 188, 117, 0.14);
  filter: blur(6px);
}

.dashboard-hero-copy,
.dashboard-progress-card {
  position: relative;
  z-index: 1;
}

.dashboard-kicker,
.dashboard-panel-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}

.dashboard-title {
  margin: 10px 0 12px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.dashboard-lead {
  max-width: 62ch;
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}

.dashboard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.dashboard-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.88);
}

.dashboard-actions {
  margin-top: 24px;
}

.dashboard-actions form {
  display: flex;
  margin: 0;
}

.dashboard-progress-card {
  align-self: stretch;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(10, 16, 28, 0.56);
  backdrop-filter: blur(12px);
}

.dashboard-progress-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}

.dashboard-progress-value {
  margin-top: 10px;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.dashboard-progress-track {
  margin-top: 18px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.dashboard-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffbc75, #ff8d63 52%, #78a9ff);
}

.dashboard-progress-note {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.82);
}

.dashboard-mini-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
}

.dashboard-mini-facts div {
  padding: 14px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.dashboard-mini-facts dt {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.62);
}

.dashboard-mini-facts dd {
  margin: 8px 0 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.dashboard-stat {
  padding: 20px 18px;
  border-radius: 22px;
  border: 1px solid rgba(127, 127, 127, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    rgba(127, 127, 127, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-stat-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

.dashboard-stat strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.dashboard-stat-note {
  display: block;
  margin-top: 8px;
  opacity: 0.74;
}

.dashboard-content-grid {
  display: block;
  margin-top: 22px;
}

.dashboard-panel {
  padding: 26px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(90, 140, 255, 0.1), transparent 34%),
    rgba(127, 127, 127, 0.05);
}

.dashboard-panel-head,
.dashboard-outline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-panel-title {
  margin: 6px 0 0;
  font-size: 30px;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.dashboard-bible-copy {
  margin: 0;
  line-height: 1.75;
}

.dashboard-bible-summary {
  align-items: center;
  margin: 0;
  padding: 0;
}

.dashboard-bible-summary-copy {
  display: grid;
  gap: 6px;
}

.dashboard-bible-summary .dashboard-panel-title {
  margin: 0;
}

.dashboard-bible-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.dashboard-bible-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(90, 140, 255, 0.34);
  background: rgba(90, 140, 255, 0.14);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-bible-toggle::after {
  content: "Collapse";
}

.dashboard-bible-panel:not([open]) .dashboard-bible-toggle::after {
  content: "Expand";
}

.dashboard-bible-body {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.dashboard-panel-foot {
  margin-top: 16px;
}

.dashboard-empty-copy {
  margin: 0;
  opacity: 0.8;
}

.dashboard-run-list,
.dashboard-outline-tree,
.dashboard-chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.dashboard-run-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(127, 127, 127, 0.16);
  background: rgba(127, 127, 127, 0.05);
}

.dashboard-run-type {
  font-weight: 700;
}

.dashboard-run-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-run-status-succeeded {
  background: rgba(111, 211, 159, 0.16);
  color: #8fe0b3;
}

.dashboard-run-status-running,
.dashboard-run-status-queued {
  background: rgba(120, 169, 255, 0.18);
  color: #9dc0ff;
}

.dashboard-run-status-failed,
.dashboard-run-status-cancelled {
  background: rgba(255, 125, 125, 0.18);
  color: #ff9a9a;
}

.dashboard-outline {
  margin-top: 22px;
  padding: 28px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    rgba(127, 127, 127, 0.04);
}

.dashboard-outline-note {
  margin: 8px 0 0;
  opacity: 0.76;
}

.dashboard-outline-tree {
  display: grid;
  gap: 18px;
}

.dashboard-act {
  border-radius: 22px;
  border: 1px solid rgba(127, 127, 127, 0.16);
  background:
    radial-gradient(circle at top right, rgba(255, 188, 117, 0.1), transparent 28%),
    rgba(127, 127, 127, 0.04);
  overflow: hidden;
}

.dashboard-act-details {
  padding: 14px;
}

.dashboard-act-summary {
  margin: 0;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.dashboard-chapter-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.dashboard-chapter-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(127, 127, 127, 0.14);
  background: rgba(8, 14, 28, 0.2);
}

.dashboard-chapter-row,
.dashboard-scene-row {
  margin: 0;
  padding: 0;
}

.dashboard-chapter-title {
  font-weight: 700;
}

.dashboard-scene-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.dashboard-scene-item {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(127, 127, 127, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.auth-main {
  max-width: 1180px;
  padding-top: 40px;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 460px);
  gap: 24px;
  align-items: stretch;
}

.auth-story,
.auth-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(127, 127, 127, 0.18);
  border-radius: 28px;
  min-height: 620px;
}

.auth-story {
  padding: 36px;
  background:
    radial-gradient(circle at top left, rgba(90, 140, 255, 0.3), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 188, 117, 0.18), transparent 30%),
    linear-gradient(155deg, rgba(11, 16, 31, 0.96), rgba(23, 12, 33, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 28px 60px rgba(0, 0, 0, 0.18);
}

.auth-story::before,
.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-story::before {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 34%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 28px
    );
  opacity: 0.7;
}

.auth-story-copy,
.auth-story-grid,
.auth-panel-inner {
  position: relative;
  z-index: 1;
}

.auth-story-copy {
  max-width: 560px;
}

.auth-kicker {
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.72;
}

.auth-story h1,
.auth-header h2 {
  margin: 0;
  line-height: 1.02;
}

.auth-story h1 {
  max-width: 9ch;
  font-size: clamp(42px, 7vw, 74px);
  letter-spacing: -0.04em;
}

.auth-lead {
  max-width: 520px;
  margin: 18px 0 0;
  font-size: 18px;
  opacity: 0.84;
}

.projects-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  padding: 32px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(255, 188, 117, 0.16), transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(90, 140, 255, 0.18), transparent 34%),
    linear-gradient(160deg, rgba(19, 21, 28, 0.96), rgba(11, 16, 31, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 28px 60px rgba(0, 0, 0, 0.14);
}

.projects-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.05), transparent 34%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 32px
    );
}

.projects-hero-copy,
.projects-hero-stats {
  position: relative;
  z-index: 1;
}

.projects-kicker {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.72;
}

.projects-hero-lead {
  max-width: 46ch;
  margin: 0;
  font-size: 17px;
  opacity: 0.82;
}

.projects-hero-actions {
  margin-top: 22px;
}

.projects-hero-stats {
  display: grid;
  gap: 14px;
  align-content: center;
}

.projects-stat {
  padding: 18px 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
}

.projects-stat strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.projects-stat-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
}

.projects-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
  align-items: start;
}

.project-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(127, 127, 127, 0.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(90, 140, 255, 0.12), transparent 32%),
    rgba(127, 127, 127, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 34px rgba(0, 0, 0, 0.08);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(90, 140, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 20px 40px rgba(0, 0, 0, 0.12);
}

.project-card-collapsible {
  display: block;
}

.project-card-summary-toggle {
  display: grid;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.project-card-summary-toggle::-webkit-details-marker {
  display: none;
}

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

.project-card-date {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.68;
}

.project-card-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.project-card-slug {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.7;
}

.project-card-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(90, 140, 255, 0.38);
  background: rgba(90, 140, 255, 0.16);
  font-weight: 700;
  white-space: nowrap;
}

.project-card-open::after {
  content: "Expand";
}

.project-card[open] .project-card-open {
  background: rgba(255, 188, 117, 0.16);
  border-color: rgba(255, 188, 117, 0.34);
}

.project-card[open] .project-card-open::after {
  content: "Collapse";
}

.project-card:not([open]) .project-card-date,
.project-card:not([open]) .project-card-slug,
.project-card:not([open]) .project-card-open,
.project-card:not([open]) .project-card-metrics {
  display: none;
}

.project-card:not([open]) .project-card-summary-toggle {
  gap: 0;
}

.project-card:not([open]) .project-card-head {
  display: block;
}

.project-card-body {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(127, 127, 127, 0.16);
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(127, 127, 127, 0.24);
  background: rgba(127, 127, 127, 0.08);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.project-tag-strong {
  border-color: rgba(255, 188, 117, 0.28);
  background: rgba(255, 188, 117, 0.14);
}

.project-card-summary {
  margin: 0;
  min-height: 72px;
  opacity: 0.84;
}

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

.project-metric {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(127, 127, 127, 0.16);
  background: rgba(127, 127, 127, 0.05);
}

.project-metric strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.project-metric span {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  opacity: 0.74;
}

.project-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.project-card-actions-primary {
  display: block;
}

.project-card-dashboard-link {
  box-sizing: border-box;
  display: inline-flex;
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  font-size: 16px;
}

.project-card-actions form {
  display: flex;
  margin: 0;
}

.project-card-actions form .btn {
  width: 100%;
}

.projects-empty {
  margin-top: 24px;
  padding: 34px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(90, 140, 255, 0.14), transparent 26%),
    radial-gradient(circle at bottom left, rgba(255, 188, 117, 0.12), transparent 24%),
    rgba(127, 127, 127, 0.05);
}

.projects-empty-title {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.projects-empty-copy {
  max-width: 46ch;
  margin: 0 0 18px;
  opacity: 0.8;
}

.auth-story-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.auth-story-card {
  padding: 18px 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-story-card-feature {
  grid-column: 1 / -1;
  min-height: 160px;
  background:
    linear-gradient(135deg, rgba(90, 140, 255, 0.2), transparent 65%),
    rgba(255, 255, 255, 0.07);
}

.auth-story-card strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}

.auth-story-card p {
  margin-top: 10px;
  max-width: 44ch;
  opacity: 0.78;
}

.auth-story-label {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-panel {
  background:
    radial-gradient(circle at top, rgba(90, 140, 255, 0.12), transparent 34%),
    rgba(19, 21, 28, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 20px 44px rgba(0, 0, 0, 0.14);
}

.auth-panel::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 22%),
    radial-gradient(circle at 80% 0, rgba(255, 188, 117, 0.09), transparent 28%);
}

.auth-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 34px 30px;
}

.auth-header {
  margin-bottom: 22px;
}

.auth-header h2 {
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: -0.04em;
}

.auth-subtitle {
  margin-top: 12px;
  max-width: 34ch;
}

.auth-form {
  display: grid;
  gap: 16px;
}

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

.auth-panel .form-label {
  font-size: 14px;
}

.auth-panel input[type="text"],
.auth-panel input[type="password"],
.auth-panel input[type="email"] {
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-panel input[type="text"]:focus,
.auth-panel input[type="password"]:focus,
.auth-panel input[type="email"]:focus {
  outline: 2px solid rgba(90, 140, 255, 0.6);
  outline-offset: 2px;
  border-color: rgba(90, 140, 255, 0.5);
}

.auth-inline-link,
.auth-subtitle a {
  color: #c7d8ff;
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.auth-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: rgba(90, 140, 255, 0.95);
}

.auth-help {
  margin-top: -2px;
}

.auth-submit {
  min-height: 52px;
  margin-top: 6px;
  border-radius: 14px;
  font-size: 15px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: rgba(243, 244, 246, 0.65);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.auth-alt-actions {
  display: grid;
  gap: 10px;
}

.auth-alt-button {
  min-height: 48px;
  border-radius: 14px;
}

.auth-social {
  margin-top: 12px;
}

.auth-social h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.auth-social ul {
  list-style: none;
  padding-left: 0;
}

.auth-social a,
.auth-social button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(127, 127, 127, 0.35);
  background: rgba(127, 127, 127, 0.12);
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}

.auth-social a:hover,
.auth-social button:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

@media (prefers-color-scheme: light) {
  .projects-hero {
    background:
      radial-gradient(circle at top left, rgba(255, 188, 117, 0.2), transparent 28%),
      radial-gradient(circle at 85% 20%, rgba(90, 140, 255, 0.18), transparent 34%),
      linear-gradient(160deg, rgba(255, 252, 247, 0.98), rgba(245, 247, 255, 0.96));
    color: #101114;
  }

  .projects-hero::before {
    background:
      linear-gradient(120deg, rgba(255, 255, 255, 0.36), transparent 34%),
      repeating-linear-gradient(
        90deg,
        rgba(16, 17, 20, 0.03) 0,
        rgba(16, 17, 20, 0.03) 1px,
        transparent 1px,
        transparent 32px
      );
  }

  .projects-stat {
    border-color: rgba(16, 17, 20, 0.08);
    background: rgba(255, 255, 255, 0.56);
  }

  .project-card {
    background:
      radial-gradient(circle at top right, rgba(90, 140, 255, 0.08), transparent 32%),
      rgba(255, 255, 255, 0.84);
  }

  .project-tag {
    background: rgba(16, 17, 20, 0.04);
  }

  .project-metric {
    background: rgba(16, 17, 20, 0.03);
  }

  .projects-empty {
    background:
      radial-gradient(circle at top right, rgba(90, 140, 255, 0.12), transparent 26%),
      radial-gradient(circle at bottom left, rgba(255, 188, 117, 0.14), transparent 24%),
      rgba(255, 255, 255, 0.88);
  }

  .auth-story {
    background:
      radial-gradient(circle at top left, rgba(90, 140, 255, 0.22), transparent 34%),
      radial-gradient(circle at bottom right, rgba(255, 188, 117, 0.18), transparent 30%),
      linear-gradient(155deg, rgba(246, 247, 255, 0.98), rgba(245, 240, 237, 0.96));
    color: #101114;
  }

  .auth-story::before {
    background:
      linear-gradient(120deg, rgba(255, 255, 255, 0.55), transparent 34%),
      repeating-linear-gradient(
        0deg,
        rgba(16, 17, 20, 0.035) 0,
        rgba(16, 17, 20, 0.035) 1px,
        transparent 1px,
        transparent 28px
      );
  }

  .auth-story-card {
    border-color: rgba(16, 17, 20, 0.08);
    background: rgba(255, 255, 255, 0.52);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }

  .auth-story-label {
    background: rgba(16, 17, 20, 0.06);
  }

  .auth-panel {
    background:
      radial-gradient(circle at top, rgba(90, 140, 255, 0.16), transparent 34%),
      rgba(255, 255, 255, 0.84);
    color: #101114;
  }

  .auth-divider {
    color: rgba(16, 17, 20, 0.52);
  }

  .auth-divider::before,
  .auth-divider::after {
    background: rgba(16, 17, 20, 0.1);
  }

  .auth-inline-link,
  .auth-subtitle a {
    color: #3157c8;
  }

  .auth-panel input[type="text"],
  .auth-panel input[type="password"],
  .auth-panel input[type="email"] {
    border-color: rgba(16, 17, 20, 0.1);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  }
}

@media (max-width: 900px) {
  .page-grid-2 {
    grid-template-columns: 1fr;
  }

  .page-hero-head,
  .page-panel-head {
    flex-direction: column;
  }

  .token-usage-model-panel,
  .token-usage-model-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .token-usage-model-form {
    min-width: 0;
    width: 100%;
  }

  .dashboard-hero,
  .dashboard-content-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-panel-head,
  .dashboard-outline-head,
  .dashboard-act-summary {
    flex-direction: column;
  }

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

  .projects-hero {
    grid-template-columns: 1fr;
  }

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

  .auth-main {
    padding-top: 24px;
  }

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

  .auth-story,
  .auth-panel {
    min-height: auto;
  }

  .auth-story {
    padding: 28px 24px;
  }

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

  .auth-story-card-feature {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .page-hero,
  .page-panel {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .page-title {
    font-size: 36px;
  }

  .page-summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero,
  .dashboard-panel,
  .dashboard-outline {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .dashboard-title {
    font-size: 38px;
  }

  .dashboard-progress-value {
    font-size: 48px;
  }

  .dashboard-mini-facts,
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-run-item,
  .dashboard-scene-item,
  .dashboard-chapter-card {
    padding: 14px;
  }

  .projects-hero,
  .projects-empty {
    padding: 24px 18px;
    border-radius: 22px;
  }

  .project-card {
    padding: 18px;
    border-radius: 18px;
  }

  .project-card-head {
    flex-direction: column;
  }

  .project-card-open {
    width: 100%;
  }

  .project-card-title {
    font-size: 24px;
  }

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

  .project-card-actions .btn {
    flex: 1 1 calc(50% - 10px);
  }

  .project-card-actions form {
    flex: 1 1 calc(50% - 10px);
  }

  .auth-story,
  .auth-panel {
    border-radius: 22px;
  }

  .auth-panel-inner {
    padding: 26px 18px;
  }

  .auth-story h1 {
    max-width: 11ch;
    font-size: clamp(34px, 14vw, 52px);
  }

  .auth-lead {
    font-size: 16px;
  }
}
