/* ==========================================================
   Local SEO Auditor - Theme
   Black page background, white text on the page/nav/footer,
   white card containers with dark text for readability.
   ========================================================== */

:root {
    --bg-body:       #f6efe6;
    --card-bg:       #fffdf9;
    --card-text:     #3b2a1e;
    --card-muted:    #8a6f5d;
    --card-border:   #eadccb;
    --input-bg:      #fff9f1;
    --input-border:  #d9c6b0;
    --page-muted:    #ead9c3;
    --accent:        #c2410c;
    --accent-hover:  #9a3412;
    --danger:        #dc2626;
    --danger-bg:     #fef2f2;
    --success:       #16a34a;
    --success-bg:    #f0fdf4;
    --notice:        #b45309;
    --notice-bg:     #fffbeb;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, "Segoe UI", Arial, sans-serif;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    background: var(--bg-body);
    color: #3b2a1e;
}

/* ---------------- Card containers ---------------- */
.card {
    background: var(--card-bg);
    color: var(--card-text);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.card a { color: var(--accent); }
.card a:hover { color: var(--accent-hover); }

h1, h2 { color: var(--card-text); margin-top: 0; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }

/* ---------------- Navigation (sits on black page background) ---------------- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #3a2418;
    border: 1px solid #5a4032;
    padding: 14px 22px;
    border-radius: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-brand {
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    letter-spacing: 0.02em;
    margin-right: 20px;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.nav-links a {
    color: var(--page-muted);
    text-decoration: none;
    font-size: 14px;
    padding: 7px 12px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover {
    background: rgba(255,240,220,0.12);
    color: #ffffff;
}

.nav-links a.active {
    background: var(--accent);
    color: #fff;
}

.nav-links a.nav-secondary {
    color: var(--page-muted);
    font-size: 13px;
}

.nav-divider {
    width: 1px;
    height: 18px;
    background: #5a4032;
    margin: 0 6px;
}

/* Dropdown groups */
.nav-group { position: relative; }

.nav-group-toggle {
    background: transparent;
    border: none;
    color: var(--page-muted);
    font-size: 14px;
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.nav-group-toggle:hover,
.nav-group.open .nav-group-toggle {
    background: rgba(255,240,220,0.12);
    color: #ffffff;
}
.nav-group-toggle.active {
    color: #ffffff;
    box-shadow: inset 0 -2px 0 var(--accent);
}
.nav-caret { font-size: 11px; margin-left: 2px; }

/* padding-top bridges the gap so hover doesn't drop while moving to the menu */
.nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    padding-top: 6px;
    z-index: 100;
    min-width: 190px;
}
.nav-group.open .nav-menu { display: block; }
@media (hover: hover) {
    .nav-group:hover .nav-menu { display: block; }
}

.nav-menu-list {
    background: #3a2418;
    border: 1px solid #5a4032;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-menu-list a { display: block; white-space: nowrap; }

@media (max-width: 560px) {
    .nav-menu { left: auto; right: 0; }
}

/* ---------------- Footer (sits on black page background) ---------------- */
.site-footer {
    text-align: center;
    color: #5c4a3d;
    font-size: 13px;
    padding: 20px 0 10px;
}
.site-footer p { margin: 0; }

/* ---------------- Forms (inside cards) ---------------- */
label {
    display: block;
    margin-top: 14px;
    font-weight: 600;
    font-size: 13px;
    color: var(--card-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

input[type=text],
input[type=email],
input[type=password],
select,
textarea {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--card-text);
    font-family: inherit;
    font-size: 14px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea { min-height: 80px; }

::placeholder { color: #9ca3af; }

.checkbox-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.checkbox-row input { width: auto; }

/* ---------------- Buttons ---------------- */
.btn-primary {
    margin-top: 20px;
    padding: 11px 22px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-small {
    padding: 7px 14px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s, color 0.15s;
}
.btn-small:hover { background: var(--accent); color: #fff; }

.btn-secondary {
    margin-top: 20px;
    padding: 11px 22px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover { background: var(--accent); color: #fff; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

.btn-danger {
    padding: 7px 14px;
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}
.btn-danger:hover { background: var(--danger); color: #fff; }

button { font-family: inherit; }

.password-row { display: flex; gap: 6px; margin-top: 6px; }
.password-row input { flex: 1; margin-top: 0; }
.password-row button {
    padding: 8px 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--card-text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}
.password-row button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- Dashboard cards ---------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 4px;
}

.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 22px;
    text-decoration: none;
    color: var(--card-text);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.55);
}

.dashboard-card .icon {
    width: 40px;
    height: 40px;
    color: var(--accent);
}
.dashboard-card .icon svg {
    width: 100%;
    height: 100%;
}

.dashboard-card h3 {
    margin: 0;
    font-size: 16px;
    color: var(--card-text);
}
.dashboard-card p {
    margin: 0;
    font-size: 13px;
    color: var(--card-muted);
    line-height: 1.4;
}

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* ---------------- Tables (inside cards) ---------------- */
.table-scroll {
    overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; margin-top: 16px; }

th, td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--card-border);
    font-size: 14px;
    color: var(--card-text);
}

th {
    color: var(--card-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

tr:hover td { background: #fbf4ea; }

.actions { white-space: nowrap; }
.actions form { display: inline; }

/* ---------------- Misc ---------------- */
.muted { color: var(--card-muted); font-size: 13px; }

.error {
    color: #991b1b;
    background: var(--danger-bg);
    border: 1px solid #fca5a5;
    padding: 10px 14px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 14px;
}

.notice {
    color: var(--notice);
    background: var(--notice-bg);
    border: 1px solid #fde68a;
    padding: 10px 14px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 14px;
}

.success-box {
    background: var(--success-bg);
    border: 1px solid #86efac;
    color: #166534;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.badge-active { background: var(--success-bg); color: var(--success); border: 1px solid #86efac; }
.badge-inactive { background: #f5ece1; color: var(--card-muted); border: 1px solid var(--card-border); }

.cred-value {
    font-family: "Courier New", monospace;
    font-size: 15px;
    background: var(--input-bg);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--input-border);
    color: var(--card-text);
}

/* ---------------- Sandbox toggle ---------------- */
.sandbox-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px;
    border-radius: 6px;
}
.sandbox-toggle input { width: auto; margin: 0; }
.sandbox-toggle label {
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    font-size: 14px;
    color: var(--card-text);
}
.sandbox-on  { background: var(--success-bg); border: 1px solid #86efac; }
.sandbox-off { background: var(--danger-bg); border: 1px solid #fca5a5; }

/* ---------------- Stat tiles ---------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.stat-tile {
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 14px 16px;
    background: var(--input-bg);
}
.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--card-muted);
}
.stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat-unit { font-size: 13px; font-weight: 400; color: var(--card-muted); margin-left: 2px; }
.stat-change { display: block; font-size: 12px; color: var(--card-muted); margin-top: 2px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ---------------- Data view tabs ---------------- */
.view-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 24px;
}
.view-bar form { margin: 0; }
.card a.view-tab {
    display: inline-block;
    padding: 6px 12px;
    margin-left: 4px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    color: var(--card-muted);
    border: 1px solid var(--card-border);
}
.card a.view-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------------- Outreach statuses ---------------- */
.status-select { width: auto; margin-top: 0; padding: 6px 8px; }
.status-new       { background: #fdf1e7; color: var(--accent-hover); border: 1px solid #f5c9a6; }
.status-contacted { background: var(--notice-bg); color: var(--notice); border: 1px solid #fde68a; }
.status-won       { background: var(--success-bg); color: var(--success); border: 1px solid #86efac; }
.status-skip      { background: #f5ece1; color: var(--card-muted); border: 1px solid var(--card-border); }
tr.row-dim td { opacity: 0.55; }
tr.row-selected td { background: #fdf1e7; }

/* ---------------- Choice cards (radio options) ---------------- */
.choice-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 6px;
}
label.choice-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    font-size: 14px;
    color: var(--card-text);
}
label.choice-card input { width: auto; margin-top: 3px; }
label.choice-card:has(input:checked) { border-color: var(--accent); background: #fdf1e7; }

/* ---------------- Sentiment ---------------- */
.sentiment-bar {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 18px;
    background: var(--card-border);
}
.sent-fill-positive { background: var(--success); }
.sent-fill-neutral  { background: #9ca3af; }
.sent-fill-negative { background: var(--danger); }
.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
}
.sent-positive { background: var(--success-bg); color: var(--success); border: 1px solid #86efac; }
.sent-neutral  { background: #f5ece1; color: var(--card-muted); border: 1px solid var(--card-border); }
.sent-negative { background: var(--danger-bg); color: var(--danger); border: 1px solid #fca5a5; }

.two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0 24px;
}
.citation-cell { min-width: 280px; }

/* ---------------- Filter bars, long tables ---------------- */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.filter-row > div { flex: 1 1 200px; }
.filter-row > div:first-child { flex: 3 1 300px; }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form select { margin-top: 0; min-width: 220px; }

.table-filter { margin-top: 12px; max-width: 360px; }
.table-tall { max-height: 560px; overflow-y: auto; }
.table-tall thead th { position: sticky; top: 0; background: var(--card-bg); z-index: 1; }
.url-cell { max-width: 420px; word-break: break-all; }

/* ---------------- Keyword groups ---------------- */
.group-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.group-item {
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--input-bg);
}
.group-item.group-editing { border-color: var(--accent); background: #fdf1e7; }
.group-item .actions { display: flex; gap: 6px; align-items: center; }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: #fff;
    border: 1px solid var(--card-border);
    color: var(--card-text);
}
.chip-button { cursor: pointer; font-family: inherit; }
.chip-button:hover { border-color: var(--accent); color: var(--accent); }
.chip-new { border-color: #f5b98a; background: #fdf1e7; }
.chip-added { background: var(--success-bg); border-color: #86efac; color: #166534; }

.group-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
    margin-top: 6px;
}

/* ---------------- Ranking history ---------------- */
.rank-up   { color: var(--success); font-weight: 600; white-space: nowrap; }
.rank-down { color: var(--danger); font-weight: 600; white-space: nowrap; }
.rank-matrix th, .rank-matrix td { text-align: center; padding: 8px 6px; }
.rank-matrix th:first-child, .rank-matrix td:first-child { text-align: left; min-width: 200px; }
.rank-top3  { background: #dcfce7; color: #166534; font-weight: 600; }
.rank-top10 { background: #f0fdf4; color: #166534; }
.rank-page2 { background: #fffbeb; color: var(--notice); }
.rank-far   { background: #fbf4ea; color: var(--card-muted); }
.rank-none  { color: var(--card-muted); }
.legend-chip.rank-top3, .legend-chip.rank-top10, .legend-chip.rank-page2, .legend-chip.rank-far { display: inline-block; padding: 1px 8px; }
.ai-badge {
    display: inline-block;
    margin-left: 3px;
    padding: 0 4px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    background: #ede9fe;
    color: #6d28d9;
    vertical-align: middle;
}

/* ---------------- Reviews ---------------- */
.review-item { border-bottom: 1px solid var(--card-border); padding: 12px 0; }
.review-item:last-child { border-bottom: none; }
.review-negative { border-left: 3px solid var(--danger); padding-left: 10px; }
.stars { color: #f59e0b; letter-spacing: 1px; margin-right: 6px; }
.stars-off { color: #d1d5db; }
.qr-box { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--card-border); border-radius: 8px; margin-top: 6px; }
.password-row textarea { flex: 1; margin-top: 0; font-size: 13px; }

/* ---------------- Map grid ---------------- */
.grid-map { height: 460px; border-radius: 8px; margin-top: 16px; border: 1px solid var(--card-border); }
.grid-pin div {
    width: 34px; height: 34px; border-radius: 50%;
    color: #fff; font-weight: 700; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.grid-subheading { font-size: 15px; color: var(--card-text); margin: 22px 0 4px; }
.share-box { margin-top: 12px; padding: 12px 14px; border: 1px solid #f5c9a6; background: #fdf1e7; border-radius: 8px; }
.share-box label { margin-top: 0; }
.map-mode { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
button.view-tab-inline { background: transparent; cursor: pointer; font-family: inherit; }
button.view-tab-inline.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.leader-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--card-text); }
.leader-chip { display: inline-flex; align-items: center; gap: 6px; }
.leader-dot {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
    color: #fff; font-size: 10px; font-weight: 700;
}
.rank-grid { display: grid; gap: 4px; max-width: 420px; margin-top: 12px; }
.rank-cell {
    aspect-ratio: 1; border-radius: 6px; color: #fff; font-weight: 700;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
}

/* ---------------- Action plan / work log / report ---------------- */
.suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--card-border);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item .muted { margin-top: 3px; line-height: 1.4; }
.suggestion-item .actions { display: flex; gap: 6px; flex-shrink: 0; }
.plan-heading { font-size: 14px; margin: 18px 0 4px; color: var(--card-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.month-input { width: auto; padding: 9px; margin-top: 6px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 6px; font-family: inherit; }
.report-month-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.report-cell { white-space: nowrap; }
.compact-text { width: 150px; margin-top: 4px; padding: 5px 6px; font-size: 12px; }

/* ---------------- Utilities ---------------- */
.utility-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.utility-grid textarea { font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.utility-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.utility-checks { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 14px; }
label.inline-check {
    display: flex; align-items: center; gap: 6px; margin: 0;
    text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px; color: var(--card-text);
}
label.inline-check input { width: auto; margin: 0; }

.case-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.case-buttons .btn-small { font-size: 14px; padding: 8px 14px; }

.limit-box { margin-top: 12px; }
.limit-bar { height: 10px; border-radius: 5px; background: var(--card-border); overflow: hidden; }
.limit-bar span { display: block; height: 100%; width: 0; transition: width 0.15s; }
.limit-bar .limit-good  { background: var(--success); }
.limit-bar .limit-short { background: #eab308; }
.limit-bar .limit-over  { background: var(--danger); }

.serp-preview {
    margin-top: 16px; padding: 16px 18px; max-width: 652px;
    border: 1px solid var(--card-border); border-radius: 8px; background: #fff;
    font-family: Arial, sans-serif;
}
.serp-site { display: flex; align-items: center; gap: 10px; }
.serp-favicon { width: 26px; height: 26px; border-radius: 50%; background: #f1f3f4; border: 1px solid #dadce0; flex-shrink: 0; }
.serp-sitename { font-size: 14px; color: #202124; }
.serp-breadcrumb { font-size: 12px; color: #4d5156; }
.serp-title { font-size: 20px; line-height: 1.3; color: #1a0dab; margin-top: 6px; }
.serp-desc { font-size: 14px; line-height: 1.58; color: #4d5156; margin-top: 3px; }

/* ---------------- Printing (e.g. Map Grid "Print / Save as PDF") ---------------- */
.print-only { display: none; }
body.printing .grid-map { width: 700px; }   /* approximate printed width so the map fits every point before printing */

@media print {
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }   /* keep colored markers and cells */
    body { background: #fff !important; color: #000; margin: 0; padding: 0; max-width: none; }
    nav, .site-footer, .no-print, .leaflet-control-zoom { display: none !important; }
    .print-only { display: block; }
    .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; margin-bottom: 12px; }
    .grid-map { width: 700px; height: 430px; }
    .rank-grid { max-width: 360px; }
    a { color: inherit; text-decoration: none; }
}

/* ---------------- Automation ---------------- */
.automation-table th, .automation-table td { text-align: center; padding: 8px 6px; }
.automation-table th:first-child, .automation-table td:first-child { text-align: left; min-width: 200px; }
.automation-table input[type=checkbox] { width: auto; }
.compact-select { width: auto; margin-top: 0; padding: 5px 6px; }
.compact-number { width: 70px; margin-top: 0; padding: 5px 6px; }
input[type=number], input[type=email] {
    padding: 10px;
    margin-top: 6px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--card-text);
    font-family: inherit;
    font-size: 14px;
}
input[type=email] { width: 100%; }

.pack-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 0 4px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    background: #fee2e2;
    color: #b91c1c;
    vertical-align: middle;
}
.card a.view-tab-inline, a.view-tab-inline {
    display: inline-block;
    padding: 5px 12px;
    margin-left: 4px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    color: var(--card-muted);
    border: 1px solid var(--card-border);
}
.card a.view-tab-inline.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.report-keywords h3 { font-size: 15px; margin: 20px 0 0; color: var(--card-text); }

/* ---------------- Gap checklist ---------------- */
.checklist { list-style: none; margin: 16px 0 0; padding: 0; }
.checklist li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--card-border);
}
.checklist li:last-child { border-bottom: none; }
.checklist .muted { margin-top: 3px; line-height: 1.45; }
.check-icon {
    flex: 0 0 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}
.check-bad  .check-icon { background: var(--danger-bg); color: var(--danger); border: 1px solid #fca5a5; }
.check-warn .check-icon { background: var(--notice-bg); color: var(--notice); border: 1px solid #fde68a; }
.check-good .check-icon { background: var(--success-bg); color: var(--success); border: 1px solid #86efac; }

/* ---------------- Side-by-side comparison ---------------- */
.compare-table th[scope=row] { white-space: nowrap; }
.compare-table thead th { text-transform: none; font-size: 13px; letter-spacing: 0; color: var(--card-text); vertical-align: bottom; min-width: 130px; }
.compare-table .client-col { background: #f8fafc; }
.compare-table td.cell-good { background: var(--success-bg); color: #166534; font-weight: 600; }
.compare-table td.cell-bad  { background: var(--danger-bg); color: #991b1b; font-weight: 600; }
.legend-chip { padding: 1px 6px; border-radius: 4px; }
.legend-chip.cell-good { background: var(--success-bg); color: #166534; }
.legend-chip.cell-bad  { background: var(--danger-bg); color: #991b1b; }
.small-list { font-size: 12px; line-height: 1.4; max-width: 220px; }
.citation-cell .muted { margin-top: 4px; line-height: 1.4; }

hr { border: none; border-top: 1px solid var(--card-border); margin: 20px 0; }

pre {
    background: #111827;
    color: #d1d5db;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 13px;
    border: 1px solid #5a4032;
}

code {
    background: var(--input-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--card-text);
}

/* Map Grid: choose what the grid is centered on */
.center-choice { border: 1px solid var(--border, #d1d5db); border-radius: 6px; padding: 10px 14px 12px; margin: 4px 0 14px; }
.center-choice legend { font-weight: 600; padding: 0 6px; }
.center-choice .inline-radio { display: inline-flex; align-items: center; gap: 6px; margin: 0 18px 8px 0; font-weight: normal; }
.center-choice .inline-radio input { width: auto; margin: 0; }
.center-choice #center-place input[type="text"] { max-width: 360px; }

/* Review reply page (review_reply.php) */
.review-quote { border-left: 3px solid #f59e0b; background: #fffbeb; padding: 12px 14px; border-radius: 6px; margin-top: 10px; }
.review-stars { color: #f59e0b; letter-spacing: 1px; }
.review-stars-off { color: #d1d5db; letter-spacing: 1px; margin-right: 6px; }
.reply-choices { display: flex; flex-wrap: wrap; gap: 6px; }

/* Password boxes (assets/password_tools.js): eye button, suggest a password, match check */
.pw-field { position: relative; margin-top: 6px; }
.pw-field input { margin-top: 0; padding-right: 44px; }
.pw-eye {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 34px; padding: 0; background: none; border: 0; border-radius: 4px;
    color: var(--card-muted); cursor: pointer;
}
.pw-eye:hover, .pw-eye:focus-visible { color: var(--accent); }
.pw-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pw-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.pw-suggest-btn { padding: 0; background: none; border: 0; color: var(--accent); font-size: 13px; cursor: pointer; text-decoration: underline; }
.pw-suggest-btn:hover { color: var(--accent-hover); }
.pw-suggest-msg { font-size: 12px; color: var(--card-muted); }
.pw-match { font-size: 12px; margin-top: 4px; min-height: 1em; }
.pw-match-ok { color: #15803d; }
.pw-match-no { color: #b45309; }

/* Help page (help.php) */
.help-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.help-toolbar input[type=search] { flex: 1; min-width: 220px; margin-top: 0; padding: 10px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 6px; color: var(--card-text); font-size: 14px; }
.help-contents { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 20px; margin-top: 16px; font-size: 13px; }
.help-contents-group { display: flex; flex-direction: column; gap: 3px; }
.help-contents-group strong { font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--card-muted); margin-bottom: 2px; }
.help-panel { border: 1px solid var(--card-border); border-radius: 8px; margin-top: 10px; scroll-margin-top: 16px; }
.help-panel > summary { list-style: none; cursor: pointer; padding: 12px 40px 12px 14px; position: relative; display: flex; flex-direction: column; gap: 2px; }
.help-panel > summary::-webkit-details-marker { display: none; }
.help-panel > summary::after { content: "+"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--accent); line-height: 1; }
.help-panel[open] > summary::after { content: "−"; }
.help-panel > summary:hover .help-title, .help-panel > summary:focus-visible .help-title { color: var(--accent); }
.help-panel > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.help-title { font-weight: 600; font-size: 15px; color: var(--card-text); }
.help-summary { font-size: 13px; color: var(--card-muted); }
.help-body { padding: 0 16px 14px; border-top: 1px solid var(--card-border); font-size: 14px; line-height: 1.6; color: var(--card-text); }
.help-body h4 { margin: 16px 0 6px; font-size: 14px; }
.help-body ol, .help-body ul { padding-left: 22px; margin: 6px 0; }
.help-body li { margin: 4px 0; }
.help-body li > ul { margin-top: 4px; }
.help-tip { background: var(--input-bg); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 4px; font-size: 13px; }
.help-open { margin: 14px 0 0; }
.help-home-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin-top: 10px; }

/* Search From Anywhere (search_view.php) */
.sv-block { border: 1px solid var(--card-border); border-left: 4px solid #94a3b8; border-radius: 8px; padding: 10px 14px; margin-top: 10px; background: #fff; color: var(--card-text); }
.sv-block.sv-t-paid { border-left-color: #f5871f; }
.sv-block.sv-t-local_services { border-left-color: #f5871f; }
.sv-block.sv-t-local_pack { border-left-color: #1b6fd1; }
.sv-block.sv-t-ai_overview { border-left-color: #7c3aed; }
.sv-block.sv-t-organic { border-left-color: #64748b; }
.sv-block.sv-mine { box-shadow: 0 0 0 2px #f5871f; }
.sv-chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: #e2e8f0; color: #334155; }
.sv-chip.sv-t-paid, .sv-chip.sv-t-local_services { background: #fdeedd; color: #b75f0c; }
.sv-chip.sv-t-local_pack { background: #e5effb; color: #1b6fd1; }
.sv-chip.sv-t-ai_overview { background: #ede9fe; color: #6d28d9; }
.sv-chip.sv-t-organic { background: #e2e8f0; color: #334155; }
.sv-you-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #f5871f; color: #fff; }
.sv-list { margin: 8px 0 0; padding-left: 22px; }
.sv-list li { padding: 4px 0; }
.sv-list li.sv-you, .sv-block div.sv-you { background: #fff7ed; border-radius: 6px; padding: 4px 8px; margin-left: -8px; }
.sv-questions { color: var(--card-muted); font-size: 14px; }

/* Branded header on shared client pages (client logo left, agency right): never wider than the screen */
.report-head img { max-width: 100%; height: auto; }
@media (max-width: 600px) {
    .report-head, .report-head tbody, .report-head tr, .report-head td { display: block; width: 100%; }
    .report-head td { text-align: left !important; }
    .report-head td + td { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--card-border); }
}

/* Review Insights (review_insights.php) */
.ri-pick { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.ri-pick label.inline-check { align-items: flex-start; }
.ri-pick label.inline-check input { margin-top: 3px; }
.ri-headline { font-size: 17px; font-weight: 600; color: var(--card-text); border-left: 4px solid var(--accent); padding: 8px 14px; background: #fdf1e7; border-radius: 6px; }
.ri-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.ri-box { border: 1px solid var(--card-border); border-top: 4px solid #94a3b8; border-radius: 8px; padding: 12px 14px; background: #fff; }
.ri-box h3 { margin: 0 0 8px; font-size: 15px; }
.ri-box p { margin: 0 0 10px; font-size: 14px; }
.ri-box-good { border-top-color: #1b6fd1; } .ri-box-bad { border-top-color: #c4402f; } .ri-box-info { border-top-color: #f5871f; }
.ri-themes { list-style: none; margin: 0; padding: 0; }
.ri-themes li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--card-border); font-size: 14px; }
.ri-themes li:last-child { border-bottom: 0; }
.ri-dot { flex: 0 0 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.ri-good { background: #1b6fd1; } .ri-bad { background: #c4402f; }
.ri-quote { color: var(--card-muted); font-style: italic; font-size: 13px; margin-top: 2px; }
.ri-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ri-chips span { background: #eef2f7; border: 1px solid var(--card-border); border-radius: 999px; padding: 3px 10px; font-size: 13px; color: var(--card-text); }
.ri-steps { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
.ri-steps li { padding: 3px 0; }
.ri-steps .s-ok { color: #1b6fd1; } .ri-steps .s-err { color: #c4402f; } .ri-steps .s-run { color: #b75f0c; }

/* Page Builder */
.pb-field { margin: 0 0 12px; padding: 8px 10px; border-radius: 6px; border-left: 3px solid transparent; }
.pb-field.pb-done { border-left-color: #1b6fd1; background: #f4f8fd; }
.pb-field .password-row textarea { flex: 1; margin-top: 0; font-family: inherit; }
.pb-over { color: #c4402f; font-weight: 600; }
.pb-alt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--card-border); }
.badge-warn { background: #fff7ed; color: #b75f0c; border: 1px solid #fdba74; }
.pf-head { margin: 18px 0 2px; font-size: 15px; color: var(--card-muted); text-transform: uppercase; letter-spacing: .04em; }
.badge-bad { background: #fef2f2; color: #c4402f; border: 1px solid #fca5a5; }
.sp-no { color: #c4402f; font-weight: 600; }
.sp-page { margin-bottom: 4px; }
.sp-assign { min-width: 210px; }
.so-bar { display: inline-block; width: 70px; height: 8px; background: #e6ebf2; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.so-bar div { height: 100%; background: #1f5fa8; }
.so-client { font-weight: 600; }
/* Photo Library */
.ph-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.ph-filters > div { min-width: 160px; }
.ph-bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 14px; padding: 8px 10px; background: #f6f8fb; border-radius: 6px; }
.ph-bulk select, .ph-bulk input[type=text] { width: auto; margin: 0; }
.ph-bulk .inline-check { margin: 0; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ph-card { position: relative; border: 1px solid var(--card-border); border-radius: 8px; padding: 8px; background: #fff; }
.ph-card img { width: 100%; height: 160px; object-fit: cover; border-radius: 5px; display: block; }
.ph-check { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.9); border-radius: 4px; padding: 2px 4px; margin: 0; }
.ph-check input { width: auto; margin: 0; }
.ph-tags { margin: 6px 0 2px; display: flex; flex-wrap: wrap; gap: 4px; }
.ph-tags .badge { font-size: 11px; padding: 2px 7px; }
.ph-alt { font-size: 13px; margin: 4px 0; }
.pb-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 8px; }
.pb-photos img { width: 100%; height: 180px; object-fit: cover; border-radius: 6px; display: block; }
/* Schema Markup */
.sc-code { font-family: "Courier New", monospace !important; font-size: 13px; white-space: pre; }
.sc-hours { width: auto; margin: 6px 0; }
.sc-hours td { padding: 3px 8px 3px 0; border: 0; }
.sc-hours input[type=text] { width: 80px; margin: 0; }
.sc-hours .inline-check { margin: 0; }
/* Keyword Group Builder */
.kb-community { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.kb-community input { margin: 0; }
.kb-group { border: 1px solid var(--card-border); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.kb-group-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kb-group-head .inline-check { margin: 0; }
.kb-name { width: auto !important; min-width: 220px; margin: 0 !important; font-weight: 600; }
.kb-vols { width: 100%; font-size: 13px; }
.kb-vols td { padding: 2px 6px; border: 0; }
.kb-clash { background: #fff7ed; border-radius: 6px; padding: 6px 10px; font-size: 14px; margin: 8px 0 0; }
.kb-clash .inline-check { display: inline-flex; margin: 0 10px 0 0; }
