:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #e8ecf2;
  --text: #1b2330;
  --text-dim: #6b7789;
  --text-faint: #9aa5b4;
  --brand-a: #ff6b4a;
  --brand-b: #f0392b;
  --gold: #f5a524;
  --active-bg: #eaf2ff;
  --active-fg: #2f7ef5;
  --tile: #f2f5f9;
  --money: #16a34a;
  --danger-a: #f4544e;
  --danger-b: #e6332a;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sb-w: 248px;
}

:root[data-theme="dark"] {
  --bg: #0f141a;
  --panel: #161d26;
  --line: #28323f;
  --text: #e7edf3;
  --text-dim: #97a5b5;
  --text-faint: #63707e;
  --ink-a: #232a33;
  --ink-b: #14181e;
  --gold: #f5b544;
  --active-bg: #17293f;
  --active-fg: #5aa2ff;
  --tile: #1c2530;
  --money: #2ec07a;
  --danger-a: #f4544e;
  --danger-b: #ff6f68;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

.sidebar {
  width: var(--sb-w);
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 14px 12px 16px;
}

.sb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  margin: 0 2px 16px;
  border-radius: 12px;
  background: transparent;
  transition: transform .15s;
}

.sb-head:hover { transform: translateY(-1px); }

.logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-text { line-height: 1.1; }

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
}

.brand-tld { color: var(--gold); }

.brand-sub {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 2px;
}

.search {
  position: relative;
  margin: 0 2px 18px;
}

.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--tile);
  border-radius: 9px;
  padding: 8px 12px 8px 33px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, background .15s;
}

.search input::placeholder { color: var(--text-faint); }
.search input:focus { background: var(--panel); border-color: #c9d8f2; }

.sb-tools {
  display: flex;
  gap: 8px;
  margin: 0 2px 18px;
}

.sb-tools button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--tile);
  color: var(--text-dim);
  border-radius: 9px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}

.sb-tools button:hover { color: var(--text); border-color: #c9d8f2; }
.sb-tools button svg { width: 15px; height: 15px; }
.sb-tools .flag { font-size: 14px; line-height: 1; }

.sb-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .11em;
  color: var(--text-faint);
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 8px;
}

.nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 8px;
  border-radius: 10px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .14s, color .14s;
}

.nav a:hover { background: var(--tile); }

.nav .ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--tile);
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: background .14s;
}

.nav a.active { background: var(--active-bg); color: var(--active-fg); font-weight: 600; }
.nav a.active .ico { background: var(--panel); }

.socials { display: flex; gap: 7px; padding: 0 6px; margin-bottom: 20px; }

.socials a {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: border-color .14s, color .14s, transform .14s;
}

.socials a:hover { border-color: #cfd8e3; color: var(--text); transform: translateY(-1px); }
.socials svg { width: 15px; height: 15px; }

.user-card {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.user-top { display: flex; align-items: center; gap: 10px; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(140deg, #4a9bff, #2f6fe0);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.sb-login {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border: none; border-radius: 10px;
  background: var(--active-fg); color: #fff;
  font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  transition: filter .14s;
}
.sb-login:hover { filter: brightness(1.06); }
.sb-login svg { width: 16px; height: 16px; }

.user-meta { flex: 1; min-width: 0; }
.user-logout {
  margin-left: auto; flex-shrink: 0;
  width: 32px; height: 32px; border: 1px solid var(--line); background: transparent;
  border-radius: 8px; color: var(--text-faint); cursor: pointer;
  display: grid; place-items: center;
  transition: background .14s, color .14s, border-color .14s;
}
.user-logout:hover { background: color-mix(in srgb, var(--danger-a) 12%, transparent); color: var(--danger-b); border-color: var(--danger-a); }
.user-logout svg { width: 16px; height: 16px; }

.user-name { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.user-role { font-size: 10px; font-weight: 600; letter-spacing: .08em; color: var(--text-faint); }

.divider { height: 1px; background: var(--line); margin: 11px 0 9px; }

.bal-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .09em;
  color: var(--text-faint);
  margin-bottom: 2px;
}

.bal { font-size: 15px; font-weight: 700; color: var(--money); }

.sb-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background .14s, border-color .14s;
}

.sb-btn:hover { background: var(--tile); border-color: #d6dde6; }

.logout {
  margin-top: 2px;
  border: none;
  background: linear-gradient(140deg, var(--danger-a), var(--danger-b));
  color: #fff;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-size: 12px;
  padding: 11px;
  box-shadow: 0 3px 10px rgba(230, 51, 42, .28);
}

.logout:hover { filter: brightness(1.05); background: linear-gradient(140deg, var(--danger-a), var(--danger-b)); }

.spacer { flex: 1; min-height: 12px; }

.content { flex: 1; min-width: 0; padding: 32px 36px; }
.content h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.content p { color: var(--text-dim); font-size: 14px; }

.content { max-width: 780px; }
.content-wide { max-width: 1060px; }

.tbx-app { display: flex; gap: 18px; align-items: flex-start; }

.tbx-fixed { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.tbx-fixed .topbar { flex-shrink: 0; }
.tbx-fixed .tool-head { flex-shrink: 0; }
.tbx-fixed .tbx-app { flex: 1; min-height: 0; align-items: stretch; }
.tbx-fixed .tbx-nav { position: static; top: auto; max-height: none; height: 100%; }
.tbx-fixed .tbx-work { overflow-y: auto; min-height: 0; padding-right: 2px; }

.tbx-nav {
  width: 186px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 4px;
}

.tbx-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  transition: background .13s, color .13s;
}
.tbx-nav a:hover { background: var(--tile); color: var(--text); }
.tbx-nav a.active { background: var(--active-bg); color: var(--active-fg); font-weight: 600; }

.tbx-work { flex: 1; min-width: 0; }

.tbx-tool {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.tbx-card-head h3 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.tbx-card-head p { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }

.tbx-tool textarea { resize: vertical; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; line-height: 1.6; }
.tt-in { min-height: 120px; }
.tt-out { min-height: 120px; background: var(--tile); }

.tbx-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tbx-btns .btn { padding: 7px 13px; font-size: 12.5px; }

.tt-inl { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.tt-inl input { width: 88px; padding: 7px 9px; font-size: 13px; }
.tt-inl input[type="number"] { width: 66px; }

.tbx-out-wrap { display: flex; flex-direction: column; gap: 7px; }
.tbx-out-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 20px; }
.tbx-count { font-size: 12px; color: var(--text-faint); font-weight: 500; }

.tbx-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); font-weight: 500; cursor: pointer; }
.tbx-chk input { width: 15px; height: 15px; accent-color: var(--active-fg); cursor: pointer; }

.tbx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tbx-two textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; line-height: 1.6; }

.np-page { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.np-page .topbar { flex-shrink: 0; }
.np-page .tool-head { flex-shrink: 0; }

.np-app { flex: 1; min-height: 0; display: flex; gap: 16px; }

.np-list { width: 234px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.np-new { justify-content: center; }
.np-items { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }

.np-item { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 11px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; background: var(--panel); transition: background .13s, border-color .13s; }
.np-item:hover { background: var(--tile); }
.np-item.active { border-color: var(--active-fg); background: var(--active-bg); }
.np-item-main { flex: 1; min-width: 0; }
.np-item-del { flex-shrink: 0; width: 28px; height: 28px; border: none; background: transparent; border-radius: 7px; color: var(--text-faint); cursor: pointer; display: grid; place-items: center; opacity: .55; transition: background .13s, color .13s, opacity .13s; }
.np-item-del:hover { background: color-mix(in srgb, var(--danger-a) 15%, transparent); color: var(--danger-b); opacity: 1; }
.np-item-del svg { width: 15px; height: 15px; }
.np-item-t { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-item-p { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.np-empty { font-size: 13px; color: var(--text-faint); padding: 14px; text-align: center; }

.np-editor { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.np-editor .np-title-in { font-size: 16.5px; font-weight: 650; border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 4px 2px 8px; background: transparent; }
.np-editor .np-title-in:focus { box-shadow: none; border-bottom-color: var(--active-fg); }
.np-editor .np-body { flex: 1; min-height: 0; resize: none; border: none; padding: 4px 2px; font-family: var(--sans); font-size: 14px; line-height: 1.7; background: transparent; }
.np-editor .np-body:focus { box-shadow: none; }

.np-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.np-stat { font-size: 12.5px; color: var(--text-faint); font-weight: 500; }
.np-actions { display: flex; align-items: center; gap: 8px; }
.np-actions .btn { padding: 7px 12px; font-size: 12.5px; }
.np-saved { font-size: 12px; color: var(--money); font-weight: 600; min-width: 60px; text-align: right; }
.np-del:hover { border-color: var(--danger-a); color: var(--danger-b); }

.btn.np-share-btn { background: var(--active-fg); border-color: var(--active-fg); color: #fff; }
.btn.np-share-btn:hover:not(:disabled) { filter: brightness(1.06); background: var(--active-fg); border-color: var(--active-fg); }

.np-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 4px;
  background: var(--active-bg); border: 1px solid var(--active-fg); border-radius: 10px;
  font-size: 13px; color: var(--active-fg); font-weight: 500;
}

.np-share {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--tile);
}
.np-share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.np-share-hint { font-size: 12px; color: var(--text-dim); font-weight: 500; }

.np-modes { display: inline-flex; gap: 2px; padding: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; flex-shrink: 0; }
.np-mode { border: none; background: transparent; color: var(--text-dim); font-family: inherit; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.np-mode:hover { color: var(--text); }
.np-mode.active { background: var(--active-bg); color: var(--active-fg); }
.np-editor .np-link {
  flex: 1; min-width: 180px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
  padding: 8px 10px; background: var(--panel);
}

@media (max-width: 760px) {
  .np-app { flex-direction: column; }
  .np-list { width: 100%; }
  .np-items { max-height: 150px; }
}

.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 12, 20, .55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; width: 100%; max-width: 380px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.modal-msg { font-size: 14.5px; color: var(--text); line-height: 1.5; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn.np-del-btn { background: var(--danger-a); border-color: var(--danger-a); color: #fff; }
.btn.np-del-btn:hover:not(:disabled) { filter: brightness(1.05); background: var(--danger-a); border-color: var(--danger-a); }

.tbx-pomo { align-items: center; text-align: center; }
.pomo-phase { font-size: 13px; font-weight: 600; color: var(--active-fg); text-transform: uppercase; letter-spacing: .08em; }
.pomo-time { font-family: ui-monospace, Consolas, monospace; font-size: 64px; font-weight: 700; letter-spacing: .02em; line-height: 1.1; }

@media (max-width: 760px) {
  .tbx-app { flex-direction: column; }
  .tbx-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    position: static;
    max-height: none;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
  }
}

.topbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.topbar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  transition: background .14s, color .14s, border-color .14s, transform .14s;
}

.topbar a:hover { color: var(--text); border-color: #cfd8e3; transform: translateY(-1px); }
.topbar a.active { background: var(--active-bg); color: var(--active-fg); border-color: transparent; }
.topbar .tb-ico { font-size: 15px; line-height: 1; }

.tool-head { margin-bottom: 22px; }
.tool-head h1 { margin-bottom: 6px; }
.tool-head p { max-width: 620px; line-height: 1.6; }
.tool-head code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}

.hidden { display: none !important; }

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
}

.tab {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .14s, color .14s;
}

.tab:hover { color: var(--text); }
.tab.active { background: var(--panel); color: var(--active-fg); box-shadow: 0 1px 3px rgba(20, 30, 45, .07); }

textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  padding: 11px 12px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  outline: none;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}

textarea:focus { border-color: var(--active-fg); box-shadow: 0 0 0 3px rgba(47, 126, 245, .12); }
textarea::placeholder { color: var(--text-faint); }

.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.bulk-count { font-size: 13px; font-weight: 600; color: var(--text-dim); }

.rows { margin-top: 10px; }

.row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
}

.row-item:last-child { border-bottom: none; }

.row-meta { min-width: 0; flex: 1; }

.row-name {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-name.raw {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: .02em;
}

.row-item.bad .row-name { color: var(--text-faint); }
.row-err { font-size: 12px; color: var(--danger-b); margin-top: 2px; }

.row-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.row-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--text);
  user-select: all;
}

.row-code.bad, .row-item.bad .row-code {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-faint);
  user-select: none;
}

.row-code.pending {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--active-fg);
  user-select: none;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.row-secs {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-faint);
  min-width: 26px;
  text-align: right;
}

.btn.icon-only { padding: 7px; }
.btn.icon-only svg { width: 14px; height: 14px; }

.status {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-faint);
  white-space: nowrap;
}

.run-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 18px;
  flex-wrap: wrap;
}

.btn.run {
  background: var(--active-fg);
  border-color: var(--active-fg);
  color: #fff;
  padding: 10px 20px;
}
.btn.run:hover:not(:disabled) { filter: brightness(1.06); background: var(--active-fg); border-color: var(--active-fg); }

.progress { font-size: 13px; color: var(--text-dim); font-weight: 500; }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.result-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.result-box.live { border-color: color-mix(in srgb, var(--money) 45%, var(--line)); }
.result-box.die { border-color: color-mix(in srgb, var(--danger-a) 40%, var(--line)); }

.result-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.result-title { font-size: 13.5px; font-weight: 700; }
.result-box.live .result-title { color: var(--money); }
.result-box.die .result-title { color: var(--danger-b); }

.result-count {
  font-size: 12px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
  padding: 1px 8px;
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--tile);
}
.result-box.live .result-count { color: var(--money); background: rgba(22, 163, 74, .1); }
.result-box.die .result-count { color: var(--danger-b); background: rgba(230, 51, 42, .09); }

.result-head .btn { margin-left: auto; }
.btn.copy-live:hover:not(:disabled) { border-color: var(--money); color: var(--money); }
.btn.copy-die:hover:not(:disabled) { border-color: var(--danger-a); color: var(--danger-b); }

.result-out {
  border: none;
  border-radius: 0;
  min-height: 230px;
  resize: vertical;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}
.result-out:focus { box-shadow: none; }
.result-box.live .result-out { background: rgba(22, 163, 74, .04); }
.result-box.die .result-out { background: rgba(230, 51, 42, .035); }

@media (max-width: 620px) {
  .result-grid { grid-template-columns: 1fr; }
  .result-out { min-height: 170px; }
}

.status.live { color: var(--money); border-color: var(--money); background: rgba(22, 163, 74, .08); }
.status.die { color: var(--danger-b); border-color: var(--danger-a); background: rgba(230, 51, 42, .07); }
.status.pending { color: var(--active-fg); border-color: #c9d8f2; }
.status.error, .status.unknown { color: var(--text-faint); }

label.field { display: block; margin-bottom: 18px; }
label.field:last-child { margin-bottom: 0; }

label.field > span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 7px;
}

input[type="text"], select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input[type="text"]:focus, select:focus {
  border-color: var(--active-fg);
  box-shadow: 0 0 0 3px rgba(47, 126, 245, .12);
}

select { cursor: pointer; }

.hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.code-out {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 18px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text);
  user-select: all;
  line-height: 1.2;
}

.code.idle { color: var(--text-faint); font-weight: 500; }
.code.err { color: var(--danger-b); font-size: 14px; letter-spacing: 0; font-weight: 500; user-select: none; }

.countdown { display: flex; align-items: center; gap: 12px; }

.ring { width: 40px; height: 40px; transform: rotate(-90deg); flex-shrink: 0; }
.ring circle { fill: none; stroke-width: 3.5; }
.ring .track { stroke: var(--line); }
.ring .bar { stroke: var(--active-fg); stroke-linecap: round; transition: stroke-dashoffset .9s linear, stroke .3s; }
.ring.low .bar { stroke: var(--danger-a); }
.ring.idle .bar { stroke: transparent; transition: none; }

.secs {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text-dim);
  min-width: 28px;
}

.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .14s, border-color .14s, color .14s;
}

.btn:hover:not(:disabled) { background: var(--tile); border-color: #cfd8e3; }
.btn svg { width: 15px; height: 15px; }
.btn.copied { color: var(--money); border-color: var(--money); }
.btn:disabled { opacity: .45; cursor: default; }

.adv { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }

.adv summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  user-select: none;
}

.adv summary::-webkit-details-marker { display: none; }
.adv summary:hover { color: var(--text); }
.adv summary svg { width: 14px; height: 14px; transition: transform .18s; }
.adv[open] summary svg { transform: rotate(90deg); }

.adv-body {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.adv-body label.field { margin-bottom: 0; }

.note {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--money);
  background: var(--panel);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.note svg { width: 17px; height: 17px; color: var(--money); flex-shrink: 0; margin-top: 2px; }
.note strong { color: var(--text); font-weight: 600; }

@media (max-width: 560px) {
  .code { font-size: 28px; }
  .code-out { justify-content: center; }
}

.sb-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 30;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}

@media (max-width: 820px) {
  .sb-toggle { display: grid; place-items: center; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 25;
    padding-top: 62px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, .12);
  }
  .sidebar.open { transform: none; }
  .content { padding: 68px 20px 24px; }
}

@media (max-width: 640px) {
  body { overflow-x: hidden; }

  .content { padding: 58px 14px 20px; }
  .tool-head { margin-bottom: 16px; }
  .tool-head h1, .content h1, .hero h1 { font-size: 20px; }
  .tool-head p, .content p, .hero p { font-size: 13px; line-height: 1.55; }

  .topbar { flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin-bottom: 16px; padding-bottom: 12px; }
  .topbar a { flex-shrink: 0; padding: 8px 11px; font-size: 12.5px; }
  .topbar .tb-ico { font-size: 14px; }

  .panel { padding: 15px; }
  .code { font-size: 24px; letter-spacing: .03em; }
  .adv-body { grid-template-columns: 1fr 1fr; gap: 12px; }
  .code-out, .bulk-bar, .run-row { gap: 12px; }

  .grid { grid-template-columns: 1fr; }

  .tbx-fixed, .np-page { height: auto; overflow: visible; }
  .tbx-fixed .tbx-app { flex-direction: column; }
  .tbx-fixed .tbx-nav { flex-direction: row; width: 100%; height: auto; max-height: none; overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; margin-bottom: 4px; }
  .tbx-fixed .tbx-nav a { flex-shrink: 0; white-space: nowrap; }
  .tbx-fixed .tbx-work { overflow: visible; height: auto; }
  .np-editor { min-height: 340px; }
  .np-editor .np-body { min-height: 240px; }
  .result-out { min-height: 150px; }
}
