/* 4xStudio — Modern UI (default). Retro 2000s skins live in x4.css and apply with body.retro */

/* touch & small screens */
#ov, #tlTracks, #tlRuler, .tlend-tab, .ge-cv, .prow label, .hsplit, .anchor-grid { touch-action: none; }
body.hide-left .panel.left, body.hide-right .panel.right { display: none; }
@media (max-width: 900px) {
  .main { position: relative; }
  .panel { position: absolute; top: 0; bottom: 0; z-index: 45; box-shadow: 0 0 40px rgba(0,0,0,.6); max-width: 88vw; }
  .panel.left { left: 0; } .panel.right { right: 0; }
  .tbtn .tl, .tbtn > span:not(.ic) { display: none; }
  .tl-tools .subtle { display: none; }
  .transport { flex-wrap: wrap; }
  .menubar .menu { padding: 6px 7px; }
  body.modern .titlebar .tt { display: none; }
}
@media (pointer: coarse) {
  .tbtn { padding: 8px 9px; } .pbtn { min-width: 38px; min-height: 36px; }
  .prow input[type=range] { height: 24px; }
}

/* stickers + library segmented control */
.tiles.stickers { grid-template-columns: repeat(5, 1fr); gap: 4px; }
.tile.sticker { min-height: 40px; font-size: 24px; padding: 2px; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif; }
body.modern .tile.sticker { filter: none; }
.panel .seg b { font-size: 11px; padding: 3px 10px; }
body.modern .tabs { flex-wrap: wrap; }
body.modern .tab { flex: 1 0 22%; }

/* ---------- shared: dual icons, settings dialog ---------- */
.ic { display: inline-flex; align-items: center; justify-content: center; }
.svgi { display: block; flex: none; }
body.retro .svgi { display: none; }
body.modern .emo { display: none; }
.titlebar .logo svg { width: 13px; height: 8px; color: #fff; }
.splash .mlogo { display: none; }

.set-sec { font-weight: 600; margin: 14px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.set-sec:first-child { margin-top: 0; }
.ui-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ui-card { border: 2px solid transparent; border-radius: 12px; padding: 8px; cursor: pointer; background: rgba(127,127,127,.08); }
.ui-card:hover { background: rgba(127,127,127,.15); }
.ui-card.on { border-color: var(--accent, #316ac5); }
.ui-nm { font-weight: 600; margin-top: 6px; }
.ui-prev { height: 74px; border-radius: 7px; position: relative; overflow: hidden; }
.ui-prev i, .ui-prev b, .ui-prev span { position: absolute; display: block; }
.modern-prev { background: #0d0e11; border: 1px solid #262a32; }
.modern-prev i { left: 0; right: 0; top: 0; height: 12px; background: #0b0c0f; border-bottom: 1px solid #22252c; }
.modern-prev b { top: 18px; bottom: 18px; width: 22%; background: #16181d; border-radius: 4px; left: 6px; }
.modern-prev b + b { left: auto; right: 6px; }
.modern-prev span { left: 30%; right: 30%; top: 18px; bottom: 18px; background: #fff; border-radius: 3px; opacity: .9; }
.retro-prev { background: #ece9d8; border: 2px solid #0831d9; border-top: none; }
.retro-prev i { left: 0; right: 0; top: 0; height: 13px; background: linear-gradient(#3c8cf6, #0a5bd8 30%, #0842a8); }
.retro-prev b { top: 18px; bottom: 6px; width: 22%; background: linear-gradient(#7ba2e7, #6375d6); left: 4px; }
.retro-prev b + b { left: auto; right: 4px; }
.retro-prev span { left: 30%; right: 30%; top: 22px; bottom: 16px; background: #1d2a9a; box-shadow: 0 0 0 1px #000; }
.swatches { display: flex; gap: 10px; }
.sw { width: 28px; height: 28px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); position: relative; }
.sw.on::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--c); }

/* ---------- modern theme ---------- */
body.modern {
  --accent: #f2f2f2; --accentText: #0b0c0f;
  --bg0: #08090b; --bg1: #0d0e11; --bg2: #121318; --bg3: #17191e; --bg4: #1e2127; --line: #22252c; --line2: #2c3038;
  --text: #e8eaee; --muted: #8b919c; --selText: #fff;
  --face: var(--bg1); --face2: var(--bg2); --dark: var(--line); --border: var(--line2);
  --tl: #0d0e11; --tlRow: #101114; --tlRow2: #0e0f12; --tlGrid: #1a1c21; --ruler1: #0f1013; --ruler2: #0f1013;
  font: 12px 'Segoe UI Variable Text', 'Segoe UI', 'Inter', system-ui, sans-serif;
  background: var(--bg0); color: var(--text);
}
body.modern.accent-violet { --accent: #8b7bff; --accentText: #fff; }
body.modern.accent-cyan { --accent: #3ad1ff; --accentText: #04141a; }
body.modern.accent-lime { --accent: #b8f03c; --accentText: #121a02; }
body.modern.accent-coral { --accent: #ff6b5b; --accentText: #fff; }
body.modern.accent-pink { --accent: #ff5fb4; --accentText: #fff; }

body.modern ::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
body.modern ::-webkit-scrollbar-thumb { background: #2a2d34; border: 2px solid transparent; background-clip: padding-box; border-radius: 10px; box-shadow: none; }
body.modern ::-webkit-scrollbar-thumb:hover { background-color: #3a3e47; }
body.modern ::-webkit-scrollbar-corner { background: transparent; }

body.modern #win { border: none; border-radius: 0; background: var(--bg1); }

/* title bar */
body.modern .titlebar { height: 40px; background: var(--bg0); color: var(--text); text-shadow: none; border-radius: 0; padding: 0 14px; gap: 10px; border-bottom: 1px solid var(--line);
  font: 400 13px 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif; }
body.modern .titlebar .logo { width: auto; height: auto; background: none; box-shadow: none; border-radius: 0; }
body.modern .titlebar .logo svg { width: 34px; height: 18px; color: var(--text); }
body.modern .titlebar .tt b { font-weight: 650; letter-spacing: .01em; }
body.modern .titlebar .tsub { color: var(--muted); }
body.modern .titlebar .tt { text-align: right; min-width: 0; }
body.modern .titlebar .tt b { display: none; }
body.modern .titlebar .tsub::before { content: ""; }
body.modern .titlebar .wbtn { display: none; }
body.modern #win > .titlebar { position: relative; }
/* menubar sits inside the title row visually */
body.modern .menubar { height: 30px; background: transparent; border: none; box-shadow: none; gap: 2px; z-index: 60; flex: none; margin-left: 6px; }
body.modern .timeline { height: min(270px, 36vh); }
body.modern .menubar .menu { padding: 6px 10px; border-radius: 7px; color: var(--muted); }
body.modern .menubar .menu:hover, body.modern .menubar .menu.open { background: var(--bg4); color: var(--text); }
body.modern .dropdown, body.modern .ctxmenu { background: #18191e; color: var(--text); border: 1px solid var(--line2); border-radius: 10px; padding: 5px; box-shadow: 0 16px 40px rgba(0,0,0,.55); top: calc(100% + 4px); min-width: 230px; }
body.modern .dropdown .mi, body.modern .ctxmenu .mi { padding: 6px 10px; border-radius: 6px; }
body.modern .dropdown .mi:hover, body.modern .ctxmenu .mi:hover { background: var(--bg4); color: var(--text); }
body.modern .dropdown .sep, body.modern .ctxmenu .sep { background: var(--line2); margin: 4px 2px; }

/* toolbar */
body.modern .toolbar { background: var(--bg1); border-bottom: 1px solid var(--line); padding: 6px 10px; gap: 2px; }
body.modern .tbtn { border: none; border-radius: 8px; padding: 6px 8px; color: var(--muted); gap: 6px; }
body.modern .tbtn:hover { background: var(--bg4); color: var(--text); border: none; }
body.modern .tbtn:active, body.modern .tbtn.on { background: var(--bg4); color: var(--accent); box-shadow: none; border: none; }
body.modern .tbtn.sm { padding: 5px 6px; }
body.modern .tsep { width: 1px; height: 20px; margin: 0 6px; border: none; background: var(--line2); }
body.modern .aqua, body.modern .aqua.orange, body.modern .aqua.green { background: var(--accent); color: var(--accentText); border: none; border-radius: 9px; padding: 7px 14px; text-shadow: none; box-shadow: none; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
body.modern .aqua:hover { filter: brightness(1.08); }
body.modern .aqua.green { background: var(--bg4); color: var(--text); border: 1px solid var(--line2); }

/* inputs */
body.modern input[type=text], body.modern input[type=number], body.modern select, body.modern textarea { background: var(--bg0); color: var(--text); border: 1px solid var(--line2); border-radius: 6px; padding: 4px 6px; outline: none; }
body.modern input:focus, body.modern select:focus, body.modern textarea:focus { border-color: var(--accent); }
body.modern input[type=color] { border-radius: 6px; background: var(--bg0); border-color: var(--line2); height: 22px; }
body.modern input[type=range] { accent-color: var(--accent); height: 14px; }
body.modern input[type=checkbox], body.modern input[type=radio] { accent-color: var(--accent); }
body.modern .xbtn { background: var(--bg4); color: var(--text); border: 1px solid var(--line2); border-radius: 8px; box-shadow: none; padding: 4px 12px; min-height: 26px; }
body.modern .xbtn:hover { background: #262a31; box-shadow: none; }
body.modern .xbtn.primary { background: var(--accent); color: var(--accentText); border-color: transparent; font-weight: 600; }
body.modern .xbtn.small { min-height: 22px; padding: 2px 8px; }

/* side panels */
body.modern .panel { background: var(--bg2); width: 280px; }
body.modern .panel.left { border-right: 1px solid var(--line); }
body.modern .panel.right { width: 310px; border-left: 1px solid var(--line); }
body.modern .center { background: var(--bg0); border: none; }
body.modern .tabs { padding: 8px; gap: 2px; flex-wrap: nowrap; border-bottom: 1px solid var(--line); }
body.modern .tab { flex: 1; background: none; border: none; border-radius: 8px; padding: 6px 0 5px; color: var(--muted); font-size: 10px; top: 0; }
body.modern .tab .ti { display: flex; justify-content: center; margin-bottom: 3px; }
body.modern .tab:hover { background: var(--bg4); color: var(--text); }
body.modern .tab.on { background: var(--bg4); color: var(--text); border: none; padding-top: 6px; font-weight: 500; }
body.modern .tab.on .ti { color: var(--accent); }
body.modern .panel .scroll { padding: 12px; }

body.modern .grp { border-radius: 12px; background: var(--bg3); border: 1px solid var(--line); box-shadow: none; margin-bottom: 10px; }
body.modern .grp > .gh { background: none; color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding: 10px 12px 6px; }
body.modern .grp > .gh:hover { color: var(--text); }
body.modern .grp > .gh .chev { background: none; border: none; color: var(--muted); font-size: 8px; }
body.modern .grp > .gb { background: none; border: none; padding: 4px 12px 12px; }
body.modern .grp.closed > .gh { padding-bottom: 10px; }
body.modern .prow { margin: 5px 0; }
body.modern .prow label { color: #b9bec7; }
body.modern .prow .kf { color: #4a4f59; }
body.modern .prow .kf:hover { background: var(--bg4); }
body.modern .prow .kf.anim { color: var(--accent); opacity: .7; }
body.modern .prow .kf.here { color: var(--accent); opacity: 1; text-shadow: 0 0 6px var(--accent); }
body.modern .subtle, body.modern .hint { color: var(--muted); }
body.modern .kbd { background: var(--bg4); color: var(--text); border-color: var(--line2); }

body.modern .tiles { gap: 8px; }
body.modern .tile { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); min-height: 64px; }
body.modern .tile:hover { background: var(--bg4); border-color: var(--accent); box-shadow: none; }
body.modern .tile .big { filter: grayscale(1) brightness(1.15); font-size: 22px; }
body.modern .tile .nm { color: #c3c8d0; }
body.modern .media-item { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 5px; }
body.modern .media-item .th { border-radius: 6px; filter: grayscale(1); }

/* stage */
body.modern .stage-wrap { background: var(--bg0) radial-gradient(circle, #1a1c21 1px, transparent 1.2px) 0 0/22px 22px; box-shadow: none; }
body.modern #stage { box-shadow: 0 0 0 1px #24272e, 0 24px 60px rgba(0,0,0,.6); border-radius: 2px; }

/* transport */
body.modern .transport { background: var(--bg1); border-top: 1px solid var(--line); padding: 8px 12px; gap: 6px; color: var(--text); }
body.modern .pbtn { width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; color: var(--muted); box-shadow: none; }
body.modern .pbtn:hover { background: var(--bg4); color: var(--text); filter: none; }
body.modern .pbtn.play { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accentText); }
body.modern .pbtn.play:hover { background: var(--accent); filter: brightness(1.1); }
body.modern .pbtn.on { background: var(--bg4); color: var(--accent); }
body.modern .lcd { background: none; border: none; color: var(--text); text-shadow: none; font: 500 15px 'Cascadia Mono', Consolas, 'JetBrains Mono', monospace; letter-spacing: .02em; min-width: 140px; }
body.modern .lcd small { color: var(--muted); font-size: 12px; }
body.modern #vu { background: none; border: none; }
body.modern .transport .lbl { color: var(--muted); }

/* timeline */
body.modern .hsplit { height: 4px; background: var(--bg0); border-top: 1px solid var(--line); }
body.modern .hsplit:hover { background: var(--accent); }
body.modern .timeline { background: var(--bg1); }
body.modern .tl-tools { border-bottom: 1px solid var(--line); padding: 5px 10px; gap: 2px; color: var(--muted); }
body.modern #tlScroll { background: var(--tl); border: none; margin: 0; }
body.modern .tl-corner { background: var(--ruler1); border-color: var(--line); color: var(--muted); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; padding-left: 12px; }
body.modern #tlNames { background: var(--bg1); border-right: 1px solid var(--line); }
body.modern .trow { border-bottom: 1px solid var(--tlGrid); padding: 0 8px; color: #c8ccd3; }
body.modern .trow.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
body.modern .trow .tog { color: var(--muted); border: none; border-radius: 4px; width: 20px; height: 20px; }
body.modern .trow .tog:hover { background: var(--bg4); color: var(--text); }
body.modern .trow .ico { color: var(--muted); }
body.modern .trow.audio { background: none; }
body.modern .trow.audio.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); }
body.modern .trow.hdr { background: var(--bg0); color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
body.modern #tlPlayhead { background: var(--accent); box-shadow: none; }
body.modern #tlPlayhead::before { border-top-color: var(--accent); }

/* status bar */
body.modern .statusbar { height: 26px; background: var(--bg0); border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
body.modern .statusbar > div { border: none; margin: 0; padding: 5px 12px; }
body.modern .statusbar > div + div { border-left: 1px solid var(--line); }

/* dialogs */
body.modern #modalBg { background: rgba(0,0,0,.55); backdrop-filter: blur(4px); }
body.modern .xwin { background: var(--bg2); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
body.modern .xwin .titlebar { height: 44px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); background: var(--bg2); font-weight: 600; }
body.modern .xwin .titlebar .logo svg { width: 26px; height: 14px; }
body.modern .xwin .titlebar .wbtn.x { display: grid; background: none; border: none; box-shadow: none; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; font: 18px system-ui; }
body.modern .xwin .titlebar .wbtn.x:hover { background: var(--bg4); color: var(--text); filter: none; }
body.modern .xwin .body { padding: 18px; }
body.modern .xwin .foot { border-top: 1px solid var(--line); padding: 12px 16px; }
body.modern .xwin fieldset { border: 1px solid var(--line2); border-radius: 10px; }
body.modern .xwin legend { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
body.modern .progress { background: var(--bg0); border: 1px solid var(--line2); border-radius: 99px; height: 8px; padding: 0; }
body.modern .progress > div { background: var(--accent); border-radius: 99px; }
body.modern .splash { padding: 18px 10px 4px; }
body.modern .splash .big { display: none; }
body.modern .splash .mlogo { display: block; color: var(--text); margin: 6px auto 14px; }
body.modern .splash .mlogo svg { width: 200px; height: 108px; }
body.modern .splash .sub { color: var(--muted); font: 500 12px 'Segoe UI', system-ui; letter-spacing: .3em; text-transform: uppercase; }
body.modern .splash p { color: #b9bec7; line-height: 1.6; }
body.modern .toast { background: #1d2026; color: var(--text); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 14px 10px 34px; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
body.modern .toast::before { background: var(--accent); color: var(--accentText); font-family: system-ui; top: 10px; left: 11px; }
body.modern .piano { border-color: #000; border-radius: 6px; overflow: hidden; }
body.modern .piano .wk.on, body.modern .piano .bk.on { background: var(--accent); }
body.modern .ui-card { background: var(--bg3); }
body.modern .ui-card:hover { background: var(--bg4); }

/* export button icon spacing */
.export-btn { display: inline-flex; align-items: center; gap: 6px; }
body.retro .export-btn .svgi { display: none; }

/* keyboard shortcuts dialog */
.sc-grid { columns: 2; column-gap: 28px; }
.sc-grid > div { break-inside: avoid; margin-bottom: 6px; }
.sc-tab { border-collapse: collapse; width: 100%; }
.sc-tab td { padding: 3px 0; vertical-align: top; }
.sc-tab td:first-child { white-space: nowrap; padding-right: 14px; width: 1%; }
.kbd { font-family: inherit; }

/* easing graph editor */
.geditor { margin-top: 8px; }
.ge-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ge-seg { flex: 1; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--border, #7f9db9); border-radius: 6px; overflow: hidden; flex: none; }
.seg b { font-weight: 500; padding: 2px 8px; cursor: pointer; font-size: 10.5px; }
.seg b.on { background: var(--accent, #316ac5); color: var(--accentText, #fff); }
.ge-cv { width: 100%; height: 190px; display: block; border: 1px solid var(--border, #7f9db9); }
body.modern .ge-cv { border: 1px solid var(--line); border-radius: 8px; }
.ge-presets { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; margin: 6px 0; }
.ge-pre { display: grid; place-items: center; padding: 3px 0; border-radius: 5px; border: 1px solid transparent; cursor: pointer; color: var(--muted, #555); }
.ge-pre:hover { border-color: var(--border, #7f9db9); color: var(--text, #000); }
.ge-pre.on { border-color: var(--accent, #316ac5); color: var(--accent, #316ac5); }
body.retro .ge-pre { background: #fff; border-color: #c5d2ee; }
body.retro .ge-pre.on { background: #fff4c8; border-color: #f8b330; color: #000; }
.ge-bz { font-family: Consolas, 'Cascadia Mono', monospace; min-width: 0; }
.geditor.empty .ge-presets, .geditor.empty .ge-row, .geditor.empty .seg { opacity: .4; pointer-events: none; }

/* anchor presets */
.anchor-row .xbtn { display: inline-flex; align-items: center; gap: 4px; }
.anchor-row .xbtn.on { background: var(--accent, #316ac5); color: var(--accentText, #fff); }
.anchor-grid { display: grid; grid-template-columns: repeat(3, 14px); grid-template-rows: repeat(3, 14px); gap: 2px; padding: 3px; border: 1px solid var(--border, #7f9db9); border-radius: 5px; flex: none; }
.anchor-grid b { display: grid; place-items: center; cursor: pointer; border-radius: 3px; }
.anchor-grid b::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--muted, #888); opacity: .6; }
.anchor-grid b:hover { background: rgba(127,127,127,.2); }
.anchor-grid b.on::after { width: 8px; height: 8px; background: #ff3030; opacity: 1; }

/* timeline value graph */
.trow.graphrow { flex-direction: column; align-items: stretch; padding-top: 6px; gap: 6px; }
.trow.graphrow > span { display: none; }
.trow.graphrow::before { content: attr(data-name); }
.glegend { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; font-size: 10.5px; }
.gl { display: flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: 5px; cursor: pointer; opacity: .65; }
.gl:hover { opacity: 1; background: rgba(127,127,127,.15); }
.gl.on { opacity: 1; font-weight: 600; background: rgba(127,127,127,.18); }
.gl.off { opacity: .3; text-decoration: line-through; }
.gl i { width: 10px; height: 3px; border-radius: 2px; flex: none; }

/* project end marker (draggable) */
#tlEnd { position: absolute; top: 0; width: 0; border-left: 2px solid #ff3b3b; z-index: 6; pointer-events: none; }
#tlEnd .tlend-tab { position: absolute; top: 3px; right: 0; pointer-events: auto; cursor: ew-resize; background: #ff3b3b; color: #fff; font: 600 9.5px 'Segoe UI', Tahoma, sans-serif; letter-spacing: .04em;
  padding: 2px 6px 2px 7px; border-radius: 4px 0 0 4px; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.35); user-select: none; }
#tlEnd .tlend-tab::after { content: ''; position: absolute; right: -6px; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
#tlEnd .tlend-tab:hover { filter: brightness(1.12); }
body.retro #tlEnd .tlend-tab { font: bold 9px Tahoma; background: linear-gradient(#ff7a6a, #d81e0a); border: 1px solid #8a1000; border-right: none; }

/* aspect ratio */
.pbtn.ratio { width: auto; padding: 0 10px; gap: 7px; display: inline-flex; align-items: center; font: 600 11px 'Segoe UI', Tahoma, sans-serif; }
body.modern .pbtn.ratio { color: var(--text); border: 1px solid var(--line2); }
.ratio-ic { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; opacity: .55; flex: none; }
.ratio-ic.on { opacity: 1; }
.ratio-row { display: inline-flex; align-items: center; gap: 8px; }
.ratio-row .ratio-ic { margin: 0 3px; }
.ratio-row b { min-width: 34px; }
.ratio-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 4px 0 8px; }
.ratio-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 46px; border: 1px solid var(--border, #7f9db9); border-radius: 7px; cursor: pointer; font-size: 10.5px; }
.ratio-tile:hover { border-color: var(--accent, #316ac5); }
.ratio-tile.on { border-color: var(--accent, #316ac5); color: var(--accent, #316ac5); font-weight: 600; }
body.retro .ratio-tile { background: #fff; }
body.retro .ratio-tile.on { background: #fff4c8; border-color: #f8b330; color: #000; }

/* 3D type picker */
.t3-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 4px 0 2px; }
.t3-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0 4px; border: 1px solid var(--border, #7f9db9); border-radius: 7px; cursor: pointer; font-size: 10px; color: var(--muted, #555); }
.t3-tile:hover { border-color: var(--accent, #316ac5); color: var(--text, #000); }
.t3-tile.on { border-color: var(--accent, #316ac5); color: var(--accent, #316ac5); font-weight: 600; }
body.retro .t3-tile { background: #fff; }
body.retro .t3-tile.on { background: #fff4c8; border-color: #f8b330; color: #000; }

/* multi-selection */
.sel-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; max-height: 110px; overflow-y: auto; }
.chip { padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border, #7f9db9); font-size: 10.5px; cursor: pointer; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip:hover { border-color: var(--accent, #316ac5); }
.chip.on { border-color: var(--accent, #316ac5); color: var(--accent, #316ac5); font-weight: 600; }
body.retro .chip { background: #fff; }
.align-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin-bottom: 6px; }
.align-row .xbtn { padding: 3px 0; display: grid; place-items: center; min-height: 26px; }

/* drag & drop media */
.media-item.draggable { cursor: grab; }
.media-item.draggable:active { cursor: grabbing; }
.media-item.draggable .th { pointer-events: none; }
.trow.dropmedia { box-shadow: inset 0 0 0 2px var(--accent, #ff9900); }

/* 9 library tabs: two tidy rows */
body.modern .tabs { flex-wrap: wrap; row-gap: 2px; }
body.modern .tab { flex: 1 0 18%; font-size: 9.5px; padding: 5px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.retro .tab { flex: 1 0 18%; font-size: 10px; }

/* release: beta badge, welcome guide, autosave indicator */
.beta-badge { font: 700 9px 'Segoe UI', Tahoma, sans-serif; letter-spacing: .1em; padding: 2px 6px; border-radius: 99px; border: 1px solid currentColor; opacity: .75; flex: none; vertical-align: middle; }
body.retro .titlebar .beta-badge { color: #fff; }
.welcome .wl-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.welcome .wl-logo svg { width: 70px; height: 38px; display: block; }
.welcome .wl-title { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.welcome .wl-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.welcome .wl-card { border: 1px solid var(--border, #7f9db9); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.welcome .wl-card:hover { border-color: var(--accent, #316ac5); background: rgba(127,127,127,.08); }
.welcome .wl-card span { font-size: 11px; opacity: .7; }
.welcome .wl-tips { margin: 0 0 12px; padding-left: 18px; line-height: 1.6; }
body.retro .welcome .wl-card { background: #fff; }
#stSave { color: var(--muted, #555); }
