/* Visualização e preferências de leitura */
:root {
  color-scheme: dark;
  --paper:#16131e; --white:#231f2e; --ink:#faf6ff; --sub:#d0c7da;
  --plum:#d6c2ff; --violet:#d6c2ff; --peach:#46303e; --coral:#ffac98;
  --line:#51465e; --edge:#8d7c9e; --control:#30293d; --button-ink:#21152c;
}
body {background:radial-gradient(ellipse at 82% 2%,#2b2137 0,transparent 55%),var(--paper);min-height:100vh}
:focus-visible,.option input:focus-visible+span {outline:3px solid #fff198;outline-offset:3px}
.skip:focus {background:#fff198;color:#221c06}
.sidebar {background:#1a1721}
.brand img {background:#fff9f6;border-radius:10px;padding:5px 9px}
.navitem,.swipe-hint,.deck-action,.check {color:var(--sub)}
.navitem:hover,.calm-toggle:hover {background:var(--control)}
.navitem.active,.navcount {color:var(--violet);background:#382d49}
.navitem.active {box-shadow:inset 3px 0 var(--violet)}
.calm-toggle {min-height:44px;text-align:left;border-radius:12px;margin:22px 0;padding:8px 16px;color:var(--plum);font-weight:650}
.intro h1 {letter-spacing:-.05em}
.outline,.iconbtn,.profile-link,.action-disc,.input {color:var(--ink);background:var(--control);border:1px solid var(--edge)}
.iconbtn {width:auto;min-width:44px;border-radius:12px;padding:0 10px;gap:5px;font-size:.9rem;flex:none}
.iconbtn svg {width:16px}
.primary,.studio-btn {color:var(--button-ink);background:var(--violet)}
.studio-btn {width:fit-content}
.miniheart,.textbtn {color:var(--coral)}
.demo-label span {border-color:var(--edge)}
.tag,.mode-note,.bubble,.invite,.softpanel {background:var(--peach);color:var(--ink)}
.section-rule {border-color:var(--line)}
.photo-stack::before {background:#483345;border-color:var(--edge)}
.photo-meta {gap:6px;align-items:start}
.compat-badge {background:#ead9ff;color:#352044}
.compat-badge svg {color:#684283}
.position,.interests span,.more-profile {background:#231b2b;color:#fff}
.position {white-space:nowrap}
.portrait-card {border:1px solid #716279}
.photo-shade {background:linear-gradient(180deg,transparent 39%,#110e1b44 53%,#120b1cdc 78%,#120b1c 100%)}
.deck-action.undo .action-disc {color:var(--plum)}
.deck-action.like .action-disc {background:var(--coral);border-color:var(--coral);color:#3a1923}
.aff-icon.tone-0 {color:#c9e8c0;background:#34433b}
.aff-icon.tone-1 {color:#ffbeaf;background:#47343b}
.aff-icon.tone-2 {color:#ddc9ff;background:#3d344b}
.option span,.scene,.display-choice {min-height:44px;border-color:var(--edge)}
.option input:checked+span,.scene:has(input:checked) {background:var(--violet);color:var(--button-ink);border-color:var(--violet)}
.check,.scene,.display-choice {min-height:44px}
.check input,.display-choice input,.scene input {accent-color:var(--violet);width:20px;height:20px;flex:none}
input::placeholder,textarea::placeholder {color:var(--sub)}
.formerror {color:#ffb8ae}
#toast {background:var(--violet);color:var(--button-ink)}
.sheethead {flex-wrap:wrap}
dialog {border:1px solid var(--edge)}
dialog::backdrop {background:#09060dcc}
.match-avatar span {background:#472c47;color:var(--coral)}
.rehearsal-tile {position:relative;overflow:hidden;isolation:isolate;border:1px solid #78618d;border-radius:21px;
  background:radial-gradient(ellipse at 85% 10%,#553e62 0,transparent 60%),#2e2237}
.tile-copy {position:relative;padding:0 clamp(18px,2vw,29px) 22px}
.tile-copy h2 {font-size:1.55rem;line-height:1.18;letter-spacing:-.04em}
.tile-copy p {margin:8px 0 16px;color:#ece3f0;max-width:37ch}
.orbit-art {height:clamp(106px,13.7vh,161px);background:url("assets/ensaio.webp") 50% 51%/cover no-repeat}
[data-contrast=true] .orbit-art {display:none}
[data-contrast=true] .tile-copy {padding-top:20px}
.mobile-rehearse {display:none}
.display-choice,.scene {display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--edge);border-radius:12px;margin:8px 0;background:var(--control);cursor:pointer}
.display-choice small {display:block;color:var(--sub);font-size:.92rem}
.display-choice input,.scene input {margin:0}
.scenes {border:0;padding:0;margin:1rem 0}
.scenes legend,.step-heading {font-weight:700}
.step-progress {margin:0 0 18px;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;list-style:none}
.step-progress li {font-size:.8rem;color:var(--sub);border-top:2px solid var(--edge);padding:6px 2px 0}
.step-progress span {display:block;font-weight:700}
.step-progress [aria-current=step] {border-top:4px solid var(--violet);color:var(--ink);font-weight:700}
#dialogBody .step-heading {font-size:1.3rem;margin:12px 0}
.scene-title {font-weight:650;color:var(--violet)}
.uncertain,.saved-question {background:var(--control);border-left:3px solid var(--coral);border-radius:8px;padding:12px 14px;margin:15px 0;overflow-wrap:anywhere}
.saved-question {white-space:pre-wrap}
#dialogBody .uncertain p {margin:5px 0 0}
.pair-answers {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr));gap:8px;margin:0}
.pair-answers>div {background:var(--control);border:1px solid var(--line);border-radius:10px;padding:9px 12px}
.pair-answers dt {color:var(--sub);font-size:.88rem}
.pair-answers dd {margin:3px 0 0;font-weight:650}
.criteria {list-style:none;margin:14px 0;padding:0}
.criterion {padding:10px 0;border-top:1px solid var(--line)}
.criterion h4 {margin:0}
.criterion-summary {color:var(--plum)}
#dialogBody .criterion-summary {margin:0 0 7px}
[data-large=true] {font-size:135%}
[data-large=true] .intro,.connection,.prefline {flex-wrap:wrap}
[data-large=true] .deck-controls {gap:8px;align-items:start}
[data-large=true] .deck-action {min-width:0;flex:1}
[data-large=true] .photo-meta {position:static;padding:10px;flex-wrap:wrap;background:var(--control)}
[data-large=true] .photo-caption {position:static;padding:10px 14px 14px}
[data-large=true] .portrait-card {display:flex;flex-direction:column;height:auto;background:#231b2b}
[data-large=true] .portrait {order:1;height:clamp(160px,34vh,330px)}
[data-large=true] .photo-caption {order:2}
[data-large=true] .photo-shade {display:none}
[data-large=true] .step-progress {grid-template-columns:1fr}
[data-large=true] .step-progress span {display:inline;margin-right:.4em}
[data-large=true] .discover-grid {grid-template-columns:1fr}
[data-large=true] .intro .btn {white-space:normal}
[data-contrast=true] {
  --paper:#000;--white:#000;--ink:#fff;--sub:#fff;--plum:#ffed85;--violet:#ffed85;--peach:#141414;
  --coral:#ffed85;--line:#fff;--edge:#fff;--control:#141414;--button-ink:#000;
}
[data-contrast=true] body,[data-contrast=true] .sidebar,[data-contrast=true] #nav,[data-contrast=true] .rehearsal-tile {background:#000}
[data-contrast=true] .photo-caption {background:#000;padding:8px 10px;border-radius:10px}
[data-contrast=true] .photo-meta span,[data-contrast=true] .interests span,[data-contrast=true] .more-profile {background:#000;color:white;border:1px solid #fff}
[data-contrast=true] .tile-copy p,[data-contrast=true] .swipe-hint,[data-contrast=true] .deck-action {color:#fff}
[data-contrast=true] .photo-stack::before {display:none}
[data-calm=true] *,[data-calm=true] ::before,[data-calm=true] ::after {animation:none!important;transition:none!important;scroll-behavior:auto!important}
[data-calm=true] body,[data-calm=true] .rehearsal-tile {background:var(--paper)}
[data-calm=true] .photo-stack::before,[data-calm=true] .orbit-art {display:none}
[data-calm=true] .tile-copy {padding-top:20px}
[data-calm=true] .portrait-card,[data-calm=true] .deck-action:hover .action-disc {transform:none}
@media(max-width:760px) {
  #nav {background:#1a1721}
  .sidebar {gap:4px;min-height:53px;height:auto;flex-wrap:wrap}
  .brand img {width:83px}
  .calm-toggle {font-size:.86rem;margin:0;padding:6px 8px}
  .demo-label {margin:0 0 0 auto}
  .mobile-rehearse {display:flex;justify-content:center;margin:12px 0 4px}
  .rehearsal-tile {display:none}
  .navitem.active {box-shadow:inset 0 -2px var(--violet)}
  [data-large=true] .sidebar,[data-large=true] .intro {align-items:start}
  [data-large=true] .navitem {font-size:.73rem;min-width:0;text-align:center}
  [data-large=true] .intro h1 {font-size:1.9rem}
  [data-large=true] .intro {flex-direction:column}
  .intro .btn {flex-shrink:0}
}
@media(max-width:370px) {
  .intro {flex-wrap:wrap}
  .step-progress {grid-template-columns:1fr}
  .step-progress span {display:inline;margin-right:.4em}
}
@media(forced-colors:active) {
  :focus-visible {outline-color:Highlight}
  .navitem.active,.step-progress [aria-current=step] {border:2px solid Highlight}
  .option input:checked+span {outline:2px solid Highlight}
  .orbit-art {display:none}
}
.portrait-card:focus-visible {outline-offset:2px}
.brand {min-height:44px}
@media(max-width:760px) { .brand {align-items:center} }

/* A navegação ocupa uma linha própria e não cobre os controles do perfil. */
@media(max-width:760px) {
  body {height:100vh;height:100dvh;display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}
  .sidebar {display:contents}
  .brand-wrap,.calm-toggle,.demo-label {grid-row:1;align-self:center}
  .brand-wrap {grid-column:1;margin-left:max(8px,env(safe-area-inset-left))}
  .calm-toggle {grid-column:2;justify-self:start}
  .demo-label {grid-column:3;margin-right:max(8px,env(safe-area-inset-right))}
  #main {grid-column:1 / -1;grid-row:2;min-height:0;overflow:auto;padding-bottom:22px;border-top:1px solid var(--line);scroll-padding:12px}
  #nav {position:static;grid-column:1 / -1;grid-row:3}
  [data-large=true] .demo-label {grid-column:1 / -1;grid-row:2;justify-self:start;margin:0 8px 4px}
  [data-large=true] body {grid-template-rows:auto auto minmax(0,1fr) auto}
  [data-large=true] #main {grid-row:3}
  [data-large=true] #nav {grid-row:4}
  [data-large=true] .calm-toggle {grid-column:2 / -1}
}

/* Fotos pessoais */
.photos-intro {max-width:58ch;color:var(--sub);margin:.4rem 0 1rem}
.photo-gallery {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:12px;margin:1rem 0}
.photo-gallery:empty {display:none}
.my-photo {margin:0;border:1px solid var(--line);border-radius:14px;padding:10px;min-width:0}
.my-photo img {display:block;width:100%;height:150px;object-fit:contain;background:var(--paper);border-radius:8px}
.my-photo figcaption {font-weight:650;margin:.4rem 0;overflow-wrap:anywhere}
.my-photo .btn {width:100%;margin:.2rem 0}
.photo-preview {display:block;max-width:100%;max-height:220px;width:auto;margin:.75rem auto;object-fit:contain;border-radius:10px}
.photo-preview[hidden] {display:none}
.photo-file {display:block;max-width:100%;margin:.5rem 0 1rem;min-height:44px}
.photo-file::file-selector-button {font:inherit;min-height:44px;border:1px solid var(--edge);background:var(--control);color:var(--ink);border-radius:10px;padding:0 .75rem}
.photo-count {font-weight:650;margin:.5rem 0}
.photo-editor [role=alert]:empty {display:none}
.photo-editor :disabled,#myPhotos :disabled {opacity:.65;cursor:default}
#main > #myPhotos {margin-bottom:1rem}


/* Sugestões do dia, conversa e conta no tema escuro */
.sug {background:var(--white);border-color:var(--line)}
.sug-label {color:var(--violet)}
.sug-label svg {color:var(--coral)}
.sug-quote {background:var(--peach);color:var(--ink)}
.chip {background:var(--control);border-color:var(--edge);color:var(--ink)}
.chip:hover {background:#3b3249}
.status-note {background:var(--control);color:var(--sub)}
.danger {border-color:#ffb8ae;color:#ffb8ae}
.dangerfill {background:#ffb8ae;color:#2a0f0b}
[data-contrast=true] .sug {border-color:#fff}
[data-contrast=true] .danger {border-color:#fff;color:#fff}

/* Leitura espaçada */
[data-spacing=true] body {font-family:Verdana,Arial,sans-serif;line-height:1.75;letter-spacing:.03em;word-spacing:.12em}
[data-spacing=true] h1,[data-spacing=true] h2,[data-spacing=true] h3,[data-spacing=true] h4 {letter-spacing:0!important;line-height:1.3!important}
[data-spacing=true] .sug-quote,[data-spacing=true] blockquote {font-family:inherit;font-style:normal}
/* Botões maiores */
[data-big=true] .btn {min-height:54px;padding:14px 22px;font-size:1.02rem}
[data-big=true] .textbtn {min-height:52px}
[data-big=true] .option span,[data-big=true] .chip,[data-big=true] .scene,[data-big=true] .display-choice {min-height:52px}
[data-big=true] .check input,[data-big=true] .display-choice input,[data-big=true] .scene input {width:26px;height:26px}
[data-big=true] .iconbtn {min-height:52px;min-width:52px}
/* Menos estímulo visual: cores suaves nas fotos */
[data-calm=true] img {filter:saturate(.35)}
[data-calm=true] .brand img {filter:none}
/* Ocultar fotos */
[data-nophoto=true] .sug-pic,[data-nophoto=true] .blockpic,[data-nophoto=true] .who img,[data-nophoto=true] .match-scene,[data-nophoto=true] .orbit-art {display:none}

/* Conta: entrar, criar conta e senhas */
.auth-box {max-width:480px}
.auth-box form {display:grid;gap:4px}
.auth-box .auth-submit {margin-top:10px;width:fit-content}
.auth-hint {font-size:.92rem;margin:0 0 6px}
.pw-wrap {display:flex;gap:8px;align-items:flex-start}
.pw-wrap .input {flex:1;min-width:0}
.pw-toggle {flex:none;min-height:44px}
.auth-links {margin:14px 0 0}
.auth-error:empty {display:none}
.input[aria-invalid=true] {border-color:#ffb8ae;box-shadow:0 0 0 1px #ffb8ae}
[data-contrast=true] .input[aria-invalid=true] {border-color:#fff;box-shadow:0 0 0 2px #ffed85}
