:root {
  color-scheme: light;
  font: 16px/1.45 system-ui, sans-serif;
  --ink: #162339;
  --muted: #52627a;
  --line: #dbe3ee;
  --bg: #f2f5f9;
  --accent: #194fb7;
  --surface: #fff;
  --error: #a52a2e;
  --votes-width: 7.5rem;
  --number-width: 3rem;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--bg); }
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: .52rem .65rem;
  border-radius: .5rem;
  border: 1px solid #aebcd0;
  background: var(--surface);
}
textarea { resize: vertical; }
input:disabled, select:disabled, button:disabled { background: #f0f3f8; color: #65748a; cursor: default; }
button {
  padding: .47rem .7rem;
  border: 1px solid #b6c5da;
  border-radius: .5rem;
  font-weight: 600;
  background: var(--surface);
  cursor: pointer;
}
button:not(:disabled):hover { background: #edf3fd; }
button.primary:not(:disabled) { color: white; background: var(--accent); border-color: var(--accent); }
button.primary:not(:disabled):hover { background: #133e8f; }
:focus-visible { outline: 3px solid #3778d7; outline-offset: 2px; }
a { color: #194b9f; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.35rem, 3vw, 1.85rem); line-height: 1.2; }
h2 { font-size: 1.15rem; line-height: 1.3; overflow-wrap: anywhere; }
small { display: block; }
.muted, footer { color: var(--muted); }
.error { color: var(--error); padding: .5rem 0 0; }
.brand { font-weight: 750; letter-spacing: -.02em; }
.brand span { font-weight: 500; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  padding: .7rem clamp(.8rem, 3vw, 2rem);
  color: #f4f7ff;
  background: #182943;
}
.account { display: flex; align-items: center; gap: .8rem; overflow-wrap: anywhere; }
.account small { color: #c7d5ea; }
.account button { color: var(--ink); }
.workspace { margin: auto; padding: clamp(.6rem, 2vw, 1.6rem); max-width: 110rem; }
.panel { padding: clamp(.8rem, 2vw, 1.35rem); background: var(--surface); border: 1px solid var(--line); border-radius: .85rem; }
.section-head, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.section-head { justify-content: space-between; }
.search-panel { margin-bottom: .8rem; }
.platforms, .stars { display: flex; padding: 0; margin: .8rem 0; border: 0; gap: .15rem; }
.platforms label, .stars label { position: relative; cursor: pointer; }
.platforms input, .stars input { position: absolute; opacity: 0; }
.platforms span, .stars span { display: block; border: 1px solid var(--line); border-radius: .5rem; padding: .35rem .8rem; }
.platforms :checked + span { background: #e6efff; color: #174ca6; border-color: #8badde; font-weight: 750; }
.platforms :focus-visible + span, .stars :focus-visible + span { outline: 3px solid #3778d7; outline-offset: 2px; }
.query-line { display: flex; gap: .55rem; }
#query { flex: 1; }
#search-submit { min-width: 6.2rem; }
#query-hint { margin: .35rem 0 .8rem; font-size: .9rem; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .65rem; }
.filters label, .feedback-grid label, .auth label { font-size: .9rem; font-weight: 600; }
.filters small { color: var(--muted); font-size: .75rem; }
.check { align-self: center; }
.spinner { display: inline-block; width: .8rem; height: .8rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.results { padding: 0; }
.result-head { padding: .85rem; }
.result-status { padding: 0 .85rem .6rem; }
.table-wrap { overflow: auto; max-height: 65vh; border-top: 1px solid var(--line); border-radius: 0 0 .85rem .85rem; }
table { border-collapse: separate; border-spacing: 0; font-size: .89rem; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); background: white; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; white-space: nowrap; z-index: 2; background: #eaf0f8; }
th button { font-size: inherit; padding: .13rem .3rem; background: transparent; border-color: transparent; }
th[aria-sort="ascending"] button::after { content: " ↑"; }
th[aria-sort="descending"] button::after { content: " ↓"; }
td:nth-child(n+4):nth-child(-n+9) { text-align: right; }
th:first-child, td:first-child { width: var(--votes-width); min-width: var(--votes-width); }
th:nth-child(2), td:nth-child(2) { width: var(--number-width); min-width: var(--number-width); }
th:nth-child(3), td:nth-child(3) { min-width: 11rem; max-width: 12rem; }
td:nth-child(3), td:nth-child(n+10):nth-child(-n+14) { overflow-wrap: anywhere; }
td:nth-child(n+11):nth-child(-n+13) { min-width: 8rem; }
td:nth-child(14) { min-width: 17rem; }
th:nth-child(-n+3), .data-row td:nth-child(-n+3) { position: sticky; z-index: 1; }
th:nth-child(-n+3) { z-index: 3; }
th:first-child, .data-row td:first-child { left: 0; }
th:nth-child(2), .data-row td:nth-child(2) { left: var(--votes-width); }
th:nth-child(3), .data-row td:nth-child(3) { left: calc(var(--votes-width) + var(--number-width)); border-right: 1px solid var(--line); }
.channel-title { display: block; }
.channel-link { display: inline-block; margin-top: .15rem; }
.votes { display: flex; gap: .3rem; }
.votes button { padding: .17rem .4rem; }
.votes button[aria-pressed="true"] { background: #deebff; border-color: #3971c5; }
.reason-open { margin-top: .3rem; font-size: .75rem; padding: .15rem .4rem; }
.reason-row td { background: #f0f5ff; }
.reason-form { position: sticky; left: .5rem; max-width: min(42rem, 82vw); display: grid; gap: .45rem; }
.reason-options { display: flex; gap: .45rem .7rem; flex-wrap: wrap; }
.description summary { cursor: pointer; }
.desc-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.description[open] .desc-preview { display: block; }
.description p { margin-top: .35rem; }
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 1rem; font-weight: 650; background: #e9eef6; }
.badge.high { background: #e0f3e7; color: #195d3d; }
.badge.medium { background: #fff1cb; color: #704d0c; }
.feedback-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: .8rem; margin-top: .8rem; }
.feedback-grid form, .auth-panel { display: grid; gap: .6rem; }
.feedback-grid button { justify-self: start; }
.stars { margin: 0; }
.stars span { font-size: 1.35rem; padding: 0 .42rem; color: #695626; }
.stars :checked + span, .stars label:has(~ label :checked) span { color: #875200; background: #fff0c6; border-color: #c7932f; }
#last-feedback { margin: .45rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
footer { padding: .9rem 0; font-size: .82rem; }
dialog { margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(100%, 33rem); border: 1px solid var(--line); padding: 1.1rem; color: var(--ink); }
dialog::backdrop { background: #18294380; }
.history-item { display: block; width: 100%; margin-top: .55rem; text-align: left; overflow-wrap: anywhere; }
.history-item small { font-weight: 400; color: var(--muted); }
.auth { width: min(calc(100% - 1.5rem), 30rem); margin: 9vh auto 0; }
.auth .brand { margin-bottom: .7rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 44rem) {
  .feedback-grid { grid-template-columns: 1fr; }
  th:nth-child(3), .data-row td:nth-child(3) { left: auto; }
  .data-row td:nth-child(3) { position: static; }
  .account { font-size: .85rem; }
}
