:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --surface-border: rgba(15, 23, 42, 0.08);
  --text: #102033;
  --muted: #53657d;
  --accent: #184e77;
  --accent-strong: #0f3d66;
  --accent-soft: rgba(24, 78, 119, 0.12);
  --gold: #b68f40;
  --emerald: #167a63;
  --danger: #a33a2b;
  --warning: #966a09;
  --shadow: 0 18px 60px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  background:
    radial-gradient(circle at top left, rgba(24, 78, 119, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(182, 143, 64, 0.12), transparent 24%),
    linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%);
  color: var(--text);
}

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

.app-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px;
}

.locked-state,
.loading-state {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.glass-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 32px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
h3,
h4 {
  font-family: "Georgia", serif;
  margin: 0;
  line-height: 1.1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar h1,
.hero-card h1,
.pin-card h1 {
  font-size: clamp(2rem, 4vw, 3.7rem);
  letter-spacing: -0.03em;
  margin-top: 8px;
}

.topbar p,
.hero-card p,
.pin-card p,
.empty-report p,
.review-section-card p,
.dashboard-hero p,
.score-hint,
.progress-subtitle,
.muted {
  color: var(--muted);
}

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

.status-pill,
.support-chip,
.score-chip,
.empty-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(24, 78, 119, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-strong);
  font-weight: 700;
}

.privacy-banner,
.warning-banner,
.error-banner {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.privacy-banner {
  background: rgba(22, 122, 99, 0.08);
  border-color: rgba(22, 122, 99, 0.14);
}

.warning-banner {
  background: rgba(182, 143, 64, 0.12);
  border-color: rgba(182, 143, 64, 0.22);
  color: #5d4308;
}

.error-banner {
  background: rgba(163, 58, 43, 0.1);
  border-color: rgba(163, 58, 43, 0.22);
  color: var(--danger);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(330px, 470px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.left-column,
.right-column {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 22px;
}

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

.upload-dropzone {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed rgba(24, 78, 119, 0.22);
  background: rgba(248, 250, 252, 0.8);
  cursor: pointer;
}

.upload-dropzone input {
  display: none;
}

.dropzone-title {
  font-weight: 700;
  color: var(--accent-strong);
}

.dropzone-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.file-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(24, 78, 119, 0.07);
  color: var(--accent-strong);
}

.text-button,
.secondary-button,
.primary-button,
.tab,
.export-grid button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: white;
  box-shadow: 0 12px 24px rgba(24, 78, 119, 0.22);
}

.secondary-button,
.tab,
.export-grid button,
.text-button {
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-strong);
  border: 1px solid rgba(24, 78, 119, 0.16);
}

.primary-button:hover,
.secondary-button:hover,
.tab:hover,
.export-grid button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

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

.wide {
  width: 100%;
  margin-top: 10px;
}

.field-label {
  display: block;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 8px;
  font-weight: 700;
}

.pin-input,
input,
textarea,
select {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 32, 51, 0.14);
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 14px;
  color: var(--text);
  outline: none;
}

.pin-input {
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 0.4em;
}

textarea {
  min-height: 135px;
  resize: vertical;
}

.paste-area {
  margin-top: 14px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

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

.progress-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(16, 32, 51, 0.06);
}

.progress-step.active {
  border-color: rgba(24, 78, 119, 0.24);
  box-shadow: inset 0 0 0 1px rgba(24, 78, 119, 0.04);
}

.progress-step.done .progress-dot {
  background: var(--emerald);
}

.progress-step.active .progress-dot {
  background: var(--gold);
}

.progress-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-top: 5px;
  background: rgba(24, 78, 119, 0.22);
  flex: 0 0 auto;
}

.progress-title {
  font-weight: 700;
  color: var(--text);
}

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

.dashboard-hero {
  padding: 24px;
}

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

.score-card,
.domain-card,
.feedback-card,
.review-section-card,
.checklist-item,
.empty-report {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(16, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.score-card {
  padding: 14px;
}

.score-label,
.domain-label,
.roadmap-priority,
.feedback-title,
.checklist-top strong {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 800;
}

.score-value {
  font-family: Georgia, serif;
  font-size: 1.2rem;
  margin-top: 6px;
  color: var(--text);
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab.active {
  background: linear-gradient(135deg, rgba(24, 78, 119, 0.15), rgba(182, 143, 64, 0.12));
  border-color: rgba(24, 78, 119, 0.28);
}

.tab-panel {
  min-height: 400px;
}

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

.review-section-card {
  padding: 18px;
}

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

.two-col,
.feedback-grid,
.domain-grid,
.checklist-grid,
.export-grid {
  display: grid;
  gap: 12px;
}

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

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

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

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

.domain-card,
.feedback-card,
.checklist-item {
  padding: 14px;
}

.domain-score {
  font-size: 2rem;
  font-family: Georgia, serif;
  color: var(--text);
}

.domain-interpretation,
.feedback-card p,
.checklist-item p {
  color: var(--muted);
}

.feedback-card.positive {
  border-color: rgba(22, 122, 99, 0.16);
  background: rgba(22, 122, 99, 0.05);
}

.feedback-card.concern {
  border-color: rgba(163, 58, 43, 0.14);
  background: rgba(163, 58, 43, 0.04);
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--text);
}

.fix-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.fix-strip span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(24, 78, 119, 0.08);
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.checklist-item.present {
  border-color: rgba(22, 122, 99, 0.16);
}

.checklist-item.missing {
  border-color: rgba(163, 58, 43, 0.16);
}

.checklist-item.partial {
  border-color: rgba(182, 143, 64, 0.16);
}

.empty-report {
  padding: 28px;
  text-align: left;
}

.empty-mark {
  width: fit-content;
  margin-bottom: 12px;
}

.empty-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.empty-hints span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(24, 78, 119, 0.08);
  color: var(--accent-strong);
}

.rewrite-block {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(24, 78, 119, 0.06);
  margin: 10px 0;
  color: var(--text);
  line-height: 1.6;
}

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

.export-grid button {
  border-radius: var(--radius-md);
}

.secure-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: #0e5c46;
  background: rgba(22, 122, 99, 0.07);
  border: 1px solid rgba(22, 122, 99, 0.14);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 16px;
  width: fit-content;
}

.settings-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
  margin-bottom: 4px;
}

.settings-tag {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(24, 78, 119, 0.07);
  color: var(--accent-strong);
  border: 1px solid rgba(24, 78, 119, 0.12);
  font-weight: 600;
}

.analyse-btn {
  margin-top: 14px;
}

.analyse-btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.analyse-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.analyse-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 8px;
  margin-bottom: 0;
}

.pin-gate {
  width: min(640px, 100%);
}

.pin-card {
  display: grid;
  gap: 16px;
}

.pin-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo-mark {
  margin-bottom: 4px;
}

.topbar-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.topbar-brand svg {
  flex-shrink: 0;
  margin-top: 6px;
}

.status-pill--live {
  background: rgba(22, 122, 99, 0.09);
  border-color: rgba(22, 122, 99, 0.22);
  color: #0e5c46;
}

.fine-print {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

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

  .summary-grid,
  .feedback-grid,
  .domain-grid,
  .checklist-grid,
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .topbar {
    flex-direction: column;
  }

  .summary-grid,
  .feedback-grid,
  .domain-grid,
  .checklist-grid,
  .two-col,
  .settings-grid,
  .export-grid {
    grid-template-columns: 1fr;
  }

  .review-section-header,
  .panel-header {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .tab-bar {
    overflow-x: auto;
    padding-bottom: 4px;
  }
}
