/* ── Restaurant document styles (one-shell card unification, Step B) ──
   The visual half of the restaurant component (_restaurant_doc.html).
   Consumed by: the /r/ shell pages + /r-prototype (linked in head) and
   the in-map restaurant card (lazy-injected by js/sheet-restaurant.js).
   Extracted from the prototype's inline styles — ONE copy. Bump ?v= on
   change everywhere it's referenced. */
.doc-header {
      position: sticky; top: 0; z-index: 5;
      display: flex; align-items: center; gap: 10px;
      padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
      background: rgba(14,14,14,0.92); backdrop-filter: none;
      border-bottom: 1px solid #1f1f1f;
    }
.doc-header img { height: 26px; }
.doc-wordmark { font-size: 11px; font-weight: 700; color: #f97316; text-transform: uppercase; letter-spacing: 1.5px; }
.doc-proto-badge { margin-left: auto; font-size: 10px; font-weight: 700; color: #999; border: 1px solid #333; border-radius: 5px; padding: 2px 7px; letter-spacing: 0.5px; }
.doc-hero-photo { width: 100%; height: 210px; object-fit: cover; border-radius: 14px; background: #1a1a1a; display: block; }
.doc-title { font-size: clamp(24px, 5.5vw, 34px); font-weight: 800; color: #fff; line-height: 1.15; margin: 16px 0 6px; }
.doc-meta { font-size: 13.5px; color: #999; line-height: 1.6; margin: 0 0 4px; }
.doc-meta b { color: #f59e0b; font-weight: 700; }
.doc-section-h { font-size: 18px; font-weight: 800; color: #e5e5e5; margin: 26px 0 12px; }
.doc-deal {
      background: #161616; border: 1px solid #242424; border-radius: 12px;
      padding: 12px 14px; margin-bottom: 8px;
    }
.doc-deal-title { font-size: 15px; font-weight: 700; color: #fff; margin: 0 0 3px; }
.doc-deal-desc { font-size: 13px; color: #999; line-height: 1.5; margin: 0; }
.doc-hours { font-size: 13.5px; color: #bbb; line-height: 1.8; }
.doc-hours b { color: #e5e5e5; font-weight: 600; }
.doc-hours .today-row b { color: #f97316; }
/* Open/closed status chip in the hero */
    .doc-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 5px 11px; margin: 2px 0 6px; }
.doc-status.open { color: #22c55e; background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.35); }
.doc-status.closed { color: #999; background: rgba(153,153,153,0.08); border: 1px solid #333; }
.doc-status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* SAVE + FOLLOW — primary consumer actions (real /r/ page parity;
       paint states are set inline by JS exactly like restaurant-page.js) */
    .doc-primary-row { display: flex; gap: 10px; margin: 14px 0 2px; }
.doc-primary {
      flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
      background: transparent; border: 1.5px solid #f97316; color: #f97316;
      border-radius: 12px; padding: 12px 10px;
      font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
    }
.doc-primary svg { width: 17px; height: 17px; flex-shrink: 0; }
/* CTA row — call / directions / website / menu / share */
    .doc-ctas { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.doc-cta {
      flex: 1; min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 5px;
      background: #161616; border: 1px solid #2a2a2a; border-radius: 12px;
      padding: 11px 6px 9px; color: #e5e5e5; font-size: 11.5px; font-weight: 600;
      text-decoration: none; font-family: inherit; cursor: pointer;
    }
.doc-cta svg { color: #f97316; }
.doc-cta:hover { border-color: #f97316; }
/* Day strip — Mon–Sun chips, today ringed, counts badged */
    .doc-daystrip { display: flex; gap: 6px; margin: 2px 0 12px; }
.doc-day {
      flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
      background: #161616; border: 1px solid #2a2a2a; border-radius: 10px;
      padding: 8px 2px 7px; color: #bbb; font-size: 12px; font-weight: 700;
      font-family: inherit; cursor: pointer;
    }
.doc-day .dc { font-size: 10px; font-weight: 600; color: #777; }
.doc-day.has .dc { color: #f97316; }
.doc-day.sel { background: #f97316; border-color: #f97316; color: #fff; }
.doc-day.sel .dc { color: rgba(255,255,255,0.85); }
.doc-day.today:not(.sel) { border-color: rgba(249,115,22,0.55); }
.doc-day.none { opacity: 0.45; }
.doc-day-sub { font-size: 12px; color: #888; margin: 0 0 10px; }
.doc-day-sub b { color: #e5e5e5; }
/* Deal card extras */
    .doc-deal-top { display: flex; align-items: baseline; gap: 8px; }
.doc-deal-title { flex: 1; }
.doc-price { font-size: 13.5px; font-weight: 800; color: #f97316; white-space: nowrap; }
.doc-deal-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.doc-tag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; border-radius: 5px; padding: 2px 7px; border: 1px solid; }
.doc-tag.wings { color: #f97316; border-color: rgba(249,115,22,0.45); }
.doc-tag.beer { color: #f59e0b; border-color: rgba(245,158,11,0.45); }
.doc-tag.drinks { color: #a78bfa; border-color: rgba(167,139,250,0.45); }
.doc-tag.food { color: #34d399; border-color: rgba(52,211,153,0.45); }
.doc-tag.happy_hour { color: #60a5fa; border-color: rgba(96,165,250,0.45); }
.doc-time { font-size: 11.5px; color: #999; }
.doc-also { font-size: 11px; color: #777; }
.doc-deal-heart {
      margin-left: auto; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      width: 28px; height: 28px; border-radius: 8px;
      background: none; border: 1px solid #2e2e2e; color: #999; cursor: pointer;
    }
.doc-deal-heart:hover { color: #f97316; border-color: rgba(249,115,22,0.5); }
.doc-deal-heart.on { color: #f97316; border-color: rgba(249,115,22,0.6); }
.doc-deal-share {
      flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      width: 28px; height: 28px; border-radius: 8px;
      background: none; border: 1px solid #2e2e2e; color: #999; cursor: pointer;
    }
.doc-deal-share:hover { color: #f97316; border-color: rgba(249,115,22,0.5); }
.doc-deal-share.shared { color: #22c55e; border-color: rgba(34,197,94,0.6); }
.doc-hours-toggle {
      margin-top: 8px; /* sits directly under the CTA row (owner call 2026-06-13) */
      display: flex; align-items: center; justify-content: space-between; gap: 10px;
      width: 100%; background: #161616; border: 1px solid #242424; border-radius: 12px;
      padding: 12px 14px; font-family: inherit; font-size: 13.5px; color: #bbb;
      cursor: pointer; text-align: left;
    }
.doc-hours-toggle b { color: #f97316; font-weight: 700; }
.doc-hours-toggle .chev { color: #777; transition: transform 0.2s; flex-shrink: 0; }
.doc-hours-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
#doc-hours-full { margin-top: 10px; padding: 0 4px; }
.doc-live {
      display: inline-flex; align-items: center; gap: 5px;
      font-size: 10.5px; font-weight: 800; letter-spacing: 0.5px; color: #22c55e;
    }
.doc-live .dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; animation: doc-live-pulse 2s ease-in-out infinite; }
.doc-verified { color: #10b981; font-size: 11px; font-weight: 700; }
.doc-empty-day { background: #141414; border: 1px dashed #2e2e2e; border-radius: 12px; padding: 18px 14px; text-align: center; font-size: 13px; color: #999; }
.doc-empty-day button { margin-top: 10px; background: none; border: 1px solid rgba(249,115,22,0.5); color: #f97316; border-radius: 999px; padding: 7px 14px; font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
/* Photo strip (only when the API ships images) */
    .doc-photos { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 4px 0 6px; }
.doc-photos img { height: 92px; border-radius: 10px; flex-shrink: 0; }
/* Reviews summary (no review text in the public API — honest summary
       card + a link out to Google) */
    .doc-reviews { display: flex; align-items: center; gap: 14px; background: #161616; border: 1px solid #242424; border-radius: 12px; padding: 14px; }
.doc-reviews .score { font-size: 30px; font-weight: 800; color: #fff; }
.doc-reviews .stars { color: #f59e0b; font-size: 14px; letter-spacing: 2px; }
.doc-reviews .sub { font-size: 12px; color: #999; margin-top: 2px; }
.doc-reviews a { margin-left: auto; flex-shrink: 0; font-size: 12.5px; font-weight: 700; color: #f97316; text-decoration: none; border: 1px solid rgba(249,115,22,0.5); border-radius: 999px; padding: 8px 13px; }
/* Server-fragment blocks (Phase 2/3): breadcrumb, visitor reviews +
       form, events, the SEO nearby-links band, the claimed-owner strip,
       and the push-deep-link highlight. */
    .doc-breadcrumb { font-family: ui-monospace, Menlo, monospace; font-size: 11px; letter-spacing: 0.04em; color: #7c828a; margin: 0 0 10px; }
.doc-breadcrumb a { color: #7c828a; text-decoration: none; }
.doc-breadcrumb a:hover { color: #f97316; }
.doc-breadcrumb .sep { color: #4b5159; margin: 0 6px; }
.doc-breadcrumb .here { color: #b8bdc4; }
.doc-write-row { margin: 10px 0 4px; }
.doc-write-row > button { width: 100%; text-align: left; background: #161616; border: 1px dashed #2e2e2e; border-radius: 10px; padding: 11px 13px; font-size: 13px; color: #b8bdc4; cursor: pointer; }
.doc-write-row > button:hover { border-color: rgba(249,115,22,0.5); color: #f97316; }
#review-form textarea { width: 100%; min-height: 92px; resize: vertical; background: #141414; border: 1px solid #2a2a2a; border-radius: 10px; color: #e5e5e5; font: inherit; font-size: 13.5px; padding: 10px 12px; margin-top: 8px; box-sizing: border-box; }
.doc-review-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.doc-review-foot span { font-size: 11.5px; color: #777; }
.doc-review-foot .btns { display: flex; gap: 8px; }
.doc-review-foot button { padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; border: 1px solid #333; background: transparent; color: #b8bdc4; }
.doc-review-foot #review-submit-btn { background: #f97316; border-color: #f97316; color: #1a0a00; }
.doc-review-date { font-weight: 500; color: #6f757d; margin-left: 8px; font-size: 11px; }
.doc-review-resp { margin-top: 8px; padding: 8px 10px; border-left: 2px solid rgba(249,115,22,0.5); background: rgba(249,115,22,0.05); border-radius: 0 8px 8px 0; font-size: 12.5px; color: #a8adb4; }
.doc-review-resp b { display: block; font-size: 11px; color: #f97316; margin-bottom: 2px; }
.doc-deal-hi { border-color: rgba(249,115,22,0.75) !important; box-shadow: 0 0 0 1px rgba(249,115,22,0.45), 0 0 24px rgba(249,115,22,0.18); transition: box-shadow .4s ease, border-color .4s ease; }
.doc-review-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.doc-review { background: #141414; border: 1px solid #222; border-radius: 10px; padding: 10px 12px; }
.doc-review-name { margin: 0 0 3px; font-size: 12px; font-weight: 800; color: #cfcfcf; }
.doc-events { display: flex; flex-direction: column; gap: 8px; }
.doc-event { display: flex; gap: 10px; align-items: flex-start; background: #161616; border: 1px solid #242424; border-radius: 12px; padding: 12px; }
.doc-event.today { border-color: rgba(249,115,22,0.45); }
.doc-event-tag { flex-shrink: 0; font-size: 10px; font-weight: 800; letter-spacing: 0.6px; color: #f97316; border: 1px solid rgba(249,115,22,0.5); border-radius: 999px; padding: 3px 8px; margin-top: 1px; }
.doc-event-title { margin: 0; font-size: 13.5px; font-weight: 700; color: #e5e5e5; }
.doc-event-when { margin: 2px 0 0; font-size: 12px; color: #999; }
.doc-event-desc { margin: 4px 0 0; font-size: 12px; color: #888; line-height: 1.4; }
.doc-nearlinks-h { margin: 14px 0 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #777; }
.doc-nearlinks { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 4px; }
.doc-nearlinks a { font-size: 12px; color: #cfcfcf; text-decoration: none; background: #161616; border: 1px solid #262626; border-radius: 999px; padding: 6px 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-nearlinks a span { color: #8f8f8f; }
.doc-owner { margin: 0; font-size: 12.5px; font-weight: 700; color: #34d399; background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.3); border-radius: 12px; padding: 12px 14px; }
/* Owner claim strip (mirrors the real /r/ page's dashed claim band) */
    .doc-claim { display: flex; align-items: center; gap: 12px; background: rgba(20,24,28,0.6); border: 1px dashed #3a3a3a; border-radius: 12px; padding: 13px 14px; text-decoration: none; }
.doc-claim .ct { flex: 1; min-width: 0; }
.doc-claim .ct b { display: block; font-size: 12.5px; color: #e5e5e5; }
.doc-claim .ct span { font-size: 12px; color: #999; line-height: 1.4; }
.doc-claim .go { flex-shrink: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #f97316; }
/* Invitation 1 — the number, right after their deals */
    .doc-nearby {
      display: flex; align-items: center; gap: 10px; width: 100%;
      background: rgba(249,115,22,0.08); border: 1.5px solid rgba(249,115,22,0.45);
      border-radius: 12px; padding: 13px 14px; margin: 14px 0 4px;
      font-family: inherit; font-size: 14.5px; font-weight: 600; color: #f97316;
      cursor: pointer; text-align: left;
    }
.doc-nearby:hover { background: rgba(249,115,22,0.14); }
.doc-nearby .dn-sub { display: block; font-size: 11.5px; font-weight: 500; color: #999; margin-top: 2px; }
/* Invitation 3 — the scroll-end porthole. The element itself is a
       transparent placeholder; the real map shows through the clip window
       synced to this rect. */
    #doc-porthole {
      position: relative;
      /* A SQUARE window (capped on short viewports) — the wide short
         rectangle undersold the scene; the restaurant sits centred in
         this via the scroll-rest re-pad. */
      width: 100%;
      aspect-ratio: 1 / 1;
      height: auto;
      min-height: 280px;
      max-height: min(62vh, 560px);
      border: 1.5px solid rgba(249,115,22,0.5); border-radius: 16px;
      margin: 10px 0 18px; cursor: pointer;
      overflow: hidden; /* round-clips the docked map canvas */
      background: #0c1118; /* visible until the map docks in */
    }
/* The caption reads as a BUTTON (solid brand fill) — testing showed a
       ghost pill didn't communicate "tap me". pointer-events stays none:
       the entire porthole is the tap target; this is just its label. */
    #doc-porthole .ph-caption {
      position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
      z-index: 5; white-space: nowrap;
      background: #f97316; border: none; border-radius: 999px;
      padding: 11px 20px; font-size: 13.5px; font-weight: 700; color: #fff;
      box-shadow: 0 4px 18px rgba(249,115,22,0.45);
      pointer-events: none;
    }
#doc-porthole:hover .ph-caption { background: #ea580c; }
#doc-porthole:active { transform: scale(0.995); }
/* Soft pulsing ring on the frame — pre-rendered border, OPACITY
       animated (compositor-only, no per-frame paint). */
    /* INNER ring (inset 6px) with z above the docked canvas — the old
       -4px outer ring was clipped away by the porthole's overflow:hidden
       and painted under the map's z-index:1 besides. */
    #doc-porthole::after {
      content: ''; position: absolute; inset: 6px; border-radius: 11px;
      border: 2px solid rgba(249,115,22,0.6);
      opacity: 0; pointer-events: none;
      z-index: 4;
      animation: ph-ring 2.6s ease-in-out infinite;
    }
@media (prefers-reduced-motion: reduce) {
      #doc-porthole::after { animation: none; }
    }
.doc-foot { font-size: 11px; color: #666; text-align: center; line-height: 1.6; padding-bottom: env(safe-area-inset-bottom); }

/* ── Card posture (in-map sheet): the map IS behind the card — hide the
   document's map-window block, SEO link band, claim strip, breadcrumb. ── */
#detail-content.wbs-card-mode .doc-breadcrumb,
#detail-content.wbs-card-mode #doc-porthole,
#detail-content.wbs-card-mode h2.doc-section-h:has(+ #doc-porthole),
#detail-content.wbs-card-mode .doc-nearlinks-h,
#detail-content.wbs-card-mode .doc-nearlinks,
#detail-content.wbs-card-mode #doc-nearby-btn,
#detail-content.wbs-card-mode .doc-claim { display: none; }
#detail-content.wbs-card-mode .doc-title { font-size: 22px; margin-top: 6px; }
#detail-content.wbs-card-mode .doc-hero-photo { max-height: 160px; object-fit: cover; width: 100%; border-radius: 12px; }

/* Card header bar: breadcrumb back to the feed + close (spec §6.1).
   This IS the card's chrome — the panel's legacy strip steps back below. */
.wbs-card-bar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 6px;
  background: rgba(18,18,18,0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #242424; margin: 0 -4px; padding: 0 4px; }
.wbs-card-crumb { flex: 1; min-width: 0; text-align: left; background: none; border: 0;
  color: #f97316; font-size: 13px; font-weight: 700; padding: 12px 4px; cursor: pointer;
  font-family: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wbs-card-crumb:hover { color: #fff; }
.wbs-card-x { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,0.08); color: #ccc; font-size: 19px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-family: inherit; }
.wbs-card-x:hover { background: rgba(255,255,255,0.16); color: #fff; }

/* Legacy panel chrome in card mode (desktop clash, owner screenshot
   2026-06-13): the floating ✕ ghosted over the card and the old strip
   left a dead gap. The crumb bar's ✕ replaces it everywhere; the strip
   itself survives ONLY on mobile, where its drag-handle is the
   swipe-to-close grip. */
#detail-panel:has(#detail-content.wbs-card-mode) .detail-close-btn { display: none; }
@media (min-width: 768px) {
  #detail-panel:has(#detail-content.wbs-card-mode) .detail-top-bar { display: none; }
}

/* Card loading state */
.wbs-card-loading { display: flex; align-items: center; gap: 10px; color: #999; font-size: 13.5px; padding: 26px 4px; }
.wbs-card-loading .sp { width: 16px; height: 16px; border: 2px solid rgba(249,115,22,0.3); border-top-color: #f97316;
  border-radius: 50%; animation: wbs-card-spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes wbs-card-spin { to { transform: rotate(360deg); } }
