/* Integration states layered on the approved semantic palette. */
[hidden] { display:none !important; }
.header-preferences { display:flex; flex-wrap:wrap; gap:8px; }
.header-preferences button { min-height:44px; display:flex; flex-direction:column; align-items:flex-start; font-size:.875rem; }
.header-preferences button span { color:inherit; font-size:.75rem; }
[data-theme="dai-sao"] .header-preferences { margin-top:24px; }
.preference-list { display:grid; gap:12px; }
.preference-list button { display:flex; flex-direction:column; align-items:flex-start; gap:6px; min-height:48px; text-align:start; }
.preference-list [aria-pressed="true"] { border:2px solid var(--action); background:var(--soft); }
.preference-list button:disabled { opacity:1; color:var(--muted); cursor:default; }
dialog { width:min(560px,calc(100vw - 32px)); max-height:calc(100dvh - 40px); overflow-y:auto; }
.result-section p { white-space:pre-line; overflow-wrap:anywhere; }
.after-reading { display:flex; gap:12px; flex-wrap:wrap; }
.after-reading h2,.after-reading p { flex-basis:100%; }
button,input,select { min-height:44px; }
.check-field input { min-height:0; width:20px; height:20px; flex-shrink:0; }
#form-error,#lead-error { color:var(--danger); }
.spinner { display:inline-block; width:32px; height:32px; border:3px solid var(--line); border-top-color:var(--action); border-radius:50%; animation:turn 1s linear infinite; }
@keyframes turn { to { transform:rotate(360deg); } }
@media(max-width:700px){.header-preferences{width:100%;}.header-preferences button{flex:1;}[data-theme="dai-sao"] .header-preferences{margin-top:8px;}.after-reading button{width:100%;}}
@media(prefers-reduced-motion:reduce){.spinner{animation:none;}}

.header-preferences button { background:transparent; border:1px solid currentColor; border-radius:10px; padding:8px 12px; text-align:start; }
.preference-list button { background:var(--surface); color:var(--ink); border:1px solid var(--control); border-radius:12px; padding:16px; }
.preference-list button:hover:not(:disabled) { background:var(--soft); }
.history-row button { background:var(--surface); color:var(--ink); border:1px solid var(--control); border-radius:8px; padding:8px 12px; }
.result-heading .expiry { font-size:.875rem; color:var(--muted); }
/* Navigation inherits the header palette, including the blue Trạm tín hiệu header. */
.brand-header nav button { color:inherit; }
dialog #lead-content + button { margin-top:12px; }
.after-reading p { max-width:none; }
/* Q18: complete notice and bibliography remain readable in every Q15 theme. */
.result-notice{margin-top:2rem;padding-top:1.5rem;border-top:1px solid var(--line);overflow-wrap:anywhere}
.result-notice h2{font-size:1rem}.result-notice p{font-size:1rem;line-height:1.7}
.methods-action{margin-top:1.5rem}.methodology section{margin-block:1.5rem;padding-block:1rem;border-top:1px solid var(--line)}
.methodology p,.methodology a{overflow-wrap:anywhere}.methodology h3{font-size:1.1rem;line-height:1.5}

/* Q01 progressive disclosure shares the Q15 theme tokens and native keyboard behavior. */
.tuvi-facts{padding:clamp(1rem,3vw,2rem);margin:1.5rem 0;overflow-wrap:anywhere}
.tuvi-facts h2{font-size:1.4rem}.tuvi-facts p{line-height:1.7}
.tuvi-chart>summary,.tuvi-reading>summary,.tuvi-palace>summary{padding:1rem .4rem;cursor:pointer;font-weight:650;line-height:1.5}
.tuvi-palaces{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin-block:1rem}
.tuvi-palace,.tuvi-reading{border-top:1px solid currentColor;padding:.2rem .6rem;min-width:0}
.tuvi-palace ul{padding-inline-start:1.3rem}.tuvi-palace li{line-height:1.6}.tuvi-palace p{font-size:.9em}
.tuvi-reading{margin-block:1rem}.tuvi-reading p{line-height:1.85}
.tuvi-facts summary:focus-visible,.tuvi-reading summary:focus-visible{outline:3px solid currentColor;outline-offset:3px}
@media(max-width:700px){.tuvi-palaces{grid-template-columns:1fr}.tuvi-facts h2{font-size:1.2rem}}

/* GĐ7 extends shared papers and fields across all four approved themes. */
.private-photo{display:block;max-width:100%;max-height:65vh;width:auto;height:auto;object-fit:contain;margin:1rem auto;border-radius:12px;background:#fff}
.private-photo[hidden],[data-measure][hidden]{display:none}
.measurement-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 1rem}
.observation-facts,.image-waiting{padding:clamp(1rem,3vw,2rem);margin:1.5rem 0}
.observation-facts dl{display:grid;gap:.75rem}.observation-facts dl>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1rem;border-bottom:1px solid var(--line);padding:.7rem 0}
.observation-facts dd{margin:0}.observation-facts dd small{display:block;margin-top:.3rem}.field input[type=file]{max-width:100%;white-space:normal}
@media(max-width:520px){.measurement-grid{grid-template-columns:1fr}.observation-facts dl>div{grid-template-columns:1fr;gap:.25rem}.image-waiting button{margin:.35rem 0}}

/* P3 camera: shared Q15 tokens, uncropped frame, no change to approved appearances. */
.camera-frame{background:var(--surface);border:1px solid var(--line);border-radius:12px;overflow:hidden;min-height:40px}
.camera-frame video,.camera-frame img{display:block;width:100%;max-height:42dvh;object-fit:contain}
.camera-frame [hidden],.camera-actions [hidden]{display:none}
.camera-mirrored{transform:scaleX(-1)}
.camera-actions{flex-wrap:wrap}.camera-actions button{white-space:normal}
.camera-panel select{width:100%;min-width:0}.camera-panel p{overflow-wrap:anywhere}

/* P4 artwork only; frozen symbolic cards keep their original theme treatment. */
.spread .reading-card .card-face.card-illustrated{padding:0;min-height:0;aspect-ratio:2/3;border-radius:7px;overflow:hidden;background:#fff;display:grid;place-items:center}
.card-art-image{display:block;width:100%;height:100%;object-fit:contain}
.card-art-image.is-reversed{transform:rotate(180deg)}
.card-art-image[hidden],.card-art-fallback[hidden]{display:none}
.card-art-fallback{padding:16px;text-align:center;color:#24483e}
.reading-card:has(.card-illustrated) figcaption strong,.reading-card:has(.card-illustrated) figcaption span{display:block}
.reading-card:has(.card-illustrated) figcaption strong{font-size:14px;line-height:1.4;margin-bottom:4px}
