/* ============================================================
   Hamilton Residency PMS
   Tally-inspired professional theme
   Complete consolidated stylesheet
   ============================================================ */

/* ---------- Reset & variables ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #12335c;
  --navy-dark:   #0b2340;
  --navy-light:  #1e4b82;
  --accent:      #f5a623;
  --bg:          #eef2f7;
  --card:        #ffffff;
  --line:        #d8e0ea;
  --text:        #1c2b3a;
  --muted:       #66768a;
  --green:       #1d8a4c;
  --red:         #c0392b;
  --amber:       #d98c00;
  --shadow:      0 2px 6px rgba(18, 51, 92, .08);
}

html, body { height: 100%; }

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

/* ============================================================
   Shell layout
   ============================================================ */
.shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
}

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  flex: 0 0 58px;
  height: 58px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  position: relative;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff;
}

.brand-sub { font-size: 11px; color: #c8d5e6; margin-top: 1px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.user-chip {
  background: rgba(255, 255, 255, .12);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip .role {
  font-size: 10px;
  background: var(--accent);
  color: #3a2a00;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.btn-sm {
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .22);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  line-height: 1.4;
}

.btn-sm:hover { background: rgba(255, 255, 255, .28); }
.btn-sm.danger { background: #b93b30; }
.btn-sm.danger:hover { background: #962d24; }
.btn-sm.ok { background: var(--green); }
.btn-sm.ok:hover { background: #166b3a; }
.btn-sm.light {
  background: #eaf1fa;
  color: var(--navy);
  border: 1px solid #cddff1;
}
.btn-sm.light:hover { background: #dbe8f7; }

.badge-count {
  background: var(--accent);
  color: #3a2a00;
  font-weight: 700;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

.logo-img {
  height: 42px;
  width: auto;
  max-width: 180px;
  margin-right: 12px;
  vertical-align: middle;
  display: inline-block;
}

/* ============================================================
   Body row — sidebar + main
   ============================================================ */
.body-row {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  width: 225px;
  flex: 0 0 225px;
  background: var(--navy-dark);
  padding: 14px 0;
  height: 100%;
  overflow-y: auto;
}

.sidebar nav a {
  display: block;
  padding: 10px 20px;
  color: #cfd8e3;
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: .15s;
}

.sidebar nav a:hover { background: var(--navy-light); color: #fff; }

.sidebar nav a.active {
  background: var(--navy-light);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   Main content
   ============================================================ */
.main {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  padding: 22px 30px;
}

.main h1 {
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--card);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.card h3 {
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.card-head h3 { margin: 0; }

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ============================================================
   Grid & stat tiles
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat {
  background: var(--card);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  border-left: 5px solid var(--navy);
}

.stat .lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 600;
}

.stat .val {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--navy);
}

.stat.green { border-left-color: var(--green); }
.stat.green .val { color: var(--green); }
.stat.red { border-left-color: var(--red); }
.stat.red .val { color: var(--red); }
.stat.orange { border-left-color: var(--amber); }
.stat.orange .val { color: var(--amber); }

/* ============================================================
   Tables
   ============================================================ */
table { width: 100%; border-collapse: collapse; font-size: 13px; }

th, td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: #f4f7fb;
  font-weight: 700;
  color: var(--navy);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--navy);
}

tr:hover td { background: #f8fbff; }

tr.total td {
  background: #eaf1fa;
  border-top: 2px solid var(--navy);
  font-weight: 600;
}

td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; }
td.actions > * { margin-right: 4px; }

.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #eef6ff; transition: background .15s; }

/* ============================================================
   Forms
   ============================================================ */
label {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  margin: 4px 0 3px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  margin-bottom: 8px;
  background: #fff;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(18, 51, 92, .12);
}

input[type="checkbox"] { width: auto; margin: 0; }
textarea { resize: vertical; }

.row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.row > div { flex: 1 1 180px; min-width: 0; }
.row > div.btn-col { flex: 0 0 auto; }

.btn-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  align-items: center;
}

.search { max-width: 280px; }

/* ============================================================
   Buttons
   ============================================================ */
button, .btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: .15s;
  text-decoration: none;
  display: inline-block;
  line-height: 1.4;
}

button:hover, .btn:hover { background: var(--navy-dark); }
button.primary { background: var(--navy); }
button.primary:hover { background: var(--navy-dark); }
button.sec { background: #7a8798; }
button.sec:hover { background: #5e6a7c; }
button.danger { background: var(--red); }
button.danger:hover { background: #962d24; }
button.ok { background: var(--green); }
button.ok:hover { background: #166b3a; }
button.sm { padding: 5px 10px; font-size: 11.5px; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
}

.badge.paid    { background: #d5f2df; color: #0f5c2f; }
.badge.due     { background: #fbe0dd; color: #8d1f16; }
.badge.partial { background: #fdeec9; color: #7a5400; }
.badge.neutral { background: #e6ecf3; color: #3a4a5e; }
.badge.demand  { background: var(--accent); color: #3a2a00; margin-right: 6px; }

/* ============================================================
   Flash messages
   ============================================================ */
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  background: #d5f2df;
  color: #0f5c2f;
  border-left: 4px solid var(--green);
}

.flash.error {
  background: #fbe0dd;
  color: #8d1f16;
  border-left-color: var(--red);
}

/* ============================================================
   Chip (apartment number)
   ============================================================ */
.apt-chip {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 5px;
  letter-spacing: .4px;
}

/* ============================================================
   Login page
   ============================================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 20% 20%, rgba(245, 166, 35, .10) 0, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, .07) 0, transparent 45%),
    linear-gradient(135deg, var(--navy-dark), var(--navy-light));
}

.login-box {
  background: #fff;
  padding: 38px 34px;
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  border-top: 5px solid var(--accent);
  text-align: center;
}

.login-brand h1 { color: var(--navy); font-size: 20px; margin-bottom: 4px; }
.login-brand p { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }

.logo-login {
  display: block;
  height: 90px;
  width: auto;
  max-width: 220px;
  margin: 0 auto 14px;
}

.login-box form { text-align: left; margin-top: 18px; }
.login-box form button { width: 100%; padding: 11px; font-size: 14px; }

/* ============================================================
   Two-column layouts
   ============================================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
}
.two-col > .card { min-width: 0; }

@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ============================================================
   Messages
   ============================================================ */
.msg-list { max-height: 560px; overflow-y: auto; }

.msg-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.msg-item:hover { background: #f6faff; }
.msg-item.unread { background: #e8f1fb; font-weight: 600; }

.msg-item .meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 400;
}

.msg-body {
  background: #f7f9fc;
  padding: 14px;
  border-radius: 8px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  word-wrap: break-word;
}

/* ============================================================
   Inactive rows
   ============================================================ */
.row-reversed td {
  background: #fbf3f3;
  color: #88514d;
  text-decoration: line-through;
  text-decoration-color: rgba(180, 60, 60, .45);
}
.row-reversed td .badge,
.row-reversed td a,
.row-reversed td form,
.row-reversed td input { text-decoration: none; }

/* ============================================================
   Statement header
   ============================================================ */
.stmt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 2px solid var(--navy);
  padding-bottom: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.stmt-title { font-size: 20px; font-weight: 800; color: var(--navy); letter-spacing: .3px; }
.stmt-sub { font-size: 11.5px; color: var(--muted); }
.stmt-meta { text-align: right; font-size: 12px; color: var(--text); line-height: 1.5; }
.stmt-meta b { color: var(--navy); }

/* ============================================================
   REPORT HEADER — logo on top
   ============================================================ */
.report-title-block {
  display: block;
  text-align: center;
  border-bottom: 2px solid var(--navy);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.report-logo {
  display: block !important;
  height: 72px !important;
  width: auto !important;
  max-height: 72px !important;
  max-width: 220px !important;
  margin: 0 auto 10px auto !important;
  object-fit: contain;
}

.report-headings { display: block; text-align: center; }

.report-property {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.15;
}
.report-manager { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.report-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.report-period { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr.total td {
  background: #eaf1fa;
  border-top: 2px solid var(--navy);
  font-weight: 700;
}

/* ============================================================
   KPI band
   ============================================================ */
.kpi-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--navy);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #eaf1fa;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 700;
  margin-bottom: 3px;
}
.kpi-value { font-size: 20px; font-weight: 700; color: var(--navy); line-height: 1.15; }
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ============================================================
   MARKETPLACE
   ============================================================ */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.market-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}

.market-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(18, 51, 92, .14);
}

.market-photo {
  height: 150px;
  width: 100%;
  background: #f4f7fb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.market-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  max-width: 100%;
  max-height: 150px;
}

.market-photo-placeholder {
  font-size: 42px;
  color: #c8d5e6;
}
.market-photo-placeholder.big { font-size: 96px; }

.market-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.market-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  line-height: 1.3;
  min-height: 36px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.market-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 6px;
}

.market-meta,
.market-seller { line-height: 1.4; }

.market-detail {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .market-detail { grid-template-columns: 1fr; }
}

.market-photo-large {
  height: 320px;
  width: 100%;
  background: #f4f7fb;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
}
.market-photo-large img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  max-width: 100%;
  max-height: 320px;
}

/* ============================================================
   COMMUNITY BOARD
   ============================================================ */
.board-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.board-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}

.board-item:hover {
  background: #f8fbff;
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(18, 51, 92, .08);
}

.board-item-left {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 90px;
}
.board-item-body { flex: 1 1 auto; min-width: 0; }

.board-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  line-height: 1.3;
}
.board-excerpt {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 6px;
}
.board-meta { line-height: 1.4; }
.board-reply {
  border-left: 3px solid var(--navy);
  padding: 10px 14px;
  margin: 10px 0;
  background: #f7f9fc;
  border-radius: 4px;
}

/* ============================================================
   HELP MODULE
   ============================================================ */
.help-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .help-layout { grid-template-columns: 1fr; }
}

.help-nav {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.help-nav h3 { margin-bottom: 10px; }

.help-group { margin-top: 14px; }
.help-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 6px;
  padding-left: 4px;
}
.help-link {
  display: block;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--navy);
  text-decoration: none;
  border-radius: 5px;
  border-left: 3px solid transparent;
  transition: .15s;
}
.help-link:hover { background: #eaf1fa; }
.help-link.active {
  background: #eaf1fa;
  border-left-color: var(--accent);
  font-weight: 600;
}
.help-content { padding: 24px 28px; }
.help-title {
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 4px;
  border: none;
  padding: 0;
}
.help-meta { margin-bottom: 18px; }
.help-body { font-size: 13.5px; line-height: 1.65; color: var(--text); }
.help-body h3 {
  font-size: 15px;
  color: var(--navy);
  margin: 22px 0 8px;
  text-transform: none;
  letter-spacing: 0;
}
.help-body h4 { font-size: 13.5px; color: var(--navy); margin: 16px 0 6px; }
.help-body p { margin-bottom: 12px; }
.help-body ul, .help-body ol { margin: 8px 0 14px 22px; }
.help-body li { margin-bottom: 5px; }
.help-body code {
  background: #eef3f9;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: Consolas, monospace;
  font-size: 12.5px;
}
.help-body a { color: var(--navy); text-decoration: underline; }
.help-body table { margin: 12px 0; font-size: 13px; }
.help-body table th,
.help-body table td { padding: 7px 10px; border: 1px solid var(--line); }
.help-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 8px 14px;
  margin: 12px 0;
  background: #fff7e5;
  color: #7a5400;
  border-radius: 4px;
}

/* ============================================================
   Small utilities
   ============================================================ */
.small { font-size: 11.5px; }
.muted { color: var(--muted); }
.center { text-align: center; }
code {
  background: #eef3f9;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}
hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }

/* ============================================================
   Print — hide chrome, keep content
   ============================================================ */
@media print {
  .sidebar, .topbar, .page-actions, .report-actions,
  .btn-sm, button, .flash, .flash *,
  .card:first-of-type { display: none !important; }

  .body-row { display: block !important; }
  .main {
    padding: 0 !important;
    overflow: visible !important;
    height: auto !important;
  }
  body { background: #fff !important; overflow: visible !important; }
  .card {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }

  .report-title-block {
    display: block !important;
    text-align: center;
    border-bottom: 2px solid #12335c;
    padding-bottom: 10px;
    margin-bottom: 12px;
  }
  .report-logo {
    display: block !important;
    height: 72px !important;
    max-height: 72px !important;
    width: auto !important;
    max-width: 220px !important;
    margin: 0 auto 10px auto !important;
  }
  .report-property { font-size: 20px; font-weight: 800; color: #12335c; }
  .report-manager  { font-size: 11px; color: #66768a; }
  .report-name     { font-size: 14px; font-weight: 700; color: #12335c;
                     margin-top: 4px; text-transform: uppercase; }
  .report-period   { font-size: 11px; color: #66768a; margin-top: 2px; }

  table { width: 100%; border-collapse: collapse; }
  th {
    background: #12335c !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  tr.total td {
    background: #eaf1fa !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  .body-row { flex-direction: column; overflow: visible; }
  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    max-height: 260px;
  }
  .main { height: auto; overflow: visible; padding: 16px; }
  body { overflow: auto; }
  .row > div { flex: 1 1 100%; }
  .report-logo { height: 56px !important; max-height: 56px !important; }
  .market-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .market-photo { height: 120px; }
}