/* jpcanada.com style adaptation for imvan.ca */
/* Based on jpcanada.com/resources2018/styles-pc.css + styles-phone.css */
/* Exact values from agent research 2026-04-11 */

/* ===== Brand Theme Variables ===== */
:root {
  --brand-primary: #c00;
  --brand-primary-hover: #a00;
  --brand-primary-rgb: 204, 0, 0;
  --brand-secondary: #003399;
  --brand-secondary-hover: #0044cc;
  --brand-light: #ff4444;
}

/* ===== Skip Link (a11y) ===== */
.jp-skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-secondary);
  color: #fff;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
  z-index: 100000;
  border-radius: 0 0 4px 4px;
}
.jp-skip-link:focus {
  top: 0;
}

/* ===== Reset & Base ===== */
body.jp-style {
  font-family: Lato, "Noto Sans JP", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 22px;
  color: #333;
  text-align: center;
  margin: 0;
  padding: 0;
  background: #fff;
}
body.jp-style a { color: #0044cc; text-decoration: underline; }
body.jp-style a:hover { color: red; }
/* Scoped: only content-area images get red hover border, not sidebar/header banners */
#jp-content a:hover img { border: 1px red solid; }
body.jp-style h1, body.jp-style h2, body.jp-style h3, body.jp-style h4, body.jp-style h5 {
  margin: 0; padding: 0;
}

/* ===== Page Frame (840 + 1/8 = 945px) ===== */
.jp-header, .jp-section, .jp-footer {
  width: 945px;
  margin: 0 auto;
  text-align: left;
  clear: both;
}
.jp-header { padding-top: 0; }
.jp-section { padding-top: 8px; }
.jp-section + .jp-section { padding-top: 0; }

/* Two-column float layout (147 sidebar + 10 gap + 788 content = 945) */
#jp-content { width: 788px; float: right; }
#jp-banner-left { width: 147px; float: left; overflow: hidden; }

/* Clearfix for float container */
.jp-clearfix::after { content: ''; display: table; clear: both; }

/* ===== H1 SEO Bar (jpcanada-style fixed top) ===== */
.jp-h1-bar {
  position: fixed;
  top: 0; right: 0;
  width: 100%;
  min-width: 600px;
  z-index: 99999;
  background: #eee;
  color: #333;
  font-size: 0.6em;
  font-weight: 300;
  height: 1.5em;
  text-align: right;
  padding-top: 2px;
  margin-top: 0;
}

/* ===== Header ===== */
.jp-header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.jp-header-inner li {
  display: inline-block;
  vertical-align: top;
  text-align: center;
  border: 1px #eee solid;
  list-style: none;
}
.jp-logo { width: 145px; }
.jp-logo img {
  transition: transform 0.3s ease;
}
.jp-logo img:hover {
  transform: rotate(-10deg);
}

/* Header info bar (weather + exchange rate) */
.jp-header-info {
  margin-top: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.jp-header-info select {
  border: solid 1px #bbb;
  padding: 2px 4px;
  font-size: 12px;
}

/* Exchange rate */
.exchange { background: #ccffff; font-weight: 700; padding: 2px 4px; font-size: 12px; }

/* ===== Left Banner Sidebar ===== */
#jp-banner-left ul { list-style: none; margin: 0; padding: 0; }
#jp-banner-left li { margin: 0; padding: 0; }
#jp-banner-left h3 {
  background-color: var(--brand-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 5px;
  margin-top: 6px;
  margin-bottom: 0;
}
#jp-banner-left h3:first-of-type { margin-top: 8px; }
#jp-banner-left .links-box {
  background-color: #FFFFDD;
  padding: 5px 6px;
  margin: 0;
  border: #e0e0e0 1px solid;
  border-top: none;
  font-size: 12px;
  line-height: 1.8;
}
.sbn-img { border: #ddd solid 1px; display: block; margin-bottom: 5px; width: 145px; max-width: 100%; }

/* Sidebar stats box */
.sidebar-stats-box {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
  color: #fff;
  text-align: center;
  padding: 10px 6px;
  margin-bottom: 6px;
}
.sidebar-stats-box .stats-number { font-size: 22px; font-weight: bold; line-height: 1.2; }
.sidebar-stats-box .stats-label { font-size: 11px; opacity: 0.85; }
.sidebar-stats-box .stats-today { font-size: 11px; color: #ffd; margin-top: 2px; }
.sidebar-post-btn {
  display: block;
  background: #fff;
  color: var(--brand-primary) !important;
  text-decoration: none !important;
  font-weight: bold;
  font-size: 12px;
  padding: 4px 0;
  margin-top: 6px;
  border-radius: 2px;
  text-align: center;
}
.sidebar-post-btn:hover { background: #ffe; }

/* ===== Section Headlines (black bar) ===== */
.bbs-headline {
  display: block;
  background-color: #000;
  color: #fff;
  padding: 2px 6px;
  font-size: 13px;
  font-weight: 400;
  margin-top: 3px;
}
.bbs-headline:first-child,
.jp-entry-banners + .bbs-headline { margin-top: 0; }
.bbs-headline a { color: #fff; }

/* ===== Content text ===== */
#jp-content p { padding: 0; margin: 0; font-size: 13px; }
#jp-content h3 { font-size: 15px; text-align: left; }
#jp-content h4, #jp-content h5 { font-size: 14px; }

/* ===== Board Grid (bbs-table) — 3 columns like jpcanada ===== */
.bbs-table { display: table; table-layout: fixed; width: 100%; text-align: left; margin-top: 2px; margin-bottom: 2px; }
.bbs-table .divTableRow { display: table-row; }
.bbs-table .divTableCell {
  display: table-cell;
  width: 33.33%;
  padding: 3px 4px;
  font-size: 13px;
  vertical-align: top;
  overflow: hidden;
  word-break: break-all;
}

/* ===== Category Grid (modern card style) ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #e0e0e0;
  margin: 3px 0 4px;
}
.cat-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px;
  padding: 8px 6px;
  background: #fff;
  text-decoration: none !important;
  transition: background 0.15s;
}
.cat-card:hover { background: #fffde7; }
.cat-card-icon { font-size: 16px; }
.cat-card-name { font-size: 14px; font-weight: bold; color: #0044cc; }
.cat-card-desc { width: 100%; font-size: 11px; color: #888; line-height: 1.3; }
.cat-count-badge {
  display: inline-block;
  background: #f0f0f0;
  color: var(--brand-primary);
  font-size: 10px;
  font-weight: bold;
  padding: 0 4px;
  border-radius: 2px;
  vertical-align: middle;
}

/* ===== Quick Category Bar (58.com style) ===== */
.quick-cats {
  display: flex;
  gap: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  margin: 4px 0;
  overflow-x: auto;
}
.qc-item {
  flex: 1;
  text-align: center;
  padding: 5px 2px;
  font-size: 12px;
  font-weight: 500;
  color: #333 !important;
  text-decoration: none !important;
  border-right: 1px solid #f0f0f0;
  white-space: nowrap;
  transition: background 0.15s;
}
.qc-item:last-child { border-right: none; }
.qc-item:hover { background: #f5f5f5; color: var(--brand-primary) !important; }
.qc-icon { display: inline; font-size: inherit; margin-right: 1px; }
.qc-count { font-size: 10px; color: #767676; margin-left: 2px; }
.qc-hot { color: var(--brand-primary) !important; font-weight: bold; }
.qc-post { background: var(--brand-primary); color: #fff !important; font-weight: bold; }
.qc-post:hover { background: var(--brand-primary-hover); color: #fff !important; }

/* ===== Entry Banners (clean accent-bar style, compact) ===== */
.jp-entry-banners {
  display: flex;
  gap: 8px;
  margin: 6px 0;
}
.jp-entry-banner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 10px 16px;
  text-decoration: none !important;
  font-weight: bold;
  font-size: 20px;
  letter-spacing: 1px;
  border: 1px solid #e0e0e0;
  border-left: 4px solid;
  transition: background 0.15s, border-color 0.15s;
}
/* Gold/amber accent */
.jp-entry-banner-gold {
  border-left-color: #e6a800;
  background: #fffdf5;
  color: #b07000 !important;
}
.jp-entry-banner-gold:hover {
  background: #fff8e1;
  border-color: #e6a800;
  color: #995f00 !important;
}
/* Rose/pink accent */
.jp-entry-banner-pink {
  border-left-color: #e05577;
  background: #fff8f9;
  color: #c0445e !important;
}
.jp-entry-banner-pink:hover {
  background: #fff0f3;
  border-color: #e05577;
  color: #a03350 !important;
}
.jp-entry-banner small {
  display: block;
  font-size: 12px;
  font-weight: normal;
  letter-spacing: 0;
  margin-top: 3px;
  color: #888;
}

/* ===== 12 Colored Border Classes ===== */
.tbYellow  { border: #daa520 1px solid; padding: 3px; }
.tbGreen   { border: #00cc33 1px solid; padding: 3px; }
.tbBlue    { border: #0000ff 1px solid; padding: 3px; }
.tbLtBlue  { border: #0099ff 1px solid; padding: 3px; }
.tbOrange  { border: #ff9933 1px solid; padding: 3px; }
.tbPink    { border: #ff00ff 1px solid; padding: 3px; }
.tbStPink  { border: #cc3399 1px solid; padding: 3px; }
.tbSmBlue  { border: #009999 1px solid; padding: 3px; }
.tbGray    { border: #bebebe 1px solid; padding: 3px; }
.tbPurple  { border: #990099 1px solid; padding: 3px; }
.tbRed     { border: #ff0000 1px solid; padding: 3px; }
.tbYGreen  { border: #33ff66 1px solid; padding: 3px; }

/* ===== Board Wrapper (3px colored border around content when viewing a category) ===== */
.board-wrapper {
  border: 3px solid;
  border-radius: 2px;
  padding: 4px;
  margin-top: 4px;
}
.board-wrapper.bw-rental     { border-color: #0000ff; }
.board-wrapper.bw-real_estate { border-color: #00cc33; }
.board-wrapper.bw-car         { border-color: #ff9933; }
.board-wrapper.bw-job         { border-color: #990099; }
.board-wrapper.bw-buy_sell    { border-color: #ff00ff; }
.board-wrapper.bw-service_nanny      { border-color: #009999; }
.board-wrapper.bw-service_renovation { border-color: #ff0000; }
.board-wrapper.bw-service_gardening  { border-color: #33ff66; }
.board-wrapper.bw-service_hvac       { border-color: #0099ff; }

/* ===== Info Table (2-column guide) ===== */
.info-table { display: table; width: 100%; text-align: left; }
.info-table .divTableRow { display: table-row; }
.info-table .divTableCell {
  display: table-cell;
  width: 50%;
  padding: 5px 4px;
  font-size: 14px;
  vertical-align: top;
}

/* ===== Area Table (city × category matrix) ===== */
.area-table { display: table; border: 1px solid #000; width: 100%; text-align: center; }
.area-table .divTableRow { display: table-row; }
.area-table .divTableCell, .area-table .divTableHead {
  display: table-cell;
  border: 1px solid #fff;
  padding: 4px 3px;
  font-size: 14px;
  vertical-align: middle;
}
.area-table .divTableRow:nth-child(even) { background: #DEE0E0; }
.area-table .tbHeader, .area-table .tbHeader a {
  background-color: #000;
  color: white;
}
.area-table .tbHeader a { text-decoration: none; }
.area-table .tbHeader a:hover { font-weight: 600; color: white; }

/* ===== Free Space (Ad Placeholders) ===== */
.free-space { text-align: center; margin: 10px auto; padding: 10px 0; }

/* Ad placeholder box (for when no real ads) */
.ad-placeholder {
  display: inline-block;
  background: #f5f5f5;
  border: 1px dashed #ccc;
  color: #767676;
  font-size: 11px;
  text-align: center;
  line-height: 1.3;
  padding: 4px;
}
.ad-placeholder-468 { width: 468px; height: 60px; line-height: 60px; }
.ad-placeholder-147 { width: 140px; height: 100px; }

/* ===== CTA Bar ===== */
.jp-cta-bar {
  background: #fffde7;
  border-bottom: 2px solid var(--brand-primary);
  padding: 4px 0;
}
.jp-cta-btn {
  background: var(--brand-primary);
  color: #fff !important;
  font-weight: bold;
  font-size: 14px;
  padding: 6px 16px;
  text-decoration: none !important;
  display: inline-block;
}
.jp-cta-btn:hover { background: var(--brand-primary-hover); color: #fff !important; }

/* ===== Search ===== */
.jp-search input[type="text"] {
  border: 1px solid #bbb;
  padding: 4px 8px;
  font-size: 12px;
}
.jp-search button {
  background: var(--brand-secondary);
  color: #fff;
  border: none;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}

/* ===== Listing Rows ===== */
.jp-listing-row {
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  gap: 3px;
  align-items: baseline;
  min-width: 0;
  overflow: hidden;
  padding: 0.5px 0;
  border-bottom: 1px dotted #f0f0f0;
}
.jp-listing-row a { color: #333; text-decoration: none; }
.jp-listing-row a:hover { color: var(--brand-primary); text-decoration: underline; }
.jp-listing-row:hover { background: #fffde7; }
.jp-price { color: #c60; font-weight: bold; font-size: 12px; }
.jp-time { color: #767676; font-size: 10px; white-space: nowrap; }

/* Listing page rows (detail rows) */
.listing-row { display: flex; gap: 8px; padding: 6px 8px; border-bottom: 1px solid #eee; font-size: 14px; align-items: flex-start; }
.listing-row:nth-child(even) { background: #f9f9f9; }
.listing-row:hover { background: #fffde7; }
.listing-row .thumb-wrap { position: relative; flex-shrink: 0; width: 80px; height: 60px; }
.listing-row .thumb { width: 80px; height: 60px; object-fit: cover; border: 1px solid #ddd; flex-shrink: 0; background: #f0f0f0; }
.listing-row .img-count { position: absolute; bottom: 2px; left: 2px; background: rgba(0,0,0,0.65); color: #fff; font-size: 10px; padding: 0 4px; border-radius: 2px; line-height: 16px; }
.listing-row .info { flex: 1; min-width: 0; }
.listing-row .info .title-link { color: #0044cc; text-decoration: none; font-weight: bold; font-size: 14px; }
.listing-row .info .title-link:hover { color: red; text-decoration: underline; }
.listing-row .info .meta { font-size: 11px; color: #666; margin-top: 2px; }
.listing-row .info .desc { font-size: 11px; color: #888; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-row .price { font-size: 14px; font-weight: bold; color: #c60; white-space: nowrap; }
.listing-row .date { font-size: 10px; color: #767676; white-space: nowrap; text-align: right; }
.listing-row .date .view-count { font-size: 9px; color: #aaa; margin-top: 2px; }

/* Service attribute badges */
.attr-badge { display: inline-block; font-size: 10px; padding: 0 4px; margin-left: 4px; border-radius: 2px; font-weight: 500; line-height: 16px; }
.attr-badge-green { background: #e8f5e9; color: #2e7d32; }
.attr-badge-blue { background: #e3f2fd; color: #1565c0; }
.attr-badge-orange { background: #fff3e0; color: #e65100; }

/* Page nav (numbered pagination) */
.page-nav { text-align: center; padding: 10px 8px; font-size: 12px; border-top: 1px solid #eee; display: flex; justify-content: center; align-items: center; gap: 2px; flex-wrap: wrap; }
.page-nav a { color: #0044cc; padding: 4px 10px; border: 1px solid #ddd; border-radius: 3px; text-decoration: none; min-width: 32px; text-align: center; display: inline-block; }
.page-nav a:hover { background: #e8f0fe; border-color: #0044cc; }
.page-nav .page-current { background: var(--brand-secondary); color: #fff; padding: 4px 10px; border: 1px solid var(--brand-secondary); border-radius: 3px; font-weight: bold; min-width: 32px; text-align: center; display: inline-block; }
.page-nav .page-ellipsis { padding: 4px 6px; color: #767676; }

/* Floating Action Button (发布) */
.fab-post {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  display: flex; align-items: center; gap: 6px;
  background: var(--brand-secondary); color: #fff; border: none; border-radius: 28px;
  padding: 12px 20px; font-size: 14px; font-weight: bold;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: background 0.15s, transform 0.15s;
}
.fab-post:hover { background: var(--brand-secondary-hover); transform: translateY(-2px); }
.fab-post .fab-icon { font-size: 20px; line-height: 1; }
.fab-post .fab-label { letter-spacing: 0.5px; }

/* Filter bar */
.filter-bar { background: #f5f5f5; border-bottom: 1px solid #ddd; padding: 4px 8px; font-size: 12px; }
.filter-bar select, .filter-bar input { border: 1px solid #bbb; padding: 3px 6px; font-size: 12px; }
.filter-bar button { background: var(--brand-secondary); color: #fff; border: none; padding: 4px 10px; font-size: 12px; cursor: pointer; }

/* ===== Footer ===== */
.jp-footer {
  font-size: 12px;
  line-height: 1.5;
  padding-top: 20px;
}
.jp-footer #copyright {
  text-align: center;
  color: #333;
  font-size: 1em;
  font-weight: 300;
  width: 100%;
  min-width: 945px;
  margin-top: 20px;
}

/* Quick links */
.jp-quicklinks {
  font-size: 12px;
  text-align: center;
  padding: 6px;
  background: #f9f9f9;
  border-top: 1px solid #ddd;
}

/* ===== Ticker shared ===== */
.ticker {
  font-size: 12px;
  border-bottom: 1px solid #e0e0e0;
  background: #f9f9f9;
}
.ticker a { color: #0044cc; text-decoration: none; }
.ticker a:hover { text-decoration: underline; }
.ticker-label {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  font-weight: bold;
  font-size: 11px;
  color: #fff;
  background: var(--brand-primary);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 24px;
}
.ticker-sep { color: #ccc; margin: 0 12px; }

/* ① Marquee 水平滚动 */
.ticker-marquee {
  display: flex;
  align-items: center;
  height: 24px;
  overflow: hidden;
}
.ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  padding-left: 8px;
}
.ticker-scroll {
  display: inline-flex;
  white-space: nowrap;
  animation: marquee-scroll 35s linear infinite;
  gap: 0;
}
.ticker-marquee:hover .ticker-scroll { animation-play-state: paused; }
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-scroll { animation: none; }
  .back-to-top { transition: none; }
  .jp-logo img { transition: none; }
  .cat-card, .city-tag, .forum-tab, .transit-tab,
  .jp-entry-banner, .listing-grid-card, .pro-card,
  .guide-card, .qc-item, .announce-card { transition: none; }
}




/* ===== Weather Bar ===== */
.weather-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: linear-gradient(90deg, #e8f4fd 0%, #f0f8ff 100%);
  border: 1px solid #d0e4f0;
  font-size: 12px;
  color: #333;
  margin: 2px 0;
}
.weather-icon { font-size: 16px; }
.weather-forecast { color: #666; margin-left: auto; font-size: 11px; }

/* ===== Forum Tabs ===== */
.forum-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}
.forum-tab {
  padding: 5px 12px;
  font-size: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.forum-tab:hover { color: #333; background: #f5f5f5; }
.forum-tab.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); font-weight: bold; background: #fff; }

/* ===== Toolbox Grid (百宝箱) ===== */
.toolbox-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: #e0e0e0;
  margin: 3px 0 4px;
}
.toolbox-card {
  background: #fff;
  padding: 6px 8px;
}
.toolbox-title {
  font-size: 13px;
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 3px;
  margin-bottom: 3px;
}
.toolbox-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.toolbox-links a {
  font-size: 11px;
  color: #0044cc;
  text-decoration: none;
  padding: 1px 0;
  line-height: 1.5;
}
.toolbox-links a:hover { color: red; text-decoration: underline; }

/* ===== City Tags ===== */
.city-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 4px;
  background: #fff;
  border: 1px solid #e0e0e0;
  margin: 3px 0 4px;
}
.city-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 13px;
  color: #333 !important;
  text-decoration: none !important;
  transition: all 0.15s;
}
.city-tag:hover { background: #e8e8e8; border-color: #bbb; }
.city-tag-all { background: var(--brand-primary); color: #fff !important; border-color: var(--brand-primary); }
.city-tag-all:hover { background: var(--brand-primary-hover); }

/* ===== Guide Grid ===== */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #e0e0e0;
  margin: 3px 0 4px;
}
.guide-card {
  display: block;
  padding: 8px 6px;
  background: #fff;
  text-decoration: none !important;
  transition: background 0.15s;
}
.guide-card:hover { background: #f5f8ff; }
.guide-title { display: block; font-size: 13px; font-weight: bold; color: #333; }
.guide-tips { display: block; font-size: 11px; color: #888; margin-top: 2px; }

/* ===== Featured cards (news/promo) ===== */
.jp-card-row {
  display: flex;
  gap: 8px;
  margin: 6px 0;
}
.jp-card {
  flex: 1;
  border-bottom: 1px solid #eee;
  padding: 4px;
  font-size: 12px;
}
.jp-card img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid #DADCE0;
  float: left;
  margin-right: 5px;
}
.jp-card .title { font-weight: bold; font-size: 12px; }
.jp-card .text { color: #888; font-size: 0.8em; margin-top: 2px; }

/* ===== Utility: text helpers ===== */
.txt-red { color: #ff0000; }
.txt-small { font-size: 10px; }
.txt-bold { font-weight: 700; }

/* ===== Mobile overrides ===== */
@media (max-width: 767px) {
  .jp-header, .jp-section, .jp-footer { width: auto; padding: 0 0.5em; }
  .jp-footer #copyright { min-width: auto; font-size: 0.8em; }
  #jp-content { width: auto; float: none; }
  #jp-banner-left { display: none; }

  /* Logo: scale down on mobile, keep aspect ratio for both default and V2 logos */
  .jp-logo { width: auto; max-width: 145px; }
  .jp-logo img { height: 40px !important; width: auto !important; max-width: 150px; }

  /* Entry banners: stack vertically on mobile */
  .jp-entry-banners { flex-direction: column; gap: 6px; }
  .jp-entry-banner { font-size: 16px; padding: 8px 12px; }

  /* Ticker: smaller label on mobile */
  .ticker-label { padding: 0 6px; font-size: 10px; }
  .ticker-track { padding-left: 4px; }

  /* Header: hide exchange rate and nav links on mobile (MobileNav handles nav) */
  .jp-header-info .exchange { display: none; }
  .jp-header-info > span:has(+ a[href="/listings"]) { display: none; }
  .jp-header-info > a[href="/listings"],
  .jp-header-info > a[href="/forum"],
  .jp-header-info > a[href="/auth/login"],
  .jp-header-info > a[href="/dashboard"] { display: none; }
  .jp-header-info { gap: 4px; padding-top: 2px; }

  /* Search: responsive */
  .jp-search input[type="text"] { width: 100% !important; min-width: 0; flex: 1; }
  .jp-search select { max-width: 80px; font-size: 11px; }
  .jp-search { flex-wrap: nowrap; }

  /* Quick cats: icon grid on mobile (58.com style) */
  .quick-cats {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    overflow-x: visible;
    border: 1px solid #eee;
  }
  .qc-item {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 2px 6px;
    font-size: 11px;
    line-height: 1.3;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
  }
  .qc-item:nth-child(5n) { border-right: none; }
  .qc-item:nth-last-child(-n+6) { border-bottom: none; }
  .qc-icon { font-size: 22px; display: block; margin-bottom: 2px; }
  .qc-count { font-size: 9px !important; color: #767676 !important; margin-left: 0 !important; display: block; }
  .qc-post {
    grid-column: span 1;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-light)) !important;
    color: #fff !important;
    border-radius: 0;
  }
  .qc-post .qc-icon { font-size: 22px; }

  /* Category grid: 2 columns on mobile */
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-card { padding: 6px 4px; }
  .cat-card-name { font-size: 13px; }
  .cat-card-desc { display: none; }

  /* Guide grid: 2 columns on mobile */
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-card { padding: 6px 4px; }
  .guide-tips { font-size: 10px; }

  /* Board grid: single column, tighter on mobile */
  .bbs-table .divTableCell { display: block; width: 100%; padding: 3px 4px; }
  .bbs-table .divTableRow { display: block; }
  .bbs-table { margin-top: 1px; margin-bottom: 1px; }

  .info-table .divTableCell { display: block; width: 100%; }
  .info-table .divTableRow { display: block; }

  /* Area table: readable on mobile */
  .area-table .divTableRow { display: block; margin-bottom: 0.8em; }
  .area-table .divTableCell { display: block; font-size: 14px; margin-bottom: 0.3em; }
  .area-table .tbHeader { display: none; }
  .area-table .phone-area-name {
    display: block;
    background-color: #000;
    color: #fff;
    padding: 0.3em;
  }

  .free-space { margin-top: 1em; }
  .free-space img { max-width: 100%; height: auto; }
  .ad-placeholder-468 { width: 100%; height: auto; min-height: 40px; }

  .jp-card-row { flex-direction: column; }

  .jp-header-inner { flex-wrap: wrap; }
  .jp-h1-bar { display: none; }

  /* Section headlines: tighter on mobile */
  .bbs-headline { margin-top: 6px; padding: 2px 4px; font-size: 14px; }

  .listing-row .thumb-wrap { width: 60px; height: 45px; }
  .listing-row .thumb { width: 60px; height: 45px; }
  .listing-row .info .title-link { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .listing-row .info .desc { display: none; } /* hide desc on mobile to save space */
  .listing-row { padding: 8px 6px; gap: 6px; min-height: 44px; /* touch target */ }
  .listing-row .price { font-size: 13px; }

  /* Page nav: scrollable on narrow screens */
  .page-nav { gap: 3px; padding: 8px 4px; }
  .page-nav a, .page-nav .page-current { padding: 6px 10px; min-width: 36px; font-size: 13px; /* bigger touch target */ }

  /* FAB: icon-only on small screens, closer to bottom nav */
  .fab-post { bottom: 72px; right: 16px; padding: 12px 16px; }
  .fab-post .fab-label { display: none; }

  /* Quick links: wrap nicely */
  .jp-quicklinks { line-height: 2; }

  /* Weather bar: stack on mobile */
  .weather-bar { flex-wrap: wrap; }
  .weather-forecast { margin-left: 0; font-size: 10px; }

  /* Toolbox: 2 columns on mobile */
  .toolbox-grid { grid-template-columns: repeat(2, 1fr); }

  /* Forum tabs: smaller */
  .forum-tab { padding: 4px 8px; font-size: 11px; }

  /* Transit widget: smaller tabs */
  .transit-tab { padding: 4px 8px; font-size: 11px; }
  .skytrain-line { padding: 5px 10px; font-size: 11px; }

  /* Listing grid: 2 columns on mobile */
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
  .listing-grid-thumb { height: 80px; }

  /* Pro directory: stack vertically */
  .pro-directory { flex-direction: column; }
  .pro-section { border-right: none; border-bottom: 1px solid #f0f0f0; }
  .pro-section:last-child { border-bottom: none; }
  .pro-cards { flex-wrap: wrap; }
  .pro-card { min-width: 0; }

  /* Forum: responsive topic list */
  .forum-topic-row { flex-wrap: wrap; }
  .forum-topic-row .forum-stats { display: none; }
  .forum-topic-row .forum-time { font-size: 9px; }
}

/* ===== Transit Widget (VanSky-inspired) ===== */
.transit-widget {
  background: #fff;
  border: 1px solid #eee;
  margin: 3px 0 4px;
}
.transit-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}
.transit-tab {
  padding: 5px 12px;
  font-size: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.transit-tab:hover { color: #333; background: #f5f5f5; }
.transit-tab.active { color: var(--brand-secondary); border-bottom-color: var(--brand-secondary); font-weight: bold; background: #fff; }

/* SkyTrain line buttons */
.skytrain-line {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
  color: #fff !important;
  text-decoration: none !important;
  transition: opacity 0.15s;
}
.skytrain-line:hover { opacity: 0.85; }
.skytrain-expo { background: #1a5ba5; }
.skytrain-millennium { background: #fdb913; color: #333 !important; }
.skytrain-canada { background: #009ac7; }

/* ===== Listing Grid View ===== */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #e0e0e0;
  margin: 2px 0;
}
.listing-grid-card {
  display: block;
  background: #fff;
  text-decoration: none !important;
  transition: background 0.15s;
  overflow: hidden;
}
.listing-grid-card:hover { background: #fffde7; }
.listing-grid-thumb {
  position: relative;
  width: 100%;
  height: 100px;
  overflow: hidden;
  background: #f0f0f0;
}
.listing-grid-info { padding: 4px 6px; }
.listing-grid-title {
  font-size: 12px;
  color: #333;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.listing-grid-meta { margin-top: 2px; }
.listing-grid-price { font-size: 13px; font-weight: bold; color: #c60; }

/* ===== Professional Directory ===== */
.pro-directory {
  background: #fff;
  border: 1px solid #eee;
  margin: 3px 0 4px;
  display: flex;
  gap: 0;
}
.pro-section {
  flex: 1;
  padding: 6px 8px;
  border-right: 1px solid #f0f0f0;
}
.pro-section:last-child { border-right: none; }
.pro-section-title {
  font-size: 12px;
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 3px;
  margin-bottom: 4px;
}
.pro-cards { display: flex; gap: 6px; }
.pro-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border: 1px dashed #ddd;
  border-radius: 3px;
  text-decoration: none !important;
  transition: background 0.15s;
}
.pro-card:hover { background: #fffde7; border-color: #ccc; }
.pro-card-placeholder { background: #fafafa; }
.pro-card-icon { font-size: 20px; }
.pro-card-text { font-size: 11px; color: #666; line-height: 1.3; }

/* ===== Source Badge (inline, for list views) ===== */
.source-badge {
  display: inline-block;
  background: #e8f4fd;
  color: #3b82a0;
  font-size: 10px;
  font-weight: bold;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 2px;
  border: 1px solid #b8d8e8;
  vertical-align: middle;
  line-height: 16px;
  white-space: nowrap;
}

/* ===== Source Attribution Bar (detail page, jpcanada-compatible) ===== */
.source-attribution {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e8f4fd;
  border: 1px solid #b8d8e8;
  padding: 6px 10px;
  margin: 6px 0;
  font-size: 12px;
  color: #3b6e8a;
}
.source-attribution-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #3b82a0;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  font-style: italic;
  flex-shrink: 0;
}
.source-attribution-link {
  color: #0044cc !important;
  text-decoration: underline;
  margin-left: 2px;
}
.source-attribution-link:hover {
  color: red !important;
}

/* ===== Guide Page Styles ===== */
.guide-toc {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.guide-toc-title {
  font-size: 13px;
  font-weight: bold;
  color: #333;
  margin-bottom: 6px;
}
.guide-toc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.guide-toc-link {
  font-size: 12px;
  padding: 3px 10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  color: #0044cc !important;
  text-decoration: none !important;
  white-space: nowrap;
}
.guide-toc-link:hover {
  background: #e8f0fe;
  border-color: #0044cc;
}
.guide-section {
  background: #fff;
  border: 1px solid #eee;
  margin-bottom: 8px;
  scroll-margin-top: 40px;
}
.guide-section-title {
  background: var(--brand-secondary);
  color: #fff;
  padding: 5px 10px;
  font-size: 14px;
  font-weight: bold;
  margin: 0;
}
.guide-content {
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.7;
}
.guide-content h4 {
  font-size: 13px;
  font-weight: bold;
  color: var(--brand-secondary);
  margin: 8px 0 4px;
  padding-bottom: 2px;
  border-bottom: 1px dotted #ddd;
}
.guide-content ul, .guide-content ol {
  margin: 4px 0;
  padding-left: 20px;
}
.guide-content p {
  margin: 4px 0;
  font-size: 12px;
}
.guide-fare-table {
  overflow-x: auto;
  margin: 6px 0;
}
.guide-fare-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.guide-fare-table th {
  background: #f0f0f0;
  padding: 4px 8px;
  border: 1px solid #ddd;
  text-align: left;
  font-weight: bold;
  white-space: nowrap;
}
.guide-fare-table td {
  padding: 4px 8px;
  border: 1px solid #eee;
}
.guide-fare-table tr:nth-child(even) td {
  background: #fafafa;
}
.guide-tip {
  background: #fffde7;
  border-left: 3px solid #f9a825;
  padding: 6px 10px;
  margin: 6px 0;
  font-size: 12px;
}
.guide-tip ul {
  margin: 2px 0;
  padding-left: 16px;
}
.guide-tip li {
  line-height: 1.6;
}
.guide-checklist {
  padding: 6px 10px;
}
.guide-check-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px dotted #eee;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}
.guide-check-item input[type=checkbox] {
  margin-top: 3px;
  flex-shrink: 0;
}
.guide-check-item input[type=checkbox]:checked + span {
  color: #767676;
  text-decoration: line-through;
}
.guide-cta-btn {
  display: inline-block;
  background: var(--brand-primary);
  color: #fff !important;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none !important;
  border-radius: 3px;
}
.guide-cta-btn:hover {
  background: var(--brand-primary-hover);
}

@media (max-width: 767px) {
  .guide-toc-links { gap: 3px; }
  .guide-toc-link { font-size: 11px; padding: 2px 8px; }
  .guide-fare-table { font-size: 11px; }
  .guide-fare-table th, .guide-fare-table td { padding: 3px 4px; }
}

/* ===== City x Category Navigation Matrix ===== */
.nav-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
  border: 1px solid #eee;
  margin: 3px 0 4px;
}
.nav-matrix th {
  background: #f5f5f5;
  padding: 4px 6px;
  border: 1px solid #eee;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}
.nav-matrix th a { color: #333; text-decoration: none; }
.nav-matrix td {
  padding: 3px 6px;
  border: 1px solid #f0f0f0;
  text-align: center;
  font-size: 11px;
}
.nav-matrix td a { color: #0066cc; text-decoration: none; }
.nav-matrix td a:hover { color: var(--brand-primary); text-decoration: underline; }
.nav-matrix .city-cell { text-align: left; font-weight: bold; background: #fafafa; white-space: nowrap; }

@media (max-width: 767px) {
  .nav-matrix { font-size: 10px; }
  .nav-matrix th, .nav-matrix td { padding: 2px 3px; }
}

/* ===== Hashtag Labels (jpcanada-inspired) ===== */
.hashtag {
  display: inline-block;
  font-size: 10px;
  color: #0066cc;
  background: #e8f4fd;
  padding: 1px 5px;
  border-radius: 2px;
  margin-right: 3px;
  white-space: nowrap;
}

/* ===== Announcement Cards ===== */
.announce-card:hover { opacity: 0.9; transform: translateY(-1px); transition: all 0.15s; }

/* ===== Forum Board Directory Grid ===== */
.forum-board-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid #eee;
}
.forum-board-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-right: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none !important;
  color: #333;
  transition: background 0.15s;
}
.forum-board-item:nth-child(4n) { border-right: none; }
.forum-board-item:hover { background: #fffde7; }
.forum-board-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}
.forum-board-info { min-width: 0; }
.forum-board-name { font-size: 12px; font-weight: bold; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forum-board-stats { font-size: 10px; color: #767676; }

@media (max-width: 767px) {
  .forum-board-grid { grid-template-columns: repeat(2, 1fr); }
  .forum-board-item:nth-child(2n) { border-right: none; }
  .forum-board-item:nth-child(4n) { border-right: 1px solid #f0f0f0; }
  .announce-card { min-width: 100% !important; }
}

/* ===== Back-to-Top Button ===== */
.back-to-top {
  position: fixed;
  bottom: 80px;
  right: 12px;
  z-index: 40;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  font-size: 20px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: rgba(0, 0, 0, 0.7); }
.has-fab .back-to-top { bottom: 130px; }
@media (min-width: 768px) {
  .back-to-top { bottom: 24px; right: 24px; }
}

/* ===== Sticky Search on Mobile ===== */
@media (max-width: 767px) {
  .jp-search-sticky {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }
}

/* ===== Tel Link (clickable phone on mobile) ===== */
.tel-link { color: #0066cc; text-decoration: none; }
.tel-link:hover { text-decoration: underline; }
@media (min-width: 768px) {
  .tel-link { color: inherit; cursor: default; pointer-events: none; }
}

/* ===== Mobile Filter Toggle ===== */
@media (max-width: 767px) {
  .filter-bar { position: relative; }
  .filter-toggle-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
  }
  .filter-toggle-btn::after { content: ' ▼'; font-size: 10px; }
  .filter-toggle-btn.expanded::after { content: ' ▲'; }
  .filter-content { display: none; }
  .filter-content.expanded { display: block; }
}
@media (min-width: 768px) {
  .filter-toggle-btn { display: none; }
  .filter-content { display: block !important; }
}

/* ===== Floating Publish FAB (58.com-inspired mobile CTA) ===== */
.fab-publish {
  display: none;
}
@media (max-width: 767px) {
  .fab-publish {
    display: flex;
    position: fixed;
    bottom: 24px;
    right: 12px;
    z-index: 50;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-light) 100%);
    color: #fff;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(var(--brand-primary-rgb), 0.4);
    -webkit-tap-highlight-color: transparent;
    animation: fab-pulse 3s ease-in-out infinite;
  }
  .fab-publish:hover { background: linear-gradient(135deg, var(--brand-primary-hover) 0%, #e03030 100%); }
  .fab-publish .fab-icon { font-size: 16px; }
  .has-fab .back-to-top { bottom: 80px; }
}
@keyframes fab-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(var(--brand-primary-rgb), 0.4); }
  50% { box-shadow: 0 4px 20px rgba(var(--brand-primary-rgb), 0.6); }
}
@media (prefers-reduced-motion: reduce) {
  .fab-publish { animation: none; }
}

/* ===== Stats Dashboard Strip (58.com-inspired) ===== */
.stats-strip {
  display: flex;
  background: linear-gradient(90deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 6px 0;
  margin: 4px 0;
  border-radius: 3px;
  overflow: hidden;
}
.stats-item {
  flex: 1;
  text-align: center;
  padding: 2px 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.stats-item:last-child { border-right: none; }
.stats-num {
  font-size: 18px;
  font-weight: bold;
  color: #ffcc00;
  display: block;
  line-height: 1.2;
}
.stats-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  display: block;
}
@media (max-width: 767px) {
  .stats-num { font-size: 15px; }
  .stats-label { font-size: 9px; }
  .stats-item { padding: 2px 2px; }
}

/* ===== Forum List Mobile Responsive ===== */
.forum-mobile-stats { display: none; }

@media (max-width: 767px) {
  .forum-list-header { display: none !important; }
  .forum-col-seq { display: none !important; }
  .forum-col-stats { display: none !important; }
  .forum-col-lastreply { display: none !important; }
  .forum-topic-row { padding: 8px 6px !important; }
  .forum-mobile-stats { display: inline; font-size: 10px; color: #767676; }
}
