/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --indigo:       #4A4A88;
  --indigo-light: #EEEEF8;
  --indigo-mid:   #B8B8DC;
  --indigo-dark:  #22224A;
  --peach:        #D4845A;
  --peach-light:  #FBF2EC;
  --peach-mid:    #F0C8A8;
  --peach-dark:   #5A3020;
  --ink:          #1C1C2E;
  --mid:          #52526A;
  --muted:        #9898B0;
  --surface:      #F7F7FB;
  --white:        #FFFFFF;
  --rule:         rgba(0,0,0,0.07);
  --axis:         rgba(0,0,0,0.15);
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--surface);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

/* ── App wrapper ───────────────────────────────────────────────────────────── */
.app {
  max-width: 660px;
  width: 100%;
  position: relative;
}

/* ── Brand bar ─────────────────────────────────────────────────────────────── */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem 0.85rem;
}
.brand-logo { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--indigo);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.brand-tag  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.brand-tool {
  font-size: 11px; font-weight: 600; color: var(--indigo);
  background: var(--indigo-light); padding: 4px 12px;
  border-radius: 20px; border: 0.5px solid var(--indigo-mid);
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

/* ── Card header ───────────────────────────────────────────────────────────── */
.card-head {
  padding: 1.1rem 1.4rem 0.95rem;
  border-bottom: 0.5px solid var(--rule);
  display: flex; align-items: flex-start; justify-content: space-between;
  background: var(--white);
}
.head-title  { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.head-ctx    { font-size: 12px; color: var(--muted); }
.head-ctx strong { color: var(--indigo); font-weight: 600; }
.step-pill {
  font-size: 11px; color: var(--muted);
  background: var(--surface); border: 0.5px solid var(--rule);
  border-radius: 20px; padding: 3px 11px;
  white-space: nowrap; margin-top: 2px;
}

/* ── Wizard steps ──────────────────────────────────────────────────────────── */
.step { display: none; }
.step.active { display: block; }

/* ── Context step ──────────────────────────────────────────────────────────── */
.step-inner  { padding: 1.75rem 1.4rem 1.5rem; }
.step-q      { font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1.35; margin-bottom: 8px; }
.step-hint   { font-size: 13px; color: var(--muted); margin-bottom: 1.25rem; line-height: 1.6; }
.step-input  {
  width: 100%; font-size: 14px; color: var(--ink);
  border: 0.5px solid var(--indigo-mid); border-radius: 10px;
  padding: 0.85rem 1rem; background: var(--surface);
  outline: none; resize: none; font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
  min-height: 90px; line-height: 1.6;
}
.step-input:focus { border-color: var(--indigo); background: var(--white); }

.step-examples { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 7px; }
.example-chip {
  font-size: 12px; color: var(--indigo);
  background: var(--indigo-light); border: 0.5px solid var(--indigo-mid);
  border-radius: 20px; padding: 5px 12px; cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.example-chip:hover { background: var(--indigo-mid); }

/* ── Quadrant steps ────────────────────────────────────────────────────────── */
.q-step-inner { padding: 1.5rem 1.4rem 1.4rem; }
.q-step-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 5px;
}
.q-step-label.indigo { color: var(--indigo); }
.q-step-label.peach  { color: var(--peach); }

.q-step-q    { font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.4; margin-bottom: 6px; }
.q-step-hint { font-size: 13px; color: var(--muted); margin-bottom: 1.1rem; line-height: 1.6; }

.q-step-area {
  width: 100%; font-size: 14px; color: var(--ink);
  border: 0.5px solid var(--rule); border-radius: 10px;
  padding: 0.85rem 1rem; background: var(--surface);
  outline: none; resize: none; font-family: inherit;
  min-height: 110px; line-height: 1.6;
  transition: border-color 0.15s, background 0.15s;
}
.q-step-area:focus        { border-color: var(--indigo); background: var(--white); }
.q-step-area.peach:focus  { border-color: var(--peach); }

.chips-preview { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 0.75rem; }
.chip-p {
  font-size: 12px; font-weight: 600; padding: 4px 11px;
  border-radius: 20px; background: var(--peach-mid); color: var(--peach-dark);
}

/* ── VBA reminder box ──────────────────────────────────────────────────────── */
.vba-reminder {
  background: var(--peach-light);
  border: 0.5px solid var(--peach-mid);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
}
.vba-reminder-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 5px;
}
.vba-reminder-row:last-child { margin-bottom: 0; }
.vba-reminder-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--peach);
  white-space: nowrap; flex-shrink: 0; padding-top: 2px;
  min-width: 78px;
}
.vba-reminder-text {
  font-size: 13px; color: var(--mid); line-height: 1.55;
}

.values-sort-btn {
  margin-top: 0.85rem;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--peach);
  background: var(--peach-light); border: 0.5px solid var(--peach-mid);
  border-radius: 20px; padding: 6px 14px; cursor: pointer;
  font-family: inherit; transition: background 0.15s;
}
.values-sort-btn:hover { background: var(--peach-mid); }
.sort-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--peach); flex-shrink: 0; }

/* ── Commit step ───────────────────────────────────────────────────────────── */
.commit-step { padding: 1.75rem 1.4rem 1.5rem; }
.commit-sentence {
  background: var(--indigo-light); border-radius: 12px;
  padding: 1.1rem 1.25rem; margin: 1.1rem 0;
  font-size: 15px; color: var(--mid); line-height: 2.2;
}
.commit-inline {
  border: none; border-bottom: 2px solid var(--indigo);
  background: none; outline: none; font-size: 15px;
  color: var(--indigo); font-weight: 600; font-family: inherit;
  padding: 0 4px; min-width: 120px;
}

/* ── Matrix view ───────────────────────────────────────────────────────────── */
.matrix-view { display: none; }
.matrix-view.active { display: block; }

.axis-row { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1.5px solid var(--axis); }
.axis-lbl {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 0.55rem 1rem;
}
.axis-lbl.left  { color: var(--indigo); }
.axis-lbl.right { color: var(--peach); border-left: 1.5px solid var(--axis); }

.quadrants { display: grid; grid-template-columns: 1fr 1fr; }
.q { padding: 1rem 1.1rem 0.9rem; min-height: 130px; }
.q.tl { background: var(--indigo-light); }
.q.tr { background: var(--peach-light);  border-left: 1.5px solid var(--axis); }
.q.bl { background: var(--indigo-light); border-top: 1.5px solid var(--axis); }
.q.br { background: var(--peach-light);  border-left: 1.5px solid var(--axis); border-top: 1.5px solid var(--axis); }

.q-tag { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.tl .q-tag, .bl .q-tag { color: var(--indigo); }
.tr .q-tag, .br .q-tag { color: var(--peach); }
.q-content {
  font-size: 13px; color: var(--mid); line-height: 1.6; white-space: pre-wrap;
  max-height: 220px; overflow-y: auto;
}

.matrix-commit {
  border-top: 1.5px solid var(--axis);
  padding: 0.95rem 1.2rem;
  background: var(--white);
  display: flex; align-items: flex-start; gap: 12px;
}
.commit-circle {
  margin-top: 3px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--indigo); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.commit-dot  { width: 9px; height: 9px; border-radius: 50%; background: var(--indigo); }
.commit-lbl  { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--indigo); margin-bottom: 3px; }
.commit-val  { font-size: 14px; color: var(--ink); line-height: 1.5; }
.commit-val em { color: var(--indigo); font-style: normal; font-weight: 600; }

/* ── Bottom nav ────────────────────────────────────────────────────────────── */
.bottom-nav {
  border-top: 0.5px solid var(--rule);
  padding: 0.8rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
}
.dots { display: flex; gap: 6px; align-items: center; }
.dot  { width: 22px; height: 3px; border-radius: 3px; background: var(--rule); transition: background 0.25s; }
.dot.done   { background: var(--indigo-mid); }
.dot.active { background: var(--indigo); }

.btns { display: flex; gap: 7px; }
.btn-back {
  font-size: 13px; color: var(--muted); background: none;
  border: 0.5px solid var(--rule); border-radius: 9px;
  padding: 6px 14px; cursor: pointer; font-family: inherit;
}
.btn-back:hover { background: var(--rule); }
.btn-next {
  font-size: 13px; font-weight: 600; color: var(--white);
  background: var(--indigo); border: none; border-radius: 9px;
  padding: 6px 18px; cursor: pointer; font-family: inherit;
  transition: opacity 0.15s;
}
.btn-next:hover { opacity: 0.85; }
.btn-pdf {
  font-size: 13px; font-weight: 600; color: var(--indigo);
  background: var(--indigo-light); border: 0.5px solid var(--indigo-mid);
  border-radius: 9px; padding: 6px 14px; cursor: pointer; font-family: inherit;
}
.btn-pdf:hover { background: var(--indigo-mid); }

/* ── Card sort panel ───────────────────────────────────────────────────────── */
.sort-panel {
  position: absolute; inset: 0; border-radius: 18px;
  background: var(--white); z-index: 10;
  display: none; flex-direction: column; overflow: hidden;
  animation: slideIn 0.2s ease;
}
.sort-panel.open { display: flex; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sort-head {
  padding: 1.1rem 1.4rem 0.95rem;
  border-bottom: 0.5px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
}
.sort-head-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.sort-head-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sort-close {
  font-size: 20px; color: var(--muted); cursor: pointer;
  background: none; border: none; line-height: 1;
  padding: 4px 6px; font-family: inherit;
}
.sort-close:hover { color: var(--ink); }

.sort-phase { flex: 1; display: none; flex-direction: column; overflow: hidden; }
.sort-phase.active { display: flex; }

/* Tinder phase */
.tinder-area {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 1.5rem 1.4rem; gap: 1.1rem;
}
.tinder-progress { font-size: 12px; color: var(--muted); }
.tinder-q {
  font-size: 14px; font-weight: 500; color: var(--mid);
  text-align: center; max-width: 300px; line-height: 1.5;
}
.tinder-q em { color: var(--indigo); font-style: normal; font-weight: 600; }
.tinder-card {
  width: 100%; max-width: 300px;
  background: var(--peach-light); border: 0.5px solid var(--peach-mid);
  border-radius: 18px; padding: 2.25rem 1.75rem;
  text-align: center; min-height: 150px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s, opacity 0.12s;
}
.tinder-word { font-size: 24px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.tinder-btns { display: flex; gap: 12px; width: 100%; max-width: 300px; }
.t-btn {
  flex: 1; padding: 0.7rem; border-radius: 11px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 0.5px solid var(--rule); font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
}
.t-btn:active { transform: scale(0.97); }
.t-keep { background: var(--indigo); color: var(--white); border-color: var(--indigo); }
.t-skip { background: var(--surface); color: var(--muted); }
.t-skip:hover { background: rgba(0,0,0,0.05); }
.tinder-hint { font-size: 11px; color: var(--muted); text-align: center; max-width: 260px; line-height: 1.5; }

/* Pick phase */
.pick-area { flex: 1; overflow-y: auto; padding: 1.25rem 1.4rem; }
.pick-instruction { font-size: 14px; color: var(--mid); margin-bottom: 1.1rem; line-height: 1.6; }
.pick-grid  { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-chip  {
  font-size: 13px; font-weight: 500; padding: 7px 15px; border-radius: 20px;
  cursor: pointer; border: 1.5px solid var(--peach-mid);
  background: var(--peach-light); color: var(--peach-dark);
  transition: all 0.15s; user-select: none;
}
.pick-chip.selected  { background: var(--peach); color: var(--white); border-color: var(--peach); }
.pick-chip.disabled  { opacity: 0.3; cursor: default; }
.pick-count { font-size: 12px; color: var(--muted); margin-top: 0.85rem; }

.sort-bottom {
  border-top: 0.5px solid var(--rule);
  padding: 0.8rem 1.4rem;
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--surface);
}
.sort-btn-sec {
  font-size: 13px; color: var(--muted); background: none;
  border: 0.5px solid var(--rule); border-radius: 9px;
  padding: 6px 14px; cursor: pointer; font-family: inherit;
}
.sort-btn-pri {
  font-size: 13px; font-weight: 600; color: var(--white);
  background: var(--indigo); border: none; border-radius: 9px;
  padding: 6px 16px; cursor: pointer; font-family: inherit;
}

/* ── Disclaimer ────────────────────────────────────────────────────────────── */
.disclaimer {
  padding: 0.85rem 0.25rem 0;
  font-size: 11px; color: var(--muted);
  line-height: 1.6; text-align: center;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 1rem 0.75rem 2rem; }
  .step-q, .q-step-q { font-size: 16px; }
  .tinder-word { font-size: 20px; }
  .quadrants { grid-template-columns: 1fr; }
  .q.tr, .q.bl, .q.br { border-left: none; }
  .q.bl, .q.br { border-top: 1.5px solid var(--axis); }
  .axis-row { grid-template-columns: 1fr; }
  .axis-lbl.right { border-left: none; border-top: 0.5px solid var(--axis); }
}
