/* ─────────────────────────────────────────────────────────────────────────────
   places.css — «الأماكن» page (route /). Scoped to .view-places. Reuses the app
   design tokens (style.css) so light/dark + Thmanyah type come for free. RTL,
   mobile-first, utilitarian — a planning surface, not a photo essay.
   ───────────────────────────────────────────────────────────────────────────── */

.view-places {
  max-width: var(--container);
  margin: 0 auto;
  /* bottom clearance ≥ FAB height + offset so the last card's actions stay tappable */
  padding: 14px 16px calc(96px + env(safe-area-inset-bottom, 0px));
}

/* ── Header ─────────────────────────────────────────────────────────────────*/
.pl-head {
  padding: 8px 2px 14px;
}
.pl-eyebrow {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.pl-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
/* ── «اليوم» cockpit — the day-aware answer card under the title ────────────*/
.pl-today {
  margin: 2px 0 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.pl-today-eyebrow {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--brand);
}
.pl-today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.pl-today-city {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: 999px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent);
  transition: transform 0.1s;
}
.pl-today-city:active {
  transform: scale(0.96);
}
.pl-today-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.pl-today-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}
.pl-today-line strong {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink);
}
.pl-today-sub {
  font-size: 0.84rem;
  color: var(--ink-2);
}
.pl-today--before .pl-today-link,
.pl-today--after .pl-today-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--brand);
}
.pl-today-text {
  margin: 8px 0 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink-2);
  cursor: pointer;
}
.pl-today-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pl-today-next {
  margin-top: 9px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 8px;
}
.pl-today-next-sum {
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-2);
}
.pl-today-next-sum::-webkit-details-marker {
  display: none;
}
.pl-today-next-sum::after {
  content: " ▾";
  color: var(--muted);
}
.pl-today-next[open] .pl-today-next-sum::after {
  content: " ▴";
}
.pl-today-next-text {
  margin: 6px 0 0;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--ink-2);
}

/* ── Sticky head: city switcher + category jumpbar + search ─────────────────*/
.pl-stickyhead {
  position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top));
  z-index: 30;
  margin: 0 -16px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.pl-switch {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 0 8px;
}
.pl-switch::-webkit-scrollbar {
  display: none;
}
.pl-jumpbar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 0 9px;
}
.pl-jumpbar::-webkit-scrollbar {
  display: none;
}
.pl-jump {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  transition: transform 0.1s;
}
.pl-jump:active {
  transform: scale(0.95);
}
.pl-jump-count {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
}
.pl-search-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
}
.pl-search-toggle svg {
  width: 15px;
  height: 15px;
}
.pl-search {
  display: none;
  padding: 0 0 9px;
}
.pl-search.is-open {
  display: block;
}
.pl-search-input {
  width: 100%;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}
.pl-search-input:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 1px;
}
/* jump targets land below the topbar + sticky head */
.pl-cat {
  scroll-margin-top: calc(var(--topbar-h) + env(safe-area-inset-top) + 118px);
}
.pl-city {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 15px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.1s;
}
.pl-city:active {
  transform: scale(0.96);
}
.pl-city.is-active {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  color: var(--ink);
}
.pl-city-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}
.pl-city.is-active .pl-city-name {
  color: var(--brand);
}
.pl-city-en {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--muted);
}
.pl-city-sub {
  margin: 12px 2px 0;
  min-height: 1.2em;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Toolbar (قريب مني + sort hint) ─────────────────────────────────────────*/
.pl-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 2px 4px;
}
.pl-near {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s;
}
.pl-near:active {
  transform: scale(0.96);
}
.pl-near.is-active {
  background: color-mix(in srgb, var(--brand-2) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--brand-2) 50%, transparent);
  color: var(--brand-2);
}
.pl-near.is-loading {
  opacity: 0.7;
}
.pl-near-ico {
  display: inline-flex;
  width: 16px;
  height: 16px;
}
.pl-near-ico svg {
  width: 100%;
  height: 100%;
}
.pl-sort-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Category blocks ────────────────────────────────────────────────────────*/
.pl-blocks {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 18px;
}
.pl-cat-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.pl-cat-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
  font-weight: 700;
  color: var(--ink);
}
.pl-cat-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.pl-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pl-empty {
  margin: 2px 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.pl-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 2px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.pl-divider::before,
.pl-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--line-strong) 0 5px,
    transparent 5px 10px
  );
}

/* ── Place card (dense: the daily list is scanned, not read) ────────────────*/
.pl-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 13px;
  box-shadow: var(--shadow-sm);
}
.pl-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.pl-card-title-wrap {
  min-width: 0;
}
.pl-card-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}
.pl-card-en {
  display: block;
  margin-top: 1px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--muted);
  direction: ltr;
  text-align: start;
}
.pl-marks {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.pl-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.pl-badge-ico {
  display: inline-flex;
  width: 13px;
  height: 13px;
}
.pl-badge-ico svg {
  width: 100%;
  height: 100%;
}
.pl-km {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
}
.pl-km-ico {
  display: inline-flex;
  width: 12px;
  height: 12px;
  opacity: 0.85;
}
.pl-km-ico svg {
  width: 100%;
  height: 100%;
}
.pl-card-area {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.pl-card-area-ico {
  display: inline-flex;
  width: 13px;
  height: 13px;
  flex: none;
}
.pl-card-area-ico svg {
  width: 100%;
  height: 100%;
}
.pl-tags {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 6px;
  margin-top: 6px;
}
.pl-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand-2);
  background: color-mix(in srgb, var(--brand-2) 10%, transparent);
  padding: 2px 9px;
  border-radius: 999px;
}
.pl-card-note {
  margin: 6px 0 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pl-warn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 9px;
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 32%, transparent);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 0.83rem;
  line-height: 1.55;
  color: var(--ink);
}
.pl-warn-ico {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--gold);
}
.pl-warn-ico svg {
  width: 100%;
  height: 100%;
}
.pl-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 8px;
}
/* Icon-only secondary actions: labels stay in the DOM (a11y + render-check) */
.pl-btn-txt {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.pl-maps,
.pl-spend-btn {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
}
.pl-maps .pl-maps-ico,
.pl-spend-btn .pl-spend-ico {
  width: 17px;
  height: 17px;
}
.pl-phone {
  margin-inline-end: auto;
  font-size: 0.82rem;
  color: var(--muted);
}
.pl-maps {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.pl-maps:hover {
  background: color-mix(in srgb, var(--brand) 16%, transparent);
}
.pl-maps-ico {
  display: inline-flex;
  width: 14px;
  height: 14px;
}
.pl-maps-ico svg {
  width: 100%;
  height: 100%;
}

/* ── Reveals: hotels + off-route aside (native <details>) ───────────────────*/
.pl-reveal,
.pl-aside {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}
.pl-aside {
  margin-top: 34px;
}
.pl-reveal-sum,
.pl-aside-sum {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
}
.pl-reveal-sum::-webkit-details-marker,
.pl-aside-sum::-webkit-details-marker {
  display: none;
}
.pl-reveal-ico {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--brand);
}
.pl-reveal-ico svg {
  width: 100%;
  height: 100%;
}
.pl-reveal-title,
.pl-aside-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
}
.pl-reveal-count,
.pl-aside-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--bg);
  background: var(--muted);
  padding: 1px 8px;
  border-radius: 999px;
}
.pl-reveal-chev,
.pl-aside-chev {
  margin-inline-start: auto;
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.pl-reveal-chev svg,
.pl-aside-chev svg {
  width: 100%;
  height: 100%;
}
.pl-reveal[open] .pl-reveal-chev,
.pl-aside[open] .pl-aside-chev {
  transform: rotate(180deg);
}
.pl-reveal > .pl-list,
.pl-aside-body {
  padding: 4px 13px 14px;
}
.pl-aside-lead {
  margin: 0 2px 12px;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.pl-off-group + .pl-off-group {
  margin-top: 18px;
}
.pl-off-city {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
}
.pl-off-en {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── «مختارة» shared selection toggle ───────────────────────────────────────*/
.pl-sel {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.1s;
}
.pl-sel:active {
  transform: scale(0.94);
}
.pl-sel-ico {
  display: inline-flex;
  width: 14px;
  height: 14px;
  opacity: 0.45;
  transition: opacity 0.15s;
}
.pl-sel-ico svg {
  width: 100%;
  height: 100%;
}
.pl-sel.is-on {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 13%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
}
.pl-sel.is-on .pl-sel-ico {
  opacity: 1;
}
.pl-sel-by {
  margin-top: 7px;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: start;
}
.pl-sel-by:empty {
  display: none;
}

/* ── Name picker (first-run identity, in the bottom sheet) ───────────────────*/
.np-lede {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.np-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.np-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s;
}
.np-name:active {
  transform: scale(0.98);
}
.np-name.is-current {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  color: var(--brand);
}
.np-name-covers {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.np-name.is-current .np-name-covers {
  color: var(--brand);
}
.np-note {
  margin: 14px 2px 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--gold);
}

/* ── «+ سعر/إيصال» capture button + per-place spend line (Phase 3) ────────────*/
.pl-spend-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition:
    background 0.15s,
    transform 0.1s;
}
.pl-spend-btn:active {
  transform: scale(0.94);
}
.pl-spend-btn:hover {
  background: color-mix(in srgb, var(--gold) 16%, transparent);
}
.pl-spend-ico {
  display: inline-flex;
  width: 14px;
  height: 14px;
}
.pl-spend-ico svg {
  width: 100%;
  height: 100%;
}
.pl-spend {
  margin-top: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  text-align: start;
}
.pl-spend:empty {
  display: none;
}

/* ── Floating standalone «+ مصروف» add (Phase 3) ─────────────────────────────*/
.pl-fab {
  position: fixed;
  inset-block-end: calc(18px + env(safe-area-inset-bottom, 0px));
  inset-inline-end: 18px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 13px 18px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 999px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 40%, transparent);
  transition: transform 0.12s;
}
.pl-fab:active {
  transform: scale(0.95);
}
.pl-fab-ico {
  display: inline-flex;
  width: 18px;
  height: 18px;
}
.pl-fab-ico svg {
  width: 100%;
  height: 100%;
}

@media (min-width: 680px) {
  .pl-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .pl-divider {
    grid-column: 1 / -1;
  }
}
