*, *::before, *::after { box-sizing: border-box; }


/* The hidden attribute must win over display:flex / grid on these elements. */
[hidden] { display: none !important; }


:root {
  --bg: #12141a;
  --bg-elev: #1a1d26;
  --bg-card: #20242e;
  --line: #2c3140;
  --text: #e8eaf0;
  --muted: #9aa3b5;
  --faint: #6d7588;
  --accent: #7eb6ff;
  --bug: #ff8a7a;
  --bug-bg: #3a1f1c;
  --imp: #7ed0b0;
  --imp-bg: #17342c;
  --warn-bg: #3a2f14;
  --warn: #f0c36a;
  --danger: #ff9b8a;
  --btn: #2a3142;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --radius: 16px;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  padding: 20px 16px 48px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}

#app {
  max-width: 760px;
  margin: 0 auto;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.mark {
  width: 12px;
  height: 36px;
  margin-top: 2px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--accent), #5b8def 60%, #7ed0b0);
  flex: none;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.who {
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.gate h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.gate p {
  margin: 0 0 20px;
  color: var(--muted);
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--btn);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
}

.btn:hover { filter: brightness(1.08); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn.google {
  background: #fff;
  color: #1f1f1f;
  border-color: #fff;
  width: 100%;
  max-width: 280px;
}

.btn.primary {
  background: #3a6fd8;
  border-color: #4a7de0;
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  min-height: 36px;
  font-weight: 550;
}

.gicon { display: block; }

.hint {
  color: var(--danger) !important;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
}

.banner {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #5a4a1f;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.status {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.status.error { color: var(--danger); }

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.8rem;
  color: var(--muted);
}
.chip strong {
  color: var(--text);
  font-weight: 650;
  margin-right: 2px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.field.search { grid-column: 1 / -1; }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field span {
  font-size: 0.75rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 650;
}

select, input[type="search"] {
  width: 100%;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  min-height: 44px;
}

input[type="search"]::placeholder { color: var(--faint); }

.result-meta {
  margin: 6px 0 12px;
  color: var(--faint);
  font-size: 0.82rem;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 10px;
}

.app-name {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.ver {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.badge {
  margin-left: auto;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge.bug { background: var(--bug-bg); color: var(--bug); }
.badge.improvement { background: var(--imp-bg); color: var(--imp); }
.badge.other { background: #2a2f3c; color: var(--muted); }

.message {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.98rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 42px 16px;
  background: var(--bg-elev);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1.05rem;
}
.empty p { margin: 0; }

@media (min-width: 640px) {
  body { padding: 32px 24px 64px; }
  h1 { font-size: 1.55rem; }
  .filters { grid-template-columns: 160px 160px 1fr; }
  .field.search { grid-column: auto; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
}

.seg {
  appearance: none;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  padding: 8px 10px;
  min-height: 40px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.seg.on {
  background: var(--btn);
  color: var(--text);
}

.chip.action {
  appearance: none;
  font: inherit;
  cursor: pointer;
}

.chip.action.on {
  border-color: #4a7de0;
  color: var(--text);
  background: #243656;
}

.card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.card-main { min-width: 0; flex: 1; }

.check {
  appearance: none;
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border-radius: 999px;
  border: 2px solid #5a6275;
  background: transparent;
  color: #12141a;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.check:hover { border-color: var(--imp); }
.check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.check.checked {
  background: var(--imp);
  border-color: var(--imp);
}

.check-mark {
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

.card.is-done .message { color: #c5c9d4; }
.card.is-done .app-name { color: #d4d7e0; }

.done-meta { color: var(--imp); }

.comment-toggle {
  appearance: none;
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  padding: 0;
  min-height: 36px;
  cursor: pointer;
}

.comment-toggle.open { color: var(--text); }

.comments {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.thread {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.comment p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  color: var(--faint);
  font-size: 0.75rem;
}

.empty-comment {
  color: var(--muted);
  background: transparent;
  border-style: dashed;
}

.comment-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.comment-form textarea {
  width: 100%;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  min-height: 72px;
}

.btn.small {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.9rem;
}
