@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ══ tokens ═════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0b0c0e;
  --bg-side: #0e0f12;
  --surface: #131418;
  --surface-2: #18191e;
  --surface-3: #1f2127;
  --line: rgba(255, 255, 255, 0.065);
  --line-strong: rgba(255, 255, 255, 0.11);

  --text: #ececf1;
  --text-2: #a5a8b2;
  --text-3: #7a7e89;

  --accent: #84ec2c;
  --accent-strong: #a2f45e;
  --accent-soft: rgba(132, 236, 44, 0.12);
  --accent-line: rgba(132, 236, 44, 0.3);
  --accent-ink: #0c1a03;
  --warn: #e8b85e;
  --warn-soft: rgba(232, 184, 94, 0.12);
  --bad: #f07272;
  --bad-soft: rgba(240, 114, 114, 0.12);
  --info: #6fa9ff;
  --info-soft: rgba(111, 169, 255, 0.12);

  --r-sm: 7px;
  --r: 10px;
  --r-lg: 14px;

  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);

  --font: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --t-fast: 120ms;
  --t-med: 200ms;
  --t-slow: 320ms;

  /* Mantine "light" variant: a tinted wash of the color, text in a lighter shade */
  --gray-light: rgba(134, 142, 150, 0.15);
  --gray-light-hover: rgba(134, 142, 150, 0.22);
  --gray-light-color: #d0d3da;
  --green-light: rgba(132, 236, 44, 0.13);
  --green-light-hover: rgba(132, 236, 44, 0.2);
  --green-light-color: #a6f26a;
  --red-light: rgba(250, 82, 82, 0.15);
  --red-light-hover: rgba(250, 82, 82, 0.22);
  --red-light-color: #ff8787;
  --disabled-bg: #24262b;
  --disabled-color: #5f636c;

  --titlebar: 44px;
  --side-w: 236px;
  --hist-w: 0px;

  /* glass layers over the full-window banner */
  --glass-side: rgba(10, 11, 14, 0.5);
  --glass-panel: rgba(18, 19, 23, 0.78);
  --glass-deep: rgba(10, 11, 13, 0.7);
  --blur: blur(12px) saturate(1.15);
}

/* ══ base ═══════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}

/* Text fields are the one place selection must work: you edit in them. */
input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* No focus outlines anywhere. Keyboard focus still shows: controls take their
   hover look on :focus-visible, and fields brighten their border on focus. */
*:focus,
*:focus-visible {
  outline: none;
}

.num {
  font-variant-numeric: tabular-nums;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ico {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ══ shell ══════════════════════════════════════════════════════════════════ */

.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  grid-template-rows: var(--titlebar) minmax(0, 1fr);
  grid-template-areas:
    'title title'
    'side main';
  height: 100vh;
  height: 100dvh;
  transition: opacity 380ms var(--ease-out);
}

/* hidden while the window grows from launcher size; fades in once it lands */
.app.entering {
  opacity: 0;
  pointer-events: none;
}

/* Ambient light behind the whole window, every column glass over it. The image
   is the banner pre-blurred until no text or icon is legible: what remains is
   its neon glow, which reads as mood instead of competing with the UI. It sits
   on a fixed layer outside the grid so it never affects layout. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 9, 11, 0.5), rgba(8, 9, 11, 0.72)),
    radial-gradient(110% 90% at 50% 45%, rgba(8, 9, 11, 0.15), rgba(8, 9, 11, 0.65)),
    url('/assets/backdrop.jpg') center / cover no-repeat;
  /* Center the glow on the work column, not the window: the side columns
     differ in width, so the window's middle sits off to one side. */
  background-position: center, center, calc(50% + (var(--side-w) - var(--hist-w)) / 2) center;
  pointer-events: none;
}

.titlebar {
  grid-area: title;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--glass-side);
  backdrop-filter: var(--blur);
}

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

.brand-logo {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 7px;
  filter: drop-shadow(0 0 8px rgba(132, 236, 44, 0.3));
}

.brand-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-version {
  padding: 1px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 10.5px;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding-right: 8px;
}

/* Titlebar controls: quiet at rest, Mantine-light on hover. Close turns red
   light rather than the OS's solid red block, so it matches every other button. */
.tb-btn,
.win-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 28px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease-out);
}

.tb-btn {
  display: none;
}

.tb-btn:hover,
.tb-btn:focus-visible,
.tb-btn[aria-expanded='true'],
.win-btn:hover,
.win-btn:focus-visible {
  background: var(--gray-light);
  color: var(--gray-light-color);
}

.win-btn.close:hover,
.win-btn.close:focus-visible {
  background: var(--red-light);
  color: var(--red-light-color);
}

.tb-btn:active,
.win-btn:active {
  transform: translateY(1px);
}

.winctl {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 6px;
  border-left: 1px solid var(--line);
}

.win-btn .ico,
.tb-btn .ico {
  width: 15px;
  height: 15px;
  stroke-width: 1.75;
}

/* ══ sidebar ════════════════════════════════════════════════════════════════ */

.sidebar {
  grid-area: side;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--glass-side);
  backdrop-filter: var(--blur);
}

.side-scroll {
  flex: 1;
  min-height: 0;
  padding: 10px 12px;
  overflow-y: auto;
}

.side-label {
  padding: 18px 10px 8px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-label:first-child {
  padding-top: 8px;
}

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

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.nav-item::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  transform: translateY(-50%) scaleY(0);
  transition: transform var(--t-med) var(--ease-out);
}

.nav-item .ico {
  transition: color var(--t-fast) var(--ease);
}

.nav-item:hover,
.nav-item:focus-visible {
  background: var(--gray-light);
  color: var(--text);
}

/* Mantine NavLink, light variant: the active entry wears the primary wash */
.nav-item.active {
  background: var(--green-light);
  color: var(--green-light-color);
}

.nav-item.active::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-item.active .ico {
  color: var(--accent);
}

.nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--info);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease-spring);
}

.nav-item.busy .nav-dot {
  opacity: 1;
  transform: scale(1);
  animation: pulse 1.4s ease-in-out infinite;
}

.nav-item.admin-nav .ico {
  color: var(--warn);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 10px 12px 12px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.user-open {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
  transition: background var(--t-fast) var(--ease);
}

.user-open:hover,
.user-open:focus-visible {
  background: var(--surface-3);
}

.user-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-3);
  object-fit: cover;
}

.user-meta {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

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

.user-role {
  color: var(--text-3);
  font-size: 11px;
}

.user-role.admin {
  color: var(--warn);
}

/* ══ shared controls ════════════════════════════════════════════════════════ */

/* ── buttons: Mantine "light" variant ─────────────────────────────────────────
   Every button is a tinted wash of its color with text in a lighter shade of
   it: gray by default, green for the action a page exists for, red for
   destructive ones. Hover deepens the wash, press nudges down a pixel, and
   disabled is a flat neutral — never a faded copy of the color. */

.btn,
.icon-btn {
  --b-bg: var(--gray-light);
  --b-bg-hover: var(--gray-light-hover);
  --b-color: var(--gray-light-color);
}

.btn.primary,
.btn.accent,
.icon-btn.done {
  --b-bg: var(--green-light);
  --b-bg-hover: var(--green-light-hover);
  --b-color: var(--green-light-color);
}

.btn.danger,
.btn.danger-outline,
.icon-btn.danger.armed {
  --b-bg: var(--red-light);
  --b-bg-hover: var(--red-light-hover);
  --b-color: var(--red-light-color);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--b-bg);
  color: var(--b-color);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease-out);
}

.btn:hover:not(:disabled),
.btn:focus-visible:not(:disabled) {
  background: var(--b-bg-hover);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  background: var(--disabled-bg);
  color: var(--disabled-color);
  cursor: not-allowed;
}

.btn .ico {
  width: 15px;
  height: 15px;
}

.btn.sm {
  height: 28px;
  padding: 0 11px;
  font-size: 12px;
}

.btn.lg {
  height: 40px;
  padding: 0 22px;
  font-size: 13.5px;
}

/* ghost reads as the same light button, just secondary in size and weight */
.btn.ghost {
  font-weight: 500;
}

.btn.primary .ico {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* icon buttons: same light wash, quieter at rest so rows of them stay calm */
.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease-out);
}

.icon-btn:hover:not(:disabled),
.icon-btn:focus-visible:not(:disabled),
.icon-btn.done,
.icon-btn.armed {
  background: var(--b-bg);
  color: var(--b-color);
}

.icon-btn.danger:hover:not(:disabled),
.icon-btn.danger:focus-visible:not(:disabled) {
  background: var(--red-light);
  color: var(--red-light-color);
}

.icon-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-btn .ico {
  width: 15px;
  height: 15px;
}

.input,
textarea,
.select-trigger {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(8, 9, 11, 0.6);
  color: var(--text);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.input {
  height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
}

.input.mono {
  font-family: var(--mono);
  font-size: 12px;
}

textarea {
  display: block;
  min-height: 64px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  resize: none;
  word-break: break-all;
}

.input::placeholder,
textarea::placeholder {
  color: var(--text-3);
  font-family: var(--font);
}

.input:hover:not(:disabled),
textarea:hover:not(:disabled),
.select-trigger:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.18);
}

/* focus = brighter border only; no rings, no outlines */
.input:focus,
textarea:focus,
.select-trigger:focus-visible,
.select.open .select-trigger {
  border-color: var(--accent);
}

/* ── select (custom listbox) ──────────────────────────────────────────────── */

.select {
  position: relative;
  min-width: 0;
}

.select-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 12px;
  font-size: 12.5px;
  text-align: left;
}

.select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  transition: transform var(--t-med) var(--ease-out);
}

.select.open .select-chevron {
  transform: rotate(180deg);
}

.select.disabled .select-trigger {
  background: var(--disabled-bg);
  color: var(--disabled-color);
  cursor: not-allowed;
}

.select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 280px;
  min-width: 100%;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: rgba(22, 23, 28, 0.97);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow-lg);
  transform-origin: top center;
  animation: menuIn 160ms var(--ease-out) both;
}

.select.drop-up .select-menu {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom center;
}

.select-group {
  padding: 8px 8px 4px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
}

.select-option-label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.select-option.active {
  background: var(--gray-light);
  color: var(--text);
}

.select-option[aria-selected='true'] {
  color: var(--green-light-color);
}

.select-option[aria-selected='true'].active {
  background: var(--green-light);
}

.select-option .ico {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

/* Whatever holds an open menu must paint above its later siblings. Rows and
   panels each animate in, which gives every one its own stacking context, so
   without this the next row would draw over the menu. */
.panel:has(.select.open),
.access-row:has(.select.open),
.field:has(.select.open) {
  position: relative;
  z-index: 5;
}

/* ── checkbox (custom, light) ─────────────────────────────────────────────── */

input[type='checkbox'] {
  display: grid;
  place-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(8, 9, 11, 0.6);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

input[type='checkbox']::before {
  content: '';
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border-bottom: 2px solid var(--green-light-color);
  border-left: 2px solid var(--green-light-color);
  transform: rotate(-45deg) scale(0);
  transition: transform var(--t-med) var(--ease-spring);
}

input[type='checkbox']:hover:not(:disabled),
input[type='checkbox']:focus-visible {
  border-color: rgba(255, 255, 255, 0.22);
}

input[type='checkbox']:checked {
  border-color: var(--accent-line);
  background: var(--green-light-hover);
}

input[type='checkbox']:checked::before {
  transform: rotate(-45deg) scale(1);
}

input[type='checkbox']:disabled {
  background: var(--disabled-bg);
  cursor: not-allowed;
}

.hint {
  color: var(--text-3);
  font-size: 12px;
}

.note {
  padding: 12px;
  color: var(--text-3);
  font-size: 12px;
}

.note.error {
  color: var(--bad);
}

/* ══ main / page ════════════════════════════════════════════════════════════ */

.main {
  grid-area: main;
  min-height: 0;
  overflow-y: auto;
  background: transparent;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px 36px 26px;
}

/* a tool page: the form on the left, what this tool did today and how it
   works on the right — so the width the history column gave back is used */
.page-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  align-items: start;
  gap: 16px;
}

.page-aside {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.aside-card {
  padding: 13px 14px;
}

.aside-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.aside-head h3 {
  font-size: 13px;
  font-weight: 600;
}

.recent {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 -6px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background var(--t-fast) var(--ease);
}

.recent-item:hover,
.recent-item:focus-visible {
  background: var(--surface);
}

.recent-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.recent-name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-meta {
  color: var(--text-3);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.recent-item .pill {
  height: 20px;
  padding: 0 8px;
  font-size: 10.5px;
}

.recent-empty {
  padding: 4px 6px 2px;
  color: var(--text-3);
  font-size: 12px;
}

.how {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: how;
}

.how li {
  position: relative;
  padding-left: 28px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
  counter-increment: how;
}

.how li::before {
  content: counter(how);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
}

.page.page-enter > * {
  animation: riseIn var(--t-slow) var(--ease-out) both;
}

.page.page-enter > :nth-child(2) { animation-delay: 40ms; }
.page.page-enter > :nth-child(3) { animation-delay: 80ms; }
.page.page-enter > :nth-child(4) { animation-delay: 120ms; }
.page.page-enter > :nth-child(5) { animation-delay: 160ms; }

.page-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px solid var(--accent-line);
  border-radius: 11px;
  background: linear-gradient(150deg, rgba(132, 236, 44, 0.18), rgba(132, 236, 44, 0.04));
  color: var(--accent);
}

.page-icon .ico {
  width: 20px;
  height: 20px;
  stroke-width: 1.6;
}

.page-titles {
  flex: 1;
  min-width: 0;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.page-tag {
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.page-desc {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 12.5px;
}

.panel {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--glass-panel);
  backdrop-filter: var(--blur);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* setup: one card, sections divided by hairlines */
.setup-section {
  padding: 13px 16px 14px;
}

.setup-section + .setup-section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: 13px;
  font-weight: 600;
}

/* view swap: setup → process slides forward, back slides the other way */
.view-forward {
  animation: viewForward var(--t-slow) var(--ease-out) both;
}

.view-back {
  animation: viewBack var(--t-slow) var(--ease-out) both;
}

.step {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
}

.panel-hint {
  margin-left: auto;
  color: var(--text-3);
  font-size: 12px;
}

/* ── dropzone ─────────────────────────────────────────────────────────────── */

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r);
  background: radial-gradient(120% 140% at 50% 0%, rgba(255, 255, 255, 0.025), transparent 60%), var(--bg);
  cursor: pointer;
  transition: border-color var(--t-med) var(--ease), background-color var(--t-med) var(--ease),
    box-shadow var(--t-med) var(--ease);
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: rgba(255, 255, 255, 0.2);
}

.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.dropzone.ready,
.dropzone.busy {
  border-style: solid;
  border-color: var(--line);
  background: var(--surface-2);
  cursor: default;
  box-shadow: none;
}

.dz-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 34px 20px 30px;
  text-align: center;
}

.dz-text {
  min-width: 0;
}

.dz-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  transition: transform var(--t-med) var(--ease-spring), color var(--t-med) var(--ease),
    background var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}

.dz-icon .ico {
  width: 22px;
  height: 22px;
}

.dropzone:hover .dz-icon {
  color: var(--text);
  transform: translateY(-2px);
}

.dropzone.dragging .dz-icon {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-3px) scale(1.06);
}

.dz-title {
  font-size: 14px;
  font-weight: 600;
}

.dz-hint {
  color: var(--text-3);
  font-size: 12px;
}

.dz-actions {
  display: flex;
  flex: none;
  gap: 8px;
  margin-top: 4px;
}

.dz-progress {
  padding: 16px;
}

.dz-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--text-2);
  font-size: 12px;
}

.dz-ready {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  animation: fadeIn var(--t-med) var(--ease-out) both;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

.dz-meta {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.dz-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dz-sub {
  color: var(--text-3);
  font-size: 12px;
}

/* ── options ──────────────────────────────────────────────────────────────── */

.options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 500;
}

.field-aside {
  color: var(--text-3);
  font-weight: 400;
}

.key-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 18px;
}

.key-saved {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 12px;
}

.key-saved .ico {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.check:hover {
  border-color: var(--line-strong);
}

.check:has(input:checked) {
  border-color: var(--accent-line);
  background: var(--green-light);
}

.check input {
  margin-top: 1px;
}

.check-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.check-title {
  font-weight: 500;
}

.file-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
}

.file-list .row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}

.file-list .row:hover {
  background: var(--surface);
}

.file-list .row:last-child {
  border-bottom: 0;
}

.file-list .row.off {
  cursor: default;
  opacity: 0.5;
}

.file-list .name {
  flex: 1;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list .why {
  color: var(--text-3);
  font-size: 11.5px;
}

/* ── dumper ───────────────────────────────────────────────────────────────── */

/* The detect panel stacks a status strip, a route picker and the fetch button;
   a uniform gap keeps them evenly spaced and compact instead of drifting apart. */
[data-ref='detectPanel'] {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

[data-ref='detectPanel'] .section-head {
  margin-bottom: 0;
}

/* The live connection strip: a dot, a headline, a detail line. It replaces the
   old "Deteksi server" button because the desktop app watches FiveM on its own. */
.watch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.watch-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-3) 18%, transparent);
}

.watch[data-tone='live'] .watch-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
  animation: watchPulse 2s var(--ease) infinite;
}

.watch[data-tone='wait'] .watch-dot {
  background: var(--warn, #d6a33a);
  box-shadow: 0 0 0 3px color-mix(in srgb, #d6a33a 20%, transparent);
}

.watch[data-tone='off'] .watch-dot {
  background: var(--bad);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent);
}

.watch-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.watch-title {
  font-size: 13px;
  font-weight: 500;
}

.watch-sub {
  color: var(--text-3);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

@keyframes watchPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .watch[data-tone='live'] .watch-dot { animation: none; }
}

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


.detect-status {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
}

.detect-status.error {
  color: var(--bad);
}

.list-foot {
  display: flex;
  justify-content: flex-end;
}

/* The resource picker: a single toolbar over the list rather than a label, a
   filter and a footer scattered apart. */
.resource-field {
  gap: 8px;
}

.resource-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.resource-filter {
  flex: 1;
  min-width: 0;
}

.resource-count {
  flex: none;
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* A server's resource list is the page's main body, not a footnote: give it room
   to show a useful slice instead of the 240px general file list. The height tracks
   the window so the whole Dumper card fits without the page itself scrolling — on a
   short window the list shrinks and only the list scrolls, never the section. */
.resource-list {
  max-height: min(340px, calc(100dvh - 560px));
}

/* A ticked row reads as selected at a glance, so a long list shows its picks
   without the eye hunting checkboxes. */
.resource-list .row:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.resource-list .row:has(input:checked) .name {
  color: var(--text-1);
}

.resource-list .row:has(input:checked):hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.resource-list .why {
  flex: none;
  margin-left: auto;
  padding-left: 10px;
  white-space: nowrap;
}

/* ── action bar ───────────────────────────────────────────────────────────── */

.setup-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 12px 12px 16px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: rgba(0, 0, 0, 0.18);
}

.run-hint {
  flex: 1;
  min-width: 0;
  color: var(--text-3);
  font-size: 12.5px;
}

.run-hint.error {
  color: var(--bad);
}

.setup-foot .btn.primary {
  margin-left: auto;
  height: 36px;
  min-width: 132px;
  padding: 0 18px;
}

/* ── process ──────────────────────────────────────────────────────────────── */

.process {
  overflow: hidden;
}

.process-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}

.process-titles {
  flex: 1;
  min-width: 0;
}

.process-titles h2 {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-meta {
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.status,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.status::before,
.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status.running,
.status.queued,
.pill.running,
.pill.queued {
  background: var(--info-soft);
  color: var(--info);
}

.status.running::before,
.pill.running::before {
  animation: pulse 1.4s ease-in-out infinite;
}

.status.succeeded,
.pill.succeeded {
  background: var(--accent-soft);
  color: var(--accent);
}

.status.failed,
.pill.failed {
  background: var(--bad-soft);
  color: var(--bad);
}

.status.cancelled,
.pill.cancelled {
  background: var(--warn-soft);
  color: var(--warn);
}

.process-progress {
  padding: 0 18px 16px;
}

.process-stage {
  margin-top: 8px;
  overflow: hidden;
  color: var(--text-2);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track {
  position: relative;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.track.thin {
  height: 3px;
}

.fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 300ms var(--ease-out);
}

.fill.indeterminate {
  position: absolute;
  width: 35% !important;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: slide 1.2s var(--ease) infinite;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 18px;
}

.result:not(:empty) {
  padding-bottom: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--line);
}

.stat {
  padding: 12px 14px;
  background: var(--surface-2);
}

.stat dt {
  color: var(--text-3);
  font-size: 11.5px;
}

.stat dd {
  margin-top: 2px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.ai-usage {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
}

.ai-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}

.ai-head .ico {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.ai-label {
  font-size: 12px;
  font-weight: 500;
}

.ai-model {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
}

.ai-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  padding: 10px 14px;
}

.ai-rows dt {
  color: var(--text-3);
  font-size: 11.5px;
}

.ai-rows dd {
  font-family: var(--mono);
  font-size: 13px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r);
  font-size: 12.5px;
  word-break: break-word;
}

.notice .ico {
  margin-top: 1px;
}

.notice.bad {
  border: 1px solid rgba(240, 114, 114, 0.25);
  background: var(--bad-soft);
  color: var(--bad);
}

.notice.warn {
  border: 1px solid rgba(232, 184, 94, 0.25);
  background: var(--warn-soft);
  color: var(--warn);
}

.deliver {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r);
  background: rgba(132, 236, 44, 0.05);
}

.deliver-file {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.deliver-name {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deliver-size {
  color: var(--text-3);
  font-size: 11.5px;
}

.next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.next-label {
  margin-right: 4px;
  color: var(--text-3);
  font-size: 12px;
}

.reports {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.reports .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 64px;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.reports .row:last-child {
  border-bottom: 0;
}

.reports .name {
  overflow: hidden;
  font-family: var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports .extra {
  color: var(--text-3);
  text-align: right;
}

.reports .more {
  display: block;
  color: var(--text-3);
}

.tag-ok,
.tag-bad,
.tag-warn,
.tag-mute {
  font-size: 11.5px;
}

.tag-ok {
  color: var(--accent);
}

.tag-bad {
  color: var(--bad);
}

.tag-mute {
  color: var(--text-3);
}

.tag-warn {
  color: var(--warn);
}

.reports .row[title] {
  cursor: help;
}

/* ── console ──────────────────────────────────────────────────────────────── */

.console {
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 6px 10px;
}

.console-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  transition: color var(--t-fast) var(--ease);
}

.console-toggle:hover,
.console-toggle:focus-visible {
  background: var(--gray-light);
  color: var(--gray-light-color);
}

.console-toggle .ico {
  width: 14px;
  height: 14px;
  transition: transform var(--t-med) var(--ease-out);
}

.console.collapsed .console-toggle .ico {
  transform: rotate(-90deg);
}

.console-count {
  color: var(--text-3);
  font-weight: 400;
}

.console.collapsed .console-body {
  display: none;
}

.console-body {
  max-height: 280px;
  min-height: 80px;
  margin: 0;
  padding: 4px 16px 14px;
  overflow: auto;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.console-body .line {
  display: block;
}

.console-body .time {
  margin-right: 12px;
  color: var(--text-3);
}

.console-body .warn {
  color: var(--warn);
}

.console-body .error {
  color: var(--bad);
}

.console-body .done {
  color: var(--accent);
}

/* ══ history page ═══════════════════════════════════════════════════════════ */

.history-count {
  min-width: 22px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.history-count:empty {
  display: none;
}

.history-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

/* armed: the first click of "Hapus semua" asks for the second */
.btn.armed {
  background: var(--red-light-hover);
  box-shadow: inset 0 0 0 1px currentColor;
}

.btn.icon-only {
  width: 28px;
  padding: 0;
}

.history-panel {
  padding: 6px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entry {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 14px;
  row-gap: 8px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--r);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.entry:hover {
  background: var(--surface);
}

.entry.is-new {
  animation: riseIn var(--t-slow) var(--ease-out) both;
}

.entry-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text-2);
}

.entry-icon .ico {
  width: 16px;
  height: 16px;
}

.entry.state-succeeded .entry-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.entry.state-failed .entry-icon {
  background: var(--bad-soft);
  color: var(--bad);
}

.entry.state-running .entry-icon,
.entry.state-queued .entry-icon {
  background: var(--info-soft);
  color: var(--info);
}

.entry.state-cancelled .entry-icon {
  background: var(--warn-soft);
  color: var(--warn);
}

.entry-body {
  min-width: 0;
}

.entry-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-meta {
  overflow: hidden;
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry .pill {
  height: 22px;
  padding: 0 9px;
  font-size: 11px;
}

.entry-actions {
  display: flex;
  gap: 6px;
}

.entry-ai {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-family: var(--mono);
  font-size: 10.5px;
}

.entry-model {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
}

.entry-tokens {
  color: var(--text-3);
}

.entry .track {
  grid-column: 2 / -1;
}

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 20px;
  color: var(--text-3);
  text-align: center;
  animation: fadeIn var(--t-slow) var(--ease-out) both;
}

.history-empty .ico {
  width: 22px;
  height: 22px;
  margin-bottom: 12px;
  stroke-width: 1.5;
}

.empty-title {
  color: var(--text-2);
  font-weight: 500;
}

.empty-sub {
  margin-top: 2px;
  font-size: 12px;
}

/* the count beside "Riwayat" in the sidebar */
.nav-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
  text-align: center;
}

.nav-count:empty {
  display: none;
}

.nav-item.active .nav-count {
  background: var(--green-light-hover);
  color: var(--green-light-color);
}

/* ══ settings page ══════════════════════════════════════════════════════════ */

.tabs {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--glass-deep);
  backdrop-filter: var(--blur);
  scrollbar-width: none;
}

.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  flex: none;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}

.tab .ico {
  width: 14px;
  height: 14px;
}

.tab:hover,
.tab:focus-visible {
  color: var(--text);
}

.tab[aria-selected='true'] {
  color: var(--text);
}

.tab[aria-selected='true'] .ico {
  color: var(--accent);
}

/* the pill behind the active tab glides between tabs */
.tab-indicator {
  position: absolute;
  top: 4px;
  left: 0;
  height: 32px;
  width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-3);
  transition: transform var(--t-slow) var(--ease-out), width var(--t-slow) var(--ease-out);
}

.tab-panel.tab-enter {
  animation: riseIn var(--t-med) var(--ease-out) both;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
  gap: 14px 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-field label {
  font-size: 12.5px;
  font-weight: 500;
}

.input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.save-status {
  flex: 1;
  min-width: 0;
  color: var(--text-3);
  font-size: 12px;
}

.save-status:empty {
  display: none;
}

.save-status.ok {
  color: var(--accent);
}

.save-status.error {
  color: var(--bad);
}

.setup-section > .save-status {
  margin-top: 10px;
}

/* ── access list ──────────────────────────────────────────────────────────── */

.admin-add {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 120px auto;
  gap: 8px;
}

.admin-add .btn {
  height: 36px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
}

.access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px 9px 12px;
  border-bottom: 1px solid var(--line);
  transition: background var(--t-fast) var(--ease);
  animation: fadeIn var(--t-med) var(--ease-out) both;
}

.access-row:first-child {
  border-radius: var(--r) var(--r) 0 0;
}

.access-row:last-child {
  border-bottom: 0;
  border-radius: 0 0 var(--r) var(--r);
}

.access-row:only-child {
  border-radius: var(--r);
}

.access-row:hover {
  background: var(--surface);
}

.access-info {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.access-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.access-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.access-avatar.initial {
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.access-name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-id {
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 11px;
}

.access-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.role-select {
  width: 124px;
}

.role-select .select-trigger {
  height: 30px;
  font-size: 12px;
}

.access-note {
  margin-top: 10px;
}

.pill.admin {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill.user {
  background: var(--surface-3);
  color: var(--text-2);
}

/* ── account & about ──────────────────────────────────────────────────────── */

.account {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.account-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-avatar {
  width: 56px;
  height: 56px;
  border: 2px solid var(--accent-line);
  border-radius: 50%;
  background: var(--surface-3);
  object-fit: cover;
}

.account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.account-name {
  font-size: 16px;
  font-weight: 650;
}

.facts {
  display: grid;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.fact {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.fact:last-child {
  border-bottom: 0;
}

.fact dt {
  color: var(--text-3);
}

.fact dd {
  overflow-wrap: anywhere;
}

.fact dd.mono {
  font-family: var(--mono);
  font-size: 12px;
}

.about {
  overflow: hidden;
}

.about-banner {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1162 / 614;
  border-bottom: 1px solid var(--line);
  object-fit: cover;
}

/* ══ login ══════════════════════════════════════════════════════════════════ */

/* In the desktop app the login window has the banner's own aspect ratio, so
   `cover` fills it exactly with nothing cropped. */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  isolation: isolate;
  background: url('/assets/banner.jpg') center / cover no-repeat, var(--bg);
  animation: fadeIn var(--t-slow) var(--ease-out) both;
}

/* even darkening everywhere, a little deeper behind the card so it stays legible */
.login-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(34% 52% at 50% 50%, rgba(8, 9, 11, 0.55), transparent 100%),
    rgba(8, 9, 11, 0.45);
  pointer-events: none;
}

.login-chrome {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.login-chrome .win-btn {
  color: rgba(236, 236, 241, 0.7);
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(340px, 100%);
  padding: 24px 26px 18px;
  border: 1px solid rgba(132, 236, 44, 0.22);
  border-radius: 20px;
  background: rgba(14, 15, 18, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(132, 236, 44, 0.08);
  text-align: center;
  animation: modalIn 480ms var(--ease-spring) 80ms both;
}

.login-logo {
  width: 96px;
  height: 96px;
  margin-bottom: 4px;
  filter: drop-shadow(0 10px 28px rgba(132, 236, 44, 0.28));
}

.login-title {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.login-sub {
  color: var(--text-2);
  font-size: 13px;
}

.login-card .btn {
  width: 100%;
  margin-top: 10px;
}

.login-error {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(240, 114, 114, 0.25);
  border-radius: var(--r-sm);
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 12px;
  animation: fadeIn var(--t-med) var(--ease-out) both;
}

.login-foot {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ══ scrollbars ═════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1) padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18) padding-box;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

/* ══ motion ═════════════════════════════════════════════════════════════════ */

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slide {
  from {
    left: -35%;
  }
  to {
    left: 100%;
  }
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes viewForward {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes viewBack {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* ══ responsive ═════════════════════════════════════════════════════════════ */

@media (max-width: 1280px) {
  :root {
    --side-w: 220px;
  }
  .page {
    padding: 28px 32px 44px;
  }
}

@media (max-width: 1060px) {
  .page-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-aside {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .page-aside {
    grid-template-columns: 1fr;
  }
  .entry {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }
  .entry-actions {
    grid-column: 2 / -1;
  }
  .page {
    padding: 24px 24px 40px;
  }
  .panel-hint {
    display: none;
  }
  .dz-empty {
    flex-wrap: wrap;
  }
  .dz-actions {
    width: 100%;
  }
  .dz-actions .btn {
    flex: 1;
  }
  .admin-add {
    grid-template-columns: 1fr 1fr;
  }
  .fact {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* icon rail */
@media (max-width: 700px) {
  :root {
    --side-w: 64px;
  }

  .app {
    grid-template-columns: var(--side-w) minmax(0, 1fr);
  }

  .side-scroll {
    padding: 10px 8px;
  }

  .side-label,
  .nav-label,
  .nav-dot,
  .nav-count,
  .user-meta,
  .brand-name,
  .app-version {
    display: none;
  }

  .side-label + .nav,
  .nav + .side-label + .nav {
    margin-top: 10px;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .nav-item::before {
    left: -8px;
  }

  .nav-item.busy::after {
    content: '';
    position: absolute;
    top: 7px;
    right: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--info);
  }

  .user-open {
    justify-content: center;
    padding: 2px;
  }

  .user-card {
    flex-direction: column;
    gap: 6px;
    margin: 8px;
    padding: 8px 0;
  }

  .page {
    padding: 20px 16px 32px;
  }

  .page-head {
    gap: 12px;
  }

  .page-icon {
    width: 40px;
    height: 40px;
  }

  .page-title {
    font-size: 18px;
  }

  .setup-foot {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .run-hint {
    text-align: center;
  }

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