:root {
  --ink: #121417;
  --muted: #59606b;
  --paper: #f7f7f4;
  --panel: #ffffff;
  --line: #dfe3e8;
  --blue: #2457ff;
  --blue-dark: #163cb9;
  --green: #097969;
  --lime: #d9f75b;
  --rose: #ef4c5f;
  --charcoal: #20262e;
  --shadow: 0 18px 45px rgba(23, 31, 42, 0.12);
}

* {
  box-sizing: border-box;
}

#skipButton{
  background: #14181f;
  color: #ffffff;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 14px;
}
/* =========================================================
   API NOTICE MODAL
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(10, 12, 18, 0.78);
  backdrop-filter: blur(10px);

  overflow-y: auto;
}

.modal {
  position: relative;

  width: min(620px, 100%);
  max-height: 92vh;

  overflow-y: auto;

  padding: 34px;

  background: #ffffff;
  color: #14181f;

  border: 1px solid #e2e5e9;
  border-radius: 24px;

  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.28);

  animation: modalEnter 0.25s ease-out;
}

.modal-close {
  position: absolute;

  top: 16px;
  right: 16px;

  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 50%;

  background: #f2f4f7;
  color: #59606b;

  font-size: 25px;
  line-height: 1;

  cursor: pointer;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.modal-close:hover {
  background: #e6e9ee;
  color: #14181f;
}

.modal-icon {
  width: 52px;
  height: 52px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 14px;

  background: #eef4fb;

  border-radius: 15px;

  font-size: 24px;
}

.modal-kicker {
  margin: 0 0 6px;

  color: #2e74b5;

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal h2 {
  margin: 0 0 10px;

  font-family: "Source Serif 4", Georgia, serif;

  font-size: 32px;
  line-height: 1.1;
}

.modal-intro {
  margin: 0;

  color: #59606b;

  font-size: 15px;
  line-height: 1.65;
}


/* =========================================================
   MVP HIGHLIGHT
   ========================================================= */

.modal-highlight {
  margin: 22px 0;

  padding: 16px 18px;

  background: #f5f8fb;

  border-left: 4px solid #2e74b5;
  border-radius: 10px;
}

.modal-highlight strong {
  display: block;

  margin-bottom: 5px;

  color: #1f4d78;

  font-size: 14px;
}

.modal-highlight p {
  margin: 0;

  color: #59606b;

  font-size: 13px;
  line-height: 1.55;
}


/* =========================================================
   API GUIDE SECTIONS
   ========================================================= */

.api-guide-section {
  margin-top: 20px;

  padding: 20px;

  background: #fafbfc;

  border: 1px solid #e5e8ec;
  border-radius: 15px;
}

.api-guide-header {
  display: flex;
  gap: 13px;

  align-items: flex-start;

  margin-bottom: 15px;
}

.api-guide-number {
  flex: 0 0 auto;

  width: 30px;
  height: 30px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #2e74b5;
  color: #ffffff;

  border-radius: 50%;

  font-size: 13px;
  font-weight: 800;
}

.api-guide-header h3 {
  margin: 2px 0 4px;

  font-size: 16px;
}

.api-guide-header p {
  margin: 0;

  color: #6b7280;

  font-size: 12px;
  line-height: 1.5;
}


/* =========================================================
   STEPS
   ========================================================= */

.api-steps {
  margin: 0 0 16px;
  padding-left: 20px;

  color: #454b55;

  font-size: 13px;
  line-height: 1.6;
}

.api-steps li {
  margin-bottom: 6px;

  padding-left: 3px;
}

.api-steps a {
  color: #2e74b5;

  font-weight: 700;

  text-decoration: none;
}

.api-steps a:hover {
  text-decoration: underline;
}


/* =========================================================
   GUIDE BUTTON
   ========================================================= */

.modal-guide-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 9px 14px;

  background: #2e74b5;
  color: #ffffff;

  border-radius: 9px;

  font-size: 12px;
  font-weight: 700;

  text-decoration: none;

  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.modal-guide-button:hover {
  background: #245f94;

  transform: translateY(-1px);
}

.secondary-guide {
  background: #14181f;
}

.secondary-guide:hover {
  background: #292f38;
}


/* =========================================================
   SECURITY
   ========================================================= */

.modal-security {
  display: flex;
  gap: 10px;
  align-items: flex-start;

  margin-top: 20px;
  padding: 13px 15px;

  background: #fff8e8;

  border: 1px solid #f0dfb1;
  border-radius: 10px;
}

.modal-security span {
  font-size: 15px;
}

.modal-security p {
  margin: 0;

  color: #6d5b2c;

  font-size: 11px;
  line-height: 1.5;
}


/* =========================================================
   ACTION
   ========================================================= */

.modal-actions {
  display: flex;

  margin-top: 22px;
}

.modal-button {
  width: 100%;

  padding: 13px 18px;

  border: 0;
  border-radius: 10px;

  background: #14181f;
  color: #ffffff;

  font-family: inherit;

  font-size: 14px;
  font-weight: 700;

  cursor: pointer;

  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.modal-button:hover {
  background: #2b313a;

  transform: translateY(-1px);
}

.modal-footer-note {
  margin: 13px 0 0;

  color: #8a9099;

  font-size: 11px;

  text-align: center;
}


/* =========================================================
   SIDEBAR HELP LINK
   ========================================================= */

.api-help-link {
  margin-top: 3px;

  padding: 0;

  border: 0;

  background: transparent;
  color: #2e74b5;

  font-family: inherit;

  font-size: 12px;
  font-weight: 700;

  text-align: left;

  cursor: pointer;
}

.api-help-link:hover {
  text-decoration: underline;
}


/* =========================================================
   ANIMATION
   ========================================================= */

@keyframes modalEnter {
  from {
    opacity: 0;

    transform:
      translateY(12px)
      scale(0.98);
  }

  to {
    opacity: 1;

    transform:
      translateY(0)
      scale(1);
  }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

  .modal-overlay {
    padding: 12px;
  }

  .modal {
    padding: 25px 20px;

    border-radius: 18px;
  }

  .modal h2 {
    font-size: 27px;
  }

  .api-guide-section {
    padding: 16px;
  }

}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Archivo", sans-serif;
  background:
    linear-gradient(90deg, rgba(36, 87, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(9, 121, 105, 0.07) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: var(--ink);
  color: var(--lime);
  border-radius: 6px;
  font-weight: 800;
}

.kicker {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-family: "Source Serif 4", serif;
  font-size: 2rem;
  line-height: 1;
}

h2 {
  font-family: "Source Serif 4", serif;
  font-size: 1.55rem;
}

h3 {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.setup-stack,
.tech-drawer {
  display: grid;
  gap: 14px;
}

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

.field span,
.question-stack span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

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

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

textarea {
  min-height: 116px;
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn,
.record-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.btn:hover,
.record-btn:hover {
  transform: translateY(-1px);
}

.primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 12px 24px rgba(36, 87, 255, 0.22);
}

.secondary {
  background: #e8f1ff;
  color: var(--blue-dark);
}

.ghost {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

.compact {
  min-height: 38px;
  padding-inline: 12px;
}

.microcopy,
.status-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.tech-drawer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.tech-drawer summary {
  cursor: pointer;
  font-weight: 800;
}

.tech-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.tech-list section {
  display: grid;
  gap: 6px;
}

.tech-icon {
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
}

.tech-list h2 {
  font-family: "Archivo", sans-serif;
  font-size: 0.95rem;
}

.tech-list p,
.tech-drawer blockquote {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tech-drawer blockquote {
  margin-top: 16px;
  padding-left: 12px;
  border-left: 3px solid var(--green);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.1fr);
  gap: 1px;
  background: var(--line);
}

.input-pane,
.output-pane {
  min-width: 0;
  padding: 30px;
  background: rgba(247, 247, 244, 0.96);
}

.pane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.pane-heading.small {
  margin-bottom: 14px;
}

.record-btn {
  background: var(--charcoal);
  color: white;
}

.record-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--rose);
}

.record-btn.recording .record-dot {
  animation: pulse 900ms infinite;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.pitch-field {
  margin-bottom: 14px;
}

.action-row {
  margin-bottom: 14px;
}

.empty-state,
.loading-state,
.verdict-band,
.analysis-grid section,
.rewrite-results section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.empty-state,
.loading-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.loader {
  width: 42px;
  height: 42px;
  border: 4px solid #d8dce3;
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: spin 850ms linear infinite;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow);
}

.score-strip div {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.score-strip div:last-child {
  border-right: 0;
}

.score-strip span,
.verdict-band span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.score-strip strong {
  font-family: "Source Serif 4", serif;
  font-size: 2rem;
  line-height: 1;
}

.overall-score {
  background: var(--lime);
}

.verdict-band {
  margin-top: 14px;
  padding: 18px;
}

.verdict-band strong {
  display: block;
  margin: 6px 0 8px;
  font-size: 1.3rem;
}

.verdict-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.analysis-grid section,
.rewrite-results section {
  padding: 16px;
}

ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

li + li {
  margin-top: 8px;
}

.deeper-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.follow-up-zone {
  display: grid;
  gap: 14px;
}

.question-stack {
  display: grid;
  gap: 12px;
}

.question-stack label {
  display: grid;
  gap: 8px;
}

.compact-loader {
  min-height: 130px;
  margin-top: 14px;
}

.dark {
  background: var(--charcoal);
  color: white;
}

.dark p,
.dark span {
  color: rgba(255, 255, 255, 0.75);
}

.rewrite-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.rewrite-results p {
  color: var(--muted);
  line-height: 1.62;
}

.hidden {
  display: none !important;
}

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

@keyframes pulse {
  50% {
    transform: scale(1.5);
    opacity: 0.45;
  }
}

@media (max-width: 1120px) {
  .app-shell,
  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .sidebar,
  .input-pane,
  .output-pane {
    padding: 20px;
  }

  .pane-heading,
  .control-grid,
  .score-strip,
  .analysis-grid,
  .rewrite-results {
    grid-template-columns: 1fr;
  }

  .pane-heading {
    align-items: stretch;
    display: grid;
  }

  .score-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .score-strip div:last-child {
    border-bottom: 0;
  }
}
