/* Commission 003: load after theme.css. Court tokens and production gem painter stay unchanged. */
.amethyst-app:not(.inside) .lanonly { display:none!important; }
.amethyst-app .appbar { height:60px; }
.amethyst-app .appbar-inner { max-width:1080px; padding:8px 16px; }
.amethyst-app .appbrand { font-size:14px; }
.amethyst-app .wrap { max-width:1080px; padding:12px 16px calc(112px + env(safe-area-inset-bottom)); }
.amethyst-app .identity { display:flex; align-items:center; gap:16px; padding:8px 0 16px; min-height:114px; }
.amethyst-app .identity h1 { font:600 clamp(23px,4vw,30px)/1.15 var(--font-ui); letter-spacing:-.8px; margin:3px 0 6px; color:var(--ink); }
.amethyst-app .identity .tag { font:13px/1.5 var(--font-ui); margin:0; color:var(--quiet); }
.amethyst-app .identity .eyebrow { font-size:9px; letter-spacing:2px; }
.amethyst-app .crestwrap.grand { width:82px; height:90px; flex:0 0 82px; margin:0; }
.amethyst-app .crestwrap.grand .crest { width:82px; height:82px; }
.amethyst-app .crestwrap.grand .halo { inset:-14px; width:auto; height:auto; }
.amethyst-app .crestwrap.grand .ring { inset:4px; width:auto; height:auto; }
.amethyst-app.inside .weather-panel.lanonly,.amethyst-app.inside section.lanonly { display:block; }
.amethyst-app .appbrand svg { width:24px; height:28px; }
.amethyst-app .appbar-inner>.eyebrow { margin-left:auto; }
.amethyst-app .home-search { max-width:none; margin:6px 0 18px; }
.amethyst-app section { margin-top:20px; scroll-margin-top:76px; }
.amethyst-app h2 { font:600 16px/1.35 var(--font-ui); color:var(--ink); letter-spacing:-.2px; text-transform:none; margin:0 0 12px; }
.amethyst-app h2::after { display:none; }
.amethyst-app .hall-heading { display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
.amethyst-app .hall-heading small { font:11px var(--font-ui); color:var(--quiet); }
.amethyst-app .grid.app-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.amethyst-app .app-grid .tile { display:flex; flex-direction:row; align-items:center; min-height:92px; gap:10px; padding:14px 12px; border-radius:18px; }
.amethyst-app .app-grid .tile .gem { width:32px; height:36px; flex:0 0 32px; }
.amethyst-app .app-grid .tile .nm { font:600 13px/1.3 var(--font-ui); overflow-wrap:normal; letter-spacing:-.2px; }
.amethyst-app .app-grid .tile .ds { font:11px/1.4 var(--font-ui); margin-top:4px; color:var(--quiet); }
.amethyst-app .app-grid .tile .go { display:none; }
.amethyst-app .app-grid .tile .tx { min-width:0; }
.amethyst-app .dock { position:fixed; bottom:0; left:0; right:0; z-index:35; display:flex; justify-content:center; gap:4px; padding:8px 12px calc(8px + env(safe-area-inset-bottom)); background:var(--bg2); border-top:1px solid var(--line); box-shadow:0 -10px 35px rgba(0,0,0,.15); }
.amethyst-app .dock a { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; width:20%; max-width:104px; min-height:58px; border-radius:13px; color:var(--quiet); text-decoration:none; font:11px var(--font-ui); }
.amethyst-app .dock svg { width:21px; height:21px; }
.amethyst-app .dock a[aria-current=page] { color:var(--gold2); background:var(--line); box-shadow:inset 0 1px 0 rgba(255,255,255,.05); }
.amethyst-app .dock a:active { background:var(--card); transform:scale(.97); }
.amethyst-app[data-keyboard=true] .dock { display:none; }
.amethyst-app .empty-result { padding:24px 12px; color:var(--quiet); text-align:center; }
.amethyst-app .weather-panel { margin:0 0 14px; border:1px solid var(--edge); border-radius:22px; background:linear-gradient(135deg,var(--surface),var(--card2)); overflow:hidden; box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 10px 30px rgba(0,0,0,.13); }
.amethyst-app .weather-panel summary { cursor:pointer; list-style:none; padding:16px; }
.amethyst-app .weather-panel summary::-webkit-details-marker { display:none; }
.amethyst-app .weather-title { display:flex; justify-content:space-between; align-items:center; font-size:13px; margin-bottom:12px; }
.amethyst-app .weather-title .expand { color:var(--gold2); font-size:11px; }
.amethyst-app .weather-reading { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.amethyst-app .weather-reading>div+div { border-left:1px solid var(--line); padding-left:16px; }
.amethyst-app .weather-reading small { font-size:10px; color:var(--quiet); display:block; }
.amethyst-app .weather-reading strong { display:block; font-size:32px; line-height:1.2; font-weight:450; letter-spacing:-1px; margin:3px 0; }
.amethyst-app .weather-reading span { display:block; font-size:11px; line-height:1.4; }
.amethyst-app .weather-reading .age { color:var(--quiet); font-size:10px; margin-top:4px; }
.amethyst-app .weather-detail { padding:0 16px 16px; border-top:1px solid var(--line); }
.amethyst-app .weather-periods { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:14px 0; }
.amethyst-app .weather-periods>div { min-width:0; font-size:11px; color:var(--quiet); }
.amethyst-app .weather-periods b { display:block; color:var(--ink); font-size:17px; margin:4px 0; }
.amethyst-app .weather-note { font-size:11px; line-height:1.6; color:var(--quiet); margin:10px 0; }
.amethyst-app .weather-refresh { min-height:44px; font-size:12px; padding:8px 12px; background:var(--bg2); color:var(--gold2); border:1px solid var(--line); border-radius:10px; }
.amethyst-app .weather-panel [data-stale=true] { color:var(--gold2); }
.amethyst-app .paper-head { padding:16px 0 20px; max-width:740px; margin:auto; }
.amethyst-app .back-hall { display:inline-flex; align-items:center; min-height:44px; color:var(--gold2); font:12px var(--font-ui); text-decoration:none; margin-bottom:10px; }
.amethyst-app .paper-head h1 { font:600 clamp(26px,5vw,34px)/1.2 var(--font-ui); letter-spacing:-.9px; margin:8px 0; color:var(--ink); }
.amethyst-app .paper-head .tag { font:13px/1.6 var(--font-ui); margin:0; color:var(--quiet); }
.amethyst-app .reading { max-width:740px; margin:auto; min-width:0; }
.amethyst-app .paper { max-width:none; padding:0; border:0; box-shadow:none; background:none; font:17px/1.7 var(--font-ui); }
.amethyst-app .paper .paper { margin:0; }
.amethyst-app .paper h2 { display:block; margin:28px 0 12px; font-size:21px; line-height:1.35; }
.amethyst-app .paper h2 small { display:block; font:12px/1.5 var(--font-ui); color:var(--quiet); margin-top:6px; }
.amethyst-app .paper p { margin:0 0 18px; }
.amethyst-app .paper .lead { font:18px/1.65 var(--font-ui); color:var(--ink); }
.amethyst-app .paper h3 { font:600 17px/1.5 var(--font-ui); color:var(--gold2); margin:24px 0 10px; }
.amethyst-app .contents { margin:0 0 18px; border:1px solid var(--line); border-radius:14px; padding:10px 14px; font:13px/1.6 var(--font-ui); }
.amethyst-app .contents summary { min-height:28px; cursor:pointer; color:var(--gold2); }
.amethyst-app .contents:has(nav:empty) { display:none; }
.amethyst-app .terms { list-style:decimal; padding-left:24px; }
.amethyst-app .terms li { padding:0 0 18px 4px; }
.amethyst-app .terms li::marker { color:var(--gold); font-weight:600; }
.amethyst-app .terms b { color:var(--ink); }
.amethyst-app .pdfbox { font-size:13px; padding:16px; margin:20px 0; }
.amethyst-app .pdfbox iframe { width:100%; height:240px; border:0; border-radius:10px; }
.amethyst-app .pdf-preview { padding:20px; border:1px dashed var(--line); border-radius:10px; color:var(--quiet); font-size:12px; }
.amethyst-app .paper .f { font:14px/1.5 var(--font-ui); }
.amethyst-app .paper form { padding:20px; border:1px solid var(--line); background:var(--card2); border-radius:18px; margin-top:20px; }
.amethyst-app .paper .acc { font-size:13px; }
.amethyst-app .paper .done,.amethyst-app .paper .err { font-size:13px; margin-top:12px; }
.amethyst-app footer { margin-top:32px; font-size:10px; }
.amethyst-app .reading footer { line-height:1.7; }
/* Existing working hooks, redressed; no service logic is replaced here. */
.amethyst-app #gate { display:none; position:fixed; inset:0; z-index:100; background:rgba(0,0,0,.7); align-items:center; justify-content:center; padding:20px; }
.amethyst-app #gate.open { display:flex; }
.amethyst-app #gate .door { width:min(420px,100%); box-shadow:0 24px 100px rgba(0,0,0,.55); }
.amethyst-app #gate h3 { font:600 22px var(--font-ui); letter-spacing:-.5px; }
.amethyst-app #gate p,.amethyst-app #gate .msg { font:13px/1.6 var(--font-ui); }
.amethyst-app #gate .row { display:flex; justify-content:flex-end; gap:10px; margin-top:16px; }
.amethyst-app #gate .bad { border-color:var(--down); }
.amethyst-app #gate .busy,.amethyst-app .runbtn.busy { opacity:.6; cursor:wait; }
.amethyst-app .shake { animation:amethyst-shake .25s; }
@keyframes amethyst-shake { 25% { transform:translateX(-5px); } 75% { transform:translateX(5px); } }
.amethyst-app .gauge { position:relative; width:min(270px,100%); margin:auto; text-align:center; }
.amethyst-app .gauge svg { width:100%; height:auto; overflow:visible; }
.amethyst-app .gauge .val { position:absolute; inset:55% 0 auto; font:450 30px var(--font-ui); }
.amethyst-app .gauge .val small { display:block; font-size:11px; color:var(--quiet); }
.amethyst-app .gauge .verdict { color:var(--gold2); font-size:12px; }
.amethyst-app .gauge .verdict.dim { color:var(--quiet); }
.amethyst-app .pills { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.amethyst-app .pill { flex:1 1 90px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; font-size:12px; }
.amethyst-app .pill .k { color:var(--quiet); display:block; font-size:10px; }
.amethyst-app .realmline { display:flex; flex-wrap:wrap; gap:12px; margin-top:14px; font-size:12px; }
.amethyst-app .track { height:4px; background:var(--line); border-radius:4px; overflow:hidden; margin-top:12px; }
.amethyst-app .track i { display:block; height:100%; background:var(--gold); }
.amethyst-app .anote { font-size:11px; color:var(--quiet); }
.amethyst-app .lg .tiles { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.amethyst-app .lg .t { background:var(--card2); border:1px solid var(--line); padding:16px; border-radius:16px; }
.amethyst-app .lg .t b { font-size:12px; color:var(--quiet); }
.amethyst-app .lg .v { font-size:26px; } .amethyst-app .lg .v small,.amethyst-app .lg .s { font-size:11px; color:var(--quiet); }
.amethyst-app .lg .card { display:block; padding:16px; overflow:auto; }
.amethyst-app .lg canvas { width:100%; height:190px; }
.amethyst-app .lg .legend,.amethyst-app .lg .status { font-size:11px; color:var(--quiet); }
.amethyst-app .lg .verdict { border:1px solid var(--line); padding:16px; border-radius:14px; font-size:14px; }
.amethyst-app .chat .bar { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.amethyst-app .chat .mind,.amethyst-app .chat .lnk { border:1px solid var(--line); border-radius:10px; padding:10px 12px; font-size:12px; color:var(--quiet); cursor:pointer; }
.amethyst-app .chat .mind { display:flex; flex-direction:column; }
.amethyst-app .chat .mind.on { border-color:var(--gold); color:var(--gold2); }
.amethyst-app .chat .mind .n { font-size:10px; }
.amethyst-app .chat .gone { opacity:.4; }
.amethyst-app .chat #log { display:flex; flex-direction:column; gap:14px; min-height:180px; margin:20px 0; }
.amethyst-app .chat .msg { display:flex; align-items:flex-start; gap:10px; max-width:94%; }
.amethyst-app .chat .msg .gem { width:28px; height:32px; flex:0 0 28px; }
.amethyst-app .chat .msg.me { align-self:flex-end; flex-direction:row-reverse; }
.amethyst-app .chat .bub { border:1px solid var(--line); border-radius:16px; padding:14px; background:var(--card2); min-width:0; }
.amethyst-app .chat .msg.me .bub { border-color:var(--gold); }
.amethyst-app .chat .body { font:15px/1.65 var(--font-ui); overflow-wrap:anywhere; }
.amethyst-app .chat .body pre { overflow:auto; max-width:100%; }
.amethyst-app .chat .who,.amethyst-app .chat .meta,.amethyst-app .chat .status,.amethyst-app .chat .hint { font-size:11px; color:var(--quiet); }
.amethyst-app .chat .composer { position:sticky; bottom:90px; z-index:10; background:var(--bg); padding:10px 0; }
.amethyst-app .chat .box { display:flex; gap:8px; border:1px solid var(--line); padding:8px; border-radius:16px; background:var(--card2); }
.amethyst-app .chat textarea { flex:1; min-width:0; min-height:44px; color:var(--ink); font:14px/1.5 var(--font-ui); border:0; background:transparent; padding:10px; resize:vertical; }
.amethyst-app .chat .sendbtn { min-width:58px; display:grid; place-items:center; color:var(--gold2); font-size:12px; cursor:pointer; }
.amethyst-app .chat .seat { border:1px solid var(--line); border-radius:16px; padding:16px; }
.amethyst-app .chat .row { display:flex; align-items:center; gap:10px; padding:10px 0; font-size:13px; }
.amethyst-app .chat .row .ti { min-width:0; flex:1; overflow:hidden; text-overflow:ellipsis; }
.amethyst-app .chat .row .del { color:var(--quiet); cursor:pointer; }
.amethyst-app .chat .blank { padding:18px 0; color:var(--quiet); }
.amethyst-app .preview-note { font:11px/1.5 var(--font-ui); color:var(--quiet); border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
@supports (backdrop-filter:blur(12px)) and (color:color-mix(in srgb,white,black)) { .amethyst-app .dock { backdrop-filter:blur(16px); background:color-mix(in srgb,var(--bg2) 92%,transparent); } }
@media(min-width:700px) { .amethyst-app .wrap { padding:18px 24px 120px; } .amethyst-app .grid.app-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; } .amethyst-app .app-grid .tile { min-height:96px; padding:16px; } .amethyst-app .app-grid .tile .nm { font-size:14px; } .amethyst-app .crestwrap.grand { width:90px; height:96px; flex-basis:90px; } .amethyst-app .crestwrap.grand .crest { width:90px; height:90px; } }
@media(min-width:1180px) { .amethyst-app .grid.app-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media(max-width:360px) { .amethyst-app .app-grid .tile { padding:12px 9px; gap:7px; } .amethyst-app .app-grid .tile .gem { width:26px; flex-basis:26px; } .amethyst-app .app-grid .tile .nm { font-size:12px; } }
@media(prefers-reduced-motion:reduce) { .amethyst-app .dock a:active { transform:none; } }

/* Commission 004: court seasoning, fixed geometry and unchanged words/type. */
.court-mark { position:absolute; left:64px; top:76px; width:26px; height:26px; color:var(--gold2); pointer-events:none; }
.court-mark svg,.court-drift svg { display:none; width:100%; height:100%; }
.paper-head .court-mark { left:auto; right:0; top:30px; width:22px; height:22px; }
.court-drift { display:none; position:absolute; right:8%; top:24%; width:38px; height:38px; color:var(--gold2); opacity:.07; animation:court-drift 24s ease-in-out infinite alternate; }
html:is([data-theme=amazon],[data-theme=egyptian],[data-theme=atlantis],[data-theme=halloween],[data-theme=christmas]) .court-drift { display:block; }
html[data-theme=amazon] [data-court-mark=amazon],html[data-theme=egyptian] [data-court-mark=egyptian],html[data-theme=atlantis] [data-court-mark=atlantis],html[data-theme=halloween] [data-court-mark=halloween],html[data-theme=christmas] [data-court-mark=christmas] { display:block; }
html:is([data-theme=amazon],[data-theme=egyptian],[data-theme=atlantis],[data-theme=halloween],[data-theme=christmas]) .amethyst-app .dock a[aria-current=page] { color:var(--gold2); box-shadow:inset 0 1px 0 var(--gold),0 0 16px var(--line); }
html:is([data-theme=amazon],[data-theme=egyptian],[data-theme=atlantis],[data-theme=halloween],[data-theme=christmas]) .amethyst-app .tile::before { background:linear-gradient(120deg,var(--gold),transparent 42%,var(--gold2) 43%,transparent 45%,var(--line) 75%); opacity:.12; }
html[data-theme=amazon] .court-drift { transform:rotate(-25deg); }
html[data-theme=egyptian] .court-drift { top:37%; right:12%; }
html[data-theme=atlantis] .court-drift { top:45%; right:6%; }
html[data-theme=halloween] .court-drift { top:28%; right:10%; opacity:.045; color:var(--gold); }
html[data-theme=christmas] .court-drift { top:18%; right:7%; }
@keyframes court-drift { from { translate:0 0; } to { translate:-12px 18px; } }
body[data-paused=true] .court-drift { animation-play-state:paused; }
.preview-courts { display:flex; align-items:center; gap:12px; margin-top:20px; font:11px var(--font-ui); color:var(--quiet); }
.preview-courts select { min-height:44px; border:1px solid var(--line); border-radius:10px; background:var(--bg2); color:var(--ink); padding:8px; }
@media(min-width:700px) { .identity .court-mark { left:72px; top:82px; } }
@media(prefers-reduced-motion:reduce) { .court-drift { animation:none; } }
