:root { color-scheme: only light; --brand: #1f6feb; --danger: #d1242f; --ok: #1a7f37; }
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f5f7fb; color: #1c1e21;
}


.hidden { display: none !important; }

.center {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.card {
  background: #fff; padding: 28px 32px; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(20, 30, 60, 0.08); width: min(420px, 92vw);
}
h1 { margin: 0 0 18px; font-size: 1.4rem; }
h2 { margin: 0 0 12px; font-size: 1.1rem; }

label { display: block; margin: 12px 0 6px; font-size: 0.92rem; }
input[type="text"], input[type="password"], select {
  width: 100%; padding: 10px 12px; font-size: 1rem; border: 1px solid #d0d7de;
  border-radius: 8px; outline: none; background: #fff; color: inherit;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,0.2); }

.btn {
  padding: 9px 16px; font-size: 0.95rem; border: 0; border-radius: 8px;
  background: var(--brand); color: #fff; cursor: pointer;
}
.btn:hover:not(:disabled) { background: #1a5fd0; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.secondary { background: #6b7280; }
.btn.secondary:hover:not(:disabled) { background: #545a64; }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 10px; font-size: 0.85rem; }

.row { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }

.status { margin-top: 14px; min-height: 1.2em; font-size: 0.95rem; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

/* App shell */
.app-shell {
  background: #fff; min-height: 100vh; max-width: 1200px; margin: 0 auto;
  display: flex; flex-direction: column;
}
.app-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid #e3e6eb;
}
.app-header h1 { margin: 0; font-size: 1.1rem; }
.outlet-selector {
  font-size: 1.2rem; font-weight: 700; padding: 6px 12px;
  border: none; background: transparent; color: inherit;
  cursor: pointer; max-width: 280px;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center;
  padding-right: 24px;
}
.outlet-selector:focus { outline: 2px solid var(--brand); border-radius: 4px; }
.outlet-selector:disabled { opacity: 0.7; cursor: default; }
.app-header .who { font-size: 0.9rem; opacity: 0.8; }

.tabs {
  display: flex; gap: 4px; padding: 0 12px;
  border-bottom: 1px solid #e3e6eb;
}
.tab {
  padding: 10px 16px; cursor: pointer; border: 0; background: transparent;
  color: inherit; font-size: 0.95rem; border-bottom: 2px solid transparent;
}
.tab[aria-selected="true"] { border-bottom-color: var(--brand); color: var(--brand); font-weight: 600; }
.tab:hover { background: rgba(31,111,235,0.08); }

.tab-panel { padding: 20px; }
.tab-panel.empty { color: #6b7280; font-style: italic; }

/* Users table */
.users-toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.users-toolbar .info { font-size: 0.9rem; opacity: 0.75; }

.table-wrap { overflow-x: auto; border: 1px solid #e3e6eb; border-radius: 8px; }
table.users {
  width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 880px;
}
table.users th, table.users td {
  border-bottom: 1px solid #e3e6eb; padding: 8px 10px; text-align: left; vertical-align: middle;
}
table.users th {
  background: #f5f7fb; font-weight: 600; position: sticky; top: 0;
}
table.users td input, table.users td select {
  width: 100%; padding: 6px 8px; font-size: 0.9rem;
  border: 1px solid transparent; background: transparent; color: inherit; border-radius: 6px;
}
table.users td input:focus, table.users td select:focus {
  border-color: var(--brand); background: #fff;
}

table.users td.readonly { color: #6b7280; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }
table.users tr.removed { opacity: 0.4; text-decoration: line-through; }
table.users tr.dirty td { background: rgba(31,111,235,0.06); }


/* Permissions link in users table */
a.perm-link { color: var(--brand); text-decoration: none; cursor: pointer; }
a.perm-link:hover { text-decoration: underline; }

/* Status pill in users table */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 500;
  padding: 2px 8px; border-radius: 999px;
}
.status-pill.online  { color: var(--ok);     background: rgba(26,127,55,0.10); }
.status-pill.offline { color: #6b7280;        background: rgba(107,114,128,0.12); }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; flex: 0 0 auto;
}
.status-pill.online .status-dot { box-shadow: 0 0 0 3px rgba(26,127,55,0.18); }
.status-sub {
  display: block; font-size: 0.72rem; color: #6b7280; margin-top: 2px;
}

/* Products: search bar */
.p-search-bar {
  margin-bottom: 12px;
}
.p-search-bar input {
  width: 100%; padding: 9px 14px; font-size: 0.92rem;
  border: 1px solid #d0d7de; border-radius: 8px;
  background: #fff; color: inherit;
}
.p-search-bar input:focus {
  border-color: var(--brand); outline: none;
  box-shadow: 0 0 0 3px rgba(31,111,235,0.15);
}


/* Products: sortable column headers */
table.users th.sortable {
  cursor: pointer; user-select: none; white-space: nowrap;
}
table.users th.sortable:hover { color: var(--brand); }

/* Products: pagination */
.p-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 12px 0; font-size: 0.88rem;
}
.p-page-info { color: #6b7280; }

/* Logs: filter bar */
.log-filters {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center;
}
.log-filters input[type="text"],
.log-filters input[type="date"],
.log-filters select {
  padding: 8px 12px; font-size: 0.9rem;
  border: 1px solid #d0d7de; border-radius: 8px;
  background: #fff; color: inherit;
}
.log-filters input[type="text"] { flex: 1; min-width: 140px; }
.log-filters select { min-width: 120px; }
.log-filters input[type="date"] { min-width: 130px; }
.log-filters input:focus, .log-filters select:focus {
  border-color: var(--brand); outline: none;
  box-shadow: 0 0 0 3px rgba(31,111,235,0.15);
}


/* Logs: table tweaks */
.log-ts { white-space: nowrap; font-size: 0.84rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.log-summary { font-size: 0.88rem; }
.log-table-pill {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(31,111,235,0.10); color: var(--brand);
  text-transform: uppercase; letter-spacing: 0.03em;
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.modal {
  background: #fff; border-radius: 12px; width: min(560px, 100%);
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.modal-header, .modal-footer {
  display: flex; align-items: center; gap: 8px; padding: 14px 18px;
}
.modal-header { border-bottom: 1px solid #e3e6eb; }
.modal-header h2 { margin: 0; flex: 1; font-size: 1.05rem; }
.modal-footer { border-top: 1px solid #e3e6eb; }
.modal-body { padding: 18px; overflow-y: auto; }

.perms-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.perms-table th, .perms-table td { padding: 6px 4px; text-align: left; border: 0; }
.perms-table th { background: transparent; font-weight: 600; font-size: 0.85rem; color: #6b7280; }
.perms-table input {
  width: 100%; padding: 7px 10px; border: 1px solid #d0d7de; border-radius: 6px;
  background: #fff; color: inherit; font-size: 0.95rem;
}
.perms-table input:focus {
  border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(31,111,235,0.2);
}
.perms-table td:last-child { width: 1%; white-space: nowrap; }
.hint { font-size: 0.8rem; color: #6b7280; margin: 8px 0 0; }
.hint code { background: rgba(127,127,127,0.15); padding: 1px 4px; border-radius: 3px; }


/* ---- Outlet view ---- */
.outlet-view { padding: 0 12px 24px; }
.outlet-subtabs {
  display: flex; gap: 4px; padding: 8px 0;
  border-bottom: 2px solid #e3e6eb; margin-bottom: 12px;
}
.outlet-subtab {
  padding: 8px 18px; border: none; background: transparent;
  cursor: pointer; font-size: 0.95rem; font-weight: 500;
  color: #555; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color 0.15s, border-color 0.15s;
}
.outlet-subtab.active { color: var(--brand); border-bottom-color: var(--brand); }
.outlet-subtab:hover { color: var(--brand); }

.outlet-date-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0 12px; flex-wrap: wrap;
}
.outlet-date-bar .odb-group {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.outlet-date-bar label { font-weight: 500; font-size: 0.95rem; }
.outlet-date { padding: 4px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.95rem; }
.outlet-save-btn { margin-left: 4px; }
.outlet-save-status { font-size: 0.85rem; margin-left: 4px; }

.num-cell { text-align: right; font-variant-numeric: tabular-nums; }

.outlet-count-input {
  width: 80px; padding: 6px 8px; border: 1px solid transparent;
  border-radius: 6px; text-align: right; font-size: 0.9rem;
  background: transparent; color: inherit;
}
.outlet-count-input:focus {
  border-color: var(--brand); background: #fff; outline: none;
  box-shadow: 0 0 0 3px rgba(31,111,235,0.2);
}

.outlet-print-row {
  display: flex; justify-content: flex-end; padding: 12px 0 4px;
}

/* Dispatch matrix – sticky Item Name col + vertical store headers */
#dispatch-matrix-table { min-width: 0; }
#dispatch-matrix-table th:nth-child(1),
#dispatch-matrix-table td:nth-child(1) {
  position: sticky; left: 0; z-index: 2;
  background: var(--card-bg, #fff);
  min-width: 140px; max-width: 180px;
}
#dispatch-matrix-table th:nth-child(1) { z-index: 4; }

#dispatch-matrix-table th.dispatch-vhead {
  height: 140px; vertical-align: bottom; text-align: center;
  padding: 6px 2px; white-space: nowrap;
  width: 48px; min-width: 48px; max-width: 48px;
}
#dispatch-matrix-table th.dispatch-vhead span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: inline-block; line-height: 1.1;
}
#dispatch-matrix-table td.num-cell {
  width: 48px; min-width: 48px; max-width: 48px;
  padding: 4px 2px;
}
#dispatch-matrix-table .outlet-count-input {
  width: 40px; padding: 4px 4px; text-align: right;
}
#dispatch-matrix-table th.dispatch-total-head,
#dispatch-matrix-table td.dispatch-total-cell {
  width: 52px; min-width: 52px; max-width: 52px;
  font-weight: 600;
}
#dispatch-matrix-table th.dispatch-total-head { background: #e6eef9; }
#dispatch-matrix-table td.dispatch-total-cell { background: rgba(31,111,235,0.06); }

/* Outlet/Store view — force LIGHT styling regardless of OS dark mode preference.
   Shop floor staff need high-contrast black-on-white text; on Android with system
   dark mode the global dark-mode rules + OS-native form-control dark styling
   together rendered values barely visible. We opt this view out entirely. */
.outlet-view { color-scheme: only light; color: #1c1e21; }
.outlet-view .table-wrap { background: #fff; border-color: #e3e6eb !important; }
.outlet-view .table-wrap table.users { min-width: 0; background: #fff; }
.outlet-view table.users th {
  background: #f5f7fb !important; color: #1c1e21 !important;
  border-color: #e3e6eb !important;
}
.outlet-view table.users td {
  color: #1c1e21 !important; border-color: #e3e6eb !important;
}
.outlet-view .outlet-subtab { color: #555 !important; }
.outlet-view .outlet-subtab.active { color: var(--brand) !important; }
.outlet-view .outlet-subtabs { border-bottom-color: #e3e6eb !important; }
.outlet-view label,
.outlet-view .outlet-date-bar label { color: #1c1e21 !important; }
.outlet-view .outlet-date,
.outlet-view input,
.outlet-view select,
.outlet-view textarea {
  color-scheme: only light;
  background: #fff !important; color: #1c1e21 !important;
  border: 1px solid #d0d7de !important;
}
.outlet-view input::placeholder { color: #9ca3af; }
.outlet-view a.ov-correct,
.outlet-view a.ov-history { color: var(--brand) !important; }

/* Dispatched/Incoming/Return table — fixed column layout */
.dir-table { table-layout: fixed; width: 100%; }
.dir-table th.dir-name-col { width: 28%; min-width: 100px; }
.dir-table th.dir-num-col { width: 88px; min-width: 72px; max-width: 88px; }
.dir-table th.dir-comment-col { min-width: 120px; }
.dir-table .dir-num-input,
.dir-table .dir-comment-input {
  width: 100%; padding: 4px 6px; font-size: 0.9rem; border-radius: 4px;
}
.dir-table .dir-num-input { text-align: right; padding: 4px 4px; }
.dir-table .dir-num-input:focus,
.dir-table .dir-comment-input:focus {
  border-color: var(--brand) !important; outline: none;
  box-shadow: 0 0 0 2px rgba(31,111,235,0.2);
}

/* Mobile layout — shrink padding & column widths so the DIR table fits a
   phone width without horizontal scrolling. */
@media (max-width: 600px) {
  .outlet-view { padding: 0 6px 24px; }
  .outlet-view table.users th,
  .outlet-view table.users td { padding: 6px 4px; font-size: 0.85rem; }
  .dir-table th.dir-name-col { width: auto; min-width: 80px; }
  .dir-table th.dir-num-col { width: 56px; min-width: 48px; max-width: 60px; }
  .dir-table th.dir-comment-col { min-width: 80px; }
  .dir-table .dir-num-input { padding: 3px 2px; font-size: 0.85rem; }
  .dir-table .dir-comment-input { padding: 3px 4px; font-size: 0.85rem; }
}

/* Bellagio Kitchen */
.bk-sync-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; margin-bottom: 10px;
  background: rgba(31,111,235,0.06); border: 1px solid rgba(31,111,235,0.18);
  border-radius: 8px; font-size: 0.88rem;
}
.bk-sync-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.bk-sync-dot.ok   { background: var(--ok); box-shadow: 0 0 0 3px rgba(26,127,55,0.18); }
.bk-sync-dot.warn { background: #d97706; box-shadow: 0 0 0 3px rgba(217,119,6,0.18); }

.bk-empty {
  padding: 28px 12px; text-align: center; color: #6b7280;
  background: rgba(0,0,0,0.02); border: 1px dashed #cbd5e1; border-radius: 8px;
}

.bk-tag {
  display: inline-block; font-size: 0.75rem;
  padding: 1px 7px; margin: 1px 3px 1px 0;
  background: rgba(31,111,235,0.10); color: var(--brand);
  border-radius: 999px; white-space: nowrap;
}

.bk-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: capitalize; }
.bk-badge-ok     { background: rgba(26,127,55,0.12);  color: var(--ok); }
.bk-badge-warn   { background: rgba(217,119,6,0.14);  color: #b45309; }
.bk-badge-danger { background: rgba(209,36,47,0.12);  color: var(--danger); }
.bk-badge-info   { background: rgba(31,111,235,0.10); color: var(--brand); }
.bk-badge-muted  { background: rgba(107,114,128,0.12); color: #6b7280; }

.bk-icon-btn {
  background: transparent; border: 1px solid transparent; cursor: pointer;
  font-size: 1rem; padding: 2px 6px; border-radius: 6px; line-height: 1;
}
.bk-icon-btn:hover { background: rgba(31,111,235,0.08); border-color: rgba(31,111,235,0.18); }
.bk-icon-btn.bk-msg-on, .bk-icon-btn.bk-track-on { background: rgba(26,127,55,0.10); }
.bk-icon-btn sup { font-size: 0.65rem; color: var(--ok); margin-left: 2px; }

/* Prepare tab: rows for orders already shipped are read-only and grayed out. */
tr.bk-row-shipped > td { background: #f3f4f6; color: #6b7280; }
tr.bk-row-shipped > td strong { color: #6b7280; font-weight: 500; }
.bk-shipped-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(107,114,128,0.12); color: #4b5563;
  font-size: 0.78rem; font-weight: 600; cursor: default;
}
/* Cancelled rows: red-tinted gray, read-only. Takes precedence over shipped. */
tr.bk-row-cancelled > td { background: #fef2f2; color: #9ca3af; text-decoration: line-through; }
tr.bk-row-cancelled > td strong { color: #9ca3af; font-weight: 500; }
.bk-cancelled-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(220,38,38,0.10); color: #b91c1c;
  font-size: 0.78rem; font-weight: 600; cursor: default; text-decoration: none;
}
.bk-cancel-reason {
  margin-top: 3px; font-size: 0.75rem; color: #6b7280;
  text-decoration: none; max-width: 130px; word-wrap: break-word; line-height: 1.3;
}

table.users.bk-table { min-width: 1100px; font-size: 0.86rem; }
table.users.bk-table td.bk-items-cell { max-width: 280px; font-size: 0.82rem; line-height: 1.35; }
table.users.bk-table td.bk-cake-msg {
  max-width: 220px; font-style: italic; color: #b45309;
  white-space: pre-wrap; word-wrap: break-word; line-height: 1.35;
}

/* Instructions column — chef brief with inline more/less expand */
table.users.bk-table td.bk-instructions-cell {
  max-width: 300px; min-width: 180px;
  white-space: pre-wrap; word-wrap: break-word; line-height: 1.4;
  vertical-align: top;
}
.bk-instr-text { font-size: 0.88rem; }
.bk-instr-more {
  display: inline-block; margin-left: 4px; font-size: 0.78rem;
  color: var(--brand); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.bk-instr-more:hover { text-decoration: underline; }
.bk-instr-edit { vertical-align: middle; }
/* Expanded message thread inside the Instructions cell. Older messages are
   dimmed so the latest one (the chef's active brief) reads as primary. */
.bk-instr-expanded { display: block; }
.bk-instr-msg { padding: 4px 0; border-top: 1px dashed #e3e6eb; }
.bk-instr-msg:first-child { border-top: 0; padding-top: 0; }
.bk-instr-msg-meta { font-size: 0.72rem; color: #888; margin-bottom: 2px; }
.bk-instr-msg-body { color: #555; }
.bk-instr-msg-latest .bk-instr-msg-body { color: #111827; font-weight: 500; }

/* Cake message admin-override styling. Blue text + small "edited" tooltip
   makes it visually obvious to the chef that the brief came from management,
   not from the customer's Shopify input. */
.bk-cake-admin { color: #1d4ed8; font-weight: 600; }
.bk-cake-edit { vertical-align: middle; margin-left: 4px; }


/* Kitchen ticket print button on the To Prepare table. Compact icon-only
   button so the trailing column stays narrow. */
.bk-print-btn {
  background: transparent; border: 1px solid #d0d7de; border-radius: 4px;
  padding: 2px 6px; cursor: pointer; font-size: 1rem; line-height: 1.2;
}
.bk-print-btn:hover { background: #f5f7fb; border-color: var(--brand); }

/* Bulk-print button at the top of the To Prepare tab. Prints every unprinted
   token for the selected delivery date in one job (one thermal-roll cut per
   token). Disabled state hides the count, matching disabled buttons elsewhere. */
.bk-bulk-print-btn {
  background: var(--brand, #1f6feb); color: #fff; border: 1px solid var(--brand, #1f6feb);
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font-weight: 600;
  font-size: 0.92rem; margin-left: 8px;
}
.bk-bulk-print-btn:hover:not(:disabled) { filter: brightness(1.08); }
.bk-bulk-print-btn:disabled { opacity: 0.55; cursor: default; }

/* Reset-prints link next to the bulk-print button. Subtle text link so it
   doesn't compete with the primary action; only shown after at least one
   token in the loaded set has been printed. */
.bk-reset-link {
  margin-left: 8px; font-size: 0.85rem; color: #6b7280; text-decoration: underline;
  text-decoration-style: dotted; text-underline-offset: 2px; cursor: pointer;
}
.bk-reset-link:hover { color: #b45309; }


/* Bold-text mode for daylight readability (Prepare / In Transit tabs).
   Skips already-dimmed rows so cancelled / shipped orders remain visually
   distinct. */
table.users.bk-table.bk-bold tr:not(.bk-row-cancelled):not(.bk-row-shipped) > td {
  color: #111827; font-weight: 600;
}
table.users.bk-table.bk-bold tr:not(.bk-row-cancelled):not(.bk-row-shipped) > td small { color: #4b5563; font-weight: 500; }



/* Mobile layout — tighten admin tables (Users, Products, Inventory, Logs…)
   so cells aren't oversized and the toolbar buttons wrap cleanly. */
@media (max-width: 600px) {
  .app-shell { padding: 8px; }
  .app-header { flex-wrap: wrap; gap: 6px; }
  .users-toolbar { gap: 6px; }
  .users-toolbar .btn { padding: 6px 10px; font-size: 0.85rem; }
  table.users { font-size: 0.82rem; }
  table.users th, table.users td { padding: 5px 4px; }
  table.users td input, table.users td select {
    padding: 4px 4px; font-size: 0.82rem;
  }
  .tab { padding: 8px 10px; font-size: 0.85rem; }
}


/* Site Status sub-tab — daily attendance / equipment / temperature tracking */
.site-status { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 24px; }
.ss-section {
  border: 1px solid #e3e6eb; border-radius: 8px; padding: 10px 12px;
  background: #fff;
}
.ss-section-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.ss-section-header h3 {
  margin: 0; font-size: 1rem; flex: 1; color: #1c1e21;
}
.ss-count { font-weight: 400; color: #6b7280; font-size: 0.88rem; }
.ss-add-btn { white-space: nowrap; }
.ss-today { font-size: 0.95rem; color: #1c1e21; }

.ss-photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.ss-photo {
  position: relative; display: block; border: 1px solid #e3e6eb;
  border-radius: 6px; overflow: hidden; aspect-ratio: 1 / 1;
  background: #f5f7fb; text-decoration: none;
}
.ss-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ss-photo-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 0.7rem;
  padding: 2px 4px; line-height: 1.15; text-align: center;
}
.ss-empty { color: #6b7280; font-size: 0.88rem; margin: 4px 0; }

.ss-temp-form {
  display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap;
}
.ss-temp-form input {
  padding: 6px 8px; border: 1px solid #d0d7de; border-radius: 4px;
  background: #fff; color: #1c1e21; font-size: 0.9rem;
}
.ss-temp-form .ss-temp-label { flex: 1; min-width: 140px; }
.ss-temp-form .ss-temp-value { width: 100px; }
.ss-temp-table { min-width: 0; }

@media (max-width: 600px) {
  .ss-section { padding: 8px; }
  .ss-section-header h3 { font-size: 0.95rem; }
  .ss-photo-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px; }
  .ss-temp-form .ss-temp-label { width: 100%; flex: none; }
  .ss-temp-form .ss-temp-value { width: 100%; }
  .ss-temp-form .btn { width: 100%; }
}
