/* KennOS. Everything is scoped under .kos */
.kos {
  --acc: #ffb45e;
  --fg: #f4ece6; --dim: rgba(244, 236, 230, .62); --faint: rgba(244, 236, 230, .38);
  --win: rgba(26, 19, 34, .88); --win2: rgba(38, 29, 48, .9); --panel: rgba(255, 255, 255, .055); --panel2: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .12); --line2: rgba(255, 255, 255, .2); --bar: rgba(18, 13, 26, .58);
  --ui: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --label: "Unbounded", "Bricolage Grotesque", system-ui, sans-serif;
  --disp: "Instrument Serif", Georgia, "Times New Roman", serif;
  position: absolute; inset: 0; overflow: hidden; color: var(--fg); font: 400 14px/1.45 var(--ui);
  background: #120d1a; user-select: none; -webkit-user-select: none; -webkit-font-smoothing: antialiased; touch-action: manipulation;
}
.kos.light {
  --fg: #2a2030; --dim: rgba(42, 32, 48, .66); --faint: rgba(42, 32, 48, .42);
  --win: rgba(255, 250, 245, .9); --win2: rgba(255, 244, 234, .95); --panel: rgba(60, 30, 50, .055); --panel2: rgba(60, 30, 50, .1);
  --line: rgba(60, 30, 50, .14); --line2: rgba(60, 30, 50, .26); --bar: rgba(255, 250, 244, .66);
}
.kos *, .kos *::before, .kos *::after { box-sizing: border-box; }
.kos button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.kos a { color: var(--acc); text-decoration: none; }
.kos a:hover { text-decoration: underline; }
.kos.light a { color: #b25a1c; }
.kos input, .kos textarea, .kos select { font: inherit; color: inherit; }
.kos .kos-sp { flex: 1; }
.kos svg { display: block; }
.kos.rm *, .kos.rm *::before, .kos.rm *::after { transition: none !important; animation: none !important; }

.kos .kos-wp { position: absolute; inset: 0; width: 100%; height: 100%; }
.kos .kos-desk { position: absolute; left: 0; right: 0; top: 34px; bottom: 0; overflow: hidden; }

/* menu bar */
.kos .kos-mb { position: absolute; left: 0; right: 0; top: 0; height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 12px;
  background: var(--bar); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border-bottom: 1px solid var(--line); font-size: 13px; z-index: 5; }
.kos .kos-mb-mark { width: 18px; height: 18px; color: var(--acc); }
.kos.light .kos-mb-mark { color: #c96a22; }
.kos .kos-mb-name { font-weight: 700; letter-spacing: .01em; }
.kos .kos-mb-app { color: var(--dim); font-weight: 500; padding-left: 10px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kos .kos-mb-clock { color: var(--dim); font-variant-numeric: tabular-nums; padding: 0 6px; white-space: nowrap; }
.kos .kos-mb-btn { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s; }
.kos .kos-mb-btn svg { width: 15px; height: 15px; }
.kos .kos-mb-btn:hover { background: var(--panel2); border-color: var(--line2); }
.kos .kos-snd:not(.on) { border-color: color-mix(in srgb, var(--acc) 60%, transparent); color: var(--acc); }
.kos.light .kos-snd:not(.on) { color: #b25a1c; }
.kos .kos-snd.on svg { color: var(--acc); }

/* dock */
.kos .kos-dock { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 10px; padding: 9px 11px; border-radius: 20px;
  background: var(--bar); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); z-index: 4; transition: opacity .4s, transform .5s cubic-bezier(.2, .9, .2, 1); }
.kos .kos-dk { position: relative; display: block; }
.kos .kos-dk-tile { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -8px 14px rgba(0, 0, 0, .14), 0 3px 8px rgba(0, 0, 0, .28); transition: transform .18s cubic-bezier(.2, .9, .3, 1.4); }
.kos .kos-dk-tile svg { width: 26px; height: 26px; }
.kos .kos-dk:hover .kos-dk-tile { transform: translateY(-7px) scale(1.08); }
.kos .kos-dk:active .kos-dk-tile { transform: translateY(-2px) scale(.97); }
.kos .kos-dk-dot { position: absolute; left: 50%; bottom: -6px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--acc); opacity: 0; transition: opacity .2s; }
.kos .kos-dk.run .kos-dk-dot { opacity: 1; }
.kos .kos-dk-tip { position: absolute; left: 50%; bottom: 66px; transform: translate(-50%, 4px); padding: 3px 9px; border-radius: 7px; background: rgba(16, 11, 22, .92); color: #f4ece6; border: 1px solid rgba(255, 255, 255, .14); font-size: 12px; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; }
.kos .kos-dk:hover .kos-dk-tip { opacity: 1; transform: translate(-50%, 0); }
.kos.booting .kos-dock { opacity: 0; transform: translate(-50%, 30px); }
.kos.booting .kos-mb { opacity: 0; }
.kos .kos-mb { transition: opacity .4s; }

/* windows */
.kos .kos-win { position: absolute; display: flex; flex-direction: column; border-radius: 12px; background: var(--win); border: 1px solid var(--line);
  backdrop-filter: blur(26px) saturate(1.25); -webkit-backdrop-filter: blur(26px) saturate(1.25);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .28), 0 14px 40px rgba(0, 0, 0, .34); transition: opacity .16s, transform .18s cubic-bezier(.2, .9, .3, 1), box-shadow .2s; transform-origin: 50% 60%; }
.kos .kos-win.focused { border-color: var(--line2); box-shadow: 0 0 0 1px rgba(0, 0, 0, .34), 0 28px 80px rgba(0, 0, 0, .5); }
.kos .kos-win.opening, .kos .kos-win.closing { opacity: 0; transform: scale(.94) translateY(10px); }
.kos .kos-win.minim { opacity: 0; transform: scale(.5) translateY(60vh); pointer-events: none; visibility: hidden; transition: opacity .2s, transform .25s, visibility 0s .25s; }
.kos .kos-win.max { border-radius: 0; border-left: 0; border-right: 0; }
.kos .kos-win.drag { transition: none; }
.kos .kos-win.drag .kos-body { pointer-events: none; }
.kos .kos-win:not(.focused) .kos-tb { opacity: .62; }
.kos .kos-tb { flex: none; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px; border-bottom: 1px solid var(--line); cursor: default; touch-action: none; }
.kos .kos-tb-ic { width: 16px; height: 16px; color: var(--acc); }
.kos.light .kos-tb-ic { color: #c96a22; }
.kos .kos-tb-t { font-weight: 600; font-size: 13px; letter-spacing: .01em; }
.kos .kos-wb { width: 26px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--dim); transition: background .12s, color .12s; }
.kos .kos-wb svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.kos .kos-wb:hover { background: var(--panel2); color: var(--fg); }
.kos .kos-wb-x:hover { background: #e2574c; color: #fff; }
.kos .kos-body { flex: 1; min-height: 0; position: relative; overflow: hidden; border-radius: 0 0 11px 11px; display: flex; flex-direction: column; }
.kos .kos-rs { position: absolute; touch-action: none; z-index: 3; }
.kos .kos-win.max .kos-rs { display: none; }
.kos .kos-rs-n { top: -4px; left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.kos .kos-rs-s { bottom: -4px; left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.kos .kos-rs-e { right: -4px; top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.kos .kos-rs-w { left: -4px; top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.kos .kos-rs-ne { right: -5px; top: -5px; width: 15px; height: 15px; cursor: nesw-resize; }
.kos .kos-rs-nw { left: -5px; top: -5px; width: 15px; height: 15px; cursor: nwse-resize; }
.kos .kos-rs-se { right: -5px; bottom: -5px; width: 18px; height: 18px; cursor: nwse-resize; }
.kos .kos-rs-sw { left: -5px; bottom: -5px; width: 15px; height: 15px; cursor: nesw-resize; }

/* toast */
.kos .kos-toast { position: absolute; left: 50%; bottom: 100px; transform: translate(-50%, 12px); padding: 8px 14px; border-radius: 10px; background: rgba(16, 11, 22, .9); color: #f4ece6; border: 1px solid rgba(255, 255, 255, .16); font-weight: 500; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 6; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.kos .kos-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* boot */
.kos .kos-boot { position: absolute; inset: 0; z-index: 9; background: #0e0a15; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .45s; color: #f4ece6; }
.kos .kos-boot.show { opacity: 1; pointer-events: auto; transition: none; }
.kos .kos-boot-in { width: 240px; display: flex; flex-direction: column; align-items: center; }
.kos .kos-boot-mark { width: 64px; height: 64px; color: var(--acc); }
.kos .kos-boot-mark svg { opacity: 0; transform: scale(.8); animation: kos-markin .7s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes kos-markin { to { opacity: 1; transform: none; } }
.kos .kos-boot-name { font: 400 30px/1 var(--disp); margin: 10px 0 18px; opacity: 0; animation: kos-fade .5s .3s forwards; }
.kos .kos-boot-bar { width: 100%; height: 2px; background: rgba(255, 255, 255, .12); border-radius: 2px; overflow: hidden; }
.kos .kos-boot-bar i { display: block; height: 100%; width: 100%; background: var(--acc); transform: scaleX(0); transform-origin: 0 50%; animation: kos-bar 1.45s cubic-bezier(.3, .1, .2, 1) .1s forwards; }
.kos .kos-boot-log { width: 100%; height: 78px; margin-top: 14px; font: 400 11.5px/1.6 var(--mono); color: rgba(244, 236, 230, .5); }
@keyframes kos-draw { to { stroke-dashoffset: 0; } }
@keyframes kos-fade { to { opacity: 1; } }
@keyframes kos-bar { to { transform: scaleX(1); } }

/* shared controls */
.kos .k-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 13px; white-space: nowrap; transition: background .12s, border-color .12s, transform .08s; }
.kos .k-btn:hover { background: var(--panel2); border-color: var(--line2); text-decoration: none; }
.kos .k-btn:active { transform: translateY(1px); }
.kos .k-btn.pri { background: var(--acc); border-color: transparent; color: #24160a; }
.kos .k-btn.pri:hover { filter: brightness(1.08); }
.kos .k-btn.on { background: color-mix(in srgb, var(--acc) 22%, transparent); border-color: color-mix(in srgb, var(--acc) 60%, transparent); }
.kos .k-btn svg { width: 16px; height: 16px; }
.kos a.k-btn { color: var(--fg); }
.kos a.k-btn.pri { color: #24160a; }
.kos .k-lbl { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.kos input[type=range] { -webkit-appearance: none; appearance: none; height: 18px; background: transparent; margin: 0; min-width: 40px; }
.kos input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 3px; background: var(--panel2); }
.kos input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--acc); border: 2px solid rgba(20, 14, 26, .9); cursor: pointer; }
.kos input[type=range]::-moz-range-track { height: 4px; border-radius: 3px; background: var(--panel2); }
.kos input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--acc); border: 2px solid rgba(20, 14, 26, .9); }
.kos select { height: 28px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); padding: 0 6px; }
.kos select option { color: #222; }
.kos .k-scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.kos .k-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.kos .k-scroll::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }

/* terminal */
.kos .k-term { flex: 1; min-height: 0; background: rgba(10, 7, 14, .78); color: #eadfd6; font: 400 13px/1.55 var(--mono); padding: 12px 14px; user-select: text; -webkit-user-select: text; cursor: text; }
.kos .k-term pre { margin: 0; font: inherit; white-space: pre-wrap; word-break: break-word; }
.kos .k-term .t-acc { color: #ffb45e; } .kos .k-term .t-dim { color: rgba(234, 223, 214, .55); } .kos .k-term .t-rose { color: #f28aa8; } .kos .k-term .t-teal { color: #7fd6c8; } .kos .k-term .t-err { color: #ff8a7a; }
.kos .k-term-line { display: flex; gap: 8px; align-items: baseline; }
.kos .k-term-line input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #fff; font: inherit; padding: 0; caret-color: #ffb45e; }
.kos .k-term a { color: #7fd6c8; }

/* notes */
.kos .k-notes { flex: 1; min-height: 0; display: flex; }
.kos .k-notes-list { width: 190px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: var(--panel); }
.kos .k-notes-items { flex: 1; padding: 6px; }
.kos .k-note-it { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; margin-bottom: 2px; }
.kos .k-note-it b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kos .k-note-it span { display: block; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kos .k-note-it:hover { background: var(--panel); }
.kos .k-note-it.sel { background: color-mix(in srgb, var(--acc) 20%, transparent); }
.kos .k-notes-bar { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.kos .k-notes-bar .k-btn { flex: 1; height: 28px; padding: 0 6px; }
.kos .k-notes-ed { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kos .k-notes-title { border: 0; outline: 0; background: none; padding: 18px 24px 4px; font: 400 30px/1.15 var(--disp); width: 100%; }
.kos .k-notes-text { flex: 1; border: 0; outline: 0; background: none; resize: none; padding: 8px 24px 20px; font-size: 15px; line-height: 1.62; user-select: text; -webkit-user-select: text; }
.kos .k-notes-links { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 20px 14px; border-top: 1px solid var(--line); }

/* cv */
.kos .k-cv { flex: 1; min-height: 0; padding: 26px 34px 30px; user-select: text; -webkit-user-select: text; }
.kos .k-cv h1 { font: 400 42px/1.05 var(--disp); margin: 0 0 6px; }
.kos .k-cv .sub { color: var(--dim); font-weight: 500; margin: 0 0 14px; }
.kos .k-cv .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.kos .k-cv p { margin: 0 0 10px; max-width: 70ch; }
.kos .k-cv h2 { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--acc); margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.kos.light .k-cv h2 { color: #b25a1c; }
.kos .k-cv h3 { font-size: 15px; font-weight: 700; margin: 14px 0 2px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.kos .k-cv h3 small { font-weight: 500; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.kos .k-cv h4 { font-size: 13.5px; font-weight: 600; margin: 10px 0 3px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; }
.kos .k-cv h4 small { font-weight: 500; color: var(--faint); }
.kos .k-cv ul { margin: 2px 0 6px; padding-left: 18px; color: var(--dim); }
.kos .k-cv li { margin: 2px 0; max-width: 72ch; }
.kos .k-cv .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 22px; }
.kos .k-cv .grid div b { display: block; font-weight: 600; }
.kos .k-cv .grid div span { color: var(--dim); font-size: 13.5px; }

/* topics */
.kos .k-topics { flex: 1; min-height: 0; display: flex; }
.kos .k-topics-grid { flex: 1; min-width: 0; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; align-content: start; grid-auto-rows: max-content; }
.kos .k-topic { text-align: left; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; transition: transform .15s, border-color .15s, background .15s; display: block; }
.kos .k-topic:hover { transform: translateY(-3px); border-color: var(--line2); background: var(--panel2); }
.kos .k-topic.sel { border-color: var(--acc); }
.kos .k-topic canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #150f20; flex: none; }
.kos .k-topic b { display: block; padding: 9px 12px 2px; font-weight: 600; }
.kos .k-topic span { display: block; padding: 0 12px 11px; font-size: 12.5px; color: var(--dim); line-height: 1.4; }
.kos .k-topics-detail { width: 300px; flex: none; border-left: 1px solid var(--line); background: var(--panel); padding: 18px; user-select: text; -webkit-user-select: text; }
.kos .k-topics-detail canvas { width: 100%; height: auto; border-radius: 10px; background: #150f20; display: block; }
.kos .k-topics-detail h3 { font: 400 27px/1.1 var(--disp); margin: 14px 0 8px; }
.kos .k-topics-detail p { margin: 0 0 10px; color: var(--dim); }
.kos .k-topics-detail ul { margin: 0 0 12px; padding-left: 18px; color: var(--dim); }
.kos .k-topics-head { padding: 14px 18px 0; }
.kos .k-topics-head h2 { font: 400 26px/1.1 var(--disp); margin: 0; }
.kos .k-topics-head p { margin: 2px 0 0; color: var(--dim); font-size: 13px; }
.kos .k-topics-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* settings */
.kos .k-set { flex: 1; min-height: 0; padding: 18px 22px 22px; }
.kos .k-set h3 { margin: 18px 0 9px; }
.kos .k-set h3:first-child { margin-top: 0; }
.kos .k-set-wps { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.kos .k-set-wp { border-radius: 10px; border: 2px solid transparent; overflow: hidden; background: var(--panel); text-align: left; transition: transform .12s; }
.kos .k-set-wp:hover { transform: translateY(-2px); }
.kos .k-set-wp.sel { border-color: var(--acc); }
.kos .k-set-wp canvas { display: block; width: 100%; height: auto; }
.kos .k-set-wp span { display: block; padding: 5px 8px 6px; font-size: 12px; font-weight: 600; }
.kos .k-set-acc { display: flex; gap: 10px; }
.kos .k-set-acc button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25); }
.kos .k-set-acc button.sel { border-color: var(--fg); }
.kos .k-set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kos .k-set-row small { display: block; color: var(--faint); font-size: 12px; }
.kos .k-sw { width: 40px; height: 23px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); position: relative; flex: none; transition: background .15s; }
.kos .k-sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--fg); transition: transform .15s; }
.kos .k-sw.on { background: var(--acc); }
.kos .k-sw.on::after { transform: translateX(17px); background: #24160a; }

/* paint */
.kos .k-paint { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.kos .k-paint-bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.kos .k-paint-tools { display: flex; gap: 3px; }
.kos .k-pt { width: 32px; height: 30px; border-radius: 8px; display: grid; place-items: center; border: 1px solid transparent; color: var(--dim); }
.kos .k-pt svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kos .k-pt:hover { background: var(--panel2); color: var(--fg); }
.kos .k-pt.on { background: color-mix(in srgb, var(--acc) 24%, transparent); border-color: color-mix(in srgb, var(--acc) 60%, transparent); color: var(--fg); }
.kos .k-pt:disabled { opacity: .35; pointer-events: none; }
.kos .k-paint-cols { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.kos .k-pc { width: 20px; height: 20px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .35); box-shadow: 0 0 0 1px var(--line); }
.kos .k-pc.on { box-shadow: 0 0 0 2px var(--fg); }
.kos .k-paint-bar input[type=color] { width: 26px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.kos .k-paint-sep { width: 1px; height: 22px; background: var(--line); }
.kos .k-paint-area { flex: 1; min-height: 0; position: relative; overflow: hidden; background: #fbf6ee; cursor: crosshair; touch-action: none; }
.kos .k-paint-area canvas { position: absolute; left: 0; top: 0; }
.kos .k-paint-size { width: 90px; }

/* beats */
.kos .k-beats { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.kos .k-beats-warn { flex: none; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 7px 12px; background: color-mix(in srgb, var(--acc) 16%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); font-weight: 500; font-size: 13px; }
.kos .k-beats-warn.hide { display: none; }
.kos .k-beats-top { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.kos .k-play { width: 76px; }
.kos .k-play.on { background: #f0605c; color: #fff; }
.kos .k-knob { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--dim); font-weight: 500; }
.kos .k-knob input { width: 84px; }
.kos .k-knob b { color: var(--fg); font-variant-numeric: tabular-nums; min-width: 26px; font-weight: 600; }
.kos .k-scope { flex: 1; min-width: 90px; height: 34px; border-radius: 8px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); }
.kos .k-seq { flex: 1 1 auto; min-height: 150px; padding: 8px 12px; display: grid; grid-auto-rows: minmax(20px, 1fr); gap: 4px; }
.kos .k-tr { display: grid; grid-template-columns: 76px 22px 44px 1fr; gap: 7px; align-items: stretch; min-height: 0; }
.kos .k-tr-n { font-size: 12px; font-weight: 600; text-align: left; align-self: center; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.kos .k-tr-n i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.kos .k-tr-m { border-radius: 6px; border: 1px solid var(--line); font-size: 10px; font-weight: 700; color: var(--faint); align-self: center; height: 20px; }
.kos .k-tr-m.on { background: #f0605c; color: #fff; border-color: transparent; }
.kos .k-tr-v { width: 44px; align-self: center; min-width: 0; }
.kos .k-steps { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; min-height: 0; }
.kos .k-st { border-radius: 5px; background: var(--panel); border: 1px solid var(--line); min-width: 0; transition: transform .06s, background .06s; position: relative; }
.kos .k-st.b4 { background: var(--panel2); }
.kos .k-st:nth-child(4n+1) { margin-left: 3px; }
.kos .k-st.on { background: var(--tc); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 12px -2px var(--tc); }
.kos .k-st.ph { outline: 1.5px solid var(--dim); outline-offset: -1px; background: var(--panel2); }
.kos .k-st.on.ph { transform: scale(1.12); filter: brightness(1.35); }
.kos .k-synth { flex: none; border-top: 1px solid var(--line); padding: 8px 12px 12px; }
.kos .k-synth-bar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 8px; }
.kos .k-keys { position: relative; height: 92px; display: flex; touch-action: none; border-radius: 0 0 8px 8px; overflow: hidden; }
.kos .k-key { flex: 1; background: linear-gradient(#f6efe6, #e6dccf); border: 1px solid #1c1420; border-top: 0; border-radius: 0 0 5px 5px; position: relative; color: #8a7d74; font: 500 10px var(--mono); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px; }
.kos .k-key.dn { background: linear-gradient(var(--acc), color-mix(in srgb, var(--acc) 70%, #000)); color: #3a2410; }
.kos .k-key-b { position: absolute; top: 0; height: 58%; background: linear-gradient(#2b2233, #0f0b14); border-radius: 0 0 4px 4px; z-index: 2; color: #9c8fa6; font: 500 9px var(--mono); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.kos .k-key-b.dn { background: linear-gradient(color-mix(in srgb, var(--acc) 80%, #000), color-mix(in srgb, var(--acc) 45%, #000)); color: #fff; }

/* blocks */
.kos .k-blocks { flex: 1; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(120% 90% at 50% 0%, rgba(120, 80, 190, .28), transparent 60%), #150e1e; color: #f4ece6; }
.kos .k-blocks canvas { flex: 1; min-height: 0; width: 100%; display: block; }
.kos .k-blocks-pad { flex: none; display: none; gap: 6px; padding: 8px; justify-content: center; }
.kos .k-blocks-pad button { flex: 1; max-width: 62px; height: 44px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08); font-weight: 700; font-size: 12px; touch-action: manipulation; }
.kos .k-blocks-pad button:active { background: var(--acc); color: #24160a; }
@media (pointer: coarse) { .kos .k-blocks-pad { display: flex; } }

/* small screens */
@media (max-width: 720px) {
  .kos .kos-mb-app, .kos .kos-mb-clock { display: none; }
  .kos .kos-dock { gap: 5px; padding: 6px 7px; bottom: 8px; border-radius: 16px; }
  .kos .kos-dk-tile { width: 38px; height: 38px; border-radius: 11px; }
  .kos .kos-dk-tile svg { width: 21px; height: 21px; }
  .kos .kos-dk-tip { display: none; }
  .kos .k-notes-list { width: 112px; }
  .kos .k-notes-title { padding: 14px 14px 2px; font-size: 26px; }
  .kos .k-notes-text { padding: 8px 14px 14px; }
  .kos .k-topics { flex-direction: column; }
  .kos .k-topics-detail { width: auto; border-left: 0; border-top: 1px solid var(--line); max-height: 34%; flex: none; }
  .kos .k-topics-grid { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding-bottom: 20px !important; }
  .kos .kos-dk-tile { width: 31px !important; height: 31px !important; border-radius: 9px !important; }
  .kos .kos-dk-tile svg { width: 18px !important; height: 18px !important; }
  .kos .kos-dock { gap: 3px !important; padding: 5px !important; }
  .kos .k-tools-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .kos .k-tools-head { padding: 14px 14px 10px !important; }
  .kos .k-topics-detail canvas { display: none; }
  .kos .k-topics-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 10px; }
  .kos .k-cv { padding: 18px 16px; }
  .kos .k-tr { grid-template-columns: 44px 20px 1fr; gap: 4px; }
  .kos .k-tr-v { display: none; }
  .kos .k-tr-n i { display: none; }
  .kos .k-steps { gap: 2px; }
  .kos .k-st:nth-child(4n+1) { margin-left: 1px; }
  .kos .k-knob input { width: 60px; }
  .kos .k-blocks-pad { display: flex; }
  .kos .k-keys { height: 76px; }
  .kos .k-key, .kos .k-key-b { font-size: 0; }
  .kos .kos-toast { bottom: 70px; }
}

/* external links carry a visible icon */
.kos a[href^="http"]::after, #intro a[href^="http"]::after, #card a[href^="http"]::after, #credit a[href^="http"]::after {
  content: ""; display: inline-block; width: .82em; height: .82em; margin-left: .42em; vertical-align: -.06em; background: currentColor; opacity: .85;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 3H3.6A1.6 1.6 0 002 4.6v7.8A1.6 1.6 0 003.6 14h7.8a1.6 1.6 0 001.6-1.6V9.5'/%3E%3Cpath d='M9.5 2H14v4.5M14 2L7.5 8.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 3H3.6A1.6 1.6 0 002 4.6v7.8A1.6 1.6 0 003.6 14h7.8a1.6 1.6 0 001.6-1.6V9.5'/%3E%3Cpath d='M9.5 2H14v4.5M14 2L7.5 8.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.kos .kos-mb-mark svg, .kos .kos-boot-mark svg { width: 100%; height: 100%; display: block; }
.kos .k-projects { flex: 1; min-height: 0; padding: 20px 22px 26px; user-select: text; -webkit-user-select: text; }
.kos .k-projects h2 { font: 400 30px/1.1 var(--disp); margin: 0; }
.kos .k-projects h3 { font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--acc); margin: 22px 0 10px; }
.kos .k-proj-sub, .kos .k-proj-empty { margin: 4px 0 0; color: var(--dim); }
.kos .k-proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.kos .k-proj { display: block; padding: 14px 16px 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: inherit; text-decoration: none; transition: transform .15s, border-color .15s, background .15s; }
.kos .k-proj:hover, .kos .k-proj:focus-visible { transform: translateY(-2px); border-color: var(--acc); background: var(--panel2); outline: none; }
.kos .k-proj i { display: block; font: 500 11px/1 var(--mono); font-style: normal; color: var(--dim); margin-bottom: 8px; }
.kos .k-proj b { font-weight: 600; font-size: 16px; }
.kos .k-proj span { display: block; margin-top: 4px; color: var(--dim); font-size: 13px; line-height: 1.45; }
.kos a.k-proj { position: relative; padding-right: 40px; }
.kos a.k-proj::after { position: absolute; top: 14px; right: 14px; margin: 0; width: 14px; height: 14px; }
/* eyebrow labels: wide caps, like the panel lettering on a synth */
.kos .k-lbl, .kos .k-cv h2, .kos .k-projects h3, .kos .k-proj i { font-family: var(--label); font-weight: 500; font-size: 9.5px; letter-spacing: .11em; text-transform: uppercase; }
.kos .k-cv h2 { font-size: 10px; }

.kos .k-tools { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.kos .k-tools-head { padding: 18px 22px 12px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; }
.kos .k-tools-head h2 { font: 400 30px/1.1 var(--disp); margin: 0; }
.kos .k-tools-head p { margin: 3px 0 0; color: var(--dim); font-size: 13px; }
.kos .k-tools-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.kos .k-chip { font: 500 12px/1 var(--ui); padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--dim); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.kos .k-chip:hover { color: var(--fg); border-color: var(--line2); }
.kos .k-chip.on { background: var(--acc); border-color: var(--acc); color: #24150a; }
.kos .k-tools-grid { flex: 1; min-height: 0; padding: 4px 22px 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; align-content: start; }
.kos .k-tool { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; gap: 6px; padding: 11px 4px 9px; border-radius: 11px; min-height: 76px; border: 1px solid var(--line); background: var(--panel); transition: transform .15s, opacity .2s, background .15s, border-color .15s; }
.kos .k-tool:hover { transform: translateY(-2px); background: var(--panel2); border-color: var(--line2); }
.kos .k-tool.off { opacity: .16; transform: scale(.96); }
.kos .k-tool-mark { width: 28px; height: 28px; display: grid; place-items: center; flex: none; }
.kos .k-tool-mark svg { width: 26px; height: 26px; display: block; }
.kos .k-tool-mark em { font: 500 10px/1 var(--label); font-style: normal; letter-spacing: .04em; text-transform: uppercase; color: var(--acc); width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line2); display: grid; place-items: center; }
.kos .k-tool b { font-weight: 600; font-size: 11.5px; line-height: 1.2; }
.kos .k-tool-sub { font-size: 10.5px; color: var(--dim); line-height: 1.2; margin-top: -4px; }
.kos.light .k-tool-mark svg path[fill="#ffffff"] { fill: #2a2030; }
.kos .k-proj u { display: block; margin-top: 9px; padding: 7px 9px; border-radius: 8px; text-decoration: none; font-size: 12px; line-height: 1.4; color: var(--fg); background: color-mix(in srgb, var(--acc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--acc) 45%, transparent); }
