/* LINK theme — aligned with 998 CRM (Inter body, Geist headings, shared tokens) */

html.link-app {
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Geist", "Inter", system-ui, -apple-system, sans-serif;

  /* LINK aliases used in link/styles.css */
  --text: var(--ink);
  --text-muted: var(--muted);
  --border: var(--line);
  --primary: var(--blue);
  --warning: #fbbf24;
  --danger: #ef4444;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
}

html.link-app[data-theme="light"] {
  color-scheme: light;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: rgba(37, 99, 235, 0.1);
  --ink: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --bg: #fafafa;
  --surface: #fff;
  --surface-muted: #f4f4f5;
  --panel: #fff;
  --panel-border: #e4e4e7;
  --topbar-bg: #fafafa;
  --overlay-bg: rgba(15, 23, 42, 0.35);
  --grid-color: transparent;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
  --success-bg: #ecfdf5;
  --success-ink: #047857;
  --success-line: #a7f3d0;
  --warn-bg: #fffbeb;
  --warn-ink: #b45309;
  --warn-line: #fde68a;
  --error-bg: #fef2f2;
  --error-ink: #b91c1c;
  --error-line: #fecaca;
  --info-bg: rgba(37, 99, 235, 0.08);
  --info-ink: #1d4ed8;
  --info-line: rgba(37, 99, 235, 0.2);
}

html.link-app[data-theme="dark"] {
  color-scheme: dark;
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --blue-soft: rgba(59, 130, 246, 0.1);
  --ink: #e8ecf4;
  --muted: #9aa3b2;
  --line: #2a3142;
  --bg: #151a23;
  --surface: #151a23;
  --surface-muted: #1e2432;
  --panel: #151a23;
  --panel-border: #2a3142;
  --topbar-bg: #151a23;
  --overlay-bg: rgba(2, 6, 23, 0.72);
  --grid-color: transparent;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --success-bg: rgba(6, 78, 59, 0.35);
  --success-ink: #4ade80;
  --success-line: rgba(74, 222, 128, 0.25);
  --warn-bg: rgba(120, 53, 15, 0.35);
  --warn-ink: #fbbf24;
  --warn-line: rgba(251, 191, 36, 0.25);
  --error-bg: rgba(127, 29, 29, 0.35);
  --error-ink: #fca5a5;
  --error-line: rgba(239, 68, 68, 0.25);
  --info-bg: rgba(59, 130, 246, 0.1);
  --info-ink: #60a5fa;
  --info-line: rgba(59, 130, 246, 0.25);
}

html.link-app .bg-grid {
  display: none;
}

html.link-app .topbar {
  backdrop-filter: none;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

html.link-app .topbar-inner {
  padding: 14px 24px;
}

html.link-app .brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
}

html.link-app .brand-version {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

html.link-app .badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 2px 8px;
}

html.link-app .subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

html.link-app .eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}

html.link-app h1,
html.link-app .link-hero h1,
html.link-app .hero h1,
html.link-app .link-auth-gate h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.33;
  letter-spacing: -0.02em;
}

html.link-app h2,
html.link-app .panel h2,
html.link-app .link-section-head h2,
html.link-app .link-posts-group-title,
html.link-app .settings-head h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.02em;
}

html.link-app .link-hero p,
html.link-app .lede,
html.link-app .panel-copy,
html.link-app .settings-copy {
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
}

html.link-app .settings-copy {
  font-size: 14px;
}

html.link-app .btn {
  font-weight: 500;
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

html.link-app .btn:hover {
  transform: none;
}

html.link-app .btn-primary {
  background: var(--blue);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), 0 12px 28px rgba(59, 130, 246, 0.22);
}

html.link-app .btn-primary:hover {
  background: var(--blue-dark);
}

html.link-app .btn-ghost {
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--line);
}

html.link-app .btn-ghost:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--blue) 50%, var(--line));
  background: transparent;
}

html.link-app a.btn {
  text-decoration: none;
}

html.link-app a.btn:hover {
  text-decoration: none;
}

html.link-app .btn-small {
  font-size: 14px;
  padding: 8px 16px;
  line-height: 1.25;
}

html.link-app .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  backdrop-filter: none;
  padding: 20px 22px;
}

html.link-app .panel-accent {
  background: var(--surface);
  border-color: var(--line);
}

html.link-app .stat-card,
html.link-app .link-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  backdrop-filter: none;
}

html.link-app .stat-value,
html.link-app .link-stat strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

html.link-app .stat-label,
html.link-app .link-stat span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

html.link-app .field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

html.link-app .field-input,
html.link-app .search {
  border-radius: 12px;
  font-size: 16px;
}

html.link-app .settings-dialog {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

html.link-app .link-post-title {
  font-size: 16px;
  font-weight: 500;
}

html.link-app .link-post-title:hover {
  color: var(--blue);
}

html.link-app .link-post-id {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  font-family: var(--font-body);
}

html.link-app .status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.35;
}

html.link-app .status-pill.is-draft {
  color: var(--blue);
  background: var(--blue-soft);
}

html.link-app .status-pill.is-scheduled {
  color: var(--warn-ink);
  background: var(--warn-bg);
}

html.link-app .status-pill.is-published {
  color: var(--success-ink);
  background: var(--success-bg);
}

html.link-app .status-pill.is-failed {
  color: var(--error-ink);
  background: var(--error-bg);
}

html.link-app .status-pill.is-publishing {
  color: var(--info-ink);
  background: var(--info-bg);
}

html.link-app .link-update-banner {
  background: var(--info-bg);
  border: 1px solid var(--info-line);
  border-radius: var(--radius-md);
}

html.link-app .link-oauth-banner {
  border-radius: var(--radius-md);
}

html.link-app .link-action-link {
  font-size: 14px;
  color: var(--muted);
}

html.link-app .link-action-link:hover {
  color: var(--ink);
}

html.link-app .theme-toggle .theme-icon-dark {
  display: none;
}

html.link-app[data-theme="dark"] .theme-toggle .theme-icon-light {
  display: none;
}

html.link-app[data-theme="dark"] .theme-toggle .theme-icon-dark {
  display: inline;
}

html.link-app .theme-toggle svg {
  flex-shrink: 0;
}
