:root {
  color-scheme: light;
  --bg: #f7f3ee;
  --surface: #fff;
  --ink: #292326;
  --muted: #71666b;
  --accent: #7d3049;
  --line: #e5dcd7;
  --soft: #eee2e5;
  --danger: #9a2532;
  --focus: #165e96;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 0;
  border-radius: 10px;
  min-height: 44px;
  padding: 12px 16px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.secondary,
.icon,
.back {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
button.danger {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid var(--line);
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
header {
  max-width: 960px;
  margin: auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: Georgia, serif;
  letter-spacing: 0.2em;
  font-size: 24px;
}
.brand span {
  display: block;
  font-family: inherit;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
main {
  max-width: 960px;
  margin: auto;
  padding: 24px 20px 140px;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.04em;
  margin: 4px 0 12px;
  overflow-wrap: anywhere;
}
h1 span {
  font-size: 18px;
  color: var(--muted);
  font-weight: 400;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 700;
  margin: 0;
}
.intro {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 500px;
  margin: 0 0 24px;
}
.settings {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 20px;
}
.settings label {
  flex: 1;
}
.settings button {
  font-size: 13px;
  max-width: 160px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 16px;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-top: 8px;
  min-height: 46px;
}
textarea {
  line-height: 1.5;
  resize: vertical;
  font-weight: 400;
}
input[type="search"] {
  margin: 0;
}
.search {
  margin-bottom: 12px;
}
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.tabs button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 16px;
}
.tabs button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.card .open {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  background: transparent;
  color: var(--ink);
  font-weight: 400;
  border-radius: 0;
}
.cover {
  display: flex;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--soft);
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-content {
  padding: 12px;
}
.card h2 {
  font-size: 15px;
  line-height: 1.35;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.badge {
  font-size: 11px;
  display: inline-block;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
}
.badge.attention {
  background: #fff0d7;
  color: #7c470a;
}
.badge.ready {
  background: #e6efe6;
  color: #315533;
}
.card p {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 12px;
  margin: 0;
  font-size: 12px;
  min-height: 44px;
}
.pick input {
  width: 22px;
  min-height: 22px;
  margin: 0;
  accent-color: var(--accent);
}
.batchbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 5;
  flex-wrap: wrap;
}
.batchbar span {
  font-size: 13px;
}
.batchbar button {
  font-size: 13px;
}
.back {
  margin-bottom: 20px;
}
.media {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 16px 0 24px;
  padding-bottom: 8px;
}
.media figure {
  margin: 0;
  flex: 0 0 85%;
  max-width: 440px;
  scroll-snap-align: start;
}
.media img,
.media video {
  width: 100%;
  height: 320px;
  object-fit: contain;
  background: var(--soft);
  border-radius: 12px;
}
.media figcaption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.notice {
  background: #fff0d7;
  color: #7c470a;
  padding: 16px;
  border-radius: 10px;
  line-height: 1.5;
}
.muted,
.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.actions button {
  flex: 1 1 170px;
}
details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-top: 24px;
}
summary {
  cursor: pointer;
  min-height: 30px;
  font-size: 14px;
  font-weight: 600;
}
details label {
  margin-top: 16px;
}
dialog {
  width: min(600px, calc(100% - 24px));
  max-height: 90dvh;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  background: var(--bg);
  color: var(--ink);
}
dialog::backdrop {
  background: #24141b88;
}
dialog h2 {
  font-size: 22px;
}
.close {
  float: right;
  margin-bottom: 12px;
}
.review-item {
  clear: both;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.review-item pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}
.review-item .media img,
.review-item .media video {
  height: 160px;
}
.review-item .media {
  margin: 8px 0;
}
.review-item h3 {
  font-size: 14px;
}
#toast {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  max-width: 620px;
  margin: auto;
  z-index: 20;
  background: var(--ink);
  color: var(--bg);
  padding: 16px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 4px 16px #0002;
}
#status {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
[hidden] {
  display: none !important;
}
@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cover {
    height: 230px;
  }
  main {
    padding: 32px 24px 140px;
  }
}
@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 360px) {
  main {
    padding: 20px 12px 160px;
  }
  .grid {
    gap: 8px;
  }
  .cover {
    height: 150px;
  }
  .settings {
    gap: 8px;
  }
  .settings button {
    max-width: 120px;
  }
  .tabs button {
    padding: 8px 12px;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #211c1e;
    --surface: #2c2528;
    --ink: #f7ede8;
    --muted: #bcaeb4;
    --accent: #c36f8d;
    --line: #4a3b42;
    --soft: #3e3037;
    --danger: #ffb3ba;
    --focus: #82bfee;
  }
  .badge.ready {
    background: #283d2d;
    color: #bce3c3;
  }
  .badge.attention,
  .notice {
    background: #45351f;
    color: #f3d299;
  }
}

/* Queue actions stay reachable above the selection toolbar on narrow phones. */
main {
  padding-bottom: 220px;
}
.card > .danger {
  margin: 0 12px 12px;
  width: calc(100% - 24px);
}
.batchbar > span {
  flex-basis: 100%;
  text-align: center;
}
.batchbar > button {
  flex: 1 1 120px;
  max-width: 100%;
}
.batchbar > #review {
  flex-basis: 100%;
  max-width: 600px;
}
#attachmentPreview {
  white-space: pre-wrap;
}
