:root {
  --ink: #172345;
  --muted: #5c6a90;
  --accent: #1d4ed8;
  --accent-soft: #dbe7ff;
  --surface: #ffffff;
  --panel: #f5f8ff;
  --line: rgba(23, 35, 69, 0.12);
  --shadow: 0 20px 48px rgba(29, 78, 216, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(219, 231, 255, 0.6) 0%, rgba(245, 248, 255, 1) 34%),
    #f8fbff;
}

a { color: inherit; }

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

.hero-strip {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.hero-strip.slim {
  align-items: center;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
}

h1,
h2 {
  margin: 0;
  line-height: 0.98;
}

h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  letter-spacing: -0.05em;
}

h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.95rem);
  letter-spacing: -0.03em;
}

p,
li {
  color: var(--muted);
  line-height: 1.7;
}

.topnav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.topnav a {
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
}

.topnav a[aria-current="page"] {
  color: var(--accent);
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.95fr) 250px;
  gap: 18px;
  align-items: start;
}

.input-card,
.metrics-card,
.sidebar-card,
.summary-card,
.about-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 28px;
}

.input-card,
.metrics-card {
  padding: 22px;
}

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

.sidebar-card,
.summary-card,
.about-card {
  padding: 18px;
}

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

textarea,
button {
  font: inherit;
}

textarea {
  width: 100%;
  min-height: 340px;
  padding: 18px;
  resize: vertical;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  line-height: 1.65;
}

button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 14px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.ghost-button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.status {
  min-height: 1.4rem;
  margin-top: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  padding: 16px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.metric-card span {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
}

.output-text {
  margin: 0;
  min-height: 260px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #0d1736;
  color: #e5ecff;
  white-space: pre-wrap;
  line-height: 1.7;
}

.notes-list,
.sidebar ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

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

.inline-link,
.footer a {
  color: var(--accent);
  font-weight: 700;
}

.footer {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 22px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1020px) {
  .dashboard,
  .summary-row,
  .about-grid,
  .hero-strip {
    grid-template-columns: 1fr;
  }

  .hero-strip {
    display: grid;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 18px, 1240px);
  }

  .section-head,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  textarea,
  .output-text {
    min-height: 260px;
  }
}
