/* Poster. Quiet chrome so the photographs are the loudest thing on screen. */

:root {
  --bg: #f6f5f2;
  --panel: #ffffff;
  --ink: #1b1b1a;
  --muted: #74716a;
  --line: #e3e1db;
  --soft: #eeece7;
  --accent: #1b1b1a;
  --accent-ink: #ffffff;
  --focus: #2f6fdf;
  --good: #2e7d4f;
  --warn: #a8641a;
  --bad: #b3261e;
  --add: #e6f4ea;
  --del: #fbe9e7;
  --radius: 8px;
  --row: 136px;
  color-scheme: light;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --panel: #1a1a19;
    --ink: #ecebe7;
    --muted: #9a978f;
    --line: #2d2c29;
    --soft: #222220;
    --accent: #ecebe7;
    --accent-ink: #121211;
    --focus: #6d9cf0;
    --good: #5fb07f;
    --warn: #d99a52;
    --bad: #ef7f74;
    --add: #183322;
    --del: #3a1d1a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.86em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.center { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.error-text { color: var(--bad); }
[hidden] { display: none !important; }

/* MARK: Controls */

button, .button {
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
button:hover:not(:disabled), .button:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--bad); }
button.primary.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.active { background: var(--soft); }
button.link, .button.link { border-color: transparent; background: none; padding: 6px 8px; }
button.link:hover, .button.link:hover { border-color: transparent; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

select:not(.branch select) { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; max-width: 100%; }
input, textarea {
  font: inherit;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
textarea { resize: vertical; line-height: 1.5; }
input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--accent); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; }
.field small { font-weight: 400; margin-left: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; padding-bottom: 9px; white-space: nowrap; }

.pill {
  display: inline-block;
  font-size: 11px;
  line-height: 16px;
  padding: 1px 7px;
  border-radius: 9px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.pill.live { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pill.draft { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.edited { background: color-mix(in srgb, var(--focus) 14%, transparent); color: var(--focus); }
.pill.new { background: var(--soft); color: var(--ink); }

/* MARK: Layout */

.app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: 48px minmax(0, 1fr);
  height: 100dvh;
}
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  min-width: 0;
}
.brand { font-weight: 650; text-decoration: none; letter-spacing: -0.01em; }
.topbar .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar { overflow: auto; border-right: 1px solid var(--line); background: var(--panel); padding: 10px 8px 32px; }
.main { --foot: 80px; overflow: auto; padding: 0 clamp(16px, 4vw, 48px) var(--foot); }

.deploy { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 4px 3px 10px; border-radius: 14px; background: var(--soft); white-space: nowrap; min-width: 0; }
.deploy a { font-weight: 500; }
.deploy .close { padding: 0 6px; font-size: 16px; line-height: 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.good { background: var(--good); }
.dot.bad { background: var(--bad); }
.dot.pulse { background: var(--focus); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* MARK: Sidebar */

.search { margin: 0 0 4px; padding: 7px 10px; background: var(--soft); border-color: transparent; }
.nav-section header { display: flex; align-items: center; gap: 6px; padding: 14px 8px 6px; }
.nav-section.folded header { padding-bottom: 2px; }
.nav-section h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.nav-section header .muted { font-size: 12px; }
.nav-toggle { display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 4px 2px 0; border: 0; background: none; color: inherit; }
.nav-toggle:hover:not(:disabled) h3 { color: var(--ink); }
.nav-toggle:disabled { opacity: 1; cursor: default; }
.nav-toggle .chevron { display: inline-block; width: 10px; font-size: 10px; color: var(--muted); transition: transform 0.15s; }
.nav-toggle[aria-expanded="false"] .chevron { transform: rotate(-90deg); }
.nav-section .add { font-size: 13px; text-decoration: none; color: var(--focus); font-weight: 500; }
.nav-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 6px;
  text-decoration: none;
}
.nav-item:hover { background: var(--soft); }
.nav-item.active { background: var(--soft); box-shadow: inset 2px 0 0 var(--ink); }
.nav-item img, .nav-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--line); display: block; }
.nav-text { display: grid; min-width: 0; }
.nav-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badges { display: grid; gap: 2px; justify-items: end; }

/* MARK: Home */

.home { max-width: 760px; margin: 40px auto 0; }
.home h1 { font-size: 28px; margin: 0 0 20px; }
.new-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 32px; }
.new-button { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-decoration: none; }
.new-button:hover { border-color: var(--ink); }
.new-button strong { font-size: 17px; }
.new-button .muted { font-size: 13px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 24px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* MARK: Editor */

.editor { max-width: 1120px; margin: 0 auto; }
.editor-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0;
  margin-bottom: 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.crumbs > span:first-child { font-weight: 600; }
.crumbs .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.back { display: none; font-size: 22px; padding: 0 8px; }
.banner { padding: 10px 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--warn) 14%, transparent); margin: 0 0 16px; }
.banner p { margin: 0 0 8px; }

.fields { display: grid; gap: 16px; max-width: 760px; }
.title-input { font-size: 28px; font-weight: 600; letter-spacing: -0.015em; padding: 4px 0; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; }
.title-input:focus { box-shadow: none; border-bottom-color: var(--focus); }
.row { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
.row .field { width: auto; }
.row .grow { flex: 1; min-width: 200px; }
.address { margin: -8px 0 0; font-size: 13px; }

.menu { position: relative; }
.menu-items { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: grid; min-width: 220px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); }
.menu-items button { border: 0; justify-content: flex-start; }
.menu-items button:hover { background: var(--soft); }

.source { display: grid; gap: 10px; }
.source p { margin: 0; }
.source textarea { min-height: 60vh; font-size: 13px; line-height: 1.55; white-space: pre; tab-size: 2; }

/* MARK: Photos */

.photos { margin-top: 32px; border-radius: var(--radius); }
.photos.dropping { box-shadow: 0 0 0 2px var(--focus); background: color-mix(in srgb, var(--focus) 6%, transparent); }
.section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-head .muted { font-size: 13px; }
.count { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--soft); border-radius: 9px; padding: 1px 7px; }

.dropzone { display: grid; gap: 6px; justify-items: center; width: 100%; padding: 48px 24px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--panel); color: var(--muted); white-space: normal; text-align: center; }
.dropzone strong { font-size: 17px; color: var(--ink); }

.grid { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: var(--radius); background: var(--soft); outline: none; }
.grid:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.grid.dragging, .grid.dragging .tile { cursor: grabbing; }
.tile {
  position: relative;
  height: var(--row);
  aspect-ratio: var(--ratio);
  max-width: 100%;
  flex: 0 0 auto;
  border-radius: 3px;
  overflow: hidden;
  background: var(--line);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.tile.selected { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.tile.dragged { opacity: 0.3; }
.tile.drop-before, .tile-end.drop-before { box-shadow: -5px 0 0 -1px var(--focus); }
.tile.opaque { display: grid; place-items: center; background: var(--panel); border: 1px dashed var(--line); }
.tile-end { width: 1px; height: var(--row); }
.tile-label { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; font-size: 12px; color: var(--muted); text-align: center; word-break: break-all; }
.tile .num { position: absolute; right: 6px; bottom: 4px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / 0.7); }
.badge { position: absolute; top: 6px; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 9px; background: rgb(0 0 0 / 0.62); color: #fff; letter-spacing: 0.02em; }
.badge.cover { left: 6px; }
.badge.caption { top: auto; bottom: 5px; left: 6px; padding: 0 5px; font-size: 13px; line-height: 16px; }
.tile-status { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / 0.7)); }
.tile-status.error, .tile-status.warn { top: 0; display: grid; place-items: center; padding: 6px; font-weight: 600; font-size: 12px; text-align: center; }
.tile-status.error { background: color-mix(in srgb, var(--bad) 82%, transparent); }
.tile-status.warn { background: color-mix(in srgb, var(--warn) 82%, transparent); }
.bar { display: block; height: 3px; margin-top: 4px; border-radius: 2px; background: rgb(255 255 255 / 0.3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: #fff; transition: width 0.2s; }
.ghost { position: fixed; z-index: 60; pointer-events: none; padding: 2px 9px; border-radius: 10px; background: var(--focus); color: #fff; font-size: 12px; font-weight: 600; }

/* The picked photo's panel stays in view at the foot of the window, however
   far down the contact sheet the photo is. */
.inspector { position: sticky; bottom: calc(12px - var(--foot, 0px)); z-index: 6; display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 16px; margin-top: 12px; padding: 12px; max-height: min(460px, 70vh); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgb(0 0 0 / 0.18); }
.inspector-image img { width: 100%; max-height: 230px; object-fit: contain; display: block; border-radius: 3px; background: var(--soft); }
.inspector-body { display: grid; gap: 10px; align-content: start; }
.inspector-body p { margin: 0; }
.inspector-title { display: flex; align-items: center; justify-content: space-between; }
.buttons { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* MARK: Dialogs */

.overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / 0.35); }
.dialog { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; display: grid; gap: 14px; padding: 22px; background: var(--panel); border-radius: 12px; box-shadow: 0 20px 60px rgb(0 0 0 / 0.25); }
.dialog.wide { width: min(860px, 100%); }
.dialog h2 { margin: 0; font-size: 19px; }
.dialog p { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.where { padding: 8px 11px; border-radius: 7px; background: var(--soft); font-size: 14px; }
.where strong { font-size: 13px; }
.where.live { box-shadow: inset 3px 0 0 var(--good); }
.issues, .notes { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.changes { display: grid; gap: 8px; }
.change { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.change-head { width: 100%; border: 0; border-radius: 0; background: var(--soft); gap: 10px; }
.change-head .mono { overflow: hidden; text-overflow: ellipsis; }
.stat { font-size: 12px; font-family: ui-monospace, Menlo, monospace; }
.stat.add { color: var(--good); }
.stat.del { color: var(--bad); }
.diff { margin: 0; max-height: 46vh; overflow: auto; font: 12px/1.55 ui-monospace, "SF Mono", Menlo, monospace; padding: 6px 0; }
.diff .line { display: block; padding: 0 12px; white-space: pre; min-height: 1.55em; }
.diff .add { background: var(--add); }
.diff .del { background: var(--del); }
.diff .fold { color: var(--muted); background: var(--soft); }

.login { width: min(340px, 100%); display: grid; gap: 12px; }
.login h1 { margin: 0; font-size: 26px; }
.login p { margin: 0; }
.login .button { justify-content: center; padding: 9px 12px; }
.login .banner { margin: 0; }

/* MARK: Setting up */

.setup { width: min(560px, 100%); display: grid; gap: 14px; }
.setup h1 { margin: 0; font-size: 26px; }
.setup > p { margin: 0; }
.setup .banner { margin: 0; }
.steps { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 10px; counter-reset: step; }
.step { position: relative; display: grid; gap: 8px; padding: 14px 16px 16px 52px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); counter-increment: step; color: var(--muted); }
.step::before { content: counter(step); position: absolute; left: 16px; top: 14px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--muted); }
.step h2 { margin: 0; font-size: 16px; }
.step p { margin: 0; }
.step.current { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.step.current::before { background: var(--accent); color: var(--accent-ink); }
.step.done { color: var(--ink); }
.step.done::before { content: "✓"; background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.step .button.primary, .step button.primary { padding: 8px 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: min(620px, calc(100vw - 32px)); padding: 8px 8px 8px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); }
.toast.error { background: var(--bad); color: #fff; }
.toast-action { padding: 4px 12px; border: 0; background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; font-weight: 600; }
.toast-close { color: inherit; padding: 2px 8px; font-size: 17px; }

/* MARK: Small pieces */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hint { margin: 0 0 8px; font-size: 12.5px; }
.banner.subtle { background: var(--soft); }
button.link.inline { padding: 0; font-size: inherit; text-decoration: underline; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.segmented button { border: 0; border-radius: 0; padding: 5px 11px; }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.active { background: var(--soft); font-weight: 600; }
input.size { width: 110px; padding: 0; accent-color: var(--ink); }
.branch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.branch select { font: inherit; font-size: 13px; color: var(--ink); background: var(--soft); border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; max-width: 180px; }
.branch.fixed { padding: 3px 8px; background: var(--soft); border-radius: 6px; }
.settings-group { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.settings-group legend { font-weight: 600; margin-bottom: 6px; }
.settings-group p { margin: 0; }
.settings-heading { margin: 6px 0 -4px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.settings-heading:not(:first-of-type) { padding-top: 14px; border-top: 1px solid var(--line); }
.setting-form { display: grid; gap: 10px; }
.setting-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.how { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.copy { display: inline-flex; align-items: baseline; gap: 8px; max-width: 100%; vertical-align: baseline; }
.copy code { padding: 1px 6px; border-radius: 5px; background: var(--soft); overflow-wrap: anywhere; user-select: all; }
.inline-dot { display: inline-block; margin-right: 7px; vertical-align: 1px; }
button.link.inline.danger { color: var(--bad); }
.hidden-note { padding: 12px 8px 0; }

/* MARK: Files — the site's code */

.files-section header .muted { font-size: 12px; font-weight: 400; }
.files-note { padding: 4px 8px 8px; display: grid; gap: 8px; justify-items: start; }
.files-note p { margin: 0; }
.files-tree { display: grid; padding-bottom: 8px; }
.files-actions { display: flex; align-items: center; gap: 6px; padding: 0 8px 4px; }
.files-actions .link { padding: 2px 4px; font-size: 13px; }
.file-row { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; padding: 3px 8px 3px calc(8px + var(--depth, 0) * 14px); border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; font-size: 13px; text-decoration: none; text-align: left; line-height: 20px; }
.file-row:hover { background: var(--soft); }
.file-row.active { background: color-mix(in srgb, var(--focus) 14%, transparent); }
.file-row.folder { font-weight: 500; }
.file-row.folder .chevron { display: inline-block; width: 12px; font-size: 11px; color: var(--muted); transition: transform 0.15s; }
.file-row.folder[aria-expanded="false"] .chevron { transform: rotate(-90deg); }
.file-row.locked .file-name { color: var(--muted); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.file-row .pill { margin-left: auto; }
.file-view { display: grid; gap: 12px; max-width: 1100px; margin: 0 auto; }
.file-view h1 { font-size: 18px; margin: 8px 0 0; }
.file-view .banner { margin: 0; }
.file-path { overflow-wrap: anywhere; }
textarea.code { font: 12.5px/1.55 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre; overflow: auto; tab-size: 2; min-height: 320px; resize: vertical; }
textarea.code[readonly] { background: var(--soft); }
.code-note { padding: 10px 14px; border-radius: var(--radius); background: var(--soft); display: grid; gap: 6px; font-size: 14px; }
.code-note.ask { background: color-mix(in srgb, var(--focus) 12%, transparent); box-shadow: inset 3px 0 0 var(--focus); }
.code-note p { margin: 0; }
.address-input { display: flex; align-items: center; gap: 4px; }
.folder-setter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--soft); }
.folder-setter input { width: 200px; padding: 5px 8px; }
.dropzone:disabled { opacity: 0.5; cursor: default; }
.address-input .muted { font-size: 14px; white-space: nowrap; }

/* MARK: Photos — several picked, the list, replacing */

.bulk { position: sticky; bottom: calc(12px - var(--foot, 0px)); z-index: 6; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); }
.inspector-image { position: relative; border-radius: 4px; }
.inspector-image.replacing, .row-image.replacing { outline: 2.5px dashed var(--focus); outline-offset: 3px; }
.drop-note { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); text-align: center; }
.inspector-image.replacing .drop-note { color: var(--focus); font-weight: 600; }
.inspector-image .tile-status { border-radius: 0 0 3px 3px; }

.photo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.photo-row { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: start; padding: 8px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.photo-row.failed { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.row-image { position: relative; height: 96px; border-radius: 3px; overflow: hidden; background: var(--line); }
.row-image img { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--soft); }
.row-image .num { position: absolute; left: 5px; top: 3px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / 0.7); }
.row-image .badge.cover { top: auto; bottom: 5px; left: 5px; }
.row-body { display: grid; gap: 4px; margin: 0; min-width: 0; }
.row-body p { margin: 0; }
.row-body textarea { min-height: 56px; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; }
.row-actions button { padding: 3px 7px; font-size: 13px; }
.row-actions button.active { color: var(--warn); }
.row-actions button:disabled { opacity: 0.45; }

/* MARK: Small screens — one pane at a time */

@media (max-width: 820px) {
  :root { --row: 104px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .app.editing .sidebar { display: none; }
  .app:not(.editing) .main { display: none; }
  .back { display: inline-flex; }
  .hide-small { display: none; }
  .inspector { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; max-height: 62vh; }
  .inspector-image img { max-height: 120px; }
  .drop-note { display: none; }
  .photo-row { grid-template-columns: 88px minmax(0, 1fr); gap: 10px; }
  .row-image { height: 72px; }
  .branch select { max-width: 120px; }
  .branch > [aria-hidden] { display: none; }
  .topbar { gap: 8px; padding: 0 8px 0 12px; }
  .topbar button.link { padding: 6px 5px; }
  /* No room in the bar on a phone: the deploy status floats just under it. */
  .deploy { position: fixed; z-index: 30; top: 56px; left: 12px; right: 12px; justify-content: center; white-space: normal; box-shadow: 0 6px 18px rgb(0 0 0 / 0.18); }
  .setting-fields { grid-template-columns: 1fr; }
  .step { padding-left: 46px; }
  .step::before { left: 13px; }
  input.size { display: none; }
  .title-input { font-size: 23px; }
  .editor-head .crumbs .muted { display: none; }
}
