/* Pulse uses the existing Xporia palette and a finite, accessible vertical feed. */
.xp-root { --xp-accent:#6350df; --xp-tint:color-mix(in srgb,var(--xp-accent) 8%,var(--panel)); max-width:780px; margin-inline:auto; color:var(--ink); font-size:15px; line-height:1.55; }
.xp-root *, .xp-root *::before, .xp-root *::after { box-sizing:border-box; }
.xp-root [hidden] { display:none!important; }
.xp-root :is(h2,h3,p,figure,fieldset) { margin:0; }
.xp-root :is(button,input) { font:inherit; }
.xp-root button { cursor:pointer; -webkit-tap-highlight-color:transparent; }
.xp-root :is(button,input,[tabindex]):focus-visible { outline:3px solid var(--xp-accent); outline-offset:3px; }
.xp-root button:disabled { cursor:wait; opacity:.6; }
.xp-heading { display:flex; justify-content:space-between; align-items:center; gap:15px; margin-bottom:18px; }
.xp-root .xp-eyebrow { font-size:10px; font-weight:800; letter-spacing:.12em; color:var(--xp-accent); }
.xp-root h2 { font-size:clamp(27px,4vw,38px); letter-spacing:-.04em; line-height:1.3; color:var(--ink); }
.xp-heading-hint { font-size:13px; color:var(--muted); }
.xp-welcome { display:grid; justify-items:center; gap:20px; padding:clamp(24px,5vw,48px); border:1px solid var(--line); border-radius:26px; background:radial-gradient(ellipse at top right,var(--xp-tint),transparent 70%),var(--panel); text-align:center; }
.xp-welcome h3,.xp-finish h3 { font-size:clamp(24px,4vw,32px); letter-spacing:-.03em; line-height:1.2; color:var(--ink); }
.xp-welcome p { max-width:450px; }
.xp-welcome small,.xp-pause-note { font-size:12px; color:var(--muted); }
.xp-pulse-mark { display:grid; place-items:center; width:60px; height:60px; border-radius:20px; color:white; background:linear-gradient(135deg,#9366e8,#5744ce); font-size:36px; font-weight:850; }
.xp-start-form { display:grid; gap:15px; width:100%; max-width:400px; }
.xp-field { display:grid; gap:8px; text-align:left; font-size:12px; color:var(--muted); }
.xp-input { width:100%; min-width:0; min-height:46px; border:1px solid var(--line); border-radius:12px; padding:11px 13px; background:var(--control-bg,var(--panel)); color:var(--ink); font-size:16px!important; }
.xp-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:46px; padding:11px 18px; border:1px solid var(--line); border-radius:12px; background:var(--panel); color:var(--ink); font-weight:750!important; font-size:14px!important; }
.xp-primary { background:var(--xp-accent); color:white; border-color:var(--xp-accent); }
.xp-text-button { min-height:42px; border:0; padding:9px 3px; background:transparent; color:var(--xp-accent); font-size:12px!important; font-weight:750!important; }
.xp-feed-progress { display:flex; justify-content:space-between; gap:10px; padding:0 4px 10px; font-size:11px; color:var(--muted); }
.xp-position { color:var(--xp-accent); font-weight:800; }
.xp-feed { position:relative; height:clamp(420px,calc(100dvh - 215px),740px); overflow-y:auto; overflow-x:hidden; scroll-snap-type:y proximity; scrollbar-width:thin; scrollbar-color:var(--line) transparent; border-radius:24px; }
.xp-card { display:flex; flex-direction:column; gap:18px; min-height:100%; margin-bottom:14px; padding:clamp(20px,4vw,34px); scroll-snap-align:start; border:1px solid var(--line); border-radius:24px; background:linear-gradient(150deg,var(--xp-tint),transparent 52%),var(--panel); overflow-wrap:anywhere; }
.xp-card:last-child { margin-bottom:0; }
.xp-kind-visual { --xp-tint:color-mix(in srgb,#059669 9%,var(--panel)); }
.xp-kind-riddle { --xp-tint:color-mix(in srgb,#d97706 8%,var(--panel)); }
.xp-kind-order { --xp-tint:color-mix(in srgb,#2563eb 8%,var(--panel)); }
.xp-card-meta { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:11px; font-weight:750; color:var(--muted); }
.xp-kind { padding:6px 10px; border-radius:9px; background:var(--panel); color:var(--xp-accent); }
.xp-subject { font-size:11px; color:var(--muted); }
.xp-question { font-size:clamp(21px,3vw,29px); letter-spacing:-.025em; line-height:1.35; color:var(--ink); }
.xp-answer-form { display:grid; gap:16px; }
.xp-options { display:grid; gap:10px; min-width:0; padding:0; border:0; }
.xp-choice { display:flex; align-items:center; gap:12px; min-height:49px; padding:12px 15px; border:1px solid var(--line); border-radius:13px; text-align:left; color:var(--ink); background:var(--panel); font-size:15px!important; }
.xp-choice:hover { border-color:var(--xp-accent); }
.xp-choice[aria-pressed="true"] { background:var(--xp-tint); border:2px solid var(--xp-accent); padding:11px 14px; }
.xp-order-number { flex:0 0 26px; display:grid; place-items:center; height:26px; border-radius:50%; background:var(--xp-tint); color:var(--xp-accent); font-weight:850; }
.xp-order-hint,.xp-answer-recap { font-size:12px; color:var(--muted); }
.xp-feedback { display:grid; gap:9px; padding:17px; border:1px solid var(--line); border-radius:14px; background:var(--panel-soft); font-size:14px; white-space:pre-wrap; }
.xp-feedback strong { color:var(--xp-accent); }
.xp-correct { border-color:color-mix(in srgb,#059669 35%,var(--line)); }
.xp-correct strong { color:#047857; }
.xp-correction { font-weight:750; }
.xp-card-navigation { display:flex; gap:14px; justify-content:space-between; margin-top:auto; }
.xp-card-navigation > :last-child { margin-left:auto; }
.xp-chart { display:grid; gap:12px; padding:16px; border:1px solid var(--line); border-radius:14px; background:var(--panel); }
.xp-chart figcaption { font-size:12px; font-weight:750; }
.xp-chart-row { display:grid; grid-template-columns:minmax(60px,1fr) minmax(0,2fr) auto; align-items:center; gap:10px; font-size:12px; }
.xp-chart-bar { height:14px; border-radius:4px; background:var(--xp-accent); }
.xp-finish { justify-content:center; align-items:center; text-align:center; }
.xp-score { font-size:48px; font-weight:850; letter-spacing:-.04em; color:var(--xp-accent); }
.xp-history { margin-top:24px; border-top:1px solid var(--line); padding-top:12px; }
.xp-history summary { cursor:pointer; padding:12px 0; font-size:14px; font-weight:700; }
.xp-history-row { display:grid; width:100%; gap:4px; padding:16px 4px; border:0; border-bottom:1px solid var(--line); text-align:left; color:var(--ink); background:transparent; }
.xp-history-row span { font-size:12px; color:var(--muted); }
.xp-status { margin-bottom:14px!important; padding:12px; border-radius:10px; background:var(--xp-tint); font-size:13px; }
.xp-status.xp-error { color:#9f1239; background:#fff1f2; }
.xp-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
body[data-theme="dark"] .xp-root { --xp-accent:#b5a4ff; }
body[data-theme="dark"] .xp-primary { color:#18203a; }
body[data-theme="dark"] .xp-correct strong { color:#6ee7b7; }
body[data-theme="dark"] .xp-status.xp-error { color:#fecdd3; background:#4c0519; }
body.simple-ui .sidebar .nav-item .pulse-icon { display:grid; place-items:center; font-size:18px; font-weight:900; background:linear-gradient(135deg,#ef62a0,#a04bd9)!important; color:#fff!important; }
@media(max-width:760px) { .xp-heading { margin-bottom:12px; } .xp-eyebrow { display:none; } .xp-card { gap:15px; } .xp-feed { height:clamp(280px,calc(100dvh - 290px - env(safe-area-inset-bottom)),700px); } .xp-heading .xp-text-button { max-width:70px; flex-shrink:0; } }
@media(prefers-reduced-motion:reduce) { .xp-root * { scroll-behavior:auto!important; animation:none!important; transition:none!important; } }

body.feature-pulse-disabled :is([data-view="pulse"],[data-view-link="pulse"],#pulseView) { display:none!important; }
