@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --accent: #ff6b2c;
    --accent-strong: #e94f12;
    --accent-soft: #fff0e9;
    --bg: #f7f8fb;
    --surface: #ffffff;
    --surface-2: #f0f2f6;
    --text: #171a21;
    --muted: #6c7380;
    --line: #e3e6ec;
    --blue: #165dff;
    --green: #1d9b63;
    --red: #d83d4c;
    --shadow: 0 18px 55px rgba(24, 31, 50, .09);
    --soft-shadow: 0 8px 28px rgba(24, 31, 50, .07);
    --radius: 22px;
    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #101216;
    --surface: #181b21;
    --surface-2: #21252d;
    --text: #f1f3f7;
    --muted: #9da5b2;
    --line: #2c313b;
    --accent-soft: #3a251e;
    --shadow: 0 18px 55px rgba(0, 0, 0, .35);
    --soft-shadow: 0 8px 28px rgba(0, 0, 0, .25);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        --bg: #101216;
        --surface: #181b21;
        --surface-2: #21252d;
        --text: #f1f3f7;
        --muted: #9da5b2;
        --line: #2c313b;
        --accent-soft: #3a251e;
        --shadow: 0 18px 55px rgba(0, 0, 0, .35);
        --soft-shadow: 0 8px 28px rgba(0, 0, 0, .25);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Manrope, system-ui, -apple-system, Segoe UI, sans-serif; font-size: 15px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, .button { cursor: pointer; }
img { display: block; max-width: 100%; }
.content-width { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-main { min-height: calc(100vh - 160px); }
.eyebrow { display: block; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.site-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 22px; min-height: 68px; padding: 10px 28px; border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); }
.header-brand, .admin-brand { display: flex; align-items: center; gap: 9px; letter-spacing: -.04em; }
.header-brand strong { font-size: 20px; font-weight: 800; }
.brand-mark { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 18px 18px 18px 5px; background: var(--accent); color: white; font-size: 30px; font-weight: 800; font-style: normal; box-shadow: 0 9px 24px color-mix(in srgb, var(--accent) 30%, transparent); }
.brand-mark.small { width: 34px; height: 34px; border-radius: 11px 11px 11px 4px; font-size: 18px; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a { padding: 8px 11px; color: var(--muted); font-weight: 600; border-radius: 10px; }
.main-nav a:hover { background: var(--surface-2); color: var(--text); }
.header-spacer { flex: 1; }
.header-widgets { display: flex; gap: 7px; }
.header-widget { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.header-widget b { margin-left: 4px; color: var(--text); }
.skeleton { display: block; height: 10px; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skeleton.short { width: 62px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.theme-switcher { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.theme-switcher button { width: 29px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.theme-switcher button:hover, .theme-switcher button.active { background: var(--surface-2); color: var(--text); }
.mini-profile { position: relative; }
.mini-profile summary { display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; font-weight: 700; }
.mini-profile summary::-webkit-details-marker { display: none; }
.mini-profile summary img, .avatar-fallback { width: 34px; height: 34px; border-radius: 11px; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; background: linear-gradient(145deg, var(--accent), #ff9b50); color: white; }
.profile-menu { position: absolute; top: calc(100% + 13px); right: 0; display: grid; min-width: 220px; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.profile-menu > strong, .profile-menu > small { padding-inline: 8px; }
.profile-menu > small { margin: 1px 0 10px; color: var(--muted); }
.profile-menu a, .profile-menu button { width: 100%; padding: 9px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--text); text-align: left; }
.profile-menu a:hover, .profile-menu button:hover { background: var(--surface-2); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 18px; border: 1px solid transparent; border-radius: 13px; font-weight: 800; transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 25%, transparent); }
.button.primary:hover { background: var(--accent-strong); }
.button.ghost { border-color: var(--line); background: var(--surface); color: var(--text); }
.button.compact { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.button.wide { width: 100%; justify-content: space-between; }

.hero { position: relative; display: grid; min-height: 520px; place-items: center; overflow: hidden; padding: 78px 20px 112px; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 36%); }
.hero::after { position: absolute; bottom: 0; left: 50%; width: min(1180px, 90%); height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); content: ""; transform: translateX(-50%); }
.hero-content { position: relative; z-index: 2; width: min(820px, 100%); text-align: center; }
.hero-logo { display: inline-flex; align-items: center; gap: 16px; margin-bottom: 34px; text-align: left; }
.hero-logo > span { display: grid; width: 76px; height: 76px; place-items: center; border-radius: 25px 25px 25px 8px; background: var(--accent); color: white; font-size: 44px; font-weight: 800; box-shadow: 0 16px 42px color-mix(in srgb, var(--accent) 30%, transparent); }
.hero-logo div { display: grid; }
.hero-logo strong { font-size: 49px; line-height: 1; letter-spacing: -.065em; }
.hero-logo small { margin-top: 6px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.hero-orbit { position: absolute; border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 50%; }
.orbit-one { width: 520px; height: 520px; right: -250px; top: -180px; }
.orbit-two { width: 370px; height: 370px; left: -220px; bottom: -210px; }

.search-box { position: relative; display: flex; align-items: center; width: min(800px, 100%); padding: 7px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--soft-shadow); transition: border-color .2s, box-shadow .2s; }
.search-box:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 14px 42px color-mix(in srgb, var(--accent) 10%, rgba(24,31,50,.09)); }
.search-box.large { padding: 8px; border-radius: 22px; box-shadow: 0 22px 70px rgba(24, 31, 50, .12); }
.search-icon { padding-left: 12px; color: var(--muted); font-size: 26px; line-height: 1; transform: rotate(-15deg); }
.search-box input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 17px; }
.search-box.large input { height: 54px; font-size: 18px; }
.search-box button { align-self: stretch; padding: 0 26px; border: 0; border-radius: 14px; background: var(--accent); color: white; font-weight: 800; }
.suggestions { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; right: 0; display: grid; overflow: hidden; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); text-align: left; }
.suggestions a { padding: 10px 13px; border-radius: 10px; }
.suggestions a:hover, .suggestions a.active { background: var(--surface-2); }
.quick-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.quick-links a { padding: 4px 10px; border-radius: 20px; background: var(--surface-2); color: var(--text); font-weight: 600; }

.dashboard-strip { position: relative; z-index: 4; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: -54px; }
.info-card, .side-card, .admin-card, .settings-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--soft-shadow); }
.info-card { min-height: 210px; padding: 22px; }
.card-label { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.card-label > span { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.card-label > strong, .card-label > small, .card-label > a { color: var(--muted); font-size: 12px; }
.weather-now { display: flex; align-items: center; gap: 14px; }
.weather-now span { font-size: 39px; }
.weather-now strong { font-size: 42px; letter-spacing: -.06em; }
.info-card > p { margin: 2px 0 14px; color: var(--muted); font-size: 13px; }
.forecast-row { display: flex; gap: 8px; }
.forecast-row > span { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 5px; padding: 7px; border-radius: 10px; background: var(--surface-2); font-size: 12px; }
.forecast-row small { color: var(--muted); }
.currency-grid { display: grid; gap: 8px; }
.currency-grid > span { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.currency-grid > span:last-child { border: 0; }
.currency-grid small { color: var(--muted); font-weight: 700; }
.currency-grid strong { font-size: 20px; letter-spacing: -.03em; }
.trend-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.trend-list a { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px; border-radius: 9px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend-list a:hover { background: var(--surface-2); }
.trend-list b { display: grid; min-width: 24px; height: 24px; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }

.home-news { padding-block: 78px; }
.section-heading, .page-title, .admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 26px; }
.section-heading h2, .page-title h1, .admin-heading h1 { margin: 5px 0 0; font-size: clamp(27px, 4vw, 38px); letter-spacing: -.05em; line-height: 1.1; }
.section-heading > a { color: var(--accent); font-weight: 800; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.news-grid.compact-grid { grid-template-columns: repeat(3, 1fr); }
.news-card { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--soft-shadow); transition: transform .25s, box-shadow .25s; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.news-card > div:last-child { padding: 17px; }
.news-card h2, .news-card h3 { margin: 7px 0 6px; font-size: 18px; line-height: 1.35; letter-spacing: -.025em; }
.news-card h3 { font-size: 15px; }
.news-card p, .news-card small { margin: 0; color: var(--muted); font-size: 12px; }
.news-image { position: relative; min-height: 170px; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 30%, #1d2738), #172033); background-position: center; background-size: cover; }
.news-image > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.news-image::after { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.35), transparent 70%); content: ""; }
.news-image span { position: absolute; z-index: 1; left: 14px; bottom: 12px; padding: 4px 9px; border-radius: 8px; background: rgba(255,255,255,.9); color: #12151a; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.news-card.featured { grid-column: span 2; grid-row: span 2; }
.news-card.featured .news-image { min-height: 330px; }
.news-card.featured h2 { font-size: 26px; }

.page-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding-block: 72px 36px; }
.page-hero h1 { margin: 7px 0 10px; font-size: clamp(38px, 6vw, 68px); line-height: 1; letter-spacing: -.065em; }
.page-hero p, .page-title p, .admin-heading p { max-width: 640px; margin: 0; color: var(--muted); }
.live-badge, .status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 30px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.live-badge i, .status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 14%, transparent); }
.category-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 24px; scrollbar-width: none; }
.category-tabs a { padding: 8px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.category-tabs a.active, .category-tabs a:hover { border-color: var(--accent); background: var(--accent); color: white; }
.news-page .news-grid { padding-bottom: 35px; }

.search-top { padding-block: 34px 22px; }
.search-top .search-box { width: 780px; max-width: 100%; }
.search-meta { margin: 11px 0 0 15px; color: var(--muted); font-size: 12px; }
.results-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(260px, 1fr); gap: 42px; padding-bottom: 70px; }
.result-list { display: grid; gap: 12px; }
.search-result { padding: 20px 22px; border: 1px solid transparent; border-radius: 18px; background: transparent; }
.search-result:hover { border-color: var(--line); background: var(--surface); box-shadow: var(--soft-shadow); }
.result-source { display: flex; align-items: center; gap: 9px; }
.favicon-placeholder { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--accent); font-size: 12px; font-weight: 800; }
.result-source div { display: grid; min-width: 0; }
.result-source small { color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-source span:last-child { color: var(--muted); font-size: 10px; }
.search-result h2 { margin: 10px 0 5px; color: var(--blue); font-size: 21px; line-height: 1.25; letter-spacing: -.025em; }
.search-result h2 a:hover { text-decoration: underline; }
.search-result p { margin: 0; color: var(--muted); font-size: 14px; }
.quick-answer { display: flex; align-items: center; justify-content: space-between; min-height: 150px; margin: 0 0 20px; padding: 24px 28px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 24px; background: linear-gradient(135deg, var(--surface), var(--accent-soft)); box-shadow: var(--soft-shadow); }
.quick-answer strong { display: block; margin: 5px 0 0; font-size: clamp(35px, 7vw, 54px); line-height: 1; letter-spacing: -.06em; }
.quick-answer p { margin: 9px 0 0; color: var(--muted); }
.answer-spark { color: var(--accent); font-size: 56px; opacity: .45; }
.results-sidebar { display: grid; align-content: start; gap: 15px; padding-top: 4px; }
.side-card { padding: 19px; }
.side-news { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.side-news:last-child { border: 0; }
.side-news small { color: var(--accent); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.side-news strong { font-size: 13px; line-height: 1.4; }
.search-help > span { font-size: 11px; color: var(--accent); font-weight: 800; text-transform: uppercase; }
.search-help p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 10px; }
.pagination a, .pagination span { padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); font-size: 12px; font-weight: 700; }
.pagination span { color: var(--muted); }
.empty-state { display: grid; min-height: 330px; place-items: center; align-content: center; padding: 40px; text-align: center; }
.empty-state > span { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 18px; background: var(--accent-soft); color: var(--accent); font-size: 30px; }
.empty-state h1, .empty-state h2 { margin: 15px 0 5px; }
.empty-state p { max-width: 480px; margin: 0; color: var(--muted); }
.empty-state.small { min-height: 150px; }

.auth-page .site-header, .auth-page .site-footer { display: none; }
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-copy { position: relative; display: grid; align-content: center; overflow: hidden; padding: 10vw; background: #171b24; color: white; }
.auth-copy::before { position: absolute; width: 500px; height: 500px; right: -250px; top: -190px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; content: ""; }
.auth-copy h1 { margin: 8px 0 18px; font-size: clamp(42px, 7vw, 74px); line-height: .95; letter-spacing: -.07em; }
.auth-copy p { max-width: 490px; color: #aeb5c1; font-size: 17px; }
.auth-art { position: absolute; right: 8%; bottom: 7%; display: grid; width: 120px; height: 120px; place-items: center; border-radius: 40px 40px 40px 10px; background: var(--accent); color: white; font-size: 62px; font-weight: 800; transform: rotate(-7deg); box-shadow: 0 28px 90px rgba(255,107,44,.25); }
.auth-card { width: min(540px, 100%); margin: auto; padding: 50px 64px; }
.auth-logo { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 42px; font-size: 18px; font-weight: 800; }
.auth-card h2 { margin: 0; font-size: 34px; letter-spacing: -.05em; }
.auth-card > p { margin: 4px 0 25px; color: var(--muted); }
.auth-alt { text-align: center; font-size: 13px; }
.auth-alt a { color: var(--accent); font-weight: 800; }

.stack-form, .panel-form { display: grid; gap: 16px; }
fieldset { display: grid; gap: 13px; margin: 0; padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--line); }
fieldset legend { margin-bottom: 12px; font-weight: 800; }
label { display: grid; gap: 6px; color: var(--text); font-size: 12px; font-weight: 800; }
label small { color: var(--muted); font-weight: 500; }
input, textarea, select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: var(--surface); color: var(--text); transition: border .2s, box-shadow .2s; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: auto; padding: 0; accent-color: var(--accent); }
input[type="color"] { padding: 5px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.form-row.three { grid-template-columns: 1fr .6fr 1.2fr; }
.check-line { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.alert, .toast { padding: 12px 14px; border-radius: 11px; font-size: 13px; }
.alert.error, .toast.error { border: 1px solid color-mix(in srgb, var(--red) 35%, var(--line)); background: color-mix(in srgb, var(--red) 9%, var(--surface)); color: var(--red); }
.alert.success, .toast.success { border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line)); background: color-mix(in srgb, var(--green) 9%, var(--surface)); color: var(--green); }
.toast { position: fixed; z-index: 100; top: 82px; left: 50%; min-width: min(460px, calc(100% - 30px)); box-shadow: var(--shadow); text-align: center; transform: translateX(-50%); animation: toast-in .35s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } }

.captcha { display: grid; padding: 8px 10px 6px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.captcha-check { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 3px; border: 0; background: transparent; color: var(--text); text-align: left; }
.captcha-box { position: relative; display: grid; width: 26px; height: 26px; place-items: center; margin-right: 11px; border: 2px solid #98a0ae; border-radius: 7px; background: var(--surface); }
.captcha-logo { display: grid; width: 30px; height: 30px; place-items: center; margin-left: auto; border-radius: 10px 10px 10px 3px; background: var(--accent); color: white; }
.captcha small { padding-left: 40px; color: var(--muted); font-size: 9px; font-weight: 500; }
.captcha small a { text-decoration: underline; }
.captcha.loading .captcha-box::after { width: 14px; height: 14px; border: 2px solid var(--accent); border-top-color: transparent; border-radius: 50%; content: ""; animation: spin .6s linear infinite; }
.captcha.success { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.captcha.success .captcha-box { border-color: var(--green); background: var(--green); }
.captcha.success .captcha-box::after { width: 12px; height: 6px; border-bottom: 2px solid white; border-left: 2px solid white; content: ""; transform: rotate(-45deg) translateY(-1px); }
.captcha.failed { border-color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }

.article-page { max-width: 980px; padding-block: 70px; }
.article-page header { max-width: 850px; margin: 0 auto 34px; }
.category-link { color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.article-page h1 { margin: 12px 0 20px; font-size: clamp(34px, 6vw, 62px); line-height: 1.08; letter-spacing: -.055em; }
.article-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 12px; }
.article-image { width: 100%; max-height: 560px; object-fit: cover; border-radius: 28px; }
.article-body { max-width: 780px; margin: 36px auto; }
.article-body > p { font-size: 19px; line-height: 1.8; }
.source-notice { display: flex; align-items: center; gap: 15px; margin-top: 36px; padding: 19px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.source-notice > span { color: var(--accent); font-size: 30px; }
.source-notice div { flex: 1; }
.source-notice p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.related-news { max-width: 780px; margin: 50px auto; }
.related-news h2 { font-size: 25px; }
.related-news a { display: flex; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.related-news small { color: var(--muted); white-space: nowrap; }

.profile-page { padding-block: 36px 80px; }
.profile-cover { min-height: 240px; border-radius: 28px; background: linear-gradient(125deg, #182133, #2d374d 55%, color-mix(in srgb, var(--accent) 70%, #253149)); background-position: center; background-size: cover; }
.profile-head { display: flex; align-items: flex-end; gap: 20px; padding: 0 28px; transform: translateY(-34px); }
.profile-avatar { display: grid; flex: 0 0 120px; height: 120px; place-items: center; overflow: hidden; border: 5px solid var(--bg); border-radius: 35px; background: var(--accent); color: white; font-size: 47px; font-weight: 800; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head > div:nth-child(2) { flex: 1; padding-bottom: 5px; }
.profile-head h1 { margin: 3px 0; font-size: 34px; line-height: 1.1; letter-spacing: -.05em; }
.profile-head p { margin: 0; color: var(--muted); }
.profile-actions { display: flex; gap: 8px; padding-bottom: 10px; }
.profile-layout { display: grid; grid-template-columns: 320px 1fr; gap: 28px; }
.profile-layout aside { display: grid; align-content: start; gap: 14px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.profile-stats span { display: grid; text-align: center; }
.profile-stats strong { font-size: 23px; }
.profile-stats small { color: var(--muted); font-size: 10px; }
.side-card .profile-stats { grid-template-columns: repeat(2, 1fr); margin-bottom: 20px; }
.side-card h3 { margin-top: 0; }
.side-card > p { color: var(--muted); font-size: 13px; }
.profile-detail { display: block; padding: 6px 0; color: var(--muted); font-size: 12px; }
.history-list { display: grid; gap: 7px; }
.history-list a { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.history-list a > span { display: grid; height: 32px; place-items: center; border-radius: 9px; background: var(--surface-2); }
.history-list small { color: var(--muted); }
.public-profile-grid { display: grid; grid-template-columns: 1fr 330px; gap: 50px; max-width: 960px; margin: 15px auto; }
.big-bio { font-size: 21px; line-height: 1.75; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-list span { padding: 6px 10px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }

.settings-page { padding-block: 60px 90px; }
.settings-layout, .admin-settings-layout { display: grid; grid-template-columns: 210px minmax(0, 760px); gap: 34px; align-items: start; }
.settings-nav { position: sticky; top: 92px; display: grid; gap: 3px; }
.settings-nav a { padding: 9px 11px; border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.settings-nav a:hover { background: var(--surface-2); color: var(--text); }
.panel-form .settings-card, .admin-settings-form .settings-card, .theme-settings { display: grid; gap: 15px; margin-bottom: 18px; padding: 24px; }
.settings-card h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.settings-card > p { margin: -10px 0 5px; color: var(--muted); font-size: 12px; }
.toggle-line { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.toggle-line:last-child { border: 0; }
.toggle-line span { display: grid; }
.toggle-line input { position: relative; width: 43px; height: 24px; appearance: none; border: 0; border-radius: 20px; background: var(--line); box-shadow: none; transition: .2s; }
.toggle-line input::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.18); content: ""; transition: .2s; }
.toggle-line input:checked { background: var(--accent); }
.toggle-line input:checked::after { transform: translateX(19px); }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-option { cursor: pointer; }
.theme-option input { position: absolute; opacity: 0; }
.theme-preview { display: grid; grid-template-columns: 25% 1fr; grid-template-rows: 12px 1fr; height: 95px; padding: 9px; border: 2px solid var(--line); border-radius: 13px; background: #f4f5f7; }
.theme-preview.dark { background: #181b21; }
.theme-preview.system { background: linear-gradient(90deg, #f4f5f7 50%, #181b21 50%); }
.theme-preview i { grid-column: 1 / 3; margin-bottom: 4px; border-radius: 4px; background: var(--accent); }
.theme-preview b { margin-right: 5px; border-radius: 4px; background: #cfd4dc; }
.theme-preview em { border-radius: 4px; background: #fff; }
.theme-option input:checked + .theme-preview { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-option > strong { display: block; margin-top: 6px; text-align: center; font-size: 11px; }

.site-footer { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 28px max(28px, calc((100% - 1180px) / 2)); border-top: 1px solid var(--line); background: var(--surface); }
.site-footer > div { display: grid; }
.site-footer span, .site-footer small { color: var(--muted); font-size: 11px; }
.site-footer nav { display: flex; gap: 18px; font-size: 12px; font-weight: 700; }
.site-footer > small { grid-column: 1 / 3; }

.install-body { display: grid; min-height: 100vh; place-items: center; padding: 40px 20px; background: radial-gradient(circle at top left, var(--accent-soft), var(--bg) 35%); }
.install-shell { width: min(1100px, 100%); }
.install-card { overflow: hidden; border: 1px solid var(--line); border-radius: 30px; background: var(--surface); box-shadow: var(--shadow); }
.install-brand { display: flex; align-items: center; gap: 11px; padding: 22px 28px; border-bottom: 1px solid var(--line); }
.install-brand div { display: grid; }
.install-brand small { color: var(--muted); }
.install-grid { display: grid; grid-template-columns: .8fr 1.2fr; }
.install-grid > aside { padding: 48px; background: #171b24; color: white; }
.install-grid > aside h1 { margin: 8px 0 15px; font-size: 42px; line-height: 1; letter-spacing: -.055em; }
.install-grid > aside p { color: #aeb5c1; }
.install-grid > div { padding: 40px; }
.requirements { display: grid; gap: 10px; margin-top: 35px; }
.requirement { display: flex; align-items: center; gap: 10px; }
.requirement > span { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 9px; background: rgba(255,255,255,.1); }
.requirement.ok > span { color: #66e0a4; }
.requirement.bad > span { color: #ff8690; }
.requirement div { display: grid; font-size: 12px; font-weight: 700; }
.requirement small { color: #8d95a3; font-weight: 500; }

.admin-body { min-height: 100vh; }
.admin-sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; display: flex; width: 245px; flex-direction: column; padding: 22px 16px; background: #171a20; color: #f3f4f7; }
.admin-brand { padding: 0 8px 25px; }
.admin-brand em { margin-left: auto; color: #747d8c; font-size: 8px; font-style: normal; letter-spacing: .14em; }
.admin-sidebar nav { display: grid; gap: 4px; }
.admin-sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 11px; color: #aeb5c1; font-size: 13px; font-weight: 700; }
.admin-sidebar nav a:hover { background: #242832; color: white; }
.back-to-site { margin-top: auto; padding: 10px 12px; color: #aeb5c1; font-size: 12px; }
.admin-workspace { min-height: 100vh; margin-left: 245px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 10px 32px; border-bottom: 1px solid var(--line); background: var(--surface); }
.admin-topbar > div { display: grid; }
.admin-topbar strong { font-size: 14px; }
.admin-topbar > a { color: var(--muted); font-size: 12px; font-weight: 700; }
.admin-main { max-width: 1320px; padding: 38px 40px 80px; }
.admin-heading { align-items: center; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-grid article { display: grid; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--soft-shadow); }
.stat-grid article > span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.stat-grid article > strong { margin: 9px 0 1px; font-size: 32px; letter-spacing: -.05em; }
.stat-grid article > small { color: var(--muted); font-size: 10px; }
.admin-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.admin-card { padding: 22px; }
.admin-card h2 { margin-top: 0; font-size: 20px; }
.data-list > div { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.data-list > div:last-child { border: 0; }
.data-list span, .data-list small { color: var(--muted); }
.queue-summary { display: grid; gap: 7px; }
.queue-summary > span { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; padding: 7px 0; }
.queue-summary b { font-size: 12px; text-transform: capitalize; }
.queue-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.queue-dot.pending { background: #e8a020; }.queue-dot.done { background: var(--green); }.queue-dot.failed { background: var(--red); }.queue-dot.processing { background: var(--blue); }
.quick-admin-actions { display: grid; gap: 6px; margin-top: 20px; }
.quick-admin-actions a { padding: 9px 11px; border-radius: 10px; background: var(--surface-2); font-size: 12px; font-weight: 700; }
.admin-settings-layout { grid-template-columns: 190px minmax(0, 800px); }
.sticky-actions { position: sticky; z-index: 5; bottom: 14px; display: flex; align-items: center; gap: 14px; padding: 11px; border: 1px solid var(--line); border-radius: 15px; background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.sticky-actions span { color: var(--muted); font-size: 11px; }
.table-card { overflow: hidden; padding: 0; }
.table-card > .card-label { padding: 20px 22px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
td a, td > strong { display: grid; }
td small { display: block; color: var(--muted); }
.inline-form { display: flex; gap: 5px; }
.inline-form select { min-height: 34px; padding: 5px 7px; }
.inline-form button, .icon-button { border: 0; border-radius: 8px; background: var(--surface-2); color: var(--text); }
.status-chip { display: inline-block; padding: 3px 7px; border-radius: 20px; background: var(--surface-2); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.status-chip.active, .status-chip.done { background: color-mix(in srgb, var(--green) 12%, var(--surface)); color: var(--green); }
.status-chip.failed, .status-chip.blocked { background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); }
.status-chip.pending, .status-chip.processing { background: color-mix(in srgb, #e8a020 14%, var(--surface)); color: #b47806; }
.feed-list { display: grid; }
.feed-list > div { display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.feed-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 800; }
.feed-list > div > div { display: grid; }
.feed-list a, .feed-list small { color: var(--muted); font-size: 10px; }
.feed-list em { color: var(--red); font-size: 10px; font-style: normal; }
.icon-button { width: 30px; height: 30px; }
.icon-button.danger { color: var(--red); }
.crawl-add { margin-bottom: 18px; }
.crawl-add form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; }
.crawl-add p { margin-bottom: 0; color: var(--muted); font-size: 11px; }
.crawler-grid { grid-template-columns: 1.4fr .6fr; }
.document-list { display: grid; }
.document-list a { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.document-list a > span { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--accent); font-size: 11px; font-weight: 800; }
.document-list a > div { display: grid; min-width: 0; }
.document-list strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.document-list small { color: var(--muted); font-size: 9px; }

.error-page { display: grid; min-height: 100vh; place-items: center; align-content: center; padding: 30px; text-align: center; }
.error-page > strong { margin-top: 18px; color: var(--accent); font-size: 80px; line-height: 1; letter-spacing: -.08em; }
.error-page h1 { margin: 8px 0; }
.error-page p { margin: 0 0 22px; color: var(--muted); }

@media (max-width: 1020px) {
    .header-widgets { display: none; }
    .dashboard-strip { grid-template-columns: repeat(2, 1fr); }
    .trends-card { grid-column: span 2; }
    .results-layout { grid-template-columns: 1fr 280px; gap: 24px; }
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .news-grid.compact-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .content-width { width: min(100% - 24px, 1180px); }
    .site-header { gap: 10px; min-height: 60px; padding: 9px 12px; }
    .header-brand strong, .main-nav, .theme-switcher, .mini-profile summary > span { display: none; }
    .hero { min-height: 450px; padding: 60px 12px 100px; }
    .hero-logo > span { width: 62px; height: 62px; border-radius: 20px 20px 20px 7px; font-size: 35px; }
    .hero-logo strong { font-size: 40px; }
    .search-box button { padding: 0 16px; }
    .search-box input { font-size: 15px; }
    .quick-links > span { width: 100%; }
    .dashboard-strip { grid-template-columns: 1fr; }
    .trends-card { grid-column: auto; }
    .news-grid, .news-grid.compact-grid { grid-template-columns: 1fr; }
    .news-card.featured { grid-column: auto; grid-row: auto; }
    .news-card.featured .news-image { min-height: 210px; }
    .page-hero { align-items: flex-start; flex-direction: column; padding-block: 48px 25px; }
    .results-layout { grid-template-columns: 1fr; }
    .results-sidebar { order: -1; }
    .results-sidebar:empty { display: none; }
    .source-notice { align-items: flex-start; flex-wrap: wrap; }
    .article-page { padding-block: 45px; }
    .profile-cover { min-height: 160px; border-radius: 20px; }
    .profile-head { align-items: center; flex-wrap: wrap; padding: 0 12px; }
    .profile-avatar { flex-basis: 90px; height: 90px; border-radius: 27px; }
    .profile-actions { width: 100%; }
    .profile-layout, .public-profile-grid, .settings-layout, .admin-settings-layout { grid-template-columns: 1fr; }
    .settings-nav { position: static; display: flex; overflow-x: auto; }
    .form-row, .form-row.three { grid-template-columns: 1fr; }
    .theme-options { grid-template-columns: 1fr 1fr 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-copy { min-height: 270px; padding: 50px 28px; }
    .auth-copy h1 { font-size: 42px; }
    .auth-copy p { font-size: 14px; }
    .auth-art { width: 70px; height: 70px; border-radius: 23px 23px 23px 7px; font-size: 35px; }
    .auth-card { padding: 38px 22px 60px; }
    .install-grid { grid-template-columns: 1fr; }
    .install-grid > aside, .install-grid > div { padding: 28px; }
    .site-footer { grid-template-columns: 1fr; padding: 25px 16px; }
    .site-footer > small { grid-column: auto; }
    .admin-sidebar { position: sticky; top: 0; width: 100%; height: 61px; flex-direction: row; align-items: center; padding: 8px 12px; overflow-x: auto; }
    .admin-brand { padding: 0 8px 0 0; }
    .admin-brand em, .admin-sidebar nav a span, .back-to-site { display: none; }
    .admin-sidebar nav { display: flex; }
    .admin-sidebar nav a { padding: 9px 12px; font-size: 18px; }
    .admin-workspace { margin-left: 0; }
    .admin-topbar { padding: 9px 15px; }
    .admin-main { padding: 28px 13px 70px; }
    .admin-heading { align-items: flex-start; flex-direction: column; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .data-list > div { grid-template-columns: 1fr; gap: 2px; }
    .crawl-add form { grid-template-columns: 1fr; }
}

@media (max-width: 450px) {
    .dashboard-strip { width: calc(100% - 16px); }
    .info-card { padding: 18px; }
    .hero-logo small { display: none; }
    .quick-answer { padding: 20px; }
    .answer-spark { display: none; }
    .profile-head > div:nth-child(2) { min-width: 180px; }
    .profile-actions .button { flex: 1; padding-inline: 9px; }
    .profile-stats { grid-template-columns: repeat(3, 1fr); }
    .theme-options { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr; }
}

