/* Top-bar slot for feature buttons (feedback icon). Empty in the baseline. */
.topbar-actions { display: inline-flex; align-items: center; gap: 8px; }
.topbar-actions:empty { display: none; }

/* #toast used to live inside #screen-calendar, which is `position: relative`,
   so its `position: absolute` resolved against that screen. Now that the shell
   hoists it to top level — where <body> has no `position` — it must be fixed,
   or it silently resolves against the initial containing block instead.
   Matches #loading-overlay, which is already `position: fixed`. */
#toast { position: fixed; }

/* iOS-style save confirmation. No file is actually written. */
#save-confirm {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; z-index: 60; opacity: 0; transition: opacity .18s ease;
}
#save-confirm.is-visible { opacity: 1; }
.save-confirm-box {
  background: rgba(0, 0, 0, .82); color: #fff; border-radius: 14px;
  padding: 22px 26px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font); font-size: 15px; font-weight: 500; min-width: 180px;
}
.save-confirm-tick { font-size: 40px; line-height: 1; color: var(--cyan); }

/* ---------- Social card (Part 1) ---------- */
.tick-card {
  width: 420px; height: 420px; background: #fff; border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column; font-family: var(--font); color: var(--ink);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); flex: none;
}
.tick-card-top { background: var(--blue); color: #fff; padding: 22px 22px 18px; position: relative; }
.tick-card-eyebrow {
  margin: 0; font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase;
  opacity: .82; font-weight: 500;
}
.tick-card-percent { margin: 6px 0 0; font-size: 72px; font-weight: 700; line-height: .92; }
.tick-card-percent span { font-size: 30px; font-weight: 500; }
.tick-card-message { margin: 8px 0 0; font-size: 17px; font-weight: 700; line-height: 1.22; }
.tick-card-cta { margin: 5px 0 0; font-size: 12px; font-weight: 400; opacity: .9; }
.tick-card-watermark {
  position: absolute; right: 14px; bottom: 10px; font-size: 10px;
  letter-spacing: .5px; color: rgba(255, 255, 255, .75); font-weight: 500;
}
.tick-card-mid { flex: 1; padding: 13px 22px; overflow: hidden; }
.tick-card-midlabel {
  margin: 0 0 8px; font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.tick-card-days { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; }
.tick-card-day {
  aspect-ratio: 1; border-radius: 2px; background: var(--panel); color: var(--muted);
  font-size: 9px; display: flex; align-items: center; justify-content: center;
}
.tick-card-day.is-high-risk { background: var(--cyan); color: #fff; font-weight: 700; }
.tick-card-foot {
  border-top: 1px solid var(--border); padding: 12px 22px 14px;
  display: flex; align-items: center; gap: 11px;
}
.tick-card-mark {
  width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex: none; letter-spacing: .3px;
}
.tick-card-vet { display: flex; flex-direction: column; line-height: 1.3; }
.tick-card-vet b { font-size: 13px; font-weight: 700; }
.tick-card-vet i { font-style: normal; font-size: 11px; color: var(--muted); }

/* ---------- Export panel (Parts 1 + 2) ---------- */
/* Fixed, not absolute: #overlay-mount is a top-level div with no `position`,
   so `absolute` would resolve against the initial containing block. */
.xp-root { position: fixed; inset: 0; z-index: 50; }
.xp-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.xp-panel {
  position: absolute; inset: 18px; background: #fff; border-radius: 12px; overflow: hidden;
  display: flex; box-shadow: 0 14px 40px rgba(0, 0, 0, .3); font-family: var(--font);
}
.xp-controls {
  width: 300px; flex: none; border-right: 1px solid var(--border);
  padding: 14px 16px 16px; overflow-y: auto; display: flex; flex-direction: column;
}
.xp-head { display: flex; align-items: center; margin-bottom: 10px; }
.xp-head h3 { margin: 0; font-size: 15px; color: var(--ink); }
.xp-close {
  margin-left: auto; background: none; border: 0; font-size: 22px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 4px;
}
.xp-label {
  font-size: 10px; letter-spacing: .7px; text-transform: uppercase; color: var(--muted);
  font-weight: 700; margin: 12px 0 4px; display: flex; align-items: center; gap: 6px;
}
.xp-badge {
  background: var(--panel); color: var(--blue); border-radius: 3px;
  font-size: 9px; font-weight: 700; padding: 2px 5px; letter-spacing: .3px;
}
.xp-field {
  font: 400 13px/1.3 var(--font); color: var(--ink); background: #fff;
  border: 1px solid var(--border); border-radius: 4px; padding: 7px 8px; width: 100%;
}
.xp-field:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.xp-textarea { resize: vertical; min-height: 68px; }
.xp-seg { display: flex; gap: 4px; }
.xp-seg button {
  flex: 1; font: 700 11px/1 var(--font); padding: 7px 4px; cursor: pointer;
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px;
}
.xp-seg button.is-active { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.xp-seg-period button { flex: 0 0 42px; }
.xp-save {
  margin-top: auto; background: var(--cyan); color: #fff; border: 0; border-radius: 5px;
  font: 700 13px/1 var(--font); padding: 11px; cursor: pointer;
}
.xp-save:hover { background: var(--cyan-active); }
.xp-preview {
  flex: 1; background: var(--panel); display: flex; flex-direction: column;
  align-items: center; gap: 12px; padding: 16px; overflow: auto;
  /* `safe center` centers short content but aligns to start once content
     overflows. Plain `center` triggers flexbox unsafe-centering: the overflow
     above the start edge falls outside the scrollable region and cannot be
     reached, because scrollTop cannot go negative. That hid the 12-month PDF's
     branded header entirely. The plain declaration is the fallback for engines
     without `safe`. */
  justify-content: center;
  justify-content: safe center;
}
.xp-stage { display: flex; align-items: center; justify-content: center; }
.xp-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.xp-dot {
  width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--border);
}
.xp-dot.is-active { background: var(--cyan); }
.xp-placeholder { color: var(--muted); font-size: 13px; }

/* ---------- PDF preview (Part 2) ---------- */
.pdf-page {
  width: 360px; min-height: 480px; background: #fff; border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2); padding: 20px 22px;
  font-family: var(--font); color: var(--ink); flex: none;
}
.pdf-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px; border-bottom: 2px solid var(--border); margin-bottom: 14px;
}
.pdf-head.is-branded { border-bottom-color: var(--blue); }
.pdf-mark {
  width: 32px; height: 32px; border-radius: 6px; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex: none;
}
.pdf-clinic { display: flex; flex-direction: column; line-height: 1.3; }
.pdf-clinic b { font-size: 13px; }
.pdf-clinic i { font-style: normal; font-size: 10px; color: var(--muted); }
.pdf-title { margin: 0; font-size: 20px; color: var(--blue); }
.pdf-summary { margin: 4px 0 0; font-size: 13px; }
.pdf-summary b { font-size: 20px; color: var(--cyan); }
.pdf-note { margin: 8px 0 14px; font-size: 10px; line-height: 1.45; color: var(--muted); }
.pdf-month { margin-bottom: 12px; }
.pdf-month h4 {
  margin: 0 0 5px; font-size: 10px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted);
}
.pdf-days { display: grid; grid-template-columns: repeat(11, 1fr); gap: 2px; }
.pdf-day {
  aspect-ratio: 1; border-radius: 2px; background: var(--panel); color: var(--muted);
  font-size: 8px; display: flex; align-items: center; justify-content: center;
}
.pdf-day.is-high-risk { background: var(--blue); color: #fff; font-weight: 700; }
.pdf-foot {
  margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 8px; color: var(--muted);
}

/* ---------- Recents card + pins (Part 3) ---------- */
.rc {
  position: absolute; left: 14px; bottom: 14px; z-index: 20; width: 208px;
  background: #fff; border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
  overflow: hidden; font-family: var(--font);
}
.rc-head {
  display: flex; align-items: center; padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.rc-head b { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.rc-toggle {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 11px; padding: 0 2px;
}
.rc.is-collapsed .rc-list { display: none; }
.rc-list { list-style: none; margin: 0; padding: 0; }
.rc-row { display: flex; align-items: center; border-bottom: 1px solid #f4f4f4; }
.rc-row:last-child { border-bottom: 0; }
.rc-row.is-active { background: #f0f9fe; }
.rc-pick {
  flex: 1; display: flex; align-items: center; gap: 7px; background: none; border: 0;
  cursor: pointer; padding: 8px 10px; font: 500 12px/1.2 var(--font); color: var(--ink);
  text-align: left;
}
.rc-dot {
  width: 8px; height: 8px; flex: none; background: var(--blue);
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
}
.rc-row.is-active .rc-dot { background: var(--cyan); }
.rc-del {
  background: none; border: 0; cursor: pointer; color: var(--border);
  font-size: 15px; line-height: 1; padding: 6px 9px;
}
.rc-del:hover { color: #c0392b; }
.rc-empty { margin: 0; padding: 12px 10px; font-size: 11px; color: var(--muted); }

/* Leaflet divIcon pins for recents. */
.rc-pin {
  background: var(--blue); border: 2px solid #fff; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.rc-pin.is-selected { background: var(--cyan); }

/* "Recent searches" heading inside the existing suggestions dropdown. */
.suggestion-section {
  padding: 6px 12px; background: var(--panel); font: 700 9px/1.2 var(--font);
  letter-spacing: .8px; text-transform: uppercase; color: var(--muted);
}
.suggestion-row.is-recent { display: flex; align-items: center; }
.suggestion-row.is-recent > span { flex: 1; }

/* ---------- Feedback (Part 4) ---------- */
/* Both top bars measure rgb(255,255,255) — there is no coloured bar for a
   translucent-white surface to sit against. Mirror .location-btn (css/app.css)
   instead: a solid panel surface with blue glyph, so the control has a visible
   shape, hover state and focus ring against white. */
.fb-btn {
  width: 40px; height: 40px; border-radius: 8px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); color: var(--blue); font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.fb-btn:hover { background: var(--border); }
.fb-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* Fixed for the same reason as .xp-root — see the export panel styles. */
.fb-root { position: fixed; inset: 0; z-index: 55; }
.fb-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.fb-modal {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 420px; max-width: calc(100% - 40px); background: #fff; border-radius: 12px;
  padding: 18px 20px 20px; box-shadow: 0 14px 40px rgba(0, 0, 0, .3);
  font-family: var(--font); display: flex; flex-direction: column;
}
.fb-head { display: flex; align-items: center; margin-bottom: 6px; }
.fb-head h3 { margin: 0; font-size: 16px; color: var(--ink); }
.fb-close {
  margin-left: auto; background: none; border: 0; font-size: 22px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 4px;
}
.fb-label {
  font-size: 10px; letter-spacing: .7px; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin: 12px 0 4px;
}
.fb-field {
  font: 400 13px/1.35 var(--font); color: var(--ink); background: #fff;
  border: 1px solid var(--border); border-radius: 4px; padding: 8px 9px; width: 100%;
}
.fb-field:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.fb-textarea { resize: vertical; min-height: 110px; }
.fb-note { margin: 10px 0 0; font-size: 10px; line-height: 1.45; color: var(--muted); }
.fb-submit {
  margin-top: 14px; background: var(--cyan); color: #fff; border: 0; border-radius: 5px;
  font: 700 13px/1 var(--font); padding: 12px; cursor: pointer;
}
.fb-submit:hover:not(:disabled) { background: var(--cyan-active); }
.fb-submit:disabled { background: var(--border); cursor: not-allowed; }
