/* Style: calm, image-first, mobile-first. Warm paper background, deep
   navy accent (the brief's lead colour), big tap targets. */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  background: #f7f3ec;
  color: #26302a;
}
.site-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px;
  background: #26374a; color: #fff;
}
.app-icon { width: 36px; height: 36px; border-radius: 8px; }
.header-text { flex: 1 1 auto; min-width: 140px; }
.site-header h1 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.tagline { margin: 2px 0 0; font-size: 0.85rem; opacity: 0.92; }
.header-nav { display: flex; gap: 6px; }
.nav-link {
  color: #dbe4ee; text-decoration: none; font-size: 0.92rem;
  padding: 9px 12px; border-radius: 8px; min-height: 40px;
  display: inline-flex; align-items: center;
}
.nav-link.on { background: rgba(255,255,255,0.16); color: #fff; font-weight: 600; }

.main { margin: 0 auto; padding: 12px; max-width: 1100px; }

.add-toggle {
  width: 100%; min-height: 52px; margin-top: 10px;
  font-size: 1.02rem; font-weight: 600;
  background: #26374a; color: #fff; border: none; border-radius: 10px;
  cursor: pointer;
}
.panel {
  margin-top: 10px; background: #fff; border: 1px solid #ddd5c2;
  border-radius: 10px; padding: 12px;
}
.quick-panel { margin-top: 0; }
.field { display: block; margin-bottom: 10px; }
.field > span, .field > legend {
  display: block; font-size: 0.82rem; color: #5c665e; margin-bottom: 4px;
}
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 0.95rem;
  padding: 9px 10px; border: 1px solid #b9bfae; border-radius: 8px;
  min-height: 44px; background: #fffdf9;
}
.field textarea { min-height: 0; resize: vertical; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .field-grid { grid-template-columns: 1fr; } }
fieldset.field { border: none; padding: 0; margin: 0 0 10px; }
.link-row { display: flex; gap: 6px; }
.link-row input { flex: 1 1 auto; }
.file-row { margin-top: 6px; }
.fetch-note { margin: 6px 0 2px; font-size: 0.82rem; color: #5c665e; min-height: 1em; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.primary-btn {
  min-height: 46px; padding: 8px 18px; font-size: 0.98rem; font-weight: 600;
  background: #26374a; color: #fff; border: none; border-radius: 8px; cursor: pointer;
  white-space: nowrap;
}
.mini-btn {
  min-height: 44px; padding: 6px 12px; font-size: 0.88rem;
  background: #efe9db; border: 1px solid #d5cdb6; border-radius: 8px;
  cursor: pointer; color: #26302a; white-space: nowrap;
}
.mini-btn.danger { color: #8a2f2f; }
.mini-btn:disabled { opacity: 0.55; cursor: default; }
.link-btn { display: inline-flex; align-items: center; text-decoration: none; }
.segmented { display: flex; border: 1px solid #b9bfae; border-radius: 8px; overflow: hidden; }
.segmented button {
  flex: 1 1 0; min-height: 44px; font: inherit; font-size: 0.92rem;
  background: #fffdf9; border: none; cursor: pointer; color: #26302a;
}
.segmented button.on { background: #26374a; color: #fff; font-weight: 600; }

/* Colour chips (add + detail forms) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 6px 12px 6px 8px;
  font: inherit; font-size: 0.88rem; color: #26302a;
  background: #fffdf9; border: 1px solid #b9bfae; border-radius: 999px;
  cursor: pointer; text-transform: capitalize;
}
.chip .dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid rgba(38,48,42,0.35); flex: 0 0 auto;
}
.chip.on { border-color: #26374a; box-shadow: 0 0 0 2px #26374a inset; font-weight: 600; }

/* Filters: a collapsible sheet on narrow screens, a row on wide ones. */
.filters-toggle {
  width: 100%; min-height: 46px; margin-top: 12px;
  font: inherit; font-size: 0.95rem; font-weight: 600;
  background: #efe9db; border: 1px solid #d5cdb6; border-radius: 8px;
  cursor: pointer; color: #26302a;
}
.filters { display: none; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.filters.open { display: flex; }
@media (min-width: 760px) {
  .filters-toggle { display: none; }
  .filters { display: flex; margin-top: 14px; }
}
.filters input, .filters select {
  font: inherit; font-size: 0.92rem; padding: 8px 10px; min-height: 44px;
  border: 1px solid #b9bfae; border-radius: 8px; background: #fffdf9;
}
#search { flex: 2 1 170px; }
.filters select { flex: 1 1 130px; }

.status-line { min-height: 1.1em; margin: 8px 0 4px; color: #5c665e; font-size: 0.88rem; }
.status-line.error { color: #a33; }
.empty { color: #5c665e; }

/* Card grid: masonry via CSS columns. */
.card-grid { column-count: 2; column-gap: 10px; }
@keyframes cardin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card { animation: cardin 0.35s ease both; }
@media (min-width: 640px) { .card-grid { column-count: 3; } }
@media (min-width: 980px) { .card-grid { column-count: 4; } }
.card {
  break-inside: avoid; display: block; width: 100%;
  margin: 0 0 10px; padding: 0; border: none; border-radius: 12px;
  overflow: hidden; background: #fff; cursor: pointer; text-align: left;
  font: inherit; box-shadow: 0 1px 4px rgba(38, 48, 42, 0.14);
}
.card img { width: 100%; display: block; }
.card-nophoto {
  display: flex; align-items: center; justify-content: center;
  height: 110px; background: #e4ddcd; color: #26374a;
  font-size: 2rem; font-weight: 600;
}
.card .card-body { display: block; padding: 8px 10px 10px; }
.card .card-title { display: block; font-size: 0.98rem; font-weight: 600; color: #26302a; line-height: 1.3; }
.card .card-sub { display: block; font-size: 0.78rem; color: #5c665e; margin-top: 2px; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.swatches { display: inline-flex; gap: 4px; }
.sw {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(38,48,42,0.35); display: inline-block;
}
.markers { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.pill {
  font-size: 0.72rem; padding: 2px 8px; border-radius: 999px;
  background: #efe9db; color: #5c5340;
}
.pill.st-want { background: #f3e3c3; color: #6d5210; }
.pill.st-own { background: #26374a; color: #fff; }
.pill.st-pass { background: #ddd; color: #666; }
.pill.phase { background: #dce4ee; color: #26374a; }

/* Detail sheet */
.scrim {
  position: fixed; inset: 0; background: rgba(38, 48, 42, 0.45); z-index: 40;
}
.detail-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-height: 92vh; overflow-y: auto;
  background: #fffdf9; border-radius: 16px 16px 0 0; padding: 14px;
  box-shadow: 0 -4px 24px rgba(38, 48, 42, 0.25);
}
@media (min-width: 760px) {
  .detail-sheet { left: 50%; right: auto; transform: translateX(-50%); width: 640px; }
}
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.detail-head h2 { margin: 0; font-size: 1.1rem; }
.detail-image { width: 100%; border-radius: 10px; margin: 10px 0 6px; display: block; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.thumb {
  position: relative; width: 64px; height: 64px; padding: 0;
  border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  cursor: pointer; background: #e8e2d2;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.on { border-color: #26374a; }
.thumb-tag {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 0.62rem; text-align: center; padding: 1px 0;
  background: rgba(38,55,74,0.85); color: #fff;
}
.gallery-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.site-footer { padding: 6px 14px 20px; color: #5c665e; font-size: 0.82rem; max-width: 1100px; margin: 0 auto; }

/* Style Guide page */
.guide { max-width: 760px; }
.guide h2 { font-size: 1.15rem; margin: 22px 0 6px; color: #26374a; }
.guide h2:first-child { margin-top: 6px; }
.guide p, .guide li { line-height: 1.5; }
.guide ul, .guide ol { margin: 6px 0; padding-left: 22px; }
.guide .lede { font-size: 1.02rem; }
.guide .motto { font-style: italic; color: #44536b; }
.palette { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.palette .sw-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 76px; }
.palette .sw-big {
  width: 52px; height: 52px; border-radius: 10px;
  border: 1px solid rgba(38,48,42,0.3);
}
.palette .sw-name { font-size: 0.78rem; color: #5c665e; text-align: center; text-transform: capitalize; }
.combo { background: #fff; border: 1px solid #ddd5c2; border-radius: 10px; padding: 10px 12px; margin: 0 0 8px; }
.combo .combo-name { font-weight: 600; display: block; }
