/* Console-specific styles on top of the design system tokens and components.
   Class names mirror the design canvas (tw-*) so the mockup and the product
   read the same. Layout classes replace the canvas's inline styles. */

html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
a { color: var(--indigo-950); }
a:hover { color: var(--indigo-700); }
button { font-family: var(--font-sans); }

@keyframes tw-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes tw-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); } 70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); } }
@keyframes tw-drawer { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tw-new, .tw-live, .tw-drawer { animation: none !important; } }

.tw-row:hover { background: var(--neutral-50); }
.tw-new { animation: tw-in .35s ease; }
.tw-live { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--green-600); animation: tw-pulse 1.6s ease-out infinite; }
.tw-drawer { animation: tw-drawer .2s ease; }
.tw-th { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); background: var(--neutral-50); }
.tw-td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
tr:last-child .tw-td { border-bottom: 0; }
.tw-chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font: 500 13px var(--font-sans); color: var(--text-subtle); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.tw-chip:hover { border-color: var(--border-strong); color: var(--text); }
.tw-chip[aria-pressed="true"] { background: var(--indigo-50); border-color: var(--indigo-200); color: var(--indigo-950); }

/* ---- Login ---- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.login__brand { background: var(--indigo-950); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; isolation: isolate; }
.login__glow { position: absolute; inset: 0; z-index: -1; background: radial-gradient(600px 400px at 90% -10%, rgba(251,110,68,.45), transparent 60%), radial-gradient(500px 400px at 0% 110%, rgba(255,204,239,.35), transparent 55%); }
.login__symbol { width: 28px; height: 42px; color: #fff; }
.login__title { font-family: var(--font-display); font-size: 56px; line-height: 1; letter-spacing: -.03em; margin-bottom: 16px; }
.login__tagline { font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.82); max-width: 380px; }
.login__watermark { position: absolute; right: -60px; bottom: -80px; width: 340px; height: 510px; opacity: .1; color: #fff; }
.login__panel { display: flex; align-items: center; justify-content: center; padding: 48px; background: #fff; }
.login__card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 24px; }
.login__heading { font-size: 24px; font-weight: 600; letter-spacing: -.005em; line-height: 1.25; }
.login__sub { font-size: 14px; color: var(--text-muted); margin-top: 6px; }
.login__note { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.login__google { display: flex; justify-content: center; min-height: 44px; }
@media (max-width: 800px) { .login { grid-template-columns: minmax(0,1fr); } .login__brand { min-height: 240px; padding: 32px 24px; } .login__watermark { display: none; } .login__panel { padding: 32px 16px; } }

/* ---- App shell ---- */
.app { display: grid; grid-template-columns: 232px minmax(0,1fr); min-height: 100vh; }
.app__main { container: tw-main / inline-size; min-width: 0; padding: 28px 32px 48px; }
.sidebar { position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 12px 16px; }
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; text-decoration: none; color: var(--text); }
.sidebar__mark { width: 28px; height: 28px; border-radius: 8px; background: var(--indigo-950); display: inline-flex; align-items: center; justify-content: center; }
.sidebar__mark svg { width: 12px; height: 18px; color: #fff; }
.sidebar__name { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.sidebar__group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 22px; }
.sidebar__group-title { font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; padding: 0 10px; margin-bottom: 6px; }
.sidebar__link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 6px; font-size: 14px; border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; text-decoration: none; color: var(--text-subtle); }
.sidebar__link[aria-disabled="true"] { color: var(--text-muted); cursor: default; }
.sidebar__count { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--red-100); color: var(--red-700); font-weight: 600; }
.sidebar__soon { font-size: 10px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.sidebar__user { margin-top: auto; border-top: 1px solid var(--border); padding: 14px 6px 0 10px; display: flex; align-items: center; gap: 10px; }
.sidebar__avatar { width: 30px; height: 30px; border-radius: 999px; background: var(--pink-200); color: var(--indigo-950); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; }
.sidebar__who { flex: 1; min-width: 0; }
.sidebar__email { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__role { font-size: 11px; color: var(--text-muted); }
@media (max-width: 800px) { .app { grid-template-columns: minmax(0,1fr); } .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); } .app__main { padding: 20px 16px 40px; } }

/* ---- Page furniture ---- */
.page__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.page__title { font-size: 24px; font-weight: 600; letter-spacing: -.005em; line-height: 1.25; }
.page__lead { font-size: 14px; color: var(--text-muted); margin-top: 6px; max-width: 720px; line-height: 1.5; }
.stats { display: flex; gap: 12px; }
.stat { min-width: 96px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; }
.stat__label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stat__value { font-size: 22px; font-weight: 600; line-height: 1.2; margin-top: 2px; }
.empty { padding: 48px 24px; text-align: center; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty__big { font-size: 40px; font-weight: 600; color: var(--neutral-300); line-height: 1; }
.empty__title { font-size: 15px; font-weight: 500; color: var(--text); }

/* ---- Notices (auth failures, errors) ---- */
.notice { max-width: 520px; margin: 15vh auto; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; }
.notice__title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.notice__body { font-size: 14px; color: var(--text-subtle); line-height: 1.5; }
.notice__actions { margin-top: 20px; display: flex; gap: 12px; }
.hidden { display: none !important; }

/* ---- Findings feed ---- */
.feed__title { font-family: var(--font-display); font-size: 36px; line-height: 1; letter-spacing: -.02em; margin: 0; font-weight: 400; }
.feed__live { font-size: 14px; color: var(--text-muted); margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.stat__value--danger { color: var(--red-600); }
.stat__value--muted { color: var(--text-muted); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters__search { position: relative; flex: 1; min-width: 240px; max-width: 380px; }
.filters__search svg { position: absolute; left: 12px; top: 12px; color: var(--text-muted); }
.filters__search .input { padding-left: 36px; width: 100%; }
.filters__sep { width: 1px; height: 24px; background: var(--border); }
.filters__chips { display: flex; gap: 6px; flex-wrap: wrap; }
.feed { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; position: relative; }
.feed__stale { display: none; padding: 8px 18px; font-size: 12px; background: var(--yellow-100); color: var(--yellow-800); border-bottom: 1px solid var(--yellow-200); }
.feed[data-stale="true"] .feed__stale { display: block; }
.feed__row { display: grid; grid-template-columns: 96px 128px minmax(0,1fr) 88px; gap: 16px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); cursor: pointer; text-decoration: none; color: var(--text); }
.feed__row:last-of-type { border-bottom: 0; }
.feed__row--selected { background: var(--indigo-50); }
.feed__row--critical { background: var(--red-50); }
.feed__row--cleared { opacity: .55; }
.feed__row--cleared .feed__summary { text-decoration: line-through; }
.feed__rule { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feed__rule-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed__tier { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.feed__what { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.feed__summary { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed__sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed__ago { text-align: right; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.feed__more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--border); }
.empty__zero { width: 56px; height: 56px; border-radius: 999px; background: var(--pink-200); color: var(--indigo-950); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; }
@container tw-main (max-width: 720px) { .feed__row { grid-template-columns: 96px minmax(0,1fr); } .feed__rule, .feed__ago { display: none; } }

/* ---- Finding drawer ---- */
.drawer__scrim { position: fixed; inset: 0; background: rgba(23,23,23,.18); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 100vw; background: #fff; border-left: 1px solid var(--border); box-shadow: var(--shadow-xl); z-index: 31; display: flex; flex-direction: column; overflow: hidden; }
.drawer__head { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.drawer__badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer__spacer { flex: 1; }
.drawer__title { font-size: 18px; font-weight: 600; line-height: 1.35; text-wrap: pretty; margin: 0; }
.drawer__when { font-size: 12px; color: var(--text-muted); }
.drawer__body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.drawer__label { font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; }
.drawer__note { font-size: 13px; line-height: 1.55; color: var(--text-subtle); text-wrap: pretty; margin: 0; }
.drawer__error { font-size: 12px; color: var(--red-700); }
.drawer__foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; background: var(--neutral-50); }
.drawer__hint { font-size: 11px; color: var(--text-muted); text-align: center; }
.evidence { display: grid; grid-template-columns: 140px minmax(0,1fr); row-gap: 10px; column-gap: 14px; font-size: 13px; margin: 0; }
.evidence dt { color: var(--text-muted); padding-top: 1px; }
.evidence dd { margin: 0; color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
.evidence__code { font-family: var(--font-mono); font-size: 12.5px; padding: 1.5px 6px; border-radius: 4px; background: var(--neutral-100); color: var(--indigo-950); border: 1px solid var(--border); word-break: break-all; }
.reviews { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.review { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 13px; }
.review .badge { align-self: flex-start; }
.review__meta { font-size: 12px; color: var(--text-muted); }
.review__text { line-height: 1.5; }
@media (max-width: 800px) { .drawer { width: 100vw; } }

/* ---- Review form ---- */
.review-form { display: flex; flex-direction: column; gap: 12px; }
.review-form__verdicts { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.review-form__choice { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-subtle); cursor: pointer; }
.review-form__choice input { margin: 0; }
.review-form .textarea { width: 100%; }

/* ---- Detection data ---- */
.data { max-width: 1180px; }
.data__grid { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 20px; align-items: start; }
.data__nav { display: flex; flex-direction: column; gap: 18px; }
.data__group-title { display: flex; align-items: center; gap: 8px; padding: 0 10px; margin-bottom: 6px; font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; }
.data__link { font-family: var(--font-mono); font-size: 13px; }
.data__link-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data__count { font-family: var(--font-sans); font-size: 11px; color: var(--text-muted); }
.data__pane { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.data__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.data__title-wrap { min-width: 0; }
.data__title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.data__name { font-family: var(--font-mono); font-size: 18px; font-weight: 600; }
.data__desc { font-size: 13px; color: var(--text-subtle); margin-top: 4px; text-wrap: pretty; }
.data__used { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.data__form { padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.data__field { flex: 1 1 180px; min-width: 140px; }
.data__field--select, .data__field--asn, .data__field--country { flex: 0 0 140px; }
.data__field--text { flex: 2 1 240px; }
.data__field .input { width: 100%; font-size: 13px; }
.data__optional { font-weight: 400; color: var(--text-muted); font-size: 11px; }
.data__table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.data__scroll { overflow-x: auto; }
.data__table { width: 100%; border-collapse: collapse; }
.data__table .t-mono { font-size: 13px; }
.data__added { font-size: 12px; color: var(--text-subtle); white-space: nowrap; }
.data__when { color: var(--text-muted); font-size: 11px; }
.data__actions { text-align: right; white-space: nowrap; }
.data__actions form { display: inline; }
.data__empty { padding: 32px; text-align: center; font-size: 14px; color: var(--text-muted); }
.data__foot { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
@container tw-main (max-width: 1040px) { .data__grid { grid-template-columns: minmax(0,1fr); } .data__nav { flex-direction: row; flex-wrap: wrap; } }
