/* Stark Drama 1.06: shared editorial shell. All selectors are scoped.
   Specialist application pages do not receive sd-shell. */
.sd-shell {
  --sd-bg:#0c1013; --sd-raised:#151b1f; --sd-quiet:#10161a;
  --sd-line:#2a3339; --sd-line-soft:#222b30; --sd-text:#e6ecee;
  --sd-secondary:#aab8bf; --sd-muted:#8998a0; --sd-accent:#87ddcc;
  --sd-warm:#f0c27d; --sd-purple:#baa5c7; --sd-error:#f5a398;
  --header-height:64px; background:var(--sd-bg);
}
.sd-shell .site-header {height:64px;background:var(--sd-raised);border-bottom:1px solid var(--sd-line);backdrop-filter:none}
.sd-shell .site-header-inner {width:calc(100% - 64px);max-width:1400px;gap:28px}
.sd-shell .site-brand {font-size:.88rem;font-weight:750;letter-spacing:.06em;color:var(--sd-text);gap:10px}
.sd-shell .site-brand-mark {width:32px;height:32px;background:transparent;border:1px solid #528b80;border-radius:4px;color:var(--sd-accent);font-size:.7rem}
.sd-shell .site-nav {flex:1;justify-content:space-between;gap:12px;margin:0;background:transparent;box-shadow:none}
.sd-nav-primary,.sd-nav-utility {display:flex;align-items:center;gap:4px}
.sd-nav-utility {border-left:1px solid var(--sd-line);padding-left:14px}
.sd-shell .site-nav a {font-size:.875rem;font-weight:650;white-space:nowrap;padding:12px 10px;color:var(--sd-secondary);border-radius:4px;min-height:44px;display:flex;align-items:center}
.sd-shell .site-nav a:hover,.sd-shell .site-nav a[aria-current=page] {color:var(--sd-text);background:#233035}
.sd-shell .site-nav a[aria-current=page] {box-shadow:inset 0 -2px 0 var(--sd-accent)}
.sd-shell .site-header-actions {gap:8px;margin-left:0}
.sd-shell .board-chip,.sd-shell .site-nav-toggle {border:1px solid #46565d;border-radius:4px;background:transparent;color:var(--sd-text);min-height:44px;font-size:.85rem}
.sd-shell .board-chip {gap:8px;padding:8px 12px;max-width:180px}
.sd-shell .board-chip strong {color:var(--sd-accent);font-size:.8rem;white-space:nowrap}
.sd-shell .board-chip-prefix {font-size:.65rem;color:var(--sd-secondary)}
.sd-nav-group-label {display:none}
.sd-shell .site-footer {background:var(--sd-quiet);border-color:var(--sd-line);margin-top:64px}
.sd-shell .site-footer-inner {width:calc(100% - 64px);max-width:1280px;padding:32px 0 40px;gap:48px}
.sd-shell .site-footer-about strong {color:var(--sd-text);font-size:.85rem}
.sd-shell .site-footer p {color:var(--sd-secondary);font-size:.85rem;line-height:1.6}
.sd-shell .site-footer .site-build-marker {color:var(--sd-muted);font-size:.7rem;letter-spacing:.06em;margin-top:16px}
.sd-shell .site-footer nav {display:grid;grid-template-columns:1fr 1fr;gap:4px 24px;min-width:300px;align-content:start}
.sd-shell .site-footer nav a,.sd-shell .footer-tool-button {display:flex;align-items:center;min-height:44px;color:var(--sd-secondary);font-weight:500;font-size:.82rem;padding:5px 0;border:0;background:transparent;text-align:left}
.sd-shell .site-footer nav a:hover,.sd-shell .footer-tool-button:hover {color:var(--sd-accent)}
/* Context is subordinate to the learning content, but remains fully available. */
.sd-shell .text-context-nav {background:var(--sd-quiet);border-color:var(--sd-line);overflow:hidden}
.sd-shell .text-context-inner {width:calc(100% - 64px);max-width:1280px;min-height:46px;gap:16px}
.sd-shell .text-context-title {flex:0 0 auto;border-color:var(--sd-line);font-size:.87rem;font-weight:650;color:var(--sd-text)}
.sd-shell .text-context-links {min-width:0;overflow-x:auto;scrollbar-width:thin;scrollbar-color:#53616a transparent;flex:1}
.sd-shell .text-context-links a {min-height:44px;display:flex;align-items:center;padding:10px;color:var(--sd-secondary);font-size:.8rem;font-weight:500}
.sd-shell .text-context-links a[aria-current=page] {border-bottom-color:var(--sd-accent);color:var(--sd-text)}
.sd-source-strip {border-bottom:1px solid var(--sd-line-soft);color:var(--sd-secondary)}
.sd-source-details {max-width:1280px;width:calc(100% - 64px);margin:auto}
.sd-source-details>summary {display:flex;align-items:center;flex-wrap:wrap;gap:8px 20px;min-height:44px;padding:8px 0;font-size:.75rem;cursor:pointer;list-style:none}
.sd-source-details>summary::-webkit-details-marker {display:none}
.sd-source-boards {color:var(--sd-text);font-weight:650}
.sd-source-toggle {margin-left:auto;color:var(--sd-accent);display:flex;gap:10px;align-items:center}
.sd-source-details[open] .sd-source-toggle>span {transform:rotate(45deg)}
.sd-source-edition {flex-basis:100%;color:var(--sd-warm)}
.sd-source-details .set-text-accuracy-inner {width:100%;max-width:none;padding:16px 0 20px;grid-template-columns:1.2fr 1fr;gap:32px;border-top:1px solid var(--sd-line)}
.sd-source-details .set-text-accuracy-main strong {font-size:.8rem;color:var(--sd-text)}
.sd-source-details .set-text-accuracy-main,.sd-source-details .set-text-accuracy-review {color:var(--sd-secondary);font-size:.8rem;line-height:1.6}
.sd-source-details a {color:var(--sd-accent);text-decoration:underline;text-underline-offset:3px}
.sd-shell .board-dialog,.sd-shell .shared-device-dialog {background:var(--sd-raised);border:1px solid #506069;border-radius:8px;color:var(--sd-text);max-height:90dvh;overflow:auto}
.sd-shell .board-dialog h2,.sd-shell .shared-device-dialog h2 {text-transform:none;border:0;padding:0;color:var(--sd-text);letter-spacing:-.015em;font-size:1.7rem}
.sd-shell .board-dialog .eyebrow,.sd-shell .shared-device-dialog .eyebrow {font-size:.72rem;color:var(--sd-accent)}
.sd-shell .board-dialog p,.sd-shell .shared-device-dialog p {color:var(--sd-secondary)}
.sd-shell .board-choice {background:var(--sd-quiet);border-radius:4px;border-color:var(--sd-line);box-shadow:none;transform:none}
.sd-shell .board-choice:hover,.sd-shell .board-choice[aria-pressed=true] {border-color:var(--sd-accent);background:#21332f;transform:none}
.sd-shell .board-choice strong {color:var(--sd-text)}
.sd-shell .board-choice span {color:var(--sd-secondary)}
.sd-shell .board-dialog button,.sd-shell .shared-device-dialog button {min-height:44px;border-radius:4px}
.sd-shell .dialog-close {background:var(--sd-quiet);color:var(--sd-text)}
.sd-shell :is(.site-header,.site-footer,.text-context-nav,.sd-source-strip,.board-dialog,.shared-device-dialog) :is(a,button,summary):focus-visible {outline:2px solid var(--sd-accent);outline-offset:3px;box-shadow:none}
@media(max-width:1250px){.sd-shell .site-header-inner{gap:16px}.sd-shell .site-nav a{padding-inline:8px}.sd-nav-utility{padding-left:8px}}
@media(max-width:1100px){
  .sd-shell .site-header-inner{width:calc(100% - 40px);gap:12px}
  .sd-shell .site-brand{margin-right:auto}
  .sd-shell .site-nav-toggle{display:block;order:4;min-width:65px}
  .sd-shell .site-header-actions{order:3}
  .sd-shell .site-nav{display:none;position:absolute;top:64px;left:0;right:0;padding:20px 24px;background:var(--sd-raised);border-bottom:1px solid #526269;max-height:calc(100dvh - 64px);overflow:auto;flex-direction:column;align-items:stretch;gap:16px}
  .sd-shell .site-nav.is-open{display:flex}
  .sd-nav-primary,.sd-nav-utility{display:grid;grid-template-columns:1fr 1fr;gap:4px 16px;padding:0;border:0}
  .sd-nav-utility{border-top:1px solid var(--sd-line);padding-top:14px}
  .sd-nav-group-label{display:block;grid-column:1/-1;font-size:.68rem;color:var(--sd-muted);text-transform:uppercase;letter-spacing:.1em;margin-bottom:4px}
  .sd-shell .site-nav a{padding:12px;font-size:1rem}
  .sd-shell .site-footer-inner{gap:24px}
}
@media(max-width:699px){
  .sd-shell .site-header-inner{width:calc(100% - 24px);gap:8px}
  .sd-shell .site-brand-name{font-size:.74rem;letter-spacing:.035em}
  .sd-shell .site-brand{gap:7px}.sd-shell .site-brand-mark{width:28px;height:30px;font-size:.65rem}
  .sd-shell .board-chip{padding:6px 9px;max-width:130px}.sd-shell .board-chip-prefix{display:none}
  .sd-shell .site-nav-toggle{min-width:54px;padding:8px}
  .sd-shell .text-context-inner{width:100%;display:block}
  .sd-shell .text-context-title{display:block;padding:10px 16px 0;border:0}
  .sd-shell .text-context-links{padding:0 6px}
  .sd-source-details{width:calc(100% - 32px)}
  .sd-source-details>summary{column-gap:12px;font-size:.7rem}
  .sd-source-toggle{margin-left:0}
  .sd-source-details .set-text-accuracy-inner{display:grid;grid-template-columns:1fr;gap:16px}
  .sd-shell .site-footer{margin-top:40px}.sd-shell .site-footer-inner{width:calc(100% - 32px);display:block;padding:24px 0}
  .sd-shell .site-footer nav{margin-top:20px;min-width:0;gap:0 16px}
}
@media(prefers-reduced-motion:reduce){.sd-shell :is(.site-header,.text-context-nav,.sd-source-strip) *{transition:none!important;scroll-behavior:auto!important}}
@media print{.sd-shell{padding-top:0!important;background:white;color:black}.sd-shell .site-header,.sd-shell .site-footer,.sd-shell .text-context-nav,.sd-shell .sd-source-strip,.sd-shell .skip-link{display:none!important}}
/* The consent workflow and wording remain in stark-tracker.js; visual alignment only. */
.sd-shell #stark-analytics-panel {background:var(--sd-raised);border-color:#506069;border-radius:6px;box-shadow:0 8px 28px #0006;font-size:.86rem}
.sd-shell #stark-analytics-panel strong {color:var(--sd-accent)}
.sd-shell #stark-analytics-panel span {color:var(--sd-secondary)}
.sd-shell #stark-analytics-panel a {color:var(--sd-accent);text-decoration:underline;text-underline-offset:3px}
.sd-shell #stark-analytics-panel button {border-radius:4px;background:var(--sd-quiet);border-color:#526168;color:var(--sd-text)}
.sd-shell #stark-privacy-settings.footer-privacy-button {color:var(--sd-secondary);font-size:.82rem;padding:5px 0;border-radius:0;min-height:44px;text-align:left}
.sd-shell #stark-analytics-panel :is(a,button):focus-visible,.sd-shell #stark-privacy-settings:focus-visible {outline:2px solid var(--sd-accent);outline-offset:3px}
@media(max-width:699px){.sd-shell .site-brand-name{display:inline}.sd-shell #stark-analytics-panel{padding:14px 16px;gap:12px}}
@media(max-width:360px){.sd-shell .site-brand-name{max-width:65px;line-height:1.2;font-size:.7rem}.sd-shell .board-chip strong{font-size:.75rem}}
