:root {
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-lg: 0 22px 60px rgba(16, 31, 36, 0.16);
  --shadow-md: 0 14px 34px rgba(16, 31, 36, 0.10);
  --shadow-sm: 0 8px 22px rgba(16, 31, 36, 0.08);
}

@font-face {
  font-family: "Manrope";
  src: url("fonts/Manrope-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

body[data-theme="light"] {
  --bg: #F2F8F7;
  --bg-soft: #F2F8F7;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-2: #eef5f3;
  --sidebar: linear-gradient(180deg, #103536 0%, #173f41 100%);
  --text: #102227;
  --muted: #60757b;
  --border: rgba(17, 53, 54, 0.09);
  --accent: #0d8b77;
  --accent-strong: #0a6b5d;
  --accent-soft: #dff4ef;
  --danger: #a73b32;
}

body[data-theme="dark"] {
  --bg: #0d161a;
  --bg-soft: #122027;
  --surface: rgba(19, 31, 37, 0.84);
  --surface-solid: #15242a;
  --surface-2: #1b2d34;
  --sidebar: linear-gradient(180deg, #081116 0%, #102027 100%);
  --text: #e6f1ee;
  --muted: #8ea5ad;
  --border: rgba(222, 240, 236, 0.08);
  --accent: #27b89f;
  --accent-strong: #1a9b85;
  --accent-soft: rgba(39, 184, 159, 0.14);
  --danger: #ef8d86;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: background 0.2s ease, color 0.2s ease;
}

body.no-scroll {
  overflow: hidden;
}

a,
button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.app-viewport {
  min-height: 100vh;
  transition: opacity 0.08s ease;
}

.page-transitioning {
  opacity: 0.98;
  pointer-events: none;
}

.page-spinner {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.card {
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 1.3rem;
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.brand-badge:hover {
  opacity: 0.85;
}

.brand-badge::after {
  content: '.ai';
  font-size: 0.75em;
  color: var(--accent);
  margin-left: 2px;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr minmax(360px, 520px);
}

.auth-hero {
  position: relative;
  padding: 72px clamp(28px, 5vw, 72px);
  display: flex;
  align-items: flex-end;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.18), transparent 22%),
    linear-gradient(140deg, #123a3d 0%, #0f6461 52%, #0d8b77 100%);
  color: #f8fffd;
  overflow: hidden;
}

.auth-hero--register {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.14), transparent 22%),
    linear-gradient(140deg, #0d3244 0%, #125876 48%, #1b8a96 100%);
}

.auth-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.auth-hero h1 {
  margin: 18px 0 14px;
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.auth-hero p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(248, 255, 253, 0.86);
}

.auth-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.auth-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.92rem;
  color: rgba(248, 255, 253, 0.92);
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-card {
  width: min(100%, 460px);
  padding: 34px;
}

.auth-card h2 {
  margin: 0 0 6px;
  font-size: 1.9rem;
  letter-spacing: -0.03em;
}

.auth-sub {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.94rem;
}

input,
select {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  padding: 14px 16px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(13, 139, 119, 0.12);
}

.input-prefix-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  margin-bottom: 12px;
  overflow: hidden;
}

.input-prefix {
  padding: 12px 12px 12px 14px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-prefix-wrap input {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.input-prefix-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(13, 139, 119, 0.12);
}

.pw-wrap {
  position: relative;
  margin-bottom: 16px;
}

.pw-wrap input {
  margin-bottom: 0;
  padding-right: 74px;
}

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: auto;
  padding: 8px 10px;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.pw-toggle--icon {
  width: 36px;
  height: 36px;
  padding: 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
}

.pw-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
}

.pw-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.pw-toggle--icon .pw-icon--hide {
  display: none;
}

.pw-toggle--icon.is-revealed .pw-icon--show {
  display: none;
}

.pw-toggle--icon.is-revealed .pw-icon--hide {
  display: inline-flex;
}

.btn-primary,
.btn-ghost {
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn-primary:hover,
.btn-ghost:hover {
  transform: translateY(-1px);
}

.btn-primary {
  width: 100%;
  padding: 14px 18px;
  border: 0;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  font-weight: 800;
}

.btn-primary.loading,
.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-ghost {
  width: auto;
  padding: 11px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.auth-footer {
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
}

.auth-footer a,
.view-404 a,
.note a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer a:hover,
.view-404 a:hover,
.note a:hover {
  text-decoration: underline;
}

.form-error,
.result {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.password-checklist {
  margin: -4px 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.password-checklist li {
  font-size: 0.9rem;
  color: var(--muted);
}

.password-checklist li.met {
  color: #1f9d61;
  font-weight: 700;
}

.password-checklist li.unmet {
  color: var(--muted);
}

.form-info {
  margin-bottom: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.form-error {
  margin-bottom: 14px;
  background: rgba(167, 59, 50, 0.12);
  color: var(--danger);
}

.result {
  margin-top: 16px;
  word-break: break-word;
}

.result.success {
  background: rgba(13, 139, 119, 0.12);
  color: var(--accent-strong);
}

.result.error {
  background: rgba(167, 59, 50, 0.12);
  color: var(--danger);
}

.result a {
  color: inherit;
  font-weight: 800;
}

.note {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.note-tight {
  margin-top: 12px;
}

.dashboard-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
}

.dashboard-overlay {
  display: block;
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(6, 15, 18, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 38;
}

.dashboard-layout.sidebar-open .dashboard-overlay {
  opacity: 1;
  pointer-events: auto;
}

.dashboard-sidebar {
  background: var(--sidebar);
  color: #f3fcfa;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  width: min(88vw, 320px);
  padding: 16px;
  z-index: 40;
  transform: translateX(-102%);
  transition: transform 0.22s ease;
  overflow-y: auto;
}

.dashboard-layout.sidebar-open .dashboard-sidebar {
  transform: translateX(0);
}

.sidebar-top,
.sidebar-bottom {
  display: grid;
  gap: 16px;
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-close {
  display: inline-grid;
  place-items: center;
  justify-self: end;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f3fcfa;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.sidebar-brand p,
.sidebar-foot {
  margin: 8px 0 0;
  color: rgba(243, 252, 250, 0.70);
}

.sidebar-nav {
  display: grid;
  gap: 10px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  color: rgba(243, 252, 250, 0.82);
  text-decoration: none;
  font-weight: 700;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
  background: transparent;
  color: #ffffff;
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

.sidebar-account {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-account__avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 800;
}

.sidebar-account__meta {
  display: grid;
  gap: 2px;
}

.sidebar-account__meta strong {
  font-size: 0.92rem;
  line-height: 1.1;
}

.sidebar-account__meta span {
  color: rgba(243, 252, 250, 0.74);
  font-size: 0.8rem;
}

.sidebar-logout {
  grid-column: 1 / -1;
  width: 100%;
  border-color: rgba(255, 255, 255, 0.16);
  color: #f3fcfa;
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-main {
  padding: 18px;
  padding-top: 16px;
}

.dashboard-header {
  display: grid;
  gap: 16px;
  margin-bottom: 26px;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-topbar__actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.dashboard-brand {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.dashboard-brand:hover {
  border-color: var(--accent);
}

.dashboard-header__intro {
  min-width: 0;
}

.dashboard-sidebar-toggle {
  display: inline-grid;
  place-items: center;
}

.dashboard-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.dashboard-copy {
  margin: 8px 0 0;
  color: var(--muted);
}

.dashboard-actions {
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.btn-icon {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.btn-icon span {
  font-size: 1.35rem;
  line-height: 1;
}

#theme-toggle span {
  font-size: 1.55rem;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  font-weight: 800;
}

.profile-name {
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
  min-width: 0;
}

.stat-card,
.dashboard-panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  min-width: 0;
  max-width: 100%;
}

.stat-card {
  padding: 20px;
}

.stat-card--link {
  cursor: pointer;
}

.stat-card--link:hover {
  transform: translateY(-2px);
}

.stat-label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.stat-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  min-width: 0;
}

.page-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.page-stack .stats-grid {
  margin-bottom: 0;
}

.settings-grid {
  align-items: start;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
}

.settings-left-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.settings-account-card {
  position: sticky;
  top: 28px;
  align-self: start;
}

.dashboard-panel {
  padding: 24px;
}

.dashboard-main,
.dashboard-header,
.dashboard-header__intro,
.dashboard-grid > *,
.stats-grid > *,
.page-stack > * {
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-head h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.activity-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.activity-list li:last-child {
  border-bottom: 0;
}

.activity-list span {
  color: var(--muted);
}

.activity-list strong {
  font-size: 0.92rem;
}

.links-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.links-table {
  width: 100%;
  border-collapse: collapse;
}

.links-table th,
.links-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.links-table th {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.links-table td {
  font-size: 0.93rem;
}

.links-table .truncate {
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.links-table a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.links-table a:hover {
  text-decoration: underline;
}

.event-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.event-list li {
  margin: 6px 0;
}

.view-404 {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px;
}

.view-404 h2 {
  margin: 0 0 12px;
}

.hidden {
  display: none;
}

@media (max-width: 1100px) {
  .auth-layout,
  .dashboard-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .settings-left-column {
    order: 2;
  }

  .settings-account-card {
    order: 1;
    position: static;
  }

  .auth-hero {
    min-height: 320px;
    align-items: center;
  }
}

@media (max-width: 760px) {
  .auth-panel,
  .dashboard-main {
    padding: 18px;
  }

  .auth-card,
  .dashboard-panel,
  .stat-card {
    padding: 18px;
  }

  .dashboard-header {
    gap: 14px;
    margin-bottom: 20px;
  }

  .dashboard-topbar {
    gap: 10px;
  }

  .dashboard-topbar__actions {
    gap: 16px;
  }

  .dashboard-brand {
    max-width: calc(100vw - 140px);
  }

  .dashboard-header h1 {
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }

  .dashboard-copy,
  .stat-card p,
  .note {
    overflow-wrap: anywhere;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-sidebar {
    width: min(90vw, 320px);
  }

  .profile-pill {
    width: 100%;
    justify-content: flex-start;
  }

  .links-table .truncate,
  .detail-meta-url--truncate {
    max-width: 220px;
  }
}

@media (min-width: 1101px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-overlay {
    display: none;
  }

  .dashboard-sidebar {
    position: fixed;
    height: 100dvh;
    width: 280px;
    transform: none;
    z-index: 40;
    padding: 28px 22px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
  }

  .sidebar-close {
    display: none;
  }

  .sidebar-account {
    display: none;
  }

  .dashboard-main {
    padding: 28px;
    margin-left: 280px;
  }

  .dashboard-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
    margin-left: 0;
  }

  .dashboard-topbar {
    grid-column: 1 / -1;
    margin-bottom: 2px;
  }

  .dashboard-sidebar-toggle {
    display: none;
  }

  .dashboard-header__intro {
    grid-column: 1 / 2;
  }

  .dashboard-actions {
    display: flex;
    grid-column: 2 / 3;
    justify-content: flex-end;
  }

  .sidebar-logout {
    display: none;
  }
}

/* ── Link detail page ─────────────────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.breadcrumb-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.breadcrumb-sep,
.breadcrumb-current {
  color: var(--muted);
}

.breadcrumb-current {
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-badge--active {
  background: rgba(13, 139, 119, 0.12);
  color: var(--accent-strong);
}

.status-badge--expired {
  background: rgba(167, 59, 50, 0.12);
  color: var(--danger);
}

.status-badge--muted {
  background: var(--surface-2);
  color: var(--muted);
}

.muted-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.detail-meta-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.detail-meta-url {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  word-break: break-all;
  font-size: 0.92rem;
}

.detail-meta-url--truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
}

.detail-meta-url:hover {
  text-decoration: underline;
}

.detail-edit-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.inline-edit-form {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.inline-edit-form h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.inline-edit-form .btn-primary {
  margin-top: 4px;
}

/* Chart */
.chart-period-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.chart-period-tab {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chart-period-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.chart-period-tab.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent);
}

.tab-count {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.78rem;
  font-weight: 800;
  margin-left: 4px;
}

.chart-period-tab.active .tab-count {
  background: rgba(13, 139, 119, 0.18);
}

.link-chart-wrap {
  min-height: 155px;
  padding: 4px 0 0;
}

.link-chart-svg {
  width: 100%;
  height: auto;
  max-height: 175px;
  display: block;
}

.chart-bar {
  fill: var(--accent);
  opacity: 0.82;
  transition: opacity 0.12s ease;
}

.chart-bar:hover {
  opacity: 1;
}

.chart-label-text {
  font-size: 10px;
  fill: var(--muted);
  font-family: "Manrope", sans-serif;
}

.chart-empty {
  padding: 36px 0;
  text-align: center;
  color: var(--muted);
}

/* Breakdowns */
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.breakdown-list {
  display: grid;
  gap: 10px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 110px 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.breakdown-label {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breakdown-bar-wrap {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  min-width: 3px;
  transition: width 0.35s ease;
}

.breakdown-count {
  text-align: right;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Referrer list */
.ref-list {
  gap: 0;
}

.activity-list__item-ref {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.activity-list__item-ref:last-child {
  border-bottom: 0;
}

.ref-source {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

/* Click events table */
.click-events-table th,
.click-events-table td {
  font-size: 0.83rem;
  padding: 9px 8px;
}

.events-empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 0 !important;
}

/* Stats link in links table */
.link-detail-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.link-detail-link:hover {
  text-decoration: underline;
}

.stat-last-click {
  font-size: 1.1rem;
  line-height: 1.25;
  word-break: break-word;
}

@media (max-width: 1100px) {
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .breakdown-row {
    grid-template-columns: 80px 1fr 36px;
  }

  .detail-meta-grid {
    grid-template-columns: 1fr;
  }
}
