:root {
  --bg: #eef2f4;
  --panel: #ffffff;
  --ink: #1f2528;
  --muted: #687078;
  --line: #d5dde2;
  --accent: #0d766e;
  --accent-dark: #07534e;
  --blue: #264f78;
  --rose: #a34455;
  --gold: #a46a14;
  --shadow: 0 24px 70px rgba(30, 43, 52, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(13, 118, 110, 0.13), transparent 42%),
    linear-gradient(240deg, rgba(163, 68, 85, 0.12), transparent 40%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.status {
  min-width: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px 14px;
  color: var(--muted);
  text-align: center;
  box-shadow: 0 8px 28px rgba(52, 45, 36, 0.08);
}

.grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 18px;
}

.output-panel {
  min-height: 710px;
  display: flex;
  flex-direction: column;
}

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

.panel-head h2 {
  margin-bottom: 4px;
  font-size: 1.12rem;
}

.panel-head p,
.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.icon-button,
.actions button {
  min-width: 42px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

textarea {
  min-height: 330px;
  resize: vertical;
  padding: 14px;
  line-height: 1.55;
}

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

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

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

.compact {
  min-width: 0;
}

.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checks legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.94rem;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.primary {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 850;
}

.primary:hover,
.primary:focus-visible {
  background: var(--accent-dark);
}

.output-head {
  align-items: center;
  margin: 0;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.actions {
  display: flex;
  gap: 8px;
}

.notes {
  flex: 1;
  overflow: auto;
  padding: 22px;
}

.empty-state {
  min-height: 560px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 56px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 900;
  box-shadow: 0 16px 40px rgba(13, 118, 110, 0.18);
}

.note-section {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.note-section:last-child {
  border-bottom: 0;
}

.note-section h3 {
  margin-bottom: 10px;
  color: var(--accent-dark);
  font-size: 1.05rem;
}

.note-section p,
.note-section li {
  line-height: 1.65;
}

.note-section ul,
.note-section ol {
  padding-left: 22px;
  margin: 0;
}

.note-section li + li {
  margin-top: 8px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  border-radius: 999px;
  background: rgba(38, 79, 120, 0.1);
  color: var(--blue);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.flashcard {
  border-left: 4px solid var(--rose);
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(163, 68, 85, 0.08);
}

.flashcard strong {
  display: block;
  margin-bottom: 4px;
}

@media (max-width: 880px) {
  .shell {
    padding: 18px;
  }

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

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

  .output-panel {
    min-height: 560px;
  }
}

@media (max-width: 560px) {
  .controls,
  .checks {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .output-head {
    align-items: stretch;
    flex-direction: column;
  }

  .actions button {
    flex: 1;
  }
}
