:root {
  --bg: #f4efe5;
  --panel: #fffaf2;
  --ink: #10233c;
  --muted: #5b6b7f;
  --line: #d8cdb8;
  --accent: #0c5c7e;
  --accent-soft: #d7edf5;
  --accent-deep: #071c2b;
  --gold: #d3a34b;
  --shadow: 0 18px 50px rgba(16, 35, 60, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(12, 92, 126, 0.12), transparent 26%),
    linear-gradient(180deg, #f7f1e7 0%, #efe7d9 100%);
  color: var(--ink);
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.app-shell {
  max-width: 1400px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  display: grid;
  gap: 16px;
}

.brand,
.status-card {
  background: rgba(255, 250, 242, 0.94);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.language-switcher {
  width: 100%;
}

.workspace {
  min-width: 0;
}

.hero {
  padding: 12px 0 20px;
}

.hero-app {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding-top: 0;
}

.hero-title {
  font-size: clamp(34px, 6vw, 64px);
  line-height: 0.96;
  max-width: 760px;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 18px;
}

.topnav a {
  text-decoration: none;
  color: var(--accent);
  border: 1px solid rgba(12, 92, 126, 0.2);
  background: rgba(215, 237, 245, 0.7);
  padding: 10px 14px;
  border-radius: 999px;
}

.topnav a.active {
  background: var(--accent);
  color: white;
}

.nav-rail {
  display: grid;
  gap: 10px;
}

.nav-rail a {
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 250, 242, 0.94);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.nav-rail a.active {
  background: var(--accent);
  color: white;
}

.banner {
  background: #10233c;
  color: #fff2cf;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 6vw, 56px);
  line-height: 0.98;
  max-width: 720px;
}

.lede,
.section-head p,
.muted {
  color: var(--muted);
}

.compact {
  font-size: 13px;
}

.panel {
  background: rgba(255, 250, 242, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 18px;
}

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

.compact-form .grid {
  align-items: start;
}

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

.feature-card,
.next-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(245, 236, 222, 0.94));
}

.feature-card h3,
.next-card h3 {
  margin: 0 0 8px;
}

.feature-card a {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.card-kicker,
.status-label {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
}

.emphasis-card {
  background: linear-gradient(180deg, rgba(16, 35, 60, 0.98), rgba(12, 92, 126, 0.92));
  color: white;
}

.emphasis-card .card-kicker,
.emphasis-card p {
  color: rgba(255, 255, 255, 0.86);
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.auth-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(245, 236, 222, 0.94));
}

.auth-card h3 {
  margin: 0;
}

.auth-status-card .output {
  min-height: 180px;
}

.capability {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fffdf8;
  display: grid;
  gap: 6px;
}

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

.wide {
  grid-column: 1 / -1;
}

label span {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--muted);
}

input,
select,
textarea,
button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  font: inherit;
}

input,
select,
textarea {
  padding: 12px 14px;
  background: #fffdf8;
  color: var(--ink);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.actions,
.preset-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

button {
  background: white;
  color: var(--ink);
  cursor: pointer;
  padding: 12px 16px;
}

button.primary,
.pill,
.inline-button,
.cta {
  background: var(--accent-soft);
  border-color: rgba(12, 92, 126, 0.2);
  color: var(--accent);
}

.pill {
  width: auto;
  max-width: 100%;
}

.inline-button,
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(12, 92, 126, 0.2);
  font-weight: 700;
}

.primary-link {
  background: var(--accent);
  color: white;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.mode-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(12, 92, 126, 0.2);
  background: #edf4f7;
  color: var(--accent);
}

.mode-pill.final {
  background: #fff0d6;
  color: #a15a00;
}

.mode-pill.normal {
  background: #d7edf5;
  color: var(--accent-deep);
}

.output {
  margin: 12px 0 0;
  padding: 14px;
  min-height: 340px;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: #203040;
  overflow: auto;
}

.small-output {
  min-height: 220px;
}

.health-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f0eadf;
  border: 1px solid var(--line);
  font-weight: 700;
}

.health-badge.ok {
  background: #d7edf5;
  color: var(--accent-deep);
}

.health-badge.bad {
  background: #f8d8d2;
  color: #7b2217;
}

.mini-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.banner-neutral {
  background: #10233c;
  color: #fff2cf;
}

.banner-warning {
  background: #f4a63d;
  color: #2c1800;
}

.banner-danger {
  background: #cb4939;
  color: #fff6f3;
}

.banner-success {
  background: #1f845a;
  color: #f0fff7;
}

.banner-pulse {
  animation: bannerPulse 1.2s ease-in-out infinite;
}

@keyframes bannerPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.01); opacity: 0.84; }
}

@media (max-width: 820px) {
  .app-shell,
  .grid,
  .dual,
  .overview-grid,
  .capability-grid,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    gap: 16px;
  }

  .sidebar {
    position: static;
  }

  .hero-app,
  .grid,
  .dual,
  .overview-grid,
  .capability-grid {
    grid-template-columns: 1fr;
  }

  .hero-app {
    display: grid;
  }
}
