@charset "UTF-8";

/* ==================================================================
   PHURNISHINGS CONSOLE

   Layered on top of styles.css, so the staff console and the shop
   share one set of colour, type and spacing tokens. Nothing here
   redefines a token — it only adds the structures a management tool
   needs that a shop does not: a dense list, an inspector, a bulk
   action bar.

   The layout is the macOS three-pane pattern from the HIG: sidebar
   for navigation, list in the middle, inspector on the trailing edge.
   The list keeps its scroll position while the inspector is open, so
   editing twenty listings in a row never loses your place.
   ================================================================== */

:root {
  --inspector-w: 400px;
  --row-h: 56px;
}

.console-body { margin: 0; }

.console-app {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  transition: grid-template-columns 0.34s cubic-bezier(0.32, 0.72, 0, 1);
}
.console-app[data-sidebar="collapsed"] { grid-template-columns: 0 minmax(0, 1fr); }
.console-app[data-inspector="open"] { padding-right: var(--inspector-w); }

.console-main {
  flex: 1;
  min-width: 0;
  padding: 0 0 var(--sp-20);
}

.view { min-height: 40vh; }


/* ==================================================================
   SIGN IN
   ================================================================== */

.signin {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--sp-6);
  background: var(--bg-base);
}
.signin[hidden] { display: none; }

.signin-card {
  width: min(420px, 100%);
  padding: var(--sp-10);
  border: 1px solid var(--separator);
  border-radius: var(--r-2xl);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sheet);
}

.signin-badge {
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  background: var(--tint-quaternary);
  color: var(--tint);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  align-self: center;
}

.password-wrap { position: relative; }
.password-peek {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--label-tertiary);
  cursor: pointer;
}
.password-peek:hover { color: var(--label-primary); background: var(--fill-primary); }


/* ==================================================================
   SIDEBAR ADDITIONS
   ================================================================== */

.sidebar-foot {
  margin-top: auto;
  padding-top: var(--sp-4);
}
.console-app .sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-foot .sidebar-item { text-decoration: none; }

.whoami {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  border-top: 1px solid var(--separator);
}
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--tint);
  color: #fff;
  font: 600 12px/1 var(--font-text);
  letter-spacing: 0.02em;
}

.whoami-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.whoami-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Status dots. Colour is never the only signal — every status also
   carries a written label next to it. */
.dot {
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 1px;
}
.dot-live     { background: var(--success); }
.dot-draft    { background: var(--warning); }
.dot-archived { background: var(--label-quaternary); }


/* ==================================================================
   BULK ACTION BAR
   ================================================================== */

.bulkbar {
  position: sticky;
  top: var(--toolbar-h);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--gutter);
  border-bottom: 1px solid var(--separator);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
  transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
}
.bulkbar[data-open="true"] {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  height: auto;
  padding: var(--sp-2) var(--gutter);
}


/* ==================================================================
   LISTING TABLE
   A list, not a grid: staff scan by name and status, and a dense row
   fits far more on screen than a card would.
   ================================================================== */

.table-head,
.row {
  display: grid;
  grid-template-columns: 34px 52px minmax(160px, 2.4fr) 108px 96px 88px minmax(120px, 1fr) 96px;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--gutter);
}

.table-head {
  position: sticky;
  top: var(--toolbar-h);
  z-index: 20;
  height: 34px;
  border-bottom: 1px solid var(--separator);
  background: var(--bg-base);
  font: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--label-tertiary);
}
.bulkbar[data-open="true"] ~ .console-main .table-head { top: calc(var(--toolbar-h) + 44px); }

.row {
  min-height: var(--row-h);
  border-bottom: 1px solid var(--separator);
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease;
}
.row:hover { background: var(--fill-primary); }
.row[aria-selected="true"] { background: var(--tint-quaternary); }
.row:focus-visible { outline: 3px solid var(--tint); outline-offset: -3px; }

.row-thumb {
  width: 44px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--fill-primary);
  overflow: hidden;
}
.row-thumb svg { width: 88%; height: 88%; }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }

.row-name { min-width: 0; }
.row-title {
  margin: 0;
  font: var(--text-subhead);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-sub {
  margin: 0;
  font: var(--text-caption);
  color: var(--label-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-num { font-variant-numeric: tabular-nums; font-size: 14px; }
.row-muted { color: var(--label-secondary); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 3px var(--sp-3);
  border-radius: var(--r-full);
  background: var(--fill-primary);
  font: var(--text-caption);
  font-weight: 600;
  white-space: nowrap;
}
.pill-live     { background: rgba(27, 127, 59, 0.13); color: var(--success); }
.pill-draft    { background: rgba(154, 100, 0, 0.14); color: var(--warning); }
.pill-archived { background: var(--fill-secondary); color: var(--label-secondary); }

.row-actions { display: flex; gap: var(--sp-1); justify-content: flex-end; }
.row-actions .icon-btn { width: 30px; height: 30px; }

/* Checkbox styled to the system look rather than the browser default. */
.check {
  appearance: none;
  width: 17px; height: 17px;
  border: 1.5px solid var(--label-quaternary);
  border-radius: 4px;
  background: var(--bg-elevated);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.check:hover { border-color: var(--label-tertiary); }
.check:checked {
  background: var(--tint);
  border-color: var(--tint);
}
.check:checked::after {
  content: "";
  width: 10px; height: 10px;
  background: #fff;
  clip-path: polygon(14% 46%, 38% 70%, 86% 20%, 94% 30%, 38% 88%, 6% 56%);
}
.check:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; }

.stock-low { color: var(--danger); font-weight: 600; }


/* ==================================================================
   INSPECTOR
   ================================================================== */

.inspector {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 80;
  width: var(--inspector-w);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--separator);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sheet);
  transform: translateX(100%);
  transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
}
.inspector[data-open="true"] { transform: translateX(0); }

.inspector-inner {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.inspector-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--separator);
  background: var(--bg-elevated);
}
.inspector-head h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-body { padding: var(--sp-5); }

.inspector-art {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--fill-primary);
  margin-bottom: var(--sp-2);
  overflow: hidden;
}
.inspector-art svg { width: 74%; height: 74%; }
.inspector-art img { width: 100%; height: 100%; object-fit: cover; }

.inspector-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--separator);
  background: var(--bg-elevated);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }

.section-divider {
  margin: var(--sp-6) 0 0;
  padding-top: var(--sp-5);
  border-top: 1px solid var(--separator);
}

/* Shape picker — a small grid of the built-in illustrations. */
.shape-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.shape-option {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--separator);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.shape-option svg { width: 78%; height: 78%; }
.shape-option:hover { background: var(--fill-primary); }
.shape-option[aria-pressed="true"] {
  border-color: var(--tint);
  background: var(--tint-quaternary);
}

/* Toggle switch, for featured / new flags. */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--separator);
}
.switch {
  appearance: none;
  flex: none;
  width: 44px; height: 26px;
  border-radius: var(--r-full);
  background: var(--fill-tertiary);
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}
.switch:checked { background: var(--tint); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; }

.unsaved {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: rgba(154, 100, 0, 0.13);
  color: var(--warning);
  font: var(--text-footnote);
  font-weight: 500;
}
.unsaved[hidden] { display: none; }


/* ==================================================================
   PANELS — orders, staff, activity
   ================================================================== */

.panel { padding: var(--sp-8) var(--gutter) 0; max-width: 1100px; }
.panel-head { margin-bottom: var(--sp-5); }
.panel-head h2 { margin: 0 0 var(--sp-1); }
.panel-head p { margin: 0; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.stat {
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
}
.stat-value {
  display: block;
  font: var(--text-title-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.014em;
}
.stat-label {
  display: block;
  margin-top: 2px;
  font: var(--text-caption);
  color: var(--label-secondary);
}

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
  overflow: hidden;
}
.card-list > li {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--separator);
}
.card-list > li:last-child { border-bottom: none; }
.grow { flex: 1; min-width: 0; }

.order-lines {
  margin: var(--sp-1) 0 0;
  font: var(--text-caption);
  color: var(--label-tertiary);
}

.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--separator);
  font: var(--text-subhead);
}
.activity-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--label-quaternary);
  transform: translateY(-2px);
}
.activity-when {
  font: var(--text-caption);
  color: var(--label-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}


/* ==================================================================
   RESPONSIVE
   ================================================================== */

@media (max-width: 1180px) {
  .console-app[data-inspector="open"] { padding-right: 0; }
  .table-head, .row {
    grid-template-columns: 34px 52px minmax(140px, 2fr) 100px 88px 84px;
  }
  .col-updated, .col-actions { display: none; }
}

@media (max-width: 860px) {
  .console-app { grid-template-columns: minmax(0, 1fr); }
  .console-app[data-sidebar="collapsed"] { grid-template-columns: minmax(0, 1fr); }
  .console-app .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 95;
    width: 280px;
    transform: translateX(-100%);
    opacity: 1;
  }
  .console-app[data-sidebar="expanded"] .sidebar { transform: translateX(0); }

  .inspector { width: 100%; }

  .table-head { display: none; }
  .row {
    grid-template-columns: 34px 52px minmax(0, 1fr) auto;
    padding: var(--sp-3) var(--sp-4);
    row-gap: var(--sp-1);
  }
  .col-price, .col-stock { display: none; }
  .panel { padding-inline: var(--sp-4); }
}


/* Phones: the console's toolbar and bulk bar were clipping too. */
@media (max-width: 860px) {
  .console-app .toolbar { flex-wrap: wrap; row-gap: var(--sp-2); }
  .bulkbar { flex-wrap: wrap; row-gap: var(--sp-2); }
  .bulkbar .btn { flex: 1 1 auto; }
  .inspector-foot {
    flex-wrap: wrap;
    padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  }
  .inspector-foot .btn { flex: 1 1 100%; }
  .signin-card { padding: var(--sp-6); }
  .card-list > li { flex-wrap: wrap; row-gap: var(--sp-3); }
  .card-list > li .text-field { width: 100%; }
}

/* ==================================================================
   CALENDAR
   ================================================================== */

.panel-wide { max-width: 1400px; }

.cal-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--separator);
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.cal-head {
  padding: var(--sp-2);
  background: var(--bg-base);
  text-align: center;
  font: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--label-tertiary);
}

.cal-cell {
  min-height: 110px;
  padding: var(--sp-2);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.cal-blank { background: var(--bg-base); }
.cal-today { background: var(--tint-quaternary); }

.cal-daynum {
  align-self: flex-start;
  min-width: 26px; height: 26px;
  padding: 0 6px;
  border: none;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--label-secondary);
  font: var(--text-footnote);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.cal-daynum:hover { background: var(--tint); color: #fff; }
.cal-today .cal-daynum { font-weight: 700; color: var(--tint); }

.cal-events { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }

.cal-event {
  display: flex;
  align-items: baseline;
  gap: var(--sp-1);
  width: 100%;
  padding: 3px var(--sp-2);
  border: none;
  border-left: 3px solid currentColor;
  border-radius: var(--r-sm);
  background: var(--fill-primary);
  font: var(--text-caption);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.cal-event:hover { background: var(--fill-secondary); }
.cal-time { font-variant-numeric: tabular-nums; opacity: 0.7; flex: none; }
.cal-title {
  color: var(--label-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-done { opacity: 0.45; }
.cal-done .cal-title { text-decoration: line-through; }

/* One colour per kind, always paired with a written label. */
.cal-pickup      { color: #1F6FB2; }
.cal-delivery    { color: #2C7A4B; }
.cal-meeting     { color: #8A4FBF; }
.cal-restoration { color: #97682A; }
.cal-other       { color: var(--label-secondary); }

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
  font: var(--text-caption);
  color: var(--label-secondary);
}
.cal-key { display: inline-flex; align-items: center; gap: var(--sp-2); }
.cal-dot {
  width: 9px; height: 9px;
  border-radius: 2px;
  background: currentColor;
  flex: none;
}

.sheet-event {
  inset: 50% auto auto 50%;
  width: min(520px, calc(100vw - 40px));
  max-height: min(88vh, 800px);
  border-radius: var(--r-2xl);
  transform: translate(-50%, -46%) scale(0.97);
  opacity: 0;
  pointer-events: none;
}
.sheet-event[data-open="true"] {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.sheet-event .sheet-head { justify-content: flex-start; }

/* ==================================================================
   BOOKS
   ================================================================== */

.sheet-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font: var(--text-footnote);
}
.sheet-table th,
.sheet-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--separator);
  text-align: right;
  white-space: nowrap;
}
.sheet-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-base);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--label-tertiary);
}
.sheet-table .col-piece { text-align: left; min-width: 190px; }
.sheet-table .col-piece span { display: block; }
.sheet-table tbody tr:hover { background: var(--fill-primary); }

/* Computed columns are visibly not editable. */
.col-calc {
  background: var(--fill-primary);
  font-variant-numeric: tabular-nums;
  color: var(--label-secondary);
}
.num-good { color: var(--success); font-weight: 600; }
.num-bad  { color: var(--danger);  font-weight: 600; }

.book-input {
  width: 78px;
  padding: var(--sp-1) var(--sp-2);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--label-primary);
  font: var(--text-footnote);
  font-variant-numeric: tabular-nums;
  text-align: right;
  appearance: textfield;
}
.book-input::-webkit-outer-spin-button,
.book-input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.book-input:hover { border-color: var(--separator-opaque); }
.book-input:focus {
  border-color: var(--tint);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--tint-quaternary);
  outline: none;
}
.book-input[aria-invalid="true"] { border-color: var(--danger); }

.sheet-table tfoot td {
  border-top: 2px solid var(--separator-opaque);
  border-bottom: none;
  background: var(--bg-base);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
  .cal-cell { min-height: 74px; padding: 4px; }
  .cal-title { display: none; }
  .cal-event { justify-content: center; padding: 2px; }
  .cal-head { font-size: 10px; padding: var(--sp-1); }
  .sheet-event {
    inset: auto 0 0 0; width: 100%; max-height: 92dvh;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    transform: translateY(100%) scale(1); opacity: 1;
  }
  .sheet-event[data-open="true"] { transform: translateY(0) scale(1); }
}

/* Bottom line — the arithmetic laid out so it reads as a sum. */
.bottom-line {
  display: grid;
  gap: var(--sp-1);
  max-width: 420px;
  margin: 0 0 var(--sp-5);
  padding: var(--sp-5);
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
}
.bottom-line > div {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-5);
  font: var(--text-subhead);
}
.bl-label { color: var(--label-secondary); }
.bl-value { font-variant-numeric: tabular-nums; }
.bl-minus { color: var(--label-secondary); }
.bl-total {
  margin-top: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--separator-opaque);
  font: var(--text-headline) !important;
}
.bl-total .bl-label { color: var(--label-primary); }

.cat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.cat-chip {
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  background: var(--fill-primary);
  font: var(--text-caption);
  font-variant-numeric: tabular-nums;
  color: var(--label-secondary);
}
.cat-chip strong { color: var(--label-primary); font-weight: 600; }

.ledger-add {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  background: var(--fill-primary);
}
.ledger-add .text-field { width: auto; }
.ledger-add #lg-description { flex: 1; min-width: 180px; }

@media (max-width: 860px) {
  .ledger-add { flex-direction: column; }
  .ledger-add .text-field,
  .ledger-add .btn { width: 100% !important; }
}

/* ==================================================================
   PHOTOS
   ================================================================== */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--sp-2);
}

.photo-tile {
  position: relative;
  aspect-ratio: 1;
  margin: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--fill-primary);
  border: 1px solid var(--separator);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* The cover is the one customers see first, so it says so. */
.photo-cover { border-color: var(--tint); }
.photo-flag {
  position: absolute;
  top: 4px; left: 4px;
  padding: 1px 6px;
  border-radius: var(--r-full);
  background: var(--tint);
  color: #fff;
  font: 600 10px/1.6 var(--font-text);
  letter-spacing: 0.03em;
}

.photo-tools {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.14s ease;
}
.photo-tile:hover .photo-tools,
.photo-tile:focus-within .photo-tools { opacity: 1; }

/* A touch screen has no hover, so the controls stay visible there. */
@media (hover: none) {
  .photo-tools { opacity: 1; }
}

.photo-tools button {
  flex: 1;
  min-height: 26px;
  border: none;
  background: rgba(28, 22, 16, 0.72);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.photo-tools button:hover:not(:disabled) { background: rgba(28, 22, 16, 0.9); }
.photo-tools button:disabled { opacity: 0.3; cursor: default; }
.photo-remove:hover:not(:disabled) { background: var(--danger) !important; }

.photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  aspect-ratio: 1;
  border: 1.5px dashed var(--separator-opaque);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  color: var(--label-secondary);
  font: var(--text-caption);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.photo-add:hover {
  border-color: var(--tint);
  background: var(--tint-quaternary);
  color: var(--tint);
}
.photo-add svg { color: currentColor; }
.photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-add:focus-within { outline: 3px solid var(--tint); outline-offset: 2px; }

.photo-status {
  margin: var(--sp-3) 0 0;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  background: var(--fill-primary);
  color: var(--label-secondary);
}
.photo-status[hidden] { display: none; }

@media (max-width: 860px) {
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .photo-tools button { min-height: 34px; font-size: 17px; }
}
