/* STRATA OS: the desktop, drawn in the original artifact's language (css/strata.css tokens + its five strata colours). */
:root { --sb-thumb: rgba(19, 26, 42, .22); --sb-thumb-hover: rgba(19, 26, 42, .4); --bar-h: 38px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sb-thumb: rgba(228, 233, 242, .2); --sb-thumb-hover: rgba(228, 233, 242, .38); } }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover); }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
*::-webkit-scrollbar-corner { background: transparent; }
@supports (-moz-appearance: none) { * { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; } }
[hidden]:not([hidden=until-found i]) { display: none !important; }
.is-hidden { display: none !important; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.linkbtn { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); font-size: 12.5px; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }

html, body.os { height: 100%; overflow: hidden; }
body.os { background: var(--bg); }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; z-index: 100; background: #05070b; color: #9fb3c8; display: flex; align-items: flex-start; justify-content: flex-start; padding: 7vh 8vw; transition: opacity .35s ease; }
.boot pre { margin: 0; font: 500 15px/1.65 var(--font-mono); white-space: pre-wrap; }
.boot pre b { color: #45d1ba; font-weight: 600; } .boot pre i { color: #f0b54a; font-style: normal; }
.boot.out { opacity: 0; pointer-events: none; }

/* ---------- the menu bar ---------- */
.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: var(--bar-h); display: flex; align-items: center; gap: 8px; padding: 0 12px; background: color-mix(in srgb, var(--panel) 86%, transparent); backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); font-size: 13px; }
.bar button, .bar a { border: 0; background: none; cursor: pointer; color: var(--ink); text-decoration: none; font: 500 13px/1 var(--font-body); padding: 6px 8px; border-radius: 6px; }
.bar button:hover, .bar a:hover { background: var(--panel-2); }
.bar-brand { display: flex; align-items: center; gap: 7px; }
.bar-brand b { font: 800 15px/1 var(--font-display); letter-spacing: -0.02em; }
.bar-menu { display: flex; gap: 2px; }
.bar-gap { flex: 1; }
.chip { display: inline-flex; align-items: baseline; gap: 5px; height: 26px; padding: 0 9px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; align-items: center; }
.chip i { font-style: normal; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chip b { font-size: 13px; font-weight: 600; }
.chip .sub { font-size: 11.5px; color: var(--muted); margin-left: 2px; }
.chip.cpu { background: var(--s-cpu); border-color: color-mix(in srgb, var(--l-cpu) 30%, var(--line)); }
.chip.cpu b { color: var(--l-cpu); font-size: 14px; }
.chip.cpu.up b { animation: up 1s ease-out; }
@keyframes up { from { color: #fff; text-shadow: 0 0 10px var(--l-cpu); } }
.chip.feed .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.chip.feed.live .dot { background: #2fd27a; box-shadow: 0 0 0 3px color-mix(in srgb, #2fd27a 22%, transparent); animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 50% { box-shadow: 0 0 0 6px transparent; } }
.chip.feed span { font-size: 12px; color: var(--ink); }
.bar-clock { font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.ca-pill { display: flex; align-items: center; gap: 4px; height: 26px; padding: 0 3px 0 9px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); min-width: 0; max-width: 290px; }
.ca-pill.is-live { border-color: var(--l-screen); }
.ca-lab { font: 700 12px/1 var(--font-display); white-space: nowrap; }
.ca-addr { display: flex; align-items: center; gap: 6px; min-width: 0; height: 20px; border: 0; padding: 0 2px 0 4px; background: none; font: 500 11.5px/1 var(--font-mono); color: var(--ink); cursor: copy; }
.ca-addr:disabled { cursor: default; color: var(--muted); font: 500 11.5px/1 var(--font-body); }
.ca-addr > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-copy { flex: none; font: 600 11px/1 var(--font-body); font-style: normal; padding: 4px 7px; border-radius: 5px; background: var(--ink); color: var(--bg); }
.ca-link { flex: none; font: 600 11px/1 var(--font-body) !important; padding: 5px 7px !important; border-radius: 5px; background: var(--panel-2); }

/* ---------- the desk ---------- */
.desk { position: fixed; inset: var(--bar-h) 0 0 0; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 78% 108%, color-mix(in srgb, var(--l-screen) 13%, transparent), transparent 70%),
    radial-gradient(900px 520px at 100% -10%, color-mix(in srgb, var(--l-assembler) 12%, transparent), transparent 70%),
    radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--l-source) 14%, transparent), transparent 70%),
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--bg); }
.hero { position: absolute; left: 124px; bottom: 96px; max-width: 640px; text-align: left; pointer-events: none; }
.hero-k { margin: 0 0 6px; font: 600 12px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--l-screen); }
.hero h1 { margin: 0; font: 800 clamp(44px, 5.6vw, 92px)/0.9 var(--font-display); letter-spacing: -0.045em; color: color-mix(in srgb, var(--ink) 88%, transparent); }
.hero-l { margin: 12px 0 0; max-width: 62ch; font-size: 15px; line-height: 1.5; color: var(--muted); }
.hero-l b { color: var(--ink); font-weight: 600; }
.hero-l + .hero-l { margin-top: 8px; }
.hero-facts { list-style: none; margin: 14px 0 0; padding: 0; display: flex; gap: 6px; justify-content: flex-start; flex-wrap: wrap; }
.hero-facts li { font: 600 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; padding: 6px 9px; border-radius: 6px; background: color-mix(in srgb, var(--panel) 80%, transparent); border: 1px solid var(--line); color: var(--ink); }
.hero-facts li:nth-child(1) { color: var(--l-cpu); } .hero-facts li:nth-child(2) { color: var(--l-compiler); } .hero-facts li:nth-child(3) { color: var(--l-screen); } .hero-facts li:nth-child(4) { color: var(--l-source); }

.icons { position: absolute; top: 18px; left: 16px; bottom: 90px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 86px); grid-auto-columns: 86px; gap: 4px 6px; }
.ico { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 5px 2px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--ink); }
.ico:hover, .ico:focus-visible { background: color-mix(in srgb, var(--panel) 70%, transparent); }
.ico .g { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--c, var(--ink)); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--c, #000) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22); }
.ico .g svg { width: 26px; height: 26px; }
.ico span { font-size: 12px; font-weight: 500; text-align: center; line-height: 1.2; text-shadow: 0 1px 0 color-mix(in srgb, var(--bg) 70%, transparent); }
.ico .tag { font: 600 9.5px/1 var(--font-mono); letter-spacing: .06em; color: var(--l-screen); text-transform: uppercase; }

/* ---------- windows ---------- */
.win { position: absolute; z-index: 10; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 24px 60px rgba(19, 26, 42, .22), 0 2px 6px rgba(19, 26, 42, .08); overflow: hidden; animation: winin .26s cubic-bezier(.2, .7, .2, 1); min-width: 280px; }
@keyframes winin { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.win.focus { box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 30px 80px rgba(19, 26, 42, .32), 0 0 0 1px color-mix(in srgb, var(--wc, var(--l-cpu)) 35%, transparent); }
.win-head { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 0; background: var(--panel-2); border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; }
.win-head:active { cursor: grabbing; }
.win-band { width: 5px; align-self: stretch; background: var(--wc, var(--l-cpu)); }
.win-title { font: 700 13.5px/1 var(--font-display); letter-spacing: -0.01em; }
.win-meta { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.win-x { width: 26px; height: 24px; border: 0; border-radius: 6px; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--muted); }
.win-x:hover { background: var(--bad-bg); color: var(--bad); }
.win-body { position: relative; flex: 1; min-height: 0; }
.win .screen { display: block; background: #05070b; padding: 8px; }
.win canvas { display: block; width: 100%; aspect-ratio: 4 / 3; image-rendering: pixelated; image-rendering: crisp-edges; border-radius: 3px; background: #000; touch-action: none; outline: none; }
.win .foot { display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); min-height: 30px; }
.win .foot b { color: var(--ink); font-weight: 600; }
.win .foot .r { margin-left: auto; }
.win .foot .err { color: var(--bad); }

/* ---------- dock ---------- */
.dock { position: fixed; z-index: 45; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 6px; padding: 7px; border-radius: 16px; background: color-mix(in srgb, var(--panel) 78%, transparent); backdrop-filter: blur(14px) saturate(1.3); border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(19, 26, 42, .16); }
.dock button { position: relative; width: 44px; height: 44px; border: 0; border-radius: 11px; display: grid; place-items: center; background: var(--c, var(--ink)); color: #fff; cursor: pointer; transition: transform .14s; }
.dock button:hover { transform: translateY(-3px); }
.dock button svg { width: 22px; height: 22px; }
.dock button.on::after { content: ""; position: absolute; bottom: -5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--ink); }
.dock .sep { width: 1px; background: var(--line); margin: 4px 2px; }

/* ---------- Studio ---------- */
.studio { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.studio .bar2 { display: flex; gap: 6px; align-items: center; padding: 7px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.studio .bar2 .hint { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.studio .code { position: relative; background: var(--code-bg); min-height: 0; }
.studio .code pre, .studio .code textarea { position: absolute; inset: 0; margin: 0; padding: 10px 12px 30px; border: 0; white-space: pre; overflow: auto; font: 12.5px/19px var(--font-mono); tab-size: 2; font-variant-ligatures: none; }
.studio .code pre { pointer-events: none; overflow: hidden; color: var(--ink); }
.studio .code textarea { resize: none; background: transparent; color: transparent; caret-color: var(--ink); outline: none; -webkit-text-fill-color: transparent; }
.studio .msg { padding: 7px 10px; font-size: 12.5px; border-top: 1px solid var(--line); min-height: 32px; }
.studio .msg.bad { color: var(--bad); background: var(--bad-bg); }
.studio form.pub { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--panel-2); }
.studio form.pub input { font: 500 13px/1.2 var(--font-body); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; min-width: 0; }
.studio form.pub input.mono { font-family: var(--font-mono); font-size: 12px; }
.studio form.pub .full { grid-column: 1 / -1; }
.studio form.pub .row { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.studio form.pub .row p { margin: 0; font-size: 12px; color: var(--muted); }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn.teal { background: var(--l-screen); border-color: var(--l-screen); color: #fff; font-weight: 600; }
.c-com { color: var(--syn-com); font-style: italic; } .c-kw { color: var(--syn-kw); } .c-type { color: var(--syn-type); } .c-str { color: var(--syn-str); } .c-num { color: var(--syn-num); } .c-fn { color: var(--syn-fn); font-weight: 600; } .c-pre { color: var(--syn-pre); }

/* ---------- App Store, About, Chat ---------- */
.pane-scroll { height: 100%; overflow: auto; padding: 14px 16px 18px; }
.pane-scroll h2 { font: 800 22px/1.05 var(--font-display); letter-spacing: -0.02em; margin: 0 0 4px; }
.pane-scroll h3 { font: 700 14px/1.2 var(--font-display); margin: 16px 0 6px; }
.pane-scroll p { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.pane-scroll p b { color: var(--ink); font-weight: 600; }
.payday { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--s-screen); margin: 8px 0 12px; font-size: 13px; }
.payday b { font: 600 18px/1 var(--font-mono); color: var(--l-screen); }
.apps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.apps li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 2px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.apps .ag { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; font: 800 15px/1 var(--font-display); }
.apps .an { min-width: 0; }
.apps .an b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apps .an span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apps .au { font: 600 12.5px/1.2 var(--font-mono); text-align: right; white-space: nowrap; }
.apps .au i { display: block; font: 500 10.5px/1.2 var(--font-body); font-style: normal; color: var(--muted); }
.apps .builtin .au { color: var(--muted); }
.apps .empty { display: block; color: var(--muted); font-size: 13px; border: 0; padding: 10px 0; }
.about pre { margin: 0 0 12px; padding: 12px; border-radius: 8px; background: #05070b; color: #9fb3c8; font: 500 12px/1.6 var(--font-mono); white-space: pre-wrap; }
.about pre b { color: #45d1ba; font-weight: 600; }
.chatwin { display: flex; flex-direction: column; height: 100%; padding: 10px 12px; gap: 8px; }
.chatwin .c-head { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.chatwin .c-head input { flex: 1; font: 500 13px/1.2 var(--font-body); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; min-width: 0; }
.c-pin { display: flex; gap: 8px; align-items: baseline; padding: 6px 9px; border-radius: 8px; background: var(--s-cpu); font-size: 12.5px; }
.c-pin b { flex: none; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--l-cpu); }
.c-pin span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.c-list { list-style: none; margin: 0; padding: 0 4px 0 0; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.c-list li { line-height: 1.4; overflow-wrap: anywhere; }
.c-list .c-time { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-right: 6px; }
.c-list .c-name { font-weight: 600; margin-right: 6px; filter: brightness(.7) saturate(1.3); }
.c-list li.is-dev { background: var(--s-compiler); border-radius: 6px; padding: 3px 6px; }
.c-list .c-none { color: var(--muted); }
.c-tag { display: inline-block; font: 700 10px/1 var(--font-display); letter-spacing: .08em; padding: 3px 5px; border-radius: 4px; background: var(--l-compiler); color: #fff; margin-right: 6px; }
.c-mod { margin-left: 8px; display: inline-flex; gap: 6px; } .c-mod button { border: 0; background: none; padding: 0; font-size: 11px; color: var(--muted); cursor: pointer; text-decoration: underline; }
.c-form { display: flex; gap: 6px; } .c-form input { flex: 1; font: 500 13px/1.2 var(--font-body); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; min-width: 0; }
.c-hint { margin: 0; font-size: 11.5px; color: var(--muted); } .c-hint.is-bad { color: var(--bad); }
.devnote { position: fixed; z-index: 90; left: 50%; top: 48px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; max-width: min(640px, calc(100% - 24px)); padding: 10px 12px 10px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); box-shadow: 0 14px 40px rgba(0, 0, 0, .3); font-size: 14px; }
.devnote .linkbtn { color: var(--bg); text-decoration: none; font-size: 18px; line-height: 1; }
.toast { position: fixed; z-index: 95; left: 50%; bottom: 80px; transform: translateX(-50%); padding: 9px 14px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 13.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: calc(100% - 24px); }

/* ---------- small screens: one app at a time, full width ---------- */
@media (max-width: 860px) {
  .bar { gap: 4px; padding: 0 6px; overflow-x: auto; }
  .bar-menu, .bar-clock, .chip.feed span, .ca-pill .ca-link, .chip .sub { display: none; }
  .ca-pill { max-width: 150px; }
  .icons { top: 12px; left: 8px; right: 8px; bottom: auto; grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-template-rows: none; grid-auto-rows: 88px; grid-auto-columns: auto; }
  .hero { left: 16px; right: 16px; bottom: 96px; text-align: left; } .hero-l { margin-left: 0; } .hero-facts { justify-content: flex-start; }
  .win { left: 6px !important; right: 6px; top: 6px !important; bottom: 74px; width: auto !important; height: auto !important; }
  .win-head { cursor: default; }
  .dock { bottom: 8px; gap: 4px; padding: 5px; max-width: calc(100% - 16px); overflow-x: auto; }
  .dock button { width: 40px; height: 40px; }
}

/* the app icons: one drawn family (img/icons), cut to the same rounded square */
.ico .g.pic { width: 52px; height: 52px; border-radius: 14px; background: none; overflow: hidden; box-shadow: 0 8px 18px rgba(19, 26, 42, .18), 0 1px 0 rgba(255, 255, 255, .35) inset; }
.ico .g.pic img, .dock button.pic img, .apps .ag.pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ico:hover .g.pic { transform: translateY(-2px); transition: transform .14s; }
.dock button.pic { background: none; overflow: hidden; padding: 0; box-shadow: 0 4px 10px rgba(19, 26, 42, .16); }
.apps .ag.pic { overflow: hidden; background: none; }
.icons { grid-template-rows: repeat(auto-fill, 86px); row-gap: 2px; top: 12px; }
.ico { gap: 4px; padding: 4px 2px; } .ico .tag { margin-top: -2px; }

.bar .xlink { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono) !important; font-size: 12.5px !important; }
