:root {
  --ink: #1a1a18;
  --brand-blue: #2a5785;
  --brand-blue-deep: #1f4568;
  --brand-beige: #efe4d2;
  --brand-cream: #faf6ee;
  --brand-sand: #dcc9af;
  --surface: rgba(250, 246, 238, 0.84);
  --surface-strong: rgba(255, 251, 245, 0.94);
  --border: rgba(42, 87, 133, 0.16);
  --shadow: 0 24px 80px rgba(25, 38, 53, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(239, 228, 210, 0.95), transparent 38%),
    linear-gradient(135deg, #f7f1e7 0%, #f3ede4 40%, #ebe5dc 100%);
}

button {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.bg-shape {
  position: absolute;
  pointer-events: none;
  opacity: 0.14;
  filter: saturate(0.85);
}

.bg-shape-circle {
  top: -8rem;
  right: -10rem;
  width: min(34rem, 48vw);
}

.bg-shape-square {
  bottom: -9rem;
  left: -8rem;
  width: min(28rem, 42vw);
}

.bg-shape-oval {
  top: 34%;
  right: -7rem;
  width: min(20rem, 28vw);
}

.app {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.hero {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.hero__brand,
.status-panel,
.summary-panel,
.skill-card,
.results-card {
  backdrop-filter: blur(18px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero__brand {
  border-radius: var(--radius-xl);
  padding: 1.5rem;
}

.hero__logo {
  width: 100%;
  height: auto;
  display: block;
}

.eyebrow,
.section-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-blue);
}

.hero__copy {
  padding: 1rem 0.5rem;
}

.hero__copy h1,
.results-card h2,
.status-panel h2,
.skill-card h3 {
  font-family: var(--font-display);
  line-height: 1.02;
  margin: 0;
}

.hero__copy h1 {
  font-size: 24pt;
  max-width: 100%;
}

.hero__copy p {
  max-width: 42rem;
  font-size: 1.05rem;
  margin: 1rem 0 0;
  color: rgba(26, 26, 24, 0.76);
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 1rem;
}

.mode-switcher {
  display: inline-flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 251, 245, 0.7);
  border: 1px solid rgba(42, 87, 133, 0.14);
  box-shadow: 0 14px 28px rgba(24, 32, 42, 0.06);
}

.mode-button {
  border: none;
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  background: transparent;
  color: rgba(26, 26, 24, 0.72);
  cursor: pointer;
  font-weight: 700;
}

.mode-button--active {
  background: var(--brand-blue);
  color: white;
}

.status-panel,
.summary-panel,
.skill-card,
.results-card {
  border-radius: var(--radius-xl);
}

.status-panel,
.summary-panel {
  padding: 1.35rem 1.5rem;
}

.progress-wrap {
  margin-top: 1rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.progress-bar {
  margin-top: 0.65rem;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(42, 87, 133, 0.12);
}

.progress-bar__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-blue) 0%, #4f7ba8 100%);
  transition: width 220ms ease;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

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

.summary-pill {
  padding: 0.85rem 0.9rem;
  background: var(--surface-strong);
  border-radius: var(--radius-md);
  border: 1px solid rgba(42, 87, 133, 0.1);
}

.summary-pill strong {
  display: block;
  font-size: 1.2rem;
  margin-top: 0.18rem;
}

.card-stage,
.results-stage,
.library-stage {
  margin-top: 1.25rem;
}

.skill-card,
.results-card,
.library-panel,
.library-card {
  padding: 1.5rem;
}

.skill-card {
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: auto -6rem -6rem auto;
  width: 14rem;
  height: 14rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42, 87, 133, 0.15) 0%, rgba(42, 87, 133, 0) 68%);
}

.skill-card__topline,
.card-footer,
.results-card__header,
.results-overview,
.results-columns {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.skill-card__topline {
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(42, 87, 133, 0.12);
  color: var(--brand-blue-deep);
  font-size: 0.88rem;
  font-weight: 700;
}

.pill--soft {
  background: rgba(220, 201, 175, 0.45);
}

.skill-card__body {
  padding: 2rem 0 1rem;
}

.definition-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0 0 1rem;
  position: relative;
  z-index: 1;
}

.definition-block {
  min-height: 100%;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 251, 245, 0.86);
  border: 1px solid rgba(42, 87, 133, 0.1);
}

.definition-block--muted {
  background: rgba(239, 228, 210, 0.5);
}

.definition-copy {
  margin: 0;
  line-height: 1.5;
  color: rgba(26, 26, 24, 0.8);
  font-size: 0.96rem;
}

.skill-card h3 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  max-width: 11ch;
}

.muted {
  color: rgba(26, 26, 24, 0.66);
}

.actions {
  position: relative;
  z-index: 1;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.option-button,
.ghost-button,
.primary-button {
  cursor: pointer;
  border-radius: 18px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.option-button {
  text-align: left;
  min-height: 114px;
  padding: 1rem 1rem 0.95rem;
  border: 1px solid rgba(42, 87, 133, 0.16);
  background: var(--surface-strong);
  box-shadow: 0 12px 28px rgba(24, 32, 42, 0.06);
}

.option-button:hover,
.option-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible,
.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(24, 32, 42, 0.1);
}

.option-button strong {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.option-button span {
  display: block;
  color: rgba(26, 26, 24, 0.68);
  line-height: 1.35;
}

.option-button__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  margin-bottom: 0.75rem;
  border-radius: 999px;
  background: rgba(42, 87, 133, 0.12);
  color: var(--brand-blue-deep);
  font-size: 0.85rem;
  font-weight: 700;
}

.card-footer {
  margin-top: 1rem;
}

.ghost-button,
.primary-button {
  border: 1px solid rgba(42, 87, 133, 0.18);
  padding: 0.85rem 1rem;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
}

.primary-button {
  background: var(--brand-blue);
  color: white;
  border-color: transparent;
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.hidden {
  display: none;
}

.library-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.library-panel,
.library-card {
  border-radius: var(--radius-xl);
  backdrop-filter: blur(18px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.library-panel {
  position: sticky;
  top: 1rem;
}

.library-panel__header h2,
.library-card h3 {
  font-family: var(--font-display);
  line-height: 1.02;
  margin: 0;
}

.search-field {
  display: block;
  margin-top: 1rem;
}

.search-field input {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(42, 87, 133, 0.14);
  background: rgba(255, 251, 245, 0.86);
  font: inherit;
}

.library-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
  max-height: 70vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.library-list-button {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(42, 87, 133, 0.12);
  background: rgba(255, 251, 245, 0.88);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
}

.library-list-button.is-active {
  background: rgba(42, 87, 133, 0.12);
  border-color: rgba(42, 87, 133, 0.28);
}

.library-list-button strong,
.library-list-button span {
  display: block;
}

.library-list-button span {
  margin-top: 0.2rem;
  color: rgba(26, 26, 24, 0.64);
  font-size: 0.9rem;
}

.development-panel {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 251, 245, 0.9);
  border: 1px solid rgba(42, 87, 133, 0.12);
}

.development-content {
  display: grid;
  gap: 0.65rem;
}

.development-block {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: rgba(239, 228, 210, 0.32);
}

.development-block strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--brand-blue-deep);
}

.development-block p {
  margin: 0;
  line-height: 1.55;
}

@media (min-width: 901px) {
  .library-shell {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
  }

  .library-panel {
    position: sticky;
    top: 1rem;
    width: auto;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
  }

  .library-card {
    margin-left: 0;
    min-height: calc(100vh - 2rem);
  }
}

.results-card__header,
.results-overview,
.results-columns {
  flex-wrap: wrap;
}

.results-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.results-overview,
.results-columns {
  margin-top: 1.5rem;
}

.print-summary {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 251, 245, 0.98), rgba(239, 228, 210, 0.72));
  border: 1px solid rgba(42, 87, 133, 0.12);
}

.print-summary__hero,
.print-summary__stats {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.print-summary__logo {
  width: min(220px, 48vw);
  height: auto;
}

.print-summary__stats {
  margin-top: 1rem;
}

.print-summary__stats > div {
  flex: 1 1 260px;
}

.results-overview > div,
.results-columns > div {
  flex: 1 1 320px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(42, 87, 133, 0.1);
  color: var(--brand-blue-deep);
  font-size: 0.92rem;
  font-weight: 700;
}

.results-table {
  display: grid;
  gap: 0.7rem;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(140px, 0.7fr) minmax(150px, 0.7fr);
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--surface-strong);
  border: 1px solid rgba(42, 87, 133, 0.1);
  border-radius: var(--radius-md);
}

.result-row--definitions {
  grid-template-columns: 1fr 1fr;
}

.result-row__label {
  font-weight: 700;
}

.result-row__meta {
  color: rgba(26, 26, 24, 0.72);
}

.result-row__definition {
  line-height: 1.45;
  color: rgba(26, 26, 24, 0.82);
}

@media (max-width: 900px) {
  .hero,
  .dashboard,
  .library-shell {
    grid-template-columns: 1fr;
  }

  .hero__copy h1 {
    max-width: 100%;
  }

  .library-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 1rem, 1120px);
    padding-top: 0.75rem;
  }

  .hero__brand,
  .status-panel,
  .summary-panel,
  .skill-card,
  .results-card,
  .library-panel,
  .library-card {
    border-radius: 22px;
    padding: 1.1rem;
  }

  .option-grid,
  .summary-grid,
  .definition-panel {
    grid-template-columns: 1fr;
  }

  .skill-card h3 {
    font-size: 2.3rem;
  }

  .result-row {
    grid-template-columns: 1fr;
  }

  .mode-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media print {
  :root {
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --border: rgba(26, 26, 24, 0.12);
    --shadow: none;
  }

  body {
    background: white;
    color: black;
  }

  .page-shell {
    overflow: visible;
  }

  .bg-shape,
  .hero,
  .dashboard,
  .card-stage,
  .results-actions,
  .ghost-button,
  .primary-button {
    display: none !important;
  }

  .app {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .results-stage {
    margin-top: 0;
  }

  .results-card {
    border: none;
    box-shadow: none;
    padding: 0;
    background: white;
    backdrop-filter: none;
  }

  .results-card__header {
    display: block;
    margin-bottom: 1rem;
  }

  .results-card__header .muted {
    color: rgba(0, 0, 0, 0.72);
  }

  .print-summary {
    padding: 0 0 1rem;
    margin-top: 0;
    border: none;
    background: none;
    border-radius: 0;
  }

  .print-summary__hero,
  .print-summary__stats,
  .results-overview,
  .results-columns {
    display: block;
  }

  .print-summary__stats > div,
  .results-overview > div,
  .results-columns > div {
    margin-bottom: 1rem;
  }

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

  .summary-pill,
  .result-row {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
    background: white;
    border-color: rgba(0, 0, 0, 0.14);
  }

  .chip-list {
    gap: 0.35rem;
  }

  .chip {
    color: black;
    background: #f0f0f0;
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  .results-table {
    gap: 0.45rem;
  }

  .result-row {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .result-row--definitions {
    grid-template-columns: 1fr 1fr;
  }
}
