:root {
  --ink: #17203a;
  --muted: #69718a;
  --line: #e5e7f1;
  --surface: #ffffff;
  --canvas: #f8f9ff;
  --primary: #25328a;
  --primary-2: #3445bd;
  --teal: #0d8f87;
  --coral: #e9593c;
  --free: #147d4b;
  --free-bg: #e8f7ef;
  --paid: #7435a6;
  --paid-bg: #f2e9fb;
  --mixed: #1768a5;
  --mixed-bg: #e5f2fb;
  --shadow: 0 14px 44px rgba(34, 45, 105, .12);
  --soft-shadow: 0 6px 22px rgba(34, 45, 105, .09);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(73, 91, 205, .08), transparent 30rem),
    radial-gradient(circle at 92% 10%, rgba(13, 143, 135, .07), transparent 28rem),
    var(--canvas);
  color: var(--ink);
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 72px;
  padding: 14px clamp(18px, 3vw, 48px);
}
.mini-brand {
  display: none;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 17px;
  letter-spacing: -.03em;
}
.mini-brand strong { color: var(--primary); }
.site-header.compact .mini-brand { display: flex; }
.header-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.quiet-link { color: var(--muted); font-size: 14px; text-decoration: none; }
.quiet-link:hover, .quiet-link:focus-visible { color: var(--primary); }
.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 6px 12px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(31, 42, 99, .05);
}
.profile-button:hover { border-color: #c8cae2; box-shadow: var(--soft-shadow); }
#profile-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 50%;
  background: #edf0ff;
}
#profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
#profile-label { max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.profile-menu {
  position: absolute;
  top: 64px;
  right: clamp(18px, 3vw, 48px);
  display: grid;
  min-width: 230px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}
.profile-menu a, .profile-menu button {
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 11px;
  background: none;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.profile-menu a:hover, .profile-menu button:hover { background: #f2f4ff; }

main { min-height: calc(100vh - 145px); }
.search-home {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: calc(100vh - 155px);
  padding: 40px 20px 120px;
}
.hero-brand { text-align: center; }
.hero-brand img { width: 94px; filter: drop-shadow(0 16px 22px rgba(37, 50, 138, .12)); }
.hero-brand h1 { margin: 12px 0 4px; font-size: clamp(35px, 6vw, 58px); letter-spacing: -.065em; line-height: 1; }
.hero-brand h1 span { color: var(--primary); }
.hero-brand p { margin: 13px 0 34px; color: var(--muted); font-size: clamp(14px, 2vw, 17px); }
.search-form { position: relative; width: min(750px, 100%); }
.search-box {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 66px;
  padding: 8px 10px 8px 20px;
  border: 1px solid #dcdfee;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: #a8afe3; box-shadow: 0 16px 55px rgba(37, 50, 138, .18); }
.search-leading { margin-right: 12px; color: var(--primary); font-size: 30px; line-height: 1; transform: rotate(-18deg); }
.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(15px, 2vw, 18px);
}
.search-box input::placeholder { color: #8e94a9; }
.search-tool {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--primary);
  font-size: 21px;
  cursor: pointer;
}
.search-tool:hover, .search-tool:focus-visible { background: #eef0ff; }
.search-buttons { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }
.primary-button, .secondary-button, .quiet-button {
  min-height: 44px;
  padding: 10px 19px;
  border-radius: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.primary-button { border: 1px solid var(--primary); background: var(--primary); color: #fff; box-shadow: 0 7px 18px rgba(37, 50, 138, .18); }
.primary-button:hover { background: var(--primary-2); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.secondary-button:hover { border-color: #bdc2df; box-shadow: var(--soft-shadow); transform: translateY(-1px); }
.quiet-button { border: 0; background: #eef0f8; color: var(--ink); }
.home-note { margin: 24px 0 0; color: #80879c; font-size: 12px; }

.suggestions {
  position: absolute;
  z-index: 40;
  top: 72px;
  left: 20px;
  right: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}
.suggestion-item { display: flex; gap: 10px; width: 100%; padding: 12px 16px; border: 0; background: #fff; text-align: left; cursor: pointer; }
.suggestion-item:hover, .suggestion-item[aria-selected="true"] { background: #f3f5ff; }

.results-view { width: min(1480px, 100%); margin: 0 auto; padding: 8px clamp(18px, 3.2vw, 52px) 70px; }
.results-search-wrap { position: relative; width: min(760px, 100%); margin: 5px auto 32px; }
.compact-search {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 5px 7px 5px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}
.compact-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; }
.compact-search button { width: 39px; height: 39px; border: 0; border-radius: 50%; background: transparent; color: var(--primary); cursor: pointer; font-size: 20px; }
.compact-search button:hover { background: #eef0ff; }
.compact-suggestions { top: 59px; left: 12px; right: 12px; }
.result-summary { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.eyebrow { margin: 0 0 4px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.result-summary h1 { margin: 0; font-size: clamp(24px, 4vw, 38px); letter-spacing: -.045em; }
.result-summary p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.correction { margin: 8px 0 18px; padding: 12px 15px; border-left: 4px solid var(--teal); border-radius: 0 12px 12px 0; background: #e9f8f6; }
.correction button { border: 0; background: none; color: var(--primary); font-weight: 800; text-decoration: underline; cursor: pointer; }
.filter-bar { display: flex; gap: 8px; overflow-x: auto; padding: 5px 1px 10px; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; min-height: 39px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.filter-chip.active, .filter-chip:hover { border-color: var(--primary); background: #eef0ff; color: var(--primary); }
.active-intent { display: flex; flex-wrap: wrap; gap: 7px; min-height: 22px; margin: 3px 0 18px; }
.intent-pill { padding: 5px 9px; border-radius: 999px; background: #edf7f6; color: #146e68; font-size: 11px; font-weight: 700; }
.result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(15px, 2vw, 26px); }
.resource-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(38, 46, 97, .045);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.resource-card:hover { transform: translateY(-4px); border-color: #cdd0e6; box-shadow: var(--shadow); }
.card-image-link { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #eef0ff, #e8f7f5); }
.card-image { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.resource-card:hover .card-image { transform: scale(1.025); }
.image-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--primary); font-size: 54px; }
.price-badge { position: absolute; left: 10px; bottom: 10px; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .035em; backdrop-filter: blur(6px); }
.price-free { background: rgba(232, 247, 239, .94); color: var(--free); }
.price-paid { background: rgba(242, 233, 251, .94); color: var(--paid); }
.price-freemium { background: rgba(229, 242, 251, .94); color: var(--mixed); }
.price-unknown { background: rgba(245, 246, 250, .94); color: var(--muted); }
.card-actions { position: absolute; z-index: 4; top: 9px; right: 9px; display: flex; gap: 6px; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .94); box-shadow: 0 3px 12px rgba(17, 24, 64, .15); cursor: pointer; }
.icon-button:hover { background: #fff; color: var(--primary); }
.icon-button.favorite.active { background: #fff0ed; color: var(--coral); }
.card-body { padding: 15px 16px 17px; }
.card-title { display: -webkit-box; min-height: 48px; margin: 0 0 9px; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 800; line-height: 1.45; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-title:hover { color: var(--primary); }
.card-meta { display: -webkit-box; min-height: 36px; margin: 0 0 11px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-source { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #f0f1f6; padding-top: 11px; color: var(--muted); font-size: 10px; }
.source-domain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verified { color: var(--teal); font-weight: 800; }
.load-more-wrap { display: flex; justify-content: center; margin: 32px 0; }
.zero-state { max-width: 650px; margin: 50px auto; text-align: center; }
.zero-icon { font-size: 70px; color: #bcc1d9; transform: rotate(-18deg); }
.zero-state h2 { margin-bottom: 8px; }
.zero-state p { color: var(--muted); }
.alternative-searches { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.alternative-searches button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--primary); cursor: pointer; }

.ad-shell { grid-column: 1 / -1; min-height: 130px; padding: 12px; border: 1px solid #e8e9ef; border-radius: 16px; background: #fff; text-align: center; overflow: hidden; }
.ad-label { display: block; margin-bottom: 7px; color: #9297a8; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }

.content-page { width: min(1080px, 100%); margin: 0 auto; padding: 30px clamp(18px, 4vw, 46px) 90px; }
.page-hero { margin: 12px 0 30px; padding: clamp(24px, 5vw, 48px); border-radius: 28px; background: linear-gradient(135deg, #283590, #187f8d); color: #fff; }
.page-hero .eyebrow { color: #a8eee7; }
.page-hero h1 { max-width: 760px; margin: 8px 0; font-size: clamp(30px, 5vw, 48px); letter-spacing: -.055em; }
.page-hero p { max-width: 750px; margin: 10px 0 0; color: rgba(255, 255, 255, .8); }
.page-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel-card { padding: 22px; border: 1px solid var(--line); border-radius: 19px; background: #fff; box-shadow: var(--soft-shadow); }
.panel-card.full { grid-column: 1 / -1; }
.panel-card h2, .panel-card h3 { margin-top: 0; letter-spacing: -.03em; }
.panel-card p, .legal-copy p, .legal-copy li { color: var(--muted); line-height: 1.75; }
.item-list { display: grid; gap: 9px; }
.account-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; }
.account-item a, .account-item button { color: var(--primary); }
.empty-copy { padding: 18px; color: var(--muted); text-align: center; }
.preference-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.switch { position: relative; width: 48px; height: 27px; border: 0; border-radius: 999px; background: #cdd1df; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--teal); }
.switch[aria-checked="true"]::after { transform: translateX(21px); }
.danger-button { padding: 10px 14px; border: 1px solid #f0b5aa; border-radius: 12px; background: #fff2ef; color: #a83620; font-weight: 700; cursor: pointer; }
.portal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.portal-form .full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #343c57; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid #d9dce9; border-radius: 11px; background: #fff; color: var(--ink); outline: 0; }
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #8993d6; box-shadow: 0 0 0 3px rgba(52, 69, 189, .11); }
.admin-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric { padding: 17px; border-radius: 16px; background: #f2f4ff; }
.metric strong { display: block; font-size: 27px; }
.metric span { color: var(--muted); font-size: 11px; }

.portal-dialog { width: min(590px, calc(100% - 28px)); max-height: 88vh; overflow: auto; padding: 28px; border: 0; border-radius: 22px; box-shadow: 0 28px 90px rgba(15, 20, 54, .3); }
.portal-dialog::backdrop { background: rgba(15, 20, 45, .48); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f0f1f7; font-size: 25px; cursor: pointer; }
.portal-dialog h2 { margin-top: 0; padding-right: 30px; letter-spacing: -.04em; }
.portal-dialog p { color: var(--muted); line-height: 1.6; }
.portal-dialog form, .filter-fields { display: grid; gap: 15px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.tool-choice { display: grid; gap: 14px; }
.upload-drop { display: grid; place-items: center; min-height: 180px; padding: 20px; border: 2px dashed #cbd0e6; border-radius: 18px; background: #f8f9ff; text-align: center; cursor: pointer; }
.upload-drop:hover { border-color: var(--primary); }
.preview-image { max-height: 260px; margin: 12px auto; border-radius: 15px; }

.consent-banner {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(920px, calc(100% - 28px));
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 80px rgba(24, 31, 78, .23);
  transform: translateX(-50%);
}
.consent-banner strong { display: block; margin-bottom: 3px; }
.consent-banner p { margin: 0; color: var(--muted); font-size: 12px; }
.consent-actions { display: flex; flex: 0 0 auto; gap: 9px; margin-left: 16px; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 24px; width: max-content; max-width: calc(100% - 30px); padding: 11px 16px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: var(--shadow); font-size: 13px; transform: translateX(-50%); }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; padding: 18px clamp(18px, 3vw, 48px); border-top: 1px solid rgba(219, 222, 235, .8); color: var(--muted); font-size: 11px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.mobile-nav { display: none; }
.noscript { padding: 20px; background: #fff1da; text-align: center; }

@media (max-width: 1100px) {
  .result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  body { padding-bottom: 66px; }
  .site-header { min-height: 62px; padding: 10px 14px; }
  .site-header.compact .mini-brand span { display: none; }
  .owner-link, #profile-label { display: none; }
  .profile-button { padding: 5px; border: 0; background: transparent; box-shadow: none; }
  #profile-avatar { width: 36px; height: 36px; }
  .profile-menu { top: 56px; right: 12px; }
  .search-home { min-height: calc(100vh - 120px); padding: 26px 16px 90px; }
  .hero-brand img { width: 76px; }
  .hero-brand h1 { margin-top: 9px; font-size: 38px; }
  .hero-brand p { max-width: 310px; margin: 12px auto 27px; font-size: 13px; }
  .search-box { min-height: 58px; padding-left: 15px; }
  .search-leading { margin-right: 7px; font-size: 25px; }
  .search-box input { font-size: 14px; }
  .search-tool { width: 37px; height: 37px; }
  .search-buttons { display: grid; grid-template-columns: 1fr; gap: 10px; width: min(330px, 100%); margin: 18px auto 0; }
  .results-view { padding: 4px 14px 60px; }
  .results-search-wrap { margin-bottom: 24px; }
  .result-summary { align-items: start; }
  .lucky-compact { display: none; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .resource-card { border-radius: 15px; }
  .card-image-link { aspect-ratio: 4 / 4.5; }
  .card-body { padding: 11px 11px 13px; }
  .card-title { min-height: 42px; font-size: 13px; line-height: 1.55; }
  .card-meta { min-height: 32px; font-size: 9px; }
  .card-source { font-size: 8px; }
  .price-badge { left: 7px; bottom: 7px; font-size: 8px; }
  .card-actions { top: 6px; right: 6px; }
  .icon-button { width: 32px; height: 32px; }
  .content-page { padding: 10px 14px 60px; }
  .page-grid, .portal-form { grid-template-columns: 1fr; }
  .panel-card.full, .portal-form .full { grid-column: auto; }
  .page-hero { padding: 25px 20px; border-radius: 20px; }
  .consent-banner { bottom: 76px; display: grid; gap: 12px; }
  .consent-actions { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
  .site-footer { display: grid; padding-bottom: 26px; }
  .site-footer nav { gap: 12px; }
  .mobile-nav { position: fixed; z-index: 90; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); min-height: 64px; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .96); backdrop-filter: blur(16px); }
  .mobile-nav a { display: grid; place-items: center; align-content: center; gap: 1px; color: var(--muted); font-size: 23px; text-decoration: none; }
  .mobile-nav span { font-size: 8px; font-weight: 700; }
}

@media (max-width: 390px) {
  .result-grid { grid-template-columns: 1fr; }
  .card-image-link { aspect-ratio: 4 / 3; }
  .card-title { min-height: auto; }
  .card-meta { min-height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
