:root {
    color-scheme: dark;
    --bg: #090b10;
    --surface: #11141c;
    --surface-2: #171b25;
    --surface-3: #202633;
    --border: #29303d;
    --text: #f4f6fb;
    --muted: #98a2b3;
    --accent: #7c3aed;
    --accent-2: #a78bfa;
    --success: #22c55e;
    --warning: #f59e0b;
    --shadow: 0 22px 65px rgb(0 0 0 / 28%);
    --radius: 18px;
    --shell: 1220px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 88% -5%, rgb(124 58 237 / 19%), transparent 30rem),
        radial-gradient(circle at 5% 30%, rgb(79 70 229 / 8%), transparent 25rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
::selection { background: rgb(124 58 237 / 42%); }
[hidden] { display: none !important; }
.shell { width: min(calc(100% - 36px), var(--shell)); margin-inline: auto; }

.topbar {
    position: sticky; top: 0; z-index: 50;
    border-bottom: 1px solid rgb(41 48 61 / 75%);
    background: rgb(9 11 16 / 82%);
    backdrop-filter: blur(18px);
}
.topbar__inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(145deg, var(--accent), #4f46e5); box-shadow: 0 8px 25px rgb(124 58 237 / 30%);
    font-weight: 900; letter-spacing: -.05em;
}
.brand__copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand__copy strong { font-size: 14px; letter-spacing: .18em; }
.brand__copy small { margin-top: 5px; color: var(--muted); font-size: 10px; letter-spacing: .25em; }
.topbar__status { display: inline-flex; align-items: center; gap: 8px; color: #cbd5e1; font-size: 13px; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--warning); box-shadow: 0 0 0 5px rgb(245 158 11 / 12%); }

.hero { padding: 84px 0 58px; border-bottom: 1px solid rgb(41 48 61 / 55%); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); gap: 72px; align-items: center; }
.eyebrow { color: var(--accent-2); font-size: 11px; font-weight: 900; letter-spacing: .23em; }
.hero h1 { margin: 17px 0 20px; font-size: clamp(46px, 7vw, 82px); line-height: .98; letter-spacing: -.058em; }
.hero h1 span { color: var(--accent-2); }
.hero__lead { max-width: 690px; margin: 0; color: #adb6c7; font-size: clamp(17px, 2vw, 20px); line-height: 1.7; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { border: 1px solid transparent; border-radius: 12px; padding: 12px 17px; color: var(--text); cursor: pointer; font-weight: 800; transition: .18s ease; }
.button--primary { background: var(--accent); box-shadow: 0 12px 28px rgb(124 58 237 / 24%); }
.button--primary:hover { transform: translateY(-1px); background: #8b5cf6; }
.button--ghost { border-color: var(--border); background: var(--surface); }
.button--ghost:hover { border-color: #4b5563; background: var(--surface-2); }

.hero-card { padding: 22px; border: 1px solid var(--border); border-radius: 22px; background: linear-gradient(155deg, rgb(23 27 37 / 94%), rgb(14 17 24 / 94%)); box-shadow: var(--shadow); }
.hero-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.pill { padding: 6px 9px; border: 1px solid rgb(167 139 250 / 28%); border-radius: 999px; background: rgb(124 58 237 / 12%); color: #c4b5fd; letter-spacing: .04em; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin: 20px 0; border: 1px solid var(--border); border-radius: 14px; background: var(--border); }
.metric { min-width: 0; padding: 18px 12px; background: var(--surface); text-align: center; }
.metric strong { display: block; overflow: hidden; color: white; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.metric span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.status-box { display: flex; gap: 12px; padding: 14px; border: 1px solid rgb(245 158 11 / 22%); border-radius: 14px; background: rgb(245 158 11 / 7%); }
.status-box__icon { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgb(245 158 11 / 17%); color: #fbbf24; font-weight: 900; }
.status-box strong { font-size: 13px; }
.status-box p { margin: 5px 0 0; color: #aeb7c6; font-size: 12px; line-height: 1.55; }

.content { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 42px; padding-top: 50px; padding-bottom: 88px; }
.sidebar__sticky { position: sticky; top: 98px; }
.search { position: relative; display: flex; align-items: center; }
.search__icon { position: absolute; left: 13px; color: #737f91; font-size: 22px; pointer-events: none; }
.search input { width: 100%; height: 46px; padding: 0 58px 0 40px; border: 1px solid var(--border); border-radius: 12px; outline: 0; background: #0f1219; color: white; }
.search input::placeholder { color: #697386; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(124 58 237 / 13%); }
kbd { position: absolute; right: 9px; padding: 3px 6px; border: 1px solid #333b49; border-bottom-width: 2px; border-radius: 6px; background: #171b23; color: #7f8999; font-size: 9px; }
.section-nav { margin-top: 28px; }
.section-nav__title { margin: 0 0 10px 12px; color: #616c7d; font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.section-nav a { display: flex; align-items: center; gap: 11px; margin: 4px 0; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; color: #929cad; font-size: 13px; font-weight: 700; transition: .16s ease; }
.section-nav a span { width: 24px; color: #657084; font-variant-numeric: tabular-nums; }
.section-nav a:hover { background: #12161e; color: white; }
.section-nav a.is-active { border-color: rgb(124 58 237 / 22%); background: rgb(124 58 237 / 10%); color: #ddd6fe; }
.section-nav a.is-active span { color: #a78bfa; }

.content-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.content-head h2 { margin: 8px 0 0; font-size: clamp(27px, 4vw, 38px); letter-spacing: -.035em; }
.result-count { flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; color: #929cac; font-size: 11px; font-weight: 800; }
.notice { display: flex; gap: 10px; margin-bottom: 34px; padding: 14px 16px; border: 1px solid rgb(124 58 237 / 22%); border-radius: 12px; background: rgb(124 58 237 / 8%); font-size: 13px; line-height: 1.5; }
.notice strong { color: #c4b5fd; white-space: nowrap; }
.notice span { color: #9ca6b7; }
.no-results { padding: 36px; border: 1px dashed #343b49; border-radius: 16px; background: rgb(17 20 28 / 55%); text-align: center; }
.no-results strong { display: block; margin-bottom: 6px; }
.no-results span { color: var(--muted); font-size: 13px; }

.rule-section { scroll-margin-top: 100px; margin-bottom: 46px; }
.rule-section__header { display: flex; gap: 14px; margin-bottom: 14px; }
.section-index { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border: 1px solid rgb(124 58 237 / 26%); border-radius: 10px; background: rgb(124 58 237 / 10%); color: #b9a4fb; font-size: 11px; font-weight: 900; }
.rule-section__header h3 { margin: 0; font-size: 20px; }
.rule-section__header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.rule-list { display: grid; gap: 10px; }
.rule-card { display: grid; grid-template-columns: 82px minmax(0, 1fr) 28px; gap: 18px; align-items: start; padding: 18px 18px 18px 16px; border: 1px solid var(--border); border-radius: 14px; background: rgb(17 20 28 / 82%); transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.rule-card:hover { transform: translateY(-1px); border-color: #3e4757; background: #141822; }
.rule-card__code { padding-top: 2px; color: #a78bfa; font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rule-card__body h4 { margin: 0 0 7px; font-size: 14px; }
.rule-card__body p { margin: 0; color: #9da7b8; font-size: 13px; line-height: 1.6; }
.anchor-link { opacity: .35; text-align: center; color: #9ca3af; font-weight: 900; transition: .16s ease; }
.rule-card:hover .anchor-link { opacity: 1; color: #a78bfa; }

.footer { border-top: 1px solid rgb(41 48 61 / 55%); background: rgb(7 9 13 / 55%); }
.footer__inner { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer__inner div { display: flex; align-items: baseline; gap: 10px; }
.footer strong { font-size: 12px; letter-spacing: .16em; }
.footer span, .footer p { color: #747f90; font-size: 11px; }
.footer p { margin: 0; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 90; transform: translateY(18px); opacity: 0; pointer-events: none; padding: 11px 14px; border: 1px solid #3b4453; border-radius: 10px; background: #171b24; box-shadow: var(--shadow); color: white; font-size: 12px; font-weight: 800; transition: .2s ease; }
.toast.is-visible { transform: translateY(0); opacity: 1; }

@media (max-width: 900px) {
    .hero { padding-top: 58px; }
    .hero__grid { grid-template-columns: 1fr; gap: 34px; }
    .content { grid-template-columns: 1fr; }
    .sidebar { border-bottom: 1px solid var(--border); padding-bottom: 18px; }
    .sidebar__sticky { position: static; }
    .section-nav { display: flex; gap: 7px; overflow-x: auto; margin-top: 14px; padding-bottom: 2px; scrollbar-width: thin; }
    .section-nav__title { display: none; }
    .section-nav a { flex: 0 0 auto; margin: 0; white-space: nowrap; }
}

@media (max-width: 620px) {
    .shell { width: min(calc(100% - 24px), var(--shell)); }
    .topbar__inner { min-height: 64px; }
    .brand__copy strong { font-size: 12px; }
    .topbar__status { font-size: 11px; }
    .hero { padding: 44px 0 38px; }
    .hero h1 { font-size: 46px; }
    .metric-grid { grid-template-columns: 1fr; }
    .content { gap: 26px; padding-top: 30px; }
    .content-head { align-items: start; flex-direction: column; }
    .notice { flex-direction: column; gap: 3px; }
    .rule-card { grid-template-columns: 1fr 25px; gap: 9px 12px; }
    .rule-card__code { grid-column: 1 / -1; }
    .anchor-link { grid-column: 2; grid-row: 2; }
    .footer__inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 24px 0; }
}
