/* The Support tool. Desktop first (tables, side-by-side columns), still usable on a tablet. Everything is coloured with the
   same theme and brand tokens as the rest of the site, so it follows the brand, the theme and light or dark. */

.support-header { gap: 20px; }
.support-header .brand-tagline { display: block; color: var(--accent-text); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.7rem; }

.support-nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.current { color: var(--on-primary); background: var(--action); box-shadow: var(--glow-box); }

.support-user { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 700; }

.role-badge {
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.role-badge.support { color: var(--notbusy); border-color: var(--notbusy); }
.role-badge.superadmin { color: var(--accent-text); border-color: var(--accent-text); }

.support-main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px var(--gutter) 64px; }

.page-head { margin-bottom: 18px; }
.page-head h1, .support-card h1 { font-size: 1.6rem; font-weight: 800; }
.support-card h2 { font-size: 1.05rem; font-weight: 800; }

.support-card {
  margin-bottom: 18px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.support-card.narrow { max-width: 560px; margin: 48px auto; }

.dev-note { margin: 8px 0 14px; padding: 10px 12px; border-left: 3px solid var(--accent-text); background: var(--surface-2); border-radius: 6px; font-size: 0.9rem; }
.dev-users { display: grid; gap: 10px; margin-bottom: 12px; }
.dev-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.dev-user:hover { border-color: var(--action); }
.dev-user-name { font-weight: 800; }
.roles { display: flex; gap: 6px; }

/* ---------- forms ---------- */

.field {
  width: 100%;
  min-height: var(--tap);
  padding: 0 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.field:focus-visible { outline-offset: 0; border-color: var(--focus); }
.field.time { width: 8.5em; }
.field.deal { flex: 1; min-width: 12em; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-field { display: grid; gap: 4px; align-content: start; }
.form-field .label { font-size: 0.8rem; font-weight: 700; color: var(--muted); }

.form-message { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--busy) 16%, transparent); border: 1px solid var(--busy); }
.status { color: var(--muted); font-size: 0.9rem; }
.status.ok { color: var(--open); font-weight: 700; }
.status.error { color: var(--busy); font-weight: 700; }

.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.card-foot { display: flex; align-items: center; gap: 14px; margin-top: 16px; }

.button.danger { background: transparent; color: var(--busy); border: 1px solid var(--busy); box-shadow: none; }
.button.danger:hover { background: var(--busy); color: var(--on-primary); }
.button:disabled { opacity: 0.55; cursor: progress; }
.icon-button.small { width: 32px; height: 32px; font-size: 0.85rem; flex: none; }

.check-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--action); }
.filter-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 12px; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.support-card .table-wrap { border: 0; }
.support-table { width: 100%; border-collapse: collapse; }
.support-table th { padding: 10px 14px; text-align: left; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.support-table td { padding: 10px 14px; vertical-align: top; border-bottom: 1px solid var(--border); }
.support-table tr:last-child td { border-bottom: 0; }
.queue-row { cursor: pointer; transition: background-color 0.12s ease; }
.queue-row:hover, .queue-row:focus-visible { background: var(--surface-2); outline-offset: -2px; }
.queue-row.is-off, tr.is-off { opacity: 0.6; }
.bar-link { font-weight: 800; color: var(--text); text-decoration: none; }
.queue-row:hover .bar-link { color: var(--accent-text); text-shadow: var(--glow-text); }
.queue-summary { margin: 14px 2px 8px; color: var(--muted); font-weight: 600; }
.pager { display: flex; justify-content: center; gap: 12px; margin-top: 16px; }
.yes { color: var(--open); font-weight: 800; }
.missing { color: var(--muted); font-style: italic; }
.row-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.comment-text { max-width: 36em; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.75rem; }
.queue-table .chip { margin: 0 4px 4px 0; }

.flag {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.flag.good { color: var(--open); border-color: var(--open); }
.flag.warn { color: var(--busy); border-color: var(--busy); }
.flag.off { color: var(--closed); border-color: var(--closed); background: var(--surface-2); }
.flag.curated { color: var(--accent-text); border-color: var(--accent-text); }

/* ---------- the bar editor ---------- */

.bar-header { display: grid; gap: 12px; }
.crumbs { color: var(--muted); font-size: 0.9rem; }
.crumbs a { color: var(--accent-text); }
.bar-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.bar-title h1 { font-size: 1.8rem; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.bar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.check-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding-top: 10px; border-top: 1px solid var(--border); }

.editor-columns { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.editor-side { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top) + 16px); max-height: calc(100dvh - var(--header-h) - 32px); overflow-y: auto; }

.curation { display: flex; flex-wrap: wrap; gap: 6px; }
.curated-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 2px 10px;
  border: 1px solid var(--accent-text);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-text);
}

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.hours-grid { display: grid; gap: 6px; }
.hours-tools { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 4px; }
.hours-row { display: grid; grid-template-columns: 7em minmax(0, 1fr); align-items: center; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.hours-row .row-actions { grid-column: 2; }
.hours-row .day { color: var(--text); }
.slots { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.slot { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.slot-note { color: var(--accent-text); font-size: 0.8rem; font-weight: 700; }
.closed { color: var(--muted); font-style: italic; }
.row-actions { display: inline-flex; gap: 8px; white-space: nowrap; }

.happy-editor { display: grid; gap: 8px; }
.happy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.happy-row select.field { width: 9em; }

.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.history-list li { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.history-list li:last-child { border-bottom: 0; }
.history-list .who { display: flex; justify-content: space-between; gap: 8px; font-size: 0.85rem; }
.history-list .who time { color: var(--muted); }
.history-list .what { overflow-wrap: anywhere; }
.history-list li.reverted .what { text-decoration: line-through; opacity: 0.6; }
.history-list .link-button { justify-self: start; padding: 2px 0; }
.history-list .flag { justify-self: start; margin: 2px 0 0; }

.role-help dt { margin-top: 10px; font-weight: 800; }
.role-help dd { margin: 2px 0 0; color: var(--muted); }

/* ---------- claims, owners and photos (Support and Owner portals) ---------- */

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--on-primary); background: var(--action); border-color: var(--action); box-shadow: var(--glow-box); }
.decision-box { display: grid; gap: 8px; min-width: 15em; }
.claim-decision { min-width: 15em; }

.owner-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.owner-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.owner-list li:last-child { border-bottom: 0; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.photo-tile { display: grid; gap: 8px; align-content: start; margin: 0; padding: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.photo-tile.is-hidden img { opacity: 0.4; }
.photo-link { display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--bg); }
.photo-link img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-tile figcaption { display: grid; gap: 2px; font-size: 0.85rem; }
.photo-actions { justify-content: flex-start; }
.photo-actions .button { padding-inline: 12px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 1100px) {
  .editor-columns { grid-template-columns: minmax(0, 1fr); }
  .editor-side { position: static; max-height: none; }
  .support-header { flex-wrap: wrap; }
  .support-nav { order: 3; flex-basis: 100%; overflow-x: auto; }
}

@media (max-width: 720px) {
  .filter-row { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

.form-message.ok { background: color-mix(in srgb, var(--open) 16%, transparent); border-color: var(--open); }

/* ---------- waiting: a busy button and a calm "still working" note ---------- */

.button.is-busy { display: inline-flex; align-items: center; gap: 8px; }
.button.is-busy:disabled { opacity: 0.85; }
.button.is-busy::before,
.form-message.wait::before {
  content: '';
  flex: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: busy-spin 0.8s linear infinite;
}
.form-message.wait { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-color: var(--border); color: var(--text); }
.form-message[hidden] { display: none; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .button.is-busy::before, .form-message.wait::before { animation-duration: 2.4s; }
}
/* ---------- sign-in: Google beside the email ---------- */

.sign-in-alt { display: grid; justify-items: center; gap: 10px; margin-top: 18px; padding-top: 4px; }
.sign-in-or { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.7rem; }
.sign-in-or::before, .sign-in-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-button { min-height: 44px; display: grid; place-items: center; }

/* Text for screen readers only (a column header that is only a button). */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- adding a bar ---------- */

.page-head.with-action { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; }
.nearby-box { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--busy) 12%, transparent); border: 1px solid var(--busy); }
.nearby-box ul { margin: 6px 0 8px 20px; }
.nearby-box a { color: var(--accent-text); font-weight: 700; }

/* ---------- the Bar Tool ---------- */

.bartool-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; }
.bartool-bar .field { min-width: 220px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; }
.tab { padding: 6px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.tab:hover, .tab:focus-visible { color: var(--text); }
.tab.current { background: var(--surface); color: var(--accent-text); box-shadow: 0 0 0 1px var(--border); }

.bartool-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.count-chip { padding: 3px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.8rem; font-weight: 700; color: var(--muted); background: var(--surface); }
.count-chip.good { color: var(--open); border-color: var(--open); }
.count-chip.warn { color: var(--busy); border-color: var(--busy); }
.bartool-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bartool-bulk { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.bartool-run .run-source { display: block; }
.bartool-imports { margin-top: 8px; }
.import-intro { margin: 8px 0 12px; }

.finding-list { display: grid; gap: 12px; }
.finding { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.finding.is-decided { opacity: 0.65; }
.finding-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 8px; }
.finding-title { font-weight: 800; font-size: 1.05rem; color: var(--text); text-decoration: none; }
a.finding-title:hover { color: var(--accent-text); text-shadow: var(--glow-text); }
.finding-change { margin: 0 0 8px; }
.finding-evidence { margin: 0 0 10px; font-size: 0.9rem; }
.finding-evidence summary { cursor: pointer; color: var(--accent-text); font-weight: 700; }
.finding-evidence ul { margin: 6px 0 6px 20px; }
.finding-links { display: flex; gap: 14px; }
.finding-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.bartool-card .finding { margin-top: 10px; }

@media (max-width: 760px) {
  .bartool-filters { grid-template-columns: minmax(0, 1fr); }
}

/* The end of every header: the account menu, then the page's own tools (Appearance, and the roles on the Support pages). */
.header-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* A box for a web address with an icon beside it that opens the address in a new tab. */
.link-field-row { display: flex; align-items: center; gap: 8px; }
.link-field-row .field { flex: 1; min-width: 0; }
.open-link { color: var(--text); text-decoration: none; }
.open-link .line-icon { width: 18px; height: 18px; }
.open-link[aria-disabled='true'] { opacity: 0.4; pointer-events: none; cursor: default; }
