/* ════════════════════════════════════════════════════════════
   CUSTOM PROPERTIES  — Catppuccin Latte (light) / Macchiato (dark)
   ════════════════════════════════════════════════════════════ */

:root {
  --base:      #eff1f5;
  --mantle:    #e6e9ef;
  --crust:     #dce0e8;
  --surface0:  #ccd0da;
  --surface1:  #bcc0cc;
  --surface2:  #acb0be;
  --text:      #4c4f69;
  --subtext:   #6c6f85;
  --muted:     #9ca0b0;
  --lavender:  #7287fd;
  --mauve:     #8839ef;
  --card:      #e6e9ef;
  --border:    #ccd0da;
  --drw-bg:    #f2f4f8;
}

[data-theme="dark"] {
  --base:      #24273a;
  --mantle:    #1e2030;
  --crust:     #181926;
  --surface0:  #363a4f;
  --surface1:  #494d64;
  --surface2:  #5b5f78;
  --text:      #cad3f5;
  --subtext:   #b8c0e0;
  --muted:     #a5adcb;
  --lavender:  #b7bdf8;
  --mauve:     #c6a0f6;
  --card:      #2a2d3e;
  --border:    #363a4f;
  --drw-bg:    #1e2030;
}

/* ════════════════════════════════════════════════════════════
   GLOBAL RESET
   ════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--base);
  color: var(--text);
}

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  background: var(--base);
  color: var(--text);
  transition: background .2s, color .2s;
}

input, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }

a { color: var(--mauve); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   THEME BUTTON
   ════════════════════════════════════════════════════════════ */

#theme-btn {
  position: fixed;
  top: 16px; right: 18px; z-index: 9999;
  background: none; border: none;
  font-size: 18px; cursor: pointer;
  opacity: .55; transition: opacity .15s;
  color: var(--text);
}
#theme-btn:hover { opacity: 1; }

/* ════════════════════════════════════════════════════════════
   SCREENS
   ════════════════════════════════════════════════════════════ */

.screen { display: none; }
.screen.active { display: block; }

/* ════════════════════════════════════════════════════════════
   SETUP SCREEN
   ════════════════════════════════════════════════════════════ */

.sw {
  max-width: 560px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.sh {
  text-align: center;
  margin-bottom: 36px;
}

.orn {
  display: block;
  font-size: 22px;
  color: var(--mauve);
  opacity: .7;
  margin-bottom: 10px;
}

.sh h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 300;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: 10px;
}

.sh p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 380px;
  margin: 0 auto;
}

.field { margin-bottom: 20px; }

.flbl {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"] {
  width: 100%;
  background: var(--mantle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
input[type="text"]:focus { border-color: var(--mauve); }
input[type="text"]::placeholder { color: var(--muted); }

.rule { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

.rhd {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 4px;
}

.rsub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 16px;
}

.radd {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.radd input { flex: 1; }

/* Tag chip checkboxes */
.tag-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tag-chip-lbl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.tag-chip-lbl input[type="checkbox"] { display: none; }
.tag-chip-lbl span {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--mantle);
  color: var(--subtext);
  transition: background .12s, border-color .12s, color .12s;
  cursor: pointer;
  user-select: none;
}
.tag-chip-lbl input:checked + span {
  background: var(--mauve);
  border-color: var(--mauve);
  color: #fff;
}
.tag-chip-lbl.sm span { font-size: 11px; padding: 3px 8px; }

.comp-opt-row {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--surface0);
  border-radius: 6px;
}
.comp-opt-row.visible { display: flex; }
.comp-opt-lbl { font-size: 12px; color: var(--muted); }

/* Roster list */
.rlist { list-style: none; margin-bottom: 6px; }

.ritem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.rnm { flex: 1; font-weight: 500; }
.rtags { display: flex; flex-wrap: wrap; gap: 4px; }

.rempty {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 12px 0;
}

/* Roster tags */
.rtag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  letter-spacing: .02em;
}

.sfoot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
}

/* ════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: background .14s, transform .1s, opacity .14s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-p {
  background: var(--mauve);
  color: #fff;
}
.btn-p:hover { opacity: .88; }
.btn-g {
  background: var(--surface0);
  color: var(--subtext);
}
.btn-g:hover { background: var(--surface1); }
.btn-sm { padding: 7px 14px; font-size: 12px; }

.ibtn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  transition: color .12s;
  padding: 2px;
  font-size: 13px;
}
.ibtn:hover { color: var(--text); }

/* ════════════════════════════════════════════════════════════
   INTERVIEW SCREEN
   ════════════════════════════════════════════════════════════ */

.iw {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 24px 100px;
  position: relative;
  min-height: 100vh;
}

/* Header bar */
.itop {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.iname {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-style: italic;
  color: var(--subtext);
  white-space: nowrap;
  flex-shrink: 0;
}

.iprog { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ibar { flex: 1; height: 3px; background: var(--surface0); border-radius: 2px; overflow: hidden; }
.ifill { height: 100%; background: var(--mauve); border-radius: 2px; transition: width .3s ease; }
.icnt { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Section label */
.isec {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  min-height: 20px;
}

.isec-lbl {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mauve);
  white-space: nowrap;
}

.isec-sub {
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--muted);
  white-space: nowrap;
}

.isec-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Question card */
.qcard {
  background: var(--mantle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 28px 22px;
  margin-bottom: 22px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.qcard.anim {
  animation: qslide .22s ease;
}

@keyframes qslide {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}

.qtxt {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.2rem, 3.5vw, 1.55rem);
  font-style: italic;
  font-weight: 400;
  text-align: center;
  color: var(--subtext);
  line-height: 1.45;
  width: 100%;
}

.qwif {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

/* ── ToT question flex layout (used in qtxt) ── */
.tot-q-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.tot-q-a { text-align: left; flex: 1; }
.tot-q-b { text-align: right; flex: 1; }
.tot-q-sep {
  flex-shrink: 0;
  color: var(--surface2);
  font-style: normal;
  font-size: 1.1em;
}

/* ════════════════════════════════════════════════════════════
   VS STAT UI  (relexp)
   ════════════════════════════════════════════════════════════ */

.vs-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 14px;
}

.vs-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--muted);
  flex: 1;
  line-height: 1.3;
  transition: color .14s;
}
.vs-name.right { text-align: right; }
.vs-name.hi    { color: var(--text); }

#vs-ui .tot-bubs {
  padding: 0;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   COMP STAT UI  (relexp)
   ════════════════════════════════════════════════════════════ */

.comp-char-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 14px;
}

.comp-char-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.comp-char-lbl {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--subtext);
  text-align: center;
}

.comp-char-block .tot-bubs { padding: 4px 0 6px; }

/* ════════════════════════════════════════════════════════════
   THIS OR THAT UI  (interview + relexp choice)
   ════════════════════════════════════════════════════════════ */

.tot-bubs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 10px 0 18px;
}

.tot-bub {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--surface1);
  background: transparent;
  cursor: pointer;
  transition: border-color .14s, background .14s, transform .1s;
  flex-shrink: 0;
}
.tot-bub.sm { width: 18px; height: 18px; }
.tot-bub:hover { border-color: var(--mauve); transform: scale(1.1); }
.tot-bub.on  { background: var(--mauve); border-color: var(--mauve); }

.tot-hint {
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ════════════════════════════════════════════════════════════
   TEXTAREA + MODE TOGGLE
   ════════════════════════════════════════════════════════════ */

textarea {
  width: 100%;
  background: var(--mantle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  resize: none;
  outline: none;
  line-height: 1.7;
  min-height: 88px;
  transition: border-color .15s;
}
textarea:focus { border-color: var(--mauve); }
textarea::placeholder { color: var(--muted); }
textarea.narrative { font-style: italic; }

.mrow {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.mbtn {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.mbtn.on {
  background: var(--mauve);
  border-color: var(--mauve);
  color: #fff;
}

/* OOC */
.ooc-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-style: italic;
  transition: color .12s;
}
.ooc-btn:hover { color: var(--subtext); }
.ooc-arr { display: inline-block; transition: transform .15s; font-style: normal; }
.ooc-btn.open .ooc-arr { transform: rotate(90deg); }

.ooc-wrap { display: none; margin-top: 6px; }
.ooc-wrap.open { display: block; }
.ooc-lbl {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.ooc { border-color: var(--surface1) !important; font-size: 12px; }

/* ════════════════════════════════════════════════════════════
   CHARACTER CHIPS
   ════════════════════════════════════════════════════════════ */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.chip {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--mantle);
  color: var(--subtext);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.chip.cur  { background: var(--mauve); border-color: var(--mauve); color: #fff; }
.chip.done { border-color: var(--surface2); color: var(--text); }
.chip.cur.done { background: var(--mauve); border-color: var(--mauve); color: #fff; }

/* ════════════════════════════════════════════════════════════
   INTERVIEW CONTROLS
   ════════════════════════════════════════════════════════════ */

.ictrl {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 22px;
  gap: 10px;
}

.skip-q {
  background: none; border: none;
  font-size: 12px; font-style: italic;
  color: var(--muted); cursor: pointer;
  padding: 0; transition: color .12s;
}
.skip-q:hover { color: var(--subtext); }

.view-a {
  background: none; border: none;
  font-size: 12px; font-style: italic;
  font-family: 'DM Sans', sans-serif;
  color: var(--muted); cursor: pointer;
  margin-left: auto; padding: 0;
  transition: color .12s;
}
.view-a:hover { color: var(--subtext); }

/* Fixed corners */
.fixed-bottom-left {
  position: fixed;
  bottom: 20px; left: 20px; z-index: 100;
}
.fixed-bottom-right {
  position: fixed;
  bottom: 20px; right: 20px; z-index: 100;
}

/* ════════════════════════════════════════════════════════════
   OUTPUT SCREEN
   ════════════════════════════════════════════════════════════ */

.ow {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 100px;
  position: relative;
  min-height: 100vh;
}

.ohd { margin-bottom: 32px; }

.eyebrow {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mauve);
  margin-bottom: 4px;
}

.oname {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 300;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.1;
}

.out-proj {
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  margin-top: 4px;
}

/* Output tabs */
.otabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.otab {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.otab.on { background: var(--mauve); border-color: var(--mauve); color: #fff; }
.otab:hover:not(.on) { background: var(--surface0); color: var(--subtext); }

/* Output panels */
.opanel { display: none; }
.opanel.on { display: block; }

.osub-hd {
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mauve);
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
  margin: 28px 0 16px;
}
.osub-hd:first-child { margin-top: 0; }

.oentry {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.oentry:last-child { border-bottom: none; }

.oq {
  font-style: italic;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.owq {
  font-style: italic;
  color: var(--surface2);
  font-size: 12px;
  margin: 14px 0 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.oresp {
  line-height: 1.85;
  white-space: pre-wrap;
  font-size: 13.5px;
}
.oresp.narrative { font-style: italic; }

.oooc {
  background: color-mix(in srgb, #40a02b 8%, var(--mantle));
  border-left: 2px solid #a4d4a0;
  padding: 7px 12px;
  color: var(--subtext);
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.65;
  border-radius: 0 4px 4px 0;
  white-space: pre-wrap;
}
.oooc-lbl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #40a02b;
  margin-bottom: 3px;
}

.oempty {
  font-style: italic;
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
}

.oactions {
  display: flex;
  gap: 10px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ════════════════════════════════════════════════════════════
   THIS OR THAT — OUTPUT
   ════════════════════════════════════════════════════════════ */

.tot-oitem {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.tot-oitem:last-child { border-bottom: none; }

.tot-opair {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tot-opole {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  flex: 1;
  line-height: 1.3;
}
.tot-opole.b { text-align: right; }
.tot-opole.hi { color: var(--text); }

.tot-obubs {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.tot-ob {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface0);
  display: inline-block;
  transition: background .12s;
}
.tot-ob.on { background: var(--mauve); }

.tot-oelab {
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.55;
}

/* ════════════════════════════════════════════════════════════
   RELEXP — OUTPUT (VS, COMP, CHOICE)
   ════════════════════════════════════════════════════════════ */

.out-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 24px;
}

/* VS output row */
.out-vs-row { margin-bottom: 14px; }
.out-vs-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.out-vs-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
  flex: 1;
  line-height: 1.3;
  transition: color .12s;
}
.out-vs-name.right { text-align: right; }
.out-vs-name.hi    { color: var(--text); }
.out-vs-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.out-vs-trait {
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

/* COMP output */
.out-comp-block { margin-bottom: 18px; }
.out-comp-traits {
  display: flex;
  justify-content: space-between;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--subtext);
  margin-bottom: 8px;
}
.out-comp-trait.right { text-align: right; }
.out-comp-char {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  letter-spacing: .04em;
  margin: 6px 0 3px;
}
.out-comp-bubs { justify-content: center; margin-bottom: 4px; }

/* ════════════════════════════════════════════════════════════
   EXPORT MODAL
   ════════════════════════════════════════════════════════════ */

.exp-modal {
  position: fixed;
  inset: 0; z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  padding: 20px;
}

.exp-modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.exp-modal-page { padding: 24px; }

.exp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.exp-modal-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 400;
}

.exp-modal-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exp-option-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 12px 16px;
  background: var(--mantle);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color .14s, background .14s;
}
.exp-option-btn:hover { border-color: var(--mauve); background: var(--base); }

.exp-opt-title { font-weight: 500; font-size: 14px; }
.exp-opt-desc  { font-size: 12px; color: var(--muted); }

.exp-modal-note {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 14px;
}

.exp-modal-code-wrap { position: relative; }

.exp-modal-ta {
  width: 100%;
  height: 280px;
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.6;
  background: var(--mantle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  resize: none;
  color: var(--text);
  min-height: unset !important;
}

.exp-modal-copied {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--mauve);
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  pointer-events: none;
}

.exp-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* ════════════════════════════════════════════════════════════
   QUESTION OVERVIEW DRAWER
   ════════════════════════════════════════════════════════════ */

.drw-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.25);
  z-index: 500;
}
.drw-overlay.open { display: block; }

.drw {
  position: fixed;
  top: 0; right: -360px; bottom: 0;
  width: 340px;
  background: var(--drw-bg);
  border-left: 1px solid var(--border);
  z-index: 600;
  display: flex;
  flex-direction: column;
  transition: right .25s ease;
  overflow: hidden;
}
.drw.open { right: 0; }

.drw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drw-head h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 400;
}

.drw-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 24px;
}

.drw-sec { margin-bottom: 4px; }

.drw-sbtn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  transition: background .12s;
}
.drw-sbtn:hover { background: var(--surface0); }
.drw-sbtn.open  { color: var(--mauve); }

.drw-sr { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 400; }
.drw-scnt { font-size: 11px; }
.drw-sarr { transition: transform .15s; display: inline-block; }
.drw-sbtn.open .drw-sarr { transform: rotate(90deg); }

.drw-qs { display: none; padding-left: 6px; margin-bottom: 4px; }
.drw-qs.open { display: block; }

.drw-sublbl {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px 4px;
}

.drw-q {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  margin-bottom: 2px;
}

.drw-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--surface2);
  flex-shrink: 0;
  margin-top: 4px;
  transition: background .12s, border-color .12s;
}
.drw-dot.on { background: var(--mauve); border-color: var(--mauve); }

.drw-qtxt {
  flex: 1;
  font-size: 12px;
  color: var(--subtext);
  line-height: 1.45;
}
.drw-qtxt.done { color: var(--text); }

.drw-jmp {
  background: none; border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 7px;
  font-size: 11px; color: var(--muted);
  cursor: pointer; flex-shrink: 0;
  transition: border-color .12s, color .12s;
}
.drw-jmp:hover { border-color: var(--mauve); color: var(--mauve); }

/* ════════════════════════════════════════════════════════════
   RELATIONSHIP TAGS  (single canonical set)
   ════════════════════════════════════════════════════════════ */

.tag-family       { color: #6f6093; background: #ece8f5; }
.tag-romantic     { color: #9e3f6c; background: #f9e8f1; }
.tag-complicated  { color: #7c6523; background: #f5ecd4; }
.tag-closefriend  { color: #3a7a6a; background: #e0f2ee; }
.tag-casualfriend { color: #2c6497; background: #ddeef9; }
.tag-acquaintance { color: #6c7a3a; background: #ecf2d8; }
.tag-rival        { color: #8c3a3a; background: #f5e2e2; }

[data-theme="dark"] .tag-family       { color: #c9b8f0; background: rgba(111,96,147,.25); }
[data-theme="dark"] .tag-romantic     { color: #f0b8d2; background: rgba(158,63,108,.25); }
[data-theme="dark"] .tag-complicated  { color: #e8d09a; background: rgba(124,101,35,.25); }
[data-theme="dark"] .tag-closefriend  { color: #9adece; background: rgba(58,122,106,.25); }
[data-theme="dark"] .tag-casualfriend { color: #9ac8f0; background: rgba(44,100,151,.25); }
[data-theme="dark"] .tag-acquaintance { color: #c0d899; background: rgba(108,122,58,.25); }
[data-theme="dark"] .tag-rival        { color: #f0a0a0; background: rgba(140,58,58,.25); }

/* ════════════════════════════════════════════════════════════
   PRINT  (hide controls)
   ════════════════════════════════════════════════════════════ */

@media print {
  #theme-btn, .otabs, .oactions, .fixed-bottom-left, .fixed-bottom-right { display: none !important; }
  .opanel { display: block !important; }
  .print-sec-lbl {
    font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
    color: #8839ef; border-bottom: 1px solid #eee; padding-bottom: 4px; margin: 20px 0 12px;
  }
  .ow { padding: 24px; max-width: 100%; }
}