:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #11151d;
  --panel-raised: #171c27;
  --line: #293142;
  --line-strong: #3b465c;
  --text: #f2f5fb;
  --muted: #98a3b7;
  --accent: #8b7cff;
  --accent-bright: #aa9fff;
  --accent-soft: rgba(139, 124, 255, .14);
  --green: #42d392;
  --yellow: #f0c96a;
  --red: #ff7185;
  --blue: #62b9ff;
  --radius: 14px;
  --shadow: 0 18px 60px rgba(0, 0, 0, .3);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background: radial-gradient(circle at 50% -20%, #252044 0, transparent 36rem), var(--bg); }
a { color: var(--accent-bright); text-decoration: none; }
a:hover { color: #c7c0ff; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 3px; }
code, pre { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
code { color: #cabfff; overflow-wrap: anywhere; }

.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 100; padding: .65rem 1rem; background: var(--text); color: var(--bg); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.site-header { min-height: 74px; display: flex; align-items: center; gap: 1.25rem; padding: .75rem max(1rem, calc((100vw - 1320px) / 2)); border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(9,11,16,.84); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; font-weight: 900; color: white; background: linear-gradient(145deg, #a392ff, #6551e8); box-shadow: 0 7px 25px rgba(113,87,255,.35); }
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand small { margin-top: .18rem; color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .06em; }
.primary-nav { display: flex; align-items: center; gap: .15rem; margin: 0 auto; }
.primary-nav a { padding: .55rem .72rem; border-radius: 8px; color: var(--muted); font-size: .92rem; font-weight: 650; }
.primary-nav a:hover { color: var(--text); background: rgba(255,255,255,.06); }
.logout-form { margin: 0; }
.shell { width: min(1320px, calc(100% - 2rem)); min-height: calc(100vh - 145px); margin: 0 auto; padding: 2.5rem 0 4rem; }
.site-footer { padding: 1.5rem; border-top: 1px solid rgba(255,255,255,.07); color: #69758a; text-align: center; font-size: .82rem; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .65rem; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.05; letter-spacing: -.045em; }
h2 { margin-bottom: .4rem; font-size: 1.15rem; letter-spacing: -.015em; }
.eyebrow { margin: 0 0 .55rem; color: var(--accent-bright); font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.muted, .page-heading p, .lede { color: var(--muted); }
.page-heading { margin-bottom: 1.8rem; }
.page-heading p { max-width: 760px; margin-bottom: 0; }
.heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.heading-row h1 { margin-bottom: .5rem; }
.hero { min-height: min(700px, calc(100vh - 180px)); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); align-items: center; gap: clamp(2rem, 8vw, 8rem); }
.hero h1 { max-width: 850px; font-size: clamp(3rem, 7vw, 6.5rem); }
.hero .lede { max-width: 720px; margin: 1.3rem 0 2rem; font-size: 1.14rem; }
.hero-panel { padding: .65rem; border: 1px solid var(--line); border-radius: 22px; background: rgba(17,21,29,.8); box-shadow: var(--shadow); }
.hero-panel div { padding: 1.4rem; border-radius: 15px; }
.hero-panel div + div { border-top: 1px solid var(--line); }
.hero-panel strong, .hero-panel span { display: block; }
.hero-panel span { margin-top: .25rem; color: var(--muted); font-size: .9rem; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17,21,29,.88); box-shadow: 0 10px 35px rgba(0,0,0,.12); }
.card-heading { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.05rem 1.25rem; border-bottom: 1px solid var(--line); }
.card-heading h2, .card-heading p { margin: 0; }
.card-heading > span { color: var(--muted); font-size: .85rem; }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; margin-top: 1.15rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1rem; }
.product-card { display: block; padding: 1.25rem; color: var(--text); transition: border-color .15s, transform .15s, background .15s; }
.product-card:hover { color: var(--text); border-color: var(--accent); background: var(--panel-raised); transform: translateY(-2px); }
.product-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.product-card p { min-height: 3rem; margin: 1.2rem 0; color: var(--muted); }
.mini-metrics, .definition-grid, .stacked-definition { margin: 0; }
.mini-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.mini-metrics div { padding: .7rem; border-radius: 8px; background: rgba(255,255,255,.035); }
.mini-metrics dt, .definition-grid dt, .stacked-definition dt { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.mini-metrics dd { margin: .2rem 0 0; font-size: 1.15rem; font-weight: 800; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1.1rem 0; }
.metric { min-width: 0; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); background: linear-gradient(150deg, rgba(255,255,255,.045), rgba(255,255,255,.015)); }
a.metric:hover { color: var(--text); border-color: var(--accent); }
.metric span, .metric strong { display: block; }
.metric span { color: var(--muted); font-size: .8rem; font-weight: 650; }
.metric strong { margin-top: .35rem; font-size: 2rem; line-height: 1; }
.metric .id-value { font-size: .95rem; letter-spacing: .04em; overflow-wrap: anywhere; }
.metric-grid-small .metric { min-height: 98px; }

.button { appearance: none; display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: .45rem; padding: .56rem .9rem; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 750; transition: border-color .15s, background .15s, transform .1s; }
.button:active { transform: translateY(1px); }
.button-primary { color: white; background: linear-gradient(145deg, #8b7cff, #6854e8); box-shadow: 0 7px 24px rgba(104,84,232,.22); }
.button-primary:hover { color: white; background: linear-gradient(145deg, #9e92ff, #735ff1); }
.button-secondary { color: var(--text); border-color: var(--line-strong); background: #222a38; }
.button-secondary:hover { color: white; border-color: var(--accent); background: #293247; }
.button-quiet { color: var(--muted); border-color: var(--line); background: transparent; }
.button-quiet:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255,255,255,.04); }
.button-danger { color: #ff9ba8; border-color: rgba(255,113,133,.32); background: rgba(255,113,133,.08); }
.button-danger:hover { color: white; border-color: var(--red); background: rgba(255,113,133,.18); }
.button-small { min-height: 32px; padding: .32rem .6rem; font-size: .78rem; }
.button-block { width: 100%; }

label { display: block; margin-bottom: .4rem; color: #c9d0dc; font-size: .82rem; font-weight: 700; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-height: 44px; padding: .65rem .75rem; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); background: #0d1118; }
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #56637b; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid rgba(139,124,255,.22); }
.validation { display: block; margin: .35rem 0 .7rem; color: #ff91a0; font-size: .82rem; }
.validation:empty { display: none; }
.input-validation-error { border-color: var(--red) !important; }
.form-card { max-width: 850px; padding: 1.35rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.inline-form { display: flex; align-items: flex-end; gap: .75rem; padding: 1.1rem 1.25rem; border-top: 1px solid var(--line); }
.inline-form > div { flex: 1; }
.two-column-form { display: grid; grid-template-columns: 1fr 1fr auto; }
.check-row { display: flex; align-items: center; gap: .55rem; margin: .2rem 0 1rem; font-weight: 500; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.auth-shell { min-height: calc(100vh - 260px); display: grid; place-items: center; }
.auth-card { width: min(430px, 100%); padding: 1.5rem; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 2.6rem; }
.auth-card input { margin-bottom: .35rem; }

.filter-bar { display: grid; grid-template-columns: 1fr .75fr .75fr 1.4fr auto; align-items: end; gap: .75rem; margin-bottom: 1rem; padding: 1rem; }
.filter-bar-short { grid-template-columns: 1fr 1fr auto; max-width: 780px; }
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: .7rem 1rem; color: #8995aa; background: rgba(255,255,255,.025); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; }
td { padding: .85rem 1rem; border-top: 1px solid var(--line); color: #d5dbe5; font-size: .88rem; vertical-align: middle; }
tbody tr:hover { background: rgba(255,255,255,.025); }
td small, .title-link + small { display: block; margin-top: .2rem; color: #778399; font-size: .72rem; }
.title-link { display: block; color: var(--text); font-weight: 750; }
.title-link:hover { color: var(--accent-bright); }
.hash { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

.badge { display: inline-flex; align-items: center; width: fit-content; padding: .25rem .5rem; border: 1px solid var(--line-strong); border-radius: 999px; color: #bdc6d6; background: rgba(255,255,255,.045); font-size: .68rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.badge-ready, .badge-resolved, .badge-complete, .badge-low { color: #7ee4af; border-color: rgba(66,211,146,.3); background: rgba(66,211,146,.08); }
.badge-new, .badge-feedback, .badge-triaged, .badge-medium { color: #9fceff; border-color: rgba(98,185,255,.3); background: rgba(98,185,255,.08); }
.badge-crash, .badge-critical, .badge-spam { color: #ff9baa; border-color: rgba(255,113,133,.3); background: rgba(255,113,133,.08); }
.badge-bug, .badge-high, .badge-inprogress, .badge-draft { color: #f3d789; border-color: rgba(240,201,106,.3); background: rgba(240,201,106,.08); }
.badge-archived, .badge-ignored, .badge-merged, .badge-retired, .badge-unset { color: #9aa5b7; }
.badge-stack { display: flex; gap: .45rem; }

.notice { margin-bottom: 1rem; padding: 1rem 1.2rem; border: 1px solid var(--line-strong); border-radius: 10px; }
.notice-error { color: #ffb1bc; border-color: rgba(255,113,133,.45); background: rgba(255,113,133,.1); }
.notice-secret { border-color: rgba(240,201,106,.45); background: rgba(240,201,106,.075); }
.notice-secret > div:first-child { display: flex; gap: .5rem; }
.notice-secret span { color: var(--muted); }
.secret-row { display: flex; gap: .65rem; margin-top: .85rem; }
.secret-row code { flex: 1; padding: .7rem; border: 1px dashed rgba(240,201,106,.45); border-radius: 7px; color: #ffe4a1; background: rgba(0,0,0,.25); overflow-wrap: anywhere; }
.secret-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: 1rem 0; }
.secret-list code { padding: .65rem; border: 1px solid var(--border); border-radius: 7px; text-align: center; background: var(--surface-2); }
.item-list { margin: 0; padding: 0; list-style: none; }
.item-list li { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.25rem; border-top: 1px solid var(--line); }
.item-list li:first-child { border-top: 0; }
.item-list small { display: block; margin-top: .22rem; color: var(--muted); }
.empty-copy { margin: 0; padding: 1.25rem; color: var(--muted); }
.empty-state { padding: 4rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; }
.empty-state p { color: var(--muted); }
.empty-state.compact { border: 0; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 1.15rem; }
.detail-main, .detail-aside { display: grid; gap: 1.15rem; }
.detail-aside { position: sticky; top: 94px; }
.content-card { overflow: hidden; }
.prose { padding: 1.3rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.action-card { padding: 1.15rem; }
.action-card form { display: grid; gap: .7rem; }
.action-card form .button { margin-top: .5rem; }
.linked-item { display: block; margin-top: 1rem; padding: .75rem; border: 1px solid var(--line); border-radius: 8px; }
.linked-item span, .linked-item strong { display: block; }
.linked-item span { color: var(--muted); font-size: .72rem; }
.linked-item strong { margin-top: .2rem; color: var(--text); }
.definition-card { padding: 1.15rem; }
.definition-card .card-heading { margin: -1.15rem -1.15rem 1rem; }
.definition-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; }
.definition-grid dd, .stacked-definition dd { margin: .25rem 0 0; overflow-wrap: anywhere; }
.stacked-definition > div { padding: .65rem 0; border-top: 1px solid var(--line); }
.stacked-definition > div:first-child { border-top: 0; padding-top: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; padding: 1rem; }
.gallery figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #07090d; }
.gallery img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; }
.gallery figcaption { padding: .55rem .7rem; color: var(--muted); font-size: .72rem; }
.rejected-file { padding: .85rem; border: 1px solid rgba(255,113,133,.3); border-radius: 9px; }
.rejected-file strong, .rejected-file span { display: block; }
.rejected-file span { color: #ff9baa; font-size: .78rem; }
pre { max-height: 520px; margin: 0; padding: 1.2rem; color: #c8d0df; background: #080a0f; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .78rem; }
.disclosure summary { padding: 1rem 1.2rem; cursor: pointer; font-weight: 750; }
.disclosure[open] summary { border-bottom: 1px solid var(--line); }
.timeline-card { overflow: hidden; }
.timeline { margin: 0; padding: 0 1.3rem 1rem 2.8rem; list-style: none; }
.timeline li { position: relative; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.timeline li::before { content: ""; position: absolute; top: 1.38rem; left: -1.5rem; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline li div { display: flex; justify-content: space-between; gap: 1rem; }
.timeline time, .timeline small { color: var(--muted); font-size: .72rem; }
.timeline p { margin: .45rem 0; color: #c6cedc; }
.break-anywhere { overflow-wrap: anywhere; }

@media (max-width: 980px) {
  .site-header { flex-wrap: wrap; }
  .primary-nav { order: 3; width: 100%; justify-content: space-between; overflow-x: auto; }
  .logout-form { margin-left: auto; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 3rem 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .split-grid, .detail-layout { grid-template-columns: 1fr; }
  .detail-aside { position: static; }
  .filter-bar { grid-template-columns: repeat(2, 1fr); }
  .filter-bar .button { align-self: end; }
  .definition-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 1rem, 1320px); padding-top: 1.4rem; }
  .site-header { padding: .65rem .75rem; }
  .primary-nav a { padding-inline: .45rem; font-size: .78rem; }
  .heading-row { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .metric-grid, .form-grid, .filter-bar, .filter-bar-short, .definition-grid { grid-template-columns: 1fr; }
  .two-column-form { grid-template-columns: 1fr; }
  .split-grid { gap: .8rem; }
  .mini-metrics { grid-template-columns: repeat(2, 1fr); }
  .secret-row { flex-direction: column; }
  .notice-secret > div:first-child { display: block; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .item-list li { align-items: flex-start; flex-direction: column; }
  .gallery { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
