:root {
  --bg: #f5f1ea;
  --bg-card: #faf8f3;
  --bg-muted: #ebe6db;
  --ink: #1a1f1c;
  --ink-soft: #2f3a33;
  --ink-muted: #5e6e63;
  --accent: #264034;
  --accent-soft: #5a8a5e;
  --warn: #b9923e;
  --good: #5a8a5e;
  --gold: #8c7342;
  --sand: #6d6559;
  --line: #cdcaba;
  --line-soft: #e2ddd3;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(90,138,94,0.10), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(90,138,94,0.07), transparent 50%);
}
.serif { font-family: 'Cormorant Garamond', Georgia, serif; }

header {
  background: rgba(245,241,234,0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--ink);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(205,202,186,0.45);
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 18px 44px rgba(0,0,0,0.04);
}
.brand { display: flex; align-items: center; }
.brand-lockup { display: flex; flex-direction: column; gap: 2px; }
.header-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--ink);
  line-height: 1;
  text-transform: uppercase;
}
.header-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
}
.mode-toggle {
  display: flex;
  background: rgba(26,31,28,0.07);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.mode-toggle button {
  background: transparent;
  color: var(--ink-muted);
  border: none;
  padding: 7px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.mode-toggle button.active {
  background: var(--ink);
  color: var(--bg);
}
.mode-toggle button:hover:not(.active) { color: var(--ink); }

main { padding: 32px 28px 80px; max-width: 1400px; margin: 0 auto; }

.unit-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  gap: 20px;
  flex-wrap: wrap;
}
.unit-grid-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 36px;
  letter-spacing: -0.02em;
}
.unit-grid-header h2 em { color: var(--accent); font-style: italic; }
.search-box { position: relative; }
.search-box input {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 10px 16px 10px 38px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  width: 220px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.search-box input:focus { border-color: var(--accent); }
.search-box::before {
  content: "⌕";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  font-size: 16px;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.unit-card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}
.unit-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px -10px rgba(0,0,0,0.15);
}
.unit-card .num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.unit-card .design-pill {
  display: inline-block;
  background: var(--bg-muted);
  color: var(--ink-soft);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 12px;
}
.unit-card .design-pill.d1 { background: #e7d9c4; color: #6b4f2a; }
.unit-card .design-pill.d2 { background: #c9d8d0; color: #2e4a3a; }
.unit-card .design-pill.d3 { background: #d8d4e3; color: #443e6b; }
.unit-card .design-pill.d4 { background: #e3cfcf; color: #6b3a3a; }
.unit-card .design-pill.d5 { background: #d6dde8; color: #2c4870; }
.unit-card .status-row { display: flex; gap: 6px; font-size: 10px; }
.status-chip {
  flex: 1;
  text-align: center;
  padding: 5px 4px;
  border-radius: 6px;
  background: var(--bg-muted);
  color: var(--ink-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-chip.done { background: var(--good); color: white; }
.unit-card .note-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}

.detail-view { display: none; }
.detail-view.active { display: block; }
.unit-grid-view.hidden { display: none; }

.back-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--ink); }

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.detail-head .left .unit-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.detail-head .left .unit-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}
.detail-head .right { text-align: right; }
.detail-head .design-tag {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--accent);
}
.detail-head .design-tag-num { font-weight: 600; }

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.section {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 22px;
}
.section h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.field { margin-bottom: 14px; position: relative; }
.field:last-child { margin-bottom: 0; }
.field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 4px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.field-thumb {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: zoom-in;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.field-thumb:hover { transform: scale(1.12); }
.field-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.field-value.empty { color: var(--ink-muted); font-style: italic; font-weight: 400; }
.finish-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.swatch-gold { background: #c9a55b; }
.swatch-black { background: #2a2a2a; }
.swatch-nickel { background: #b8b8b0; }

.photo-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: zoom-in;
  margin-left: auto;
  transition: transform 0.15s;
}
.photo-thumb:hover { transform: scale(1.1); }

.tile-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  font-size: 13px;
}
.tile-list .tile-area { color: var(--ink-muted); }
.tile-list .tile-name { font-weight: 500; }
.tile-list .tile-sqft { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* Tile package — 2-sub-row layout per area */
.tile-list-new {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  margin-top: 10px;
}
.tile-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tile-row-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.tile-area-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  font-weight: 500;
}
.tile-name-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-weight: 500;
}
.tile-name-cell .tile-name { font-weight: 500; }
.tile-sqft-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  flex-shrink: 0;
}
.tile-sqft {
  color: var(--ink-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tile-thumb {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: zoom-in;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.tile-thumb:hover { transform: scale(1.12); }
.custom-badge {
  display: inline-block;
  background: #b8883a;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.tile-override-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}
.tile-override-select {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.15s;
  flex: 1;
  min-width: 0;
}
.tile-override-select:focus { border-color: var(--accent); background: white; }

.notes-section {
  background: #fdf6e8;
  border: 1px solid #e8d9b8;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 24px;
}
.notes-section h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #8a6a2a;
  margin-bottom: 12px;
}
.notes-section .note-text {
  font-size: 15px;
  line-height: 1.5;
  color: #5a4520;
}

.status-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}
.status-tile {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.status-tile .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  font-weight: 500;
}
.status-tile .state {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--ink-muted);
}
.status-tile .state.done { background: var(--good); color: white; }

.editable input, .editable select, .editable textarea {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
.editable input:focus, .editable select:focus, .editable textarea:focus {
  border-color: var(--accent);
  background: white;
}
.editable textarea { min-height: 70px; resize: vertical; font-size: 14px; }
.editable .field-value { display: none; }
.editable .field-input { display: block; }
.field-input { display: none; }
.status-toggle { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.status-toggle button {
  flex: 1;
  min-width: 80px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  cursor: pointer;
}
.status-toggle button.active { background: var(--good); color: white; border-color: var(--good); }
.editable .status-tile .state { display: none; }
.editable .status-tile .status-toggle-wrap { display: block; flex:1; }
.status-toggle-wrap { display: none; }

.save-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.4);
  transition: transform 0.3s cubic-bezier(.2,.9,.3,1.2);
  z-index: 100;
}
.save-banner.show { transform: translateX(-50%) translateY(0); }
.save-banner.error { background: #8a3a2a; }
.save-banner .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--good);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.save-banner.error .dot { background: #ff9a8a; }

.mode-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-left: 8px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,31,28,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
}
.modal h3 {
  font-size: 24px;
  margin-bottom: 8px;
}
.modal p {
  color: var(--ink-soft);
  margin-bottom: 18px;
  font-size: 14px;
}
.modal input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  outline: none;
}
.modal input:focus { border-color: var(--accent); }
.modal-error {
  color: #a44;
  font-size: 13px;
  min-height: 18px;
  margin-top: 8px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
.btn-primary, .btn-secondary {
  padding: 10px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  letter-spacing: 0.04em;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); }
.btn-secondary { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-secondary:hover { background: var(--bg-muted); }

#photo-modal { cursor: zoom-out; }
#photo-modal img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.5);
}

/* ===== PHASE SELECTOR ===== */
.phase-select-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  text-align: center;
}
.phase-select-wrap > h2 {
  font-weight: 400;
  font-size: 36px;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
}
.phase-select-wrap > h2 em { color: var(--accent); font-style: italic; }
.phase-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.phase-card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 40px 56px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-width: 190px;
}
.phase-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px -12px rgba(0,0,0,0.18);
}
.phase-card .phase-num {
  font-size: 80px;
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.phase-card .phase-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
  font-weight: 500;
  margin-bottom: 6px;
}
.phase-card .phase-meta {
  font-size: 13px;
  color: var(--ink-soft);
}
.phase-card.phase-coming { opacity: 0.55; }
.phase-card.phase-coming:hover {
  transform: translateY(-1px);
  border-color: var(--line);
  box-shadow: 0 4px 16px -8px rgba(0,0,0,0.1);
}
.grid-empty {
  padding: 80px 20px;
  text-align: center;
  color: var(--ink-muted);
}
.grid-empty p { font-size: 22px; font-style: italic; }

/* ===== FIN-001: TRADE-SPECIFIC VIEW FILTER ===== */
.trade-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.trade-tab {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.trade-tab:hover { border-color: var(--accent-soft); color: var(--ink); }
.trade-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
/* Empty-state note shown when a trade view has no recorded selections. */
.section-empty {
  color: var(--ink-muted);
  font-size: 13px;
  font-style: italic;
  padding: 8px 0 4px;
  margin: 0;
}
@media (max-width: 640px) {
  /* Keep the filter on one horizontally-scrollable row on narrow phones. */
  .trade-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .trade-filter::-webkit-scrollbar { display: none; }
  .trade-tab { flex: 0 0 auto; }
}

/* ===== V2 ACCORDION ===== */
.v2-sections { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.accordion-section {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
}
.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
}
.accordion-header:hover { background: var(--bg-muted); }
.accordion-section.expanded .accordion-header { border-bottom-color: var(--line-soft); }
.accordion-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  margin: 0; padding: 0; border: none;
}
.accordion-chevron {
  font-size: 9px;
  color: var(--ink-muted);
  transition: transform 0.2s;
}
.accordion-section.expanded .accordion-chevron { transform: rotate(90deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.accordion-section.expanded .accordion-body { max-height: 3000px; }
.accordion-body-inner { padding: 4px 22px 18px; }

/* ===== V2 STATUS ROW ===== */
.v2-status-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.v2-status-chip {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.v2-status-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.v2-status-chip.status-done { background: var(--good); border-color: var(--good); }
.v2-status-chip.status-active { background: #e8f0e8; border-color: var(--accent-soft); }
.v2-status-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 3px;
  font-weight: 500;
}
.v2-status-val { display: block; font-size: 11px; font-weight: 600; color: var(--ink); }
.v2-status-chip.status-done .v2-status-label,
.v2-status-chip.status-done .v2-status-val { color: white; }
.v2-status-chip.status-active .v2-status-val { color: var(--accent); }
@media (max-width: 640px) {
  .v2-status-row { grid-template-columns: repeat(3, 1fr); }
}

/* ===== V2 FIELD ROWS ===== */
.v2-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.v2-field-row:last-child { border-bottom: none; }
.v2-field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 120px;
}
.v2-field-value {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}
.v2-field-val {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.v2-field-val.empty { color: var(--ink-muted); font-style: italic; font-weight: 400; }
.reset-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-muted);
  transition: all 0.15s;
  flex-shrink: 0;
}
.reset-btn:hover { border-color: var(--warn); color: var(--warn); }

/* ===== PHOTO CAM ICON + TOOLTIP ===== */
.photo-cam {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 5px;
  border-radius: 4px;
  background: var(--bg-muted);
  cursor: zoom-in;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
  vertical-align: middle;
}
.photo-cam::after {
  content: '';
  display: block;
  width: 11px;
  height: 11px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a5f55' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E") no-repeat center/contain;
}
.photo-cam:hover {
  background: var(--accent);
  transform: scale(1.15);
}
.photo-cam:hover::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E");
}

#photo-tooltip {
  position: fixed;
  z-index: 150;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 28px -6px rgba(0,0,0,0.22);
  padding: 8px;
  width: 216px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s;
}
#photo-tooltip.visible {
  opacity: 1;
  visibility: visible;
}
#photo-tooltip img {
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: var(--bg-muted);
}
.photo-tooltip-name {
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  header { padding: 14px 18px; }
  main { padding: 24px 18px 60px; }
  .brand h1 { font-size: 18px; }
  .brand .sub { display: none; }
  .unit-grid-header h2 { font-size: 26px; }
  .detail-head .left .unit-num { font-size: 42px; }
  .search-box input { width: 100%; }
  .search-box { width: 100%; }
  .unit-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .unit-card { padding: 14px; }
  .unit-card .num { font-size: 22px; }
}
