/* =========================================================================
   Listat — Saudi Classifieds.  Original stylesheet.
   Brand: calm teal-green (from the Listat logo + Saudi map reference).
   Bilingual: supports both LTR (en) and RTL (ar) via logical properties.
   ========================================================================= */

:root {
  --brand:        #15795e;
  --brand-dark:   #0f5c47;
  --brand-light:  #2a9d78;
  --brand-soft:   #e3f3ee;
  --brand-tint:   #f1f9f6;

  --map-fill:        #d6efe7;
  --map-fill-hover:  #a9e2cd;
  --map-stroke:      #2a9d78;
  --map-stroke-hi:   #0f5c47;

  --link:        #146c8a;
  --link-hover:  #0d4a5e;

  --text:        #1d2b27;
  --text-soft:   #5b6b66;
  --muted:       #8a9893;
  --border:      #dde6e2;
  --border-soft: #eaf0ed;
  --bg:          #f6f9f8;
  --card:        #ffffff;

  --warn:    #b4690e;
  --danger:  #c2401d;
  --ok:      #1f8a4c;

  --radius:    10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(15,40,32,.06), 0 1px 3px rgba(15,40,32,.08);
  --shadow-md: 0 4px 14px rgba(15,40,32,.10);
  --shadow-lg: 0 10px 30px rgba(15,40,32,.16);
  --maxw: 1480px;

  --ff-en: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ff-ar: "Segoe UI", "Tahoma", "Geeza Pro", "Arial", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff-en);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body { font-family: var(--ff-ar); }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
h1,h2,h3,h4 { margin: 0 0 .5rem; color: var(--text); line-height: 1.25; }

.container { max-width: var(--maxw); margin: 0 auto; padding-inline: 18px; }
.hidden { display: none !important; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.text-muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45em;
  padding: .55em 1.05em; border-radius: var(--radius-sm);
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  font-weight: 600; font-size: .95rem; cursor: pointer; transition: .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color:#fff; text-decoration: none; }
.btn.secondary { background: #fff; color: var(--brand-dark); border-color: var(--border); }
.btn.secondary:hover { background: var(--brand-tint); border-color: var(--brand-light); }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn.ghost:hover { background: rgba(255,255,255,.14); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { filter: brightness(.93); }
.btn.warn { background: var(--warn); border-color: var(--warn); }
.btn.sm { padding: .35em .7em; font-size: .85rem; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.linkbtn { background:none; border:none; color: var(--link); cursor:pointer; padding:0; font-size: inherit; }
.linkbtn:hover { text-decoration: underline; }

.badge { display:inline-block; padding:.12em .55em; border-radius: 999px; font-size:.72rem; font-weight:700; }
.badge.green { background: var(--brand-soft); color: var(--brand-dark); }
.badge.gray  { background: #eef2f0; color: var(--text-soft); }
.badge.red   { background: #f9e3dc; color: var(--danger); }
.badge.amber { background: #fbeed5; color: var(--warn); }

/* =========================================================================
   HEADER
   ========================================================================= */
#site-header { position: sticky; top: 0; z-index: 50; }
.topbar { background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%); color:#fff; }
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 18px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display:flex; align-items:center; gap:11px; cursor:pointer; text-decoration:none; flex-shrink:0; }
.brand .logo { width: 46px; height: 46px; flex-shrink:0; background:#fff; border-radius:50%; object-fit:contain; padding:2px; }
.brand .brand-name { color:#fff; font-size:1.5rem; font-weight:800; letter-spacing:.3px; line-height:1; }
.brand .brand-sub { color: rgba(255,255,255,.82); font-size:.68rem; letter-spacing:2px; text-transform:uppercase; }
.brand:hover { text-decoration:none; }

.header-search { flex: 1 1 auto; display:flex; max-width: 560px; }
.header-search input {
  flex:1; border:1px solid transparent; border-start-start-radius: var(--radius-sm);
  border-end-start-radius: var(--radius-sm); padding:.6em .9em; font-size:.95rem; outline:none; min-width: 0;
}
.header-search button {
  border:none; background: var(--brand-dark); color:#fff; padding:0 1.05em; cursor:pointer;
  border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm); font-weight:700;
}
.header-search button:hover { background:#0a4636; }

.header-actions { display:flex; align-items:center; gap:10px; margin-inline-start:auto; flex-shrink:0; }
.lang-toggle {
  background: rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.35); color:#fff;
  border-radius: 999px; padding:.35em .85em; cursor:pointer; font-weight:700; font-size:.85rem;
}
.lang-toggle:hover { background: rgba(255,255,255,.25); }

.acct-menu { position: relative; }
.acct-btn {
  display:flex; align-items:center; gap:.4em; background: rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.35); color:#fff; border-radius:999px;
  padding:.4em .85em; cursor:pointer; font-weight:600; font-size:.88rem;
}
.acct-btn:hover { background: rgba(255,255,255,.25); }
.dropdown {
  position:absolute; inset-inline-end:0; top:calc(100% + 8px); background:#fff; color:var(--text);
  border:1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 210px; padding:6px; z-index: 60;
}
.dropdown a, .dropdown button {
  display:flex; align-items:center; gap:.6em; width:100%; text-align:start;
  padding:.55em .7em; border-radius: var(--radius-sm); color:var(--text); background:none; border:none;
  cursor:pointer; font-size:.92rem; text-decoration:none;
}
.dropdown a:hover, .dropdown button:hover { background: var(--brand-tint); text-decoration:none; }
.dropdown .sep { height:1px; background: var(--border-soft); margin:5px 4px; }

/* sub-toolbar */
.subbar { background:#fff; border-bottom:1px solid var(--border); }
.subbar-inner {
  max-width: var(--maxw); margin:0 auto; padding:8px 18px; display:flex; align-items:center; gap:14px; flex-wrap:wrap;
}
.region-pill {
  display:flex; align-items:center; gap:.5em; background: var(--brand-soft); color: var(--brand-dark);
  border:1px solid #c7e6da; border-radius:999px; padding:.4em .9em; font-weight:700; cursor:pointer; font-size:.9rem;
}
.region-pill:hover { background:#d3ece3; }
.subbar .spacer { flex:1; }
.subbar .crumbs { color: var(--text-soft); font-size:.9rem; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.subbar .crumbs a { font-weight:600; }
.subbar .crumbs .crumb-sep { color: var(--muted); }

/* =========================================================================
   HOMEPAGE
   ========================================================================= */
/* ---- home: boxed rail + dense section columns (page scrolls; footer at end) ---- */
.home2 { padding: 14px 0 28px; }
.home2-grid { display:grid; grid-template-columns: 400px minmax(0,1fr); gap: 20px; align-items:start; }
.home-rail { display:flex; flex-direction:column; gap: 14px; }
.home-sections { display:flex; gap:16px; align-items:flex-start; }
.sec-col { flex:1 1 0; min-width:0; display:flex; flex-direction:column; gap:14px; }
@media (max-width: 1180px){ .home2-grid { grid-template-columns: 360px minmax(0,1fr); } }
@media (max-width: 920px){ .home2-grid { grid-template-columns: 1fr; } .home-rail { position:static; } }

/* region picker: map (+ browse button) on one side, cities chips on the other */
.region-box-body { display:flex; gap:14px; align-items:flex-start; }
.map-col { flex:1 1 60%; min-width:0; display:flex; flex-direction:column; gap:9px; }
.region-cities { flex:1 1 40%; min-width:0; }
.rc-head { font-weight:800; color:var(--brand-dark); font-size:.92rem; margin-bottom:7px; }
.rc-hint { color:var(--text-soft); font-size:.82rem; margin-bottom:8px; }
.rc-subhead { font-weight:700; color:var(--text-soft); font-size:.72rem; text-transform:uppercase; letter-spacing:.3px; margin-bottom:6px; }
.city-pick-list { display:grid; grid-template-columns: repeat(2, 1fr); gap:6px; }
.city-pick-list.single { grid-template-columns: 1fr; }
.city-pick { background:var(--brand-tint); border:1px solid var(--border-soft); border-radius:999px; padding:.42em .6em; cursor:pointer; font-size:.8rem; color:var(--brand-dark); text-align:center; white-space:normal; line-height:1.3; }
.city-pick:hover { background:var(--brand-soft); border-color:var(--brand-light); }
.city-pick.sel { background:var(--brand); color:#fff; border-color:var(--brand); font-weight:700; }
.rc-browse { margin-top:2px; }
@media (max-width: 520px){ .region-box-body { flex-direction:column; } .map-col, .region-cities { flex:1 1 100%; width:100%; } }

/* unified side box: a darker "control panel" holding region + calendar + converter */
.side-panel { padding:16px; background:#a9cdbf; border:1px solid #8fc0ae; }
.side-sec { }
.side-div { border:none; border-top:1px solid rgba(15,70,54,.16); margin:15px 0; }
.region-box { position:relative; }

/* dual Hijri / Gregorian calendar — bordered, sits on the darker panel (no white) */
.dc-cal { background:transparent; border:1px solid rgba(15,70,54,.22); border-radius:var(--radius); padding:9px; }
.dc-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.dc-title { text-align:center; line-height:1.2; flex:1; }
.dc-greg { font-weight:800; color:var(--brand-dark); font-size:.96rem; }
.dc-hijri { font-size:.78rem; color:var(--text-soft); }
.dc-nav { width:28px; height:28px; flex-shrink:0; border:1px solid var(--border); background:#fff; border-radius:var(--radius-sm); cursor:pointer; color:var(--brand-dark); font-size:1rem; line-height:1; }
.dc-nav:hover { background:var(--brand-tint); border-color:var(--brand-light); }
.dc-dows { display:grid; grid-template-columns: repeat(7,1fr); gap:2px; margin-bottom:5px; }
.dc-days { display:grid; grid-template-columns: repeat(7,1fr); grid-auto-rows: 34px; gap:2px; }
.dc-dow { text-align:center; font-weight:700; color:var(--text-soft); font-size:.7rem; }
.dc-cell { position:relative; display:flex; align-items:center; justify-content:center; border-radius:5px; }
.dc-g { font-weight:700; font-size:.8rem; color:var(--text); }
.dc-h { position:absolute; bottom:1px; inset-inline-start:3px; font-size:.55rem; color:var(--text-soft); }
.dc-cell.today { background:var(--brand); }
.dc-cell.today .dc-g { color:#fff; }
.dc-cell.today .dc-h { color:rgba(255,255,255,.85); }

.cat-card {
  background: var(--card); border:1px solid var(--border); border-radius: var(--radius);
  padding: 11px 14px 12px; box-shadow: var(--shadow-sm); transition:.15s;
}
.cat-card:hover { box-shadow: var(--shadow-md); border-color:#cfe3db; }
.cat-card .cat-head {
  display:flex; align-items:center; gap:.5em; margin-bottom:.4em; padding-bottom:.34em;
  border-bottom:2px solid var(--brand-soft);
}
.cat-card .cat-title { font-size:1rem; font-weight:800; color: var(--brand-dark); cursor:pointer; }
.cat-card .cat-title:hover { text-decoration: underline; }
.cat-card .cat-count { margin-inline-start:auto; font-size:.68rem; color:var(--muted); font-weight:700; }
/* every subsection shown as a plain link, in two columns */
.sub-list { columns: 2; column-gap: 14px; }
.sub-link {
  display:block; font-size:.8rem; color: var(--link); cursor:pointer;
  padding:1px 0; line-height:1.5; break-inside:avoid; background:none; border:none;
}
.sub-link:hover { text-decoration: underline; color: var(--link-hover); background:none; }

/* rail boxes (date converter / map / cities) */
.rail-box {
  background: var(--card); border:1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow-sm);
}
.rail-title { font-size:1rem; font-weight:800; color: var(--brand-dark); margin-bottom:.3em; }
.rail-sub { color: var(--text-soft); font-size:.82rem; margin-bottom:.55em; }
.map-wrap { width:100%; }
.map-wrap svg { width:100%; height:auto; display:block; overflow: visible; }
.map-foot { display:flex; align-items:center; justify-content:space-between; margin-top:.5em; gap:10px; }
.map-foot .all-link { font-weight:700; font-size:.86rem; cursor:pointer; }

/* date converter */
.conv-box .conv-tabs { display:flex; gap:6px; background:var(--brand-tint); border:1px solid var(--border-soft); border-radius:999px; padding:3px; margin-bottom:11px; }
.conv-tab { flex:1; border:none; background:none; cursor:pointer; padding:.42em .4em; border-radius:999px; font-weight:700; font-size:.8rem; color:var(--text-soft); }
.conv-tab.active { background:var(--brand); color:#fff; }
.conv-row { display:grid; grid-template-columns: 1fr 1.5fr 1fr; gap:8px; margin-bottom:11px; }
.conv-field { display:flex; flex-direction:column; gap:.25em; font-size:.72rem; color:var(--text-soft); font-weight:700; }
.conv-field select, .conv-field input {
  width:100%; padding:.45em .5em; border:1px solid var(--border); border-radius:var(--radius-sm);
  font-size:.9rem; background:#fff; color:var(--text); outline:none;
}
.conv-field select:focus, .conv-field input:focus { border-color:var(--brand-light); box-shadow:0 0 0 3px var(--brand-soft); }
.conv-out { margin-top:11px; min-height:1.2em; }
.conv-result { background:var(--brand-soft); border:1px solid #c7e6da; border-radius:var(--radius-sm); padding:.6em .7em; text-align:center; }
.conv-result .conv-wd { display:block; font-size:.78rem; color:var(--brand); font-weight:700; }
.conv-result .conv-date { display:block; font-size:1.12rem; font-weight:800; color:var(--brand-dark); margin-top:.1em; }

/* main cities */
.city-list { display:flex; flex-wrap:wrap; gap:7px; }
.city-link { font-size:.82rem; color:var(--brand-dark); background:var(--brand-tint); border:1px solid var(--border-soft); border-radius:999px; padding:.32em .7em; cursor:pointer; }
.city-link:hover { background:var(--brand-soft); border-color:var(--brand-light); text-decoration:none; }

/* Map regions */
.saudi-map { width:100%; height:auto; display:block; overflow:visible; }
.saudi-map text { font-family: var(--ff-en); }
[dir="rtl"] .saudi-map text { font-family: var(--ff-ar); }
.map-fallback { font-size:3rem; text-align:center; padding:30px; }

.region { cursor:pointer; transition: transform .2s cubic-bezier(.34,1.56,.64,1), filter .2s;
  transform-box: fill-box; transform-origin: center;
  filter: drop-shadow(0 2px 1.6px rgba(13,68,52,.40)); outline: none; }
.region:focus-visible .region-shape { stroke: var(--map-stroke); stroke-width: 2.2; }
.region .region-shape {
  fill: url(#regGrad); stroke: #6bbfa3; stroke-width: 1.1;
  vector-effect: non-scaling-stroke; /* crisp, evenly-thick borders at any map size */
  stroke-linejoin: round; transition: fill .18s, stroke .18s, stroke-width .18s;
}
.region-label {
  fill: var(--brand-dark); font-weight: 700; pointer-events: none;
  text-anchor: middle; dominant-baseline: middle; paint-order: stroke;
  stroke: rgba(255,255,255,.9); stroke-width: 3px;
}
.region-label-en {
  fill: #3c6a5c; pointer-events:none; font-weight:600;
  text-anchor: middle; dominant-baseline: middle; paint-order: stroke;
  stroke: rgba(255,255,255,.85); stroke-width: 2px;
}
/* label grows when its region is hovered/focused */
.region-lbl { transition: transform .15s ease; transform-box: fill-box; transform-origin: center; }
.region-lbl.hot { transform: scale(1.5); }
.region-lbl.hot .region-label { fill: var(--map-stroke-hi); }
.region:hover { transform: translateY(-3px) scale(1.02); filter: drop-shadow(0 8px 7px rgba(13,68,52,.50)); }
.region:hover .region-shape { fill: url(#regGradHover); stroke: var(--map-stroke); stroke-width: 1.8; }
.region.active { filter: drop-shadow(0 6px 6px rgba(13,68,52,.50)); }
.region.active .region-shape { fill: url(#regGradActive); stroke: var(--map-stroke); stroke-width: 2; }

/* recent strip */
.recent-strip { margin-top: 26px; }
.recent-strip .strip-head { display:flex; align-items:baseline; gap:.7em; margin-bottom:.7em; }
.recent-strip h2 { font-size:1.18rem; margin:0; }
.card-row { display:grid; grid-template-columns: repeat(4,1fr); gap:14px; }
@media (max-width: 900px){ .card-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px){ .card-row { grid-template-columns: 1fr; } }

/* =========================================================================
   LISTING CARDS / RESULTS
   ========================================================================= */
.layout { display:grid; grid-template-columns: 250px 1fr; gap: 22px; padding: 20px 0 40px; align-items:start; }
@media (max-width: 860px){ .layout { grid-template-columns: 1fr; } }

.sidebar { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:14px; box-shadow:var(--shadow-sm); position:sticky; top:128px; }
.sidebar h4 { font-size:.95rem; text-transform:uppercase; letter-spacing:.4px; color:var(--text-soft); margin-bottom:.5em; }
.filter-group { padding-block: 10px; border-top:1px solid var(--border-soft); }
.filter-group:first-of-type { border-top:none; }
.field { margin-bottom: 11px; }
.field label { display:block; font-size:.82rem; font-weight:700; color:var(--text-soft); margin-bottom:.3em; }
.field input[type=text], .field input[type=number], .field input[type=email], .field input[type=tel],
.field input[type=password], .field input[type=date], .field select, .field textarea {
  width:100%; padding:.5em .65em; border:1px solid var(--border); border-radius:var(--radius-sm);
  font-size:.92rem; background:#fff; color:var(--text); outline:none; transition:.15s;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-light); box-shadow:0 0 0 3px var(--brand-soft); }
.field .hint { font-size:.76rem; color:var(--muted); margin-top:.25em; }
.field.error input, .field.error select, .field.error textarea { border-color: var(--danger); }
.field .errmsg { color: var(--danger); font-size:.78rem; margin-top:.25em; }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:520px){ .row2 { grid-template-columns:1fr; } }
.price-row { display:flex; align-items:center; gap:8px; }
.price-row input { width:100%; }

/* custom checkbox */
.check { display:flex; align-items:flex-start; gap:.5em; cursor:pointer; padding:.22em 0; font-size:.9rem; user-select:none; }
.check input { position:absolute; opacity:0; width:0; height:0; }
.check .box {
  width:18px; height:18px; border:2px solid var(--border); border-radius:5px; flex-shrink:0;
  display:inline-flex; align-items:center; justify-content:center; background:#fff; transition:.12s; margin-top:1px;
}
.check:hover .box { border-color: var(--brand-light); }
.check input:checked + .box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .box::after { content:""; width:5px; height:9px; border:solid #fff; border-width:0 2.5px 2.5px 0; transform: rotate(45deg); margin-top:-2px; }
.check input:focus-visible + .box { box-shadow:0 0 0 3px var(--brand-soft); }

.results-head { display:flex; align-items:center; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.results-head h1 { font-size:1.4rem; margin:0; }
.results-head .count { color:var(--text-soft); font-size:.9rem; }
.results-tools { margin-inline-start:auto; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.results-head .sort { display:flex; align-items:center; gap:.5em; font-size:.88rem; }
.results-head .sort select { padding:.4em .6em; border:1px solid var(--border); border-radius:var(--radius-sm); }

/* view toggle (gallery / grid / list) */
.view-toggle { display:inline-flex; gap:3px; background:var(--brand-tint); border:1px solid var(--border); border-radius:var(--radius-sm); padding:3px; }
.view-btn { display:inline-flex; align-items:center; justify-content:center; width:36px; height:30px; border:none; background:none; border-radius:6px; cursor:pointer; color:var(--text-soft); transition:.12s; }
.view-btn:hover { background:#fff; color:var(--brand-dark); }
.view-btn.active { background:var(--brand); color:#fff; }

/* results containers per view */
.results-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap:14px; }
.results-gallery { display:grid; grid-template-columns: repeat(auto-fill, minmax(248px,1fr)); gap:16px; }
@media (max-width:520px){ .results-gallery { grid-template-columns: 1fr; } .results-grid { grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); } }

/* gallery card */
.gallery-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-sm); cursor:pointer; transition:.15s; }
.gallery-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); border-color:#cfe3db; }
.gallery-card .g-thumb { width:100%; aspect-ratio:16/10; object-fit:cover; background:var(--brand-tint); display:flex; align-items:center; justify-content:center; color:var(--brand-light); font-size:2.6rem; }
.gallery-card .g-body { padding:11px 13px 13px; }
.gallery-card .g-price { color:var(--brand-dark); font-weight:800; font-size:1.05rem; }
.gallery-card .g-title { font-weight:700; margin:.15em 0; overflow:hidden; display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; }
.gallery-card .g-meta { color:var(--muted); font-size:.8rem; }

.listing { display:flex; gap:14px; padding:13px; background:var(--card); border:1px solid var(--border);
  border-radius:var(--radius); margin-bottom:11px; box-shadow:var(--shadow-sm); transition:.15s; cursor:pointer; }
.listing:hover { box-shadow:var(--shadow-md); border-color:#cfe3db; transform: translateY(-1px); }
.listing .thumb { width:150px; height:112px; border-radius:var(--radius-sm); object-fit:cover; background:var(--brand-tint); flex-shrink:0; }
.listing .thumb.placeholder { display:flex; align-items:center; justify-content:center; color:var(--brand-light); font-size:2rem; }
.listing .l-body { flex:1; min-width:0; }
.listing .l-title { font-size:1.08rem; font-weight:700; color:var(--link); margin:0 0 .2em; }
.listing:hover .l-title { text-decoration:underline; }
.listing .l-price { color: var(--brand-dark); font-weight:800; font-size:1.05rem; }
.listing .l-meta { color:var(--text-soft); font-size:.84rem; display:flex; gap:.7em; flex-wrap:wrap; margin-top:.35em; }
.listing .l-desc { color:var(--text-soft); font-size:.9rem; margin-top:.4em; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }

/* card (grid) */
.mini-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-sm); cursor:pointer; transition:.15s; }
.mini-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.mini-card .m-thumb { width:100%; aspect-ratio: 4/3; object-fit:cover; background:var(--brand-tint); display:flex; align-items:center; justify-content:center; color:var(--brand-light); font-size:2.2rem; }
.mini-card .m-body { padding:10px 12px; }
.mini-card .m-price { color:var(--brand-dark); font-weight:800; }
.mini-card .m-title { font-weight:600; font-size:.95rem; margin:.1em 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mini-card .m-meta { color:var(--muted); font-size:.78rem; }

.empty { text-align:center; padding:50px 20px; color:var(--text-soft); }
.empty .big { font-size:2.6rem; margin-bottom:.2em; }

/* My Shop — post-form item boxes */
.shop-item { border:1px solid var(--border); border-radius:var(--radius-sm); padding:11px 13px 6px; margin-bottom:10px; background:var(--brand-tint); }
.shop-item-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.shop-item-head strong { color:var(--brand-dark); font-size:.92rem; }
.shop-rm { color:var(--danger); font-weight:700; }
#addItemBtn { margin-top:2px; }
/* per-item photos (form) */
.item-photos { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:8px 0 4px; }
.ip-thumb { position:relative; width:62px; height:62px; border-radius:var(--radius-sm); overflow:hidden; border:1px solid var(--border); background:#fff; }
.ip-thumb img { width:100%; height:100%; object-fit:cover; }
.ip-thumb .ip-rm { position:absolute; top:2px; inset-inline-end:2px; background:rgba(0,0,0,.6); color:#fff; border:none; border-radius:50%; width:18px; height:18px; cursor:pointer; line-height:1; font-size:.75rem; }
.ip-add { border:1px dashed var(--brand-light); background:var(--brand-tint); color:var(--brand-dark); border-radius:var(--radius-sm); padding:.4em .7em; cursor:pointer; font-size:.82rem; font-weight:700; }
.ip-add:hover { background:var(--brand-soft); }
/* My Shop — detail page item list */
.shop-list { display:flex; flex-direction:column; gap:9px; margin-top:8px; }
.shop-row { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:11px 13px; border:1px solid var(--border-soft); border-radius:var(--radius-sm); background:#fff; }
.shop-row-name { font-weight:700; color:var(--text); }
.shop-row-desc { color:var(--text-soft); font-size:.88rem; margin-top:2px; }
.shop-row-imgs { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.shop-row-imgs img { width:68px; height:68px; object-fit:cover; border-radius:var(--radius-sm); border:1px solid var(--border); }
.item-price-tag { font-weight:800; color:var(--brand-dark); white-space:nowrap; }

/* =========================================================================
   PANELS / FORMS / AUTH
   ========================================================================= */
.panel { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:22px; box-shadow:var(--shadow-sm); }
.panel + .panel { margin-top:18px; }
.page-narrow { max-width: 720px; margin:24px auto; }
.page-mid { max-width: 920px; margin:24px auto; }
.auth-wrap { max-width: 430px; margin: 40px auto; }
.auth-wrap .panel { padding:26px; }
.auth-wrap h1 { text-align:center; color:var(--brand-dark); }
.auth-switch { text-align:center; margin-top:1em; font-size:.9rem; color:var(--text-soft); }

.form-section-title { font-size:1.05rem; color:var(--brand-dark); margin:18px 0 10px; padding-bottom:.3em; border-bottom:1px solid var(--border-soft); }
.help-note { background:var(--brand-tint); border:1px solid #d6ebe2; border-radius:var(--radius-sm); padding:.7em .9em; font-size:.86rem; color:var(--brand-dark); margin-bottom:14px; }

/* image uploader */
.uploader { border:2px dashed var(--border); border-radius:var(--radius); padding:18px; text-align:center; color:var(--text-soft); cursor:pointer; background:var(--brand-tint); transition:.15s; }
.uploader:hover { border-color:var(--brand-light); background:var(--brand-soft); }
.thumbs { display:flex; flex-wrap:wrap; gap:10px; margin-top:12px; }
.thumbs .t { position:relative; width:88px; height:88px; border-radius:var(--radius-sm); overflow:hidden; border:1px solid var(--border); }
.thumbs .t img { width:100%; height:100%; object-fit:cover; }
.thumbs .t button { position:absolute; top:2px; inset-inline-end:2px; background:rgba(0,0,0,.6); color:#fff; border:none; border-radius:50%; width:20px; height:20px; cursor:pointer; line-height:1; font-size:.8rem; }

/* =========================================================================
   DETAIL
   ========================================================================= */
.detail-grid { display:grid; grid-template-columns: 1.6fr 1fr; gap:22px; align-items:start; }
@media (max-width: 800px){ .detail-grid { grid-template-columns:1fr; } }
.gallery .main-img { width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:var(--radius); background:var(--brand-tint); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color:var(--brand-light); font-size:4rem; }
.gallery .strip { display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }
.gallery .strip img { width:70px; height:54px; object-fit:cover; border-radius:6px; border:2px solid transparent; cursor:pointer; }
.gallery .strip img.sel { border-color: var(--brand); }
.detail-price { font-size:1.8rem; font-weight:800; color:var(--brand-dark); }
.detail-meta { display:flex; flex-wrap:wrap; gap:.5em 1em; color:var(--text-soft); font-size:.9rem; margin:.4em 0 1em; }
.detail-body { white-space:pre-wrap; line-height:1.7; }
.reply-box { position:sticky; top:128px; }
.kv { display:flex; justify-content:space-between; gap:1em; padding:.4em 0; border-bottom:1px solid var(--border-soft); font-size:.92rem; }
.kv .k { color:var(--text-soft); }
.kv .v { font-weight:600; }

/* =========================================================================
   ADMIN
   ========================================================================= */
.admin-shell { display:grid; grid-template-columns: 210px 1fr; gap:22px; padding:20px 0 40px; align-items:start; }
@media (max-width: 800px){ .admin-shell { grid-template-columns:1fr; } }
.admin-nav { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:8px; box-shadow:var(--shadow-sm); position:sticky; top:128px; }
.admin-nav button { display:flex; align-items:center; gap:.6em; width:100%; text-align:start; padding:.6em .8em; border:none; background:none; border-radius:var(--radius-sm); cursor:pointer; font-weight:600; color:var(--text); }
.admin-nav button:hover { background:var(--brand-tint); }
.admin-nav button.active { background:var(--brand); color:#fff; }
.stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px; }
@media (max-width:700px){ .stat-grid { grid-template-columns:repeat(2,1fr); } }
.stat { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:16px; box-shadow:var(--shadow-sm); }
.stat .n { font-size:1.9rem; font-weight:800; color:var(--brand-dark); }
.stat .l { color:var(--text-soft); font-size:.85rem; }

table.data { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
table.data th, table.data td { padding:.7em .8em; text-align:start; border-bottom:1px solid var(--border-soft); font-size:.9rem; vertical-align:middle; }
table.data th { background:var(--brand-tint); color:var(--brand-dark); font-weight:700; }
table.data tr:hover td { background:var(--brand-tint); }
table.data .actions { display:flex; gap:6px; flex-wrap:wrap; }
.chiprow { display:flex; flex-wrap:wrap; gap:8px; }
.chip { display:inline-flex; align-items:center; gap:.4em; background:var(--brand-tint); border:1px solid var(--border); border-radius:999px; padding:.3em .7em; font-size:.85rem; }
.chip button { background:none; border:none; color:var(--danger); cursor:pointer; font-weight:700; }

/* =========================================================================
   MODAL + TOAST
   ========================================================================= */
.modal-overlay { position:fixed; inset:0; background:rgba(15,40,32,.5); display:flex; align-items:center; justify-content:center; z-index:100; padding:18px; }
.modal { background:#fff; border-radius:var(--radius); box-shadow:var(--shadow-lg); width:100%; max-width:520px; max-height:88vh; overflow:auto; }
.modal .modal-head { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--border-soft); }
.modal .modal-head h3 { margin:0; }
.modal .modal-body { padding:20px; }
.modal .modal-foot { padding:14px 20px; border-top:1px solid var(--border-soft); display:flex; gap:10px; justify-content:flex-end; }
.modal .x { background:none; border:none; font-size:1.4rem; cursor:pointer; color:var(--muted); line-height:1; }

.region-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.region-grid button { text-align:start; padding:.6em .8em; border:1px solid var(--border); border-radius:var(--radius-sm); background:#fff; cursor:pointer; font-weight:600; color:var(--brand-dark); }
.region-grid button:hover { background:var(--brand-soft); border-color:var(--brand-light); }
.region-grid button.sel { background:var(--brand); color:#fff; border-color:var(--brand); }

#toast-root { position:fixed; inset-block-end:20px; inset-inline-end:20px; z-index:200; display:flex; flex-direction:column; gap:10px; }
.toast { background:var(--text); color:#fff; padding:.8em 1.1em; border-radius:var(--radius-sm); box-shadow:var(--shadow-lg); font-size:.9rem; animation: toastin .25s ease; max-width:320px; }
.toast.ok { background:var(--ok); }
.toast.err { background:var(--danger); }
@keyframes toastin { from { opacity:0; transform: translateY(8px);} to {opacity:1; transform:none;} }

/* =========================================================================
   FOOTER
   ========================================================================= */
#site-footer { background:#0f3a2e; color:#cfe6dd; margin-top:30px; }
.footer-inner { max-width:var(--maxw); margin:0 auto; padding:26px 18px; display:flex; flex-wrap:wrap; gap:18px; align-items:center; justify-content:space-between; }
.footer-inner a { color:#bfe3d6; }
.footer-links { display:flex; gap:16px; flex-wrap:wrap; font-size:.88rem; }
.footer-note { font-size:.8rem; color:#8fc1b2; width:100%; border-top:1px solid rgba(255,255,255,.12); padding-top:12px; margin-top:6px; }

/* calendar */
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
.cal-dow { text-align:center; font-weight:700; color:var(--text-soft); font-size:.8rem; padding:.3em 0; }
.cal-cell { min-height:78px; background:var(--brand-tint); border:1px solid var(--border-soft); border-radius:var(--radius-sm); padding:5px; }
.cal-cell.has { background:#fff; border-color:#cbe6dc; }
.cal-d { font-size:.78rem; font-weight:700; color:var(--text-soft); }
.cal-ev { background:var(--brand); color:#fff; border-radius:4px; padding:1px 5px; font-size:.7rem; margin-top:3px; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cal-ev:hover { background:var(--brand-dark); }
.cal-more { font-size:.68rem; color:var(--muted); margin-top:2px; }
@media (max-width:560px){ .cal-cell { min-height:54px; } .cal-ev { font-size:.6rem; } }

/* utilities */
.flex { display:flex; } .between { justify-content:space-between; } .items-center { align-items:center; }
.gap { gap:12px; } .gap-sm { gap:6px; } .wrap { flex-wrap:wrap; } .mt { margin-top:14px; } .mb { margin-bottom:14px; }
.stack > * + * { margin-top:12px; }
hr.soft { border:none; border-top:1px solid var(--border-soft); margin:16px 0; }
