:root {
    color-scheme: light;
    --ink: #151a30;
    --muted: #58637a;
    --line: #e0e5ef;
    --paper: #fff;
    --canvas: #f4f6fb;
    --accent: #5145d9;
    --accent-dark: #3e33bb;
    --nav: #14192d;
    --soft: #eeecff;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); line-height: 1.5; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #8275ff; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 3.2vw, 2.75rem); letter-spacing: -.06em; line-height: 1.12; margin-bottom: .6rem; }
h2 { font-size: 1.12rem; letter-spacing: -.025em; line-height: 1.3; margin-bottom: .35rem; }
h3 { font-size: 1rem; margin-bottom: .2rem; }
small { font-size: .82rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.inline { display: inline-flex; }
.skip { position: fixed; top: .5rem; left: .5rem; z-index: 9; padding: .5rem 1rem; background: #fff; transform: translateY(-150%); }
.skip:focus { transform: none; }

.workspace { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.55rem 1rem 1.2rem; color: #bcc4dd; background: var(--nav); }
.brand { display: flex; align-items: center; gap: .68rem; color: inherit; text-decoration: none; font-size: 1.13rem; letter-spacing: -.045em; white-space: nowrap; }
.sidebar .brand { color: #f7f8ff; padding: .15rem .5rem 1.8rem; }
.brand-icon { display: grid; place-items: center; position: relative; flex: none; width: 2.3rem; height: 2.3rem; border-radius: .72rem; background: #685bf2; box-shadow: 0 5px 15px #4537c13d; }
.brand-icon::before { content: ""; width: 1.12rem; height: 1.12rem; border: 1px solid #cfcaff; border-radius: 50%; box-shadow: inset 0 0 0 3px #685bf2, inset 0 0 0 4px #cfcaff; }
.brand-icon::after { content: ""; position: absolute; width: .65rem; height: 1px; transform: rotate(-45deg) translateX(.15rem); background: #fff; }
.sidebar nav { display: grid; gap: .3rem; }
.nav-link { display: flex; gap: .78rem; align-items: center; text-decoration: none; font-size: .92rem; font-weight: 550; border-radius: .6rem; min-height: 2.75rem; padding: .62rem .7rem; }
.nav-link:hover, .nav-link.selected { background: #29294e; color: #fff; }
.nav-link.selected { box-shadow: inset 3px 0 #958bff; }
.nav-count { margin-left: auto; padding: .05rem .38rem; border-radius: 1rem; background: #49417b; color: #fff; font-size: .76rem; }
.sidebar-bottom { margin-top: auto; padding: .95rem .45rem 0; border-top: 1px solid #353951; }
.profile { display: flex; align-items: center; min-width: 0; gap: .65rem; margin-bottom: .5rem; }
.profile > div { min-width: 0; }
.profile strong, .profile small { display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.profile strong { color: #f4f5ff; font-size: .88rem; }
.avatar { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: #e0dbff; background: #383264; font-size: .88rem; font-weight: 700; }
.sign-out { padding: .36rem .1rem; color: #e0e4f4; background: transparent; border: 0; font-size: .9rem; }
.sign-out:hover { text-decoration: underline; }
.workspace-body { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 4.15rem; padding: .65rem clamp(1.2rem, 3vw, 3rem); border-bottom: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: .88rem; }
.top-label { display: flex; align-items: center; gap: .7rem; color: var(--ink); font-weight: 650; }
.top-label .icon, .top-date span { color: var(--accent); }
.content { width: min(100%, 93rem); margin: 0 auto; padding: 2.1rem clamp(1.2rem, 3vw, 3rem) 1.2rem; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.2rem; margin-bottom: 1.45rem; }
.page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); }
.eyebrow { margin-bottom: .42rem; font-size: .82rem; font-weight: 750; color: var(--accent-dark); letter-spacing: .105em; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .52rem; min-height: 2.65rem; padding: .58rem .95rem; border: 1px solid transparent; border-radius: .55rem; text-decoration: none; text-align: center; white-space: nowrap; font-size: .91rem; font-weight: 650; }
.button:disabled { opacity: .65; cursor: wait; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-dark); }
.secondary { background: #fff; color: var(--ink); border-color: #d8deeb; }
.secondary:hover { border-color: #a9a6d0; background: #faf9ff; }
.text-link { color: var(--accent-dark); font-size: .9rem; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.notice { padding: .75rem 1rem; border-radius: .65rem; margin-bottom: 1.2rem; }
.notice.success { background: #e4f6ee; color: #155a40; }
.notice.error { background: #ffe9ec; color: #892634; }

.hero { position: relative; isolation: isolate; min-height: 15.5rem; display: flex; align-items: center; overflow: hidden; padding: 1.55rem clamp(1.3rem, 3.2vw, 2.65rem); border-radius: .95rem; background: linear-gradient(110deg, #1e2353 0%, #292868 55%, #382d80 100%); color: #fff; }
.hero-content { position: relative; z-index: 1; }
.hero-label { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .65rem; color: #d7d3ff; font-weight: 650; font-size: .86rem; }
.hero h2 { color: #fff; font-size: clamp(1.9rem, 3.5vw, 3.2rem); letter-spacing: -.059em; line-height: 1.02; margin-bottom: .72rem; }
.hero p { max-width: 38rem; color: #ebe8ff; margin-bottom: 1rem; }
.hero .button { color: #28205f; background: #efedff; }
.hero .button:hover { background: #fff; }
.radar-art { position: absolute; right: 3.7%; top: 50%; transform: translateY(-50%); width: clamp(11rem, 26vw, 22rem); aspect-ratio: 1; border-radius: 50%; background: repeating-radial-gradient(circle, #a8a0fa55 0 1px, transparent 1px 12.4%), linear-gradient(90deg, transparent calc(50% - .5px), #a8a0fa42 50%, transparent calc(50% + .5px)), linear-gradient(0deg, transparent calc(50% - .5px), #a8a0fa42 50%, transparent calc(50% + .5px)), conic-gradient(from 0deg, transparent 0 53%, #a38aff86 100%); mask-image: radial-gradient(circle, #000 0 66%, transparent 72%); opacity: .84; }
.radar-art i, .radar-art b, .radar-art em, .radar-art span { position: absolute; display: block; width: .39rem; height: .39rem; border-radius: 50%; background: #d4ccff; box-shadow: 0 0 0 4px #b4aaff37, 0 0 .7rem #d4ccff; }
.radar-art i { top: 49%; left: 49%; }
.radar-art b { top: 28%; left: 43%; }
.radar-art em { top: 43%; left: 73%; }
.radar-art span { top: 68%; left: 32%; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.15rem 0; }
.stat { display: flex; gap: .8rem; align-items: center; min-height: 5.55rem; padding: .85rem 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: .74rem; }
.stat h2 { color: var(--muted); font-size: .89rem; font-weight: 600; letter-spacing: 0; }
.stat strong { font-size: 1.7rem; line-height: 1.05; letter-spacing: -.055em; }
.stat-icon { flex: none; display: inline-grid !important; place-items: center; width: 2.5rem !important; height: 2.5rem !important; color: var(--accent-dark); background: var(--soft); border-radius: .64rem; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(15rem, 1fr); gap: 1rem; align-items: start; }
.panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: .74rem; overflow: hidden; }
.panel-header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; padding: 1.05rem 1.15rem .9rem; }
.panel-header p, .source-line small, .watch-row p, .watch-row small, td small { color: var(--muted); }
.panel-header p { font-size: .9rem; margin: 0; }
.empty { padding: 2rem 1rem 2.4rem; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 2.85rem; height: 2.85rem; margin: 0 auto .62rem; border-radius: 50%; background: var(--soft); color: var(--accent-dark); }
.empty p { max-width: 28rem; color: var(--muted); font-size: .94rem; margin: 0 auto; }
.source-line { display: flex; justify-content: space-between; align-items: center; gap: .35rem; padding: .68rem 0; margin: 0 1.15rem; border-top: 1px solid var(--line); }
.source-line strong, .source-line small { display: block; }
.source-line strong { font-size: .92rem; }
.source-summary > a { display: inline-block; margin: .1rem 1.15rem 1rem; }
.sync-info { margin-top: .2rem; }
.chip { display: inline-block; border-radius: .9rem; padding: .18rem .55rem; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.chip.neutral { color: #494e68; background: #eff1f7; }
.chip.new { color: #3e31a8; background: #eeecff; }
.chip.error { color: #8a2234; background: #fdebf0; }
.footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.3rem; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .93rem; }
th, td { padding: .82rem 1.05rem; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); background: #f8f9fc; font-weight: 650; font-size: .88rem; }
td small { display: block; margin-top: .15rem; }
.row-link { text-decoration: none; font-weight: 700; color: var(--accent-dark); }
.row-link:hover { text-decoration: underline; }
.filters { display: grid; grid-template-columns: minmax(12rem, 2fr) repeat(3, minmax(7rem, 1fr)) auto; align-items: end; gap: .65rem; padding: 1.05rem; }
label { display: block; color: var(--ink); font-size: .92rem; font-weight: 650; }
label small { color: var(--muted); font-weight: 400; }
input:not([type="hidden"]), select { display: block; width: 100%; min-width: 0; min-height: 2.65rem; margin-top: .28rem; padding: .5rem .68rem; border: 1px solid #d8deeb; background: #fff; border-radius: .5rem; color: var(--ink); font-weight: 400; }
select { appearance: none; padding-right: 1.55rem; background: linear-gradient(45deg, transparent 48%, #5c6583 51%) calc(100% - 14px) center / 5px 5px no-repeat, linear-gradient(135deg, #5c6583 48%, transparent 51%) calc(100% - 9px) center / 5px 5px no-repeat, #fff; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .8rem 1rem; border-top: 1px solid var(--line); color: var(--muted); }
.pagination > div { display: flex; gap: .45rem; }
.form-panel, .detail, .source-card { padding: 1.2rem; }
.form-panel { margin-bottom: 1rem; }
.form-grid, .meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .95rem; }
.actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.form-grid .actions { grid-column: 1 / -1; margin-top: .3rem; }
.watch-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .8rem; padding: .95rem 1.15rem; border-top: 1px solid var(--line); }
.watch-row p { margin-bottom: .12rem; font-size: .91rem; }
.watch-row h3 { overflow-wrap: anywhere; }
.watch-row p.watch-error { color: #8a2234; margin-top: .35rem; }
.meta-grid { padding: 1rem 0; border-block: 1px solid var(--line); }
.meta-grid dt { color: var(--muted); font-size: .9rem; }
.meta-grid dd { margin: .14rem 0 0; font-weight: 650; overflow-wrap: anywhere; }
.detail-top { display: flex; flex-wrap: wrap; gap: .5rem; }
.publication-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: .6rem 0 1rem; color: #29334c; }
.sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.source-card h2 { margin-top: .65rem; }
.source-card p, .source-caption { color: var(--muted); }
.source-card .text-link { display: block; margin-top: .75rem; }
.source-caption { margin: 1rem 0 0; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; background: radial-gradient(ellipse at 80% 10%, #e3e0ff, transparent 55%), var(--canvas); }
.login-card { width: min(100%, 28rem); padding: clamp(1.2rem, 5vw, 2.4rem); border: 1px solid var(--line); border-radius: 1.1rem; background: #fff; box-shadow: 0 2rem 5rem #26224c16; }
.login-card .brand { margin-bottom: 1.65rem; }
.login-card h1 { font-size: 2.25rem; }
.login-card p:not(.notice) { color: var(--muted); }
.stack { display: grid; gap: .8rem; }
.stack .button { margin-top: .25rem; }

.icon { position: relative; display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; flex: none; }
.icon::before, .icon::after { content: ""; position: absolute; }
.icon.home::before { width: .69rem; height: .69rem; border: 1.4px solid currentColor; border-radius: .1rem; bottom: 0; }
.icon.home::after { width: .65rem; height: .65rem; border-top: 1.4px solid currentColor; border-left: 1.4px solid currentColor; transform: rotate(45deg); top: .12rem; background: inherit; }
.icon.inbox::before { width: 1rem; height: .73rem; border: 1.5px solid currentColor; border-radius: .17rem; }
.icon.inbox::after { width: .36rem; height: .17rem; margin-top: .07rem; border: 1.4px solid currentColor; border-top: 0; border-radius: 0 0 .14rem .14rem; }
.icon.target::before { width: .94rem; height: .94rem; border: 1.5px solid currentColor; border-radius: 50%; }
.icon.target::after { width: .38rem; height: .38rem; border: 1.4px solid currentColor; border-radius: 50%; }
.icon.clock::before { width: .93rem; height: .93rem; border: 1.5px solid currentColor; border-radius: 50%; }
.icon.clock::after { width: .24rem; height: .32rem; border-left: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor; transform: translate(.1rem, -.09rem); }
.icon.layers::before, .icon.layers::after { width: .67rem; height: .67rem; border: 1.4px solid currentColor; border-radius: .11rem; transform: rotate(45deg) scaleY(.73); }
.icon.layers::after { margin-top: .4rem; border-top: 0; border-left: 0; }
.icon.bell::before { width: .72rem; height: .67rem; margin-top: -.13rem; border: 1.5px solid currentColor; border-radius: .48rem .48rem .12rem .12rem; }
.icon.bell::after { width: .23rem; height: .11rem; margin-top: .8rem; border-radius: 0 0 .15rem .15rem; background: currentColor; }
.icon.refresh::before { width: .85rem; height: .85rem; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.icon.refresh::after { width: .29rem; height: .29rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translate(.37rem, -.17rem) rotate(20deg); }

@media (max-width: 1050px) {
    .overview-grid { grid-template-columns: minmax(0, 1fr); }
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .radar-art { right: -6%; opacity: .48; }
}
@media (max-width: 760px) {
    .workspace { display: block; }
    .sidebar { position: static; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: .75rem 1rem; gap: .55rem; }
    .sidebar .brand { padding: 0; }
    .sidebar nav { display: flex; gap: .2rem; grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; }
    .nav-link { gap: .32rem; padding: .42rem .48rem; min-height: 2.25rem; font-size: .85rem; }
    .nav-link.selected { box-shadow: inset 0 -2px #958bff; }
    .nav-count { margin-left: 0; }
    .sidebar-bottom { margin: 0; padding: 0; border: 0; align-self: center; }
    .sidebar-bottom .profile { display: none; }
    .topbar { min-height: 2.9rem; }
    .content { padding-top: 1.2rem; }
    .stats { gap: .55rem; }
    .stat { padding: .6rem; gap: .4rem; }
    .stat-icon { width: 2rem !important; height: 2rem !important; }
}
@media (max-width: 520px) {
    .page-heading { flex-direction: column; align-items: flex-start; gap: .75rem; }
    .topbar { font-size: .8rem; }
    .hero { min-height: 14rem; }
    .radar-art { right: -30%; opacity: .32; }
    .stats, .sources { grid-template-columns: 1fr; }
    .stat { min-height: 3.7rem; padding-inline: .75rem; }
    .stat > div { display: flex; justify-content: space-between; align-items: center; flex: 1; gap: .35rem; }
    .stat h2 { margin: 0; }
    .watch-row { grid-template-columns: minmax(0, 1fr) auto; }
    .watch-row form { grid-column: 1 / -1; }
    .pagination { align-items: flex-start; flex-direction: column; }
}
