:root {
  --bg: #0d0f13;
  --bg-2: #12151b;
  --panel: #151920;
  --surface: #1b2029;
  --surface-2: #222833;
  --line: #262c37;
  --line-2: #313847;
  --text: #e8ebf1;
  --muted: #8c94a5;
  --faint: #5d6575;
  --accent: #5b8cff;
  --accent-2: #8fb0ff;
  --accent-soft: rgba(91, 140, 255, .14);
  --ink: #0b1020;
  --good: #4fd1a1;
  --warn: #f2b84b;
  --bad: #ff7a7a;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px rgba(0, 0, 0, .35);
  color-scheme: dark;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-width: 1040px;
  overflow: hidden;
}
body.is-dash { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .4; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: #343b49 transparent; }
[hidden] { display: none !important; }

/* Üst ve alt çubuk */
.top, .bottom {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.top {
  position: relative; z-index: 10;
  min-height: 58px;
  padding: 0 20px;
  background: linear-gradient(180deg, #171c25 0%, #12161d 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .035) inset;
}
.bottom { border-bottom: 0; border-top: 1px solid var(--line); justify-content: space-between; padding: 8px 18px; }
.brand { display: flex; gap: 12px; align-items: center; width: 232px; min-width: 232px; cursor: pointer; }
.brand strong { display: block; font-size: 15px; font-weight: 650; letter-spacing: .01em; }
.brand em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.top-mid { flex: 1; min-width: 0; display: flex; align-items: center; }
.top-acts { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.helpbtn {
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  padding: 6px 12px !important;
}
.crumb {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px;
}
.crumb span { color: var(--faint); }
.crumb b { color: var(--text); font-weight: 650; }
.dash-only { display: none !important; }
body.is-dash .dash-only { display: flex !important; }
body.is-dash .dash-hide { display: none !important; }
.profwrap { position: relative; }
.accountchip {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}
button.accountchip { font: inherit; color: inherit; }
.accountchip:hover { border-color: var(--line-2); }
.who-wrap { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.who-meta { color: var(--faint); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.profmenu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 8;
  min-width: 220px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 8px 8px; box-shadow: var(--shadow);
}
.profmenu.up { top: auto; bottom: calc(100% + 8px); left: 10px; right: 10px; min-width: 0; }
.profmenu-name { margin: 0 8px 2px; font-size: 13px; font-weight: 650; }
.profmenu-line {
  margin: 0 8px; color: var(--muted); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profmenu-line:last-of-type { margin-bottom: 8px; }
.profmenu button {
  width: 100%; text-align: left; background: transparent; border: 0; border-radius: 7px;
  padding: 8px 10px; margin-top: 4px;
}
.profmenu button:hover { background: var(--accent-soft); }
.mark {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 8px 7px;
  background: linear-gradient(160deg, #6f9bff, #3d63d6);
  box-shadow: 0 6px 18px rgba(91, 140, 255, .35);
}
.mark i { display: block; width: 3px; border-radius: 2px; background: rgba(255, 255, 255, .92); }
.mark i:nth-child(1) { height: 40%; }
.mark i:nth-child(2) { height: 85%; }
.mark i:nth-child(3) { height: 60%; }
.mark i:nth-child(4) { height: 100%; }
.mark.lg { width: 52px; height: 52px; border-radius: 14px; gap: 4px; padding: 12px 10px; }
.mark.sm { width: 28px; height: 28px; border-radius: 8px; gap: 2px; padding: 6px 5px; }
.avatar {
  flex: 0 0 auto;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-2);
  font-size: 12px; font-weight: 700;
}
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.avatar[hidden] { display: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
.userbox { position: relative; display: flex; align-items: center; gap: 8px; }
.userbox .who { color: var(--text); font-size: 12.5px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-dash #btnProjects { display: none; }
.projmenu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 6;
  min-width: 220px; max-height: 280px; overflow: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 6px; box-shadow: var(--shadow);
}
.projmenu button {
  width: 100%; text-align: left; background: transparent; border: 0; border-radius: 7px;
  padding: 8px 10px;
}
.projmenu button:hover:not(:disabled) { background: var(--accent-soft); border: 0; }
body.is-auth .crumb { display: none !important; }

/* Düğmeler */
button, .primary, .ghost, .tiny {
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, border-color .12s, color .12s;
}
button:hover:not(:disabled) { background: var(--surface-2); border-color: #3d4556; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.primary:hover:not(:disabled) { background: #6d99ff; border-color: #6d99ff; }
.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.ghost:hover:not(:disabled) { color: var(--text); background: var(--surface); border-color: var(--line-2); }
.tiny { padding: 5px 10px; font-size: 12px; }
.danger { color: var(--bad); }
.danger:hover:not(:disabled) { color: var(--bad); border-color: rgba(255, 122, 122, .4); background: rgba(255, 122, 122, .08); }

/* Ana yerleşim */
main {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}
.pane, .rail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pane-top { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px 12px; }
.pane-top > div:first-child { min-width: 0; flex: 1; }
.kicker {
  margin: 0 0 6px; color: var(--faint);
  font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.target-head { display: flex; align-items: center; gap: 8px; }
.organ-mark {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 4px;
  background: #d0122d;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .04em;
  line-height: 1.2;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset;
}
h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub {
  margin: 3px 0 0; color: var(--faint); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pane-actions, .foot-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }

.organbtn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: transparent; border: 0; border-radius: 7px; padding: 7px 4px;
  color: var(--muted); font-weight: 600; font-size: 12.5px;
}
.organbtn small { font-size: 10px; font-weight: 550; color: var(--faint); }
.organbtn:hover:not(:disabled) { background: var(--surface); border: 0; color: var(--text); }
.organbtn.on { background: var(--accent); color: #fff; }
.organbtn.on small { color: rgba(255,255,255,.8); }
.organbtn:disabled { opacity: .45; }

/* Sekmeler: bölümlü seçici */
.tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
  margin: 0 16px; padding: 3px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
}
.tab {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
  background: transparent; border: 0; border-radius: 7px; padding: 7px 6px;
  color: var(--muted);
}
.tab:hover:not(:disabled) { background: var(--surface); border: 0; }
.tab b { font-weight: 550; color: inherit; display: flex; gap: 6px; align-items: baseline; }
.tab small { display: none; }
.tab .count {
  font-size: 11px; font-weight: 600; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.tab.on { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.tab.on .count { color: var(--accent-2); }

.source-pick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.source-pick[hidden] { display: none; }
.srcchip {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 4px 12px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
}
.srcchip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); font-weight: 600; }

.searchline { display: flex; gap: 8px; padding: 10px 16px; }
.searchline .tiny { flex: 0 0 auto; white-space: nowrap; }
.searchline input { flex: 1; }
.field input, .field select, .pathline input, .searchline input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  outline: none;
}
.searchline input:focus, .field input:focus, .field select:focus, .pathline input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.searchline input::placeholder { color: var(--faint); }
.list { flex: 1; overflow: auto; min-height: 0; }
.pane-foot {
  border-top: 1px solid var(--line); color: var(--faint);
  font-size: 11.5px; padding: 9px 16px; min-height: 36px;
}
#targetFoot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  color: var(--muted);
}
#targetFoot b { color: var(--text); font-weight: 650; }
#targetFoot .sum { margin-left: auto; color: var(--text); }
.empty { color: var(--muted); padding: 28px 18px; }
.empty button { margin: 6px 6px 0 0; }

/* Org görünümü */
.organ {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  min-height: 340px;
  padding: 2px 16px 14px;
}
.bankcol { display: flex; flex-direction: column; gap: 2px; overflow: auto; min-height: 0; }
.bankbtn {
  flex: 0 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  padding: 7px 10px; font-size: 12.5px; color: var(--muted);
}
.bankbtn small { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.bankbtn:hover:not(:disabled) { background: var(--surface); border-color: transparent; color: var(--text); }
.bankbtn.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.bankbtn.on small { color: var(--accent-2); }
.bankbtn.ghost { color: var(--faint); border: 1px dashed var(--line-2); }
.bankbtn.addbank { color: var(--accent-2); border: 1px dashed rgba(91, 140, 255, .45); }
.bankbtn.addbank:disabled { opacity: .4; cursor: default; }
.bankbtn input {
  width: 100%; min-width: 0; border: 0; padding: 0; margin: 0;
  background: transparent; color: inherit; font: inherit;
}
.bankbtn.ghost.on { color: var(--accent-2); border-color: rgba(91, 140, 255, .5); }

.desk {
  min-width: 0; min-height: 0;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.deskhead { display: flex; align-items: center; gap: 10px; }
.pagebank { font-size: 14px; font-weight: 650; }
.modelbadge {
  font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px;
}
.modelbadge:empty { display: none; }
.pagestat { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pagestat i { font-style: normal; color: var(--faint); }

.keys {
  flex: 0 0 auto;
  display: grid;
  align-content: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 6px;
}
.keys.five { gap: 6px; }
.keys.five .key {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 7px 8px;
  min-height: 0;
}
.keys.five .key b { font-size: 12px; -webkit-line-clamp: 3; }
.key {
  position: relative;
  min-height: 48px;
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}
.key:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-2); }
.key.playing {
  border-color: #d0122d;
  box-shadow: 0 0 0 1px #d0122d inset;
}
.key.playing .num { background: #d0122d; color: #fff; }
@keyframes playpulse {
  from { opacity: 1; }
  to { opacity: .45; }
}
.key.playing b { animation: playpulse .9s ease-in-out infinite alternate; }
#btnPlay.on { border-color: #d0122d; color: #fff; background: #d0122d; }
.hint.soon { opacity: .45; margin-top: 8px; }
.key .num {
  flex: 0 0 auto;
  min-width: 26px; height: 22px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.key b {
  flex: 1; min-width: 0;
  font-size: 13.5px; font-weight: 600; letter-spacing: .015em;
  line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
}
.key .meta {
  position: absolute; right: 10px; bottom: 5px;
  font-size: 10px; color: var(--faint);
}
.key.lit {
  background: linear-gradient(180deg, rgba(91, 140, 255, .2), rgba(91, 140, 255, .1));
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.key.lit .num { background: var(--accent); color: #fff; }
.key.empty { background: transparent; border: 1px dashed transparent; pointer-events: none; }
.key.vacant { background: transparent; border: 1px dashed var(--line-2); }
.key.vacant b { color: var(--faint); font-weight: 450; font-size: 12.5px; letter-spacing: 0; }
.key.vacant .num { background: transparent; color: var(--faint); }
.keyedit {
  flex: 1; min-width: 0; width: 100%;
  background: var(--bg); border: 1px solid var(--accent); border-radius: 6px;
  padding: 3px 6px; font-size: 13px; font-weight: 600; color: var(--text);
}
.key[draggable="true"] { cursor: grab; }
body.dragging .key[draggable="true"] { cursor: grabbing; }
.key.drop, .key.vacant.drop {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, .25);
}
.key.drop .num { background: var(--accent); color: #fff; }
#targetList.droptarget .desk { border-color: rgba(91, 140, 255, .55); box-shadow: 0 0 0 3px rgba(91, 140, 255, .12); }

.pages { display: grid; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.pages button {
  min-width: 0; height: 26px; padding: 0;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums;
}
.pages button:hover:not(:disabled) { background: var(--surface); border: 0; color: var(--text); }
.pages button.bare { color: var(--faint); opacity: .6; }
.pages button.on { background: var(--accent); color: #fff; opacity: 1; }
.desknote { color: var(--faint); font-size: 11.5px; margin: auto 0 0; }

/* Orta panel */
.rail { padding: 0; overflow: auto; }
.rail-block { padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }
.rail-block:last-child { border-bottom: 0; }
.rail-block > button { width: 100%; margin-top: 6px; }
.rail-block > button:first-of-type { margin-top: 0; }
.primary.big { padding: 11px 12px; font-size: 14px; border-radius: 9px; }
.switch {
  display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start;
  padding: 8px 0; cursor: pointer;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  position: relative; width: 34px; height: 20px; margin-top: 1px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2);
  transition: background .15s, border-color .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: #c5cbd6;
  transition: transform .15s, background .15s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch .label { font-size: 12.5px; color: var(--text); line-height: 1.3; }
.switch .label small { display: block; color: var(--faint); font-size: 11px; margin-top: 2px; }
.hint { color: var(--muted); font-size: 11.5px; margin: 10px 0 0; }
.warn {
  color: var(--warn); font-size: 11.5px; margin: 8px 0 0;
  background: rgba(242, 184, 75, .08); border: 1px solid rgba(242, 184, 75, .25);
  border-radius: 8px; padding: 8px 10px;
}

/* İşlem geçmişi ve durum */
.logwrap { height: 96px; display: flex; flex-direction: column; border-top: 1px solid var(--line); background: var(--bg-2); }
.loghead { color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; padding: 8px 18px 0; }
#log { list-style: none; margin: 0; padding: 4px 18px 8px; overflow: auto; }
#log li { color: var(--muted); font-size: 12px; padding: 2px 0; }
#log time { color: var(--faint); font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; margin-right: 10px; }
#statusPath { margin: 0; color: var(--faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#toast {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  padding: 10px 16px; border-radius: 10px; max-width: 64ch;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); z-index: 5;
}

/* Pencereler */
dialog { border: 0; padding: 0; background: transparent; color: inherit; z-index: 30; }
dialog::backdrop { background: rgba(5, 7, 10, .65); backdrop-filter: blur(2px); }
.dlg {
  width: min(720px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.dlg header, .dlg footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 16px; }
.dlg header { border-bottom: 1px solid var(--line); }
.dlg footer { border-top: 1px solid var(--line); }
.dlg h3 { margin: 0; font-size: 15px; font-weight: 650; }
.help ol { margin: 0; padding: 10px 28px 18px 38px; color: var(--muted); }
.help li { margin: 9px 0; }
.field { display: block; padding: 12px 16px 0; color: var(--muted); font-size: 12px; }
.field input, .field select { margin-top: 6px; }
.inline { display: flex; gap: 8px; }
.pathline { display: flex; gap: 8px; padding: 12px 16px; }
.drives { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 10px; }
.browser { max-height: 360px; overflow: auto; border-top: 1px solid var(--line); }
.brow {
  width: 100%; text-align: left; background: transparent; border: 0;
  border-bottom: 1px solid var(--line); border-radius: 0;
  display: flex; justify-content: space-between; padding: 9px 16px;
}
.brow:hover:not(:disabled) { background: var(--surface); border: 0; border-bottom: 1px solid var(--line); }
.brow span:last-child { color: var(--faint); font-size: 12px; }
.brow.set span:first-child { color: var(--accent-2); font-weight: 550; }
#browseNote { margin: 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg .hint { padding: 0 16px; }

body.is-busy { cursor: progress; }
body.is-stload { cursor: progress; }

.stload {
  position: fixed; inset: 0; z-index: 24;
  display: grid; place-items: center;
  background: rgba(8, 10, 14, .72);
  backdrop-filter: blur(8px);
}
.stload[hidden] { display: none; }
.stload-card {
  width: min(360px, calc(100vw - 40px));
  text-align: center;
  padding: 36px 28px 28px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .55);
}
.stload-card .mark { margin: 0 auto 16px; }
.stload-card h2 { margin: 6px 0 18px; font-size: 22px; white-space: normal; }
.stload-bar {
  height: 4px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.stload-bar i {
  display: block; height: 100%; width: 36%;
  background: linear-gradient(90deg, #3d63d6, #8fb0ff);
  border-radius: inherit;
  animation: stload 1.6s ease-in-out infinite;
}
#studioLoadText { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.stload-pctbar {
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.stload-pctbar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #3d63d6, #8fb0ff);
  border-radius: inherit;
}
#packPct {
  margin: 16px 0 0;
  font-size: 28px; font-weight: 650; letter-spacing: -.03em;
}
#packLoadText { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
@keyframes stload {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(380%); }
}

body.is-gate main, body.is-gate .logwrap, body.is-gate .bottom,
body.is-auth main, body.is-auth .logwrap, body.is-auth .bottom,
body.is-auth .top { visibility: hidden; }
body.is-dash main, body.is-dash .logwrap, body.is-dash .bottom { display: none; }
body.is-auth .dash, body.is-auth .studio-only { display: none !important; }
body.is-dash .studio-only { display: none !important; }

.authshell {
  position: fixed; inset: 0; z-index: 12;
  display: grid; place-items: center;
  padding: 32px;
  background:
    radial-gradient(900px 420px at 12% 0%, rgba(91, 140, 255, .16), transparent 55%),
    radial-gradient(700px 380px at 90% 110%, rgba(61, 99, 214, .12), transparent 50%),
    var(--bg);
}
.authshell[hidden] { display: none; }
.auth-split {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .5);
}
.auth-side {
  padding: 44px 40px;
  background: linear-gradient(165deg, #1a2744 0%, #121820 70%);
  border-right: 1px solid var(--line);
}
.auth-side h1 { margin: 10px 0 12px; font-size: 30px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.auth-side .lead { margin: 0 0 28px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.auth-points { margin: 0; padding: 0; list-style: none; color: var(--text); font-size: 13px; }
.auth-points li { padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .06); color: var(--muted); }
.auth-panel { padding: 44px 40px 36px; }
.auth-panel h2 { margin: 6px 0 8px; font-size: 24px; font-weight: 650; }
.auth-panel .sub { margin: 0; color: var(--muted); }
.authform { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.authform .field { padding: 0; color: var(--muted); font-size: 12px; }
.authform input {
  margin-top: 7px;
  width: 100%;
  padding: 11px 12px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 10px;
}
.authform .hint { padding: 0; margin: 0; }
.auth-acts { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.auth-acts .primary { min-width: 120px; padding: 10px 16px; }

.dash {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  background: var(--bg);
}
.dash[hidden] { display: none !important; }
.dash-side {
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}
.dash-nav { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; flex: 1; }
.dash-navbtn {
  width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent;
  border-radius: 9px; padding: 10px 12px;
  color: var(--muted); font-weight: 550;
}
.dash-navbtn:hover:not(:disabled) { background: var(--surface); border-color: transparent; color: var(--text); }
.dash-navbtn.on { background: var(--accent-soft); color: var(--accent-2); }
.dash-navbtn:disabled { opacity: .38; }
.dash-account {
  position: relative;
  padding: 10px 10px 12px;
  border-top: 1px solid var(--line);
}
.dash-account-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent;
  border-radius: 10px; padding: 6px 8px;
}
.dash-account-btn:hover { background: var(--surface); }
.dash-account b { display: block; font-size: 13px; font-weight: 650; }
.dash-account small { display: block; color: var(--faint); font-size: 11px; margin-top: 2px; }
.dash-main {
  min-width: 0; min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 22px 28px 24px;
  background:
    radial-gradient(720px 280px at 100% -20%, rgba(91, 140, 255, .1), transparent 50%),
    var(--bg);
}
.dash-pagebox {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dash-pagebox[hidden] { display: none !important; }
.dash-page, .dash-kpis, .dash-session, .dash-board, .dash-jump, .zip-ready {
  width: 100%;
}
.dash-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px 18px;
  box-shadow: var(--shadow);
}
.dash-jump {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
  flex: 0 0 auto;
}
.jump {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  min-height: 108px;
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.jump .kicker { margin-bottom: 8px; }
.jump b { display: block; font-size: 16px; margin-bottom: 4px; letter-spacing: -.01em; }
.jump small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.jump:hover:not(:disabled) { border-color: var(--accent); background: var(--surface); }
.dash-home-board {
  flex: 1;
  min-height: 160px;
  margin-top: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
}
.dash-empty {
  min-height: 160px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 24px;
}
.dash-empty h3 { margin: 4px 0 6px; font-size: 18px; font-weight: 650; }
.dash-empty .sub { margin: 0; color: var(--muted); max-width: 420px; }
.dash-sheet .kpi { background: var(--bg-2); }
.zip-ready {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: nowrap;
  margin-bottom: 16px;
  padding: 16px 18px;
  background: #18233a;
  border: 1px solid #3a568f;
  border-radius: 14px;
}
.zip-ready[hidden] { display: none; }
.zip-ready > div { min-width: 0; flex: 1; }
.zip-ready h3 { margin: 2px 0 4px; font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zip-ready .sub { white-space: normal; color: #b7c6e6; }
.zip-ready .primary {
  flex: 0 0 auto;
  padding: 10px 16px;
  text-decoration: none;
  white-space: nowrap;
}
.dash-page {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  margin-bottom: 18px;
  flex: 0 0 auto;
}
.dash-page h2 { font-size: 26px; margin: 4px 0 6px; letter-spacing: -.02em; white-space: normal; }
.dash-page .sub { color: var(--muted); font-size: 13px; white-space: normal; }
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
  flex: 0 0 auto;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}
.kpi .kicker { margin-bottom: 8px; }
.kpi b { display: block; font-size: 24px; line-height: 1.1; letter-spacing: -.02em; }
.kpi b.kpi-text { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi span { display: block; margin-top: 6px; color: var(--faint); font-size: 11.5px; }
.dash-session {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
  background: #18233a;
  border: 1px solid #3a568f;
  border-radius: 14px;
}
.dash-session[hidden] { display: none; }
.dash-session h3 { margin: 2px 0 4px; font-size: 16px; font-weight: 650; }
.dash-session .sub { white-space: normal; color: #b7c6e6; }
.dash-session-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-session, .zip-ready { flex: 0 0 auto; }
.dash-profile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
  align-items: start;
}
.profform {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 22px 20px;
  box-shadow: var(--shadow);
}
.profform h3 { margin: 2px 0 4px; font-size: 18px; font-weight: 650; }
.profform .field { padding: 0; }
.profform input {
  margin-top: 7px;
  width: 100%;
  padding: 11px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.profform .primary { align-self: flex-start; margin-top: 6px; }
.dash-board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dash-board-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.dash-titleline { display: flex; align-items: center; gap: 8px; }
.dash-board-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.dash-board-head .sub { margin: 4px 0 0; white-space: normal; }
.countpill {
  min-width: 22px; height: 20px; padding: 0 7px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-2);
  font-size: 11px; font-weight: 700;
}
.dash-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg {
  display: flex; gap: 2px; padding: 3px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
}
.seg button {
  border: 0; background: transparent; border-radius: 8px;
  padding: 6px 11px; color: var(--muted); font-size: 12px; font-weight: 600;
}
.seg button:hover:not(:disabled) { background: var(--surface); border: 0; color: var(--text); }
.seg button.on { background: var(--surface-2); color: var(--text); }
.dash-search { min-width: 200px; }
.dash-search input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  outline: none;
}
.dash-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.projtable { padding: 8px 10px 12px; flex: 1; min-height: 0; overflow: auto; }
.projthead, .projrow {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 72px 120px 56px;
  gap: 12px;
  align-items: center;
}
.projthead {
  padding: 8px 12px;
  color: var(--faint);
  font-size: 10.5px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase;
}
.projrow {
  width: 100%;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 6px;
}
.projrow:hover:not(:disabled) { background: var(--surface); border-color: var(--line-2); }
.projico {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800; letter-spacing: .04em;
  color: var(--accent-2);
  background: var(--accent-soft);
}
.projico.set { color: #9ad7b8; background: rgba(79, 209, 161, .14); }
.projrow b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projrow small { display: block; margin-top: 3px; color: var(--faint); font-size: 11.5px; }
.projrow .muted { color: var(--faint); font-size: 12px; }
.projrow .badge {
  justify-self: start;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--accent-2);
  background: var(--accent-soft);
  border-radius: 999px; padding: 4px 8px;
}
.projrow .badge.set { color: #9ad7b8; background: rgba(79, 209, 161, .12); }
.gostep {
  justify-self: end;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px; font-weight: 650;
}
.projrow:hover .gostep { background: #6d99ff; }
.projthead.ziphead, .projrow.ziprow {
  grid-template-columns: 40px minmax(0, 1fr) 70px 70px 110px 84px;
}
.projrow.ziprow .gostep {
  justify-self: end;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--accent-2);
}
.projrow.ziprow:hover .gostep { background: var(--accent); color: #fff; }
a.projrow.ziprow { text-decoration: none; color: inherit; }
.projrow.ziprow.fresh { border-color: #3a568f; background: #18233a; }
.dashempty {
  color: var(--muted);
  padding: 36px 20px;
  text-align: center;
}
.dashempty b { display: block; color: var(--text); font-size: 14px; margin-bottom: 6px; }
.gate {
  position: fixed; inset: 0; z-index: 8;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 20%, #182033 0%, var(--bg) 62%);
  padding: 24px;
}
.gate[hidden] { display: none; }
.gatecard {
  width: min(720px, 100%);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 28px 28px 22px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .5);
}
.gatecard h2 { font-size: 22px; margin-bottom: 6px; white-space: normal; }
.gatecard .sub { white-space: normal; font-size: 13px; color: var(--muted); }
.gateorgans {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px;
  margin: 22px 0 8px;
}
.gateorgans[hidden], .gatesources[hidden] { display: none !important; }
.gateorgans .organbtn {
  background: var(--bg-2); border: 1px solid var(--line); padding: 16px 8px;
  font-size: 14px;
}
.gateorgans .organbtn:hover:not(:disabled) { border-color: var(--line-2); }
.gateorgans .organbtn.on { background: var(--accent); border-color: var(--accent); }
.gatesources { display: flex; flex-direction: column; gap: 8px; margin: 22px 0 8px; }
.gateset {
  width: 100%; text-align: left;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px;
}
.gateset b { display: block; font-size: 14px; }
.gateset small { color: var(--faint); font-size: 11.5px; }
.gateempty { color: var(--muted); padding: 8px 0; }
.gateacts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.ctx {
  position: fixed; z-index: 9; min-width: 248px; max-width: 320px;
  padding: 6px;
  background: #1a1f28;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
}
.ctx[hidden] { display: none; }
.ctxhead {
  margin: 0; padding: 7px 10px 8px;
  color: var(--faint); font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.ctx button {
  width: 100%; text-align: left;
  background: transparent; border: 0; border-radius: 7px;
  padding: 8px 10px; font-size: 13px; color: var(--text);
}
.ctx button:hover:not(:disabled) { background: var(--accent-soft); border: 0; color: var(--accent-2); }
.ctx button.danger { color: var(--bad); }
.ctx button.danger:hover:not(:disabled) { background: rgba(255, 122, 122, .1); border: 0; }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 5px 6px; }

.props {
  width: min(880px, calc(100vw - 40px));
  background:
    radial-gradient(520px 140px at 0 0, rgba(91, 140, 255, .14), transparent 60%),
    var(--panel);
}
.props-head { align-items: flex-start; padding: 18px 20px 6px; border-bottom: 0; }
.props-head .kicker { margin: 0 0 3px; letter-spacing: .14em; font-size: 10px; text-transform: uppercase; }
.props-head h3 { font-size: 20px; letter-spacing: -.02em; }
.props-head .ghost { margin-top: 2px; }
.props-meta { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 20px 14px; }
.props-meta span {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 76px; padding: 8px 12px;
  background: rgba(13, 15, 19, .45);
  border: 1px solid var(--line); border-radius: 10px;
}
.props-meta small { color: var(--faint); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.props-meta b { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.props-nav { display: flex; flex-direction: column; gap: 10px; padding: 0 20px 14px; }
.props-groups {
  display: inline-flex; gap: 2px; width: fit-content; padding: 3px;
  background: rgba(13, 15, 19, .55); border: 1px solid var(--line); border-radius: 11px;
}
.props-groups button {
  border: 0; background: transparent; border-radius: 8px;
  padding: 6px 12px; color: var(--muted); font-size: 12px;
}
.props-groups button:hover:not(:disabled):not(.on) { background: transparent; border: 0; color: var(--text); }
.props-groups button.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.props-groups button:disabled { opacity: .35; }
.props-vars { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; }
.props-vars button {
  border-radius: 999px; padding: 5px 12px; font-size: 12px;
  background: transparent; border-color: var(--line); color: var(--muted);
}
.props-vars button:hover:not(:disabled):not(.on) { color: var(--text); background: var(--surface); }
.props-vars button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.props-scroll { max-height: min(440px, calc(100vh - 280px)); overflow: auto; border-top: 1px solid var(--line); }
.props-table { width: 100%; border-collapse: collapse; }
.props-table th, .props-table td {
  text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.props-table th {
  position: sticky; top: 0; z-index: 1;
  background: #141922; color: var(--faint);
  font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
}
.props-table tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.props-table tr.is-user td:first-child { box-shadow: inset 2px 0 0 var(--good); }
.props-role { width: 72px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .04em; }
.props-sound { display: flex; align-items: center; gap: 8px; min-width: 0; }
.props-sound b { font-weight: 620; letter-spacing: -.01em; }
.props-code { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 12px; color: var(--muted); }
.props-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 12px;
}
.props-key, .props-empty { color: var(--muted); }
.badge {
  display: inline-block; flex: none; padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.badge.user { color: #d7ffe9; background: rgba(79, 209, 161, .16); }
.badge.factory { color: #d5e2ff; background: rgba(91, 140, 255, .16); }

body.is-place #targetList .key { cursor: copy; }
body.is-place #targetList .key.vacant { border-color: var(--accent); }
body.is-clip #targetList .key.vacant { border-color: var(--accent); cursor: copy; }
#targetList .key.clip { box-shadow: 0 0 0 1px var(--accent) inset; }
