/* The three-card reading follows Atlas's lilac/pearl design code. */
#tarot{--ts-ink:#352244;--ts-muted:#685570;--ts-plum:#43245d;--ts-gold:#c7a66a;color:var(--ts-ink);}
#tarot .ts-stack{display:grid;gap:20px;max-width:880px;margin:0 auto;padding-bottom:30px;}
#tarot .ts-hero{min-height:170px!important;position:relative;}
#tarot .ts-hero h1{font-family:inherit!important;}
#tarot .ts-hero p{max-width:32ch;font-size:20px!important;}
#tarot .ts-hero-stars{position:absolute;right:9%;top:16px;font-size:102px;line-height:1;color:#c7a66a;opacity:.6;text-shadow:0 0 30px #fff;pointer-events:none;}
.ts-modes{display:flex;gap:6px;padding:6px;border-radius:22px;background:rgba(255,250,253,.65);border:1px solid rgba(128,82,150,.17);max-width:880px;margin:0 auto 22px;}
.ts-modes button{flex:1;min-height:48px;border:0;border-radius:17px;background:transparent;font-family:inherit;font-size:18px;font-weight:600;color:#685570;cursor:pointer;padding:10px 14px;}
.ts-modes button[aria-current=page]{background:#43245d;color:#fffafd;box-shadow:0 4px 15px #43245d20;}
#tarot .reference-glass{padding:26px!important;background:linear-gradient(140deg,rgba(255,250,253,.94),rgba(248,235,251,.9))!important;border:1px solid #fff8;box-shadow:0 10px 30px #6845740a!important;min-width:0;}
#tarot h2{font-family:inherit!important;font-size:25px!important;line-height:1.28!important;letter-spacing:-.5px!important;margin:0;}
#tarot h3{font-family:inherit!important;font-size:21px!important;line-height:1.35!important;letter-spacing:-.2px!important;}
#tarot p,#tarot label,#tarot summary,#tarot textarea{font-family:inherit;font-size:18px!important;line-height:1.55;}
#tarot [hidden]{display:none!important;}
#tarot button,#tarot textarea,#tarot a{font-family:inherit;}
#tarot button:focus-visible,#tarot a:focus-visible,#tarot summary:focus-visible,.ts-modes button:focus-visible{outline:3px solid #805296;outline-offset:4px;}
#tarot button:disabled{cursor:wait;opacity:.55;}
#tarot .ts-section-top{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;margin-bottom:20px;}
#tarot .ts-deck-note{color:var(--ts-muted);font-size:16px;max-width:18ch;text-align:right;line-height:1.5;}
#tarot .ts-topics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 24px;}
#tarot .ts-topic{display:flex;align-items:center;justify-content:center;min-height:49px;background:#fffbfe;border:1px solid #bda6c65e;border-radius:16px;padding:11px 10px;font-size:18px;font-weight:500;line-height:1.3;color:var(--ts-ink);cursor:pointer;}
#tarot .ts-topic[aria-pressed=true]{background:#ece0f3;border-color:#805296;box-shadow:inset 0 0 0 1px #805296;font-weight:650;}
#tarot .ts-field{display:grid;gap:10px;font-weight:600;}
#tarot textarea{width:100%;max-width:100%;resize:vertical;min-height:110px;margin:0;border-radius:18px!important;border:1px solid #bda6c66b!important;padding:15px 16px!important;box-shadow:inset 0 2px 8px #43245d03!important;background:#fffafd!important;color:var(--ts-ink)!important;font-weight:400;}
#tarot textarea:focus{outline:2px solid #805296;outline-offset:2px;}
#tarot textarea::placeholder{color:#89718f;opacity:1;}
#tarot .ts-muted{color:var(--ts-muted);margin:10px 0 18px;}
#tarot .ts-preview{display:flex;justify-content:center;align-items:center;gap:6px;height:160px;margin:28px auto 22px;max-width:285px;pointer-events:none;}
#tarot .ts-preview .ts-art{width:86px;flex:0 0 86px;box-shadow:0 9px 20px #43245d20;}
#tarot .ts-preview .ts-art:first-child{transform:rotate(-13deg) translateY(7px);}
#tarot .ts-preview .ts-art:last-child{transform:rotate(13deg) translateY(7px);}
#tarot .ts-primary{display:flex;align-items:center;justify-content:center;gap:10px;min-height:56px;width:100%;padding:15px 22px;border-radius:19px;border:1px solid transparent;background:#43245d;color:#fffafd;font-size:19px;font-weight:650;line-height:1.35;cursor:pointer;text-decoration:none;box-shadow:0 7px 16px #43245d1a;}
#tarot .ts-primary:hover{background:#54326e;}
#tarot .ts-reflection{color:var(--ts-muted);text-align:center;margin:16px 0 0;}
#tarot .ts-text-button{border:0;background:transparent;color:var(--ts-plum);font-size:18px;line-height:1.4;text-decoration:underline;text-underline-offset:4px;padding:8px 0;min-height:44px;cursor:pointer;text-align:left;}
#tarot .ts-topic-label{display:block;font-size:17px;line-height:1.5;color:var(--ts-muted);margin-bottom:5px;}
#tarot .ts-current-question{white-space:pre-wrap;overflow-wrap:anywhere;padding:16px 18px;background:#eee1f44d;border-left:3px solid var(--ts-gold);border-radius:0 13px 13px 0;margin:0 0 22px;}
#tarot .ts-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:24px 0 4px;}
#tarot .ts-card{min-width:0;display:flex;flex-direction:column;text-align:center;}
#tarot .ts-position{font-size:17px!important;line-height:1.35;color:var(--ts-muted);margin:0 0 12px;min-height:48px;display:flex;align-items:flex-end;justify-content:center;}
#tarot .ts-card-button{width:100%;display:block;padding:0;border:0;border-radius:16px;background:transparent;position:relative;cursor:pointer;perspective:800px;box-shadow:0 10px 22px #43245d18;transition:transform .18s ease;}
#tarot .ts-card-button:not(.is-revealed):hover{transform:translateY(-5px);}
#tarot .ts-card-button.is-revealed{cursor:default;animation:ts-reveal .45s ease both;}
#tarot .ts-card-tap{position:absolute;bottom:8%;left:0;right:0;color:#71517f;font-size:24px;text-shadow:0 1px 5px #fff;}
#tarot h3.ts-card-name{font-size:18px!important;font-weight:650;margin:14px -3px 0;line-height:1.35!important;overflow-wrap:anywhere;}
#tarot .ts-open-all{display:block;margin:16px auto 0;text-align:center;}
#tarot .ts-saved{color:var(--ts-muted);text-align:center;font-size:16px!important;margin:18px 0 2px;}
#tarot .ts-meanings{margin-top:20px;border-top:1px solid #cdb7d54d;padding-top:18px;}
#tarot .ts-meanings summary,#tarot .ts-history>summary{cursor:pointer;min-height:44px;font-weight:650;color:var(--ts-ink);}
#tarot .ts-meaning{padding:18px 0;border-top:1px solid #cdb7d54d;}
#tarot .ts-meaning-position{font-size:17px;color:var(--ts-muted);}
#tarot .ts-meaning h3{margin:6px 0 10px;}
#tarot .ts-meaning p{margin:0;}
#tarot .ts-assistant-heading{display:flex;align-items:center;gap:15px;margin-bottom:14px;}
#tarot .ts-assistant-icon{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border-radius:50%;font-size:29px;color:#805296;background:radial-gradient(circle at 30% 20%,#fff,#e4d0ef);border:1px solid #fff;box-shadow:0 3px 10px #43245d13;}
#tarot .ts-assistant-name{display:block;font-size:16px;color:var(--ts-muted);margin-bottom:5px;}
#tarot .ts-messages{display:flex;flex-direction:column;gap:22px;min-width:0;}
#tarot .ts-user-message{padding:17px 20px;margin-left:min(30px,7%);border-radius:20px 20px 4px 20px;background:#eadcf1;color:var(--ts-ink);}
#tarot .ts-user-message p{margin:9px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;}
#tarot .ts-message-label{font-size:16px;font-weight:600;color:var(--ts-muted);}
#tarot .ts-assistant-message{background:rgba(255,255,255,.62);border:1px solid #fff;border-radius:20px;padding:22px;min-width:0;overflow-wrap:anywhere;}
#tarot .ts-assistant-message p{margin:16px 0 0;white-space:pre-line;}
#tarot .ts-assistant-message h4{font-family:inherit;font-size:20px;font-weight:650;line-height:1.4;margin:22px 0 8px;}
#tarot .ts-thinking{border-radius:14px;padding:16px 18px;background:#eee1f4;color:var(--ts-muted);}
#tarot .ts-thinking:before{content:'✦';display:inline-block;margin-right:12px;animation:ts-breathe 1.5s ease-in-out infinite;}
#tarot .ts-cost{margin:20px 0 12px;color:var(--ts-muted);font-size:17px!important;}
#tarot .ts-chat-form{margin-top:24px;padding-top:6px;scroll-margin-bottom:170px;}
#tarot .ts-quick{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:22px;}
#tarot .ts-quick-button{min-height:44px;padding:10px 13px;border-radius:14px;border:1px solid #bda6c65e;background:#fffafd;color:var(--ts-ink);font-size:17px;line-height:1.4;text-align:left;cursor:pointer;}
#tarot .ts-status-wrap{background:#fffbf9d9;border:1px solid #d7c2c5;border-radius:18px;padding:16px 20px;}
#tarot .ts-status{margin:0;color:var(--ts-ink);}
#tarot .ts-status.is-error{color:#7d3b52;}
#tarot .ts-history-list{display:grid;gap:12px;}
#tarot .ts-history-item{display:grid;width:100%;gap:8px;padding:18px 0;text-align:left;background:none;border:0;border-bottom:1px solid #cdb7d54d;color:var(--ts-ink);cursor:pointer;overflow-wrap:anywhere;}
#tarot .ts-history-item-top{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:19px;}
#tarot .ts-history-date{font-size:16px;color:var(--ts-muted);white-space:nowrap;}
#tarot .ts-history-question{font-size:18px;line-height:1.45;}
#tarot .ts-history-cards{font-size:16px;line-height:1.5;color:var(--ts-muted);}
#today .ts-today-entry{display:flex!important;align-items:center;justify-content:space-between;gap:12px;width:100%;margin-top:18px;padding:15px 17px!important;min-height:56px;border:1px solid #bda6c678;border-radius:17px;background:#fbf5ff;color:#43245d;font-family:inherit;font-size:18px!important;font-weight:600;text-align:left;cursor:pointer;}
.ts-today-entry>span:last-child{font-size:25px;}
@keyframes ts-reveal{from{opacity:.55;transform:rotateY(-18deg) scale(.98)}to{opacity:1;transform:rotateY(0) scale(1)}}
@keyframes ts-breathe{50%{opacity:.4;transform:scale(.85)}}
@media(max-width:600px){
 #tarot .reference-glass{padding:20px 16px!important;border-radius:24px!important;}
 #tarot .ts-stack{gap:16px;}
 #tarot .ts-hero{min-height:145px!important;}
 #tarot .ts-hero-stars{font-size:74px;right:2%;top:12px;opacity:.35;}
 #tarot .ts-hero p{font-size:19px!important;max-width:23ch;}
 #tarot .ts-section-top{gap:10px;flex-wrap:wrap;margin-bottom:18px;}
 #tarot .ts-compose .ts-section-top{display:block;}
 #tarot .ts-deck-note{display:block;text-align:left;max-width:none;margin-top:8px;}
 #tarot .ts-topics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
 #tarot .ts-topics .ts-topic:last-child{grid-column:1/-1;}
 #tarot .ts-cards{gap:9px;}
 #tarot .ts-position{font-size:16px!important;line-height:1.35;min-height:67px;margin-bottom:10px;}
 #tarot h3.ts-card-name{font-size:17px!important;}
 #tarot .ts-card-button{border-radius:10px;}
 #tarot .ts-assistant-message{padding:18px 16px;}
 #tarot .ts-assistant-heading{gap:11px;align-items:flex-start;}
 #tarot .ts-assistant-heading h2{font-size:23px!important;}
 #tarot .ts-reading .ts-section-top .ts-text-button{margin:-4px 0 0;}
 .ts-modes{border-radius:19px;margin-bottom:17px;}.ts-modes button{font-size:17px;padding:10px 8px;}
}
@media(prefers-reduced-motion:reduce){#tarot *,#tarot *:before{animation:none!important;transition:none!important;scroll-behavior:auto!important;}}

/* Existing design-code controls are intentionally specific. Match their scope
   so card faces, selected topics and spending actions retain their own roles. */
html:root #atlas-app.atlas-unified #tarot .ts-stack{width:100%!important;max-width:880px!important;min-width:0!important;grid-template-columns:minmax(0,1fr)!important;}
html:root #atlas-app.atlas-unified :is(#ask,#tarot)>.ts-modes{display:flex!important;width:100%!important;max-width:880px!important;gap:6px!important;padding:6px!important;box-sizing:border-box;}
html:root #atlas-app.atlas-unified :is(#ask,#tarot)>.ts-modes button{flex:1!important;min-width:0!important;min-height:48px!important;padding:10px 14px!important;background:transparent!important;color:#685570!important;box-shadow:none!important;border:0!important;border-radius:17px!important;font-size:18px!important;line-height:1.4!important;}
html:root #atlas-app.atlas-unified :is(#ask,#tarot)>.ts-modes button[aria-current=page]{background:#43245d!important;color:#fffafd!important;box-shadow:0 4px 15px #43245d20!important;}
html:root #atlas-app.atlas-unified #tarot .reference-glass{width:100%!important;max-width:100%!important;box-sizing:border-box;padding:26px!important;background:linear-gradient(140deg,rgba(255,250,253,.96),rgba(248,235,251,.94))!important;border-radius:26px!important;}
html:root #atlas-app.atlas-unified #tarot :is(p,label,summary,textarea){font-size:18px!important;line-height:1.55!important;}
html:root #atlas-app.atlas-unified #tarot h2{font-size:25px!important;line-height:1.28!important;}
html:root #atlas-app.atlas-unified #tarot h3{font-size:21px!important;line-height:1.35!important;}
html:root #atlas-app.atlas-unified #tarot .ts-topic{min-width:0!important;min-height:49px!important;padding:11px 10px!important;border:1px solid #bda6c65e!important;border-radius:16px!important;background:#fffbfe!important;color:#352244!important;font-size:18px!important;line-height:1.3!important;box-shadow:none!important;}
html:root #atlas-app.atlas-unified #tarot .ts-topic[aria-pressed=true]{background:#ece0f3!important;border-color:#805296!important;box-shadow:inset 0 0 0 1px #805296!important;}
html:root #atlas-app.atlas-unified #tarot .ts-primary{display:flex!important;width:100%!important;min-height:56px!important;padding:15px 22px!important;border:1px solid transparent!important;border-radius:19px!important;background:#43245d!important;color:#fffafd!important;font-size:19px!important;line-height:1.35!important;text-decoration:none!important;box-shadow:0 7px 16px #43245d1a!important;}
html:root #atlas-app.atlas-unified #tarot .ts-primary:disabled{background:#d8c7e2!important;color:#685570!important;}
html:root #atlas-app.atlas-unified #tarot .ts-card-button{display:block!important;width:100%!important;min-width:0!important;min-height:0!important;padding:0!important;border:0!important;border-radius:13px!important;background:transparent!important;box-shadow:0 10px 22px #43245d18!important;}
html:root #atlas-app.atlas-unified #tarot h3.ts-card-name{font-size:18px!important;line-height:1.35!important;overflow-wrap:anywhere!important;word-break:normal!important;hyphens:manual!important;}
html:root #atlas-app.atlas-unified #tarot :is(.ts-current-question,.ts-user-message p,.ts-assistant-message p,.ts-assistant-message h4,.ts-history-question,.ts-history-cards){overflow-wrap:anywhere!important;word-break:normal!important;}
html:root #atlas-app.atlas-unified #tarot .ts-text-button{padding:8px 0!important;min-height:44px!important;background:transparent!important;border:0!important;box-shadow:none!important;color:#43245d!important;font-size:18px!important;line-height:1.4!important;text-decoration:underline!important;}
html:root #atlas-app.atlas-unified #tarot .ts-quick-button{padding:10px 13px!important;border:1px solid #bda6c65e!important;border-radius:14px!important;background:#fffafd!important;box-shadow:none!important;font-size:18px!important;line-height:1.4!important;text-align:left!important;}
html:root #atlas-app.atlas-unified #tarot .ts-history-item{display:grid!important;width:100%!important;padding:18px 0!important;text-align:left!important;background:none!important;border:0!important;border-bottom:1px solid #cdb7d54d!important;box-shadow:none!important;border-radius:0!important;}
html:root #atlas-app.atlas-unified #tarot .ts-position{font-size:18px!important;line-height:1.35!important;}
html:root #atlas-app.atlas-unified #tarot .ts-position{overflow-wrap:anywhere!important;word-break:normal!important;}
html:root #atlas-app.atlas-unified #tarot .ts-field>span{font-size:18px!important;}
html:root #atlas-app.atlas-unified #tarot .ts-hero p{font-size:20px!important;}
@supports(grid-template-rows:subgrid){
 html:root #atlas-app.atlas-unified #tarot .ts-cards{grid-template-rows:auto auto auto;row-gap:12px;}
 html:root #atlas-app.atlas-unified #tarot .ts-card{display:grid;grid-template-rows:subgrid;grid-row:span 3;row-gap:12px;}
 html:root #atlas-app.atlas-unified #tarot .ts-position{margin:0!important;min-height:0!important;}
 html:root #atlas-app.atlas-unified #tarot h3.ts-card-name{margin:0 -2px!important;}
}
@media(max-width:600px){
 html:root #atlas-app.atlas-unified #tarot .reference-glass{padding:20px 16px!important;border-radius:24px!important;}
 html:root #atlas-app.atlas-unified #tarot .ts-position{min-height:78px!important;}
 html:root #atlas-app.atlas-unified #tarot .ts-assistant-heading h2{font-size:23px!important;}
}
