:root {
  color-scheme: light;
  --bg: #f6efe5;
  --panel: rgba(255, 255, 255, 0.78);
  --ink: #2f241d;
  --muted: #6e5b4d;
  --line: rgba(85, 61, 42, 0.18);
  --primary: #117d72;
  --primary-dark: #0c5e57;
  --accent: #c75f2a;
  --accent-soft: #f5dcc1;
  --soft: #edf6ef;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(17, 125, 114, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(199, 95, 42, 0.1), transparent 36%),
    var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0;
}

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

.brand img {
  width: 42px;
  height: 42px;
}

.topbar-actions,
.example-grid,
.tool-links,
.aid-print-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 22px;
  width: min(1220px, calc(100% - 32px));
  margin: 18px auto 60px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(87, 62, 43, 0.1);
}

.editor-panel,
.result-panel {
  padding: 22px;
}

.section-header {
  margin-bottom: 18px;
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.08;
}

h2 {
  font-size: 1.45rem;
}

.section-header p,
.status,
.aid-section p,
.aid-section li {
  color: var(--muted);
  line-height: 1.55;
}

.editor-form {
  display: grid;
  gap: 16px;
}

.field,
.field-grid {
  display: grid;
  gap: 8px;
}

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

.field {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 850;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  padding: 12px 13px;
}

button,
.primary-button,
.secondary-button,
.tool-links a,
.aid-print-links a {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  padding: 0 18px;
}

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

.secondary-button,
.tool-links a,
.aid-print-links a,
.example-grid button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: var(--line);
  background: #fffaf4;
  color: var(--ink);
  padding: 0 14px;
}

.example-grid button {
  background: var(--accent-soft);
}

.wide {
  width: 100%;
}

.tool-links {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.tool-links a {
  flex: 1 1 160px;
}

.aid-package {
  display: grid;
  gap: 16px;
}

.aid-package-header,
.aid-section,
.aid-branding {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 244, 0.82);
  padding: 18px;
}

.aid-package-header {
  background:
    linear-gradient(135deg, rgba(17, 125, 114, 0.16), transparent 58%),
    #fffaf4;
}

.aid-package-header p {
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-weight: 900;
}

.aid-package-header h2 {
  margin-bottom: 8px;
  font-size: 1.8rem;
}

.aid-section h3 {
  margin-bottom: 10px;
}

.aid-section ul {
  margin: 0;
  padding-left: 22px;
}

.aid-plan {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aid-plan li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
}

.aid-plan li > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.aid-plan strong,
.aid-plan small {
  display: block;
}

.aid-plan small {
  margin: 4px 0;
  color: var(--accent);
  font-weight: 900;
}

.aid-plan p {
  margin-bottom: 0;
}

.aid-word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.aid-word-bank span {
  border-radius: 8px;
  background: var(--soft);
  color: var(--primary-dark);
  font-weight: 900;
  padding: 8px 10px;
}

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

.aid-variants article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  padding: 14px;
}

.aid-variants h4,
.aid-variants p {
  margin-bottom: 0;
}

.aid-variants h4 {
  margin-bottom: 8px;
}

.aid-parent-note {
  background: #f8eadb;
}

.aid-branding {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

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

  .aid-variants > div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .secondary-button,
  .primary-button {
    width: 100%;
  }

  .app-shell,
  .topbar {
    width: min(100% - 28px, 1220px);
  }

  .editor-panel,
  .result-panel {
    padding: 18px;
  }

  .field-grid,
  .result-header {
    grid-template-columns: 1fr;
  }

  .result-header {
    display: grid;
  }

  h1 {
    font-size: 1.78rem;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .editor-panel,
  .result-header {
    display: none !important;
  }

  .app-shell {
    display: block;
    width: 100%;
    margin: 0;
  }

  .result-panel,
  .aid-package-header,
  .aid-section,
  .aid-branding {
    border-color: #d8d1c6;
    box-shadow: none;
  }
}
