/* Google Business Profile tools (Store Finder and Store Optimiser). Every class here starts with gb-; the st- layout helpers come from trendtool.css. */
@import url('/assets/trendtool.css');

.gb-app .panel { margin-top: 14px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.gb-app .panel > * { min-width: 0; }
.wrap.gb-app { max-width: 1700px; }
.gb-engine { background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; }

/* Summary tiles */
.gb-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; margin-top: 18px; }
.gb-tile { display: grid; gap: 2px; text-align: left; font: inherit; color: var(--ink); border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 14px; cursor: pointer; }
.gb-tile.static { cursor: default; }
.gb-tile b { font-size: 1.6rem; }
.gb-tile span { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.gb-tile.match b { color: var(--cov-fg); }
.gb-tile.notfound b, .gb-tile.closed b { color: var(--can-fg); }
.gb-tile.check b { color: var(--gap-fg); }

.gb-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 6px; }
.gb-filters { margin-top: 10px; }

/* The table */
.gb-scroll { margin-top: 12px; max-height: 75vh; max-height: max(75vh, 520px); }
.gb-table { width: 100%; border-collapse: collapse; }
.gb-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); }
.gb-table td { vertical-align: top; }
.gb-table td.first { min-width: 230px; max-width: 360px; overflow-wrap: anywhere; }
.gb-table td.wide { min-width: 240px; max-width: 420px; overflow-wrap: anywhere; }
.gb-links { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.gb-links a, .gb-open { font-weight: 600; }
.gb-why { font-size: .82rem; margin-top: 2px; }
.gb-place { margin: 6px 0 2px; }
.gb-warn { color: var(--gap-fg); font-size: .85rem; margin-top: 4px; }
.gb-ok { color: var(--cov-fg); font-weight: 600; font-size: .85rem; }
.gb-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 170px; }
.gb-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gb-link-input { flex: 1 1 220px; min-width: 0; }
.gb-hint { margin: 4px 0 0; font-size: .82rem; }
.gb-notes summary { cursor: pointer; font-size: .82rem; color: var(--muted); }
.gb-notes ul { margin: 4px 0 0; padding-left: 18px; font-size: .82rem; }
.gb-site { font-size: .82rem; margin-top: 3px; }
.gb-site.yes { color: var(--cov-fg); }
.gb-site.no { color: var(--muted); }

.gb-badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); }
.gb-badge.match, .gb-badge.manual { background: var(--cov-bg); color: var(--cov-fg); }
.gb-badge.check { background: var(--gap-bg); color: var(--gap-fg); }
.gb-badge.notfound, .gb-badge.closed { background: var(--can-bg); color: var(--can-fg); }
.gb-badge.todo { background: var(--surface-2); color: var(--muted); }

@media (max-width: 1100px) {
  .gb-scroll { max-height: none; overflow: visible; }
  .gb-table th { position: static; }
  .gb-table td.first, .gb-table td.wide { max-width: none; min-width: 0; }
  .gb-table td.first { grid-column: 1 / -1; font-size: 1.05rem; }
  .gb-table td.first::before { display: none; }
  .gb-table td.wide, .gb-table td.gb-actions { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .gb-controls > * { flex: 1 1 100%; text-align: center; }
}

/* Optimiser */
.gb-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1100px) { .gb-two { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); align-items: start; } }
.gb-tabs { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); max-width: 100%; }
.gb-tabs button { border: 0; background: transparent; padding: 9px 16px; font: inherit; cursor: pointer; color: var(--ink); }
.gb-tabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.gb-score { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.gb-score b { font-size: 2.4rem; line-height: 1; }
.gb-score .bar { flex: 1 1 200px; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.gb-score .bar i { display: block; height: 100%; background: var(--accent); }
.gb-find { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.gb-find .gb-mark { font-weight: 700; }
.gb-find .gb-mark.ok { color: var(--cov-fg); }
.gb-find .gb-mark.no { color: var(--can-fg); }
.gb-find .gb-mark.na { color: var(--muted); }
.gb-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px 16px; margin-top: 12px; min-width: 0; }
.gb-card h3 { margin: 0 0 6px; }
.gb-card ul { margin: 6px 0 0; padding-left: 18px; }
.gb-copy-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; margin-top: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.gb-copy-row p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.gb-copy-row small { color: var(--muted); display: block; margin-top: 4px; }
.gb-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin-top: 12px; }
.gb-fields .wide { grid-column: 1 / -1; }
.gb-fields textarea, .gb-fields input, .gb-fields select { width: 100%; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.gb-pick { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; }
.gb-pick button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); padding: 8px 12px; font: inherit; color: var(--ink); cursor: pointer; }
.gb-pick button[aria-pressed="true"] { background: var(--accent-soft); }
.gb-pick small { color: var(--muted); display: block; }

/* The # column is narrow (the shared table rule gives the first column 300px). */
.gb-table > thead th:first-child, .gb-table > tbody > tr.main > td:first-child { min-width: 0; width: 48px; }
@media (max-width: 1100px) { .gb-table > tbody > tr.main > td:first-child { width: auto; } }
#go-pick > input { width: 100%; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); margin-top: 8px; }
.gb-tabs button { padding: 8px 12px; }

/* Progress panel */
.gb-run { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 16px; margin: 8px 0 4px; }
.gb-run p { margin: 6px 0 0; overflow-wrap: anywhere; }
.gb-run-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; justify-content: space-between; }
.gb-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.gb-bar-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.gb-run-wait { color: var(--gap-fg); font-weight: 600; }
.gb-run-error { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--can-fg) 55%, var(--line)); background: color-mix(in srgb, var(--can-fg) 10%, var(--surface)); }
.gb-run-error pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; font-size: .82rem; max-height: 220px; overflow: auto; }
.gb-run-error summary { cursor: pointer; margin-top: 6px; }

/* Team bar */
.gb-team { margin-top: 18px; }
.gb-team-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.gb-team-bar > .btn { margin-left: auto; }
.gb-team-bar > .btn + .btn { margin-left: 0; }

/* Sharing with chosen teammates */
.gb-share { margin-top: 12px; border-color: var(--accent); }
.gb-people { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; display: grid; gap: 2px; }
.gb-person { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.gb-person:last-child { border-bottom: 0; }
.gb-person small { color: var(--muted); }
.gb-share-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.gb-auto { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; margin: 6px 0; }

/* Everything the file says about a store */
.gb-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 6px 0 4px; font-size: .88rem; }
.gb-dl dt { color: var(--muted); }
.gb-dl dd { margin: 0; overflow-wrap: anywhere; }
.gb-dl dt:first-of-type, .gb-dl dd:first-of-type { font-size: .95rem; }
.gb-dl dd:first-of-type { font-weight: 600; }
.gb-notice { margin: 8px 0; padding: 10px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); overflow-wrap: anywhere; }
.gb-notice[hidden] { display: none; }

/* Closed tick and comment next to a pasted link */
.gb-comment { width: 100%; margin-top: 6px; }
.gb-closed-box { margin-right: 2px; }

/* Review one by one */
.gb-review { border-color: var(--accent); }
.gb-rev-title { margin: 12px 0 2px; font-size: 1.15rem; overflow-wrap: anywhere; }
.gb-rev-addr { margin: 4px 0 8px; overflow-wrap: anywhere; }
.gb-rev-links { margin: 8px 0; gap: 8px; }
.gb-rev-actions { margin-top: 10px; }

/* The address gets a full-width line above the other details */
.gb-table td.first { min-width: 340px; max-width: 480px; }
.gb-dl dt:first-of-type { grid-column: 1 / -1; margin-top: 4px; }
.gb-dl dd:first-of-type { grid-column: 1 / -1; margin-bottom: 4px; font-size: .95rem; }
@media (max-width: 1100px) { .gb-table td.first { min-width: 0; max-width: none; } }

/* One-click marks on a store (permanently closed, PIN code differs, address mismatch, different brand) */
.gb-flag.on { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); font-weight: 700; }
