/* Dusk Glass colors from the app (src/components/ui.tsx), without the glows. Dark is the main design; light follows the system. */
:root {
  color-scheme: dark;
  --bg: #120e1f;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-alt: rgba(110, 78, 245, 0.2);
  --divider: rgba(255, 255, 255, 0.12);
  --text: #f4f0ff; /* 16.9:1 */
  --muted: #b3aacb; /* 8.6:1 */
  --accent: #c9bbff; /* violet text */
  --tint: rgba(255, 255, 255, 0.1);
  --primary: #6e4ef5;
  --primary-end: #9c48cb;
  --on-primary: #fff; /* 5.2:1 on primary */
  --error: #ff8a80; /* 8.3:1 */
  --glass: rgba(28, 20, 52, 0.55);
  --glass-edge: rgba(255, 255, 255, 0.22);
  --sheet: #1c1730;
  --scrim: rgba(8, 5, 18, 0.72);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f3effc;
    --surface: rgba(255, 255, 255, 0.6);
    --surface-alt: rgba(91, 63, 224, 0.1);
    --divider: rgba(31, 22, 54, 0.1);
    --text: #1f1636; /* 14.9:1 */
    --muted: #6e6585; /* 4.7:1 */
    --accent: #5b3fe0; /* 6.2:1 */
    --tint: rgba(255, 255, 255, 0.6);
    --primary: #5b3fe0;
    --primary-end: #8a3ebc;
    --on-primary: #fff; /* 6.5:1 */
    --error: #c42b1c; /* 5.2:1 */
    --glass: rgba(255, 255, 255, 0.55);
    --glass-edge: rgba(255, 255, 255, 0.9);
    --sheet: #faf7ff;
    --scrim: rgba(31, 22, 54, 0.6);
    --shadow: 0 18px 40px rgba(60, 40, 120, 0.14);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display { font-family: "Bricolage Grotesque", Inter, system-ui, sans-serif; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0; }
.muted { color: var(--muted); }
.caption { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.serif { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: 20px; line-height: 1.35; }
.error { color: var(--error); font-weight: 600; }
.icon { font-family: "Material Symbols Rounded"; font-weight: 400; font-size: 20px; line-height: 1; font-variation-settings: "FILL" 0, "wght" 400; user-select: none; }
.icon.fill { font-variation-settings: "FILL" 1, "wght" 400; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 18px;
  background: var(--glass); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: inset -1px 0 0 var(--divider);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff;
  background: #6e4ef5; /* the website's logo tile */
}
.logo svg { width: 100%; height: 100%; fill: currentColor; }
.brand b { font-family: "Bricolage Grotesque", sans-serif; font-size: 18px; display: block; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 12px; }
nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-group { padding: 14px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: var(--text);
  text-decoration: none; font-weight: 500; transition: background 0.15s;
}
.nav-item:hover { background: var(--tint); }
.nav-item[aria-current="page"] { background: var(--surface-alt); color: var(--accent); }
.nav-item[aria-current="page"] .icon { font-variation-settings: "FILL" 1, "wght" 400; }
.nav-item span:nth-child(2) { flex: 1; }
.badge {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--primary); color: var(--on-primary);
}
.badge.zero { background: var(--tint); color: var(--muted); }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--surface); }
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-end)); color: var(--on-primary);
}
.me .who { flex: 1; min-width: 0; }
.me .who div { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who small { color: var(--muted); font-size: 12px; text-transform: capitalize; }

.main { min-width: 0; padding: 28px 36px 64px; max-width: 1180px; width: 100%; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.topbar .sub { margin-top: 6px; }
.topbar .tools { display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--tint); color: var(--muted); }
.pill.dev { background: var(--surface-alt); color: var(--accent); }

/* ---------- Buttons and inputs ---------- */
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 999px; padding: 10px 18px; min-height: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--on-primary);
  background: linear-gradient(135deg, var(--primary), var(--primary-end)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.12s, filter 0.15s;
}
button:hover { filter: brightness(1.08); }
button:active { transform: scale(0.97); }
button.secondary { background: var(--tint); color: var(--text); box-shadow: inset 0 1px 0 var(--glass-edge); }
button.danger { background: var(--tint); color: var(--error); box-shadow: inset 0 1px 0 var(--glass-edge); }
button.ghost { background: transparent; color: var(--muted); box-shadow: none; padding: 8px; min-height: 36px; }
button.ghost:hover { color: var(--text); background: var(--tint); }
button:disabled { opacity: 0.5; cursor: default; transform: none; }
input, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 0; border-radius: 14px; padding: 11px 14px; width: 100%;
  box-shadow: inset 0 1px 0 var(--glass-edge);
}
textarea { resize: vertical; min-height: 64px; }
input::placeholder, textarea::placeholder { color: var(--muted); }

/* ---------- Cards and layout ---------- */
.card { background: var(--surface); border-radius: 24px; padding: 20px; box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow); }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
.meta { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta .icon { font-size: 16px; }
.enter { animation: rise 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .enter { animation: none; } button { transition: none; } }

/* Overview */
.hero {
  padding: 28px; border-radius: 28px; position: relative; overflow: hidden; color: var(--on-primary);
  background: linear-gradient(135deg, var(--primary), var(--primary-end));
}
.hero .big { font-family: "Bricolage Grotesque", sans-serif; font-size: 56px; font-weight: 700; line-height: 1; }
.hero p { opacity: 0.9; max-width: 520px; margin-top: 8px; }
.hero .row { margin-top: 20px; position: relative; z-index: 1; }
.hero button { background: rgba(255, 255, 255, 0.2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
.tile {
  display: grid; gap: 10px; padding: 18px; border-radius: 22px; background: var(--surface); text-decoration: none; color: var(--text);
  box-shadow: inset 0 1px 0 var(--glass-edge); transition: transform 0.15s, background 0.15s;
}
.tile:hover { transform: translateY(-2px); background: var(--surface-alt); }
.tile .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-alt); color: var(--accent); }
.tile .n { font-family: "Bricolage Grotesque", sans-serif; font-size: 32px; font-weight: 700; line-height: 1; }
.tile .l { color: var(--muted); font-size: 13px; font-weight: 500; }
.tile.done .n { color: var(--muted); }
.stat-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; box-shadow: inset 0 -1px 0 var(--divider); }
.stat-list > div:last-child { box-shadow: none; }
.stat-list span::first-letter { text-transform: uppercase; }
.stat-list b { color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; }

/* Queue items */
.review { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; }
.gallery { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.gallery button.ph { padding: 0; min-height: 0; background: none; box-shadow: none; flex: none; scroll-snap-align: start; border-radius: 18px; overflow: hidden; }
.gallery img, .compare img { display: block; width: 190px; aspect-ratio: 4 / 5; object-fit: cover; background: var(--tint); border-radius: 18px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare figure { margin: 0; display: grid; gap: 6px; }
.compare button.ph { padding: 0; min-height: 0; background: none; box-shadow: none; border-radius: 18px; overflow: hidden; }
.compare img { width: 100%; }
.compare figcaption { font-size: 12px; color: var(--muted); text-align: center; }
.pose { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface-alt); }
.post { padding: 26px; border-radius: 22px; min-height: 160px; display: flex; align-items: center; font-family: "Bricolage Grotesque", sans-serif; font-size: 22px; font-weight: 600; line-height: 1.3; }
.actions { display: flex; gap: 10px; margin-top: auto; flex-wrap: wrap; }
.actions button { flex: 1; min-width: 120px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-alt); color: var(--accent); text-transform: capitalize; }
.tag.warn { background: var(--tint); color: var(--error); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { min-height: 34px; padding: 6px 14px; font-size: 13px; background: var(--tint); color: var(--text); box-shadow: inset 0 1px 0 var(--glass-edge); text-transform: capitalize; }
.chip[aria-pressed="true"] { background: linear-gradient(135deg, var(--primary), var(--primary-end)); color: var(--on-primary); }
.statuses { display: flex; gap: 6px; flex-wrap: wrap; }
.statuses button { min-height: 32px; padding: 5px 12px; font-size: 13px; text-transform: capitalize; }
.quote-box { padding: 14px 16px; border-radius: 16px; background: var(--tint); }

.empty { text-align: center; padding: 56px 24px; display: grid; gap: 10px; justify-items: center; }
.empty .ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-alt); color: var(--accent); }
.empty .ic .icon { font-size: 32px; }

/* Reviewers */
.table { display: grid; }
.table > div { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 12px 4px; box-shadow: inset 0 -1px 0 var(--divider); }
.table > div:last-child { box-shadow: none; }
.add { display: flex; gap: 10px; }
.add input { flex: 1; }

/* Overlays */
.lightbox { position: fixed; inset: 0; z-index: 20; background: var(--scrim); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: grid; place-items: center; padding: 24px; animation: fade 0.2s both; }
.lightbox img { max-width: min(92vw, 900px); max-height: 86vh; border-radius: 24px; object-fit: contain; box-shadow: var(--shadow); }
.lightbox .close { position: absolute; top: 18px; right: 18px; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox .prev { left: 18px; }
.lightbox .next { right: 18px; }
.lightbox .count { position: absolute; bottom: 20px; color: #fff; font-weight: 600; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 30; display: grid; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; font-weight: 600; max-width: 360px;
  background: var(--sheet); box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow); animation: rise 0.3s both;
}
.toast .icon { color: var(--accent); }
.toast.bad .icon { color: var(--error); }

/* Sign-in */
.signin { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.signin .art { padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.signin .art h1 { font-size: 52px; max-width: 520px; line-height: 1.05; }
.signin .art .serif { max-width: 460px; color: var(--muted); margin-top: 16px; }
.signin .feat { display: grid; gap: 14px; }
.signin .feat div { display: flex; gap: 12px; align-items: center; }
.signin .feat .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-alt); color: var(--accent); }
.signin .panel { display: grid; place-items: center; padding: 24px; }
.signin .box { width: 100%; max-width: 400px; display: grid; gap: 14px; padding: 32px; border-radius: 28px; background: var(--glass); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow); }
.signin .or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.signin .or::before, .signin .or::after { content: ""; flex: 1; height: 1px; background: var(--divider); }
.signin .box .pill { justify-self: center; }
.denied { display: flex; gap: 12px; padding: 14px; border-radius: 16px; background: var(--tint); color: var(--error); }
.loading { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--tint); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Narrow screens ---------- */
@media (max-width: 960px) {
  .review { grid-template-columns: 1fr; }
  .signin { grid-template-columns: 1fr; }
  .signin .art { padding: 32px 20px 0; gap: 24px; }
  .signin .art h1 { font-size: 36px; }
  .signin .feat { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-width: 0; }
  .sidebar { position: sticky; top: 0; z-index: 10; height: auto; padding: 12px 16px; gap: 10px; box-shadow: inset 0 -1px 0 var(--divider); }
  .sidebar .brand { justify-content: space-between; padding: 0; }
  nav { flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  .nav-group { display: none; }
  .nav-item { flex: none; padding: 8px 12px; white-space: nowrap; }
  .sidebar .me { display: none; }
  .main { padding: 20px 16px 48px; }
  .grid { grid-template-columns: 1fr; }
  .gallery img { width: 150px; }
  .hero .big { font-size: 44px; }
  .table > div { grid-template-columns: auto 1fr auto; }
  .table > div > :nth-child(3) { display: none; }
}
