:root {
  --cf-orange: #f6821f;
  --cf-blue: #0051c3;
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --text: #e8eef5;
  --muted: #8b9cb3;
  --border: #2d3a4f;
  --danger: #e5484d;
  --ok: #30a46c;
  --font: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; }

a { color: var(--cf-orange); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Homepage (landing v2) */
.landing-v2 {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #070b12;
  color: var(--text);
}
.landing-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.55;
}
.landing-glow-a {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(246, 130, 31, 0.35) 0%, transparent 70%);
  top: -120px;
  right: -80px;
}
.landing-glow-b {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(0, 81, 195, 0.4) 0%, transparent 70%);
  bottom: 10%;
  left: -120px;
}
.landing-nav-v2 {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}
.landing-logo:hover { text-decoration: none; color: #fff; }
.landing-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cf-orange), #ffb366);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(246, 130, 31, 0.35);
}
.landing-nav-actions { display: flex; gap: 0.65rem; align-items: center; }
.landing-btn-nav { border-radius: 10px; }
.landing-hero-v2 {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
}
.landing-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c5d4e8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.landing-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #30a46c;
  box-shadow: 0 0 0 4px rgba(48, 164, 108, 0.25);
}
.landing-hero-copy h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.landing-gradient-text {
  background: linear-gradient(90deg, var(--cf-orange), #ffd4a8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-lead {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 520px;
  margin: 0 0 1.75rem;
  line-height: 1.65;
}
.landing-cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.5rem; }
.landing-cta-primary {
  box-shadow: 0 10px 30px rgba(246, 130, 31, 0.35);
}
.landing-trust {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.landing-trust li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.landing-trust li::before {
  content: "✓";
  color: var(--cf-orange);
  font-weight: 700;
}
.landing-preview {
  background: linear-gradient(160deg, rgba(26, 35, 50, 0.95), rgba(15, 20, 30, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.landing-preview-chrome {
  display: flex;
  gap: 6px;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.landing-preview-chrome span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}
.landing-preview-body { padding: 1.25rem; }
.landing-preview-stat {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.landing-preview-label { font-size: 0.8rem; color: var(--muted); width: 100%; }
.landing-preview-stat strong { font-size: 1.75rem; }
.landing-preview-up { color: var(--ok); font-style: normal; font-size: 0.85rem; }
.landing-preview-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
.landing-preview-bar::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 72%;
  background: linear-gradient(90deg, var(--cf-blue), var(--cf-orange));
  border-radius: inherit;
}
.landing-preview-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.landing-preview-url { color: #93c5fd; word-break: break-all; }
.landing-preview-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #15803d;
  background: rgba(48, 164, 108, 0.2);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.landing-preview-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 80px;
  padding-top: 0.5rem;
}
.landing-preview-chart span {
  flex: 1;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.9), rgba(37, 99, 235, 0.25));
  border-radius: 6px 6px 2px 2px;
  min-height: 8px;
}
.landing-features {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.landing-feature-card {
  background: rgba(26, 35, 50, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s;
}
.landing-feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(246, 130, 31, 0.35);
}
.landing-feature-card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.landing-feature-card p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.landing-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.landing-feature-icon-orange { background: rgba(246, 130, 31, 0.15); color: var(--cf-orange); }
.landing-feature-icon-blue { background: rgba(0, 81, 195, 0.2); color: #60a5fa; }
.landing-feature-icon-teal { background: rgba(48, 164, 108, 0.15); color: var(--ok); }
.landing-footer-v2 {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem 2rem 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 1200px;
  margin: 0 auto;
}
.landing-footer-sep { opacity: 0.4; margin: 0 0.5rem; }

.landing { min-height: 100vh; background: linear-gradient(145deg, #0f1419 0%, #1a2a4a 50%, #0f1419 100%); }
.landing-nav { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 2rem; }
.logo { font-weight: 700; font-size: 1.25rem; color: var(--text); }
.landing-hero { max-width: 640px; margin: 8rem auto; padding: 0 1.5rem; text-align: center; }

/* Brand domain (e.g. shortreelzz.com) */
.brand-landing {
  min-height: 100vh;
  background: linear-gradient(160deg, #120818 0%, #2d1b4e 45%, #1a0a28 100%);
  color: #f5eef8;
}
.brand-nav, .secondary-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.brand-logo {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ff6bcb, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-hero { max-width: 720px; margin: 6rem auto 4rem; padding: 0 1.5rem; text-align: center; }
.brand-tag {
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d8b4fe;
  margin-bottom: 1rem;
}
.brand-hero h1 { font-size: 2.4rem; line-height: 1.15; margin-bottom: 1rem; }
.brand-lead { color: #c4b5d0; font-size: 1.05rem; max-width: 560px; margin: 0 auto 2rem; }
.brand-cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.brand-btn-primary {
  background: linear-gradient(90deg, #ec4899, #a855f7);
  color: #fff;
  border: none;
}
.brand-btn-primary:hover { filter: brightness(1.08); color: #fff; text-decoration: none; }
.brand-btn-ghost { border-color: rgba(255,255,255,0.25); color: #f5eef8; }
.brand-footer { text-align: center; padding: 2rem; color: #9ca3af; }
.brand-footer a { color: #e879f9; }

/* Secondary redirect domains */
.secondary-landing {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.secondary-logo { font-weight: 700; color: var(--muted); }
.secondary-hero {
  max-width: 520px;
  margin: 4rem auto;
  text-align: center;
}
.secondary-hero h1 { font-size: 1.5rem; margin-top: 0; }
.secondary-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.landing-hero h1 { font-size: 2.25rem; margin-bottom: 1rem; }
.landing-hero p { color: var(--muted); font-size: 1.1rem; }
.landing-hero-note { margin-top: 1.5rem; font-size: 0.9rem; }

.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; width: 100%; max-width: 400px; }
.auth-card h1 { margin-top: 0; font-size: 1.5rem; }
.auth-footer { margin-top: 1.5rem; color: var(--muted); font-size: 0.9rem; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--surface); border-right: 1px solid var(--border); padding: 1.25rem 0; flex-shrink: 0; }
.sidebar-brand { padding: 0 1.25rem 1rem; font-weight: 700; color: var(--cf-orange); }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-link { padding: 0.65rem 1.25rem; color: var(--muted); display: flex; align-items: center; gap: 0.5rem; }
.sidebar-link:hover, .sidebar-link.active { background: var(--surface2); color: var(--text); text-decoration: none; }
.sidebar-link.active { border-left: 3px solid var(--cf-orange); }
.sidebar-divider { height: 1px; background: var(--border); margin: 0.75rem 1.25rem; }

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); background: rgba(26, 35, 50, 0.6); }
.page-title { margin: 0; font-size: 1.25rem; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 1rem; }
.topbar-signout-link { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.topbar-signout-link:hover { color: var(--text); text-decoration: none; }
.profile-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface2); cursor: pointer; font-size: 1.1rem; }
.profile-menu { position: relative; }
.profile-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; min-width: 200px; padding: 0.5rem; z-index: 10; }
.profile-dropdown.open { display: flex; flex-direction: column; }
.profile-dropdown a { padding: 0.5rem 0.75rem; color: var(--text); border-radius: 6px; }
.profile-dropdown a:hover { background: var(--surface2); text-decoration: none; }
.profile-email { padding: 0.5rem 0.75rem; font-size: 0.85rem; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 0.25rem; }

.content { padding: 1.5rem; flex: 1; }

.btn { display: inline-block; padding: 0.55rem 1rem; border-radius: 8px; border: none; cursor: pointer; font-size: 0.95rem; font-weight: 500; }
.btn-primary { background: var(--cf-orange); color: #111; }
.btn-primary:hover { filter: brightness(1.05); text-decoration: none; color: #111; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

.input { width: 100%; padding: 0.6rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); margin-top: 0.35rem; margin-bottom: 1rem; }
.input-sm { width: auto; min-width: 7rem; padding: 0.35rem 0.5rem; margin: 0; font-size: 0.85rem; }
.role-form { display: inline; }
label { display: block; font-size: 0.9rem; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; margin-bottom: 1rem; }
.card-narrow { max-width: 480px; }
.chart-card h2 { margin-top: 0; font-size: 1rem; color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat-value-sm { font-size: 1.15rem; line-height: 1.3; word-break: break-word; }
.truncate-inline { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.link-stats-hero {
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(0, 81, 195, 0.12) 100%);
  border-color: rgba(246, 130, 31, 0.35);
}
.link-stats-hero-top { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.link-id-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(246, 130, 31, 0.2);
  color: var(--cf-orange);
}
.link-stats-short { font-size: 1.15rem; margin: 0.35rem 0; font-weight: 600; }
.link-stats-dest { color: var(--muted); margin: 0; font-size: 0.9rem; max-width: 100%; }
.link-stats-kpis .stat-card-accent { position: relative; overflow: hidden; }
.link-stats-kpis .stat-card-icon {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-size: 1.35rem;
  opacity: 0.85;
}
.link-stats-kpis .stat-card-icon.flag-lg { font-size: 1.75rem; }
.card-head-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.card-head-row h2 { margin: 0; }
.link-stats-panel h2 { margin-top: 0; font-size: 1rem; color: var(--text); }
.link-stats-chart { padding-bottom: 0.5rem; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list-simple li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.rank-list-bars li {
  padding: 0.65rem 0 0.75rem;
  border-bottom: 1px solid var(--border);
}
.rank-row-main { display: flex; align-items: center; gap: 0.55rem; font-size: 0.92rem; margin-bottom: 0.35rem; }
.rank-row-stats { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.35rem; }
.rank-count { font-weight: 600; color: var(--cf-orange); }
.rank-pct { color: var(--muted); }
.rank-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
}
.rank-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cf-orange), #ffb366);
  min-width: 2px;
}
.rank-empty { padding: 1rem 0; }
.rank-list em { color: var(--muted); font-style: normal; font-size: 0.85rem; }
.flag-img, .flag-emoji { flex-shrink: 0; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }
.device-icon-lg { font-size: 1.25rem; width: 1.5rem; text-align: center; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list-rich .activity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.activity-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.activity-avatar img { width: 100%; height: 100%; object-fit: cover; }
.activity-avatar-fallback { font-size: 1.5rem; }
.activity-body { flex: 1; min-width: 0; }
.activity-main { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.activity-time { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.activity-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}
.activity-referer { margin-top: 0.45rem; font-size: 0.82rem; word-break: break-all; }
.link-stats-back { margin-top: 0.5rem; }
.stat-grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 600px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.stat-label { display: block; color: var(--muted); font-size: 0.85rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--cf-orange); }
.stat-sub { font-size: 0.85rem; color: var(--muted); }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--muted); font-weight: 500; }
.data-table th .sort-link { color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; }
.data-table th .sort-link:hover { color: var(--cf-orange); text-decoration: none; }
.data-table th .sort-link.is-active { color: var(--cf-orange); }
.data-table-links .admin-col-preview { width: 52px; padding-left: 0.35rem; padding-right: 0.35rem; }
.data-table-links .cell-owner { min-width: 160px; }
.data-table-links .cell-created { white-space: nowrap; color: var(--muted); font-size: 0.85rem; }
.data-table-links .cell-owner-inner { flex-wrap: wrap; }
.data-table-links .cell-dest { max-width: 280px; }
.data-table-links .cell-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table-links th:nth-child(7),
.data-table-links th:nth-child(8) { text-align: right; }
.link-stats-owner { margin-top: 0.5rem; }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-success { background: rgba(48, 164, 108, 0.15); border: 1px solid var(--ok); }
.alert-danger { background: rgba(229, 72, 77, 0.15); border: 1px solid var(--danger); }
.alert-warning { background: rgba(246, 130, 31, 0.15); border: 1px solid var(--cf-orange); }
.alert-info { background: rgba(0, 81, 195, 0.15); border: 1px solid var(--cf-blue); }

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.tab { padding: 0.5rem 1rem; border-radius: 8px; color: var(--muted); border: 1px solid transparent; }
.tab.active, .tab:hover { background: var(--surface); border-color: var(--border); color: var(--text); text-decoration: none; }

.badge { font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 999px; }
.badge.ok { background: rgba(48, 164, 108, 0.2); color: var(--ok); }
.badge.warn { background: rgba(246, 130, 31, 0.2); color: var(--cf-orange); }
.badge.muted { background: var(--surface2); color: var(--muted); }

.actions { white-space: nowrap; }
.inline-form { display: inline; }
.search-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; max-width: 480px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1.5fr; gap: 1rem; }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.chart-row-3 { grid-template-columns: repeat(3, 1fr); }
.admin-stats-range { display: flex; align-items: center; }
.admin-segmented { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }
.admin-seg {
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
}
.admin-seg:hover { color: var(--text); text-decoration: none; }
.admin-seg.active { background: var(--cf-orange); color: #fff; border-color: var(--cf-orange); }
.admin-stats-kpis { margin-bottom: 1.25rem; }
.admin-cache-note { margin: 0 0 1rem; font-size: 0.85rem; }

.admin-traffic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 960px) {
  .admin-traffic-grid { grid-template-columns: 1fr; }
}
.admin-traffic-pill {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: var(--muted);
}
.admin-traffic-pill.is-live {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}
.admin-traffic-active-row .checkbox-label { font-weight: 600; cursor: pointer; }
.admin-traffic-subtitle { font-size: 0.95rem; margin: 1rem 0 0.35rem; }
.admin-traffic-breakdown { margin: 0; padding-left: 1.2rem; font-size: 0.9rem; }

.admin-home-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(0, 81, 195, 0.14) 55%, rgba(246, 130, 31, 0.1) 100%);
  border-color: rgba(246, 130, 31, 0.25);
}
.admin-home-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cf-orange);
}
.admin-home-title { margin: 0; font-size: 1.45rem; }
.admin-home-lead { margin: 0.5rem 0 0; max-width: 36rem; }
.admin-home-quick { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.admin-quick-link {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  text-decoration: none;
}
.admin-quick-link:hover { border-color: var(--cf-orange); color: var(--cf-orange); text-decoration: none; }
.admin-home-kpis { margin-bottom: 1.25rem; }
.admin-kpi-card { position: relative; padding-top: 1.5rem; }
.admin-kpi-icon {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-size: 1.35rem;
  opacity: 0.9;
}
.admin-kpi-clicks { border-top: 3px solid var(--cf-orange); }
.admin-kpi-users { border-top: 3px solid #0051c3; }
.admin-kpi-links { border-top: 3px solid #22c55e; }
.admin-kpi-traffic { border-top: 3px solid #a855f7; }
.admin-home-charts { margin-bottom: 1rem; }
.admin-home-breakdown { margin-bottom: 1rem; }
.admin-home-rank-compact li { padding: 0.5rem 0 0.6rem; }
.admin-home-meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.admin-home-meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.admin-home-meta-list li span { color: var(--muted); }
.admin-home-meta-list li strong { color: var(--cf-orange); font-variant-numeric: tabular-nums; }
.admin-home-owner { display: block; font-size: 0.78rem; margin-top: 0.15rem; }
.admin-home-tables { margin-top: 0.25rem; }
.admin-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #22c55e;
}
.admin-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: admin-live-pulse 2s infinite;
}
@keyframes admin-live-pulse {
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.admin-stats-main-chart { margin-bottom: 1rem; }
.admin-stats-tables { margin-top: 0.25rem; }
.data-table-compact th, .data-table-compact td { padding: 0.45rem 0.4rem; font-size: 0.82rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hint { color: var(--muted); font-size: 0.85rem; }
.checkbox { display: flex; align-items: center; gap: 0.5rem; color: var(--text); margin-bottom: 1rem; }
.code-block { background: var(--bg); padding: 1rem; border-radius: 8px; overflow-x: auto; font-size: 0.85rem; }
.cf-list { color: var(--muted); }
.setup-steps { line-height: 1.65; padding-left: 1.25rem; }
.setup-steps li { margin-bottom: 0.65rem; }
.setup-steps code { font-size: 0.88em; }
.cf-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .grid-2, .chart-row, .chart-row-3 { grid-template-columns: 1fr; }
}

/* —— User dashboard (LinkCut-style light UI) —— */
body.user-dash {
  --ud-sidebar: #ffffff;
  --ud-sidebar-hover: #f1f5f9;
  --ud-sidebar-accent: #2563eb;
  --ud-sidebar-glow: rgba(37, 99, 235, 0.08);
  --ud-bg: #e8ecf1;
  --ud-card: #ffffff;
  --ud-text: #0f172a;
  --ud-muted: #64748b;
  --ud-border: #e2e8f0;
  --ud-primary: #2563eb;
  --ud-primary-hover: #1d4ed8;
  background: var(--ud-bg);
  color: var(--ud-text);
}
body.user-dash a:not(.ud-btn) { color: var(--ud-primary); }

.ud-shell { display: flex; min-height: 100vh; }
.ud-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--ud-sidebar);
  color: var(--ud-text);
  display: flex;
  flex-direction: column;
  padding: 1.35rem 0 1.25rem;
  box-shadow: 1px 0 0 var(--ud-border);
  border-right: 1px solid var(--ud-border);
}
.ud-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.15rem 1.35rem;
  margin: 0 0.75rem 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ud-text);
  text-decoration: none;
  border-bottom: 1px solid var(--ud-border);
}
.ud-brand:hover { text-decoration: none; color: var(--ud-text); }
.ud-brand-text { letter-spacing: -0.02em; }
.ud-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f6821f, #ffb366);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(246, 130, 31, 0.35);
  flex-shrink: 0;
}
.ud-nav-label {
  margin: 0.25rem 1.15rem 0.5rem;
  padding: 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ud-muted);
}
.ud-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; padding: 0 0.85rem; }
.ud-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: var(--ud-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
body.user-dash .ud-nav-link { color: var(--ud-muted); }
body.user-dash .ud-nav-link:hover { color: var(--ud-text); }
.ud-nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #f6821f, #3b82f6);
  transition: height 0.15s;
}
.ud-nav-link:hover {
  background: var(--ud-sidebar-hover);
  text-decoration: none;
}
.ud-nav-link.active {
  background: var(--ud-sidebar-glow);
  color: var(--ud-primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}
body.user-dash .ud-nav-link.active { color: var(--ud-primary); }
.ud-nav-link.active::before { height: 60%; }
.ud-nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--ud-border);
  color: var(--ud-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ud-nav-icon svg { width: 18px; height: 18px; opacity: 0.95; }
.ud-nav-link.active .ud-nav-icon {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--ud-primary);
}
.ud-nav-text { flex: 1; }
.ud-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  margin: 1rem 0.85rem 0;
  margin-top: auto;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--ud-border);
}
.ud-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  flex-shrink: 0;
}
.ud-user-meta { display: flex; flex-direction: column; font-size: 0.85rem; min-width: 0; }
.ud-user-name {
  font-weight: 600;
  color: var(--ud-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ud-user-links { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.ud-user-meta a { color: var(--ud-primary); font-size: 0.78rem; text-decoration: none; }
.ud-user-meta a:hover { text-decoration: underline; }
.ud-user-meta a.ud-signout-link { color: var(--ud-muted, #64748b); }
.ud-user-meta a.ud-signout-link:hover { color: var(--ud-text); }
.ud-nav-link-signout { margin-top: 0.35rem; color: var(--ud-muted, #64748b) !important; }
.ud-nav-link-signout:hover { color: var(--ud-text) !important; }

.ud-main { flex: 1; padding: 0 2.5rem 2rem; min-width: 0; }
.ud-ticker {
  overflow: hidden;
  margin: 0 -2.5rem 1.25rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--ud-border);
  text-align: center;
}
.ud-ticker-slide {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.45;
  transition: opacity 0.35s ease;
}
.ud-ticker-slide.is-fading { opacity: 0; }
.ud-ticker a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ud-ticker a:hover { opacity: 0.85; }
.ud-ticker-preview { margin: 0; border-radius: 8px; border: 1px solid var(--ud-border); }
.color-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; }
.color-row label { flex: 1; min-width: 140px; }
.input-color { padding: 0.15rem; height: 2.5rem; cursor: pointer; }
.ticker-message-list { display: flex; flex-direction: column; gap: 0.75rem; }
.ticker-message-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: var(--surface2);
}
.ticker-message-item summary { cursor: pointer; list-style: none; }
.ticker-message-item summary::-webkit-details-marker { display: none; }
.ticker-message-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ticker-message-preview { flex: 1; min-width: 120px; color: var(--muted); font-size: 0.9rem; }
.ticker-edit-form { margin-top: 0.75rem; }
.ticker-delete-form { margin-top: 0.5rem; }
.form-row-inline { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin: 0.75rem 0; }
.form-actions-inline { display: flex; gap: 0.5rem; align-items: center; }
.mt-lg { margin-top: 1.5rem; }
.ud-impersonation-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.9rem;
}
.ud-impersonation-form { margin: 0; }
.ud-btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.admin-user-loc { display: inline-flex; align-items: center; gap: 0.4rem; }
.admin-signup-ip { font-size: 0.82rem; color: var(--muted); }
.ud-page-title { margin: 0 0 1.5rem; font-size: 1.75rem; font-weight: 700; }
.ud-muted { color: var(--ud-muted); font-size: 0.9rem; }

.ud-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.ud-stat-row-4 {
  grid-template-columns: repeat(4, 1fr);
}
.ud-stat-row-5 {
  grid-template-columns: repeat(5, 1fr);
}
.ud-analytics-period-row { margin-top: 0; }

.ud-period-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}
.ud-period-card {
  position: relative;
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--ud-border);
  border-radius: 14px;
  padding: 1.1rem 1.15rem 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.ud-period-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
  background: var(--ud-primary, #2563eb);
  opacity: 0.85;
}
.ud-period-card--today::before { background: #2563eb; }
.ud-period-card--yesterday::before { background: #6366f1; }
.ud-period-card--month::before { background: #0891b2; }
.ud-period-card--last-month::before { background: #64748b; }
.ud-period-card--overall {
  background: linear-gradient(165deg, #eff6ff 0%, #f8fafc 55%, #ffffff 100%);
  border-color: #bfdbfe;
}
.ud-period-card--overall::before { background: #1d4ed8; width: 5px; }
.ud-period-card:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.ud-period-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ud-muted);
  margin-bottom: 0.45rem;
  padding-left: 0.15rem;
}
.ud-period-value {
  display: block;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--ud-text);
  font-variant-numeric: tabular-nums;
  padding-left: 0.15rem;
}
.ud-period-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--ud-muted);
  padding-left: 0.15rem;
}
@media (max-width: 1200px) {
  .ud-period-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ud-period-card--overall { grid-column: span 1; }
}
@media (max-width: 720px) {
  .ud-period-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ud-period-card--overall { grid-column: 1 / -1; }
}
.ud-country-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.ud-country-cell .flag-img { border-radius: 2px; vertical-align: middle; }
.ud-referrer-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
}
.ud-referrer-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ud-referrer-cell .brand-ic { flex-shrink: 0; }
@media (max-width: 1100px) {
  .ud-stat-row-4 { grid-template-columns: repeat(2, 1fr); }
  .ud-stat-row-5 { grid-template-columns: repeat(2, 1fr); }
}
.ud-stat-row-compact { margin-bottom: 1rem; }
.ud-stat-card {
  background: var(--ud-card);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--ud-border);
}
.ud-stat-label { display: block; font-size: 0.85rem; color: var(--ud-muted); margin-bottom: 0.35rem; }
.ud-stat-value { font-size: 2rem; font-weight: 700; color: var(--ud-text); line-height: 1.1; }
.ud-stat-value-sm { font-size: 1.15rem; font-weight: 700; }
.ud-stat-value-row { display: flex; align-items: center; gap: 0.5rem; }
.ud-stat-trend { color: #16a34a; font-size: 1.25rem; }
.ud-stat-sub { display: block; font-size: 0.85rem; color: var(--ud-muted); margin-top: 0.25rem; }

.ud-card {
  background: var(--ud-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--ud-border);
}
.ud-card-narrow { max-width: 480px; }
.ud-card-title { margin: 0 0 1.25rem; font-size: 1.1rem; font-weight: 600; }
.ud-card-footer { margin: 1rem 0 0; font-size: 0.9rem; }

.ud-og-details { margin-top: 1.25rem; border-top: 1px solid var(--ud-border); padding-top: 1rem; }
.ud-og-summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.5rem; }
.ud-og-hint { margin: 0 0 1rem; font-size: 0.85rem; }
.ud-field-inline label { display: inline; font-size: 0.9rem; color: var(--ud-text); }

.ud-create-form .ud-input { margin-bottom: 0; }
.ud-create-url { margin-bottom: 1rem; }
.ud-create-landing { margin-bottom: 0.75rem; }
.ud-create-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
}
.ud-field label { display: block; font-size: 0.8rem; color: var(--ud-muted); margin-bottom: 0.35rem; }
.ud-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--ud-border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--ud-text);
}
.ud-input:focus { outline: 2px solid rgba(37, 99, 235, 0.35); border-color: var(--ud-primary); }
.ud-select { appearance: auto; }

.ud-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: var(--ud-text);
  text-decoration: none;
}
.ud-btn-primary { background: var(--ud-primary); color: #fff; border-color: var(--ud-primary); }
body.user-dash a.ud-btn-primary,
body.user-dash a.ud-btn-primary:hover,
body.user-dash a.ud-btn-primary:visited,
body.user-dash a.ud-btn-primary:focus {
  color: #fff;
  text-decoration: none;
}
.ud-btn-primary:hover { background: var(--ud-primary-hover); color: #fff; text-decoration: none; }
.ud-btn-ghost { border-color: var(--ud-border); background: #fff; }
.ud-btn-lg { padding: 0.7rem 1.35rem; font-size: 1rem; }
.ud-btn-copy { border: 1px solid var(--ud-border); padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.ud-btn-menu { border: 1px solid var(--ud-border); padding: 0.35rem 0.65rem; font-size: 0.85rem; color: var(--ud-muted); }
.ud-btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

.ud-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ud-table th {
  text-align: left;
  padding: 0.75rem 0.5rem;
  color: var(--ud-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--ud-border);
}
.ud-table td { padding: 0.85rem 0.5rem; border-bottom: 1px solid var(--ud-border); vertical-align: middle; }
.ud-col-preview { width: 52px; padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
.ud-link-preview-thumb {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--ud-border);
  background: var(--ud-bg, #f8fafc);
}
.ud-link-preview-empty {
  display: inline-block;
  width: 40px;
  text-align: center;
  color: var(--ud-muted);
  font-size: 0.85rem;
}

.ud-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.ud-gallery-item {
  border: 1px solid var(--ud-border);
  border-radius: 12px;
  padding: 0.55rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ud-gallery-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 0.5rem;
}
.ud-gallery-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ud-gallery-actions form { margin: 0; }
.ud-gallery-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.2;
  padding: 0.48rem 0.65rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ud-gallery-actions .ud-btn-copy {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}
.ud-gallery-actions .ud-btn-copy:hover {
  background: #dbeafe;
  color: #1e40af;
}
.ud-gallery-btn-play {
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #fff;
}
.ud-gallery-btn-play:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.ud-gallery-btn-delete {
  background: #fff;
  border: 1px solid #fecaca;
  color: #dc2626;
}
.ud-gallery-btn-delete:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.ud-gallery-meta { margin: 0.35rem 0 0; font-size: 0.75rem; }

.ud-gallery-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 480px));
  gap: 1.25rem;
  align-items: start;
  justify-content: start;
  margin-bottom: 1.25rem;
}
.ud-gallery-top .ud-card {
  margin-bottom: 0;
  width: 100%;
}
.ud-gallery-example .hint { display: none; }
.ud-gallery-example .ud-card-title { margin-bottom: 0.75rem; }
.ud-example-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.ud-example-shot {
  margin: 0;
}
.ud-example-shot > img,
.ud-example-frame > img:first-child {
  width: 100%;
  height: 112px;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center top;
  border-radius: 10px;
  display: block;
  background: #f8fafc;
}
.ud-example-frame {
  position: relative;
  display: block;
}
.ud-example-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.ud-example-shot figcaption {
  margin-top: 0.4rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ud-muted);
}
@media (max-width: 900px) {
  .ud-gallery-top { grid-template-columns: 1fr; }
}

.ud-play-dialog {
  border: none;
  border-radius: 14px;
  padding: 1.1rem 1.15rem 1rem;
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  box-shadow: 0 16px 50px rgba(15, 23, 42, 0.25);
  color: var(--ud-text);
}
.ud-play-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.ud-play-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.ud-play-head .ud-card-title { margin: 0; }
.ud-play-styles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0;
}
.ud-play-style {
  width: 48px;
  height: 48px;
  padding: 4px;
  border-radius: 10px;
  border: 2px solid var(--ud-border);
  background: #f8fafc;
  cursor: pointer;
  line-height: 0;
}
.ud-play-style img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.ud-play-style.is-selected,
.ud-play-sizes .is-selected {
  border-color: var(--ud-primary, #2563eb);
  background: #eff6ff;
}
.ud-play-sizes { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.85rem; }
.ud-play-stage-wrap { text-align: center; }
.ud-play-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
}
.ud-play-preview {
  display: block;
  max-width: 100%;
  max-height: 360px;
  width: auto;
  height: auto;
}
.ud-play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.ud-btn-sm { padding: 0.35rem 0.55rem; font-size: 0.8rem; }
.ud-gallery-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.ud-gallery-pick {
  padding: 2px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  line-height: 0;
}
.ud-gallery-pick img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.ud-gallery-pick.is-selected {
  border-color: var(--ud-primary, #2563eb);
  box-shadow: 0 0 0 1px var(--ud-primary, #2563eb);
}
.ud-gallery-pick:focus-visible {
  outline: 2px solid var(--ud-primary, #2563eb);
  outline-offset: 2px;
}
.ud-link-short { font-weight: 500; }
.ud-time-cell {
  color: var(--ud-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.ud-truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ud-muted); }
.ud-empty { text-align: center; color: var(--ud-muted); padding: 2rem !important; }

.ud-actions { position: relative; display: inline-block; }
.ud-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--ud-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  min-width: 120px;
  z-index: 20;
  padding: 0.35rem 0;
}
.ud-menu a, .ud-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.85rem;
  border: none;
  background: none;
  font: inherit;
  color: var(--ud-text);
  cursor: pointer;
  text-decoration: none;
}
.ud-menu a:hover, .ud-menu button:hover { background: #f1f5f9; text-decoration: none; }
.ud-menu-danger { color: #dc2626 !important; }
.ud-menu form { margin: 0; }

.ud-card-highlight {
  border-color: #bfdbfe;
  background: linear-gradient(165deg, #ffffff 0%, #f0f9ff 100%);
}
.ud-apply-all-confirm label {
  font-size: 0.9rem;
  color: var(--ud-text);
  cursor: pointer;
}
.ud-alias-mp4 {
  margin-top: 0.45rem;
}
.ud-alias-mp4 label {
  font-size: 0.9rem;
  color: var(--ud-text);
  cursor: pointer;
  font-weight: 400;
}

.ud-bulk-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 1px solid var(--ud-border);
}
.ud-bulk-banner--pending,
.ud-bulk-banner--processing {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}
.ud-bulk-banner--completed {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.ud-bulk-banner-text { margin: 0; font-size: 0.92rem; }
.ud-bulk-banner-dismiss { margin: 0; }
.ud-badge-ok { color: #15803d; font-weight: 600; font-size: 0.8rem; }
.ud-badge-warn { color: #b45309; font-weight: 600; font-size: 0.8rem; }
.ud-badge-muted { color: var(--ud-muted); font-weight: 600; font-size: 0.8rem; }
.ud-badge-err { color: #b91c1c; font-weight: 600; font-size: 0.8rem; }

.ud-alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.ud-alert-success { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.ud-alert-danger { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.ud-alert-warning { background: #ffedd5; border: 1px solid #fdba74; color: #9a3412; }
.ud-alert-info { background: #dbeafe; border: 1px solid #93c5fd; color: #1e40af; }

.ud-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.ud-tab {
  padding: 0.45rem 1rem;
  border-radius: 8px;
  color: var(--ud-muted);
  text-decoration: none;
  border: 1px solid transparent;
}
.ud-tab.active, .ud-tab:hover { background: var(--ud-card); border-color: var(--ud-border); color: var(--ud-text); }

.ud-results-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ud-pagination { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; font-size: 0.9rem; }
.ud-help-list { line-height: 1.7; padding-left: 1.25rem; color: var(--ud-text); }
.ud-hr { border: none; border-top: 1px solid var(--ud-border); margin: 1.25rem 0; }
.ud-code {
  background: #f1f5f9;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
}

.ud-stats-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ud-stats-head .ud-page-title { margin-bottom: 0; }
body.user-dash .ud-stats-body .card {
  background: var(--ud-card);
  border-color: var(--ud-border);
  color: var(--ud-text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
body.user-dash .ud-stats-body .stat-card { background: var(--ud-card); border-color: var(--ud-border); }
body.user-dash .ud-stats-body .stat-label { color: var(--ud-muted); }
body.user-dash .ud-stats-body .stat-value { color: var(--ud-primary); }
body.user-dash .ud-stats-body .hint { color: var(--ud-muted); }
body.user-dash .ud-stats-body .chip { background: #f1f5f9; border-color: var(--ud-border); color: var(--ud-text); }

/* Link stats — recent activity feed */
.recent-activity-panel { padding-top: 1rem; }
.recent-activity-heading {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ud-muted);
  border-bottom: 1px solid var(--ud-border);
  padding-bottom: 0.75rem;
}
.recent-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.recent-activity-item {
  display: flex;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--ud-border);
  align-items: flex-start;
}
.recent-activity-item:last-child { border-bottom: none; }
.recent-activity-flag {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px solid var(--ud-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.recent-activity-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-activity-flag-fallback { font-size: 1.4rem; line-height: 1; }
.recent-activity-body { flex: 1; min-width: 0; }
.recent-activity-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}
.recent-activity-place {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ud-text);
}
.recent-activity-when {
  font-size: 0.85rem;
  color: var(--ud-muted);
  white-space: nowrap;
}
.recent-activity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.25rem;
  font-size: 0.88rem;
  color: #64748b;
}
.recent-activity-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}
.recent-activity-ref {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-ic {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}
.brand-ic svg { width: 18px; height: 18px; display: block; }
.brand-ic-muted svg { width: 16px; height: 16px; }
.recent-activity-empty {
  padding: 1.5rem 0;
  color: var(--ud-muted);
  font-size: 0.9rem;
}

@media (max-width: 960px) {
  .landing-hero-v2 { grid-template-columns: 1fr; padding-top: 2rem; }
  .landing-features { grid-template-columns: 1fr; }
  .landing-hero-visual { order: -1; max-width: 420px; margin: 0 auto; }
  .ud-shell { flex-direction: column; }
  .ud-sidebar { width: 100%; }
  .ud-stat-row { grid-template-columns: 1fr; }
  .ud-create-row { grid-template-columns: 1fr; }
  .ud-main { padding: 0 1.25rem 1.25rem; }
  .ud-ticker { margin-left: -1.25rem; margin-right: -1.25rem; }
}

/* Analytics overview */
.ud-analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.ud-page-title-tight { margin-bottom: 0; }
.ud-analytics-toolbar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.ud-select-inline { width: auto; min-width: 10rem; margin: 0; }
.ud-range-form { margin: 0; }
.ud-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.ud-card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.ud-card-head-row .ud-card-title { margin-bottom: 0; }
.ud-card-head-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.ud-segmented {
  display: inline-flex;
  border: 1px solid var(--ud-border);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}
.ud-seg {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  color: var(--ud-muted);
  text-decoration: none;
  border-right: 1px solid var(--ud-border);
}
.ud-seg:last-child { border-right: none; }
.ud-seg.active { background: #fff; color: var(--ud-primary); font-weight: 600; }
.ud-analytics-chart-card { margin-bottom: 1.25rem; }
.ud-analytics-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.ud-analytics-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.ud-metric-card {
  background: var(--ud-card);
  border: 1px solid var(--ud-border);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.ud-table-scroll {
  overflow: auto;
  max-height: 32rem;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--ud-border);
  background: #fff;
}
.ud-table-analytics-recent thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  border-bottom: 1px solid var(--ud-border);
}
.ud-table-analytics-recent tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.85);
}
.ud-table-analytics-recent tbody tr:hover {
  background: #eff6ff;
}
.ud-table-analytics-recent td {
  vertical-align: middle;
}
.ud-analytics-col-side .ud-card {
  border-radius: 14px;
}
.ud-metric-big-row { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.ud-metric-big { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.ud-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.ud-pill-up { background: #dcfce7; color: #15803d; }
.ud-pill-down { background: #fee2e2; color: #b91c1c; }
.ud-metric-link { display: block; font-weight: 600; margin: 0.35rem 0; word-break: break-all; }
.ud-metric-spark-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ud-metric-clicks { font-size: 0.9rem; color: var(--ud-muted); white-space: nowrap; }
.ud-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #15803d;
  font-weight: 600;
}
.ud-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}
.ud-table-compact td, .ud-table-compact th { padding: 0.55rem 0.45rem; font-size: 0.85rem; }
.ud-geo-list { list-style: none; margin: 0; padding: 0; }
.ud-geo-list li {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--ud-border);
}
.ud-geo-name { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.ud-geo-bar-wrap {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.ud-geo-bar { display: block; height: 100%; background: #2563eb; border-radius: 999px; min-width: 2px; }
.ud-geo-count { font-weight: 600; color: var(--ud-muted); font-size: 0.8rem; }
.ud-referrer-split { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.ud-donut-wrap { width: 160px; height: 160px; flex-shrink: 0; }
.ud-ref-list { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 140px; }
.ud-ref-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--ud-border);
}
.ud-device-row { display: flex; justify-content: space-around; gap: 0.5rem; text-align: center; }
.ud-device { flex: 1; padding: 0.5rem; }
.ud-device-icon { display: block; font-size: 1.75rem; margin-bottom: 0.35rem; }
.ud-device-name { display: block; font-size: 0.85rem; color: var(--ud-muted); }
.ud-device-pct { display: block; font-weight: 700; margin-top: 0.25rem; }

@media (max-width: 1100px) {
  .ud-analytics-grid { grid-template-columns: 1fr; }
  .ud-analytics-metrics-row { grid-template-columns: 1fr; }
}

.lp-public-body { background: #0b1220; }
.lp-public {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
}
.lp-card {
  width: min(720px, 100%);
  background: #fff;
  color: #0f172a;
  border-radius: 22px;
  padding: 1.5rem 1.15rem 1.6rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  text-align: center;
}
.lp-card-gallery { width: min(1040px, 100%); }
.lp-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 0 1.35rem;
}
.lp-images-single { grid-template-columns: 1fr; }
.lp-images-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lp-image-link {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: #e2e8f0;
}
.lp-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  height: auto;
  max-height: none;
  object-fit: cover;
  object-position: center;
  border-radius: 16px;
  margin: 0;
  display: block;
}
.lp-images-single .lp-image {
  aspect-ratio: auto;
  max-height: 78vh;
  object-fit: contain;
  background: #f8fafc;
}
.lp-image-link:hover .lp-image { transform: scale(1.015); }
.lp-image-link .lp-image { transition: transform 0.2s ease; }
@media (min-width: 760px) {
  .lp-card { padding: 1.75rem 1.4rem 1.8rem; }
  .lp-images { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; }
  .lp-images-single { grid-template-columns: 1fr; }
  .lp-images-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.lp-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, 96px);
  gap: 0.55rem;
  margin-top: 0.5rem;
}
.lp-gallery-thumbs .ud-gallery-pick-item { position: relative; display: block; cursor: pointer; margin: 0; }
.lp-gallery-thumbs .ud-gallery-pick-item input { position: absolute; opacity: 0; }
.lp-gallery-thumbs img,
.lp-gallery-thumbs .lp-thumb {
  width: 96px;
  height: 96px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  border: 2px solid transparent;
  display: block;
  background: #f8fafc;
}
.lp-gallery-thumbs .ud-gallery-pick-item input:checked + img {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
}
.lp-card h1 { margin: 0 0 0.75rem; font-size: 1.85rem; line-height: 1.25; }
.lp-copy {
  margin: 0 0 1.25rem;
  white-space: pre-line;
  color: #334155;
  line-height: 1.55;
}
.lp-cta {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
}
.lp-cta:hover { background: #1d4ed8; }
