:root {
  --font-body: "Noto Sans", "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Roobert PRO Medium", "Aptos Display", "Segoe UI Variable Display", sans-serif;
  --body-background:
    radial-gradient(circle at 10% 12%, rgba(255, 198, 198, 0.42), transparent 18%),
    radial-gradient(circle at 86% 14%, rgba(195, 250, 245, 0.42), transparent 18%),
    radial-gradient(circle at 16% 84%, rgba(255, 230, 205, 0.32), transparent 18%),
    linear-gradient(180deg, #ffffff 0%, #fffdfb 100%);
  --text: #1c1c1e;
  --text-soft: #555a6a;
  --text-faint: #8b90a0;
  --interactive: #5b76fe;
  --interactive-pressed: #2a41b6;
  --success: #00b473;
  --danger: #8f3434;
  --warn: #946200;
  --ring: rgb(224, 226, 232);
  --border: #c7cad5;
  --border-soft: #e9eaef;
  --panel-background: #ffffff;
  --panel-shadow: 0 0 0 1px var(--ring), 0 16px 40px rgba(28, 28, 30, 0.06);
  --card-shadow: 0 0 0 1px var(--ring);
  --surface-muted: #f7f8fb;
  --surface-white: #ffffff;
  --surface-coral: #ffc6c6;
  --surface-teal: #c3faf5;
  --surface-rose: #ffd8f4;
  --surface-orange: #ffe6cd;
  --surface-blue-soft: #eef2ff;
  --surface-success: #ecfbf4;
  --surface-danger: #fff2f2;
  --surface-warn: #fff7eb;
  --radius-panel: 40px;
  --radius-card: 24px;
  --radius-control: 12px;
  --hero-max-width: 980px;
  --hero-title-size: clamp(32px, 2.8vw, 42px);
  --hero-title-spacing: -0.06em;
  --hero-subtitle-width: 760px;
  --eyebrow-background: #f1f4ff;
  --eyebrow-color: var(--interactive);
  --theme-switch-background: rgba(255, 255, 255, 0.8);
  --theme-switch-border: rgba(224, 226, 232, 0.9);
  --theme-button-text: var(--text-soft);
  --theme-button-background: transparent;
  --theme-button-active-background: var(--interactive);
  --theme-button-active-text: #ffffff;
  --theme-button-active-shadow: none;
  --theme-button-hover-background: rgba(91, 118, 254, 0.08);
  --theme-button-hover-color: var(--interactive);
  --pill-background: #ffffff;
  --pill-text: var(--text);
  --pill-shadow: var(--card-shadow);
  --upload-background: var(--surface-coral);
  --history-background: var(--surface-teal);
  --upload-badge-background: rgba(255, 255, 255, 0.82);
  --upload-badge-color: var(--interactive);
  --upload-tag-background: rgba(255, 255, 255, 0.78);
  --upload-tag-color: var(--interactive);
  --upload-file-background: rgba(255, 255, 255, 0.84);
  --upload-file-color: var(--text-soft);
  --upload-hint-color: rgba(28, 28, 30, 0.72);
  --section-muted-color: rgba(28, 28, 30, 0.72);
  --file-name-inset-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
  --control-background: #ffffff;
  --control-border: var(--border-soft);
  --button-primary-background: var(--interactive);
  --button-primary-hover: var(--interactive-pressed);
  --button-primary-text: #ffffff;
  --button-secondary-background: transparent;
  --button-secondary-border: var(--border);
  --button-secondary-hover-background: #f6f7fb;
  --button-secondary-text: var(--text);
  --danger-border-color: rgba(217, 177, 177, 0.92);
  --status-default-background: var(--surface-muted);
  --status-default-text: var(--text-soft);
  --status-loading-background: var(--surface-blue-soft);
  --status-loading-text: var(--interactive-pressed);
  --status-success-background: var(--surface-success);
  --status-success-text: #007d50;
  --status-error-background: var(--surface-danger);
  --status-error-text: var(--danger);
  --summary-card-background: #ffffff;
  --summary-bar-default: #dfe5ff;
  --summary-bar-accent: #c3faf5;
  --summary-bar-danger: #ffc6c6;
  --preview-card-background: #ffffff;
  --code-background:
    linear-gradient(180deg, rgba(91, 118, 254, 0.05), rgba(91, 118, 254, 0.02)),
    #f7f8fb;
  --code-inset-shadow: inset 0 0 0 1px rgba(91, 118, 254, 0.08);
  --code-text: var(--text);
  --lint-badge-background: var(--surface-danger);
  --lint-badge-text: var(--danger);
  --empty-background: rgba(255, 255, 255, 0.7);
  --empty-shadow: inset 0 0 0 1px rgba(28, 28, 30, 0.06);
  --history-ok-color: #007d50;
  --focus-outline: 3px solid rgba(91, 118, 254, 0.28);
  --result-note-width: 520px;
}

html[data-theme="design"] {
  --body-background:
    radial-gradient(circle at 8% 10%, rgba(255, 214, 244, 0.28), transparent 18%),
    radial-gradient(circle at 92% 16%, rgba(195, 250, 245, 0.32), transparent 16%),
    radial-gradient(circle at 20% 88%, rgba(255, 230, 205, 0.24), transparent 16%),
    linear-gradient(180deg, #ffffff 0%, #fffefe 100%);
  --panel-shadow: 0 0 0 1px var(--ring);
  --card-shadow: 0 0 0 1px var(--ring);
  --radius-panel: 32px;
  --radius-card: 20px;
  --radius-control: 8px;
  --hero-max-width: 1080px;
  --hero-title-size: clamp(36px, 3.4vw, 52px);
  --hero-title-spacing: -0.05em;
  --hero-subtitle-width: 820px;
  --eyebrow-background: #eef2ff;
  --theme-switch-background: #ffffff;
  --theme-switch-border: var(--ring);
  --theme-button-text: #555a6a;
  --theme-button-active-background: #ffffff;
  --theme-button-active-text: var(--interactive);
  --theme-button-active-shadow: inset 0 0 0 1px rgba(91, 118, 254, 0.16);
  --pill-shadow: 0 0 0 1px var(--ring);
  --upload-background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  --history-background: linear-gradient(180deg, #ffffff 0%, #fffdfa 100%);
  --upload-badge-background: #eef2ff;
  --upload-badge-color: var(--interactive);
  --upload-tag-background: #ffffff;
  --upload-tag-color: var(--interactive);
  --upload-file-background: #f7f8fb;
  --upload-file-color: #555a6a;
  --button-secondary-hover-background: #f4f6ff;
  --summary-card-background: #ffffff;
  --preview-card-background: #ffffff;
  --code-background:
    linear-gradient(180deg, rgba(91, 118, 254, 0.04), rgba(91, 118, 254, 0.015)),
    #fafbff;
  --code-inset-shadow: inset 0 0 0 1px rgba(91, 118, 254, 0.1);
  --empty-background: #fafbff;
  --empty-shadow: inset 0 0 0 1px rgba(224, 226, 232, 0.9);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background: var(--body-background);
}

.shell {
  width: min(1280px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 10px;
}

.page-topbar-brand {
  display: flex;
  align-items: center;
}

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

.top-auth-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.top-auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--button-secondary-border);
  border-radius: 999px;
  background: var(--button-secondary-background);
  box-shadow: var(--card-shadow);
  color: var(--button-secondary-text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.top-auth-link:hover {
  background: var(--button-secondary-hover-background);
  color: var(--button-secondary-text);
  transform: translateY(-1px);
}

.top-auth-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.top-auth-chip {
  background: var(--theme-switch-background);
  color: var(--theme-button-text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px var(--theme-switch-border);
  max-width: 144px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-auth-entry-link {
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.top-auth-entry-link:hover {
  background: var(--button-secondary-hover-background);
  color: var(--button-secondary-text);
  transform: translateY(-1px);
}

.panel {
  margin-top: 24px;
  border-radius: var(--radius-panel);
  background: var(--panel-background);
  box-shadow: var(--panel-shadow);
}

.hero-panel,
.form-panel,
.result-panel {
  padding: 28px;
}

.auth-panel {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
  padding: 20px;
  border-radius: var(--radius-card);
  background: var(--surface-muted);
  box-shadow: var(--card-shadow);
}

.auth-page {
  min-height: 100vh;
}

.auth-body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background: var(--body-background);
}

.auth-shell {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  min-height: 100vh;
  padding: 96px 0 32px;
  position: relative;
  display: grid;
  align-items: center;
}

.auth-surface {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.86fr);
  gap: 24px;
  align-items: stretch;
  margin-top: 0;
}

.auth-body .page-topbar {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  z-index: 10;
}

.auth-brand-panel,
.auth-card {
  display: flex;
  min-height: min(720px, calc(100vh - 156px));
  border-radius: var(--radius-panel);
  background: var(--panel-background);
  box-shadow: var(--panel-shadow);
  overflow: hidden;
}

.auth-brand-panel {
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 40px;
}

.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border-soft) 64%, transparent 36%);
  pointer-events: none;
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  right: -84px;
  bottom: -96px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--interactive) 24%, transparent 76%) 0%,
    color-mix(in srgb, var(--interactive) 9%, transparent 91%) 42%,
    transparent 74%
  );
  filter: blur(8px);
  pointer-events: none;
}

.auth-brand-copy,
.auth-brand-points,
.auth-brand-highlights,
.auth-card-inner {
  position: relative;
  z-index: 1;
}

.auth-brand-copy {
  display: grid;
  gap: 18px;
}

.auth-brand-copy h1,
.auth-card-title {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.auth-brand-copy h1 {
  max-width: 11ch;
  font-size: clamp(40px, 4.2vw, 60px);
  font-weight: 520;
}

.auth-brand-copy p,
.auth-card-copy,
.auth-card-note {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.6;
}

.auth-brand-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-brand-points li {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--pill-background);
  box-shadow: var(--pill-shadow);
  font-size: 14px;
  font-weight: 600;
}

.auth-brand-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-brand-highlight {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 156px;
  padding: 18px;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface-muted) 88%, var(--surface-white) 12%);
  box-shadow: var(--card-shadow);
}

.auth-brand-highlight::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border-soft) 78%, transparent 22%);
  pointer-events: none;
}

.auth-brand-highlight-featured {
  grid-column: 1 / -1;
  min-height: 182px;
}

.auth-brand-highlight-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-white) 74%, transparent 26%);
  color: var(--interactive);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-brand-highlight strong {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.auth-brand-highlight p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}

.auth-card {
  padding: 36px;
  align-items: stretch;
}

.auth-card-centered {
  width: 100%;
}

.auth-card-inner {
  display: grid;
  gap: 20px;
  align-content: center;
  width: min(100%, 460px);
  margin: 0 auto;
}

.auth-card-title {
  font-size: clamp(30px, 2.6vw, 44px);
  font-weight: 500;
}

.auth-card-copy-compact {
  font-size: 15px;
}

.auth-card-note {
  padding: 14px 16px;
  border-radius: max(12px, calc(var(--radius-card) - 8px));
  background: color-mix(in srgb, var(--surface-muted) 84%, transparent 16%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border-soft) 78%, transparent 22%);
  font-size: 14px;
  line-height: 1.55;
}

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

.auth-form-stack .field {
  gap: 10px;
}

.auth-form-stack .field span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

.auth-form-stack input {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  box-shadow: none;
}

.auth-form-stack button[type="submit"] {
  width: 100%;
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
}

.auth-form-stack button[type="submit"]:hover:not(:disabled) {
  transform: none;
}

.auth-inline-link {
  color: var(--interactive);
  font-weight: 600;
  text-decoration: none;
}

.auth-inline-link:hover {
  color: var(--interactive-pressed);
}

.auth-status-box {
  margin-top: 0;
}

.auth-body .top-auth-link:hover,
.auth-body button.top-auth-button:hover:not(:disabled) {
  transform: none;
}

.auth-panel-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2vw, 32px);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -0.04em;
}

.auth-copy {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.55;
}

.auth-forms-panel {
  display: grid;
  gap: 14px;
}

.auth-switches,
.auth-form-actions,
.auth-user-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.auth-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-white);
  box-shadow: var(--card-shadow);
}

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

.auth-user-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-white);
  box-shadow: var(--card-shadow);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.hero-copy {
  min-width: 0;
  max-width: var(--hero-max-width);
}

.hero-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.page-theme-bar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.page-theme-switch {
  width: fit-content;
}

.theme-picker {
  position: relative;
}

.theme-picker-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 154px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--theme-switch-background);
  color: var(--theme-button-text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px var(--theme-switch-border);
}

.theme-picker-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.theme-picker-icon {
  position: relative;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 68% 28%, #ffffff 0 9%, transparent 10%),
    conic-gradient(
      from 220deg,
      #ff5f57 0deg 64deg,
      #ffbd2e 64deg 132deg,
      #28c840 132deg 208deg,
      #4c9aff 208deg 286deg,
      #b26bff 286deg 360deg
    );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34), 0 2px 6px rgba(15, 23, 42, 0.14);
}

.theme-picker-icon::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--theme-switch-background) 82%, white 18%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.theme-picker-trigger:hover:not(:disabled) {
  background: var(--theme-button-hover-background);
  color: var(--theme-button-hover-color);
  transform: none;
}

.theme-picker-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--interactive) 55%, white 45%);
  outline-offset: 3px;
}

.theme-picker-caret {
  width: 10px;
  height: 10px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease, margin-top 160ms ease;
}

.theme-picker.is-open .theme-picker-caret {
  margin-top: 4px;
  transform: rotate(-135deg);
}

.theme-picker-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  display: grid;
  gap: 6px;
  min-width: 220px;
  padding: 8px;
  border-radius: 22px;
  background: var(--theme-switch-background);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18), inset 0 0 0 1px var(--theme-switch-border);
  backdrop-filter: blur(18px);
}

.theme-picker-menu[hidden] {
  display: none;
}

.theme-picker-menu .theme-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  border-radius: 14px;
  text-align: left;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--eyebrow-background);
  color: var(--eyebrow-color);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-kicker {
  margin-bottom: 16px;
}

.section-kicker.compact {
  margin-bottom: 10px;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: var(--theme-switch-background);
  box-shadow: inset 0 0 0 1px var(--theme-switch-border);
}

.theme-button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--theme-button-background);
  color: var(--theme-button-text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: none;
}

.theme-button:hover:not(:disabled) {
  background: var(--theme-button-hover-background);
  color: var(--theme-button-hover-color);
  transform: none;
}

.theme-button.is-active,
.theme-button[aria-pressed="true"] {
  background: var(--theme-button-active-background);
  color: var(--theme-button-active-text);
  box-shadow: var(--theme-button-active-shadow);
}

html[data-theme="default"] .theme-button.is-active,
html[data-theme="default"] .theme-button[aria-pressed="true"] {
  background: var(--theme-button-active-background);
  color: var(--theme-button-active-text);
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--hero-title-size);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: var(--hero-title-spacing);
}

.subtitle {
  max-width: var(--hero-subtitle-width);
  margin: 16px 0 0;
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1.5;
}

.hero-meta,
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta {
  margin-top: 22px;
}

.hero-points {
  margin-top: 14px;
}

.meta-pill,
.hero-point {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--pill-background);
  box-shadow: var(--pill-shadow);
  color: var(--pill-text);
  font-size: 14px;
  font-weight: 600;
}

.secondary-pill {
  color: var(--text-soft);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 2.3vw, 40px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.05em;
}

.section-copy {
  max-width: var(--result-note-width);
  margin: 0 0 0 auto;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.55;
  text-align: right;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(320px, 0.78fr);
  gap: 20px;
  align-items: start;
}

.workspace-main {
  display: grid;
  gap: 18px;
}

.upload-card,
.history-section,
.summary-card,
.preview-card,
.lint-item,
.history-item {
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}

.upload-card {
  position: relative;
  display: block;
  padding: 24px;
  background: var(--upload-background);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

html[data-theme="design"] .upload-card {
  border-color: rgba(224, 226, 232, 0.92);
}

.upload-card::after {
  content: "PRD → XMind";
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--upload-tag-background);
  color: var(--upload-tag-color);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.04em;
  box-shadow: var(--card-shadow);
}

.upload-card input {
  display: none;
}

.upload-badge {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--upload-badge-background);
  color: var(--upload-badge-color);
  font-size: 12px;
  font-weight: 700;
}

.upload-title {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.upload-hint {
  display: block;
  max-width: 56ch;
  margin-top: 12px;
  color: var(--upload-hint-color);
  font-size: 15px;
  line-height: 1.55;
}

.upload-runtime-hint {
  display: block;
  margin-top: 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.file-name {
  display: inline-flex;
  margin-top: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--upload-file-background);
  color: var(--upload-file-color);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--file-name-inset-shadow);
}

.upload-card.dragging {
  border-color: var(--interactive);
  transform: translateY(-2px);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
}

.controls-note {
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

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

.field span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

select,
input,
button {
  font: inherit;
}

select,
input {
  min-width: 180px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  background: var(--control-background);
  color: var(--text);
  box-shadow: var(--card-shadow);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

button {
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--button-primary-background);
  color: var(--button-primary-text);
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

button:hover:not(:disabled) {
  background: var(--button-primary-hover);
  transform: translateY(-1px);
}

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

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary,
.ghost {
  background: var(--button-secondary-background);
  border-color: var(--button-secondary-border);
  color: var(--button-secondary-text);
  box-shadow: var(--card-shadow);
}

.secondary:hover:not(:disabled),
.ghost:hover:not(:disabled) {
  background: var(--button-secondary-hover-background);
  border-color: var(--button-secondary-border);
}

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

.danger:hover:not(:disabled) {
  background: var(--surface-danger);
  border-color: var(--danger-border-color);
}

button.top-auth-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--button-secondary-border);
  border-radius: 999px;
  background: var(--button-secondary-background);
  color: var(--button-secondary-text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--card-shadow);
}

button.top-auth-button:hover:not(:disabled) {
  background: var(--button-secondary-hover-background);
  color: var(--button-secondary-text);
  transform: translateY(-1px);
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
.top-auth-link:focus-visible,
.top-auth-entry-link:focus-visible,
.upload-card:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 3px;
}

.status {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--status-default-background);
  box-shadow: var(--card-shadow);
  color: var(--status-default-text);
  font-size: 15px;
  line-height: 1.55;
}

.status[data-state="loading"] {
  background: var(--status-loading-background);
  color: var(--status-loading-text);
}

.status[data-state="success"] {
  background: var(--status-success-background);
  color: var(--status-success-text);
}

.status[data-state="error"] {
  background: var(--status-error-background);
  color: var(--status-error-text);
}

.history-section {
  min-height: 100%;
  padding: 20px;
  background: var(--history-background);
}

html[data-theme="design"] .history-section {
  border: 1px solid rgba(224, 226, 232, 0.92);
}

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

.card-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.history-note {
  margin: 0 0 14px;
  color: var(--section-muted-color);
  font-size: 15px;
  line-height: 1.55;
}

.account-panel {
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.account-panel-active {
  outline: var(--focus-outline);
  outline-offset: 4px;
}

.account-panel-head {
  margin-bottom: 18px;
}

.account-panel-head .section-copy {
  max-width: 780px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 20px;
  align-items: start;
}

.account-card,
.admin-user-item {
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}

.account-card {
  padding: 20px;
  background: var(--surface-white);
  position: relative;
  overflow: hidden;
}

.account-security-card,
.account-admin-card {
  min-height: 100%;
}

.account-card .card-head,
.account-card .history-note {
  position: relative;
  z-index: 1;
}

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

.stack-form .field span {
  text-transform: none;
  letter-spacing: 0.04em;
}

.admin-card-head {
  align-items: center;
}

.admin-toolbar,
.admin-search-row,
.admin-user-actions,
.admin-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-toolbar {
  justify-content: flex-end;
}

.admin-search-row {
  margin-bottom: 14px;
}

.admin-search-row input {
  flex: 1 1 240px;
  min-width: 0;
}

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

.admin-user-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  background: var(--surface-white);
  align-items: start;
}

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

.admin-user-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-user-topline strong {
  font-size: 16px;
}

.admin-user-meta {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.admin-user-note {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}

.admin-user-actions {
  justify-content: flex-end;
  align-content: start;
}

.admin-user-actions button,
.admin-toolbar button,
.admin-search-row button {
  min-height: 44px;
  padding: 0 16px;
  font-size: 15px;
}

.hidden {
  display: none;
}

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

.summary-card {
  position: relative;
  min-height: 120px;
  padding: 18px;
  background: var(--summary-card-background);
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: var(--summary-bar-default);
}

.summary-card:nth-child(2)::before,
.summary-card:nth-child(4)::before {
  background: var(--summary-bar-accent);
}

.summary-card:nth-child(5)::before {
  background: var(--summary-bar-danger);
}

.summary-label {
  display: block;
  color: var(--section-muted-color);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

#summary-title {
  font-size: 22px;
  line-height: 1.32;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 22px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.diagnostics-stack {
  display: grid;
  gap: 18px;
  align-self: start;
}

.diagnostics-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.diagnostics-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.diagnostics-tab {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: none;
}

.diagnostics-tab.is-active {
  background: var(--surface-white);
  color: var(--text-strong);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.diagnostics-panel {
  display: grid;
  gap: 14px;
}

.diagnostics-panel.hidden {
  display: none;
}

.preview-card {
  padding: 20px;
  background: var(--preview-card-background);
}

.lint-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--lint-badge-background);
  color: var(--lint-badge-text);
  font-size: 13px;
  font-weight: 700;
}

.review-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-blue-soft);
  color: var(--interactive-pressed);
  font-size: 13px;
  font-weight: 700;
}

.diagnostics-tab .lint-badge,
.diagnostics-tab .review-badge {
  min-width: 0;
  min-height: 24px;
  padding: 0 8px;
  font-size: 12px;
}

.code-block {
  margin: 0;
  min-height: 620px;
  overflow: auto;
  padding: 20px;
  border-radius: 20px;
  background: var(--code-background);
  box-shadow: var(--code-inset-shadow);
  color: var(--code-text);
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 13.5px;
  line-height: 1.62;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-state {
  padding: 16px;
  border-radius: 16px;
  background: var(--empty-background);
  box-shadow: var(--empty-shadow);
  color: var(--text-soft);
}

.lint-list,
.history-list,
.review-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lint-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.review-list {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

#review-focus-more,
#lint-more {
  width: fit-content;
}

.lint-item,
.history-item,
.review-item {
  background: var(--surface-white);
}

.lint-item {
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.lint-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}

.lint-level {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-danger);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.lint-item code {
  display: block;
  color: var(--interactive-pressed);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.55;
  font-size: 12.5px;
}

.lint-item p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.review-note {
  margin: 0 0 14px;
  color: var(--text-soft);
  line-height: 1.55;
}

.review-item {
  padding: 14px;
  display: grid;
  gap: 10px;
}

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

.review-path {
  color: var(--interactive-pressed);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  line-height: 1.55;
}

.review-priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.review-priority.is-critical {
  background: var(--surface-danger);
  color: var(--danger);
}

.review-priority.is-high {
  background: var(--surface-warn);
  color: var(--warn);
}

.review-priority.is-medium {
  background: var(--surface-blue-soft);
  color: var(--interactive-pressed);
}

.review-short-hint,
.review-action {
  margin: 0;
  line-height: 1.55;
}

.review-short-hint {
  color: var(--text);
  font-weight: 700;
}

.review-action {
  color: var(--text-soft);
}

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

.review-reason {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-success);
  color: var(--history-ok-color);
  font-size: 12px;
  font-weight: 700;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}

.history-main {
  display: grid;
  gap: 6px;
}

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

.history-main strong {
  font-size: 15px;
}

.history-main span {
  color: var(--text-soft);
  line-height: 1.5;
  word-break: break-word;
}

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

.history-actions button {
  min-height: 44px;
  padding: 0 16px;
  font-size: 15px;
}

.history-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.history-badge.current {
  background: var(--surface-blue-soft);
  color: var(--interactive-pressed);
}

.history-badge.source-ok {
  background: var(--surface-success);
  color: var(--history-ok-color);
}

.history-badge.source-missing {
  background: var(--surface-warn);
  color: var(--warn);
}

.history-badge.stale {
  background: var(--surface-danger);
  color: var(--danger);
}

@media (prefers-reduced-motion: no-preference) {
  .panel,
  .upload-card,
  .summary-card,
  .preview-card,
  .history-item,
  .lint-item,
  .review-item,
  .theme-button {
    transition:
      transform 160ms ease,
      background 160ms ease,
      box-shadow 160ms ease,
      border-color 160ms ease,
      color 160ms ease;
  }

  .panel,
  .result-panel.is-updated {
    animation: fade-up 420ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .upload-card:hover,
  .summary-card:hover,
  .preview-card:hover,
  .history-item:hover,
  .lint-item:hover,
  .review-item:hover {
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .workspace-grid,
  .content-grid,
  .section-head,
  .auth-form-grid,
  .auth-surface {
    grid-template-columns: 1fr;
  }

  .section-copy {
    max-width: none;
    margin-left: 0;
    text-align: left;
  }

  .auth-card {
    order: 0;
  }

  .auth-brand-panel {
    order: 1;
    min-height: auto;
  }

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

@media (max-width: 1024px) {
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-topbar {
    align-items: flex-start;
  }

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

@media (max-width: 768px) {
  .shell {
    width: min(100vw - 20px, 1280px);
    padding-top: 10px;
  }

  .auth-shell {
    width: min(100vw - 20px, 1180px);
    padding: 92px 0 20px;
  }

  .hero-panel,
  .form-panel,
  .result-panel,
  .account-panel {
    padding: 20px;
  }

  .review-head {
    flex-direction: column;
  }

  .account-card {
    padding: 18px;
  }

  .auth-brand-panel,
  .auth-card {
    padding: 20px;
    min-height: auto;
  }

  .controls,
  .actions,
  .history-item,
  .history-actions,
  .admin-search-row,
  .admin-user-item,
  .admin-user-actions,
  .auth-switches,
  .auth-form-actions,
  .auth-user-summary,
  .page-topbar,
  .page-topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .upload-title {
    font-size: 28px;
  }

  .upload-card::after {
    position: static;
    display: inline-flex;
    margin-top: 16px;
  }

  .auth-brand-copy h1 {
    max-width: 12ch;
    font-size: clamp(34px, 12vw, 46px);
  }

  .auth-card-title {
    font-size: clamp(28px, 9vw, 38px);
  }

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

  .auth-brand-highlight-featured {
    min-height: 168px;
  }

  .admin-toolbar button,
  .admin-search-row button,
  .admin-user-actions button {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .upload-card,
  .history-section,
  .summary-card,
  .preview-card {
    border-radius: 24px;
  }

  .theme-picker {
    width: 100%;
  }

  .theme-picker-trigger {
    width: 100%;
    min-width: 0;
  }

  .theme-picker-menu {
    left: 0;
    right: 0;
    min-width: 0;
  }

  .code-block {
    min-height: 420px;
  }

  .auth-body .page-topbar {
    position: static;
    margin-bottom: 14px;
  }

  .auth-shell {
    padding-top: 18px;
    align-items: start;
  }

  .auth-brand-panel,
  .auth-card {
    border-radius: 24px;
  }

  .auth-brand-panel {
    gap: 20px;
  }

  .auth-card-inner {
    width: 100%;
  }

  .auth-brand-points {
    flex-direction: column;
  }

  .auth-brand-points li {
    width: 100%;
    justify-content: flex-start;
  }
}
