/* Mix diagnostics: the tool's own look, scoped under #pq. Colours come from the --p-* tokens in /assets/toolkit.css.
   Orange only marks what matters here: the primary action, where you are now, the problem band and the warning. */

#pq {
  --pq-bg: var(--p-bg);
  --pq-panel: var(--p-panel);
  --pq-panel2: var(--p-panel-2);
  --pq-line: var(--p-line);
  --pq-line2: var(--p-line-2);
  --pq-txt: var(--p-text);
  --pq-mut: var(--p-muted);
  --pq-faint: var(--p-faint);
  display: block;
  color: var(--pq-txt);
  font-family: var(--p-font);
  line-height: 1.5;
}
#pq .pq-wrap { padding-top: clamp(28px, 5vw, 56px); padding-bottom: 8px; }
#pq button { font-family: inherit; }
/* one small-label style on this page */
#pq .p-label { font-size: 12px; letter-spacing: 0.06em; }

/* intro */
#pq .pq-h1 { font-weight: 700; font-size: clamp(42px, 8vw, 88px); line-height: 0.95; letter-spacing: -0.04em; margin: 0 0 16px; color: var(--p-head); }
#pq .pq-lead { color: var(--pq-mut); font-size: clamp(15px, 1.6vw, 18px); max-width: 62ch; line-height: 1.5; margin: 0; }

/* your path */
#pq .pq-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 32px 0 14px; min-height: 44px; scroll-margin-top: 80px; }
#pq .pq-crumb { font-size: 12.5px; font-weight: 600; color: var(--pq-mut); background: var(--pq-panel); border: 1px solid var(--pq-line); padding: 6px 12px; min-height: 44px; border-radius: 4px; cursor: pointer; text-align: left; max-width: 100%; overflow-wrap: anywhere; }
#pq .pq-crumb:hover { color: var(--pq-txt); border-color: var(--pq-line2); }
/* where you are: sage, not orange (orange is kept for the one main action) */
#pq .pq-crumb.cur { background: var(--p-sage-dim); border-color: var(--p-sage-2); color: var(--p-sage-hi); cursor: default; }
/* on the first screen the path is just "Start": it reads as a button, so it stays out of sight (and keeps its place for the scroll) */
#pq .pq-crumbs:has(> .pq-crumb:only-child) { visibility: hidden; height: 0; min-height: 0; margin: 28px 0 0; overflow: hidden; }
#pq .pq-sep { color: var(--pq-faint); font-size: 13px; }

/* the stage: one step at a time */
#pq .pq-stage { background: var(--pq-panel); border: 1px solid var(--pq-line); border-radius: 8px; padding: clamp(20px, 3vw, 32px); box-shadow: 0 18px 30px -24px rgba(0, 0, 0, 0.8); }
#pq .pq-prompt { font-weight: 700; font-size: clamp(26px, 3.6vw, 40px); line-height: 1.08; letter-spacing: -0.04em; margin: 0 0 10px; color: var(--p-head); max-width: 30ch; }
#pq .pq-prompt:focus, #pq .pq-head:focus { outline: none; }
#pq .pq-hint { color: var(--pq-mut); font-size: 14.5px; margin: 0 0 22px; line-height: 1.5; }

/* areas */
#pq .pq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
#pq .pq-card { display: flex; flex-direction: column; gap: 6px; position: relative; background: var(--pq-panel2); border: 1px solid var(--pq-line); border-radius: 6px; padding: 18px 44px 20px 18px; cursor: pointer; text-align: left; color: var(--pq-txt); transition: border-color .15s, background-color .15s, transform .15s; min-height: 44px; }
#pq .pq-card:hover { border-color: var(--p-sage-2); background: var(--p-panel-3); transform: translateY(-2px); }
#pq .pq-card-n { display: none; }
#pq .pq-card-t { font-weight: 700; font-size: 19px; line-height: 1.15; letter-spacing: -0.02em; color: var(--p-sage-hi); }
#pq .pq-card-d { font-size: 13px; color: var(--pq-mut); line-height: 1.45; }
#pq .pq-card .pq-arr { position: absolute; top: 16px; right: 16px; color: var(--p-sage); font-size: 17px; }

/* symptoms and answers */
#pq .pq-opts { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
#pq .pq-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--pq-txt); background: var(--pq-panel2); border: 1px solid var(--pq-line); padding: 15px 18px; min-height: 56px; border-radius: 6px; cursor: pointer; text-align: left; transition: border-color .15s, background-color .15s, transform .15s; }
#pq .pq-opt:hover { border-color: var(--p-sage-2); background: var(--p-panel-3); transform: translateX(3px); }
#pq .pq-opt .pq-arr { color: var(--p-sage); font-size: 18px; flex: 0 0 auto; }

/* diagnosis */
#pq .pq-tag { color: var(--p-muted); margin-bottom: 12px; }
#pq .pq-head { font-weight: 700; font-size: clamp(28px, 4.2vw, 48px); line-height: 1.04; letter-spacing: -0.04em; margin: 0 0 16px; color: var(--p-head); max-width: 26ch; }
#pq .pq-cause { color: var(--pq-txt); font-size: 16px; line-height: 1.6; margin: 0 0 24px; max-width: 72ch; }
#pq .pq-blk { margin: 0 0 24px; max-width: 820px; }
#pq .pq-loc { background: var(--p-deep); border: 1px solid var(--pq-line); border-radius: 6px; padding: 16px 18px 18px; }
#pq .pq-lbl { color: var(--pq-mut); margin: 0 0 12px; }
#pq .pq-loc .pq-lbl { margin-bottom: 6px; }
#pq .pq-where { font-weight: 700; font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; color: var(--p-sage-hi); overflow-wrap: anywhere; }
#pq .pq-params { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
#pq .pq-param { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--p-ink); background: var(--p-sel); padding: 6px 12px; border-radius: 4px; }

/* the mini frequency strip: 20 Hz–20 kHz, the problem band in orange */
#pq .pq-spec { position: relative; height: 52px; margin-top: 14px; background: var(--p-screen); border: 1px solid var(--pq-line); border-radius: 4px; overflow: hidden; }
#pq .pq-bh { position: absolute; top: 0; bottom: 18px; background: var(--p-orange-dim); border-left: 2px solid var(--p-orange); border-right: 2px solid var(--p-orange); }
#pq .pq-tl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--pq-line); }
#pq .pq-tk { position: absolute; bottom: 3px; transform: translateX(-50%); font-family: var(--p-mono); font-size: 10.5px; color: var(--pq-mut); }
#pq .pq-tk-first { transform: translateX(4px); }
#pq .pq-tk-last { transform: translateX(calc(-100% - 4px)); }

/* steps */
#pq .pq-steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
#pq .pq-steps li { counter-increment: s; position: relative; padding: 0 0 0 40px; margin: 0; color: var(--pq-txt); font-size: 15px; line-height: 1.55; }
#pq .pq-steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 27px; height: 27px; border-radius: 4px; background: var(--p-sel); color: var(--p-ink); font-family: var(--p-mono); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
#pq .pq-steps.pq-check li::before { background: transparent; color: var(--p-muted); box-shadow: inset 0 0 0 1.5px var(--p-border); }
#pq .pq-steps.pq-adv li::before { background: transparent; color: var(--p-sage); box-shadow: inset 0 0 0 1.5px var(--p-sage); }

#pq .pq-principle { background: var(--pq-panel2); border: 1px solid var(--pq-line); border-left: 4px solid var(--p-sage); border-radius: 6px; padding: 16px 18px; margin: 4px 0 18px; max-width: 820px; }
#pq .pq-pl { color: var(--p-sage); margin-bottom: 8px; }
#pq .pq-principle p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--pq-txt); font-weight: 500; }
#pq .pq-watch { font-size: 14.5px; color: var(--pq-txt); line-height: 1.55; background: rgba(226, 194, 125, 0.08); border: 1px solid rgba(226, 194, 125, 0.4); border-radius: 6px; padding: 13px 16px; margin: 0 0 22px; max-width: 820px; }
#pq .pq-watch b { color: var(--p-warn); }

#pq .pq-links { display: flex; gap: 8px; flex-wrap: wrap; }
#pq .pq-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 600; color: var(--p-sage); box-shadow: inset 0 0 0 1.5px var(--p-sage-2); padding: 8px 14px; border-radius: 4px; text-decoration: none; transition: background-color .15s; }
#pq .pq-link:hover { background: var(--p-sage-dim); color: var(--p-sage-hi); }

#pq .pq-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
#pq .pq-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border: 0; border-radius: 4px; font: 700 13px var(--p-font); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; background: transparent; color: var(--p-sage); box-shadow: inset 0 0 0 1.5px var(--p-sage); }
#pq .pq-btn:hover { background: var(--p-sage-dim); }
#pq .pq-btn.pq-primary { background: var(--p-fill); color: var(--p-ink); box-shadow: var(--p-fill-shadow); }
#pq .pq-btn.pq-primary:hover { filter: brightness(1.05); }

/* the 6+1 principles */
#pq .pq-principles { margin-top: 20px; border: 1px solid var(--pq-line); border-radius: 8px; background: var(--pq-panel); overflow: hidden; }
#pq .pq-pr-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; min-height: 56px; background: transparent; border: 0; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; color: var(--p-sage-hi); cursor: pointer; text-align: left; }
#pq .pq-pr-toggle:hover { background: var(--p-panel-2); }
#pq .pq-chev { color: var(--p-sage); transition: transform .2s; display: inline-block; }
#pq .pq-pr-toggle.open .pq-chev { transform: rotate(180deg); }
#pq .pq-pr-body { padding: 4px 20px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px 24px; }
#pq .pq-pr { border-left: 2px solid var(--p-sage-2); padding-left: 13px; }
#pq .pq-pr b { display: block; font-size: 15px; color: var(--pq-txt); margin-bottom: 3px; }
#pq .pq-pr span { font-size: 14px; color: var(--pq-mut); line-height: 1.5; }

@media (max-width: 560px) {
  #pq .pq-grid { grid-template-columns: 1fr; }
  #pq .pq-card { padding: 16px 44px 16px 16px; }
  #pq .pq-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { #pq * { transition: none; } }

/* Depth (2026-11-07): the chooser sits on the sage metal (.t-metal); the areas are dark keys, each with its own line icon */
#pq .pq-prompt { color: #1F201F; }
#pq .pq-hint { color: #3A3C3A; }
#pq .pq-grid { gap: 14px; margin-top: 8px; }
#pq .pq-card { background: #262726; border: 0; border-radius: 10px; padding: 20px 20px 22px; gap: 8px; box-shadow: 0 14px 24px -16px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
#pq .pq-card::before { content: ""; width: 34px; height: 34px; margin-bottom: 10px; background: var(--p-sage); -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
#pq .pq-card:hover { background: #1F201F; transform: translateY(-3px); }
#pq .pq-card-t { color: var(--p-head); font-size: 19px; }
#pq .pq-card-d { color: #A9ADA8; }
#pq .pq-card .pq-arr { top: 20px; right: 18px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--p-sage-2); color: var(--p-sage); font-size: 15px; transition: background .15s, color .15s; }
#pq .pq-card:hover .pq-arr { background: var(--p-orange); box-shadow: none; color: #1F201F; }
#pq .pq-card[data-grp="0"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M2 26c4 0 5-16 9-16s5 16 9 16'/%3E%3Cpath d='M12 26c4 0 5-20 9-20s5 20 9 20'/%3E%3Cpath d='M2 29h28'/%3E%3C/svg%3E"); }
#pq .pq-card[data-grp="1"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M2 16c4-14 10-14 14 0s10 14 14 0'/%3E%3C/svg%3E"); }
#pq .pq-card[data-grp="2"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 16l3-9 4 18 4-18 4 18 4-18 4 18 4-18 3 9'/%3E%3C/svg%3E"); }
#pq .pq-card[data-grp="3"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M5 29V15M11 29V5M17 29V17M23 29V9M29 29V19'/%3E%3Cpath d='M2 11h28' stroke-width='1.6' stroke-dasharray='2 3'/%3E%3C/svg%3E"); }
#pq .pq-card[data-grp="4"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2'%3E%3Ccircle cx='11' cy='16' r='8'/%3E%3Ccircle cx='21' cy='16' r='8'/%3E%3C/svg%3E"); }
#pq .pq-card[data-grp="5"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='12' y='3' width='8' height='15' rx='4'/%3E%3Cpath d='M7 14a9 9 0 0 0 18 0M16 23v6M11 29h10'/%3E%3C/svg%3E"); }
#pq .pq-card[data-grp="6"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='9' height='8' rx='1.5'/%3E%3Crect x='13' y='6' width='17' height='8' rx='1.5'/%3E%3Crect x='2' y='18' width='15' height='8' rx='1.5'/%3E%3Crect x='19' y='18' width='11' height='8' rx='1.5'/%3E%3C/svg%3E"); }
#pq .pq-card[data-grp="7"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2'%3E%3Crect x='7' y='2' width='18' height='28' rx='3'/%3E%3Ccircle cx='16' cy='20' r='5'/%3E%3Ccircle cx='16' cy='9' r='2'/%3E%3C/svg%3E"); }
@media (max-width: 700px) { #pq .pq-card { padding: 18px 60px 18px 18px; } #pq .pq-card::before { width: 28px; height: 28px; margin-bottom: 6px; } }
/* the tool's own tokens follow the metal: dark text on the panel, light text on the keys */
#pq .t-metal, #pq .t-metal :where(button) { --pq-txt: var(--p-text); --pq-mut: var(--p-muted); --pq-faint: var(--p-faint); --pq-line: var(--p-line); --pq-line2: var(--p-line-2); }
/* the result is reading, not choosing: back to the dark screen */
#pq .pq-stage.t-metal:has(.pq-cause, .pq-principle, .pq-where) {
  --p-text: #ECEDE8; --p-head: #F4F3EC; --p-muted: #A9ADA8; --p-faint: #A2A6A0; --p-sage-hi: #F4F3EC; --p-sage-2: #C9CCC5;
  --p-line: rgba(244, 243, 236, 0.14); --p-line-2: rgba(244, 243, 236, 0.26); --p-sel: #F06A3B; --p-ink: #222322;
  --pq-txt: var(--p-text); --pq-mut: var(--p-muted); --pq-faint: var(--p-faint); --pq-line: var(--p-line); --pq-line2: var(--p-line-2);
  color: var(--p-text); background: var(--p-panel) !important; box-shadow: 0 18px 30px -24px rgba(0, 0, 0, 0.8) !important;
}
#pq .pq-stage.t-metal:has(.pq-cause, .pq-principle, .pq-where) .pq-prompt { color: var(--p-head); }
#pq .pq-stage.t-metal:has(.pq-cause, .pq-principle, .pq-where) .pq-hint { color: var(--p-muted); }
/* phone: shorter area cards so the next step is closer (Codex review 33) */
@media (max-width: 700px) {
  #pq .pq-grid { gap: 10px; }
  #pq .pq-card { padding: 14px 56px 14px 16px !important; gap: 4px; }
  #pq .pq-card::before { width: 24px !important; height: 24px !important; margin-bottom: 2px !important; }
  #pq .pq-card .pq-arr { top: 14px; right: 14px; width: 30px; height: 30px; }
}
/* the principles sit on the cream reading band (Codex review 39): the local tokens follow the band */
#pq .t-read { --pq-bg: var(--p-bg); --pq-panel: var(--p-panel); --pq-panel2: var(--p-panel-2); --pq-line: var(--p-line); --pq-line2: var(--p-line-2); --pq-txt: var(--p-text); --pq-mut: var(--p-muted); --pq-faint: var(--p-faint); }
#pq .t-read .pq-principles { margin-top: 0; }
#pq .t-read .pq-pr-toggle:hover { background: var(--p-panel-2); }
#pq .t-more .pq-principles { margin-top: 0; }
