/* ============================================================
   Ker0 Protect вЂ” minimal UI
   Flat surfaces, hairline borders, one accent used sparingly.
   ============================================================ */

:root {
  --bg: #08090a;
  --surface: #0c0d0f;
  --surface-2: #101114;
  --surface-3: #15161a;
  --line: #191a1d;
  --line-2: #26282c;

  --text: #e7e8ea;
  --text-2: #8a8d93;
  --text-3: #5a5d63;

  /* single accent, used sparingly: active tab, checked box, focus ring */
  --accent: #9966ff;

  --ok: #3fb950;
  --danger: #f85149;

  --display: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;

  --r-sm: 5px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-full: 999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  --header-h: 56px;
}

*,
*:before,
*:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* the shell restores the real line height вЂ” body uses 0 so the whitespace
   between the scripts in index.html cannot create a stray line box */
.shell {
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #22242a;
  border: 3px solid var(--bg);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #2e3138;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.mono {
  font-family: var(--mono);
}

/* small mono label вЂ” the only "voice" this UI has */
.tick {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

/* the middle row is exactly "what is left" вЂ” panels size themselves inside it */
main,
.page,
.obf-page {
  min-height: 0;
}

/* the workbench is an app view: it fills the window, it does not scroll.
   The docs/changelog tabs are ordinary pages, so the lock only applies while
   the editor grid is on screen. */
.shell-obfuscator:has(.workbench-layout) {
  height: 100vh;
  overflow: hidden;
}

.wrap {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--s5);
}

/* the only container in the system: flat, 1px border, no glow */
.pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

/* ---------------- header ---------------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(8, 9, 10, 0.85);
  backdrop-filter: saturate(120%) blur(12px);
  -webkit-backdrop-filter: saturate(120%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.hdr-in {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-shrink: 0;
}

.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: var(--r-sm);
  object-fit: cover;
}

.brand-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s1);
  margin-left: auto;
  margin-right: auto;
  height: 100%;
}

.nav-item {
  position: relative;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  border-radius: var(--r-sm);
  transition: color 0.12s var(--ease-in-out);
}

.nav-item:hover {
  color: var(--text-2);
}

.nav-item.active {
  color: var(--text);
}

/* 1px marker under the active nav item, positioned by JS */
.nav-pill {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: left 0.18s var(--ease), width 0.18s var(--ease);
}

.lang-toggle {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: color 0.12s var(--ease-in-out), border-color 0.12s var(--ease-in-out);
}

.lang-toggle:hover {
  color: var(--text);
  border-color: var(--line-2);
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background 0.12s var(--ease-in-out), border-color 0.12s var(--ease-in-out),
    color 0.12s var(--ease-in-out), opacity 0.12s var(--ease-in-out);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn .fas {
  font-size: 12px;
}

/* primary = solid ink, like a real terminal app */
.btn-primary {
  background: var(--text);
  color: #08090a;
}

.btn-primary:hover:not(:disabled) {
  background: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--line-2);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: #33363c;
  background: var(--surface-2);
}

.btn-danger {
  color: var(--text-3);
  border-color: var(--line-2);
}

.btn-danger:hover:not(:disabled) {
  color: var(--danger);
  background: rgba(248, 81, 73, 0.08);
  border-color: rgba(248, 81, 73, 0.4);
}

.btn-sm,
.btn-small {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  gap: 6px;
  border-radius: var(--r-sm);
}

.btn-sm .fas,
.btn-small .fas {
  font-size: 11px;
}

.btn-success-glow,
.btn-danger-glow {
  height: 32px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 500;
}

.btn-success-glow {
  background: rgba(63, 185, 80, 0.1);
  color: var(--ok);
  border-color: rgba(63, 185, 80, 0.3);
}

.btn-success-glow:hover:not(:disabled) {
  background: rgba(63, 185, 80, 0.16);
}

.btn-danger-glow {
  background: rgba(248, 81, 73, 0.1);
  color: var(--danger);
  border-color: rgba(248, 81, 73, 0.3);
}

.btn-danger-glow:hover:not(:disabled) {
  background: rgba(248, 81, 73, 0.16);
}

.corner-cta {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}

/* ---------------- hero ---------------- */

.hero {
  padding: var(--s8) 0 var(--s7);
}

.hero-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-title {
  font-size: clamp(38px, 5.6vw, 60px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  max-width: 16ch;
}

.hero-title span {
  color: var(--text-3);
}

.hero-desc {
  margin-top: var(--s4);
  max-width: 54ch;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-2);
}

.hero-acts {
  margin-top: var(--s5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
}

/* stat line, not stat cards */
.hero-stats {
  margin-top: var(--s7);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: none;
  border: 0;
  border-radius: 0;
}

.stat b {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.stat span {
  font-size: 12.5px;
  color: var(--text-3);
}

.stat + .stat::before {
  content: "·";
  color: #3a3d43;
  margin-right: var(--s2);
}

/* ---------------- sections ---------------- */

.sec {
  padding: var(--s7) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.sec-tight {
  padding: var(--s7) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.sec-head {
  max-width: 620px;
  margin-bottom: var(--s5);
}

.sec-title {
  font-size: 24px;
  letter-spacing: -0.025em;
}

.sec-sub {
  margin-top: var(--s2);
  font-size: 14.5px;
  color: var(--text-2);
}

/* feature rows: hairlines, no cards */
.rows {
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 56px minmax(180px, 240px) 1fr;
  gap: var(--s4);
  align-items: baseline;
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--line);
}

.row-tick {
  color: var(--text-3);
}

.row-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.row-desc {
  font-size: 14px;
  color: var(--text-2);
  max-width: 62ch;
}

/* "why" grid: bordered cells, flat */
.slab {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
  overflow: hidden;
}

.slab-cell {
  padding: var(--s5);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.slab-cell:nth-child(-n + 3) {
  border-top: 0;
}

.slab-cell:nth-child(3n + 1) {
  border-left: 0;
}

.slab-icon {
  font-size: 15px;
  color: var(--text-3);
  margin-bottom: var(--s3);
}

.slab-title {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.slab-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
}

/* steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.step {
  background: var(--surface);
  border: 0;
  border-radius: 0;
  padding: var(--s5);
}

.step-num {
  color: var(--text-3);
  margin-bottom: var(--s3);
}

.step h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.step p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
}

/* ---------------- footer ---------------- */

.ftr {
  flex-shrink: 0;
  width: 100%;
  padding: var(--s4) 0;
  background: none;
  border-top: 1px solid var(--line);
}

.ftr-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

/* ---------------- page heads ---------------- */

.page {
  padding-bottom: var(--s7);
}

.obf-page {
  padding-top: var(--s4);
  padding-bottom: var(--s4);
  display: flex;
  flex-direction: column;
}

.obf-page > .wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.obf-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-bottom: var(--s5);
}

.obf-title {
  font-size: 26px;
  letter-spacing: -0.025em;
  margin-top: var(--s2);
}

.obf-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-2);
  max-width: 60ch;
}

/* segmented tabs */
.view-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.view-tab {
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  border-radius: var(--r-sm);
  transition: color 0.12s var(--ease-in-out), background 0.12s var(--ease-in-out);
}

.view-tab:hover {
  color: var(--text-2);
}

.view-tab.active {
  background: var(--surface-3);
  color: var(--text);
}

/* ---------------- workbench ---------------- */

/* editor on top, console strip below it, settings on the right */
.workbench-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: minmax(0, 1fr) 160px;
  grid-template-areas:
    "editor settings"
    "console settings";
  gap: var(--s3);
  align-items: stretch;
  flex: 1;
  min-height: 420px;
}

.wb-editor-main {
  grid-area: editor;
}

.wb-bottom {
  grid-area: console;
  display: flex;
  min-height: 0;
}

.wb-right-sidebar {
  grid-area: settings;
}

.settings-sidebar,
.editor-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* panels with a header strip */
.wb-console-card,
.wb-editor-card,
.wb-settings-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wb-console-card {
  flex: 1;
  min-height: 0;
  width: 100%;
}

.wb-console-tools {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  height: 38px;
  padding: 0 var(--s3);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.panel-title {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.panel-title .fas {
  font-size: 11px;
}

.wb-kbd-hint {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
}

/* console: full-width strip, one line per entry */
.wb-logs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--s2) 0;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.8;
}

.log-line {
  display: flex;
  gap: var(--s2);
  align-items: baseline;
  color: var(--text-2);
  padding: 0 var(--s3);
}

.log-line:hover {
  background: rgba(255, 255, 255, 0.02);
}

.log-time {
  color: var(--text-3);
  flex-shrink: 0;
}

.log-type {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.log-type.info {
  color: var(--text-3);
}

.log-type.success {
  color: var(--ok);
}

.log-type.error {
  color: var(--danger);
}

.log-line > span:last-child {
  word-break: break-word;
}

/* editor */
.wb-editor-card {
  flex: 1;
  min-height: 0;
}

.wb-card-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s3);
  height: 36px;
  padding: 0 var(--s2);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.wb-tab-group {
  display: flex;
  align-items: flex-end;
  height: 100%;
}

/* tabs look like file tabs: the active one is a sheet pulled out of the editor */
.wb-editor-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  height: 29px;
  margin-bottom: -1px;
  padding: 0 13px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: var(--text-3);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--r-md) var(--r-md) 0 0;
  transition: color 0.12s var(--ease-in-out), background 0.12s var(--ease-in-out);
}

.wb-editor-tab .fas {
  font-size: 10px;
  color: var(--text-3);
}

.wb-editor-tab:hover {
  color: var(--text-2);
  background: var(--surface-2);
}

.wb-editor-tab.active {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
}

.wb-editor-tab.active .fas {
  color: var(--text-2);
}

.wb-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.wb-editor-host {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--surface-2);
}

.editor-busy {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  background: rgba(8, 9, 10, 0.72);
  pointer-events: none;
}

.editor-busy .fas {
  font-size: 12px;
}

/* status bar, like a real editor */
.wb-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  height: 24px;
  padding: 0 var(--s3);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  flex-shrink: 0;
}

.wb-status-right {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.wb-status-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--line-2);
}

/* ace overrides */
.wb-editor-host .ace-tm,
.wb-editor-host .ace_gutter {
  background: var(--surface-2) !important;
  color: var(--text-2) !important;
}

.wb-editor-host .ace_gutter {
  color: var(--text-3) !important;
  border-right: 1px solid var(--line) !important;
}

.wb-editor-host .ace_cursor {
  color: var(--text) !important;
}

.wb-editor-host .ace_marker-layer .ace_active-line {
  background: rgba(255, 255, 255, 0.028) !important;
}

.wb-editor-host .ace_gutter-active-line {
  background: rgba(255, 255, 255, 0.028) !important;
}

.wb-editor-host .ace_comment {
  color: #55585e !important;
  font-style: normal !important;
}

/* settings */
.wb-settings-panel {
  height: 100%;
}

.wb-settings-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.setting-group + .setting-group {
  margin-top: var(--s4);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}

.setting-group-title {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

.setting-group-title .fas {
  font-size: 11px;
}

/* checkbox rows */
.custom-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 0;
  cursor: pointer;
}

.custom-checkbox-wrapper + .custom-checkbox-wrapper {
  border-top: 1px solid rgba(25, 26, 29, 0.6);
}

.custom-checkbox {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  display: grid;
  place-content: center;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.12s var(--ease-in-out), border-color 0.12s var(--ease-in-out);
}

.custom-checkbox:hover {
  border-color: #33363c;
}

.custom-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.custom-checkbox:checked::after {
  content: "";
  width: 7px;
  height: 3.5px;
  border-left: 1.5px solid #08090a;
  border-bottom: 1.5px solid #08090a;
  transform: rotate(-45deg) translate(0.5px, -1px);
}

.custom-checkbox-wrapper > span {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.setting-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.setting-desc {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-3);
}

.setting-name-block {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 6px;
}

.setting-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
}

/* The stack VM has no protection-level choice (it is always max), so its
   column fades out and the architecture column takes the whole width.
   The second track is collapsed to 0fr rather than dropped, otherwise the
   hidden item would wrap onto a new grid row instead of fading away. */
.setting-pair.is-single {
  grid-template-columns: 1fr 0fr;
  gap: 0;
}

/* NOTE: do NOT put overflow:hidden on the visible column. .custom-dropdown-menu
   is position:absolute with top:calc(100% + 4px), so it deliberately extends
   below its column - clipping the parent makes the menu open invisibly while
   the trigger still lights up. Only the collapsing column needs overflow. */
/* Not enough room below the trigger (the settings panel clips with
   overflow:hidden) - drop the menu upwards so every option stays reachable. */
.custom-dropdown.is-open-up .custom-dropdown-menu {
  top: auto;
  bottom: calc(100% + 4px);
  animation: dd-in-up 0.12s var(--ease);
}

.setting-pair > .setting-col {
  transition: opacity 0.28s ease, max-width 0.28s ease, transform 0.28s ease;
}

.setting-pair > .setting-col.is-hidden {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transform: translateX(-6px);
  pointer-events: none;
}

/* Users who prefer reduced motion get the same end state without the fade. */
@media (prefers-reduced-motion: reduce) {
  .setting-pair > .setting-col {
    transition: none;
  }
}

.setting-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.wb-action-area {
  padding: var(--s3);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.wb-obfuscate-btn {
  width: 100%;
  height: 38px;
  font-size: 13.5px;
}

/* ---------------- dropdown ---------------- */

.custom-dropdown {
  position: relative;
  width: 100%;
}

/* trigger: a quiet control, it only shows weight on hover/open */
.custom-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  width: 100%;
  height: 36px;
  padding: 0 10px 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  transition: border-color 0.12s var(--ease-in-out), background 0.12s var(--ease-in-out);
}

.custom-dropdown-trigger:hover {
  border-color: var(--line-2);
  background: var(--surface-3);
}

.custom-dropdown.is-open .custom-dropdown-trigger {
  border-color: var(--line-2);
  background: var(--surface-3);
}

.dd-selected-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dd-arrow-icon {
  font-size: 10px;
  color: var(--text-3);
  transition: transform 0.15s var(--ease);
  flex-shrink: 0;
}

.custom-dropdown.is-open .dd-arrow-icon {
  transform: rotate(180deg);
}

/* the menu is fixed-positioned on purpose: the settings panel and its scroll area
   both clip overflow, so an absolutely positioned menu would lose its lower half */
.custom-dropdown-menu {
  position: fixed;
  z-index: 200;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: dd-in 0.12s var(--ease);
}

@keyframes dd-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.custom-dropdown-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-md);
  text-align: left;
  transition: background 0.1s var(--ease-in-out);
}

.custom-dropdown-item:hover {
  background: var(--surface-3);
}

.dd-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dd-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.custom-dropdown-item.selected .dd-label {
  color: var(--text);
}

.dd-desc {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-3);
}

/* reserved space so labels never shift when the check appears */
.dd-check-icon {
  font-size: 10px;
  color: var(--text-3);
  opacity: 0;
  flex-shrink: 0;
  margin-top: 4px;
}

.custom-dropdown-item.selected .dd-check-icon {
  color: var(--text);
  opacity: 1;
}


/* ---------------- drag & drop ---------------- */

.drag-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(8, 9, 10, 0.9);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
}

.drag-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  color: var(--text-2);
}

/* ---------------- docs ---------------- */

.docs-tip {
  margin-bottom: var(--s4);
  padding: var(--s4) var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-lg);
}

.docs-tip-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s2);
}

.docs-tip-head .fas {
  font-size: 11px;
  color: var(--text-3);
}

.docs-tip-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.docs-tip-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 92ch;
}

.docs-tip-hint {
  margin-top: var(--s3);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.docs-tip-error {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--danger);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s3);
  margin: var(--s3) 0;
  overflow-x: auto;
  white-space: pre;
}

.docs-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s3);
  padding: 0;
  border: 0;
  background: none;
}

.doc-card {
  padding: var(--s4);
}

.doc-code {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.doc-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
  margin-bottom: var(--s3);
}

.code-block {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s3) 10px;
  /* the JS shrinks the font until a line fits; wrapping is only the last resort */
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow-x: hidden;
}

/* ---------------- changelog ---------------- */

.changelog-view {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: 0;
  border: 0;
  background: none;
}

.change-card {
  padding: var(--s5);
}

.change-card h2 {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: var(--s4);
}

.change-card h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--s2);
}

.change-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.change-card li {
  position: relative;
  padding-left: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
}

.change-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 1px;
  background: var(--line-2);
}

.change-card > div + div {
  margin-top: var(--s4);
}

.version-badge,
.date-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.date-badge {
  color: var(--text-3);
}

/* ---------------- profile ---------------- */

.profile-container {
  padding: var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  width: 100%;
  max-width: 880px;
  margin-inline: auto;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
  object-fit: cover;
}

.profile-avatar-ring {
  display: none;
}

.profile-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.profile-tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: var(--s2);
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}

.admin-badge .fas {
  font-size: 10px;
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.profile-field {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4);
  background: var(--surface);
}

.profile-field-icon {
  font-size: 13px;
  color: var(--text-3);
  flex-shrink: 0;
}

.profile-field-content {
  min-width: 0;
}

.profile-field-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.profile-field-value {
  font-size: 13.5px;
  color: var(--text);
  margin-top: 2px;
  word-break: break-all;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}

/* ---------------- maintenance panel ---------------- */

.admin-panel {
  border: 1px solid var(--line);
}

.maintenance-card {
  padding: 0;
  overflow: hidden;
}

.maintenance-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  padding: var(--s4);
  border-bottom: 1px solid var(--line);
}

.maintenance-header-title {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.maintenance-header-icon {
  font-size: 14px;
  color: var(--text-3);
}

.maintenance-header-title h3 {
  font-size: 14px;
  font-weight: 600;
}

.maintenance-header-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.maintenance-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  color: var(--text-2);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
}

.maintenance-status-badge.badge-active {
  color: var(--danger);
  border-color: rgba(248, 81, 73, 0.3);
}

.maintenance-status-badge.badge-active .status-dot {
  background: var(--danger);
}

.maintenance-status-badge.badge-inactive {
  color: var(--ok);
  border-color: rgba(63, 185, 80, 0.3);
}

.maintenance-status-badge.badge-inactive .status-dot {
  background: var(--ok);
}

.maintenance-card-body {
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.maintenance-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
}

.maintenance-banner.banner-active {
  border-color: rgba(248, 81, 73, 0.28);
}

.banner-status-title {
  font-size: 13.5px;
  font-weight: 500;
}

.banner-status-desc {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 2px;
  max-width: 52ch;
}

.maintenance-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-bottom: var(--s2);
}

.maintenance-field-label {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.quick-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: color 0.12s var(--ease-in-out), border-color 0.12s var(--ease-in-out);
}

.preset-chip:hover {
  color: var(--text);
  border-color: var(--line-2);
}

.preset-chip .fas {
  font-size: 10px;
}

.textarea-wrapper {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  overflow: hidden;
}

.maintenance-textarea {
  width: 100%;
  padding: var(--s3);
  background: transparent;
  border: 0;
  outline: none;
  resize: vertical;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
}

.maintenance-textarea::placeholder {
  color: var(--text-3);
}

.textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border-top: 1px solid var(--line);
}

.char-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

.char-warn {
  color: var(--danger);
}

.maintenance-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
}

.notice-icon {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  flex-shrink: 0;
}

.notice-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-3);
}

.notice-text strong {
  color: var(--text-2);
  font-weight: 600;
}

/* ---------------- misc ---------------- */

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: var(--s6);
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}

.empty-state .fas {
  font-size: 16px;
  margin-bottom: var(--s3);
  display: block;
}

/* entrance animations stay subtle вЂ” no sweeping, no bounce */
.sweep {
  animation: sweep-in 0.35s var(--ease) both;
}

@keyframes sweep-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (max-width: 1200px) {
  .workbench-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 980px) {
  /* stacked layout: the page scrolls normally again */
  .shell-obfuscator:has(.workbench-layout) {
    height: auto;
    overflow: visible;
  }

  .workbench-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "editor"
      "settings"
      "console";
  }

  .wb-console-card {
    flex: none;
    min-height: 180px;
  }

  .wb-logs {
    max-height: 180px;
  }

  .wb-editor-card {
    height: 62vh;
    min-height: 340px;
  }

  .wb-settings-panel {
    height: auto;
  }

  .wb-settings-content {
    overflow: visible;
  }

  .slab {
    grid-template-columns: 1fr;
  }

  .slab-cell,
  .slab-cell:nth-child(-n + 3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .slab-cell:first-child {
    border-top: 0;
  }

  .profile-details {
    grid-template-columns: 1fr;
  }

  .row {
    grid-template-columns: 40px 1fr;
  }

  .row-desc {
    grid-column: 2;
  }
}

@media (max-width: 720px) {
  .wrap {
    padding: 0 var(--s4);
  }

  .nav {
    display: none;
  }

  .hero {
    padding: var(--s7) 0 var(--s6);
  }

  .hero-stats {
    flex-direction: column;
    gap: 6px;
  }

  .stat + .stat::before {
    display: none;
  }

  .obf-head {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  /* keep the editor tab bar on one line: actions collapse to icons */
  .wb-card-actions .btn {
    font-size: 0;
    gap: 0;
    padding: 0 8px;
  }

  .wb-card-actions .btn .fas {
    font-size: 11px;
  }

  .wb-editor-tab {
    padding: 0 10px;
  }
}
