/* Physicstan 1.2: scoped application column and accessible scientific controls. */
.pst-app,.pst-dashboard,.pst-auth-tabs,.pst-pricing-grid{--pst-accent:#1767bd;--pst-bg:#fff;--pst-text:#172d48;--pst-muted:#52647b;--pst-surface:#eef3f8;--pst-surface-2:#f8fafd;--pst-border:#d8e2ee;--pst-shadow:0 12px 40px rgba(20,46,78,.07);--pst-success:#167448;--pst-warn:#93600b;--pst-danger:#b32626;max-width:100%;min-width:0;font-size:16px;line-height:1.55}
.pst-app *, .pst-dashboard *, .pst-auth-tabs *, .pst-pricing-grid *{box-sizing:border-box}
.pst-app{width:100%;margin-inline:auto;text-align:left}
.pst-app .pst-shell{width:100%;max-width:1040px;margin:20px auto;padding:clamp(16px,3vw,32px);border-radius:22px;background:var(--pst-bg);backdrop-filter:none}
.pst-app :is(h2,h3,h4,p,small,strong,summary,label){font-family:inherit;color:inherit;text-transform:none;letter-spacing:normal}
.pst-app h4{font-size:17px;line-height:1.3}.pst-app h3{font-size:clamp(23px,3vw,32px);line-height:1.2}
.pst-app .pst-hero{margin-bottom:24px;max-width:700px}.pst-app .pst-hero h2{font-size:clamp(28px,4vw,42px);letter-spacing:-.03em;line-height:1.15}.pst-app .pst-hero p{font-size:15px;color:var(--pst-muted)}
.pst-app .pst-modebar{width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:visible;gap:4px}
.pst-app .pst-mode{min-width:0;padding:12px 5px;white-space:normal;font-size:14px;line-height:1.2;border:0;background:transparent;color:var(--pst-muted);min-height:44px}
.pst-app .pst-mode.is-active{background:var(--pst-bg);color:var(--pst-accent);box-shadow:none}
.pst-app .pst-conversation{width:100%;max-height:none;overflow:visible;gap:24px;align-items:stretch;scroll-behavior:auto}
.pst-app .pst-message.is-user{width:100%;max-width:100%;text-align:left;align-self:stretch;padding:16px 20px;overflow-wrap:anywhere;border-radius:14px}
.pst-app .pst-message.is-ai{width:100%;min-width:0}.pst-app .pst-answer-canvas{box-shadow:none;border-radius:18px}
.pst-app .pst-answer-top{padding:23px 24px 10px}.pst-app .pst-summary-card{padding:16px;background:var(--pst-surface-2);border-radius:12px}.pst-app .pst-summary-card p{font-size:16px}
.pst-app .pst-answer-section{padding:22px 24px}.pst-app .pst-detail-section{border-top:1px solid var(--pst-border);margin:0;background:var(--pst-bg)}
.pst-app .pst-detail-section>summary{padding:18px 24px;font-weight:700;font-size:15px;cursor:pointer;color:var(--pst-text)}
.pst-app .pst-detail-section .pst-answer-section{border-top:0;padding-top:4px}.pst-app .pst-symbol-disclosure{margin:12px 24px;background:var(--pst-surface-2)}
.pst-app .pst-symbol-summary{background:var(--pst-surface-2);color:var(--pst-text)}.pst-app .pst-result-card{text-align:left;background:var(--pst-surface);box-shadow:none;font-size:17px;padding:18px}
.pst-app .pst-math{min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden}.pst-app .pst-math-display{display:block;white-space:nowrap;scrollbar-width:thin;padding:6px 2px}
.pst-app .pst-math-display mjx-container{min-width:max-content}.pst-app .pst-equation-card .pst-math-display{display:block;text-align:center}
.pst-app .pst-math-inline{display:inline-block;vertical-align:middle;max-width:100%}.pst-app .pst-math-inline mjx-container{max-width:100%}
.pst-app .pst-composer{position:relative;bottom:auto;width:100%;z-index:auto;padding:16px;border-radius:16px;background:var(--pst-bg);backdrop-filter:none;box-shadow:none}
.pst-app .pst-composer:focus-within{border-color:var(--pst-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--pst-accent) 12%,transparent)}
.pst-app .pst-composer textarea{display:block;width:100%;margin:0;font-size:16px!important;line-height:1.55;max-height:180px;overflow:auto;color:var(--pst-text)!important}
.pst-app .pst-composer-actions{gap:12px;flex-wrap:wrap}.pst-app .pst-submit{min-width:110px;min-height:44px}.pst-app .pst-balance{font-size:13px}
.pst-app .pst-upload{position:relative;margin:0;overflow:hidden;border-radius:999px;min-height:44px;display:flex;align-items:center}
.pst-app .pst-upload input{display:block;position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;z-index:1}
.pst-app .pst-upload span{min-height:44px;display:flex;align-items:center}
.pst-app :is(button,select,input){font-family:inherit}.pst-app button{line-height:1.3;max-width:100%;text-transform:none}
.pst-app :is(button,a,input,select,summary):focus-visible,.pst-app .pst-upload:focus-within{outline:3px solid var(--pst-accent)!important;outline-offset:3px}
.pst-app :is(button,input,select)[disabled]{cursor:wait;opacity:.6}.pst-app .pst-clear-chat{min-height:36px}
.pst-app .pst-composer-error{border-left:3px solid var(--pst-danger);padding:10px 12px;background:var(--pst-surface);margin:12px 0;font-size:14px;color:var(--pst-text)}
.pst-app [hidden]{display:none!important}.pst-app .pst-file-preview{margin:8px 0;gap:8px}.pst-app .pst-attachment{display:flex;align-items:center;gap:8px;border:1px solid var(--pst-border);border-radius:10px;background:var(--pst-surface);padding:5px 8px;max-width:100%;min-width:0}
.pst-app .pst-attachment img{width:42px;height:42px;object-fit:cover;border-radius:5px;margin:0}.pst-app .pst-attachment-icon{font-size:11px;font-weight:800;padding:8px 4px}.pst-app .pst-attachment-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;max-width:210px}.pst-app .pst-attachment button{border:0;background:transparent;color:var(--pst-text);font-size:22px;width:36px;min-height:36px;padding:0}
.pst-app .pst-science-readout{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin:3px 0 12px;font-variant-numeric:tabular-nums}
.pst-app .pst-science-quantity{min-width:0;display:flex;flex-direction:column;gap:4px}.pst-app .pst-science-quantity>span{font-size:12px;color:var(--pst-muted)}.pst-app .pst-science-quantity>strong{font-size:15px;line-height:1.4;overflow-wrap:anywhere}
.pst-app .pst-physics-visual{padding:16px;border-radius:14px;box-shadow:none;background:var(--pst-surface-2);min-width:0}
.pst-app .pst-visual-svg{background:var(--pst-bg);border:0;width:100%;max-width:100%;height:auto;margin:0;border-radius:10px}
.pst-app .pst-svg-label{font-family:inherit;font-size:18px;fill:var(--pst-muted)}.pst-app .pst-grid{stroke:var(--pst-border);stroke-width:1;stroke-dasharray:3 6}
.pst-app .pst-visual-caption{font-size:13px;line-height:1.5;margin-top:10px!important;color:var(--pst-muted)}.pst-app .pst-resistor-solid{fill:var(--pst-bg)}
.pst-app .pst-animation-controls{display:grid;grid-template-columns:auto auto auto minmax(100px,1fr);gap:8px;align-items:center;margin-top:12px}
.pst-app .pst-animation-controls button{margin:0;min-height:40px;font-size:13px;border-radius:9px;padding:8px 12px}
.pst-app .pst-animation-controls label{margin:0;font-size:12px;font-weight:700;color:var(--pst-muted)}.pst-app .pst-animation-controls select{padding:7px 3px;border:1px solid var(--pst-border);border-radius:7px;background:var(--pst-bg);color:var(--pst-text);font-size:14px;max-width:100%;height:auto}
.pst-app .pst-animation-controls input[type=range]{width:100%;min-width:0;accent-color:var(--pst-accent);height:28px;margin:0;padding:0;cursor:pointer}.pst-app .pst-animation-controls label:has(input){display:flex;align-items:center;gap:7px;min-width:0}.pst-app .pst-animation-controls output{grid-column:1/-1;text-align:right;font-size:12px;color:var(--pst-muted)}
.pst-app .pst-parameter-controls{border-top:1px solid var(--pst-border);margin-top:15px;padding-top:12px}.pst-app .pst-parameter-controls summary{cursor:pointer;font-size:14px;font-weight:700}.pst-app .pst-parameter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0}
.pst-app .pst-parameter-grid label{font-size:12px;font-weight:600;margin:0;min-width:0;color:var(--pst-muted)}.pst-app .pst-parameter-grid input{display:block;width:100%;min-width:0;margin-top:4px;padding:8px;border:1px solid var(--pst-border);border-radius:8px;background:var(--pst-bg);color:var(--pst-text);font-size:16px;height:auto}
.pst-app .pst-note-action,.pst-app .pst-followup-chip{font-size:12px;min-height:38px;padding:8px 12px;white-space:normal}
.pst-app .pst-principle-grid,.pst-app .pst-setup-grid,.pst-app .pst-example-grid,.pst-app .pst-mistake-grid{grid-template-columns:repeat(auto-fit,minmax(min(200px,100%),1fr))}
.pst-app .pst-check-card{max-width:100%;overflow-wrap:anywhere}.pst-app .pst-check-text small{font-size:12px;opacity:1}
@media(max-width:600px){
 .pst-app .pst-shell{margin:10px auto;padding:12px;border-radius:16px}.pst-app .pst-hero{margin:8px 0 20px}.pst-app .pst-mode{font-size:12px;padding:10px 3px}
 .pst-app .pst-answer-top{padding:18px 16px 8px}.pst-app .pst-summary-card{margin:8px 16px 15px}.pst-app .pst-answer-section{padding:18px 16px}.pst-app .pst-detail-section>summary{padding:16px}.pst-app .pst-symbol-disclosure{margin:10px 16px}
 .pst-app .pst-composer{padding:12px}.pst-app .pst-submit{width:100%;margin:0}.pst-app .pst-composer-help{display:block}.pst-app .pst-composer-help>span:first-child{display:none}
 .pst-app .pst-animation-controls{grid-template-columns:1fr 1fr 1fr}.pst-app .pst-animation-controls label:has(input){grid-column:1/-1}.pst-app .pst-animation-controls select{width:100%}.pst-app .pst-animation-controls button{padding:8px 6px}
 .pst-app .pst-science-readout{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.pst-app .pst-science-quantity>strong{font-size:13px}.pst-app .pst-svg-label{font-size:22px}.pst-app .pst-physics-visual{padding:10px}
 .pst-app .pst-symbol-row{grid-template-columns:55px minmax(0,1fr)}.pst-app .pst-symbol-unit{grid-column:2;text-align:left}.pst-app .pst-message.is-user{padding:12px 16px}
}
.pst-app[data-theme=dark]{--pst-bg:#101e30;--pst-text:#e8eff9;--pst-muted:#afc0d6;--pst-surface:#1e3048;--pst-surface-2:#16253a;--pst-border:#38516e;--pst-accent:#71b9ff;--pst-success:#68d798;--pst-danger:#ff9c9c}
@media(prefers-color-scheme:dark){.pst-app[data-theme=system]{--pst-bg:#101e30;--pst-text:#e8eff9;--pst-muted:#afc0d6;--pst-surface:#1e3048;--pst-surface-2:#16253a;--pst-border:#38516e;--pst-success:#68d798;--pst-danger:#ff9c9c}}
@media(prefers-reduced-motion:reduce){.pst-app *{scroll-behavior:auto!important;animation:none!important;transition:none!important}.pst-app .pst-visual-play{display:inline-flex!important}.pst-app .pst-visual-play[hidden]{display:none!important}}
@media print{.pst-app .pst-animation-controls,.pst-app .pst-parameter-controls,.pst-app .pst-composer,.pst-app .pst-modebar,.pst-app .pst-message-tools,.pst-app .pst-feedback,.pst-app .pst-followups{display:none!important}.pst-app .pst-shell{border:0;box-shadow:none;padding:0}.pst-app .pst-answer-canvas{overflow:visible}.pst-app .pst-answer-section{break-inside:avoid}.pst-app .pst-visual-svg{break-inside:avoid}}

.pst-app .pst-primary{background:#1767bd;background:color-mix(in srgb,var(--pst-accent) 60%,#06172b);color:#fff}

/* Selected mode stays unmistakable in light and dark themes. */
.pst-app .pst-modebar .pst-mode.is-active{background:#1767bd!important;color:#fff!important;box-shadow:0 2px 8px rgba(23,103,189,.24);font-weight:800;border-radius:10px}
.pst-app .pst-modebar .pst-mode.is-active::before{content:'✓ ';font-weight:900}
.pst-app .pst-modebar .pst-mode:focus-visible{outline:3px solid #1767bd;outline-offset:3px}
.pst-startup-notice{padding:12px 16px;margin-bottom:16px;border-radius:10px;background:var(--pst-surface);color:var(--pst-muted);font-size:14px}
