:root {
  --navy: #0B2A5B;
  --blue: #1D6DF0;
  --blue-dark: #155ECF;
  --blue-link: #1454C4;
  --ink: #16324F;
  --text: #4A5F79;
  --muted: #8496AD;
  --muted-2: #6E85A0;
  --line: #E6EDF7;
  --line-soft: #EEF3FA;
  --tint: #EAF1FD;
  --tint-soft: #F7FAFF;
  --field-border: #DCE6F5;
  --green: #14A06A;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  font-family: Manrope, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-link); text-decoration: none; }
a:hover { color: #0B3A93; text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
::placeholder { color: #93A3B8; }
.spacer { flex: 1; }

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
  padding: 0 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 9px; flex: none; }
.logo:hover { text-decoration: none; }
.wordmark {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--navy);
  white-space: nowrap;
}
.wordmark-tld { color: var(--blue); }
.site-nav { display: flex; gap: 22px; margin-left: 8px; flex: none; }
.site-nav a { font-size: 14.5px; font-weight: 600; color: #46617F; white-space: nowrap; }
.auth { display: flex; align-items: center; gap: 10px; flex: none; }

.btn {
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: #fff; color: #123E7E; border: 1.5px solid #CFDCF0; }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-soft { background: #F1F5FC; color: #123E7E; border: 1px solid #E2EAF6; padding: 0 16px; }
.btn-soft:hover { background: var(--tint); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--navy); color: #fff;
  font-size: 13.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* main */
#app { flex: 1; }

/* home */
.home { display: flex; flex-direction: column; align-items: center; padding: 118px 24px 60px; }
.home-lockup { display: flex; align-items: center; gap: 16px; margin-bottom: 40px; }
.home-wordmark {
  font-size: 46px; font-weight: 800; letter-spacing: -1.6px;
  color: var(--navy); white-space: nowrap;
}
.searchbox-wrap { position: relative; width: 100%; max-width: 660px; }
.searchbox {
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 8px 0 22px;
  background: #fff; border: 1.5px solid var(--field-border); border-radius: 999px;
  box-shadow: 0 6px 22px rgba(15, 60, 130, 0.07);
}
.searchbox input {
  flex: 1; height: 100%; border: 0; outline: none;
  font-size: 17px; color: var(--ink); background: transparent;
}
.searchbox-compact { height: 50px; padding: 0 6px 0 18px; box-shadow: none; }
.searchbox-compact input { font-size: 15.5px; }
.btn-search { height: 46px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 700; }
.btn-search:hover { background: var(--blue-dark); }
.searchbox-compact .btn-search { height: 38px; padding: 0 18px; font-size: 14px; }
.btn-clear { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 17px; }
.btn-clear:hover { background: #F1F5FC; }

.tagline { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 13.5px; color: var(--muted-2); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 46px; max-width: 700px; }
.chip {
  padding: 9px 16px; border: 1px solid #E4EBF6; border-radius: 999px;
  background: #F8FBFF; font-size: 13.5px; font-weight: 600; color: #3E5B7B;
}
.chip:hover { border-color: var(--blue); color: var(--blue); background: #fff; }
.kbd-hint { margin-top: 22px; font-size: 12.5px; color: #9FB0C6; }
.kbd-hint b { color: #46617F; }

/* suggestions */
.panel {
  position: absolute; left: 0; right: 0; top: 70px; z-index: 20;
  background: #fff; border: 1px solid #E4EBF6; border-radius: 16px;
  box-shadow: 0 18px 44px rgba(13, 50, 110, 0.13); padding: 8px;
}
.panel-compact { top: 58px; border-radius: 14px; padding: 6px; }
.panel-label { padding: 9px 14px 7px; font-size: 11.5px; font-weight: 700; letter-spacing: 1px; color: #93A3B8; }
.panel-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; border: 0; border-radius: 10px; background: transparent;
  text-align: left; font-size: 15px; color: var(--ink);
}
.panel-item:hover { background: #F4F8FF; }
.panel-item .icon { color: #9FB0C6; font-size: 13px; }

/* results */
.results-bar { border-bottom: 1px solid var(--line); padding: 18px 34px 0; }
.results-bar-inner { max-width: 1140px; margin: 0 auto; }
.results-bar .searchbox-wrap { max-width: 620px; }
.tabs { display: flex; gap: 30px; margin-top: 16px; }
.tab {
  padding: 0 2px 13px; border: 0; border-bottom: 2.5px solid transparent;
  background: none; font-size: 14.5px; font-weight: 700; color: var(--muted-2);
}
.tab[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.results-body { max-width: 1140px; margin: 0 auto; padding: 20px 34px 56px; }
.result-meta { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.results-grid {
  display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 320px);
  gap: 46px; align-items: start;
}
.result-list { display: flex; flex-direction: column; gap: 28px; }
.result-list.compact { gap: 18px; }
.result-site { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.favicon {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--tint); color: var(--blue);
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.result-url { font-size: 12.5px; color: #7A8EA6; }
.result-title { display: block; font-size: 19.5px; font-weight: 700; letter-spacing: -0.25px; margin-bottom: 5px; }
.result-snippet { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--text); text-wrap: pretty; }

.sponsored { padding: 16px 18px; background: #F6FAFF; border: 1px solid #E1EBFA; border-radius: 12px; }
.sponsored-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.badge-ad {
  padding: 2px 7px; border-radius: 4px; background: var(--blue); color: #fff;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.6px;
}
.sponsored .result-title { font-size: 19px; margin-bottom: 6px; }

.rail { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #FBFDFF; }
.rail-label { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: #93A3B8; margin-bottom: 14px; }
.rail-list { display: flex; flex-direction: column; gap: 2px; }
.rail-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border: 0; border-radius: 8px; background: transparent;
  text-align: left; font-size: 14px; color: #2F4C6B;
}
.rail-item:hover { background: #F1F6FE; color: var(--blue); }
.rail-item .arrow { color: #B6C4D6; }

.pagination { display: flex; align-items: center; gap: 7px; margin-top: 12px; }
.page-btn {
  height: 38px; min-width: 38px; padding: 0 14px;
  border: 1px solid #E2EAF6; border-radius: 8px; background: #fff;
  font-size: 13.5px; font-weight: 700; color: #46617F;
}
.page-btn:hover { border-color: var(--blue); color: var(--blue); }
.page-num { padding: 0; }
.page-num[aria-current="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }

/* images / news / videos */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; max-width: 1010px; }
.image-ph {
  border-radius: 10px; background: var(--tint); border: 1px solid #E1EBFA;
  display: flex; align-items: center; justify-content: center;
  color: #A9BDD6; font-size: 12px;
}
.image-title { margin-top: 7px; font-size: 13px; font-weight: 600; color: #2F4C6B; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-site { font-size: 12px; color: #92A5BC; }

.news-list { display: flex; flex-direction: column; max-width: 760px; }
.news-item { display: flex; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.news-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #7A8EA6; margin-bottom: 6px; }
.news-meta b { color: #46617F; }
.news-item .result-title { font-size: 18px; margin-bottom: 6px; }
.news-item .result-snippet { font-size: 14px; line-height: 1.55; }
.news-thumb { width: 148px; height: 96px; border-radius: 10px; background: var(--tint); border: 1px solid #E1EBFA; flex: none; }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; max-width: 1010px; }
.video-thumb {
  position: relative; height: 150px; border-radius: 10px;
  background: #E4EDFB; border: 1px solid #DDE8F8;
  display: flex; align-items: center; justify-content: center;
}
.play {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(29, 109, 240, 0.92);
  display: flex; align-items: center; justify-content: center;
}
.play::after {
  content: ""; width: 0; height: 0; margin-left: 3px;
  border-left: 12px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent;
}
.duration {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 4px;
  background: rgba(11, 42, 91, 0.85); color: #fff; font-size: 11.5px; font-weight: 700;
}
.video-title { display: block; font-size: 15px; font-weight: 700; margin-top: 10px; line-height: 1.35; }
.video-meta { font-size: 12.5px; color: #92A5BC; margin-top: 4px; }

/* dashboard */
.dash { background: var(--tint-soft); }
.dash-inner { max-width: 1140px; margin: 0 auto; padding: 38px 34px 60px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.dash-head h1 { margin: 0 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -0.8px; color: var(--navy); }
.dash-head p { margin: 0; font-size: 15px; color: #5C7391; }
.btn-cta { height: 46px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font-size: 14.5px; font-weight: 700; }
.btn-cta:hover { background: var(--blue-dark); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.stat { padding: 20px 22px; }
.stat-label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.4px; color: var(--muted); margin-bottom: 10px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -1px; color: var(--navy); }
.stat-delta { font-size: 12.5px; font-weight: 700; margin-top: 6px; color: var(--muted); }
.stat-delta.up { color: var(--green); }

.dash-mid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.chart-card { padding: 24px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.chart-title { font-size: 16px; font-weight: 800; color: var(--navy); }
.chart-sub { font-size: 13px; color: var(--muted); }
.chart { display: flex; align-items: flex-end; gap: 18px; height: 168px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.bar-value { font-size: 12px; font-weight: 700; color: #46617F; }
.bar { width: 100%; border-radius: 7px 7px 3px 3px; background: #CBDEFB; }
.bar.peak { background: var(--blue); }
.bar-day { font-size: 12px; color: #92A5BC; }

.balance { padding: 24px; background: var(--navy); border-radius: 14px; color: #fff; display: flex; flex-direction: column; }
.balance-label { font-size: 12.5px; font-weight: 700; letter-spacing: 1px; color: #8FB6F0; }
.balance-value { font-size: 46px; font-weight: 800; letter-spacing: -2px; margin: 12px 0 2px; }
.balance-sub { font-size: 14px; color: #A9C6F3; }
.balance hr { border: 0; height: 1px; background: rgba(255, 255, 255, 0.16); margin: 22px 0; }
.balance-rows { display: flex; flex-direction: column; gap: 12px; }
.balance-row { display: flex; justify-content: space-between; font-size: 14px; }
.balance-row span:first-child { color: #A9C6F3; }
.balance-row b { font-weight: 700; }
.btn-light { margin-top: 24px; height: 46px; border: 0; border-radius: 10px; background: #fff; color: var(--navy); font-size: 14.5px; font-weight: 800; }
.btn-light:hover { background: var(--tint); }

.table-card { overflow: hidden; }
.table-title { padding: 20px 24px; font-size: 16px; font-weight: 800; color: var(--navy); border-bottom: 1px solid var(--line-soft); }
.table-head, .table-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; }
.table-head {
  padding: 12px 24px; background: #FAFCFF; font-size: 12px; font-weight: 800;
  letter-spacing: 0.6px; color: var(--muted); border-bottom: 1px solid var(--line-soft);
}
.table-row { align-items: center; padding: 16px 24px; border-bottom: 1px solid #F2F6FC; font-size: 14px; color: #2F4C6B; }
.table-row .name { font-weight: 700; color: var(--navy); }
.table-row .spent { font-weight: 700; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.active { background: #E3F6EC; color: #0F8C58; }
.pill.review { background: #FFF3DC; color: #B57608; }
.pill.ended { background: #EEF2F8; color: #66788F; }

/* view-as pill */
.view-as {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; align-items: center; gap: 3px; padding: 4px;
  background: rgba(255, 255, 255, 0.96); border: 1px solid #E2EAF6; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(15, 60, 130, 0.14); backdrop-filter: blur(8px);
}
.view-as-label { padding: 0 8px 0 10px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.8px; color: #B6C4D6; white-space: nowrap; }
.view-as button {
  border: 0; border-radius: 999px; padding: 7px 13px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap;
  background: transparent; color: #7A8EA6;
}
.view-as button[aria-pressed="true"] { background: var(--tint); color: var(--blue); box-shadow: 0 1px 3px rgba(15, 60, 130, 0.14); }

/* footer */
.site-footer {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 18px 34px; border-top: 1px solid var(--line); background: #fff;
  font-size: 13px; color: var(--muted);
}
.site-footer a { color: #5C7391; }

@media (max-width: 1000px) {
  .site-nav { display: none; }
  .results-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-mid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .home { padding: 70px 18px 40px; }
  .home-wordmark { font-size: 32px; }
  .results-bar, .results-body, .dash-inner { padding-left: 18px; padding-right: 18px; }
  .stat-grid { grid-template-columns: 1fr; }
  .news-thumb { display: none; }
  .table-head, .table-row { grid-template-columns: 1.6fr 1fr 1fr; }
  .table-head div:nth-child(4), .table-head div:nth-child(5),
  .table-row div:nth-child(4), .table-row div:nth-child(5) { display: none; }
}
