:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --panel: #ffffff;
  --surface: #f7f8fb;
  --blue: #3857e5;
  --blue-deep: #2b2e9f;
  --blue-soft: #eef2ff;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 20px 60px rgba(17, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--surface);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  cursor: pointer;
}

.site-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 max(18px, calc((100vw - 1100px) / 2));
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #eef0f5;
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 850;
}

.brand-mark,
.message-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: white;
  background: var(--blue);
  border-radius: 7px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(56, 87, 229, 0.25);
}

.nav-actions {
  display: inline-flex;
  gap: 16px;
  align-items: center;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 2px;
  flex: 0 0 auto;
  background: #f3f4f8;
  border-radius: 8px;
}

.language-switch .globe {
  display: grid;
  place-items: center;
  width: 24px;
  color: #9ca3af;
  font-size: 17px;
}

.language-switch button {
  min-width: 34px;
  height: 25px;
  color: #6b7280;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 850;
}

.language-switch button.active {
  color: var(--blue);
  background: white;
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.08);
}

.signin-link,
.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  color: var(--blue);
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.contact-link {
  width: 34px;
  height: 34px;
  border: 1px solid #e0e5ff;
  border-radius: 9px;
  background: var(--blue-soft);
  font-size: 17px;
  line-height: 1;
}

.contact-link:hover {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.site-footer {
  padding: 0 28px 38px;
  color: var(--muted);
  background: #f5f7fb;
  font-size: 14px;
  font-weight: 750;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(1220px, 100%);
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.site-footer strong {
  color: var(--ink);
  font-weight: 900;
}

.hero {
  display: grid;
  place-items: center;
  min-height: 470px;
  padding: 72px 20px 70px;
  color: white;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.16) 1px, transparent 0) 0 0 / 36px 36px,
    linear-gradient(135deg, #3959ec 0%, #312b9c 100%);
}

.hero-inner {
  width: min(780px, 100%);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 22px;
  padding: 0 16px;
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 850;
}

.hero h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

.hero h1 span {
  color: #b8c6ff;
}

.hero p {
  width: min(590px, 100%);
  margin: 22px auto 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(17px, 1.7vw, 20px);
  font-weight: 650;
  line-height: 1.42;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.primary-hero,
.ghost-hero {
  min-height: 46px;
  padding: 0 24px;
  border-radius: 10px;
  font-weight: 850;
}

.primary-hero {
  color: var(--blue);
  background: white;
  border: 1px solid white;
}

.ghost-hero {
  color: white;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.criteria-strip {
  padding: 48px 20px 50px;
  background: #f8f9fb;
}

.section-heading {
  width: min(650px, 100%);
  margin: 0 auto 34px;
  text-align: center;
}

.section-heading h2,
.workspace-heading h2,
.topbar h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.section-heading h2 {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
}

.section-heading p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
}

.criteria-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(92px, 1fr));
  gap: 22px;
  width: min(1030px, 100%);
  margin: 0 auto;
}

.criterion {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.criterion span,
.letter {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: white;
  background: var(--blue);
  border-radius: 10px;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(56, 87, 229, 0.25);
}

.criterion small {
  color: #596174;
  font-size: 14px;
  font-weight: 650;
}

.workspace-section {
  padding: 42px 28px 58px;
  background:
    linear-gradient(180deg, #ffffff 0, #f5f7fb 100%);
}

.workspace-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  width: min(1220px, 100%);
  margin: 0 auto 20px;
}

.workspace-heading h2 {
  max-width: 760px;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.08;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.health-pill {
  display: grid;
  place-items: center;
  min-width: 130px;
  min-height: 70px;
  padding: 10px 16px;
  color: white;
  background: #111827;
  border-radius: 12px;
}

.health-pill span {
  font-size: 24px;
  font-weight: 900;
}

.health-pill small {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 750;
}

.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 18px;
  width: min(1220px, 100%);
  margin: 0 auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-tabs {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(17, 24, 39, 0.08);
}

.nav-tab {
  width: 100%;
  min-height: 43px;
  padding: 0 14px;
  color: #596174;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 800;
}

.nav-tab.active {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #d9e0ff;
}

.deal-card,
.repository-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(17, 24, 39, 0.08);
}

.deal-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.repository-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.repository-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.repository-header strong {
  display: block;
  line-height: 1.25;
}

.repository-header .text-button {
  max-width: 82px;
  overflow-wrap: anywhere;
  line-height: 1.15;
  text-align: right;
}

.repository-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.repository-controls,
.repository-actions {
  display: grid;
  gap: 10px;
}

.repository-actions {
  grid-template-columns: 1fr;
  align-items: center;
}

.repository-actions .danger {
  justify-self: start;
}

.deal-card-header,
.panel-header,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  color: var(--ink);
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}

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

textarea {
  resize: vertical;
  min-height: 76px;
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(56, 87, 229, 0.12);
}

.app-main {
  min-width: 0;
}

.topbar {
  margin-bottom: 14px;
  padding: 15px 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(17, 24, 39, 0.08);
}

.topbar h2 {
  font-size: 26px;
  line-height: 1.05;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.coach-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.coach-panel {
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto;
  min-height: 520px;
}

.chat-window {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  padding: 20px 0;
}

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

.message-avatar {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.message.user .message-avatar {
  background: #111827;
}

.message-body {
  padding: 12px 13px;
  background: #f6f7fb;
  border: 1px solid var(--line);
  border-radius: 12px;
  line-height: 1.35;
}

.message.user .message-body {
  background: var(--blue-soft);
  border-color: #d9e0ff;
}

.message-body p {
  margin: 0 0 10px;
}

.message-body p:last-child {
  margin-bottom: 0;
}

.chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 12px;
  align-items: end;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 10px;
  font-weight: 850;
}

.primary-button {
  color: white;
  background: var(--blue);
  border: 1px solid var(--blue);
}

.primary-button:hover {
  background: var(--blue-deep);
}

.secondary-button {
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #d9e0ff;
}

.text-button {
  min-height: 30px;
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
}

.text-button.danger {
  color: var(--red);
}

.modal-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.auth-modal {
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.auth-modal h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
}

.auth-modal p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-reset {
  justify-self: center;
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 750;
}

.auth-error[data-tone="success"] {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.radial-wrap {
  display: grid;
  place-items: center;
  padding: 22px 0;
}

.radial {
  --score: 0deg;
  display: grid;
  place-items: center;
  width: min(238px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--score), #e8ebf3 0);
}

.radial span {
  display: grid;
  place-items: center;
  width: 72%;
  aspect-ratio: 1;
  font-size: 38px;
  font-weight: 900;
  background: white;
  border-radius: 50%;
}

.gap-list,
.plan-list,
.library-grid,
.score-grid {
  display: grid;
  gap: 14px;
}

.gap-list {
  gap: 8px;
}

.gap-item,
.plan-item,
.library-item,
.score-item {
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.gap-item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  background: #f8f9fb;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
}

.gap-item:hover,
.gap-item:focus-visible,
.quick-prompts button:hover,
.quick-prompts button:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 8px 18px rgba(49, 84, 230, 0.12);
  outline: none;
}

.gap-item strong {
  margin-bottom: 0;
}

.gap-item strong,
.plan-item strong,
.library-item strong,
.score-item strong {
  display: block;
  margin-bottom: 6px;
}

.plan-item,
.library-item,
.score-item {
  padding: 13px;
}

.gap-item p,
.plan-item p,
.library-item p,
.score-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.quick-prompts {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.quick-prompts button {
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  text-align: left;
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 800;
}

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

.score-item {
  display: grid;
  gap: 13px;
}

.score-title {
  display: flex;
  gap: 10px;
  align-items: start;
}

.gap-item p,
.score-item .score-title p {
  display: none;
}

.letter {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  font-size: 20px;
}

.rating-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.rating-row button {
  min-height: 38px;
  padding: 0 8px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 850;
}

.rating-row button.active {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.notes {
  min-height: 82px;
}

.plan-item {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 14px;
}

.priority {
  display: grid;
  place-items: center;
  min-height: 38px;
  color: white;
  background: var(--red);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.priority.medium {
  background: var(--amber);
}

.priority.low {
  background: var(--green);
}

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

.library-item ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .site-nav {
    padding: 0 24px;
  }

  .criteria-row {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }

  .app-shell,
  .coach-layout,
  .score-grid,
  .library-grid {
    grid-template-columns: 1fr;
  }

  .nav-tabs {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-tab {
    text-align: center;
  }
}

@media (max-width: 720px) {
  .site-nav {
    height: auto;
    min-height: 52px;
    padding: 8px 14px;
  }

  .brand {
    font-size: 13px;
  }

  .nav-actions {
    gap: 8px;
  }

  .language-switch .globe {
    display: none;
  }

  .language-switch button {
    min-width: 30px;
    font-size: 12px;
  }

  .signin-link {
    font-size: 13px;
  }

  .hero {
    min-height: 520px;
    padding: 68px 18px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero p,
  .section-heading p {
    font-size: 16px;
  }

  .criteria-row,
  .nav-tabs,
  .chat-input,
  .repository-actions,
  .auth-actions,
  .plan-item {
    grid-template-columns: 1fr;
  }

  .workspace-section {
    padding: 40px 14px 56px;
  }

  .site-footer {
    padding-inline: 14px;
  }

  .footer-inner {
    gap: 10px;
  }

  .workspace-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-header,
  .deal-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .rating-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .coach-panel {
    min-height: auto;
  }
}
