:root {
  --ink: #182032;
  --muted: #667085;
  --paper: #fff8ed;
  --surface: #ffffff;
  --surface-soft: #fff3df;
  --line: rgba(24, 32, 50, 0.14);
  --teal: #008f85;
  --teal-soft: #dff7f3;
  --coral: #f2644a;
  --coral-soft: #ffe7df;
  --blue: #4169e1;
  --lemon: #ffd166;
  --green: #2f9e44;
  --amber: #b7791f;
  --red: #c2412d;
  --shadow: 0 24px 70px rgba(24, 32, 50, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Nunito Sans", system-ui, sans-serif;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.24), transparent 36%),
    linear-gradient(215deg, rgba(0, 143, 133, 0.16), transparent 42%),
    repeating-linear-gradient(90deg, rgba(24, 32, 50, 0.035) 0 1px, transparent 1px 28px),
    var(--paper);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0;
}

.workspace {
  min-height: calc(100vh - 48px);
  padding: 24px;
  border: 1px solid rgba(24, 32, 50, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 248, 237, 0.95)),
    var(--surface-soft);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.brand,
.privacy-chip,
.card-heading,
.file-row,
.download-actions,
.guide-heading,
.workflow-note,
.guide-card {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  font-weight: 900;
  background: var(--ink);
  border-radius: 8px;
}

.brand strong {
  display: block;
  font-size: 1rem;
}

.brand span,
.privacy-chip,
.hero-copy p,
.card-heading p,
.run-card p,
.guide-heading p,
.guide-card p,
.workflow-note span,
.file-row,
#audit-subtitle {
  color: var(--muted);
}

.privacy-chip {
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  font-weight: 800;
  background: var(--teal-soft);
  border: 1px solid rgba(0, 143, 133, 0.18);
  border-radius: 8px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: center;
  margin: 30px 0 24px;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(3rem, 6.5vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 700px;
  margin: 20px 0 0;
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero-art {
  margin: 0;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(24, 32, 50, 0.1);
}

.hero-art img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.flow-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(240px, 0.7fr);
  gap: 16px;
  align-items: stretch;
}

.upload-card,
.run-card,
.status-panel {
  border-radius: var(--radius);
}

.upload-card,
.run-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
}

.upload-card {
  border-top: 6px solid var(--teal);
}

.upload-card.word {
  border-top-color: var(--coral);
}

.card-heading {
  min-height: 54px;
  gap: 12px;
}

.icon-box {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 8px;
}

.word .icon-box {
  background: var(--coral);
}

.card-heading h2,
.run-card h2,
.guide-heading h2,
.audit-heading h2 {
  margin: 0;
  font-size: 1.08rem;
}

.card-heading p,
.run-card p,
.guide-heading p,
#audit-subtitle {
  margin: 3px 0 0;
  line-height: 1.4;
}

.drop-zone {
  display: grid;
  min-height: 150px;
  margin: 16px 0 12px;
  padding: 22px;
  place-items: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(0, 143, 133, 0.11), rgba(255, 255, 255, 0.55));
  border: 2px dashed rgba(24, 32, 50, 0.24);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.word .drop-zone {
  background: linear-gradient(135deg, rgba(242, 100, 74, 0.12), rgba(255, 255, 255, 0.55));
}

.drop-zone:hover,
.drop-zone.is-dragging {
  transform: translateY(-2px);
  border-color: var(--ink);
  background: rgba(255, 209, 102, 0.22);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-zone strong {
  font-size: 1.1rem;
}

.drop-zone span {
  color: var(--muted);
}

.file-row {
  min-height: 38px;
  gap: 9px;
  font-size: 0.94rem;
}

.file-row.is-ready {
  color: var(--teal);
  font-weight: 900;
}

.run-card {
  display: grid;
  align-content: space-between;
  gap: 18px;
  background: var(--ink);
  color: white;
}

.run-card p {
  color: rgba(255, 255, 255, 0.74);
}

.run-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  line-height: 1.35;
  list-style: none;
}

.run-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.run-list li::before {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  background: var(--lemon);
  border-radius: 50%;
}

.generate-button,
.secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.generate-button {
  width: 100%;
  color: var(--ink);
  background: linear-gradient(135deg, var(--lemon), #ff9e64 54%, #7ee0d2);
  box-shadow: 0 16px 32px rgba(255, 158, 100, 0.26);
}

.generate-button:disabled {
  cursor: wait;
  filter: grayscale(0.4);
  opacity: 0.72;
}

.guide-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.guide-heading {
  gap: 12px;
}

.guide-icon {
  background: var(--blue);
}

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

.guide-card {
  align-items: flex-start;
  gap: 11px;
  min-height: 140px;
  padding: 14px;
  background: rgba(255, 248, 237, 0.84);
  border: 1px solid rgba(24, 32, 50, 0.1);
  border-radius: 8px;
}

.guide-card.is-primary {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.34), rgba(126, 224, 210, 0.22));
  border-color: rgba(0, 143, 133, 0.22);
}

.guide-card svg {
  flex: 0 0 22px;
  margin-top: 2px;
  color: var(--teal);
}

.guide-card h3 {
  margin: 0 0 5px;
  font-size: 0.98rem;
}

.guide-card p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.48;
}

.workflow-note {
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--teal-soft);
  border: 1px solid rgba(0, 143, 133, 0.16);
  border-radius: 8px;
}

.workflow-note svg {
  flex: 0 0 20px;
  margin-top: 2px;
  color: var(--teal);
}

.workflow-note strong,
.workflow-note span {
  display: block;
}

.status-panel {
  margin-top: 16px;
  padding: 16px;
  background: rgba(24, 32, 50, 0.94);
  color: white;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.step span {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--ink);
  font-weight: 900;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 50%;
}

.step.is-active,
.step.is-done {
  color: white;
  background: rgba(0, 143, 133, 0.36);
}

.step.is-done span {
  background: var(--green);
  color: white;
}

.message {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 8px;
}

.message div {
  display: grid;
  gap: 2px;
}

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

.message.success {
  background: rgba(47, 158, 68, 0.26);
}

.message.error {
  background: rgba(194, 65, 45, 0.3);
}

.audit-panel {
  margin-top: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.audit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.download-actions {
  gap: 8px;
  flex-wrap: wrap;
}

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

.download-explainer article {
  min-height: 94px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.download-explainer b,
.download-explainer span {
  display: block;
}

.download-explainer b {
  margin-bottom: 5px;
  color: white;
}

.download-explainer span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.9rem;
  line-height: 1.42;
}

.secondary-button {
  min-height: 38px;
  padding: 0 12px;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.primary-download {
  color: var(--ink);
  background: linear-gradient(135deg, var(--lemon), #7ee0d2);
  border-color: transparent;
}

.explain-button.is-active {
  color: var(--ink);
  background: var(--lemon);
  border-color: transparent;
}

.audit-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.metric {
  min-height: 78px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 8px;
}

.metric strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.84rem;
}

.review-art {
  margin: 0 0 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.review-art img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
}

.auto-explanation {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  color: white;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.34);
  border-radius: 8px;
}

.auto-explanation[hidden] {
  display: none;
}

.auto-explanation-heading {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.auto-explanation-heading svg {
  flex: 0 0 22px;
  margin-top: 3px;
  color: var(--lemon);
}

.auto-explanation h3 {
  margin: 0 0 5px;
  font-size: 1.04rem;
}

.auto-explanation p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.auto-breakdown {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.auto-breakdown article {
  min-height: 126px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.auto-breakdown b,
.auto-breakdown strong,
.auto-breakdown span {
  display: block;
}

.auto-breakdown b {
  color: var(--lemon);
  font-size: 1.45rem;
  line-height: 1;
}

.auto-breakdown strong {
  margin: 7px 0 4px;
  color: white;
  font-size: 0.92rem;
}

.auto-breakdown span,
.plain-explanation {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.9rem;
  line-height: 1.44;
}

.audit-details {
  display: grid;
  gap: 8px;
}

.audit-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--lemon);
  border-radius: 8px;
}

.audit-item.is-success {
  border-left-color: var(--green);
}

.audit-item.is-error {
  border-left-color: var(--red);
}

.audit-item.is-warn {
  border-left-color: var(--amber);
}

.audit-item b {
  color: white;
}

.audit-item span,
.audit-item code {
  color: rgba(255, 255, 255, 0.76);
}

.audit-item code {
  display: block;
  overflow: hidden;
  max-width: 100%;
  font-family: "Nunito Sans", system-ui, sans-serif;
  white-space: nowrap;
  text-overflow: ellipsis;
}

svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 960px) {
  .hero-grid,
  .flow-panel,
  .guide-grid,
  .download-explainer,
  .auto-breakdown {
    grid-template-columns: 1fr;
  }

  .hero-art {
    max-width: 420px;
  }

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

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 18px, 680px);
    padding: 9px 0;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .audit-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .privacy-chip {
    align-self: stretch;
    justify-content: center;
  }

  .hero-copy h1 {
    font-size: 3.1rem;
  }

  .steps,
  .audit-metrics {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 132px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
