:root {
  color-scheme: light;
  --ink: #181c20;
  --muted: #626b73;
  --line: #d8dde1;
  --paper: #f7f8f9;
  --panel: #ffffff;
  --soft: #f1f4f6;
  --teal: #d90000;
  --teal-dark: #b10000;
  --gold: #b7791f;
  --rose: #b10000;
  --blue: #176b87;
  --shadow: 0 18px 50px rgba(34, 45, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(217, 0, 0, 0.045), transparent 36%),
    linear-gradient(180deg, #fbfbfc 0%, #eef1f3 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  min-height: 100vh;
}

.setup-panel {
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--line);
  padding: 28px;
}

.workspace-panel {
  padding: 28px;
  min-width: 0;
}

.brand-row,
.toolbar {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.brand-row h1,
.toolbar h2 {
  font-size: 24px;
  line-height: 1.15;
  margin: 4px 0 0;
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.brand-lockup img {
  display: block;
  height: 52px;
  object-fit: contain;
  object-position: left center;
  width: 208px;
}

.toolbar h2 {
  font-size: 22px;
}

.eyebrow,
.item-kicker {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 750;
  margin: 0;
  text-transform: uppercase;
}

.status-pill {
  align-items: center;
  background: #fff0f0;
  border: 1px solid #efc4c4;
  border-radius: 999px;
  color: var(--teal-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  min-height: 28px;
  padding: 5px 10px;
  white-space: nowrap;
}

.access-strip {
  align-items: center;
  background: #f2f5f7;
  border: 1px solid #d8dde1;
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 18px;
  padding: 10px 12px;
}

.access-strip > div {
  display: grid;
  gap: 2px;
}

.access-strip strong {
  font-size: 12px;
}

.access-strip span {
  color: var(--muted);
  font-size: 11px;
}

.access-strip a {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

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

.span-all {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.item-toggles legend {
  color: #364044;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #cfd7d3;
  border-radius: 7px;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  line-height: 1.45;
  min-height: 190px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
  outline: 0;
}

.item-toggles {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 14px;
}

.item-toggles label {
  align-items: center;
  color: #303a3e;
  display: flex;
  font-size: 13px;
  gap: 8px;
  min-width: 0;
}

.item-toggles label.is-disabled {
  color: #8a9699;
}

.item-toggles input {
  accent-color: var(--teal);
  min-height: auto;
  width: auto;
}

.teks-picker {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
}

.teks-picker legend {
  color: #364044;
  font-size: 13px;
  font-weight: 750;
}

.teks-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.teks-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.teks-option {
  align-items: start;
  background: #fbfbf8;
  border: 1px solid #e0e5e1;
  border-radius: 7px;
  display: grid;
  gap: 7px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 10px;
}

.teks-option.is-disabled {
  color: #839094;
}

.teks-option input {
  accent-color: var(--teal);
  margin-top: 3px;
  min-height: auto;
  width: auto;
}

.teks-code {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
}

.teks-text {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 2px;
}

.teks-meta {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 5px;
  text-transform: uppercase;
}

.actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.primary,
.secondary,
.icon-button {
  border-radius: 7px;
  font-weight: 800;
  min-height: 42px;
  padding: 10px 14px;
}

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

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

.secondary {
  background: #f1f4f6;
  border: 1px solid #d4dce1;
  color: var(--teal-dark);
}

.secondary:hover {
  background: #dfeae5;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.view-toggle {
  background: #f1f4f6;
  border: 1px solid #d4dce1;
  border-radius: 7px;
  display: inline-flex;
  overflow: hidden;
}

.view-button {
  background: transparent;
  color: #334044;
  font-size: 12px;
  font-weight: 850;
  min-height: 42px;
  padding: 10px 12px;
}

.view-button.is-active {
  background: var(--teal);
  color: #fff;
}

.icon-button {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  min-width: 54px;
}

.icon-button:hover {
  border-color: var(--teal);
}

.icon-button.danger {
  color: var(--rose);
}

.icon-button.source-action {
  background: #fff1f1;
  border-color: #e6b9b9;
  color: var(--teal-dark);
}

.metrics-strip {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  margin: 22px 0;
}

.metrics-strip div {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metrics-strip span {
  display: block;
  font-size: 24px;
  font-weight: 850;
}

.metrics-strip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.canvas-row {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
}

.workspace-panel.is-shell-output .canvas-row {
  grid-template-columns: 1fr;
}

.workspace-panel.is-shell-output .stimulus-preview {
  display: none;
}

.stimulus-preview {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  position: sticky;
  top: 18px;
}

.stimulus-preview h3 {
  font-size: 16px;
  margin: 0 0 12px;
}

.mini-map {
  aspect-ratio: 1.45;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), transparent 55%),
    linear-gradient(45deg, transparent 22%, rgba(183, 121, 31, 0.18) 22%, rgba(183, 121, 31, 0.18) 24%, transparent 24%),
    #f9fbf7;
  border: 1px solid #c9d6d0;
  border-radius: 8px;
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
}

.mini-map span {
  background: var(--teal);
  border: 2px solid #fff;
  border-radius: 999px;
  height: 13px;
  position: absolute;
  width: 13px;
}

.mini-map span:nth-child(1) { left: 22%; top: 30%; }
.mini-map span:nth-child(2) { left: 58%; top: 24%; background: var(--gold); }
.mini-map span:nth-child(3) { left: 42%; top: 62%; background: var(--blue); }
.mini-map span:nth-child(4) { left: 76%; top: 54%; background: var(--rose); }

.stimulus-list {
  display: grid;
  gap: 8px;
}

.stimulus-chip {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #334044;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  min-height: 34px;
  padding: 7px 9px;
}

.stimulus-chip strong {
  color: var(--teal-dark);
}

.item-stream {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.empty-state {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed #b9c5bf;
  border-radius: 8px;
  display: grid;
  min-height: 300px;
  padding: 28px;
}

.empty-state h3 {
  margin: 0;
}

.empty-state p {
  color: var(--muted);
  line-height: 1.5;
  margin: 6px 0 0;
  max-width: 560px;
}

.test-shell {
  background: #fff;
  border: 1px solid #a8b5bd;
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(30, 44, 52, 0.12);
  color: #1b1f23;
  overflow: hidden;
}

.shell-topbar {
  align-items: center;
  background: #f5f7f7;
  border-bottom: 1px solid #9eaab2;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(72px, 150px) minmax(180px, 1fr) auto auto auto auto;
  min-height: 32px;
  padding: 4px 7px;
  white-space: nowrap;
}

.shell-topbar strong,
.shell-topbar span {
  font-size: 12px;
}

.shell-items-button,
.shell-help-button,
.shell-pause-button {
  background: #fff;
  border: 1px solid #919da4;
  border-radius: 3px;
  color: #172127;
  font-size: 12px;
  font-weight: 800;
  min-height: 24px;
  padding: 2px 7px;
}

.shell-pause-button {
  background: #fff4d8;
  color: #8a5b00;
}

.shell-progress-meter {
  background: #fff;
  border: 1px solid #8d989f;
  height: 16px;
  overflow: hidden;
}

.shell-progress-meter span {
  background: #166b9b;
  display: block;
  height: 100%;
}

.shell-tool-row {
  align-items: center;
  border-bottom: 1px solid #d2d9dd;
  display: flex;
  gap: 7px;
  min-height: 58px;
  overflow-x: auto;
  padding: 5px 9px;
}

.shell-tool {
  align-items: center;
  background: transparent;
  color: #1f313b;
  display: grid;
  font-size: 10px;
  gap: 2px;
  justify-items: center;
  min-width: 50px;
  padding: 2px 3px;
}

.shell-tool span {
  align-items: center;
  background: #fff;
  border: 2px solid #9fd7c8;
  border-radius: 999px;
  color: #14906f;
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.shell-tool.is-disabled {
  opacity: 0.38;
}

.shell-tool-divider {
  background: #c6d0d6;
  flex: 0 0 1px;
  height: 38px;
}

.shell-dot-row {
  align-items: center;
  border-bottom: 2px solid #7aa6b8;
  display: flex;
  gap: 7px;
  min-height: 20px;
  overflow-x: auto;
  padding: 5px 18px;
}

.shell-dot {
  background: #111;
  border: 0;
  border-radius: 2px;
  height: 5px;
  min-height: 5px;
  overflow: hidden;
  padding: 0;
  text-indent: -999px;
  width: 5px;
}

.shell-dot.is-seen {
  background: #75d6ee;
  outline: 1px solid #21a9c8;
}

.shell-dot.is-current {
  background: #111;
  height: 7px;
  width: 38px;
}

.shell-page {
  background: #fff;
}

.shell-question-header {
  align-items: stretch;
  border-bottom: 1px solid #82aabe;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 62px;
}

.shell-number {
  align-items: center;
  background: #116c8a;
  color: #fff;
  display: inline-flex;
  font-size: 22px;
  font-weight: 850;
  justify-content: center;
  margin: 10px 14px;
  min-width: 44px;
}

.shell-save-row {
  align-items: center;
  border-bottom: 1px solid #cad6dc;
  color: #60707a;
  display: flex;
  font-size: 11px;
  gap: 14px;
  min-height: 28px;
  text-transform: uppercase;
}

.shell-save-row span {
  text-transform: none;
}

.shell-item-meta {
  color: #33434d;
  font-size: 12px;
  font-weight: 760;
  padding-top: 8px;
}

.shell-context-button {
  align-self: center;
  background: #fff;
  border: 2px solid #c4d7df;
  border-radius: 999px;
  color: #45545c;
  font-size: 22px;
  height: 42px;
  margin-right: 13px;
  width: 42px;
}

.shell-content {
  display: grid;
  min-height: 500px;
}

.shell-content.has-stimulus {
  grid-template-columns: minmax(250px, 44%) minmax(0, 1fr);
}

.shell-content.single-pane {
  grid-template-columns: 1fr;
}

.shell-stimulus {
  border: 1px solid #8c969c;
  display: grid;
  gap: 9px;
  margin: 0 auto 18px;
  max-width: 820px;
  min-width: 0;
  padding: 13px 16px;
  width: 100%;
}

.shell-pane-title {
  color: #25333a;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  text-align: left;
}

.shell-stimulus-text {
  font-size: 14px;
  line-height: 1.48;
}

.shell-source-image {
  background: #fff;
  border: 1px solid #d4d9dd;
  margin: 0;
  padding: 8px;
  text-align: center;
}

.shell-source-image img {
  display: block;
  height: auto;
  margin: 0 auto;
  max-height: 430px;
  max-width: 100%;
  object-fit: contain;
}

.source-dialog {
  background: #fff;
  border: 1px solid #cfd5da;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 22, 27, 0.24);
  color: var(--ink);
  max-height: min(88vh, 900px);
  max-width: 980px;
  padding: 0;
  width: calc(100% - 32px);
}

.source-dialog::backdrop {
  background: rgba(18, 23, 27, 0.58);
}

.source-dialog-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 20px 22px;
}

.source-dialog-header h2 {
  font-size: 20px;
  margin: 4px 0 0;
}

.dialog-close {
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 8px;
}

.source-search-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 210px auto;
  padding: 20px 22px 12px;
}

.source-search-button {
  min-width: 92px;
}

.source-policy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  padding: 0 22px 16px;
}

.source-results {
  display: grid;
  gap: 0;
  max-height: 590px;
  overflow: auto;
}

.source-result {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  padding: 18px 22px;
}

.source-result img,
.source-result-placeholder {
  background: #eef1f3;
  border: 1px solid #d7dde1;
  display: block;
  height: 112px;
  object-fit: contain;
  width: 150px;
}

.source-result-placeholder {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  justify-content: center;
  padding: 12px;
  text-align: center;
}

.source-result h3 {
  font-size: 15px;
  line-height: 1.3;
  margin: 0 0 6px;
}

.source-result p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 4px 0;
}

.source-result .rights-approved {
  color: #176b4b;
  font-weight: 800;
}

.source-result .rights-review-required {
  color: #8a5b00;
  font-weight: 800;
}

.source-result-actions {
  display: grid;
  gap: 8px;
  min-width: 110px;
}

.source-result-actions a,
.source-result-actions button {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  padding: 9px 10px;
  text-align: center;
  text-decoration: none;
}

.source-result-actions a {
  border: 1px solid var(--line);
  color: var(--ink);
}

.source-empty {
  color: var(--muted);
  padding: 36px 22px;
  text-align: center;
}

.shell-citation {
  color: #677780;
  font-size: 12px;
  font-style: italic;
  text-align: right;
}

.shell-map-visual,
.shell-graph-visual,
.shell-timeline-visual,
.shell-table-visual {
  background: #f4f6f7;
  border: 1px solid #becad1;
  border-radius: 4px;
  min-height: 150px;
}

.shell-map-visual {
  background:
    linear-gradient(135deg, rgba(21, 104, 138, 0.2), transparent 54%),
    linear-gradient(45deg, transparent 28%, rgba(110, 141, 91, 0.18) 28%, rgba(110, 141, 91, 0.18) 34%, transparent 34%),
    #f9faf8;
  position: relative;
}

.shell-map-visual span {
  background: #116c8a;
  border: 2px solid #fff;
  border-radius: 999px;
  height: 14px;
  position: absolute;
  width: 14px;
}

.shell-map-visual span:nth-child(1) { left: 24%; top: 34%; }
.shell-map-visual span:nth-child(2) { left: 58%; top: 25%; }
.shell-map-visual span:nth-child(3) { left: 44%; top: 62%; }
.shell-map-visual span:nth-child(4) { left: 78%; top: 55%; }

.shell-graph-visual {
  align-items: end;
  display: flex;
  gap: 18px;
  padding: 18px;
}

.shell-graph-visual span {
  background: #116c8a;
  flex: 1;
}

.shell-timeline-visual {
  align-items: center;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 20px;
  position: relative;
}

.shell-timeline-visual::before {
  background: #637682;
  content: "";
  height: 3px;
  left: 24px;
  position: absolute;
  right: 24px;
}

.shell-timeline-visual span {
  background: #fff;
  border: 3px solid #116c8a;
  border-radius: 999px;
  height: 18px;
  justify-self: center;
  position: relative;
  width: 18px;
}

.shell-table-visual {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  padding: 16px;
}

.shell-table-visual span {
  background: #fff;
  border: 1px solid #cfd8dd;
}

.shell-question-pane {
  justify-self: center;
  max-width: 900px;
  min-width: 0;
  padding: 30px 38px 42px;
  width: 100%;
}

.shell-prompt {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
  margin-bottom: 16px;
}

.shell-response-list {
  display: grid;
  gap: 12px;
}

.shell-part-heading {
  color: #33434d;
  font-size: 14px;
  font-weight: 850;
  margin-top: 8px;
  text-transform: uppercase;
}

.shell-choice {
  align-items: center;
  background: #fff;
  border: 1px solid #e3e8eb;
  border-radius: 7px;
  box-shadow: 0 1px 5px rgba(26, 36, 43, 0.1);
  color: #15191c;
  display: grid;
  font-size: 14px;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  justify-items: start;
  line-height: 1.35;
  min-height: 42px;
  padding: 8px 12px;
  text-align: left;
}

.shell-choice:hover,
.hot-text-select:hover,
.hotspot-choice:hover,
.drop-token:hover,
.grid-cell:hover {
  border-color: #56a6bc;
}

.shell-choice.is-selected,
.hot-text-select.is-selected,
.hotspot-choice.is-selected,
.drop-token.is-selected {
  background: #e8f5f8;
  border-color: #1c7d9b;
  box-shadow: 0 0 0 2px rgba(28, 125, 155, 0.18);
}

.shell-choice-bubble {
  align-items: center;
  border: 2px solid #b8c4cb;
  border-radius: 999px;
  color: #50616b;
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.shell-choice.is-checkbox .shell-choice-bubble {
  border-radius: 4px;
}

.shell-choice.is-selected .shell-choice-bubble,
.hotspot-choice.is-selected strong {
  background: #146f8c;
  border-color: #146f8c;
  color: #fff;
}

.shell-hot-text {
  background: #fbfcfc;
  border: 1px solid #d9e1e5;
  border-radius: 5px;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.hot-text-select {
  background: #fff;
  border: 1px solid #d8e0e4;
  border-radius: 4px;
  color: #1e282e;
  font-size: 14px;
  line-height: 1.45;
  padding: 10px 12px;
  text-align: left;
}

.hot-text-select span {
  color: #116c8a;
  font-weight: 850;
  margin-right: 8px;
}

.shell-hotspot {
  display: grid;
  gap: 16px;
}

.hotspot-canvas {
  aspect-ratio: 1.9;
  background: #fff;
  border: 1px solid #bdc9cf;
  border-radius: 4px;
  position: relative;
}

.hotspot-canvas::before,
.hotspot-canvas::after {
  background: #9faab0;
  content: "";
  height: 1px;
  left: 25%;
  position: absolute;
  right: 25%;
  top: 50%;
}

.hotspot-canvas::after {
  transform: rotate(28deg);
}

.hotspot-center {
  align-items: center;
  background: #fff;
  border: 2px solid #9da9af;
  border-radius: 999px;
  color: #24333b;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  height: 58px;
  justify-content: center;
  left: 50%;
  max-width: 180px;
  padding: 0 16px;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.hotspot-marker {
  align-items: center;
  background: #fff;
  border: 3px solid #116c8a;
  border-radius: 4px;
  color: #116c8a;
  display: inline-flex;
  font-weight: 900;
  height: 44px;
  justify-content: center;
  position: absolute;
  width: 92px;
  z-index: 2;
}

.marker-a { left: 7%; top: 18%; }
.marker-b { right: 7%; top: 18%; }
.marker-c { left: 50%; top: 68%; transform: translateX(-50%); }

.hotspot-options {
  display: grid;
  gap: 10px;
}

.hotspot-choice {
  align-items: start;
  background: #fff;
  border: 1px solid #d8e0e4;
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 10px;
  text-align: left;
}

.hotspot-choice strong {
  align-items: center;
  border: 2px solid #b8c4cb;
  border-radius: 999px;
  display: inline-flex;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.shell-dragdrop {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1fr);
}

.drop-bank,
.drop-targets {
  display: grid;
  gap: 10px;
}

.drop-token {
  background: #fff;
  border: 1px solid #cfd8dd;
  border-radius: 6px;
  box-shadow: 0 1px 5px rgba(26, 36, 43, 0.1);
  min-height: 48px;
  padding: 10px;
  text-align: left;
}

.drop-target {
  background: #f7fafb;
  border: 2px dashed #9fb3bd;
  border-radius: 6px;
  min-height: 78px;
  padding: 12px;
}

.drop-target strong,
.drop-target span {
  display: block;
}

.drop-target span {
  color: #6f7d85;
  font-size: 12px;
  margin-top: 8px;
}

.shell-match-grid {
  overflow-x: auto;
}

.shell-match-grid table {
  border-collapse: collapse;
  min-width: 560px;
  width: 100%;
}

.shell-match-grid th,
.shell-match-grid td {
  border: 1px solid #c9d3d8;
  padding: 10px;
  text-align: center;
}

.shell-match-grid tbody th {
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
}

.shell-match-grid thead th {
  background: #edf3f5;
  color: #24333b;
  font-size: 13px;
}

.grid-cell {
  background: #fff;
  border: 2px solid #aebdc5;
  border-radius: 3px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  width: 18px;
}

.grid-cell.is-selected {
  background: #146f8c;
  border-color: #146f8c;
}

.shell-short-response {
  border: 1px solid #c8d2d8;
  border-radius: 5px;
  overflow: hidden;
}

.scr-toolbar {
  background: #edf1f3;
  border-bottom: 1px solid #c8d2d8;
  display: flex;
  gap: 4px;
  padding: 6px;
}

.scr-toolbar button {
  background: #fff;
  border: 1px solid #b8c5cc;
  border-radius: 3px;
  min-height: 30px;
  min-width: 32px;
}

.shell-short-response textarea {
  border: 0;
  border-radius: 0;
  min-height: 210px;
  resize: vertical;
}

.shell-inline-choice {
  background: #fbfcfc;
  border: 1px solid #d8e0e4;
  border-radius: 5px;
  font-size: 14px;
  line-height: 1.7;
  padding: 16px;
}

.shell-inline-choice select {
  display: inline-block;
  margin: 0 6px;
  min-height: 34px;
  padding: 4px 30px 4px 8px;
  width: auto;
}

.shell-footer {
  align-items: center;
  background: #f5f7f7;
  border-top: 1px solid #c8d2d8;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  padding: 10px 14px;
}

.shell-footer-pages {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.shell-footer-pages button {
  background: #fff;
  border: 1px solid #b7c4ca;
  border-radius: 999px;
  color: #33444d;
  font-size: 12px;
  font-weight: 800;
  height: 28px;
  min-height: 28px;
  padding: 0;
  width: 28px;
}

.shell-footer-pages button.is-current {
  background: #146f8c;
  color: #fff;
}

.shell-footer-button {
  background: #fff;
  border: 1px solid #aebbc2;
  border-radius: 4px;
  color: #24333b;
  font-weight: 850;
  min-height: 36px;
  padding: 7px 12px;
}

.shell-footer-button.is-primary {
  background: #3e454a;
  color: #fff;
}

.shell-footer-button:disabled {
  opacity: 0.45;
}

.item-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 13px;
  padding: 18px;
}

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

.item-header h3 {
  font-size: 18px;
  line-height: 1.25;
  margin: 4px 0 0;
}

.point-badge {
  background: #f7efd8;
  border: 1px solid #ead7a7;
  border-radius: 999px;
  color: #7a4d0d;
  font-size: 12px;
  font-weight: 850;
  padding: 6px 9px;
  white-space: nowrap;
}

.stimulus-box {
  background: var(--soft);
  border: 1px solid #cfddd6;
  border-radius: 7px;
  color: #303b3f;
  line-height: 1.48;
  padding: 13px;
}

.stimulus-box:empty {
  display: none;
}

.prompt {
  font-weight: 760;
  line-height: 1.45;
}

.choice-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.choice-list li {
  align-items: start;
  background: #fbfbf8;
  border: 1px solid #e0e5e1;
  border-radius: 7px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  line-height: 1.4;
  padding: 10px;
}

.choice-group {
  background: #edf3ef;
  border: 1px solid #d4dfd9;
  border-radius: 999px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 850;
  grid-column: 1 / -1;
  justify-self: start;
  padding: 3px 8px;
  text-transform: uppercase;
}

.choice-label {
  align-items: center;
  background: #eef4f0;
  border: 1px solid #cfded7;
  border-radius: 999px;
  color: var(--teal-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0 7px;
}

.choice-text {
  min-width: 0;
}

.choice-text:only-child {
  grid-column: 1 / -1;
}

details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

summary {
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 800;
}

.teacher-key {
  color: #2f393d;
  display: grid;
  gap: 8px;
  line-height: 1.45;
  margin-top: 10px;
}

.teacher-key code {
  background: #eef4f0;
  border: 1px solid #d4dfd9;
  border-radius: 5px;
  padding: 2px 5px;
}

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

  .setup-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .stimulus-preview {
    position: static;
  }

  .shell-topbar {
    grid-template-columns: auto minmax(70px, 1fr) auto auto;
  }

  .shell-topbar strong,
  .shell-topbar > span {
    display: none;
  }

  .shell-content.has-stimulus {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .setup-panel,
  .workspace-panel {
    padding: 18px;
  }

  .control-grid,
  .item-toggles,
  .actions,
  .metrics-strip {
    grid-template-columns: 1fr;
  }

  .brand-row,
  .toolbar,
  .item-header {
    align-items: stretch;
    flex-direction: column;
  }

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

  .brand-lockup img {
    height: 44px;
    width: 176px;
  }

  .toolbar-actions {
    justify-content: start;
  }

  .view-toggle {
    width: 100%;
  }

  .view-button {
    flex: 1;
  }

  .shell-tool-row {
    min-height: 52px;
  }

  .shell-tool {
    min-width: 44px;
  }

  .shell-tool span {
    height: 28px;
    width: 28px;
  }

  .shell-question-header,
  .shell-footer {
    grid-template-columns: 1fr;
  }

  .shell-number {
    justify-self: start;
  }

  .shell-context-button {
    display: none;
  }

  .shell-stimulus,
  .shell-question-pane {
    padding: 20px;
  }

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

  .source-search-form,
  .source-result {
    grid-template-columns: 1fr;
  }

  .source-result img,
  .source-result-placeholder {
    height: 180px;
    width: 100%;
  }
}

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

  .setup-panel,
  .toolbar-actions,
  .metrics-strip,
  .stimulus-preview,
  .source-dialog {
    display: none;
  }

  .app-shell,
  .canvas-row {
    display: block;
  }

  .workspace-panel {
    padding: 0;
  }

  .item-card {
    box-shadow: none;
    break-inside: avoid;
    margin-bottom: 12px;
  }
}
