/* =========================================================
   RESET & BASE
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
             "Segoe UI", Roboto, Arial, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  line-height: 1.6;

  /* iOS SAFE AREA + FOOTER */
  padding-bottom: calc(56px + env(safe-area-inset-bottom));

  /* FONT METRIC STABILITY */
  font-size-adjust: 0.5;
}

/* iOS viewport stabilizer */
@supports (-webkit-touch-callout: none) {
  body {
    min-height: -webkit-fill-available;
  }
}

/* =========================================================
   HEADER (HEIGHT LOCKED)
   ========================================================= */
.header {
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;

  display: flex;
  align-items: center;
}

.header-inner {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 0 14px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo svg {
  height: 32px;
  display: block;
}

.city-select {
  height: 36px;
  font-size: 13px;
  padding: 0 28px 0 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

/* =========================
   PAGE CONTAINER (CLS LOCK)
   ========================= */
.container {
  max-width: 980px;
  margin: 16px auto;
  padding: 20px;
  background: #ffffff;
  border-radius: 12px;

  /* 🔥 CRITICAL: reserve final size */
  min-height: 1000px;
}

/* =========================================================
   BREADCRUMB
   ========================================================= */
.breadcrumb {
  font-size: 12px;
  color: #64748b;
  min-height: 28px;
  line-height: 28px;
  margin-bottom: 6px;
}

/* =========================================================
   HEADINGS
   ========================================================= */
h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 6px 0 4px;
  line-height: 1.3;
}

h2 {
  font-size: 16px;
  margin: 20px 0 8px;
}

/* =========================================================
   META
   ========================================================= */
.updated {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 14px;
}

/* =========================================================
   PRICE CARDS GRID
   ========================================================= */
.price-cards {
  display: grid;
  gap: 14px;
  grid-auto-rows: 160px;
}

@media (min-width: 1024px) {
  .price-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================================================
   PRICE CARD
   ========================================================= */
.price-card {
  background: #f8fbff;
  border: 1px solid #e0e7ff;
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;

  min-height: 160px;
  max-height: 160px;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Label */
.price-card span {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}

/* Price (ðŸ”¥ LCP FIX) */
.price-card strong {
  display: block;
  font-size: 30px;
  font-weight: 700;
  margin: 6px 0 8px;
  color: #0f172a;

  font-variant-numeric: tabular-nums;
  line-height: 1.1;

  /* ðŸ”¥ SURGICAL FIX */
  min-width: 7ch;
  display: inline-block;
  text-align: center;
}

/* Trend */
.price-trend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.price-trend.up { color: #16a34a; }
.price-trend.down { color: #dc2626; }
.price-trend.same { color: #64748b; }

.metal-note {
  font-size: 13px;
  color: #475569;
}

/* =========================================================
   QUICK LINKS
   ========================================================= */
.quick-metal-links {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

.quick-metal-links a {
  padding: 6px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  text-decoration: none;
  font-size: 13px;
  color: #0f172a;
}

/* =========================================================
   CONTENT BOX
   ========================================================= */
.content-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  margin: 18px 0;
}

.content-box p,
.content-box li {
  font-size: 14px;
  color: #334155;
}

/* =========================================================
   CITY LINKS (ðŸ”¥ CLS FIX)
   ========================================================= */
.city-links {
  list-style: none;
  padding: 0;
  margin: 0;

  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;

  min-height: 320px;
  align-items: start; /* ðŸ”¥ prevents baseline shift */
}

.city-links a {
  display: block;
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
  text-decoration: none;
  font-size: 14px;
  color: #2563eb;

  /* ðŸ”¥ SURGICAL FIX */
  min-width: 12ch;
  display: inline-block;
}

@media (min-width: 1024px) {
  .city-links {
    grid-template-columns: repeat(4, 1fr);
    min-height: 180px;
  }
}

/* =========================================================
   TABLE
   ========================================================= */
.price-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 10px;
  overflow: hidden;
}

.price-table th,
.price-table td {
  padding: 10px 8px;
  font-size: 14px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
  height: 44px;
}

.price-table thead th {
  background: #f1f5f9;
  font-weight: 600;
}

.price-table tbody tr:nth-child(even) {
  background: #fafafa;
}

/* =========================================================
   FAQ
   ========================================================= */
.faq p {
  font-size: 14px;
  margin-bottom: 10px;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  text-align: center;
  font-size: 12px;
  color: #64748b;
  padding: 12px;
}

/* =========================================================
   BOTTOM NAV
   ========================================================= */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  height: 56px;
  padding-bottom: env(safe-area-inset-bottom);

  display: flex;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;

  z-index: 10000;
}

.bottom-nav a {
  flex: 1;
  text-align: center;
  line-height: 56px;
  font-size: 13px;
  color: #475569;
  text-decoration: none;
}

.bottom-nav a.active {
  font-weight: 600;
  color: #0f172a;
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 768px) {
  .price-card strong {
    font-size: 28px;
  }
}

/* =========================================================
   POPULAR SEARCHES â€“ COMPACT
   ========================================================= */
.content-box {
  padding: 10px 10px 8px;
  margin: 12px 0;
}

.content-box h2 {
  font-size: 14px;
  margin: 0 0 6px;
  line-height: 1.25;
}

.content-box .city-links {
  gap: 6px;
  margin: 0;
}

.content-box .city-links a {
  padding: 6px 8px;
  font-size: 12.5px;
  line-height: 1.2;
  border-radius: 10px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .content-box {
    max-height: 210px;
    overflow: hidden;
  }

  .content-box .city-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 769px) {
  .content-box {
    max-height: 140px;
    overflow: hidden;
  }

  .content-box .city-links {
    grid-template-columns: repeat(3, 1fr);
  }
}
.price-value {
  font-variant-numeric: tabular-nums;
  min-width: 7ch;
  display: inline-block;
  text-align: center;
}
/* =========================================================
   META (UPDATED – FINAL FIX)
   ========================================================= */
.updated {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 14px;

  /* CLS SAFETY */
  min-height: 36px;          /* reserves 2 lines */
  line-height: 18px;

  /* HARD STOP OVERFLOW (iOS SAFE) */
  max-width: 100%;
  overflow: hidden;

  /* FORCE BREAKING */
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;

  /* FLEX REMOVAL = STABILITY */
  display: block;
}

/* SAFETY: ANY INLINE SPAN INSIDE UPDATED */
.updated span {
  display: inline;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}