/* Linktool — Design Tokens (Dark default) */

:root {
  color-scheme: dark;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Menlo", monospace;
  --font-display: "Geist", ui-sans-serif, system-ui, sans-serif;

  --t-xs: 12px;
  --t-sm: 13.5px;
  --t-base: 15px;
  --t-md: 16px;
  --t-lg: 18px;
  --t-xl: 21px;
  --t-2xl: 25px;
  --t-3xl: 31px;
  --t-4xl: 39px;
  --t-5xl: 53px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;
  --s-10: 72px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 24px;
  --r-full: 9999px;

  --row-h: 44px;
  --pad-x: 28px;
  --pad-y: 24px;

  /* Dark palette (default) */
  --bg: #0c0c0e;
  --surface: #131316;
  --surface-2: #17171b;
  --surface-3: #1d1d22;
  --line: #26262c;
  --line-strong: #353540;
  --text: #f3f3f5;
  --text-soft: #c4c4cc;
  --text-mute: #8a8a92;
  --text-faint: #5d5d66;

  /* Accent — Indigo (default) */
  --accent-50: #1a1c33;
  --accent-100: #20254a;
  --accent-300: #6e74e4;
  --accent-500: #7b80f0;
  --accent-600: #5d62e6;
  --accent-700: #4a4ec9;
  --accent-fg: #ffffff;

  --ok-50: #0f2a1c;
  --ok-500: #15a661;
  --ok-700: #6fe1a4;
  --warn-50: #2b1e0a;
  --warn-500: #d98810;
  --warn-700: #f3c25a;
  --err-50: #2c1311;
  --err-500: #d4413b;
  --err-700: #ed8581;
  --info-50: #0d2330;
  --info-500: #0e80b4;
  --info-700: #66c4ee;

  --sh-1: 0 1px 0 rgba(0,0,0,0.5);
  --sh-2: 0 4px 12px rgba(0,0,0,0.4);
  --sh-3: 0 14px 32px rgba(0,0,0,0.5);
  --sh-pop: 0 16px 50px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
  --focus: 0 0 0 3px color-mix(in oklab, var(--accent-500) 30%, transparent);
}

/* Optional: Light theme via class (not used by default) */
.theme-light {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --surface-3: #f1f1ee;
  --line: #e7e6e1;
  --line-strong: #d6d5cf;
  --text: #18181b;
  --text-soft: #43434a;
  --text-mute: #767680;
  --text-faint: #a1a1aa;

  --accent-50:  #eef0ff;
  --accent-100: #dadeff;
  --accent-300: #8b92f7;
  --accent-500: #4f55e1;
  --accent-600: #3f44c9;
  --accent-700: #3236a8;

  --ok-50:  #e6f6ed;  --ok-700: #0f7a47;
  --warn-50: #fef4e2; --warn-700: #9a5e07;
  --err-50: #fce8e6;  --err-700: #9c2823;
  --info-50: #e5f1f7; --info-700: #075b85;

  --sh-1: 0 1px 0 rgba(20,20,30,0.04), 0 1px 2px rgba(20,20,30,0.04);
  --sh-2: 0 1px 2px rgba(20,20,30,0.04), 0 4px 12px rgba(20,20,30,0.06);
  --sh-3: 0 2px 4px rgba(20,20,30,0.05), 0 14px 32px rgba(20,20,30,0.08);
  --sh-pop: 0 12px 40px rgba(20,20,30,0.18), 0 0 0 1px rgba(20,20,30,0.04);
}

/* Accent variants (class on body) */
.accent-emerald {
  --accent-50: #0f2620;
  --accent-100: #163a30;
  --accent-300: #4cc488;
  --accent-500: #2eb874;
  --accent-600: #1f9a5e;
  --accent-700: #137544;
}
.accent-amber {
  --accent-50: #2d1f08;
  --accent-100: #3b2a0b;
  --accent-300: #e6b048;
  --accent-500: #d99820;
  --accent-600: #b87b12;
  --accent-700: #8f5e09;
  --accent-fg: #16110a;
}
.accent-graphite {
  --accent-50: #2a2a30;
  --accent-100: #34343a;
  --accent-300: #b8b8c0;
  --accent-500: #ededf0;
  --accent-600: #d8d8df;
  --accent-700: #c0c0c8;
  --accent-fg: #0c0c0e;
}

.density-compact { --row-h: 36px; --pad-x: 20px; --pad-y: 16px; --t-base: 14px; --t-sm: 13px; }
.density-roomy   { --row-h: 44px; --pad-x: 28px; --pad-y: 20px; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: var(--t-base);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
  letter-spacing: -0.005em;
}

a { color: inherit; text-decoration: none; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button, input, select, textarea { font: inherit; color: inherit; }

.t-display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.025em; line-height: 1.05; }
.t-mono    { font-family: var(--font-mono); font-feature-settings: "tnum", "zero"; }
.t-tabular { font-variant-numeric: tabular-nums; }
.t-mute    { color: var(--text-mute); }
.t-soft    { color: var(--text-soft); }
.t-faint   { color: var(--text-faint); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
/* Linktool — Component primitives (Buttons, Inputs, Badges, Tables, Cards) */

/* Vertical rhythm — default gap between top-level blocks inside .page */
.page > .lt-card,
.page > .dash-kpi-strip,
.page > .dash-charts,
.page > .dash-project-grid,
.page > nav.pagination-lt,
.page > div[style*="grid-template-columns"],
.page > div[style*="display:grid"],
.page > div[style*="display: grid"],
.page > div[style*="display:flex"],
.page > div[style*="display: flex"] {
  margin-bottom: var(--sp-5, 24px);
}
.page > .lt-card:last-child,
.page > .empty-lt:last-child,
.page > div:last-child { margin-bottom: 0; }

/* Page head spacing */
.page-head { margin-bottom: var(--sp-5, 24px); }
.page-head .page-title { margin: 0 0 6px; line-height: 1.15; }
.page-head .page-sub { margin: 0; color: var(--text-3); font-size: var(--t-sm); }

/* Section header inside page (h2, h3 with class) */
.page > h2,
.page > h3,
.page > .section-head {
  margin-top: var(--sp-6, 32px);
  margin-bottom: var(--sp-3, 12px);
}

/* Card */
.lt-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.lt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.lt-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.015em;
}
.lt-card-sub { margin: 4px 0 0; color: var(--text-mute); font-size: 12.5px; }
.lt-card-body { padding: 18px 22px; }
.lt-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 10px 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-mute);
}

/* Buttons */
.btn-lt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  font-size: var(--t-base);
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.06s ease;
  user-select: none;
  cursor: pointer;
}
.btn-lt:active { transform: translateY(0.5px); }
.btn-lt-primary {
  background: var(--accent-600);
  color: var(--accent-fg);
  border-color: color-mix(in oklab, var(--accent-600) 70%, #000 0%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 1px 2px rgba(20,20,30,0.1);
}
.btn-lt-primary:hover { background: var(--accent-700); color: var(--accent-fg); }
.btn-lt-secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn-lt-secondary:hover { background: var(--surface-3); color: var(--text); }
.btn-lt-ghost { background: transparent; color: var(--text-soft); }
.btn-lt-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-lt-danger { background: var(--err-500); color: white; }
.btn-lt-danger:hover { background: color-mix(in oklab, var(--err-500) 85%, #000); color: white; }
.btn-lt-sm { height: 28px; padding: 0 10px; font-size: var(--t-sm); }
.btn-lt-lg { height: 42px; padding: 0 18px; font-size: var(--t-md); }
.btn-lt-icon { width: 32px; padding: 0; }

/* Inputs */
.input-lt, .select-lt, .textarea-lt {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  width: 100%;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.input-lt:focus, .select-lt:focus, .textarea-lt:focus {
  border-color: var(--accent-500);
  box-shadow: var(--focus);
  outline: none;
}
.input-lt::placeholder { color: var(--text-faint); }
.textarea-lt { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }

/* Badges (Linktool) */
.badge-lt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.badge-lt-ok    { background: var(--ok-50);   color: var(--ok-700);   border-color: color-mix(in oklab, var(--ok-500) 25%, transparent); }
.badge-lt-warn  { background: var(--warn-50); color: var(--warn-700); border-color: color-mix(in oklab, var(--warn-500) 25%, transparent); }
.badge-lt-err   { background: var(--err-50);  color: var(--err-700);  border-color: color-mix(in oklab, var(--err-500) 25%, transparent); }
.badge-lt-info  { background: var(--info-50); color: var(--info-700); border-color: color-mix(in oklab, var(--info-500) 25%, transparent); }
.badge-lt-accent { background: var(--accent-50); color: var(--accent-200); border-color: color-mix(in oklab, var(--accent-500) 25%, transparent); }

.dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
  flex-shrink: 0;
}

/* Tables */
.tbl-lt {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-base);
}
.tbl-lt th {
  text-align: left;
  font-weight: 500;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 2;
}
.tbl-lt td {
  padding: 0 14px;
  height: var(--row-h);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text-soft);
}
.tbl-lt tbody tr { transition: background 0.08s ease; }
.tbl-lt tbody tr:hover { background: var(--surface-2); }
.tbl-lt tbody tr:last-child td { border-bottom: 0; }
.tbl-lt td.t-primary { color: var(--text); font-weight: 500; }

/* Kbd */
.kbd-lt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-soft);
}

/* Segmented tabs */
.seg {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-3);
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 5px;
  font-size: var(--t-sm);
  color: var(--text-soft);
  font-weight: 500;
}
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-selected="true"],
.seg-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-1);
}

/* Pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
}
.pill-accent { background: var(--accent-50); color: var(--accent-300); border-color: color-mix(in oklab, var(--accent-500) 25%, transparent); }

/* Placeholder */
.placeholder {
  background:
    repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 8px, var(--surface-3) 8px, var(--surface-3) 16px);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
}

/* Animations */
@keyframes pulse-soft { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.9s linear infinite; }

.live-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--ok-500);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--ok-500) 60%, transparent);
  animation: livepulse 1.6s ease-out infinite;
}
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--ok-500) 60%, transparent); }
  100% { box-shadow: 0 0 0 8px transparent; }
}
/* Linktool — App Shell (Sidebar, Topbar, Logo, Avatar) */

.app {
  display: grid;
  grid-template-columns: auto 1fr;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.18s ease;
  z-index: 10;
}
.sidebar.is-collapsed { width: 64px; padding: 16px 8px 12px; }

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
  gap: 6px;
}
.sidebar.is-collapsed .sidebar-top { flex-direction: column; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.03em;
  color: var(--text);
}
.logo-mark {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-500);
  color: var(--accent-fg);
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.logo-mark svg { width: 16px; height: 16px; }
.logo-word { display: inline-flex; align-items: baseline; }
.logo-dot { color: var(--accent-500); margin-left: 1px; font-weight: 700; }
.sidebar.is-collapsed .logo-word { display: none; }

.sidebar-collapse {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  border-radius: 5px;
  cursor: pointer;
}
.sidebar-collapse:hover { background: var(--surface-3); color: var(--text-soft); }

.sidebar-section {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 14px 10px 6px;
}
.sidebar.is-collapsed .sidebar-section { display: none; }
.sidebar-sep { height: 1px; background: var(--line); margin: 12px 6px 4px; }

.sidebar-nav { flex: 1; overflow-y: auto; min-height: 0; }

.sidebar-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background 0.1s ease, color 0.1s ease;
  text-decoration: none;
}
.sidebar-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.sidebar-item.is-active {
  background: var(--accent-50);
  color: var(--accent-300);
}
.sidebar-icon { display: inline-flex; color: inherit; opacity: 0.8; flex-shrink: 0; }
.sidebar-icon svg { width: 16px; height: 16px; }
.sidebar-item.is-active .sidebar-icon { opacity: 1; }
.sidebar-label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar.is-collapsed .sidebar-label { display: none; }
.sidebar-badge {
  height: 18px; min-width: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
  font-size: 10.5px; font-weight: 600;
  background: var(--surface-3);
  color: var(--text-mute);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.sidebar-item.is-active .sidebar-badge { background: var(--accent-100); color: var(--accent-300); }
.sidebar-badge.is-new { background: var(--accent-500); color: var(--accent-fg); }
.sidebar.is-collapsed .sidebar-item { justify-content: center; padding: 0; }
.sidebar.is-collapsed .sidebar-badge { display: none; }

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 4px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text-soft);
}
.sidebar-user:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.sidebar-user-meta { flex: 1; font-size: 12.5px; line-height: 1.25; overflow: hidden; min-width: 0; }
.sidebar-user-meta .name { color: var(--text); font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-meta .role { color: var(--text-mute); font-size: 11px; }
.sidebar.is-collapsed .sidebar-user-meta { display: none; }

/* Avatar */
.avatar-lt {
  width: 28px; height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--accent-100);
  color: var(--accent-300);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.avatar-lt-sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar-lt-lg { width: 40px; height: 40px; font-size: 14px; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px) minmax(0, 1fr);
  align-items: center;
  height: 52px;
  padding: 0 20px;
  gap: 16px;
}
.topbar-l { display: flex; align-items: center; gap: 4px; min-width: 0; }
.topbar-c { display: flex; justify-content: center; }
.topbar-r { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.topbar-dot {
  position: absolute;
  top: -2px; right: -2px;
  width: 7px; height: 7px;
  background: var(--err-500);
  border-radius: 999px;
  border: 1.5px solid var(--bg);
}

.cmdk {
  height: 32px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-mute);
  transition: border-color 0.12s ease;
  cursor: pointer;
}
.cmdk > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: left; }
.cmdk:hover { border-color: var(--line-strong); }
.cmdk:focus-visible { border-color: var(--accent-500); }
.cmdk:focus-within { border-color: var(--accent-500); }
.cmdk-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  min-width: 0;
  line-height: 1;
}
.cmdk-input::placeholder { color: var(--text-mute); }
.cmdk-input::-webkit-search-cancel-button { display: none; }

/* Topbar icon button */
.tb-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  border-radius: 6px;
  position: relative;
  cursor: pointer;
}
.tb-icon:hover { background: var(--surface-3); color: var(--text); }
.tb-icon svg { width: 16px; height: 16px; }

/* Main column */
.main { min-width: 0; }
.main-inner { min-height: calc(100vh - 52px); }

/* Page container */
.page {
  padding: var(--pad-y) var(--pad-x) calc(var(--pad-y) + 60px);
  max-width: 1480px;
  margin: 0 auto;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.page-head > * { min-width: 0; }
.page-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  color: var(--text);
}
.page-sub { color: var(--text-mute); font-size: 12.5px; margin: 4px 0 0; max-width: 70ch; }
.page-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-mute); flex-wrap: wrap; }
.page-meta > .sep { color: var(--text-faint); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Grid + stack helpers */
.row-lt { display: flex; gap: 14px; align-items: center; }
.col-lt { display: flex; flex-direction: column; }
.grow { flex: 1; }
.grid-lt { display: grid; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-md { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }

/* Legacy container (existing Bootstrap pages) */
.lt-legacy-container { max-width: 1480px; }
.lt-flash-wrap { padding: 12px var(--pad-x) 0; max-width: 1480px; margin: 0 auto; }

/* Sortable table headers */
.th-sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.1s;
}
.th-sort:hover { color: var(--text); }
.th-sort .sort-ic {
  font-size: .75em;
  opacity: .35;
  letter-spacing: -.05em;
  transition: opacity 0.1s;
}
.th-sort.is-sort-active { color: var(--text); }
.th-sort.is-sort-active .sort-ic { opacity: 1; color: var(--accent-400, #818cf8); }

/* Footer */
.lt-footer {
  border-top: 1px solid var(--line);
  padding: 14px 24px;
}

/* Notification bell */
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--err-500, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}
.notif-item:hover { background: var(--surface-2); }
.lt-footer-inner {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Bare layout (auth pages) */
.main-bare { min-height: 100vh; display: flex; flex-direction: column; }
.main-bare .main-inner { flex: 1; }

/* Mobile */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.is-open { transform: translateX(0); }
  .app { grid-template-columns: 1fr; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .topbar-c { display: none; }
}
/* Linktool — Module helpers (subnav, forms, lists, empty) */

/* Breadcrumbs */
.page-crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.page-crumbs a { color: var(--text-mute); font-size: 12px; font-weight: 500; }
.page-crumbs a:hover { color: var(--text); }
.page-crumbs .sep { color: var(--text-faint); }
.page-crumbs .is-current { color: var(--text); }

/* SubNav (tab strip) */
.subnav {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin: -8px 0 14px;
  overflow-x: auto;
}
.subnav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mute);
  border-bottom: 2px solid transparent;
  transition: color 0.1s ease, border-color 0.1s ease;
  margin-bottom: -1px;
  white-space: nowrap;
  text-decoration: none;
}
.subnav-item:hover { color: var(--text); text-decoration: none; }
.subnav-item.is-active {
  color: var(--accent-300);
  border-bottom-color: var(--accent-500);
}
.subnav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  min-width: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-mute);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.subnav-item.is-active .subnav-count { background: var(--accent-100); color: var(--accent-300); }

/* Forms */
.form-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  overflow: hidden;
}
.form-section-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.form-section-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.form-section-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.form-section-body { padding: 4px 0; }
.form-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.form-row:last-child { border-bottom: 0; }
.form-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.form-hint { color: var(--text-mute); font-weight: 400; font-size: 11.5px; }
.form-field { min-width: 0; max-width: 520px; }
@media (max-width: 720px) {
  .form-row { grid-template-columns: 1fr; gap: 6px; }
  .form-label { padding-top: 0; }
}

/* List toolbar */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* Pagination */
.pagination-lt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

/* Empty state */
.empty-lt {
  text-align: center;
  padding: 56px 24px;
}
.empty-lt-icon {
  width: 44px; height: 44px;
  margin: 0 auto 12px;
  border-radius: 11px;
  background: var(--surface-3);
  color: var(--text-mute);
  display: inline-flex; align-items: center; justify-content: center;
}
.empty-lt-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.empty-lt-sub {
  color: var(--text-mute);
  font-size: 12.5px;
  margin: 6px auto 14px;
  max-width: 40ch;
}

/* Two-column module layout */
.module-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 14px;
  align-items: flex-start;
}
@media (max-width: 1100px) { .module-2col { grid-template-columns: 1fr; } }

/* Detail key-value list */
.kv-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px 16px;
  padding: 16px 20px;
}
.kv-list dt {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  font-weight: 500;
  padding-top: 2px;
}
.kv-list dd {
  font-size: 13px;
  color: var(--text);
  margin: 0;
}

/* Inline meta row */
.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-mute);
  flex-wrap: wrap;
}
.meta-row .sep { color: var(--text-faint); }

.divider-lt { height: 1px; background: var(--line); margin: 14px 0; }
.section-h {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

/* Dashboard */
.dash-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
@media (max-width: 900px) { .dash-kpi-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .dash-kpi-strip { grid-template-columns: 1fr; } }

.dash-kpi { display: flex; flex-direction: column; gap: 4px; }
.dash-kpi-label {
  font-size: var(--t-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
}
.dash-kpi-value {
  font-size: var(--t-3xl);
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.dash-kpi-sub { font-size: var(--t-xs); color: var(--text-3); }

.dash-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
@media (max-width: 860px) { .dash-charts { grid-template-columns: 1fr; } }

.dash-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
}

/* Pagination active state */
.btn-lt.is-active {
  background: var(--accent-100);
  color: var(--accent-300);
  border-color: var(--accent-200);
}

/* DataTables dark-theme sort arrow override */
table.dataTable thead > tr > th.sorting::before,
table.dataTable thead > tr > th.sorting::after,
table.dataTable thead > tr > th.sorting_asc::before,
table.dataTable thead > tr > th.sorting_asc::after,
table.dataTable thead > tr > th.sorting_desc::before,
table.dataTable thead > tr > th.sorting_desc::after {
  opacity: 0.35;
  color: var(--text-soft);
}
table.dataTable thead > tr > th.sorting_asc::before,
table.dataTable thead > tr > th.sorting_desc::after {
  opacity: 1;
  color: var(--accent-400);
}
table.dataTable thead > tr > th.sorting,
table.dataTable thead > tr > th.sorting_asc,
table.dataTable thead > tr > th.sorting_desc {
  position: relative;
}

/* ── Content Studio ──────────────────────────────────────────────────────── */

.studio {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: flex-start;
}
@media (max-width: 1100px) {
  .studio { grid-template-columns: 1fr; }
}

.studio-brief {
  position: sticky;
  top: 70px;
}

.studio-form {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.studio-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.studio-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.studio-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.studio-field-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-mute);
  flex-shrink: 0;
  white-space: nowrap;
}

.studio-field-hint {
  font-size: 11px;
  color: var(--text-faint);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
}

/* Segmented controls */
.studio-seg {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-3);
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  width: 100%;
}

.studio-seg-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-mute);
  transition: background 0.1s ease, color 0.1s ease;
  white-space: nowrap;
  min-width: 0;
}
.studio-seg-btn:hover { color: var(--text); }
.studio-seg-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-1);
}

/* Style chips */
.studio-chip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.studio-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.1s ease, background 0.1s ease;
  min-width: 0;
}
.studio-chip:hover { background: var(--surface-3); }
.studio-chip.is-active {
  border-color: var(--accent-500);
  background: var(--accent-50);
  box-shadow: inset 0 0 0 1px var(--accent-500);
}

.studio-chip-name {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.studio-chip.is-active .studio-chip-name { color: var(--accent-300); }

.studio-chip-hint {
  display: block;
  font-size: 11px;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Output card */
.studio-output {
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

/* Empty / loading state */
.studio-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  gap: 6px;
}

.studio-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: var(--surface-3);
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.studio-empty-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
}

.studio-empty-sub {
  font-size: 13px;
  color: var(--text-mute);
  max-width: 42ch;
  margin: 4px auto 0;
  line-height: 1.5;
}

/* Skeleton loader */
.studio-skel {
  width: 60%;
  height: 12px;
  background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%);
  background-size: 200% 100%;
  animation: studioSkel 1.3s ease-in-out infinite;
  border-radius: 4px;
  margin: 4px 0;
}
@keyframes studioSkel {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Article preview */
.studio-preview {
  padding: 32px 44px 44px;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}

.studio-article {
  max-width: 64ch;
  margin: 0 auto;
  font-family: var(--font-sans);
}

.studio-article h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--text);
}

.studio-article h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 26px 0 10px;
  color: var(--text);
}

.studio-article h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  margin: 20px 0 8px;
  color: var(--text);
}

.studio-article p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-soft);
  margin: 0 0 14px;
}

.studio-article ul,
.studio-article ol {
  margin: 0 0 14px 0;
  padding-left: 20px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.6;
}

.studio-article li { margin: 4px 0; }

.studio-article a {
  color: var(--accent-300);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--accent-500) 45%, transparent);
  text-underline-offset: 2px;
  font-weight: 500;
}

.studio-article strong { color: var(--text); font-weight: 600; }

/* HTML code view */
.studio-code {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}

.studio-code pre {
  margin: 0;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Content Studio — Image module ──────────────────────────────────────── */

/* Tabs at top of Brief card (Text / Bild switch) */
.studio-brief-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 4px;
  gap: 12px;
}
.studio-brief-tabs h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Aspect ratio chips */
.aspect-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.aspect-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.1s ease, background 0.1s ease;
  min-width: 0;
}
.aspect-chip:hover { background: var(--surface-3); }
.aspect-chip.is-active {
  border-color: var(--accent-500);
  background: var(--accent-50);
  box-shadow: inset 0 0 0 1px var(--accent-500);
}
.aspect-thumb {
  width: 32px;
  background: linear-gradient(135deg, var(--surface-3) 0%, color-mix(in oklab, var(--accent-500) 20%, var(--surface-3)) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  flex-shrink: 0;
}
.aspect-chip.is-active .aspect-thumb {
  background: linear-gradient(135deg, var(--accent-300) 0%, var(--accent-500) 100%);
  border-color: var(--accent-600);
}
.aspect-meta { text-align: center; min-width: 0; max-width: 100%; }
.aspect-name {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aspect-chip.is-active .aspect-name { color: var(--accent-300); }
.aspect-dims {
  display: block;
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

/* Image skeleton */
.img-skel-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.img-skel {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  width: 100%;
}
.img-skel-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--accent-500) 18%, transparent), transparent);
  animation: studioShimmer 1.6s ease-in-out infinite;
}
@keyframes studioShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Image gallery */
.img-gallery {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}
.img-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.img-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--sh-2);
}
.img-thumb-btn {
  display: block;
  width: 100%;
  background: var(--surface-3);
  cursor: zoom-in;
  padding: 0;
  border: 0;
}
.img-thumb-btn img {
  display: block;
  width: 100%;
  height: auto;
}
.img-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-mute);
}
.img-card-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.img-card-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.img-card-dims {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
}

/* Zoom overlay */
.img-zoom {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: zoomFadeIn 0.18s ease-out;
}
@keyframes zoomFadeIn { from { opacity: 0; } to { opacity: 1; } }
.img-zoom img {
  max-width: 90vw;
  max-height: 88vh;
  display: block;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  cursor: default;
}
.img-zoom-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.img-zoom-close:hover { background: rgba(255,255,255,0.2); }
/* Linktool — Bootstrap 5 Dark Bridge
 * Overrides Bootstrap defaults for dark-mode operator UI.
 * Keep Bootstrap JS (modals, dropdowns, collapse, datatables) functional.
 */

body { background: var(--bg); color: var(--text); }

/* Containers + main */
.container, .container-fluid { color: var(--text); }
main.container, main.container-fluid { padding-top: var(--pad-y) !important; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--text);
  box-shadow: var(--sh-1);
}
.card-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  padding: 14px 20px;
}
.card-header h1, .card-header h2, .card-header h3, .card-header h4, .card-header h5, .card-header h6 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0;
}
.card-body { padding: 20px; color: var(--text-soft); }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--line); color: var(--text-mute); }
.card-title { color: var(--text); font-family: var(--font-display); font-weight: 500; letter-spacing: -0.015em; }
.card-text { color: var(--text-soft); }

/* Buttons (Bootstrap → token palette) */
.btn {
  border-radius: var(--r-sm);
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn-primary {
  background: var(--accent-500);
  border-color: color-mix(in oklab, var(--accent-500) 70%, #000);
  color: var(--accent-fg);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background: var(--accent-600) !important;
  border-color: var(--accent-600) !important;
  color: var(--accent-fg) !important;
}
.btn-secondary, .btn-outline-secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text-soft);
}
.btn-secondary:hover, .btn-outline-secondary:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-success { background: var(--ok-500); border-color: var(--ok-500); color: white; }
.btn-success:hover { background: color-mix(in oklab, var(--ok-500) 85%, #000); border-color: var(--ok-500); }
.btn-danger { background: var(--err-500); border-color: var(--err-500); color: white; }
.btn-danger:hover { background: color-mix(in oklab, var(--err-500) 85%, #000); border-color: var(--err-500); }
.btn-warning { background: var(--warn-500); border-color: var(--warn-500); color: #16110a; }
.btn-info { background: var(--info-500); border-color: var(--info-500); color: white; }
.btn-light { background: var(--surface-3); border-color: var(--line); color: var(--text); }
.btn-light:hover { background: var(--surface-2); color: var(--text); }
.btn-dark { background: #000; border-color: #000; color: var(--text); }
.btn-link { color: var(--accent-300); }
.btn-link:hover { color: var(--accent-500); }
.btn-outline-primary { color: var(--accent-300); border-color: color-mix(in oklab, var(--accent-500) 50%, transparent); }
.btn-outline-primary:hover { background: var(--accent-500); color: var(--accent-fg); border-color: var(--accent-500); }
.btn-outline-danger { color: var(--err-700); border-color: color-mix(in oklab, var(--err-500) 50%, transparent); }
.btn-outline-danger:hover { background: var(--err-500); color: white; border-color: var(--err-500); }
.btn-outline-success { color: var(--ok-700); border-color: color-mix(in oklab, var(--ok-500) 50%, transparent); }
.btn-outline-success:hover { background: var(--ok-500); color: white; }
.btn-sm { padding: 4px 10px; font-size: var(--t-sm); }
.btn-lg { padding: 10px 18px; font-size: var(--t-md); }
.btn:focus, .btn:focus-visible { box-shadow: var(--focus); outline: none; }

/* Forms */
.form-control, .form-select {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--r-sm);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.form-control::placeholder { color: var(--text-faint); }
.form-control:focus, .form-select:focus {
  background: var(--surface);
  border-color: var(--accent-500);
  color: var(--text);
  box-shadow: var(--focus);
}
.form-control:disabled, .form-control[readonly] { background: var(--surface-2); color: var(--text-mute); }
.form-label { color: var(--text); font-size: 12.5px; font-weight: 500; margin-bottom: 6px; }
.form-text { color: var(--text-mute); font-size: 11.5px; }
.form-check-input {
  background-color: var(--surface);
  border: 1px solid var(--line-strong);
}
.form-check-input:checked {
  background-color: var(--accent-500);
  border-color: var(--accent-500);
}
.form-check-label { color: var(--text-soft); }
.input-group-text {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-soft);
}

/* Tables */
.table {
  --bs-table-color: var(--text-soft);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--line);
  --bs-table-striped-bg: var(--surface-2);
  --bs-table-striped-color: var(--text);
  --bs-table-active-bg: var(--surface-3);
  --bs-table-hover-bg: var(--surface-2);
  --bs-table-hover-color: var(--text);
  color: var(--text-soft);
  border-color: var(--line);
}
.table thead th {
  background: var(--surface-2);
  color: var(--text-mute);
  font-size: var(--t-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
}
.table > :not(caption) > * > * { border-bottom-color: var(--line); }
.table-hover > tbody > tr:hover > * { background: var(--surface-2); color: var(--text); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background: var(--surface-2); color: var(--text-soft); }
.table-bordered, .table-bordered > :not(caption) > * > * { border-color: var(--line); }
.table-responsive { border-radius: var(--r-lg); }

/* Modals */
.modal-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--text);
  box-shadow: var(--sh-pop);
}
.modal-header { border-bottom: 1px solid var(--line); padding: 16px 20px; }
.modal-title { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.015em; color: var(--text); }
.modal-body { color: var(--text-soft); padding: 18px 20px; }
.modal-footer { border-top: 1px solid var(--line); padding: 12px 20px; }
.modal-backdrop.show { opacity: 0.7; background: #000; }
.btn-close {
  filter: invert(1) grayscale(1) brightness(1.5);
  opacity: 0.7;
}
.btn-close:hover { opacity: 1; }

/* Dropdowns */
.dropdown-menu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-pop);
  padding: 6px;
  color: var(--text-soft);
}
.dropdown-item {
  color: var(--text-soft);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  font-size: 13.5px;
}
.dropdown-item:hover, .dropdown-item:focus {
  background: var(--surface-3);
  color: var(--text);
}
.dropdown-item.active, .dropdown-item:active {
  background: var(--accent-50);
  color: var(--accent-300);
}
.dropdown-divider { border-color: var(--line); margin: 6px 0; }
.dropdown-header { color: var(--text-faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; }

/* Alerts */
.alert {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text-soft);
}
.alert-success { background: var(--ok-50); border-color: color-mix(in oklab, var(--ok-500) 30%, transparent); color: var(--ok-700); }
.alert-danger  { background: var(--err-50); border-color: color-mix(in oklab, var(--err-500) 30%, transparent); color: var(--err-700); }
.alert-warning { background: var(--warn-50); border-color: color-mix(in oklab, var(--warn-500) 30%, transparent); color: var(--warn-700); }
.alert-info    { background: var(--info-50); border-color: color-mix(in oklab, var(--info-500) 30%, transparent); color: var(--info-700); }
.alert-primary { background: var(--accent-50); border-color: color-mix(in oklab, var(--accent-500) 30%, transparent); color: var(--accent-300); }
.alert-secondary { background: var(--surface-3); border-color: var(--line); color: var(--text-soft); }

/* Badges */
.badge {
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid transparent;
}
.bg-primary { background: var(--accent-500) !important; color: var(--accent-fg) !important; }
.bg-secondary { background: var(--surface-3) !important; color: var(--text-soft) !important; border-color: var(--line); }
.bg-success { background: var(--ok-50) !important; color: var(--ok-700) !important; border-color: color-mix(in oklab, var(--ok-500) 25%, transparent); }
.bg-danger { background: var(--err-50) !important; color: var(--err-700) !important; border-color: color-mix(in oklab, var(--err-500) 25%, transparent); }
.bg-warning { background: var(--warn-50) !important; color: var(--warn-700) !important; border-color: color-mix(in oklab, var(--warn-500) 25%, transparent); }
.bg-info { background: var(--info-50) !important; color: var(--info-700) !important; border-color: color-mix(in oklab, var(--info-500) 25%, transparent); }
.bg-light { background: var(--surface-3) !important; color: var(--text-soft) !important; }
.bg-dark { background: #000 !important; color: var(--text) !important; }

/* Nav tabs / pills */
.nav-tabs {
  border-bottom: 1px solid var(--line);
}
.nav-tabs .nav-link {
  color: var(--text-mute);
  border: 1px solid transparent;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  font-size: 13px;
  padding: 8px 14px;
}
.nav-tabs .nav-link:hover { color: var(--text); border-color: transparent; isolation: isolate; }
.nav-tabs .nav-link.active {
  background: transparent;
  color: var(--accent-300);
  border-color: transparent;
  border-bottom-color: var(--accent-500);
}
.nav-pills .nav-link { color: var(--text-soft); border-radius: var(--r-sm); }
.nav-pills .nav-link.active { background: var(--accent-500); color: var(--accent-fg); }

/* Pagination */
.pagination .page-link {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-soft);
}
.pagination .page-link:hover { background: var(--surface-3); color: var(--text); border-color: var(--line-strong); }
.pagination .page-item.active .page-link {
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: var(--accent-fg);
}
.pagination .page-item.disabled .page-link {
  background: var(--surface-2);
  color: var(--text-faint);
  border-color: var(--line);
}

/* Breadcrumb */
.breadcrumb { background: transparent; color: var(--text-mute); font-size: 12px; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-faint); }
.breadcrumb-item a { color: var(--text-mute); }
.breadcrumb-item a:hover { color: var(--text); }
.breadcrumb-item.active { color: var(--text); }

/* Progress */
.progress { background: var(--surface-3); border-radius: var(--r-full); height: 6px; }
.progress-bar { background: var(--accent-500); }

/* List group */
.list-group-item {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text-soft);
}
.list-group-item.active { background: var(--accent-500); color: var(--accent-fg); border-color: var(--accent-500); }
.list-group-item:hover { background: var(--surface-2); color: var(--text); }

/* Text helpers */
.text-muted { color: var(--text-mute) !important; }
.text-primary { color: var(--accent-300) !important; }
.text-success { color: var(--ok-700) !important; }
.text-danger  { color: var(--err-700) !important; }
.text-warning { color: var(--warn-700) !important; }
.text-info    { color: var(--info-700) !important; }
.text-body { color: var(--text) !important; }
.text-secondary { color: var(--text-soft) !important; }

/* Borders */
.border { border-color: var(--line) !important; }
.border-top, .border-end, .border-bottom, .border-start { border-color: var(--line) !important; }

/* Backgrounds */
.bg-white { background: var(--surface) !important; }
.bg-body { background: var(--bg) !important; }

/* DataTables */
.dataTables_wrapper {
  color: var(--text-soft);
  font-size: var(--t-sm);
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { color: var(--text-mute); }
.dataTables_wrapper .dataTables_length { padding: var(--sp-3) var(--sp-4); }
.dataTables_wrapper .dataTables_filter { padding: var(--sp-3) var(--sp-4); }
.dataTables_wrapper .dataTables_info  { padding: var(--sp-3) var(--sp-4); line-height: 32px; }
.dataTables_wrapper .dataTables_paginate { padding: var(--sp-2) var(--sp-4); }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 4px 10px;
  margin: 0 1px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: var(--t-sm);
  color: var(--text-mute) !important;
  background: transparent;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--surface-2) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--accent-600) !important;
  border-color: var(--accent-600) !important;
  color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: .35;
  cursor: default;
  background: transparent !important;
}
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 4px 8px;
}
table.dataTable thead th, table.dataTable thead td { border-bottom: 1px solid var(--line); }
table.dataTable.no-footer { border-bottom: 1px solid var(--line); }
table.dataTable tbody tr { background: transparent; }
table.dataTable tbody tr:hover { background: var(--surface-2); }
table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd { background: var(--surface-2); }

/* Spinner */
.spinner-border, .spinner-grow { color: var(--accent-500); }

/* Bootstrap focus rings */
.form-control:focus, .form-select:focus, .form-check-input:focus, .btn:focus, .btn:focus-visible {
  box-shadow: var(--focus) !important;
}

/* Old navbar (legacy) — hide (replaced by sidebar) */
.modern-navbar, body > nav.navbar { display: none !important; }

/* Old footer container spacing fix */
main.container { max-width: 1480px; }

/* Headings */
h1, h2, h3, h4, h5, h6 { color: var(--text); font-family: var(--font-display); letter-spacing: -0.02em; font-weight: 500; }
small, .small { color: var(--text-mute); }
hr { border-color: var(--line); opacity: 1; }

/* Code */
code, kbd, pre, samp { font-family: var(--font-mono); }
code { color: var(--accent-300); background: var(--surface-3); padding: 1px 6px; border-radius: 4px; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; color: var(--text-soft); }

/* Tooltips */
.tooltip-inner {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 12px;
}
.tooltip .tooltip-arrow::before { border-top-color: var(--line); }

/* User avatar (legacy) */
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--accent-100);
  color: var(--accent-300);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
}
/* Linktool — Auth screens */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--bg);
}
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } }

.auth-form-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px clamp(20px, 6vw, 80px);
  min-height: 100vh;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.03em;
  color: var(--text);
}
.auth-brand .logo-mark { width: 30px; height: 30px; }
.auth-brand .logo-mark svg { width: 17px; height: 17px; }
.auth-brand .logo-dot { color: var(--accent-500); font-weight: 700; }

.auth-card {
  max-width: 400px;
  width: 100%;
}
.auth-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 8px;
  color: var(--text);
}
.auth-sub {
  color: var(--text-mute);
  font-size: 13.5px;
  margin: 0 0 28px;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-field .form-control {
  height: 42px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 0 12px;
  font-size: 14px;
}
.auth-field .form-control:focus {
  border-color: var(--accent-500);
  box-shadow: var(--focus);
  background: var(--surface);
}
.auth-field .form-text {
  color: var(--text-mute);
  font-size: 11.5px;
  margin-top: 2px;
}
.auth-link {
  color: var(--accent-300);
  font-size: 12px;
  font-weight: 500;
}
.auth-link:hover { color: var(--accent-500); }

.auth-submit {
  height: 42px;
  width: 100%;
  border-radius: var(--r-sm);
  background: var(--accent-500);
  color: var(--accent-fg);
  border: 1px solid color-mix(in oklab, var(--accent-500) 70%, #000);
  font-weight: 500;
  font-size: 14px;
  margin-top: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.auth-submit:hover { background: var(--accent-600); }

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

.auth-foot {
  font-size: 13px;
  color: var(--text-mute);
  text-align: left;
}
.auth-foot a { color: var(--accent-300); font-weight: 500; }
.auth-foot a:hover { color: var(--accent-500); }

.auth-errors {
  background: var(--err-50);
  border: 1px solid color-mix(in oklab, var(--err-500) 30%, transparent);
  color: var(--err-700);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.auth-errors ul { margin: 0; padding-left: 18px; }

.auth-success {
  background: var(--ok-50);
  border: 1px solid color-mix(in oklab, var(--ok-500) 30%, transparent);
  color: var(--ok-700);
  border-radius: var(--r-md);
  padding: 16px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.auth-success strong { color: var(--ok-700); display: block; margin-bottom: 6px; font-size: 14px; }

/* Marketing panel (right) */
.auth-marketing-col {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background:
    radial-gradient(ellipse at 75% 25%, color-mix(in oklab, var(--accent-500) 18%, transparent), transparent 60%),
    radial-gradient(ellipse at 25% 80%, color-mix(in oklab, var(--accent-700) 18%, transparent), transparent 55%),
    var(--surface);
  border-left: 1px solid var(--line);
  overflow: hidden;
}
@media (max-width: 900px) { .auth-marketing-col { display: none; } }

.auth-marketing {
  max-width: 460px;
  position: relative;
  z-index: 2;
}
.auth-marketing-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-300);
  font-weight: 600;
  margin-bottom: 14px;
}
.auth-marketing-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--text);
}
.auth-marketing-sub {
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 0 28px;
  max-width: 42ch;
}
.auth-marketing-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.auth-stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}
.auth-stat-label {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.auth-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.18;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  z-index: 1;
}

/* Hide legacy container completely on auth */
body.auth-page .lt-legacy-container { display: none; }
body.auth-page .main-bare > .main-inner { padding: 0; }
body.auth-page .lt-flash-wrap { display: none; }

/* Password strength bar */
.pw-strength { display: flex; flex-direction: column; gap: 4px; }
.pw-strength-bar {
  height: 4px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.pw-strength-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent-500);
  transition: width 0.18s ease, background 0.18s ease;
  border-radius: var(--r-full);
}
.pw-strength-label { font-size: 11px; color: var(--text-mute); }
.conv-history {
  margin: 40px auto 48px;
  max-width: 1480px;
  padding: 0 24px;
}
.conv-history-head {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.conv-history-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0;
}
.conv-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.conv-empty {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--text-mute);
  padding: 16px 0;
}
.conv-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-width: 0;
}
.conv-row:hover {
  background: var(--surface-3);
  border-color: var(--accent-600);
}
.conv-row--active {
  border-color: var(--accent-500);
  background: color-mix(in srgb, var(--accent-500) 8%, var(--surface-2));
}
/* Left: topic + meta line */
.conv-row-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}
.conv-row-topic {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-row-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.conv-meta-project {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-400);
}
.conv-meta-domain,
.conv-meta-anchor {
  font-size: 11.5px;
  color: var(--text-mute);
}
.conv-meta-domain::before { content: '·'; margin-right: 6px; color: var(--line); }
.conv-meta-anchor::before { content: '·'; margin-right: 6px; color: var(--line); }
/* Right: chips, booking, date */
.conv-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.conv-row-chips {
  display: flex;
  gap: 4px;
}
.conv-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-mute);
  background: var(--surface-1);
  white-space: nowrap;
}
.conv-chip--on {
  border-color: var(--ok-border, #2f6b3e);
  color: var(--ok-text, #4ade80);
  background: var(--ok-bg, color-mix(in srgb, #4ade80 12%, transparent));
}
.conv-row-booking {
  font-size: 11px;
  color: var(--text-faint, var(--text-mute));
  white-space: nowrap;
}
.conv-row-date {
  font-size: 11px;
  color: var(--text-mute);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 700px) {
  .conv-list { grid-template-columns: 1fr; }
}
