/* fc-delegation — member surface
   FC brand: cream + gold, Khand + DM Sans, no white bg. */

:root {
  --gold:        #F2A900;
  --gold-dim:    rgba(242,169,0,0.10);
  --gold-glow:   rgba(242,169,0,0.30);
  --black:       #0D0D0D;
  --cream:       #FAF7F2;
  --cream2:      #F2EDE4;
  --cream3:      #E8E0D4;
  --muted:       #8C8075;
  --text:        #2A2420;
  --border:      rgba(13,13,13,0.08);
  --border-med:  rgba(13,13,13,0.14);

  --c-teal:        #0E8A6E;
  --c-teal-bg:     #E6F5F1;
  --c-coral:       #C04B28;
  --c-coral-bg:    #FAECE7;
  --c-amber:       #B8780E;
  --c-amber-bg:    #FAF1DE;
  --c-stone:       #6E6258;
  --c-stone-bg:    #ECE7DF;

  --safe-bot: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: var(--cream);
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(242,169,0,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(242,169,0,0.04) 0%, transparent 50%);
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 720px; margin: 0 auto; padding: 0 1.5rem 5rem; }

/* Header */
.site-header { padding: 2.25rem 0 2rem; display: flex; align-items: center; }
.logo-svg { height: 30px; width: auto; flex-shrink: 0; }
.header-rule { flex: 1; height: 1px; background: var(--border-med); margin-left: 1.5rem; }
.site-header-compact { padding: 1.1rem 0 0.6rem; display: flex; align-items: center; }
.site-header-compact .logo-svg { height: 22px; }
.site-header-compact .header-rule { margin-left: 1rem; }

/* Intro */
.intro-wrap { padding: 2rem 0 0; }
.intro-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 0.6rem;
}
.intro-headline {
  font-family: 'Khand', sans-serif;
  font-size: 60px; font-weight: 700; line-height: 1.0;
  color: var(--black); margin-bottom: 1.5rem; letter-spacing: -0.01em;
}
.intro-headline em { font-style: italic; color: var(--gold); }
.intro-divider {
  width: 48px; height: 3px; background: var(--gold);
  border-radius: 2px; margin-bottom: 1.5rem;
}
.intro-sub {
  font-size: 17px; color: var(--muted); line-height: 1.8;
  margin-bottom: 1rem; max-width: 540px; font-weight: 300;
}
.intro-meta {
  display: flex; gap: 2.5rem; margin-top: 3rem;
  padding-top: 2rem; border-top: 1px solid var(--border);
}
.meta-num {
  font-family: 'Khand', sans-serif; font-size: 36px; font-weight: 700;
  color: var(--black); line-height: 1; margin-bottom: 4px;
}
.meta-num span { color: var(--gold); }
.meta-label { font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.4; max-width: 130px; }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 15px 32px; font-size: 15px; font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  color: var(--black); background: var(--gold);
  border: none; border-radius: 10px; cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 16px rgba(242,169,0,0.35);
}
.btn-primary:hover { background: #d9940a; box-shadow: 0 4px 24px rgba(242,169,0,0.45); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }

.btn-secondary {
  font-size: 14px; font-weight: 500; color: var(--text);
  background: transparent; border: 1px solid var(--border-med);
  border-radius: 9px; padding: 10px 16px;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  white-space: nowrap; transition: all 0.15s;
}
.btn-secondary:hover { background: var(--cream2); }

.btn-ghost {
  font-size: 14px; color: var(--muted); background: none; border: none;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  padding: 10px 0; transition: color 0.15s;
}
.btn-ghost:hover { color: var(--text); }

/* Question / sort screen */
.q-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.6rem; }
.q-text { font-family: 'Khand', sans-serif; font-size: 38px; font-weight: 600; color: var(--black); line-height: 1.15; margin-bottom: 0.5rem; }
.q-prompt { font-size: 14px; color: var(--muted); font-style: italic; font-weight: 300; line-height: 1.65; margin-bottom: 1.75rem; }
.q-btn-row { display: flex; align-items: center; justify-content: space-between; margin-top: 2rem; }

/* Progress pips */
.progress-pips { display: flex; gap: 6px; margin-bottom: 1.5rem; }
.pip {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--cream3);
  transition: background 0.2s;
}
.pip.done { background: var(--gold); }
.pip.active { background: var(--gold); height: 5px; }

/* Sort chip choices */
.sort-row {
  display: flex; flex-direction: column; gap: 14px;
  margin-top: 1.5rem;
}
.sort-chip {
  width: 100%;
  padding: 22px 24px;
  background: #fff;
  border: 1.5px solid var(--border-med);
  border-radius: 14px;
  font-family: 'Khand', sans-serif; font-size: 28px; font-weight: 600;
  color: var(--black); text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.15s;
}
.sort-chip:hover { border-color: var(--gold); background: var(--gold-dim); }
.sort-chip-glyph {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--cream2); display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 18px;
}
.sort-chip.love .sort-chip-glyph { background: var(--c-coral-bg); color: var(--c-coral); }
.sort-chip.hate .sort-chip-glyph { background: var(--c-stone-bg); color: var(--c-stone); }
.sort-chip-sub {
  display: block; font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 400; color: var(--muted);
  margin-top: 4px; line-height: 1.4;
}

.task-card {
  background: var(--cream2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.5rem;
}
.task-card-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.task-card-name {
  font-family: 'Khand', sans-serif; font-size: 24px; font-weight: 600;
  color: var(--black); line-height: 1.2;
}
.task-card-meta {
  font-size: 13px; color: var(--muted); margin-top: 4px;
}

/* Loading screen */
.loading-wrap, .error-wrap, .wait-wrap, .nothing-wrap {
  padding: 5rem 0; display: flex; flex-direction: column; align-items: center; gap: 18px;
  text-align: center;
}
.spinner-ring {
  width: 40px; height: 40px;
  border: 2px solid rgba(242,169,0,0.15);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin 1s cubic-bezier(0.5,0,0.5,1) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-label, .error-label, .wait-label, .nothing-label {
  font-family: 'Khand', sans-serif; font-size: 28px; font-weight: 600;
  color: var(--black); max-width: 420px; line-height: 1.2;
}
.error-msg, .wait-msg, .nothing-msg {
  font-size: 14px; color: var(--muted); max-width: 420px; line-height: 1.7;
}

/* Quadrant map */
.quadrant-intro {
  font-family: 'Khand', sans-serif; font-size: 32px; font-weight: 600;
  color: var(--black); line-height: 1.15; margin-bottom: 0.5rem;
}
.quadrant-sub {
  font-size: 14px; color: var(--muted); line-height: 1.6;
  margin-bottom: 1.5rem; max-width: 540px;
}
.quadrant-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 1.5rem;
}
.quadrant-cell {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem 1rem;
  min-height: 180px;
  display: flex; flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.quadrant-cell.recommended {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-dim);
}
.quadrant-cell.recommended::after {
  content: 'Start here';
  position: absolute; top: -10px; right: 10px;
  background: var(--gold); color: var(--black);
  font-family: 'DM Sans', sans-serif;
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px; border-radius: 6px;
}
.quadrant-label {
  font-family: 'Khand', sans-serif; font-size: 16px; font-weight: 600;
  color: var(--black); line-height: 1.15; margin-bottom: 4px;
}
.quadrant-sublabel {
  font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.quadrant-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  overflow-y: auto; flex: 1;
}
.qchip {
  background: var(--cream2); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: grab;
  user-select: none;
  max-width: 100%;
}
.qchip:active { cursor: grabbing; }
.qchip.dragging { opacity: 0.5; }
.qchip-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 14ch;
}
.qchip-moved::after {
  content: '↔'; color: var(--gold); font-weight: 700; margin-left: 2px;
}
.quadrant-empty {
  color: var(--muted); font-style: italic; font-size: 13px;
  padding: 12px 4px;
}
.quadrant-cell.drop-target {
  background: var(--gold-dim);
  border-color: var(--gold);
}

/* Quadrant detail screen */
.quadrant-nav {
  display: flex; gap: 6px; margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.quadrant-nav::-webkit-scrollbar { display: none; }
.qnav-chip {
  white-space: nowrap;
  padding: 8px 12px; font-size: 12.5px;
  background: #fff; border: 1px solid var(--border-med);
  border-radius: 999px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; color: var(--text);
  font-weight: 500;
}
.qnav-chip.active { background: var(--black); color: #fff; border-color: var(--black); }
.qnav-chip.recommended:not(.active) { border-color: var(--gold); }

.detail-coaching {
  background: var(--cream2);
  border-left: 3px solid var(--gold);
  padding: 1rem 1.2rem;
  border-radius: 0 8px 8px 0;
  font-size: 14.5px; line-height: 1.65;
  color: var(--text);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-card-full {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: all 0.15s;
}
.task-card-full:hover { border-color: var(--border-med); box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.task-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.task-card-title {
  font-family: 'Khand', sans-serif; font-size: 22px; font-weight: 600;
  color: var(--black); line-height: 1.15;
}
.task-card-decision-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 8px; font-size: 12.5px; color: var(--muted);
}
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
  background: var(--cream2); color: var(--text);
  border: 1px solid var(--border);
}
.tag.tag-love { background: var(--c-coral-bg); color: var(--c-coral); border-color: transparent; }
.tag.tag-hate { background: var(--c-stone-bg); color: var(--c-stone); border-color: transparent; }
.tag.tag-keep { background: var(--c-teal-bg); color: var(--c-teal); border-color: transparent; }
.tag.tag-delegate { background: var(--gold-dim); color: var(--gold); border-color: transparent; font-weight: 600; }
.tag.tag-no-value { background: var(--c-stone-bg); color: var(--c-stone); border-color: transparent; font-style: italic; }

/* Step breakdown editor */
.step-editor { margin-top: 1rem; }
.step-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--cream2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.step-row-num {
  flex: 0 0 28px; height: 28px;
  background: var(--black); color: #fff;
  border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center;
  font-family: 'Khand', sans-serif; font-weight: 600; font-size: 14px;
}
.step-row textarea {
  flex: 1; min-height: 38px;
  background: transparent; border: 0; resize: vertical;
  font-family: 'DM Sans', sans-serif; font-size: 14.5px; line-height: 1.55;
  color: var(--text);
  padding: 6px 0;
}
.step-row textarea:focus { outline: none; }
.step-row-actions { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.step-icon-btn {
  background: transparent; border: 0; cursor: pointer;
  color: var(--muted); font-size: 18px; padding: 2px 6px;
  line-height: 1;
}
.step-icon-btn:hover { color: var(--text); }
.step-icon-btn.delete:hover { color: var(--c-coral); }

.step-add-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.step-add-row .btn-secondary { flex: 1; }
.suggest-btn {
  flex: 1; min-width: 0;
  background: var(--black); color: #fff;
  border: none; border-radius: 9px;
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.suggest-btn:hover { background: #2A2420; }
.suggest-btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.step-save-row {
  margin-top: 1rem;
  display: flex; gap: 8px; justify-content: space-between; align-items: center;
}

/* Worksheet view */
.worksheet-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.worksheet-title {
  font-family: 'Khand', sans-serif; font-size: 32px; font-weight: 700;
  color: var(--black); line-height: 1.1;
}
.worksheet-subtitle { color: var(--muted); font-size: 14px; margin-top: 6px; }

.ws-group-head {
  font-family: 'Khand', sans-serif; font-size: 14px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 1.5rem 0 0.6rem;
}
.ws-task {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  margin-bottom: 10px;
  transition: opacity 0.2s;
}
.ws-task.reclaimed { opacity: 0.55; }
.ws-task-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.ws-task-title {
  font-family: 'Khand', sans-serif; font-size: 22px; font-weight: 600;
  color: var(--black); line-height: 1.15;
}
.ws-task-meta {
  font-size: 12.5px; color: var(--muted); margin-top: 4px;
}
.ws-task-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.reclaim-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-coral); flex-shrink: 0;
}

/* Stepper */
.stepper {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px;
}
.stepper-node {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; flex: 1;
  cursor: pointer;
  background: none; border: 0; padding: 0;
  font-family: 'DM Sans', sans-serif;
  color: var(--muted);
  transition: color 0.15s;
}
.stepper-node:hover { color: var(--text); }
.stepper-circle {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--cream3);
  background: var(--cream);
  transition: all 0.2s;
}
.stepper-node.done .stepper-circle, .stepper-node.current .stepper-circle {
  background: var(--gold); border-color: var(--gold);
  box-shadow: 0 1px 6px rgba(242,169,0,0.35);
}
.stepper-node.current .stepper-circle {
  box-shadow: 0 0 0 4px var(--gold-dim);
}
.stepper-node.current { color: var(--black); }
.stepper-node.done { color: var(--text); }
.stepper-line {
  flex: 0 0 14px; height: 2px;
  background: var(--cream3); border-radius: 1px;
}
.stepper-line.done { background: var(--gold); }
.stepper-label {
  font-size: 11px; font-weight: 500;
  text-align: center; line-height: 1.2;
}
.ws-task.reclaimed .stepper-circle { background: var(--cream3); border-color: var(--cream3); box-shadow: none; }
.ws-task.reclaimed .stepper-line { background: var(--cream3); }

.ws-actions {
  display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.ws-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  background: transparent; border: 1px solid var(--border-med);
  border-radius: 8px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; color: var(--text);
  transition: all 0.15s;
}
.ws-action:hover { background: var(--cream2); }
.ws-action.primary { background: var(--gold); border-color: var(--gold); color: var(--black); font-weight: 600; }
.ws-action.primary:hover { background: #d9940a; }
.ws-action.danger { color: var(--c-coral); border-color: var(--c-coral); }
.ws-action.danger:hover { background: var(--c-coral-bg); }

/* Footer */
.fc-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem; padding-top: 1.25rem;
  color: var(--muted); font-style: italic;
  font-size: 13px; text-align: center;
  line-height: 1.55;
}

/* Toast */
.toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  background: var(--black); color: #fff;
  padding: 12px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 400;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  max-width: 90vw;
}
.toast.visible { opacity: 1; }

/* Animations */
.fade-in { animation: fadeUp 0.45s cubic-bezier(0.4,0,0.2,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Mobile */
@media (max-width: 640px) {
  .quadrant-grid { grid-template-columns: 1fr; }
  /* Reorder per 03-design.md: Hate+Shouldnt first, then Love+Shouldnt, Hate+Should, Love+Should */
  .quadrant-cell.q-hate-shouldnt { order: 1; }
  .quadrant-cell.q-love-shouldnt { order: 2; }
  .quadrant-cell.q-hate-should { order: 3; }
  .quadrant-cell.q-love-should { order: 4; }
}
@media (max-width: 480px) {
  #app { padding: 0 1.1rem 4rem; }
  .intro-headline { font-size: 46px; }
  .q-text { font-size: 30px; }
  .worksheet-title { font-size: 26px; }
  .stepper-label { font-size: 10px; }
  .intro-meta { gap: 1.25rem; }
}
