/* ============================================
   GENRE SWAP ACTIVITIES — shared styles
   Builds on ../../css/style.css tokens
   ============================================ */

.gs-hero {
  background: var(--surface);
  border-bottom: 1px solid rgba(150,216,216,0.08);
  padding: 56px 16px 40px;
  text-align: center;
}
.gs-kicker {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--shadow-blue);
}
.gs-kicker b { color: var(--ice-blue); font-weight: 700; }
.gs-hero h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.3rem, 6vw, 3.6rem);
  text-transform: none;
  letter-spacing: -0.01em;
  margin-top: 10px;
}
.gs-hero h1 em { font-style: italic; color: var(--ice-blue); }
.gs-hero .gs-question {
  margin: 14px auto 0;
  max-width: 560px;
  color: var(--fog);
  font-size: 1.02rem;
}

.gs-wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 96px; }

/* --- Intro / student info --- */
.gs-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 32px;
}
.gs-panel {
  background: var(--surface-card);
  border: 1px solid rgba(150,216,216,0.1);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}
.gs-panel h3 { color: var(--ice-blue); font-size: 1rem; margin-bottom: 8px; }
.gs-panel p { font-size: 0.95rem; }
.gs-panel p + p { margin-top: 10px; }
.gs-target { color: var(--ice-white); }
.gs-who { display: grid; grid-template-columns: 1fr 90px; gap: 12px; }
.gs-who .gs-field:first-child { grid-column: 1 / -1; }
.gs-status {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--shadow-blue);
}
.gs-status.warn { color: #f0b46a; }

/* --- Steps --- */
.gs-step { margin-top: 64px; }
.gs-step-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(150,216,216,0.12);
}
.gs-step-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--deep-sea);
  background: var(--ice-blue);
  border-radius: 100px;
  padding: 2px 10px;
  flex: none;
}
.gs-step-head h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
.gs-step-head p { margin-left: auto; color: var(--shadow-blue); font-size: 0.88rem; text-align: right; }
.gs-sub { margin: 36px 0 12px; color: var(--ice-blue); font-size: 1.05rem; }
.gs-help { color: var(--shadow-blue); font-size: 0.9rem; margin-bottom: 14px; }

/* --- Fields --- */
.gs-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gs-field + .gs-field { margin-top: 14px; }
.gs-who .gs-field + .gs-field { margin-top: 0; }
.gs-field > label, .gs-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--shadow-blue);
}
.gs-field > label small, .gs-label small {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--boundless);
  font-size: 0.78rem;
  margin-left: 6px;
}
.gs-input, .gs-wrap input[type="text"], .gs-wrap input[type="number"], .gs-wrap select, .gs-wrap textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ice-white);
  background: rgba(0,13,23,0.55);
  border: 1px solid rgba(150,216,216,0.18);
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.gs-wrap textarea { min-height: 84px; resize: vertical; line-height: 1.55; overflow: hidden; }
.gs-wrap select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--shadow-blue) 50%), linear-gradient(135deg, var(--shadow-blue) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.gs-wrap input:focus, .gs-wrap select:focus, .gs-wrap textarea:focus {
  outline: none;
  border-color: var(--ice-blue);
  box-shadow: 0 0 0 3px var(--ice-blue-dim);
}
.gs-wrap ::placeholder { color: var(--boundless); opacity: 1; }

.gs-meter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.78rem;
  color: var(--shadow-blue);
}
.gs-meter span.ok { color: #8fd6a4; }
.gs-meter span.no { color: #f0b46a; }
.gs-hint {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #f0b46a;
  background: rgba(240,180,106,0.08);
  border-left: 3px solid #f0b46a;
  border-radius: 0 6px 6px 0;
  padding: 7px 10px;
}
.gs-hint:empty { display: none; }

.gs-starters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.gs-chip {
  font: inherit;
  font-size: 0.8rem;
  color: var(--ice-blue);
  background: var(--ice-blue-dim);
  border: 1px solid transparent;
  border-radius: 100px;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.gs-chip:hover { border-color: var(--ice-blue); }

/* --- Readings + highlighter --- */
.gs-tools {
  position: sticky;
  top: calc(var(--nav-height) + 8px);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 18px;
  background: var(--deep-sea-90);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(150,216,216,0.14);
  border-radius: 100px;
}
.gs-tools-label { font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--shadow-blue); padding: 0 6px; }
.gs-tool {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fog);
  background: transparent;
  border: 1px solid rgba(150,216,216,0.2);
  border-radius: 100px;
  padding: 5px 12px 5px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.gs-tool i {
  font-style: normal;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--mk);
  color: var(--deep-sea);
}
.gs-tool[aria-pressed="true"] { border-color: var(--mk, var(--ice-blue)); color: #fff; background: rgba(255,255,255,0.06); }
.gs-tool.erase { --mk: var(--boundless); }
.gs-tool .n { font-size: 0.75rem; color: var(--shadow-blue); font-weight: 500; }

.gs-readings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gs-reading {
  background: var(--surface-card);
  border: 1px solid rgba(150,216,216,0.08);
  border-radius: var(--radius-md);
  padding: 20px 22px 22px;
}
.gs-reading header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.gs-reading .letter {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--ice-blue);
}
.gs-reading h3 { color: var(--ice-white); font-size: 1.05rem; }
.gs-reading p { color: var(--fog); font-size: 0.96rem; line-height: 1.7; max-width: none; }
.gs-s {
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.15s;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.gs-s:hover { background-color: rgba(150,216,216,0.07); }
.gs-s[data-mark] {
  color: #fff;
  background-color: rgba(150,216,216,0.22);
  background-color: color-mix(in srgb, var(--mk) 28%, transparent);
  box-shadow: inset 0 -2px 0 var(--mk);
  padding: 1px 0;
}
.gs-s[data-mark]::after {
  content: attr(data-mark);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.62rem;
  color: var(--deep-sea);
  background: var(--mk);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: 2px;
}

.gs-vocab { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.gs-vocab div { background: rgba(150,216,216,0.05); border-radius: 8px; padding: 12px 14px; }
.gs-vocab dt { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ice-blue); font-size: 0.85rem; }
.gs-vocab dd { font-size: 0.86rem; color: var(--fog); }

.gs-qs { display: grid; gap: 14px; }

/* --- Checklist + rubric + actions --- */
.gs-check-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.gs-checks { list-style: none; display: grid; gap: 4px; }
.gs-checks li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--fog);
  padding: 6px 0;
  border-bottom: 1px solid rgba(150,216,216,0.06);
}
.gs-checks .ic {
  flex: none;
  width: 20px; height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid var(--boundless);
  display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 800;
}
.gs-checks li.done .ic { background: #8fd6a4; border-color: #8fd6a4; color: var(--deep-sea); }
.gs-checks li.done { color: var(--ice-white); }
.gs-checks li .why { display: block; font-size: 0.78rem; color: var(--shadow-blue); }
.gs-checks label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; width: 100%; }
.gs-checks input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; accent-color: #8fd6a4; flex: none; }
.gs-checks .self { font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--shadow-blue); opacity: 0.75; margin-left: auto; padding-left: 8px; }
.gs-progress { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ice-blue); margin-bottom: 10px; }

.gs-rubric { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.gs-rubric th, .gs-rubric td { text-align: left; vertical-align: top; padding: 8px 8px; border-bottom: 1px solid rgba(150,216,216,0.08); color: var(--fog); }
.gs-rubric th { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--shadow-blue); font-size: 0.75rem; }
.gs-rubric td:first-child { color: var(--ice-white); font-weight: 600; }
.gs-rubric-note { font-size: 0.8rem; color: var(--shadow-blue); margin-top: 10px; }

.gs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.gs-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ice-white);
  background: transparent;
  border: 1.5px solid rgba(150,216,216,0.3);
  border-radius: 100px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.gs-btn:hover { border-color: var(--ice-blue); color: #fff; }
.gs-btn.primary { background: var(--ice-blue); border-color: var(--ice-blue); color: var(--deep-sea); }
.gs-btn.primary:hover { background: #fff; border-color: #fff; }
.gs-btn.danger { border-color: rgba(230,57,70,0.35); color: #f2a0a6; margin-left: auto; }
.gs-btn.danger.armed { background: var(--red-eye); border-color: var(--red-eye); color: #fff; }
.gs-toast { font-size: 0.85rem; color: #8fd6a4; align-self: center; }

details.gs-more { margin-top: 16px; }
details.gs-more summary { cursor: pointer; color: var(--ice-blue); font-family: var(--font-display); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.9rem; }
details.gs-more[open] summary { margin-bottom: 12px; }

/* --- Paper (the genre artifact itself) --- */
.gs-paper {
  --ink: #1b2026;
  --ink-soft: #55606b;
  --rule: #d5d9dd;
  background: #fbfaf7;
  color: var(--ink);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 18px 50px rgba(0,0,0,0.45);
}
.gs-paper p { color: var(--ink); max-width: none; }
.gs-paper .gs-field > label, .gs-paper .gs-label { color: var(--ink-soft); }
.gs-paper .gs-field > label small, .gs-paper .gs-label small { color: #8a949d; }
.gs-paper input[type="text"], .gs-paper input[type="number"], .gs-paper select, .gs-paper textarea {
  color: var(--ink);
  background: #fff;
  border-color: #c4cbd1;
}
.gs-paper input:focus, .gs-paper select:focus, .gs-paper textarea:focus { border-color: #2d6f86; box-shadow: 0 0 0 3px rgba(45,111,134,0.15); }
.gs-paper ::placeholder { color: #9aa3ab; }
.gs-paper select { background-color: #fff; background-image: linear-gradient(45deg, transparent 50%, #55606b 50%), linear-gradient(135deg, #55606b 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.gs-paper .gs-meter { color: var(--ink-soft); }
.gs-paper .gs-meter span.ok { color: #24804a; }
.gs-paper .gs-meter span.no { color: #a35d00; }
.gs-paper .gs-hint { color: #7a4a00; background: #fff4e0; border-left-color: #d98a1c; }
.gs-paper .gs-chip { color: #1f5d72; background: #e4f0f3; }
.gs-paper .gs-chip:hover { border-color: #1f5d72; }

/* print mirror (hidden on screen) */
#gs-print { display: none; }

@media (max-width: 900px) {
  .gs-intro, .gs-check-grid { grid-template-columns: minmax(0, 1fr); }
  .gs-vocab { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .gs-readings { grid-template-columns: 1fr; }
  .gs-step-head { flex-wrap: wrap; }
  .gs-step-head p { margin-left: 0; text-align: left; width: 100%; }
  .gs-tools { border-radius: 14px; top: calc(var(--nav-height) + 4px); }
  .gs-btn.danger { margin-left: 0; }
  .gs-panel { padding: 18px; }
  .gs-rubric { display: block; overflow-x: auto; }
  .gs-rubric th, .gs-rubric td { min-width: 96px; }
}
@media (max-width: 420px) {
  .gs-vocab { grid-template-columns: 1fr; }
}

/* --- Print: only the finished product --- */
@media print {
  @page { margin: 0.6in; }
  body { background: #fff !important; color: #000 !important; }
  body > *:not(#gs-print) { display: none !important; }
  #gs-print { display: block !important; color: #000; font-family: Georgia, 'Times New Roman', serif; font-size: 11pt; line-height: 1.45; }
  #gs-print h1 { font-family: Georgia, serif; text-transform: none; letter-spacing: 0; font-size: 20pt; color: #000; margin-bottom: 4pt; }
  #gs-print h2 { font-family: Georgia, serif; text-transform: none; letter-spacing: 0; font-size: 13pt; color: #000; margin: 14pt 0 4pt; border-bottom: 1px solid #999; padding-bottom: 2pt; }
  #gs-print h3 { font-family: Georgia, serif; text-transform: none; letter-spacing: 0; font-size: 11.5pt; color: #000; margin: 10pt 0 2pt; }
  #gs-print p, #gs-print li, #gs-print td { color: #000; max-width: none; font-size: 11pt; }
  #gs-print .pv-meta { font-size: 10pt; color: #333; margin-bottom: 10pt; }
  #gs-print .pv-blank { color: #888; font-style: italic; }
  #gs-print .pv-label { font-size: 9.5pt; color: #444; font-style: italic; }
  #gs-print table { border-collapse: collapse; width: 100%; }
  #gs-print td, #gs-print th { border: 1px solid #999; padding: 4pt 6pt; vertical-align: top; text-align: left; }
  #gs-print .pv-avoid { break-inside: avoid; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* --- Highlighter targets + legend --- */
.gs-tool .aim { font-size: 0.72rem; color: var(--boundless); font-weight: 500; margin-left: -3px; }
.gs-tool.met .n { color: #8fd6a4; font-weight: 700; }
.gs-tool.over .n { color: #f0b46a; font-weight: 700; }

.gs-legend { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 0 0 16px; }
.gs-legend li { display: flex; gap: 10px; align-items: flex-start; background: rgba(150,216,216,0.04); border: 1px solid rgba(150,216,216,0.08); border-left: 3px solid var(--mk); border-radius: 8px; padding: 10px 12px; font-size: 0.86rem; color: var(--fog); }
.gs-legend i { flex: none; font-style: normal; font-family: var(--font-display); font-weight: 800; font-size: 0.75rem; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--mk); color: var(--deep-sea); margin-top: 1px; }
.gs-legend strong { color: var(--ice-white); }
.gs-legend span { display: block; }
.gs-legend .look { color: var(--ice-white); font-size: 0.82rem; margin-top: 4px; }
.gs-legend .look em { color: var(--ice-blue); font-style: normal; font-weight: 600; }
.gs-legend .use { color: var(--shadow-blue); font-size: 0.8rem; margin-top: 2px; }

/* --- Evidence trays --- */
.gs-tray {
  border: 1px dashed rgba(150,216,216,0.25);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 14px;
  background: rgba(150,216,216,0.03);
}
.gs-tray-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.gs-tray-head > span:first-child { font-family: var(--font-display); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--shadow-blue); }
.gs-tray-head .tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.gs-tray-head .tags b { font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 100px; background: var(--mk); color: var(--deep-sea); }
.gs-tray ul { list-style: none; display: grid; gap: 6px; }
.gs-tray li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; font-size: 0.88rem; line-height: 1.45; color: var(--fog); padding: 6px 0; border-top: 1px solid rgba(150,216,216,0.06); }
.gs-tray li:first-child { border-top: 0; }
.gs-tray .tg { font-family: var(--font-display); font-weight: 800; font-size: 0.68rem; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--mk); color: var(--deep-sea); margin-top: 1px; }
.gs-cite { font: inherit; font-size: 0.75rem; font-weight: 700; white-space: nowrap; color: var(--ice-blue); background: var(--ice-blue-dim); border: 1px solid transparent; border-radius: 100px; padding: 3px 10px; cursor: pointer; }
.gs-cite:hover { border-color: var(--ice-blue); }
.gs-cite.done { background: #8fd6a4; color: var(--deep-sea); }
.gs-cite.static { cursor: default; border-color: transparent !important; }
.gs-tray-empty, .gs-tray-tip { font-size: 0.82rem; color: var(--shadow-blue); }
.gs-tray-tip { margin-top: 6px; }
.gs-tray-empty a { text-decoration: underline; }

.gs-paper .gs-tray { border-color: #c9cfd4; background: #f4f2ec; }
.gs-paper .gs-tray-head > span:first-child { color: #55606b; }
.gs-paper .gs-tray li { color: #2a3138; border-top-color: #e2e0d9; }
.gs-paper .gs-tray .tg, .gs-paper .gs-tray-head .tags b { color: #1b2026; }
.gs-paper .gs-cite { color: #1f5d72; background: #e4f0f3; }
.gs-paper .gs-cite:hover { border-color: #1f5d72; }
.gs-paper .gs-cite.done { background: #24804a; color: #fff; }
.gs-paper .gs-tray-empty, .gs-paper .gs-tray-tip { color: #55606b; }
.gs-paper .gs-tray-empty a { color: #1f5d72; }

@media (max-width: 520px) {
  .gs-tray li { grid-template-columns: 22px minmax(0, 1fr); }
  .gs-tray .gs-cite { grid-column: 2; justify-self: start; }
}

/* --- G versions: to-do lists + sentence frames --- */
.gs-version { display: inline-block; margin-left: 8px; font-family: var(--font-display); font-weight: 800; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--deep-sea); background: #8fd6a4; border-radius: 4px; padding: 1px 7px; vertical-align: 1px; }
.gs-todo { margin-bottom: 20px; }
.gs-todo h3 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.gs-todo h3 .gs-progress { margin: 0 0 0 auto; font-size: 0.78rem; }
.gs-todo .gs-checks li { font-size: 0.98rem; }
.gs-todo ol.gs-steps { list-style: none; counter-reset: todo; }

.gs-frame { background: var(--surface-card); border: 1px solid rgba(150,216,216,0.08); border-radius: 10px; padding: 14px 16px; }
.gs-frame + .gs-frame { margin-top: 12px; }
.gs-frame-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.gs-frame-top .num { flex: none; font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ice-blue); color: var(--deep-sea); }
.gs-frame-top .frame-text { font-size: 1rem; color: var(--ice-white); font-weight: 600; flex: 1 1 260px; }
.gs-frame-top .gs-chip { margin-left: auto; }
.gs-frame textarea { min-height: 60px; }
.gs-paper .gs-frame { background: #fff; border-color: var(--rule); }
.gs-paper .gs-frame-top .frame-text { color: #1b2026; }
.gs-paper .gs-frame-top .num { background: #1b2026; color: #fff; }

.gs-q-easy .gs-field > label { font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 600; color: var(--ice-white); }
