:root {
  color-scheme: dark;
  --bg: #08111f;
  --bg-deep: #050b14;
  --surface: #101b2d;
  --surface-2: #15243a;
  --surface-3: #1c2e47;
  --line: rgba(157, 182, 214, 0.16);
  --line-strong: rgba(157, 182, 214, 0.28);
  --text: #f3f8ff;
  --muted: #9cafc7;
  --subtle: #71859f;
  --mint: #72e2bc;
  --mint-strong: #42c89d;
  --blue: #65aefb;
  --purple: #a892ff;
  --amber: #f6c76d;
  --danger: #ff7e8e;
  --success: #67d9a8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --sidebar-width: 252px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef4fa;
  --bg-deep: #e7eef7;
  --surface: #ffffff;
  --surface-2: #f7faff;
  --surface-3: #edf3fa;
  --line: rgba(28, 50, 79, 0.12);
  --line-strong: rgba(28, 50, 79, 0.22);
  --text: #14243a;
  --muted: #5b6f89;
  --subtle: #7d8ea3;
  --shadow: 0 22px 55px rgba(55, 82, 113, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 90% 5%, rgba(101, 174, 251, 0.09), transparent 32rem),
    radial-gradient(circle at 7% 85%, rgba(114, 226, 188, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

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

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

a {
  color: inherit;
}

button {
  border: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(101, 174, 251, 0.5);
  outline-offset: 2px;
}

::selection {
  background: rgba(114, 226, 188, 0.28);
}

.noscript {
  margin: 2rem;
  padding: 1rem;
  border: 1px solid var(--danger);
  border-radius: 12px;
  background: var(--surface);
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-deep) 92%, transparent);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 4px 7px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(114, 226, 188, 0.3);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(114, 226, 188, 0.25), rgba(101, 174, 251, 0.18));
  color: var(--mint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 10px 22px rgba(0, 0, 0, 0.2);
  font-size: 20px;
  font-weight: 900;
}

.brand-mark::after {
  position: absolute;
  right: -8px;
  bottom: -9px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: rgba(101, 174, 251, 0.16);
  content: "";
}

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

.brand-name {
  display: block;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  display: block;
  margin-top: -2px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.nav-label {
  margin: 30px 10px 9px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.primary-nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  transition: 160ms ease;
}

.nav-item:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.nav-item.active {
  border-color: rgba(114, 226, 188, 0.18);
  background: linear-gradient(90deg, rgba(114, 226, 188, 0.15), rgba(101, 174, 251, 0.07));
  color: var(--text);
  box-shadow: inset 3px 0 var(--mint);
}

.nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: currentColor;
  font-size: 17px;
}

.sidebar-spacer {
  flex: 1;
}

.privacy-card {
  padding: 13px;
  border: 1px solid rgba(114, 226, 188, 0.16);
  border-radius: 14px;
  background: rgba(114, 226, 188, 0.06);
}

.privacy-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
}

.privacy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(103, 217, 168, 0.1);
}

.privacy-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.sidebar-footer {
  display: grid;
  gap: 5px;
  padding: 16px 8px 0;
  color: var(--subtle);
  font-size: 10px;
}

.sidebar-footer a {
  width: fit-content;
  color: var(--muted);
  text-underline-offset: 3px;
}

.sidebar-footer a:hover {
  color: var(--text);
}

.main-shell {
  min-height: 100vh;
  min-height: 100dvh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(20px, 4vw, 50px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(20px);
}

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

.topbar-title strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--subtle);
  font-size: 11px;
}

.save-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  content: "";
}

.save-status.warning::before {
  background: var(--amber);
}

.topbar-actions,
.hero-actions,
.button-row,
.card-actions,
.filter-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.page-content {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: clamp(25px, 4vw, 52px);
}

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 20px;
  height: 1px;
  background: var(--mint);
  content: "";
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1.06;
}

.hero-copy {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  line-height: 1;
  text-decoration: none;
  transition: 150ms ease;
}

.button:hover:not(:disabled) {
  border-color: rgba(114, 226, 188, 0.42);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--mint-strong), #58b6dd);
  color: #06151a;
  box-shadow: 0 11px 24px rgba(66, 200, 157, 0.18);
}

.button.subtle {
  background: transparent;
}

.button.danger {
  border-color: rgba(255, 126, 142, 0.24);
  color: var(--danger);
}

.button.small {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 11px;
}

.button.icon-only {
  width: 42px;
  padding: 0;
  font-size: 16px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card {
  min-height: 112px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface-2) 78%, transparent));
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.09);
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.metric-value {
  margin-top: 10px;
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.metric-note {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 10px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 820;
}

.panel-description {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 11px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(130px, 180px));
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 58%, transparent);
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > label,
.field-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.field-hint {
  margin: -2px 0 0;
  color: var(--subtle);
  font-size: 10px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--bg-deep);
  color: var(--text);
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

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

.textarea {
  min-height: 96px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.55;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--subtle);
  opacity: 0.8;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(101, 174, 251, 0.68);
  box-shadow: 0 0 0 4px rgba(101, 174, 251, 0.09);
  outline: 0;
}

.search-field {
  position: relative;
}

.search-field .input {
  padding-left: 39px;
}

.search-field::before {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  color: var(--subtle);
  content: "⌕";
  font-size: 19px;
  transform: translateY(-53%);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 22px 24px;
}

.character-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(150deg, var(--surface-2), color-mix(in srgb, var(--surface) 93%, transparent));
  transition: 170ms ease;
}

.character-card:hover {
  border-color: rgba(101, 174, 251, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.character-card.hidden-character {
  opacity: 0.62;
}

.character-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--mint), var(--blue), transparent);
  content: "";
  opacity: 0.65;
}

.character-card-body {
  padding: 18px;
}

.character-head {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.avatar {
  position: relative;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    radial-gradient(circle at 60% 30%, rgba(114, 226, 188, 0.32), transparent 42%),
    linear-gradient(145deg, #18314a, #102033);
  color: #d9fff1;
  font-size: 24px;
  font-weight: 900;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.avatar.small-avatar {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 16px;
}

.character-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.character-name {
  overflow: hidden;
  font-size: 17px;
  font-weight: 840;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.badges,
.share-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badges {
  margin-top: 9px;
}

.badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge.mint {
  border-color: rgba(114, 226, 188, 0.2);
  background: rgba(114, 226, 188, 0.09);
  color: var(--mint);
}

.badge.blue {
  border-color: rgba(101, 174, 251, 0.2);
  background: rgba(101, 174, 251, 0.09);
  color: var(--blue);
}

.badge.amber {
  border-color: rgba(246, 199, 109, 0.2);
  background: rgba(246, 199, 109, 0.09);
  color: var(--amber);
}

.character-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.mini-stat {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-deep) 70%, transparent);
}

.mini-stat span {
  display: block;
  color: var(--subtle);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mini-stat strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  color: var(--subtle);
  font-size: 9px;
}

.source-line a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
  text-underline-offset: 2px;
}

.character-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 13px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.06);
}

.character-card-footer .button {
  flex: 1;
  min-width: 0;
}

.empty-state {
  display: grid;
  min-height: 310px;
  place-items: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-state-inner {
  max-width: 440px;
}

.empty-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-2);
  color: var(--mint);
  font-size: 29px;
}

.empty-state h2 {
  margin: 0;
  font-size: 19px;
}

.empty-state p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(246, 199, 109, 0.2);
  border-radius: 13px;
  background: rgba(246, 199, 109, 0.07);
  color: var(--muted);
  font-size: 11px;
}

.notice strong {
  color: var(--amber);
}

.notice.error {
  border-color: rgba(255, 126, 142, 0.22);
  background: rgba(255, 126, 142, 0.07);
}

.notice.error strong {
  color: var(--danger);
}

.listing-layout {
  display: grid;
  grid-template-columns: minmax(390px, 0.86fr) minmax(520px, 1.14fr);
  gap: 22px;
  align-items: start;
}

.editor-column {
  display: grid;
  gap: 16px;
}

.editor-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 820;
}

.section-body {
  display: grid;
  gap: 14px;
  padding: 17px 18px 19px;
}

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

.field.full {
  grid-column: 1 / -1;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.switch-copy strong {
  display: block;
  font-size: 12px;
}

.switch-copy span {
  display: block;
  margin-top: 2px;
  color: var(--subtle);
  font-size: 9px;
}

.switch {
  position: relative;
  width: 44px;
  height: 25px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  cursor: pointer;
  transition: 150ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: 150ms ease;
}

.switch input:checked + .switch-track {
  border-color: rgba(114, 226, 188, 0.45);
  background: rgba(114, 226, 188, 0.18);
}

.switch input:checked + .switch-track::after {
  background: var(--mint);
  transform: translateX(19px);
}

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

.selected-editor {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.selected-editor summary {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
}

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

.selected-summary-copy {
  min-width: 0;
  flex: 1;
}

.selected-summary-copy strong,
.selected-summary-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-summary-copy strong {
  font-size: 12px;
}

.selected-summary-copy span {
  color: var(--subtle);
  font-size: 9px;
}

.summary-chevron {
  color: var(--subtle);
  transition: 150ms ease;
}

.selected-editor[open] .summary-chevron {
  transform: rotate(180deg);
}

.selected-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  padding: 13px;
  border-top: 1px solid var(--line);
}

.selected-fields .full {
  grid-column: 1 / -1;
}

.selected-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}

.preview-column {
  min-width: 0;
}

.preview-sticky {
  position: sticky;
  top: 92px;
}

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

.preview-toolbar strong {
  font-size: 12px;
}

.preview-toolbar span {
  color: var(--subtle);
  font-size: 9px;
}

.share-stage {
  position: relative;
  width: 100%;
  min-height: 480px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(-45deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%) 0 0 / 18px 18px,
    var(--bg-deep);
  box-shadow: var(--shadow);
}

.share-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 920px;
  min-height: 620px;
  overflow: hidden;
  transform: scale(var(--preview-scale, 0.7));
  transform-origin: top left;
  background:
    radial-gradient(circle at 84% 4%, rgba(70, 181, 201, 0.2), transparent 290px),
    radial-gradient(circle at 5% 95%, rgba(110, 104, 210, 0.16), transparent 260px),
    #0a1321;
  color: #f4f9ff;
  font-family: var(--font);
}

.share-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.share-card-inner {
  position: relative;
  z-index: 1;
  padding: 54px 56px 34px;
}

.share-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 27px;
  border-bottom: 1px solid rgba(196, 220, 244, 0.14);
}

.share-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
  color: #7ee6c2;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.15em;
}

.share-kicker::before {
  width: 27px;
  height: 1px;
  background: #7ee6c2;
  content: "";
}

.share-title {
  max-width: 620px;
  margin: 0;
  font-size: 38px;
  font-weight: 880;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.share-subtitle {
  margin-top: 11px;
  color: #91a9c2;
  font-size: 12px;
}

.server-seal {
  display: grid;
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(126, 230, 194, 0.32);
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(126, 230, 194, 0.16), rgba(101, 174, 251, 0.1));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.server-seal strong {
  display: block;
  color: #7ee6c2;
  font-size: 19px;
  text-align: center;
}

.server-seal span {
  display: block;
  margin-top: -3px;
  color: #6f879f;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-align: center;
}

.share-meta-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin: 21px 0;
}

.share-meta-box {
  min-height: 57px;
  padding: 11px 14px;
  border: 1px solid rgba(196, 220, 244, 0.11);
  border-radius: 13px;
  background: rgba(17, 31, 50, 0.72);
}

.share-meta-box span {
  display: block;
  color: #6f879f;
  font-size: 8px;
  font-weight: 820;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.share-meta-box strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: #eef7ff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.share-character {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(196, 220, 244, 0.11);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(19, 37, 59, 0.91), rgba(13, 26, 43, 0.94));
}

.share-character.main-role {
  border-color: rgba(126, 230, 194, 0.27);
  background: linear-gradient(145deg, rgba(25, 56, 64, 0.91), rgba(13, 28, 44, 0.96));
}

.share-character-top {
  display: grid;
  grid-template-columns: 67px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
}

.share-avatar {
  display: grid;
  width: 67px;
  height: 67px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(196, 220, 244, 0.16);
  border-radius: 17px;
  background: radial-gradient(circle at 60% 30%, rgba(126, 230, 194, 0.3), transparent 45%), #142b42;
  color: #c9ffed;
  font-size: 23px;
  font-weight: 900;
}

.share-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.share-avatar.anonymous-avatar {
  font-size: 17px;
  letter-spacing: 0.03em;
}

.share-role-label {
  margin-bottom: 3px;
  color: #7ee6c2;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.share-character-name {
  overflow: hidden;
  font-size: 17px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-character-meta {
  margin-top: 2px;
  color: #8ba2ba;
  font-size: 10px;
}

.share-character-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.share-stat {
  min-width: 0;
  padding: 8px;
  border-radius: 9px;
  background: rgba(7, 17, 29, 0.56);
}

.share-stat span,
.share-stat strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-stat span {
  color: #687f98;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.share-stat strong {
  margin-top: 2px;
  font-size: 9px;
}

.share-tags {
  margin-top: 11px;
}

.share-tag {
  max-width: 100%;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid rgba(196, 220, 244, 0.09);
  border-radius: 999px;
  background: rgba(101, 174, 251, 0.07);
  color: #9db2c8;
  font-size: 7px;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-extra {
  display: -webkit-box;
  margin-top: 10px;
  overflow: hidden;
  color: #8298af;
  font-size: 8px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.share-notes {
  margin-top: 14px;
  padding: 15px 17px;
  border: 1px solid rgba(196, 220, 244, 0.1);
  border-radius: 14px;
  background: rgba(11, 24, 39, 0.72);
}

.share-notes-label {
  color: #7ee6c2;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.share-notes p {
  margin: 6px 0 0;
  color: #9bb0c5;
  font-size: 9px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.share-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid rgba(196, 220, 244, 0.1);
  color: #637a92;
  font-size: 8px;
}

.share-empty {
  display: grid;
  min-height: 245px;
  place-items: center;
  border: 1px dashed rgba(196, 220, 244, 0.14);
  border-radius: 17px;
  color: #73899f;
  font-size: 11px;
  text-align: center;
}

.dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(88vh, 850px);
  max-height: min(88dvh, 850px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.52);
}

.dialog::backdrop {
  background: rgba(2, 7, 14, 0.72);
  backdrop-filter: blur(6px);
}

.dialog-shell {
  display: flex;
  max-height: inherit;
  flex-direction: column;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0;
  font-size: 18px;
}

.dialog-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.dialog-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.dialog-body {
  overflow-y: auto;
  padding: 20px 22px;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

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

.dialog-grid .full {
  grid-column: 1 / -1;
}

.query-status {
  display: none;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}

.query-status.visible {
  display: flex;
}

.query-status.success {
  border-color: rgba(103, 217, 168, 0.22);
  color: var(--success);
}

.query-status.error {
  border-color: rgba(255, 126, 142, 0.22);
  color: var(--danger);
}

.spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid rgba(101, 174, 251, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.selection-list {
  display: grid;
  gap: 8px;
}

.selection-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  cursor: pointer;
}

.selection-item:hover {
  border-color: rgba(101, 174, 251, 0.3);
}

.selection-item input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--mint-strong);
}

.selection-copy {
  min-width: 0;
  flex: 1;
}

.selection-copy strong,
.selection-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-copy strong {
  font-size: 12px;
}

.selection-copy span {
  color: var(--subtle);
  font-size: 9px;
}

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

.data-action-card {
  display: grid;
  min-height: 126px;
  align-content: space-between;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.data-action-card h3 {
  margin: 0;
  font-size: 13px;
}

.data-action-card p {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 9px;
}

.storage-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 126, 142, 0.22);
  border-radius: 13px;
  background: rgba(255, 126, 142, 0.07);
  color: var(--muted);
  font-size: 11px;
}

.toast-region {
  position: fixed;
  z-index: 9999;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 11px;
  line-height: 1.45;
  pointer-events: auto;
  animation: toast-in 180ms ease-out;
  backdrop-filter: blur(15px);
}

.toast.success {
  border-color: rgba(103, 217, 168, 0.28);
}

.toast.error {
  border-color: rgba(255, 126, 142, 0.34);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.mobile-nav {
  display: none;
}

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

@media (max-width: 1240px) {
  .character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .listing-layout {
    grid-template-columns: 1fr;
  }

  .preview-sticky {
    position: static;
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    display: none;
  }

  .main-shell {
    margin-left: 0;
    padding-bottom: 75px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 100;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    border: 1px solid var(--line-strong);
    border-radius: 17px;
    background: color-mix(in srgb, var(--bg-deep) 91%, transparent);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
  }

  .mobile-nav .nav-item {
    justify-content: center;
    min-height: 45px;
  }

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

@media (max-width: 680px) {
  body {
    font-size: 14px;
  }

  .topbar {
    min-height: 61px;
    padding: 0 15px;
  }

  .topbar-actions .button:not(.icon-only) span {
    display: none;
  }

  .page-content {
    padding: 22px 14px 28px;
  }

  .page-hero {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 21px;
  }

  .hero-actions .button {
    flex: 1;
  }

  h1 {
    font-size: 32px;
  }

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

  .metric-card {
    min-height: 97px;
    padding: 14px;
  }

  .metric-value {
    font-size: 22px;
  }

  .panel-header {
    align-items: flex-start;
    padding: 16px;
  }

  .toolbar {
    grid-template-columns: 1fr;
    padding: 13px 15px;
  }

  .character-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .field-grid,
  .selected-fields,
  .dialog-grid,
  .data-actions {
    grid-template-columns: 1fr;
  }

  .field.full,
  .selected-fields .full,
  .selected-actions,
  .dialog-grid .full {
    grid-column: auto;
  }

  .selected-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .share-stage {
    min-height: 380px;
  }

  .dialog-header,
  .dialog-body,
  .dialog-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .dialog-footer .button {
    flex: 1;
  }

  .storage-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .toast-region {
    right: 16px;
    bottom: 87px;
    left: 16px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .editor-column,
  .preview-toolbar,
  .mobile-nav,
  .toast-region {
    display: none !important;
  }

  .main-shell,
  .page-content {
    margin: 0;
    padding: 0;
  }

  .listing-layout {
    display: block;
  }

  .share-stage {
    border: 0;
  }
}
