:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #66736b;
  --line: #dce4de;
  --paper: #ffffff;
  --canvas: #f3f6f1;
  --green: #176b45;
  --green-dark: #0d4e31;
  --lime: #dff46c;
  --danger: #a83c35;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 85% 5%, rgba(223, 244, 108, 0.32), transparent 26rem),
    var(--canvas);
}

a {
  color: inherit;
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 5vw;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-user {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  text-transform: capitalize;
}

.nav-logout {
  min-height: auto;
  padding: 7px 10px;
  color: var(--green);
  font-size: 0.76rem;
  background: transparent;
  border: 1px solid var(--line);
}

.nav-logout:hover {
  color: white;
  background: var(--green);
}

.app-main {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 80px;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 264px;
  padding: 28px 20px 22px;
  flex-direction: column;
  color: #f7fbf8;
  background: linear-gradient(165deg, #123f2b, #092b1c 72%);
  box-shadow: 12px 0 40px rgba(9, 43, 28, 0.12);
}

.sidebar-brand { margin-bottom: 30px; font-size: 1.2rem; }
.sidebar-label { display: block; margin-bottom: 6px; color: #a8c8b5; font-size: .68rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.workspace-dropdown { position: relative; }
.workspace-dropdown > summary { display: flex; min-height: 48px; padding: 0 13px; align-items: center; justify-content: space-between; gap: 10px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.18); border-radius: 11px; cursor: pointer; list-style: none; }
.workspace-dropdown > summary::-webkit-details-marker { display: none; }
.workspace-dropdown > summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-chevron { color: var(--lime); font-size: 1.2rem; transition: transform .18s ease; }
.workspace-dropdown[open] .workspace-chevron { transform: rotate(180deg); }
.workspace-dropdown-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: 100%; min-width: 224px; padding: 9px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 18px 46px rgba(4,27,16,.28); }
.workspace-menu-label { display: block; padding: 5px 8px 8px; color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workspace-options { display: grid; gap: 3px; }
.workspace-options form { margin: 0; }
.workspace-option { display: flex; width: 100%; min-height: 39px; padding: 8px 9px; align-items: center; justify-content: space-between; color: var(--ink); font-size: .82rem; font-weight: 700; text-align: left; background: transparent; border: 0; border-radius: 8px; }
button.workspace-option:hover { color: var(--green-dark); background: var(--canvas); }
.workspace-option.is-current { color: var(--green-dark); background: #edf6f0; }
.workspace-option small { color: var(--green); font-size: .62rem; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 6px; margin: 28px 0; }
.sidebar-nav a { padding: 11px 12px; color: #d7e8dd; font-weight: 700; text-decoration: none; border-radius: 10px; }
.sidebar-nav a:hover { color: white; background: rgba(255,255,255,.1); }
.new-workspace { margin-top: 7px; padding: 9px 7px 3px; border-top: 1px solid var(--line); }
.new-workspace summary { color: var(--green); font-size: .82rem; font-weight: 750; cursor: pointer; }
.new-workspace form { display: grid; gap: 8px; padding-top: 14px; }
.new-workspace label { color: var(--muted); font-size: .72rem; }
.new-workspace input { width: 100%; }
.new-workspace button { min-height: 38px; }
.sidebar-account { display: grid; gap: 3px; margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14); }
.sidebar-account span { font-weight: 750; }
.sidebar-account small { overflow: hidden; color: #a8c8b5; text-overflow: ellipsis; }
.sidebar-account form { margin-top: 10px; }
.sidebar-account .nav-logout { color: #dff46c; border-color: rgba(255,255,255,.22); }
.with-sidebar .app-main { width: min(1120px, calc(100% - 314px)); margin-left: max(294px, calc((100% - 1120px + 264px) / 2)); }

.listener-heading .listener-logo { width: 82px; height: 82px; object-fit: contain; filter: drop-shadow(0 12px 24px rgba(0,0,0,.12)); }
.compact-video-summary { margin-bottom: 22px; padding: 22px; }
.compact-summary-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.compact-summary-heading h2 { margin: 5px 0 0; font-size: 1.25rem; }
.compact-summary-heading > small { padding: 6px 9px; color: var(--green); font-size: .63rem; font-weight: 800; background: #eaf5ed; border-radius: 999px; }
.compact-summary-kpis { display: grid; grid-template-columns: repeat(4,1fr); margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; }
.compact-summary-kpis > div { padding: 13px 15px; }
.compact-summary-kpis > div + div { border-left: 1px solid var(--line); }
.compact-summary-kpis span, .compact-summary-kpis strong { display: block; }
.compact-summary-kpis span { color: var(--muted); font-size: .63rem; }
.compact-summary-kpis strong { margin-top: 4px; font-size: 1.12rem; }
.compact-summary-filters { display: grid; grid-template-columns: minmax(170px,.7fr) minmax(250px,1.5fr) auto auto; gap: 8px; align-items: center; padding: 9px; background: var(--canvas); border-radius: 11px; }
.compact-summary-filters > input, .compact-summary-filters > button { min-height: 42px; }
.compact-summary-filters > input { width: 100%; background: white; }
.compact-summary-filters > a { padding: 8px; color: var(--muted); font-size: .7rem; font-weight: 750; text-decoration: none; }
.compact-hashtag-picker { position: relative; }
.compact-hashtag-picker > summary { display: flex; min-height: 42px; padding: 0 12px; align-items: center; justify-content: space-between; gap: 10px; font-size: .74rem; font-weight: 750; background: white; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; list-style: none; }
.compact-hashtag-picker > summary::-webkit-details-marker { display: none; }
.compact-hashtag-picker fieldset { position: absolute; top: calc(100% + 6px); left: 0; z-index: 15; display: grid; width: min(300px,80vw); max-height: 250px; padding: 8px; overflow-y: auto; background: white; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 15px 38px rgba(16,48,30,.17); }
.compact-hashtag-picker legend { padding: 6px; color: var(--muted); font-size: .62rem; font-weight: 800; }
.compact-hashtag-picker label { display: flex; gap: 8px; padding: 8px; align-items: center; font-size: .72rem; font-weight: 700; border-radius: 7px; }
.compact-hashtag-picker label:hover { background: var(--canvas); }
.compact-hashtag-picker input { width: 15px; height: 15px; margin: 0; accent-color: var(--green); }
.compact-top-videos { margin-top: 17px; }
.compact-top-videos > h3 { margin: 0 0 9px; font-size: .82rem; }
.compact-top-videos > h3 span { color: var(--muted); font-size: .62rem; font-weight: 500; }
.compact-top-videos > div { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.compact-top-videos article { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 9px; padding: 8px; align-items: center; background: #fafbf9; border: 1px solid #e9ede9; border-radius: 10px; }
.compact-video-cover { display: block; width: 42px; height: 52px; grid-row: span 2; overflow: hidden; background: #111; border-radius: 7px; }
.compact-video-cover img { width: 100%; height: 100%; object-fit: cover; }
.compact-top-videos article > div { min-width: 0; }
.compact-top-videos article > div > a { display: block; overflow: hidden; color: var(--ink); font-size: .68rem; font-weight: 700; line-height: 1.3; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.compact-top-videos article > div > small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .57rem; text-overflow: ellipsis; white-space: nowrap; }
.compact-top-videos article > strong { grid-column: 2; font-size: .66rem; }
.compact-top-videos article > strong small { color: var(--muted); font-size: .54rem; font-weight: 500; }

/* Hashtag video workspace */
.hv-hero { display: flex; margin-bottom: 26px; align-items: center; justify-content: space-between; gap: 28px; }
.hv-title-row { display: flex; align-items: center; gap: 10px; }
.hv-mode-badge { padding: 5px 8px; color: #587064; font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: #e8eee9; border-radius: 999px; }
.hv-hero h1 { margin: 9px 0 10px; font-size: clamp(2.35rem, 5vw, 4rem); line-height: .96; letter-spacing: -.06em; }
.hv-hero p { max-width: 650px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.hv-hero img { width: 74px; height: 74px; object-fit: contain; filter: drop-shadow(0 12px 20px rgba(0,0,0,.13)); }
.hv-quick-add { display: flex; margin: 18px 0; padding: 16px 18px; align-items: center; justify-content: space-between; gap: 20px; background: #102f21; border-radius: 16px; box-shadow: 0 14px 36px rgba(13,78,49,.12); }
.hv-quick-add-copy { display: flex; min-width: 250px; align-items: center; gap: 12px; color: white; }
.hv-quick-add-copy .hv-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; color: #102f21; font-weight: 900; background: var(--lime); border-radius: 10px; }
.hv-quick-add-copy strong, .hv-quick-add-copy small { display: block; }
.hv-quick-add-copy strong { font-size: .86rem; }
.hv-quick-add-copy small { margin-top: 3px; color: #acc7b8; font-size: .66rem; }
.hv-quick-add form { display: flex; width: min(480px, 55%); gap: 8px; }
.hv-quick-add .hashtag-input { border: 0; }
.hv-quick-add button { min-height: 44px; white-space: nowrap; background: var(--lime); color: #183225; }
.hv-dashboard, .hv-results-panel, .hv-sources-panel { background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgba(37,64,46,.045); }
.hv-dashboard { padding: 24px; }
.hv-section-heading, .hv-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hv-section-heading h2, .hv-panel-heading h2 { margin: 0; letter-spacing: -.025em; }
.hv-section-heading h2 { font-size: 1.2rem; }
.hv-section-heading p, .hv-panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; }
.hv-filtered-badge { padding: 6px 9px; color: var(--green); font-size: .65rem; font-weight: 800; background: #eaf5ed; border-radius: 999px; }
.hv-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin: 20px 0; }
.hv-kpis article { padding: 16px; background: #f7f9f6; border: 1px solid #e6ebe6; border-radius: 13px; }
.hv-kpis .hv-kpi-featured { color: white; background: linear-gradient(145deg, #176b45, #0c462d); border-color: transparent; }
.hv-kpis span, .hv-kpis strong, .hv-kpis small { display: block; }
.hv-kpis span { color: var(--muted); font-size: .66rem; font-weight: 750; }
.hv-kpis strong { margin: 7px 0 5px; font-size: 1.55rem; line-height: 1; letter-spacing: -.045em; }
.hv-kpis small { color: #8b968e; font-size: .61rem; }
.hv-kpis .hv-kpi-featured span, .hv-kpis .hv-kpi-featured small { color: #cae0d2; }
.hv-filter-bar { display: grid; grid-template-columns: minmax(190px,.8fr) minmax(260px,1.5fr) auto auto; gap: 9px; align-items: center; padding: 10px; background: #f1f4f0; border: 1px solid #e1e7e2; border-radius: 13px; }
.hv-hashtag-picker { position: relative; min-width: 0; }
.hv-hashtag-picker > summary, .hv-word-search { display: flex; min-height: 48px; padding: 7px 11px; align-items: center; gap: 10px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.hv-hashtag-picker > summary { justify-content: space-between; cursor: pointer; list-style: none; }
.hv-hashtag-picker > summary::-webkit-details-marker { display: none; }
.hv-filter-icon, .hv-search-icon { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; color: var(--green); font-weight: 900; background: #edf5ef; border-radius: 7px; }
.hv-hashtag-picker summary > span:nth-child(2), .hv-word-search > span:last-child { min-width: 0; flex: 1; }
.hv-hashtag-picker small, .hv-hashtag-picker strong, .hv-word-search small { display: block; }
.hv-hashtag-picker small, .hv-word-search small { color: var(--muted); font-size: .59rem; font-weight: 750; }
.hv-hashtag-picker strong { margin-top: 2px; overflow: hidden; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.hv-chevron { color: var(--muted); }
.hv-hashtag-picker[open] > summary { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,69,.08); }
.hv-hashtag-picker fieldset { position: absolute; top: calc(100% + 7px); left: 0; z-index: 15; display: grid; width: min(320px,85vw); max-height: 280px; padding: 8px; overflow-y: auto; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 44px rgba(16,48,30,.18); }
.hv-hashtag-picker legend { padding: 7px 8px; color: var(--muted); font-size: .65rem; font-weight: 800; }
.hv-hashtag-picker label { display: flex; gap: 9px; padding: 9px; align-items: center; font-size: .76rem; font-weight: 700; border-radius: 8px; cursor: pointer; }
.hv-hashtag-picker label:hover { background: var(--canvas); }
.hv-hashtag-picker input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.hv-word-search input { width: 100%; min-height: auto; padding: 2px 0 0; font-size: .76rem; background: transparent; border: 0; outline: 0; }
.hv-apply { min-height: 48px; padding-inline: 18px; }
.hv-clear { display: inline-flex; min-height: 48px; padding: 0 7px; align-items: center; color: var(--muted); font-size: .7rem; font-weight: 750; text-decoration: none; }
.hv-filter-help { margin: 7px 4px 0; color: #89948d; font-size: .62rem; }
.hv-workspace { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(250px,.7fr); gap: 18px; margin-top: 18px; align-items: start; }
.hv-results-panel, .hv-sources-panel { padding: 20px; }
.hv-panel-heading { margin-bottom: 14px; }
.hv-panel-heading h2 { font-size: 1.05rem; }
.hv-dedupe-badge { display: inline-flex; gap: 5px; padding: 6px 8px; align-items: center; color: var(--green); font-size: .62rem; font-weight: 800; background: #ebf5ee; border-radius: 999px; }
.hv-dedupe-badge > span { display: grid; width: 15px; height: 15px; place-items: center; color: white; font-size: .55rem; background: var(--green); border-radius: 50%; }
.hv-video-list { display: grid; gap: 7px; max-height: 660px; overflow-y: auto; padding-right: 3px; }
.hv-video-row { display: grid; grid-template-columns: 56px minmax(0,1fr) auto 30px; gap: 12px; padding: 9px; align-items: center; background: #fafbf9; border: 1px solid transparent; border-radius: 11px; }
.hv-video-row:hover { background: white; border-color: var(--line); }
.hv-video-cover { display: block; width: 56px; height: 70px; overflow: hidden; background: #111; border-radius: 8px; }
.hv-video-cover img { width: 100%; height: 100%; object-fit: cover; }
.hv-video-copy { min-width: 0; }
.hv-video-copy > a { display: block; overflow: hidden; color: var(--ink); font-size: .78rem; font-weight: 750; line-height: 1.35; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.hv-video-copy > a:hover { color: var(--green); }
.hv-video-copy > span { display: block; margin: 4px 0 7px; color: var(--muted); font-size: .63rem; }
.hv-video-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.hv-video-tags small { padding: 3px 6px; color: var(--green-dark); font-size: .56rem; font-weight: 750; background: #eaf3ed; border-radius: 999px; }
.hv-video-stats { display: flex; gap: 17px; padding: 0 6px; text-align: right; }
.hv-video-stats strong, .hv-video-stats span { display: block; }
.hv-video-stats strong { font-size: .75rem; }
.hv-video-stats span { margin-top: 2px; color: var(--muted); font-size: .55rem; }
.hv-open-link { display: grid; width: 28px; height: 28px; place-items: center; color: var(--green); text-decoration: none; background: #edf5ef; border-radius: 7px; }
.hv-empty { padding: 68px 20px; text-align: center; background: #fafbf9; border: 1px dashed var(--line); border-radius: 12px; }
.hv-empty > span { display: grid; width: 42px; height: 42px; margin: 0 auto 12px; place-items: center; color: white; font-weight: 900; background: #111; border-radius: 11px; box-shadow: 3px 3px 0 #25f4ee, -2px -2px 0 #fe2c55; }
.hv-empty h3 { margin: 0 0 5px; }
.hv-empty p { margin: 0; color: var(--muted); font-size: .74rem; }
.hv-source-list { display: grid; gap: 9px; max-height: 660px; overflow-y: auto; }
.hv-source-list > article { padding: 13px; background: #fafbf9; border: 1px solid #e8ece8; border-radius: 11px; }
.hv-source-title { display: flex; align-items: center; gap: 9px; }
.hv-source-title > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; color: white; font-weight: 900; background: #16201a; border-radius: 8px; }
.hv-source-title strong, .hv-source-title small { display: block; }
.hv-source-title strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.hv-source-title small { margin-top: 3px; color: var(--muted); font-size: .58rem; }
.hv-source-status { display: flex; margin: 11px 0; align-items: center; justify-content: space-between; color: var(--muted); font-size: .6rem; text-transform: capitalize; }
.hv-source-actions { display: flex; gap: 6px; padding-top: 9px; border-top: 1px solid var(--line); }
.hv-source-actions form { flex: 1; }
.hv-source-actions button { width: 100%; min-height: 32px; padding: 5px 8px; font-size: .62rem; background: white; color: var(--green); border: 1px solid var(--line); }
.hv-source-actions button:hover { color: white; background: var(--green); }
.hv-source-actions button.danger { color: var(--danger); }
.hv-source-actions button.danger:hover { color: white; background: var(--danger); }
.hv-source-empty { color: var(--muted); font-size: .72rem; }
.listener-search-panel { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: end; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.video-summary-dashboard { margin-bottom: 28px; padding: 28px; overflow: visible; }
.summary-dashboard-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.summary-dashboard-header h2 { margin: 6px 0 7px; font-size: 1.65rem; letter-spacing: -.035em; }
.summary-dashboard-header p { margin: 0; }
.filter-state { padding: 7px 10px; color: var(--green-dark); font-size: .7rem; font-weight: 800; background: #e7f4eb; border-radius: 999px; }
.video-summary-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.video-summary-kpis article { position: relative; padding: 18px; overflow: hidden; background: #f8faf7; border: 1px solid var(--line); border-radius: 14px; }
.video-summary-kpis article.primary { color: white; background: linear-gradient(145deg, var(--green), var(--green-dark)); border-color: transparent; }
.video-summary-kpis span, .video-summary-kpis strong, .video-summary-kpis small { display: block; }
.video-summary-kpis span { color: var(--muted); font-size: .7rem; font-weight: 700; }
.video-summary-kpis strong { margin: 7px 0 5px; font-size: 1.65rem; letter-spacing: -.04em; }
.video-summary-kpis small { color: #8a958e; font-size: .65rem; }
.video-summary-kpis .primary span, .video-summary-kpis .primary small { color: #d7eadf; }
.video-summary-filters { position: relative; display: grid; grid-template-columns: minmax(210px, .8fr) minmax(260px, 1.4fr) auto auto; gap: 10px; align-items: end; padding: 14px; background: #f0f4ef; border: 1px solid #e0e7e1; border-radius: 14px; }
.description-filter { display: grid; gap: 6px; }
.description-filter small, .hashtag-filter-picker summary small { color: var(--muted); font-size: .66rem; font-weight: 750; }
.description-filter input { min-height: 48px; background: white; }
.hashtag-filter-picker { position: relative; min-width: 0; }
.hashtag-filter-picker > summary { display: flex; min-height: 48px; padding: 8px 13px; align-items: center; justify-content: space-between; gap: 12px; background: white; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; list-style: none; }
.hashtag-filter-picker > summary::-webkit-details-marker { display: none; }
.hashtag-filter-picker > summary span:first-child, .hashtag-filter-picker > summary small, .hashtag-filter-picker > summary strong { display: block; }
.hashtag-filter-picker > summary strong { margin-top: 2px; overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.hashtag-filter-picker[open] > summary { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,69,.09); }
.hashtag-filter-picker fieldset { position: absolute; top: calc(100% + 7px); left: 0; z-index: 12; display: grid; width: min(330px, 85vw); max-height: 260px; padding: 8px; overflow-y: auto; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(16,48,30,.16); }
.hashtag-filter-picker label { display: flex; gap: 9px; padding: 9px; align-items: center; font-size: .8rem; font-weight: 700; border-radius: 8px; cursor: pointer; }
.hashtag-filter-picker label:hover { background: var(--canvas); }
.hashtag-filter-picker input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.filter-submit { min-height: 48px; white-space: nowrap; }
.filter-reset { display: inline-flex; min-height: 48px; padding: 0 8px; align-items: center; color: var(--muted); font-size: .75rem; font-weight: 750; text-decoration: none; }
.unique-video-results { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 21px; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.result-heading h3 { margin: 0 0 3px; font-size: 1rem; }
.result-heading p { margin: 0; color: var(--muted); font-size: .72rem; }
.result-heading > span { padding: 6px 9px; color: var(--green); font-size: .67rem; font-weight: 800; background: #edf7f0; border-radius: 999px; }
.unique-video-list { display: grid; gap: 8px; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.unique-video-list article { display: grid; grid-template-columns: 54px minmax(0,1fr) auto; gap: 12px; padding: 9px; align-items: center; background: #fafbf9; border: 1px solid transparent; border-radius: 11px; transition: border-color .15s ease, background .15s ease; }
.unique-video-list article:hover { background: white; border-color: var(--line); }
.result-cover { display: block; width: 54px; height: 66px; overflow: hidden; background: #111; border-radius: 8px; }
.result-cover img { width: 100%; height: 100%; object-fit: cover; }
.result-copy { min-width: 0; }
.result-copy > a { display: block; overflow: hidden; color: var(--ink); font-size: .82rem; font-weight: 750; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.result-copy > a:hover { color: var(--green); }
.result-copy > span { display: block; margin: 4px 0 7px; color: var(--muted); font-size: .68rem; }
.result-copy > div { display: flex; gap: 5px; flex-wrap: wrap; }
.result-copy small { padding: 3px 6px; color: var(--green-dark); font-size: .6rem; font-weight: 750; background: #eaf3ed; border-radius: 999px; }
.result-metric { min-width: 82px; padding-right: 8px; text-align: right; }
.result-metric strong, .result-metric span { display: block; }
.result-metric strong { font-size: .9rem; }
.result-metric span { color: var(--muted); font-size: .62rem; }
.dashboard-empty { padding: 42px 20px; text-align: center; background: #fafbf9; border: 1px dashed var(--line); border-radius: 12px; }
.dashboard-empty > span { display: grid; width: 40px; height: 40px; margin: 0 auto 10px; place-items: center; color: white; font-weight: 900; background: #111; border-radius: 10px; }
.dashboard-empty h3 { margin: 0 0 5px; }
.dashboard-empty p { margin: 0; color: var(--muted); font-size: .78rem; }
.listener-search-panel h2 { margin: 7px 0; }
.listener-search-panel form { display: flex; gap: 10px; }
.hashtag-input { display: flex; min-width: 0; flex: 1; align-items: center; background: white; border: 1px solid var(--line); border-radius: 10px; }
.hashtag-input span { padding-left: 14px; color: var(--green); font-weight: 850; }
.hashtag-input input { width: 100%; border: 0; background: transparent; }
.listener-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.listener-card { padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 34px rgba(37,64,46,.06); }
.listener-card header { display: flex; gap: 12px; align-items: center; }
.listener-card h3 { margin: 2px 0; font-size: 1.45rem; }
.hashtag-mark { display: grid; width: 46px; height: 46px; place-items: center; color: white; font-size: 1.45rem; font-weight: 900; background: #111; border-radius: 13px; box-shadow: 4px 4px 0 #25f4ee, -3px -3px 0 #fe2c55; }
.listener-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.listener-stats div { padding: 13px; background: var(--canvas); border-radius: 11px; }
.listener-stats strong, .listener-stats span { display: block; }
.listener-stats strong { font-size: 1.15rem; }
.listener-stats span { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.listener-status { display: grid; gap: 5px; color: var(--muted); }
.listener-card footer { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.listener-card footer form { margin: 0; }
.listener-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 24px; }
.listener-kpis article { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 15px; }
.listener-kpis span, .listener-kpis strong { display: block; }
.listener-kpis span { color: var(--muted); font-size: .74rem; }
.listener-kpis strong { margin-top: 7px; font-size: 1.45rem; }
.video-detail-filters { margin-bottom: 18px; padding: 14px 16px; }
.video-detail-filters > form { display: grid; grid-template-columns: minmax(150px,.65fr) minmax(220px,1.25fr) minmax(140px,.55fr) minmax(130px,.5fr) auto auto; gap: 8px; align-items: end; }
.video-detail-filters details { position: relative; }
.video-detail-filters summary { display: flex; min-height: 42px; padding: 0 12px; align-items: center; justify-content: space-between; font-size: .74rem; font-weight: 750; background: white; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; list-style: none; }
.video-detail-filters summary::-webkit-details-marker { display: none; }
.video-detail-filters fieldset { position: absolute; top: calc(100% + 6px); left: 0; z-index: 15; display: grid; width: 230px; max-height: 240px; padding: 8px; overflow-y: auto; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 34px rgba(16,48,30,.15); }
.video-detail-filters legend { padding: 5px; color: var(--muted); font-size: .62rem; font-weight: 800; }
.video-detail-filters label { padding: 7px; font-size: .72rem; font-weight: 700; }
.video-detail-filters input[type="checkbox"] { accent-color: var(--green); }
.video-detail-filters > form > input, .video-detail-filters > form > button, .video-sort-field select { min-height: 42px; }
.video-sort-field { display: grid; gap: 4px; color: var(--muted); font-size: .62rem; font-weight: 750; }
.video-sort-field select { padding: 0 10px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: .74rem; }
.video-detail-filters > small { display: block; margin-top: 7px; color: var(--muted); font-size: .62rem; }
.listener-video-list { display: grid; gap: 16px; }
.listener-video-card { display: grid; grid-template-columns: 180px 1fr; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 18px; }
.listener-cover { min-height: 255px; background: #111; }
.listener-cover img { width: 100%; height: 100%; object-fit: cover; }
.listener-video-body { min-width: 0; padding: 20px; }
.listener-video-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.listener-video-metrics { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 0; color: var(--muted); font-size: .76rem; }
.listener-video-metrics strong { color: var(--ink); }
.comment-drawer { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.comment-drawer summary { color: var(--green); font-weight: 750; cursor: pointer; }
.video-comments-link { display: inline-flex; margin-top: 8px; padding-top: 12px; color: var(--green); font-weight: 750; border-top: 1px solid var(--line); }
.creator-filter-panel { margin-bottom: 18px; padding: 16px; }
.creator-filter-panel form { display: grid; grid-template-columns: minmax(220px,1fr) minmax(150px,.5fr) minmax(140px,.45fr) auto auto; gap: 10px; align-items: end; }
.creator-filter-panel label { display: grid; gap: 5px; color: var(--muted); font-size: .68rem; font-weight: 750; }
.creator-filter-panel input, .creator-filter-panel select { min-height: 42px; }
.creator-table-panel { padding: 20px; }
.creator-table-wrap { overflow-x: auto; }
.creator-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.creator-table th, .creator-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.creator-table th { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; }
.creator-table th:first-child, .creator-table td:first-child { text-align: left; }
.creator-table a { color: var(--green); font-weight: 800; text-decoration: none; }
.creator-table tbody tr:hover { background: var(--canvas); }
.creator-table .creator-empty { padding: 30px; color: var(--muted); text-align: center; }
.comment-list { display: grid; gap: 10px; margin-top: 12px; }
.comment { padding: 12px; background: var(--canvas); border-radius: 10px; }
.comment p { margin: 5px 0; }
.comment small { color: var(--muted); }
.reply-list { display: grid; gap: 6px; margin: 10px 0 0 15px; padding-left: 11px; font-size: .8rem; border-left: 2px solid var(--line); }

@media (max-width: 760px) {
  .app-sidebar { position: relative; width: 100%; min-height: auto; padding: 20px; }
  .sidebar-brand { margin-bottom: 18px; }
  .sidebar-nav { grid-template-columns: 1fr 1fr; margin: 18px 0; }
  .sidebar-account { margin-top: 20px; }
  .with-sidebar .app-main { width: calc(100% - 30px); margin: 0 auto; padding-top: 30px; }
  .listener-search-panel, .listener-grid { grid-template-columns: 1fr; }
  .compact-summary-kpis { grid-template-columns: 1fr 1fr; }
  .compact-summary-kpis > div + div { border-left: 0; }
  .compact-summary-kpis > div:nth-child(even) { border-left: 1px solid var(--line); }
  .compact-summary-kpis > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .compact-summary-filters { grid-template-columns: 1fr; }
  .compact-summary-filters > a { text-align: center; }
  .compact-top-videos > div { grid-template-columns: 1fr; }
  .video-summary-filters, .video-summary-kpis { grid-template-columns: 1fr; }
  .video-summary-dashboard { padding: 20px; }
  .summary-dashboard-header { align-items: flex-start; flex-direction: column; }
  .video-summary-kpis { grid-template-columns: 1fr 1fr; }
  .video-summary-filters { align-items: stretch; }
  .filter-submit, .filter-reset { justify-content: center; }
  .unique-video-list article { grid-template-columns: 46px minmax(0,1fr); }
  .result-cover { width: 46px; height: 58px; }
  .result-metric { grid-column: 2; padding: 0; text-align: left; }
  .result-metric strong, .result-metric span { display: inline; }
  .listener-kpis { grid-template-columns: repeat(2, 1fr); }
  .listener-video-card { grid-template-columns: 105px 1fr; }
  .listener-cover { min-height: 190px; }
  .video-detail-filters > form { grid-template-columns: 1fr; }
  .creator-filter-panel form { grid-template-columns: 1fr; }
  .hv-hero img { width: 58px; height: 58px; }
  .hv-quick-add { align-items: stretch; flex-direction: column; }
  .hv-quick-add form { width: 100%; }
  .hv-dashboard { padding: 18px; }
  .hv-kpis { grid-template-columns: 1fr 1fr; }
  .hv-filter-bar { grid-template-columns: 1fr; }
  .hv-apply, .hv-clear { justify-content: center; }
  .hv-workspace { grid-template-columns: 1fr; }
  .hv-results-panel, .hv-sources-panel { padding: 16px; }
  .hv-video-row { grid-template-columns: 48px minmax(0,1fr) 28px; }
  .hv-video-cover { width: 48px; height: 62px; }
  .hv-video-stats { grid-column: 2; justify-content: flex-start; padding: 0; text-align: left; }
  .hv-open-link { grid-column: 3; grid-row: 1; }
}

@media (max-width: 460px) {
  .hv-hero { align-items: flex-start; }
  .hv-hero img { width: 46px; height: 46px; }
  .hv-quick-add form { flex-direction: column; }
  .hv-kpis { grid-template-columns: 1fr; }
  .hv-video-row { grid-template-columns: 44px minmax(0,1fr); }
  .hv-video-cover { width: 44px; height: 58px; }
  .hv-open-link { display: none; }
  .hv-video-stats { grid-column: 2; }
}

.hero-card {
  max-width: 780px;
  padding: clamp(32px, 7vw, 76px);
  margin: 34px auto;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(37, 64, 46, 0.09);
}

.hero-card h1,
.page-heading h1 {
  margin: 10px 0 14px;
  font-size: clamp(2.3rem, 6vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-card p {
  max-width: 620px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.eyebrow {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  color: white;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  background: var(--green);
  border: 0;
  border-radius: 11px;
  cursor: pointer;
}

button:hover,
.primary-button:hover {
  background: var(--green-dark);
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  font: inherit;
  background: #fbfcfb;
  border: 1px solid #cfd9d2;
  border-radius: 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 107, 69, 0.12);
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.84rem;
  font-weight: 750;
}

.stack-form {
  padding-top: 6px;
}

.field-action {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.stack-form small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
}

.heading-row,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.heading-actions {
  display: flex;
  gap: 9px;
}

.user-heading-actions {
  align-items: flex-start;
}

.edit-user-name {
  position: relative;
}

.edit-user-name summary {
  list-style: none;
}

.edit-user-name summary::-webkit-details-marker {
  display: none;
}

.edit-user-name[open] summary {
  border-color: var(--green);
}

.edit-user-name form {
  position: absolute;
  z-index: 10;
  top: calc(100% + 9px);
  right: 0;
  width: min(340px, calc(100vw - 28px));
  padding: 17px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 18px 45px rgba(37, 64, 46, 0.16);
}

.page-heading {
  margin-bottom: 28px;
}

.page-heading h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.muted {
  color: var(--muted);
}

.user-id {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}

.panel {
  padding: 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.panel h2,
.watchlist-section h2 {
  margin: 0 0 4px;
  letter-spacing: -0.025em;
}

.add-user-panel {
  max-width: 780px;
  margin: 24px auto 0;
}

.auth-card {
  width: min(520px, 100%);
  padding: 34px;
  margin: 40px auto;
}

.auth-card h1 {
  margin: 7px 0 6px;
  font-size: clamp(2rem, 6vw, 3.2rem);
  letter-spacing: -0.05em;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.auth-switch {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.auth-switch a {
  color: var(--green);
  font-weight: 750;
}

.user-library-panel {
  margin-bottom: 20px;
}

.user-library-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.user-library-row {
  display: grid;
  grid-template-columns: auto 1fr auto minmax(240px, auto);
  align-items: center;
  gap: 14px;
  padding: 13px;
  background: #f8faf8;
  border: 1px solid #e2e9e4;
  border-radius: 12px;
}

.user-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: white;
  font-weight: 850;
  background: var(--green);
  border-radius: 12px;
}

.user-identity strong,
.user-identity span {
  display: block;
}

.user-identity span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.you-label {
  display: inline !important;
  padding: 2px 5px;
  color: var(--green) !important;
  font-size: 0.58rem !important;
  background: #e6f4e9;
  border-radius: 999px;
  text-transform: uppercase;
}

.role-pill {
  padding: 5px 9px;
  color: #425148;
  font-size: 0.65rem;
  font-weight: 800;
  background: #e8ede9;
  border-radius: 999px;
  text-transform: uppercase;
}

.role-owner {
  color: #5d4b00;
  background: #f6e9a9;
}

.role-admin {
  color: #315170;
  background: #e1edf8;
}

.user-library-row form {
  display: flex;
  align-items: center;
  gap: 7px;
}

.user-library-row select {
  min-height: 36px;
}

.add-library-user {
  margin-top: 20px;
}

.add-library-user h2 {
  margin-bottom: 4px;
}

.member-form {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr 140px auto;
  align-items: end;
  gap: 10px;
  margin-top: 20px;
}

.optional {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.panel > p {
  margin: 0 0 22px;
}

.profile-form {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  align-items: end;
  gap: 12px;
}

.watchlist-section {
  margin-top: 38px;
}

.performance-report {
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 22px 55px rgba(27, 55, 38, 0.1);
}

.report-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 32px;
  color: white;
  background:
    radial-gradient(circle at 85% 15%, rgba(223, 244, 108, 0.22), transparent 17rem),
    linear-gradient(135deg, #0d2f21, #185c3d);
}

.report-header .eyebrow {
  color: var(--lime);
}

.report-header h2 {
  margin: 7px 0 5px;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.045em;
}

.report-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
}

.report-header .secondary-button {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  white-space: nowrap;
}

.report-kpis {
  display: grid;
  grid-template-columns: 1.25fr 1.25fr 0.8fr;
  gap: 12px;
  padding: 24px 28px 12px;
}

.hero-kpi {
  min-width: 0;
  padding: 20px;
  background: #f4f8f5;
  border: 1px solid #e0e9e2;
  border-radius: 16px;
}

.hero-kpi > span,
.hero-kpi > small,
.hero-kpi > strong {
  display: block;
}

.hero-kpi > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-kpi > strong {
  margin: 7px 0 5px;
  overflow: hidden;
  font-size: clamp(1.55rem, 3.3vw, 2.35rem);
  letter-spacing: -0.05em;
  line-height: 1;
  text-overflow: ellipsis;
}

.hero-kpi > small {
  color: var(--muted);
  font-size: 0.7rem;
}

.engagement-kpi {
  background: #f7f5ff;
  border-color: #e5e0f5;
}

.rate-kpi {
  color: white;
  background: #17211b;
  border-color: #17211b;
}

.rate-kpi > span,
.rate-kpi > small {
  color: rgba(255, 255, 255, 0.66);
}

.platform-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 28px 12px;
}

.platform-report-card {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  align-items: center;
  gap: 14px;
  padding: 17px 18px;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid #111;
  border-radius: 14px;
}

.platform-report-card.instagram {
  border-left-color: #d94677;
}

.platform-report-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-report-title .platform-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.platform-report-title strong,
.platform-report-title small,
.platform-report-card > div > strong,
.platform-report-card > div > span {
  display: block;
}

.platform-report-title small,
.platform-report-card > div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
}

.platform-report-card > div > strong {
  font-size: 0.94rem;
}

.searched-profiles {
  padding: 8px 28px 2px;
}

.searched-profiles-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 9px;
}

.searched-profiles-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.searched-profile-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.searched-profile-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.searched-platform-title {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  padding-top: 2px;
  font-size: 0.76rem;
}

.searched-platform-title img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.profile-chips span {
  padding: 4px 8px;
  color: #294536;
  font-size: 0.66rem;
  font-weight: 700;
  background: #edf4ef;
  border-radius: 999px;
}

.profile-chips .empty-chip {
  color: var(--muted);
  background: #f1f2f1;
}

.trend-card {
  padding: 22px 22px 12px;
  margin: 12px 28px 20px;
  background: #f8faf8;
  border: 1px solid #e1e8e3;
  border-radius: 17px;
}

.trend-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.trend-heading h3 {
  margin: 4px 0 3px;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.trend-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.trend-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 0 50px;
}

.trend-stat strong {
  color: var(--green);
  font-size: 1.05rem;
}

.trend-stat span {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 750;
  text-transform: uppercase;
}

.report-footnote {
  padding: 0 28px 20px;
  color: var(--muted);
  font-size: 0.64rem;
  text-align: right;
}

.view-chart-panel {
  margin-bottom: 22px;
}

.chart-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.chart-heading h2 {
  margin: 5px 0 4px;
}

.chart-heading p {
  max-width: 560px;
  margin: 0;
  font-size: 0.84rem;
}

.chart-filter {
  display: flex;
  align-items: end;
  gap: 9px;
}

.chart-filter select,
.chart-filter input {
  min-width: 150px;
}

.platform-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 10px 0 18px;
}

.latest-summary-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}

.latest-summary-heading h3,
.latest-summary-heading p {
  margin: 0;
}

.latest-summary-heading p,
.latest-summary-heading > span {
  font-size: 0.74rem;
}

.latest-summary-heading > span {
  color: var(--muted);
  font-weight: 700;
}

.platform-summary-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  background: #f5f8f5;
  border-top: 3px solid var(--green);
  border-radius: 11px;
}

.platform-summary-card.instagram {
  border-top-color: #d94677;
}

.platform-summary-card.tiktok {
  border-top-color: #111;
}

.platform-summary-card > .platform-label {
  grid-column: 1 / -1;
}

.platform-summary-card strong,
.platform-summary-card div span {
  display: block;
}

.platform-summary-card strong {
  font-size: 1.3rem;
}

.platform-summary-card div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.chart-period-summary {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 4px 0 0 72px;
}

.chart-period-summary strong {
  color: var(--green);
}

.chart-period-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.view-chart {
  width: 100%;
  overflow: hidden;
}

.view-chart svg {
  display: block;
  width: 100%;
  min-width: 560px;
}

.chart-grid-line {
  stroke: #dfe7e1;
  stroke-width: 1;
}

.chart-axis-label,
.chart-date-label {
  fill: var(--muted);
  font-size: 11px;
}

.chart-area {
  fill: rgba(23, 107, 69, 0.1);
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-point {
  fill: var(--paper);
  stroke: var(--green);
  stroke-width: 3;
}

.chart-empty {
  padding: 34px 15px 12px;
  color: var(--muted);
  text-align: center;
}

.scheduler-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  margin: -10px 0 22px;
  color: #29543a;
  font-size: 0.84rem;
  background: #e8f5e9;
  border: 1px solid #c8e5ce;
  border-radius: 11px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #25a45d;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(37, 164, 93, 0.13);
}

.section-title {
  justify-content: flex-start;
  margin-bottom: 14px;
}

.count-pill {
  min-width: 28px;
  padding: 4px 9px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  background: var(--lime);
  border-radius: 999px;
}

.profile-grid {
  display: grid;
  gap: 10px;
}

.profile-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.platform-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 900;
  background: #111;
  border-radius: 14px;
}

.platform-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.platform-icon.instagram {
  background: linear-gradient(135deg, #7548e8, #ef466f 58%, #f5a34a);
}

.profile-content h3 {
  margin: 2px 0 4px;
  font-size: 1.08rem;
}

.profile-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.platform-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.text-button {
  min-height: auto;
  padding: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  background: transparent;
}

.text-button:hover {
  color: var(--danger);
  background: #fff3f1;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.text-link {
  padding: 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}

.request-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.75rem;
  border-radius: 8px;
}

.status-succeeded {
  color: var(--green);
}

.status-failed {
  color: var(--danger);
}

.status-running,
.status-pending {
  color: #966716;
}

.live-progress {
  display: inline-flex;
  margin: 10px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: capitalize;
}

.sentiment-panel { margin-bottom: 24px; }
.analysis-notes { margin-bottom: 24px; }
.confidence-level { padding: 6px 10px; border-radius: 999px; background: #eef1ed; color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.confidence-high { background: #dff3e5; color: #176b36; }
.confidence-medium { background: #fff0c7; color: #7a5510; }
.confidence-low { background: #ffe1dd; color: #9a3028; }
.coverage-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 14px 0; }
.coverage-metrics div { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf9; }
.coverage-metrics span, .coverage-metrics strong { display: block; }
.coverage-metrics span { color: var(--muted); font-size: .72rem; }
.coverage-metrics strong { margin-top: 5px; font-size: 1rem; }
.analysis-disclaimer { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.sentiment-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.sentiment-heading h2 { margin: 5px 0 14px; }
.sentiment-state { font-size: .72rem; font-weight: 800; text-transform: capitalize; }
.sentiment-action { margin: 0 0 14px; }
.sentiment-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sentiment-kpis article { padding: 16px; border-radius: 13px; }
.sentiment-kpis article.positive { background: #eaf8ee; color: #176b36; }
.sentiment-kpis article.negative { background: #fff0ee; color: #9a3028; }
.sentiment-kpis article.neutral { background: #f2f1ed; color: #5e625e; }
.sentiment-kpis strong, .sentiment-kpis span { display: block; }
.sentiment-kpis strong { font-size: 1.35rem; }
.sentiment-kpis span { margin-top: 4px; font-size: .75rem; }
.sentiment-meta { color: var(--muted); font-size: .78rem; }
.sentiment-keywords { color: var(--muted); font-size: .78rem; }
.sentiment-keywords summary { margin-bottom: 8px; color: var(--green); cursor: pointer; font-weight: 750; }
.sentiment-keywords div + div { margin-top: 5px; }
.comment-heading { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.sentiment-controls, .sentiment-editor { display: inline-flex; align-items: center; gap: 6px; }
.sentiment-editor { margin: 0; }
.sentiment-editor select, .sentiment-editor button { min-height: 28px; padding: 3px 7px; font-size: .68rem; }
.sentiment-editor button { border: 0; border-radius: 6px; color: white; background: var(--green); cursor: pointer; }
.reply-list .sentiment-editor { margin-left: 6px; }
.sentiment-badge { display: inline-flex; padding: 2px 7px; border-radius: 999px; font-size: .62rem; font-weight: 850; text-transform: uppercase; }
.sentiment-badge.positive { color: #176b36; background: #dff3e5; }
.sentiment-badge.negative { color: #9a3028; background: #ffe1dd; }
.sentiment-badge.neutral { color: #5e625e; background: #e8e7e2; }
.sentiment-badge.unlabeled { color: var(--muted); background: var(--canvas); }
.sentiment-word { padding: 0 2px; border-radius: 3px; }
.sentiment-word.positive { color: #176b36; background: #dff3e5; }
.sentiment-word.negative { color: #9a3028; background: #ffe1dd; }
.comment-filter-panel { margin-bottom: 24px; }
.comment-filter-panel form { display: grid; grid-template-columns: minmax(210px, 1.5fr) repeat(5, minmax(120px, 1fr)) auto; gap: 12px; align-items: end; }
.comment-filter-panel label { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: .7rem; font-weight: 750; }
.comment-filter-panel input, .comment-filter-panel select { width: 100%; min-width: 0; }
.comment-filter-actions { display: flex; min-height: 42px; gap: 10px; align-items: center; }
.hashtag-comment-list { display: grid; gap: 12px; }
.hashtag-comment { padding: 18px 20px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.hashtag-comment:target { border-color: var(--green); box-shadow: 0 0 0 3px rgba(26, 102, 65, .1); }
.hashtag-comment p { margin: 14px 0; line-height: 1.55; }
.hashtag-comment footer { display: flex; gap: 16px; color: var(--muted); font-size: .72rem; }
.hashtag-comment footer a { margin-left: auto; color: var(--green); font-weight: 750; }
.comment-author { display: flex; gap: 10px; align-items: center; }
.comment-author img { width: 38px; height: 38px; object-fit: cover; border-radius: 50%; }
.comment-author strong, .comment-author small { display: block; }
.comment-author small { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.comment-pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 22px; }
.comment-pagination a { padding: 8px 12px; color: var(--green); font-size: .78rem; font-weight: 750; text-decoration: none; border: 1px solid var(--line); border-radius: 8px; background: white; }
.comment-pagination span { color: var(--muted); font-size: .75rem; }

@media (max-width: 620px) {
  .coverage-metrics { grid-template-columns: 1fr 1fr; }
  .sentiment-kpis { grid-template-columns: 1fr; }
  .comment-filter-panel form { grid-template-columns: 1fr; }
  .comment-heading { align-items: flex-start; flex-direction: column; }
  .sentiment-controls { flex-wrap: wrap; }
}

@media (min-width: 621px) and (max-width: 1100px) {
  .comment-filter-panel form { grid-template-columns: repeat(3, 1fr); }
  .comment-search-field { grid-column: span 2; }
}

.flash.error {
  color: #742e29;
  background: #fff0ee;
  border-color: #edc8c4;
}

.history-list {
  display: grid;
  gap: 14px;
}

.history-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.history-toolbar form {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.history-toolbar > span {
  flex: 0 0 auto;
  padding-bottom: 12px;
  font-size: 0.82rem;
}

.history-card {
  display: grid;
  grid-template-columns: 170px 1fr;
  min-height: 220px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.history-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 18px;
}

.history-card-link:hover .history-card,
.history-card-link:focus-visible .history-card {
  border-color: #9eb9a7;
  box-shadow: 0 14px 35px rgba(37, 64, 46, 0.1);
  transform: translateY(-2px);
}

.history-card-link:focus-visible {
  outline: 3px solid rgba(23, 107, 69, 0.2);
  outline-offset: 3px;
}

.history-card-link .history-card {
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.open-post {
  display: inline-block;
  margin-top: 9px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 750;
}

.media-cover {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: white;
  font-weight: 900;
  background: #1e2922;
}

.media-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-cover .platform-cover-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.media-cover.has-logo-fallback .platform-cover-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.history-content {
  padding: 22px;
}

.history-content h2 {
  margin: 8px 0 4px;
  font-size: 1.16rem;
  line-height: 1.35;
}

.history-content > p {
  margin: 0;
  font-size: 0.82rem;
}

.history-meta {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(64px, 1fr));
  gap: 10px;
  margin-top: 23px;
}

.metric-grid div {
  padding: 10px;
  background: #f5f8f5;
  border-radius: 10px;
}

.metric-grid strong,
.metric-grid span {
  display: block;
}

.metric-grid strong {
  font-size: 0.98rem;
}

.metric-grid span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.empty-state {
  padding: 46px 20px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed #c8d4cc;
  border-radius: 15px;
}

.empty-state h3 {
  margin: 0 0 6px;
  color: var(--ink);
}

.empty-state p {
  margin: 0;
}

.flash {
  padding: 13px 16px;
  margin-bottom: 18px;
  color: #24442f;
  background: #e6f6e9;
  border: 1px solid #bee1c7;
  border-radius: 11px;
}

.flash.info {
  color: #32485e;
  background: #eaf3fb;
  border-color: #c9dced;
}

@media (max-width: 700px) {
  .app-main {
    width: min(100% - 28px, 1040px);
    padding-top: 28px;
  }

  .hero-card {
    padding: 30px 22px;
    border-radius: 20px;
  }

  .field-action,
  .profile-form,
  .member-form {
    grid-template-columns: 1fr;
  }

  .app-nav,
  .app-sidebar,
  .nav-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-nav {
    padding: 14px 5vw;
  }

  .nav-links {
    gap: 9px;
  }

  .user-library-row {
    grid-template-columns: auto 1fr auto;
  }

  .user-library-row form {
    grid-column: 2 / -1;
  }

  .heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .edit-user-name form {
    right: auto;
    left: 0;
  }

  .history-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .history-toolbar form {
    grid-template-columns: 1fr;
  }

  .chart-heading,
  .chart-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .report-header,
  .trend-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .report-header {
    padding: 24px 20px;
  }

  .report-kpis,
  .platform-breakdown {
    grid-template-columns: 1fr;
    padding-right: 16px;
    padding-left: 16px;
  }

  .searched-profile-groups {
    grid-template-columns: 1fr;
  }

  .searched-profiles {
    padding-right: 16px;
    padding-left: 16px;
  }

  .searched-profiles-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .platform-report-card {
    grid-template-columns: 1.4fr 1fr;
  }

  .trend-card {
    margin-right: 16px;
    margin-left: 16px;
  }

  .trend-stat {
    align-items: flex-start;
    flex-direction: column;
    margin-left: 0;
  }

  .platform-summary {
    grid-template-columns: 1fr;
  }

  .latest-summary-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-period-summary {
    margin-left: 0;
  }

  .view-chart {
    overflow-x: auto;
  }

  .profile-card {
    grid-template-columns: auto 1fr;
  }

  .profile-card form {
    grid-column: auto;
  }

  .profile-actions {
    grid-column: 2;
  }

  .history-card {
    grid-template-columns: 100px 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media print {
  @page {
    size: landscape;
    margin: 8mm;
  }

  body {
    background: white;
  }

  .app-nav,
  .page-heading,
  .scheduler-notice,
  .flash,
  .print-report-button,
  .chart-filter,
  .performance-report ~ * {
    display: none !important;
  }

  .app-main {
    width: 100%;
    padding: 0;
  }

  .performance-report {
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  .report-header,
  .rate-kpi {
    color-adjust: exact;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .report-header {
    padding: 20px 24px;
  }

  .report-kpis {
    padding-top: 16px;
  }

  .trend-card {
    padding-top: 14px;
    margin-bottom: 10px;
  }

  .view-chart svg {
    max-height: 225px;
  }
}
