:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #f8fbf9;
  --surface-3: #edf4f0;
  --text: #101828;
  --muted: #667085;
  --soft: #98a2b3;
  --line: #dce7e1;
  --line-strong: #c5d8ce;
  --brand: #16b878;
  --brand-strong: #0d9d64;
  --brand-soft: #ddf8ec;
  --lime: #dfff72;
  --blue: #3375f6;
  --amber: #f5a623;
  --red: #e24c4b;
  --shadow-sm: 0 4px 18px rgba(25, 60, 43, .07);
  --shadow-md: 0 18px 46px rgba(25, 60, 43, .11);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --shell: 1220px;
  --header-h: 72px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07110d;
  --surface: #0f1b16;
  --surface-2: #13231c;
  --surface-3: #1a2d24;
  --text: #f4faf7;
  --muted: #a5b5ad;
  --soft: #77887f;
  --line: #223b30;
  --line-strong: #315342;
  --brand: #43e59e;
  --brand-strong: #20c982;
  --brand-soft: #123d2c;
  --lime: #e6ff87;
  --blue: #76a5ff;
  --amber: #ffc35a;
  --red: #ff7674;
  --shadow-sm: 0 4px 18px rgba(0,0,0,.22);
  --shadow-md: 0 24px 64px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% -5%, color-mix(in srgb, var(--brand) 10%, transparent) 0 16%, transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans", Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.shell { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }
.visually-hidden {
  position: absolute !important; 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; left: 16px; top: -80px; z-index: 1000; padding: 12px 16px;
  border-radius: 10px; background: var(--text); color: var(--surface); font-weight: 800;
  transition: top .2s ease;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 70%, white); outline-offset: 3px; }

.site-header {
  position: relative;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.utility-bar {
  min-height: 40px; display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 13px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.utility-left, .utility-nav { display: flex; align-items: center; gap: 16px; }
.utility-separator { width: 1px; height: 13px; background: var(--line-strong); }
.utility-nav a, .utility-nav button { transition: color .18s ease; }
.utility-nav a:hover, .utility-nav button:hover { color: var(--brand-strong); }
.text-button, .text-link, .button-link {
  border: 0; background: none; padding: 0; cursor: pointer;
}
.text-link { color: var(--brand-strong); font-weight: 800; }

.brand-search {
  min-height: 146px; display: grid; grid-template-columns: 236px minmax(420px, 1fr) 210px;
  gap: 34px; align-items: center;
}
.brand { display: inline-flex; width: 220px; }
.brand img { width: 220px; height: auto; }
.search-area { position: relative; width: 100%; max-width: 720px; justify-self: center; }
.search-form {
  min-height: 66px; display: flex; align-items: center; padding: 5px 6px 5px 8px;
  border: 3px solid var(--brand); border-radius: 23px; background: var(--surface);
  box-shadow: 0 10px 32px color-mix(in srgb, var(--brand) 16%, transparent);
  transition: box-shadow .2s ease, transform .2s ease;
}
.search-form:focus-within { box-shadow: 0 14px 38px color-mix(in srgb, var(--brand) 26%, transparent); transform: translateY(-1px); }
.search-scope {
  height: 48px; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  border: 0; border-right: 1px solid var(--line); background: transparent; padding: 0 16px 0 12px;
  font-weight: 800; color: var(--muted); cursor: pointer;
}
.search-scope svg { width: 18px; height: 18px; }
.search-form input {
  min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text);
  font-size: 20px; font-weight: 650; padding: 0 16px;
}
.search-form input::placeholder { color: var(--soft); font-weight: 500; }
.icon-button {
  border: 0; background: transparent; display: inline-grid; place-items: center; cursor: pointer;
}
.search-tool { width: 42px; height: 42px; border-radius: 14px; color: var(--muted); }
.search-tool:hover { background: var(--surface-3); color: var(--text); }
.search-tool svg { width: 22px; height: 22px; }
.search-submit {
  width: 52px; height: 52px; flex: 0 0 auto; border: 0; border-radius: 17px; background: var(--brand);
  color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .18s ease, transform .18s ease;
}
.search-submit:hover { background: var(--brand-strong); transform: translateY(-1px); }
.search-submit svg { width: 25px; height: 25px; }
.search-hint { margin: 9px 8px 0; color: var(--soft); font-size: 12px; }
kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 11px; }
.scope-menu, .suggestions {
  position: absolute; z-index: 50; top: 72px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-md); border-radius: 18px; overflow: hidden;
}
.scope-menu { left: 0; width: 190px; padding: 8px; }
.scope-menu button {
  width: 100%; border: 0; background: transparent; text-align: left; padding: 11px 12px;
  border-radius: 11px; cursor: pointer; color: var(--muted); font-weight: 700;
}
.scope-menu button:hover, .scope-menu button[aria-selected="true"] { background: var(--brand-soft); color: var(--brand-strong); }
.suggestions { left: 0; right: 0; padding: 8px; }
.suggestion-item {
  width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: transparent;
  padding: 11px 13px; border-radius: 12px; cursor: pointer; text-align: left;
}
.suggestion-item:hover, .suggestion-item.active { background: var(--surface-3); }
.suggestion-item svg { width: 18px; height: 18px; color: var(--soft); flex: 0 0 auto; }
.suggestion-item span { flex: 1; }
.suggestion-item small { color: var(--soft); }

.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.round-action {
  width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm);
}
.round-action svg { width: 20px; height: 20px; }
.moon-icon { display: none; }
html[data-theme="dark"] .sun-icon { display: none; }
html[data-theme="dark"] .moon-icon { display: block; }
.profile-button {
  min-width: 150px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  padding: 7px 12px 7px 8px; display: flex; align-items: center; gap: 10px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.profile-avatar, .account-avatar {
  display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-weight: 900;
}
.profile-avatar { width: 34px; height: 34px; }
.profile-copy { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.profile-copy strong { font-size: 13px; }
.profile-copy small { margin-top: 3px; color: var(--soft); font-size: 11px; }
.search-tabs {
  min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; overflow-x: auto;
  scrollbar-width: none;
}
.search-tabs::-webkit-scrollbar { display: none; }
.search-tabs button {
  flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); padding: 10px 15px;
  border-radius: 12px; cursor: pointer; font-weight: 750;
}
.search-tabs button:hover, .search-tabs button.active { background: var(--brand-soft); color: var(--brand-strong); }

section { scroll-margin-top: 30px; }
.service-rail { padding: 44px 0 28px; }
.section-heading, .panel-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-heading.compact { margin-bottom: 18px; }
.eyebrow {
  margin: 0 0 5px; color: var(--brand-strong); font-size: 11px; font-weight: 900; letter-spacing: .15em;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; line-height: 1.18; }
.section-heading h2 { font-size: clamp(24px, 3vw, 34px); }
.muted { color: var(--muted); }
.service-grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px;
}
.service-card {
  min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 17px; padding: 15px 8px 13px;
  display: flex; flex-direction: column; align-items: center; gap: 9px; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.service-card:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: var(--shadow-sm); }
.service-icon {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-weight: 900; font-size: 19px;
  background: var(--service-bg, var(--brand-soft)); color: var(--service-color, var(--brand-strong));
}
.service-card span:last-child { width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12px; font-weight: 750; }

.portal-layout { display: grid; grid-template-columns: minmax(0, 1.88fr) minmax(300px, .82fr); gap: 20px; align-items: start; padding-bottom: 20px; }
.main-column, .side-column { display: grid; gap: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.news-panel, .discovery-panel { padding: 24px; }
.panel-header { margin-bottom: 20px; }
.panel-header h2 { font-size: clamp(22px, 2.3vw, 31px); }
.panel-header.small { align-items: center; margin-bottom: 16px; }
.panel-header.small h2 { font-size: 19px; }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-3); }
.segmented button {
  border: 0; background: transparent; border-radius: 9px; padding: 8px 12px; color: var(--muted); cursor: pointer; font-weight: 750; font-size: 12px;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.news-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 20px; }
.news-lead {
  min-height: 358px; position: relative; overflow: hidden; border-radius: 20px; padding: 28px; display: flex; align-items: flex-end;
  background:
    radial-gradient(circle at 78% 18%, rgba(223,255,114,.38), transparent 26%),
    radial-gradient(circle at 22% 70%, rgba(51,117,246,.28), transparent 28%),
    linear-gradient(135deg, #0a5140 0%, #102f3c 62%, #171c34 100%);
  color: #fff;
}
.news-lead::before {
  content: ""; position: absolute; inset: 0; opacity: .32;
  background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 36px 36px;
}
.news-lead::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -52px; top: -58px; border: 40px solid rgba(255,255,255,.08); border-radius: 50%;
}
.news-lead-content { position: relative; z-index: 1; max-width: 530px; }
.category-pill {
  display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; background: var(--lime); color: #17320d; font-size: 11px; font-weight: 900; margin-bottom: 13px;
}
.news-lead h3 { font-size: clamp(28px, 3vw, 40px); margin-bottom: 12px; }
.news-lead p { margin: 0 0 18px; color: rgba(255,255,255,.78); }
.news-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: rgba(255,255,255,.65); }
.news-open {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; border: 1px solid rgba(255,255,255,.24); background: rgba(7,17,13,.28); color: #fff; padding: 10px 14px; border-radius: 12px; cursor: pointer; font-weight: 800;
}
.news-list { display: grid; align-content: start; }
.news-row {
  display: grid; grid-template-columns: 45px 1fr; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.news-row:last-child { border-bottom: 0; }
.news-row-number { color: var(--brand); font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.news-row h3 { font-size: 15px; margin-bottom: 5px; }
.news-row p { margin: 0; color: var(--muted); font-size: 12px; }
.news-row:hover h3 { color: var(--brand-strong); }
.discovery-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.discovery-card {
  min-height: 210px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 18px; overflow: hidden; cursor: pointer; transition: transform .18s ease, border-color .18s ease;
}
.discovery-card:hover { transform: translateY(-3px); border-color: var(--brand); }
.discovery-visual { height: 92px; position: relative; padding: 15px; color: #fff; overflow: hidden; }
.discovery-visual::before { content:""; position:absolute; inset:0; opacity:.28; background-image: radial-gradient(circle at 20% 20%, white 0 2px, transparent 3px); background-size: 22px 22px; }
.discovery-card:nth-child(1) .discovery-visual { background: linear-gradient(135deg,#3d5afe,#7c4dff); }
.discovery-card:nth-child(2) .discovery-visual { background: linear-gradient(135deg,#e16a3a,#f6b73c); }
.discovery-card:nth-child(3) .discovery-visual { background: linear-gradient(135deg,#059669,#14b8a6); }
.discovery-card:nth-child(4) .discovery-visual { background: linear-gradient(135deg,#0f4c75,#3282b8); }
.discovery-card:nth-child(5) .discovery-visual { background: linear-gradient(135deg,#ad1457,#ef5350); }
.discovery-card:nth-child(6) .discovery-visual { background: linear-gradient(135deg,#4b5563,#111827); }
.discovery-visual span { position: relative; z-index:1; font-size: 34px; font-weight: 900; }
.discovery-body { padding: 15px; }
.discovery-body small { color: var(--brand-strong); font-weight: 800; }
.discovery-body h3 { font-size: 16px; margin: 7px 0 8px; }
.discovery-body p { margin:0; color:var(--muted); font-size:12px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.subtle { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); color: var(--muted); }
.subtle svg { width: 19px; height: 19px; }

.side-column .panel { padding: 20px; }
.account-top { display: flex; align-items: center; gap: 13px; }
.account-avatar { width: 48px; height: 48px; font-size: 19px; }
.account-top p { margin: 0 0 3px; font-size: 12px; }
.account-top h2 { font-size: 20px; }
.account-copy { color: var(--muted); font-size: 13px; margin: 16px 0; }
.primary-button {
  border: 0; border-radius: 13px; background: var(--brand); color: #fff; padding: 12px 18px; cursor: pointer; font-weight: 850; transition: background .18s ease, transform .18s ease;
}
.primary-button:hover { background: var(--brand-strong); transform: translateY(-1px); }
.primary-button.full { width: 100%; }
.account-links { display:flex; align-items:center; justify-content:center; gap:12px; margin-top:13px; }
.account-links button { border:0; background:none; color:var(--soft); font-size:12px; cursor:pointer; }
.account-links span { width:1px; height:11px; background:var(--line); }
.weather-panel select { max-width: 122px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 9px; padding: 7px 8px; font-size: 12px; }
.weather-current { display:flex; align-items:center; gap:16px; margin-top: 4px; }
.weather-symbol { width:68px; height:68px; display:grid; place-items:center; border-radius:22px; background:linear-gradient(145deg,#fff5c7,#dff4ff); font-size:34px; }
html[data-theme="dark"] .weather-symbol { background:linear-gradient(145deg,#273225,#163047); }
.weather-current strong { display:block; font-size:38px; line-height:1; }
.weather-current span { display:block; margin-top:7px; color:var(--muted); font-size:12px; }
.weather-meta { display:flex; gap:18px; margin:15px 0; color:var(--muted); font-size:12px; }
.weather-days { display:grid; grid-template-columns:repeat(4,1fr); gap:7px; }
.weather-day { padding:9px 4px; border-radius:11px; background:var(--surface-2); text-align:center; }
.weather-day strong { display:block; font-size:12px; }
.weather-day span { display:block; font-size:18px; margin:4px 0; }
.weather-day small { color:var(--muted); }
.live-badge { display:inline-flex; align-items:center; gap:5px; color:var(--red); font-size:10px; font-weight:900; }
.live-badge i { width:7px; height:7px; border-radius:50%; background:currentColor; box-shadow:0 0 0 4px color-mix(in srgb,currentColor 14%,transparent); }
.trend-list { margin:0; padding:0; list-style:none; counter-reset:trend; }
.trend-item { display:grid; grid-template-columns:25px 1fr auto; gap:10px; align-items:center; padding:10px 0; border-bottom:1px solid var(--line); cursor:pointer; }
.trend-item:last-child { border-bottom:0; }
.trend-item::before { counter-increment:trend; content:counter(trend); color:var(--brand-strong); font-size:13px; font-weight:900; }
.trend-item button { border:0; background:none; text-align:left; cursor:pointer; padding:0; color:var(--text); font-weight:720; }
.trend-change { color:var(--soft); font-size:11px; }
.trend-change.up { color:var(--red); }
.official-links { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.official-link { display:flex; align-items:center; gap:8px; padding:10px; border:1px solid var(--line); border-radius:12px; color:var(--muted); font-size:12px; transition:.18s; }
.official-link:hover { border-color:var(--brand); color:var(--brand-strong); background:var(--brand-soft); }
.official-dot { width:8px; height:8px; border-radius:50%; background:var(--brand); box-shadow:0 0 0 4px var(--brand-soft); }

.wide-widgets { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; padding:0 0 52px; }
.widget-card { padding:20px; display:grid; grid-template-columns:auto 1fr; gap:14px; align-items:center; }
.widget-icon { width:52px; height:52px; border-radius:16px; display:grid; place-items:center; font-size:22px; font-weight:900; }
.widget-icon.finance { background:#fff4d8; color:#a85c00; }
.widget-icon.government { background:#ddebff; color:#1359b8; }
.widget-icon.learning { background:var(--brand-soft); color:var(--brand-strong); }
.widget-card h2 { font-size:17px; margin-bottom:5px; }
.widget-card p { margin:0; font-size:12px; }
.arrow-link { grid-column:2; display:inline-flex; align-items:center; gap:7px; color:var(--brand-strong); font-size:12px; font-weight:850; justify-self:start; }
.button-link { cursor:pointer; }

.search-view { padding: 42px 0 68px; }
.results-header { display:flex; justify-content:space-between; gap:30px; align-items:end; }
.results-header h1 { font-size:clamp(31px,4vw,48px); }
.result-meta { margin:10px 0 0; color:var(--muted); }
.safe-toggle { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:13px; font-weight:700; }
.switch { width:46px; height:26px; border:0; border-radius:999px; padding:3px; background:var(--line-strong); cursor:pointer; transition:.2s; }
.switch span { display:block; width:20px; height:20px; border-radius:50%; background:#fff; transition:transform .2s ease; box-shadow:0 2px 6px rgba(0,0,0,.18); }
.switch[aria-checked="true"] { background:var(--brand); }
.switch[aria-checked="true"] span { transform:translateX(20px); }
.result-tabs { display:flex; gap:8px; overflow-x:auto; margin:28px 0 20px; padding-bottom:2px; scrollbar-width:none; }
.result-tabs::-webkit-scrollbar { display:none; }
.result-tabs button { flex:0 0 auto; border:1px solid var(--line); background:var(--surface); border-radius:999px; padding:10px 15px; cursor:pointer; color:var(--muted); font-weight:800; }
.result-tabs button.active { border-color:var(--brand); background:var(--brand-soft); color:var(--brand-strong); }
.results-layout { display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:20px; align-items:start; }
.results-main, .results-side { display:grid; gap:16px; }
.answer-card { display:grid; grid-template-columns:52px 1fr; gap:15px; padding:22px; border:1px solid color-mix(in srgb,var(--brand) 45%,var(--line)); border-radius:var(--radius); background:linear-gradient(140deg,var(--brand-soft),var(--surface)); box-shadow:var(--shadow-sm); }
.answer-mark { width:52px; height:52px; border-radius:17px; display:grid; place-items:center; background:var(--brand); color:#fff; font-weight:900; font-size:19px; }
.answer-head { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.answer-head h2 { font-size:20px; }
.answer-head span { padding:5px 9px; border-radius:999px; background:var(--surface); border:1px solid var(--line); color:var(--muted); font-size:10px; font-weight:800; }
.answer-card p { margin:10px 0 0; color:var(--muted); }
.answer-sources { display:flex; flex-wrap:wrap; gap:7px; margin-top:13px; }
.answer-sources a { padding:6px 9px; border:1px solid var(--line); background:var(--surface); border-radius:999px; color:var(--muted); font-size:11px; }
.results-list { display:grid; gap:12px; }
.result-card { padding:21px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow-sm); }
.result-source { display:flex; align-items:center; gap:9px; color:var(--muted); font-size:12px; }
.source-favicon { width:25px; height:25px; border-radius:8px; display:grid; place-items:center; background:var(--surface-3); color:var(--brand-strong); font-weight:900; text-transform:uppercase; }
.result-source-copy { min-width:0; display:flex; flex-direction:column; }
.result-source-copy span:last-child { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--soft); }
.result-title { display:inline-block; margin:12px 0 8px; color:#1456c3; font-size:20px; font-weight:800; line-height:1.3; }
html[data-theme="dark"] .result-title { color:#80acff; }
.result-title:hover { text-decoration:underline; text-underline-offset:3px; }
.result-description { margin:0; color:var(--muted); font-size:14px; }
.result-extras { display:flex; flex-wrap:wrap; gap:7px; margin-top:13px; }
.result-chip { padding:5px 8px; border-radius:8px; background:var(--surface-3); color:var(--muted); font-size:11px; }
.result-image-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:14px; }
.image-result { aspect-ratio:4/3; border-radius:13px; overflow:hidden; position:relative; background:linear-gradient(135deg,#164e63,#22c55e); }
.image-result:nth-child(2n) { background:linear-gradient(135deg,#4338ca,#ec4899); }
.image-result:nth-child(3n) { background:linear-gradient(135deg,#ea580c,#facc15); }
.image-result span { position:absolute; inset:auto 10px 9px; color:#fff; font-size:12px; font-weight:800; text-shadow:0 2px 8px rgba(0,0,0,.5); }
.pagination { display:flex; justify-content:center; gap:6px; padding:12px 0; }
.pagination button { min-width:38px; height:38px; border:1px solid var(--line); background:var(--surface); border-radius:10px; cursor:pointer; }
.pagination button.active { background:var(--brand); color:#fff; border-color:var(--brand); }
.results-side .panel { padding:19px; }
.results-side h2 { font-size:18px; margin-bottom:10px; }
.side-search-card ul { margin:0; padding-left:19px; color:var(--muted); font-size:13px; }
.side-search-card li + li { margin-top:8px; }
.side-search-card code { background:var(--surface-3); padding:1px 5px; border-radius:5px; }
.recent-searches { display:flex; flex-wrap:wrap; gap:7px; }
.recent-searches button { border:1px solid var(--line); background:var(--surface-2); border-radius:999px; padding:7px 10px; cursor:pointer; color:var(--muted); font-size:11px; }
.provider-card p { margin:0; font-size:12px; }
.empty-state { padding:50px 24px; border:1px dashed var(--line-strong); border-radius:var(--radius); background:var(--surface); text-align:center; }
.empty-state strong { display:block; font-size:22px; margin-bottom:8px; }
.empty-state p { margin:0; color:var(--muted); }
.loading-card { height:148px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); padding:22px; }
.skeleton { border-radius:8px; background:linear-gradient(90deg,var(--surface-3) 25%,color-mix(in srgb,var(--surface-3) 60%,var(--surface)) 50%,var(--surface-3) 75%); background-size:200% 100%; animation:skeleton 1.25s linear infinite; }
.skeleton.one { width:34%; height:13px; }
.skeleton.two { width:72%; height:22px; margin-top:18px; }
.skeleton.three { width:90%; height:13px; margin-top:16px; }
.skeleton.four { width:64%; height:13px; margin-top:8px; }
@keyframes skeleton { to { background-position:-200% 0; } }

.site-footer { background:#08110e; color:#d7e2dc; padding:48px 0 22px; }
.footer-grid { display:grid; grid-template-columns:1.7fr repeat(3,1fr); gap:40px; }
.footer-grid img { width:200px; }
.footer-grid p { max-width:320px; color:#8fa199; font-size:13px; }
.footer-grid h2 { font-size:13px; margin:9px 0 14px; color:#fff; }
.footer-grid a { display:block; width:max-content; color:#8fa199; font-size:12px; margin:9px 0; }
.footer-grid a:hover { color:var(--brand); }
.footer-bottom { display:flex; justify-content:space-between; border-top:1px solid #1b2b24; margin-top:35px; padding-top:18px; color:#71837a; font-size:11px; }
.modal-dialog { width:min(92vw,440px); border:0; padding:0; border-radius:24px; background:transparent; color:var(--text); }
.modal-dialog::backdrop { background:rgba(3,10,7,.65); backdrop-filter:blur(5px); }
.login-card { position:relative; background:var(--surface); border:1px solid var(--line); border-radius:24px; padding:30px; box-shadow:var(--shadow-md); }
.modal-close { position:absolute; right:15px; top:13px; width:35px; height:35px; border:0; border-radius:10px; background:var(--surface-3); cursor:pointer; font-size:24px; line-height:1; }
.login-logo { width:54px; height:54px; border-radius:18px; display:grid; place-items:center; background:var(--brand); color:#fff; font-weight:900; font-size:19px; margin-bottom:18px; }
.login-card h2 { font-size:27px; }
.login-card > p { color:var(--muted); margin:8px 0 20px; }
.login-card label { display:grid; gap:7px; color:var(--muted); font-size:12px; font-weight:800; }
.login-card input { height:48px; border:1px solid var(--line-strong); border-radius:12px; background:var(--surface-2); color:var(--text); padding:0 13px; outline:0; }
.login-card input:focus { border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }
.login-card .primary-button { margin-top:13px; }
.login-card small { display:block; margin-top:16px; color:var(--soft); }
.toast { position:fixed; z-index:200; left:50%; bottom:28px; transform:translate(-50%,24px); opacity:0; pointer-events:none; padding:12px 16px; border-radius:13px; background:var(--text); color:var(--surface); box-shadow:var(--shadow-md); font-size:13px; font-weight:800; transition:.22s ease; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.back-top { position:fixed; right:22px; bottom:22px; width:44px; height:44px; border:1px solid var(--line); border-radius:14px; background:var(--surface); box-shadow:var(--shadow-sm); cursor:pointer; opacity:0; transform:translateY(12px); pointer-events:none; transition:.2s; }
.back-top.show { opacity:1; transform:none; pointer-events:auto; }
.noscript { padding:18px; background:#fee4e2; color:#912018; text-align:center; font-weight:800; }

@media (max-width: 1080px) {
  .brand-search { grid-template-columns:190px minmax(380px,1fr) 52px; gap:20px; }
  .brand { width:180px; }
  .brand img { width:180px; }
  .profile-button { display:none; }
  .service-grid { grid-template-columns:repeat(6,1fr); }
  .portal-layout { grid-template-columns:minmax(0,1.6fr) minmax(280px,.8fr); }
  .news-layout { grid-template-columns:1fr; }
  .news-list { grid-template-columns:1fr 1fr; column-gap:18px; }
  .discovery-grid { grid-template-columns:repeat(2,1fr); }
}

@media (max-width: 850px) {
  .shell { width:min(calc(100% - 28px),var(--shell)); }
  .utility-nav a:nth-child(-n+3) { display:none; }
  .brand-search { min-height:auto; grid-template-columns:1fr auto; padding:18px 0 14px; }
  .brand { width:170px; }
  .brand img { width:170px; }
  .search-area { grid-column:1/-1; grid-row:2; max-width:none; margin-top:15px; }
  .search-hint { display:none; }
  .search-tabs { justify-content:flex-start; }
  .portal-layout { grid-template-columns:1fr; }
  .side-column { grid-template-columns:1fr 1fr; }
  .trends-panel, .official-panel { min-height:100%; }
  .wide-widgets { grid-template-columns:1fr; }
  .results-layout { grid-template-columns:1fr; }
  .results-side { grid-template-columns:1fr 1fr; }
  .provider-card { grid-column:1/-1; }
  .footer-grid { grid-template-columns:1.4fr 1fr 1fr; }
  .footer-grid > div:last-child { display:none; }
}

@media (max-width: 640px) {
  :root { --radius:17px; }
  .shell { width:min(calc(100% - 20px),var(--shell)); }
  .utility-bar { min-height:36px; font-size:11px; }
  .utility-nav { gap:10px; }
  .brand-search { grid-template-columns:1fr auto; gap:8px; }
  .brand { width:150px; }
  .brand img { width:150px; }
  .header-actions { align-self:center; }
  .round-action { width:42px; height:42px; }
  .search-form { min-height:58px; border-width:2px; border-radius:19px; }
  .search-scope { width:43px; padding:0 10px; border-right:0; }
  .search-scope span { display:none; }
  .search-form input { font-size:17px; padding:0 6px; }
  #voiceSearch { display:none; }
  .search-submit { width:46px; height:46px; border-radius:14px; }
  .scope-menu, .suggestions { top:63px; }
  .search-tabs { min-height:46px; gap:3px; }
  .search-tabs button { padding:8px 11px; font-size:12px; }
  .service-rail { padding-top:28px; }
  .section-heading.compact { align-items:center; }
  .section-heading h2 { font-size:24px; }
  .service-grid { display:flex; overflow-x:auto; gap:9px; padding-bottom:5px; scrollbar-width:none; }
  .service-grid::-webkit-scrollbar { display:none; }
  .service-card { min-width:82px; padding:13px 7px 11px; }
  .service-icon { width:43px; height:43px; }
  .portal-layout { gap:13px; }
  .news-panel, .discovery-panel { padding:17px; }
  .panel-header { align-items:flex-start; flex-direction:column; gap:13px; }
  .panel-header.small { flex-direction:row; align-items:center; }
  .segmented { max-width:100%; overflow-x:auto; }
  .news-lead { min-height:330px; padding:22px; }
  .news-lead h3 { font-size:29px; }
  .news-list { grid-template-columns:1fr; }
  .news-row:nth-child(n+5) { display:none; }
  .discovery-grid { display:flex; overflow-x:auto; gap:10px; scrollbar-width:none; }
  .discovery-grid::-webkit-scrollbar { display:none; }
  .discovery-card { flex:0 0 78%; }
  .side-column { grid-template-columns:1fr; gap:13px; }
  .wide-widgets { padding-bottom:36px; }
  .widget-card { grid-template-columns:auto 1fr; }
  .results-header { align-items:flex-start; flex-direction:column; gap:16px; }
  .safe-toggle { align-self:flex-end; }
  .search-view { padding-top:28px; }
  .answer-card { grid-template-columns:40px 1fr; padding:17px; }
  .answer-mark { width:40px; height:40px; border-radius:13px; font-size:14px; }
  .answer-head { align-items:flex-start; flex-direction:column; gap:7px; }
  .result-card { padding:17px; }
  .result-title { font-size:18px; }
  .result-image-grid { grid-template-columns:1fr 1fr; }
  .results-side { grid-template-columns:1fr; }
  .footer-grid { grid-template-columns:1fr 1fr; gap:26px; }
  .footer-grid > div:first-child { grid-column:1/-1; }
  .footer-bottom { align-items:flex-start; flex-direction:column; gap:5px; }
  .login-card { padding:25px 20px; }
}

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

/* Prevent intrinsic grid/flex content from widening the mobile page. */
.portal-layout > *,
.main-column,
.side-column,
.news-panel,
.discovery-panel,
.news-layout,
.news-list,
.discovery-grid,
.results-layout > *,
.results-main,
.results-side {
  min-width: 0;
}

@media (max-width: 640px) {
  html, body { overflow-x: clip; }
  .portal-layout, .main-column, .side-column, .news-panel, .discovery-panel { width: 100%; max-width: 100%; }
  .segmented { width: 100%; }
  .discovery-grid { max-width: 100%; overflow-x: auto; }
  .discovery-card { min-width: 0; width: 78%; }
}

.brand-logo-dark { display: none; }
html[data-theme="dark"] .brand-logo-light { display: none; }
html[data-theme="dark"] .brand-logo-dark { display: block; }
