:root {
  --ink: #17212b;
  --muted: #637083;
  --line: #d8dee8;
  --panel: #ffffff;
  --wash: #f4f7fb;
  --accent: #116d6e;
  --accent-strong: #0a4d68;
  --gold: #f2b705;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(23, 33, 43, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(135deg, rgba(17, 109, 110, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(242, 183, 5, 0.13), transparent 30%),
    var(--wash);
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(310px, 380px) minmax(0, 1fr);
  gap: 22px;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px;
}

.control-panel,
.workspace {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(216, 222, 232, 0.85);
  box-shadow: var(--shadow);
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  border-radius: 8px;
}

.workspace {
  padding: 24px;
  border-radius: 8px;
  overflow: hidden;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
}

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

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.12;
}

h2 {
  font-size: 24px;
  line-height: 1.18;
}

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

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 109, 110, 0.14);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.actions,
.tool-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.tool-actions button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 42px;
  padding: 0 15px;
  font-weight: 700;
}

.primary-button {
  flex: 1;
  background: var(--accent);
  color: #fff;
}

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

.icon-button {
  width: 44px;
  padding: 0;
  background: #eef3f7;
  color: var(--accent-strong);
  font-size: 22px;
}

.mini-card {
  border: 1px solid #cbd7df;
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfd;
}

.mini-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tool-actions {
  justify-content: flex-end;
}

.tool-actions button {
  background: #eef3f7;
  color: var(--ink);
  border-color: #d6e0e8;
}

.tool-actions button:hover {
  background: #e0eaf0;
}

.status-line {
  margin: 16px 0;
  color: var(--muted);
  font-size: 14px;
}

.question-list {
  display: grid;
  gap: 14px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.question-number {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 30px;
  border-radius: 6px;
  background: rgba(242, 183, 5, 0.22);
  color: #6a4a00;
  font-weight: 800;
}

.delete-question {
  width: 34px;
  height: 34px;
  border: 1px solid #f0c6c2;
  border-radius: 6px;
  background: #fff6f5;
  color: var(--danger);
  font-size: 22px;
  line-height: 1;
}

.question-text {
  min-height: 64px;
  margin-bottom: 12px;
  font-weight: 700;
}

.options {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.option-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
}

.option-letter {
  display: inline-grid;
  place-items: center;
  height: 34px;
  border-radius: 6px;
  background: #edf5f5;
  color: var(--accent-strong);
  font-weight: 800;
}

.answer-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.answers-hidden .answer-row {
  display: none;
}

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

  .toolbar {
    display: grid;
  }

  .tool-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .two-col,
  .answer-row {
    grid-template-columns: 1fr;
  }

  .control-panel,
  .workspace {
    padding: 16px;
  }

  .tool-actions button {
    width: 100%;
  }
}

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

  .app-shell {
    display: block;
    min-height: auto;
    padding: 0;
  }

  .control-panel,
  .toolbar .tool-actions,
  .status-line,
  .delete-question {
    display: none;
  }

  .workspace {
    box-shadow: none;
    border: 0;
    padding: 0;
  }

  .question-card {
    break-inside: avoid;
    border-color: #bbb;
  }

  textarea,
  input,
  select {
    border: 0;
    padding: 0;
    box-shadow: none;
    appearance: none;
  }
}
