:root {
  color-scheme: light;
  --ink: #17312b;
  --muted: #66746f;
  --paper: #f6f4ee;
  --card: #ffffff;
  --green: #1d8a5b;
  --yellow: #c58a16;
  --red: #c84545;
  --gray: #89938f;
  --line: #dbe1de;
  --brand: #173f35;
  --gold: #f2c46d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.5; }
a { color: var(--brand); }
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem max(1rem, calc((100vw - 1100px) / 2)); background: var(--brand); color: white; }
.brand { color: white; font-size: 1.35rem; font-weight: 800; text-decoration: none; letter-spacing: -.03em; }
.environment { color: #d8e2de; font-size: .8rem; }
.page-shell { width: min(1100px, calc(100% - 2rem)); margin: 2rem auto; }
.site-footer { text-align: center; color: var(--muted); padding: 1.25rem; font-size: .8rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.25rem, 4vw, 2rem); box-shadow: 0 12px 32px rgba(23, 49, 43, .06); }
.tap-card, .auth-card { max-width: 620px; margin: 0 auto; }
.centered { max-width: 650px; margin: 0 auto; text-align: center; }
.compact-card { margin-top: 1rem; }
h1 { line-height: 1.15; letter-spacing: -.035em; margin: .3rem 0 1rem; }
h2 { margin-top: 0; }
.eyebrow { color: #477367; font-size: .78rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.stack { display: grid; gap: .8rem; }
label { font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid #b9c5c1; border-radius: 10px; padding: .8rem .9rem; font: inherit; color: var(--ink); background: white; }
textarea { min-height: 145px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(29, 138, 91, .2); border-color: var(--green); }
.button { display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 10px; padding: .8rem 1rem; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.button:disabled, .button[aria-disabled="true"] { cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .button:not(:disabled):not([aria-disabled="true"]):hover {
    box-shadow: 0 0 0 3px rgba(15, 47, 38, .22), 0 4px 12px rgba(15, 47, 38, .16);
  }
}
.button:not(:disabled):not([aria-disabled="true"]):active {
  box-shadow: inset 0 3px 0 rgba(15, 47, 38, .3), 0 0 0 2px rgba(15, 47, 38, .28);
}
.button-primary { background: var(--brand); color: white; }
.button-secondary { background: var(--gold); color: #352705; }
.button-quiet { background: white; border: 1px solid var(--line); color: var(--ink); }
.button-block { width: 100%; margin: .5rem 0; }
.button-row { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.divider { display: flex; align-items: center; gap: 1rem; color: var(--muted); margin: 1.2rem 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.alert { border-radius: 10px; padding: .8rem 1rem; margin: 1rem 0; }
.alert-error { background: #fff0f0; border: 1px solid #f0baba; color: #872b2b; }
.alert-success { background: #e6f5ed; border: 1px solid #9dcdb5; color: #16563a; }
.success-mark { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 1rem; border-radius: 50%; background: #dff5e9; color: var(--green); font-size: 2rem; font-weight: 900; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-heading p { margin: .25rem 0; }
.message-list { display: grid; }
.message-row { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.message-row:first-child { border-top: 0; }
.message-row p { margin: .35rem 0 0; color: var(--muted); }
.message-row time { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.status { display: inline-block; border-radius: 999px; padding: .2rem .55rem; margin-right: .5rem; font-size: .72rem; font-weight: 800; text-transform: capitalize; }
.status-new { background: #e7f0ff; color: #265894; }
.status-in_progress { background: #fff2cf; color: #835b00; }
.status-resolved { background: #dff5e9; color: #17613f; }
.notification-state { display: inline-block; border-radius: 999px; padding: .2rem .55rem; margin-right: .5rem; font-size: .72rem; font-weight: 800; background: #edf1ef; color: #40514b; }
.notification-accepted { background: #dff5e9; color: #17613f; }
.notification-retrying, .notification-waiting { background: #fff2cf; color: #835b00; }
.notification-needs_attention, .notification-delivery_uncertain { background: #fff0f0; color: #872b2b; }
.test-mode-banner { margin-bottom: 1rem; border: 2px solid var(--yellow); border-radius: 12px; padding: .75rem 1rem; background: #fff7df; color: #694800; font-weight: 900; text-align: center; }
.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.meta-grid div { display: grid; }
.setup-metric { display: grid; min-height: 5.5rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.setup-metric span { color: var(--muted); }
.setup-metric strong { align-self: end; font-size: 1.35rem; }
.section-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-heading-row h2, .section-heading-row .eyebrow { margin: 0; }
.detail-list { display: grid; gap: .75rem; margin: 0 0 1.25rem; }
.detail-list div { display: grid; gap: .2rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: .78rem; font-weight: 700; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1rem 0 2rem; }
@media (hover: hover) and (pointer: fine) {
  .setup-metric:hover { border-color: var(--brand); box-shadow: 0 4px 12px rgba(15, 47, 38, .12); }
}
.message-body { border-left: 4px solid var(--gold); padding: 1rem; background: #fbfaf6; white-space: pre-wrap; }
.owner-update-form { border-top: 1px solid var(--line); padding-top: 1rem; }
.owner-update-form .button { justify-self: start; }
.action-history { display: grid; }
.action-history-entry { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; border-top: 1px solid var(--line); padding: 1rem 0; }
.action-history-entry:first-child { border-top: 0; }
.action-history-entry time { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.action-history-entry div:first-child { display: grid; }
.private-note { grid-column: 1 / -1; white-space: pre-wrap; border-left: 3px solid var(--gold); padding: .75rem 1rem; background: #fbfaf6; }
.back-link { display: inline-block; margin-bottom: .5rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1rem; }
.health-list { display: grid; }
.health-row { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start; padding: .85rem 0; border-top: 1px solid var(--line); }
.health-row:first-child { border-top: 0; }
.health-row p { margin: .2rem 0 0; color: var(--muted); font-size: .85rem; }
.health-dot { width: 12px; height: 12px; margin-top: .35rem; border-radius: 50%; background: var(--gray); }
.health-working { background: var(--green); }
.health-needs_attention { background: var(--yellow); }
.health-failed { background: var(--red); }
.health-not_configured { background: var(--gray); }
.health-meta { display: grid; justify-items: end; font-size: .74rem; color: var(--muted); text-align: right; }
.health-meta span { font-weight: 800; color: var(--ink); }
.event-row { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: .7rem; border-top: 1px solid var(--line); padding: .7rem 0; font-size: .83rem; }
.event-row:first-of-type { border-top: 0; }
.event-row time { color: var(--muted); text-align: right; }
.link-card { display: grid; gap: 1rem; border-top: 1px solid var(--line); padding: 1rem 0; }
.link-card:first-of-type { border-top: 0; }
.link-card h3 { margin: .35rem 0; }
.url-preview { overflow-wrap: anywhere; padding: .65rem .8rem; border-radius: 8px; background: #f2f5f3; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; }
.compact-form { max-width: 520px; }
.compact-form input[type="checkbox"], .link-card input[type="checkbox"] { width: auto; margin-right: .45rem; }
.follow-links { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1.25rem; }
.customer-shell { margin-top: clamp(.75rem, 3vw, 2rem); }
.customer-brand.tap-card, .customer-confirmation { overflow: hidden; }
.business-identity { display: grid; justify-items: center; text-align: center; margin-bottom: 1.25rem; }
.business-logo-frame { width: min(100%, 360px); max-width: 100%; height: clamp(110px, 24vw, 190px); display: grid; place-items: center; margin-bottom: .8rem; overflow: hidden; border-bottom: 4px solid var(--brand); }
.business-logo { display: block; max-width: 100%; max-height: 170px; width: auto; height: auto; object-fit: contain; }
.business-name { font-size: clamp(1.55rem, 5vw, 2.35rem); font-weight: 850; line-height: 1.1; letter-spacing: -.035em; margin: .25rem 0; }
.business-name-with-logo { font-size: clamp(1.25rem, 4vw, 1.75rem); }
.business-name-accent { color: var(--ink); }
.location-label { margin: .2rem 0 0; color: var(--muted); font-weight: 700; }
.visit-heading { margin: .75rem 0 .35rem; }
.button-brand { background: var(--brand); color: white; border: 2px solid #17312b; }
.button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #0f2f26; outline-offset: 3px; }
.owner-setup-actions { justify-content: flex-start; }
.review-filter-grid,
.review-profile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; align-items: end; }
.review-profile-form { max-width: 820px; }
.review-profile-form textarea { min-height: 95px; }
.review-history-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; align-items: end; }
.review-batch-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem; border: 1px solid var(--line); border-radius: 10px; background: #f7faf8; }
.review-select { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .3rem; font-size: .9rem; }
.review-select input { width: 1.2rem; height: 1.2rem; }
.history-scan-row,
.review-row { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.history-scan-row:first-of-type,
.review-row:first-child { border-top: 0; }
.review-row-main { min-width: 0; }
.review-row-main h3 { margin: .4rem 0; }
.review-row-main p { margin: .3rem 0; white-space: pre-wrap; }
.review-row-actions { display: grid; gap: .55rem; align-content: start; min-width: 12rem; }
.review-row-actions form,
.history-scan-row form { margin: 0; }
.status-new,
.status-older_unanswered { background: #e7f0ff; color: #265894; }
.status-awaiting_approval,
.status-queued,
.status-awaiting_verification { background: #fff2cf; color: #835b00; }
.status-confirmed { background: #dff5e9; color: #17613f; }
.status-needs_attention { background: #fff0f0; color: #872b2b; }
.status-skipped,
.status-canceled { background: #edf1ef; color: #40514b; }
.review-source-text,
.reply-preview { margin: 1rem 0; padding: 1rem; border-left: 4px solid var(--gold); background: #fbfaf6; white-space: pre-wrap; }
.approval-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.appearance-current { margin-bottom: 1rem; }
.appearance-form { max-width: 680px; }
.appearance-form fieldset { display: grid; gap: .7rem; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.appearance-form legend { font-weight: 800; padding: 0 .35rem; }
.appearance-form fieldset label { display: flex; align-items: center; gap: .55rem; }
.appearance-form input[type="radio"] { flex: 0 0 auto; width: 1rem; height: 1rem; margin: 0; }
.appearance-form input[type="color"] { display: block; width: 5rem; height: 3rem; min-height: 3rem; padding: .25rem; border: 2px solid var(--ink); border-radius: 10px; }
.appearance-form input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.appearance-form input[type="color"]::-webkit-color-swatch { border: 1px solid #6f7d78; border-radius: 6px; }
.owner-logo-frame { justify-items: start; margin-bottom: 1rem; }
.customer-preview { margin-bottom: 1rem; }
.customer-preview [aria-disabled="true"] { cursor: default; }
.preview-publish-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.preview-publish-actions form { margin: 0; }
.confirmation-review-links { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1.25rem; }
code { overflow-wrap: anywhere; }

body.customer-brand {
  min-height: 100vh;
  background: linear-gradient(180deg, #edf3ef 0, var(--paper) 38rem);
}
body.customer-brand .customer-shell { width: min(660px, calc(100% - 1rem)); margin-top: clamp(1rem, 4vw, 3rem); }
body.customer-brand .customer-panel {
  border-color: #d4ddd8;
  border-radius: 24px;
  padding: clamp(1.35rem, 5vw, 2.5rem);
  box-shadow: 0 22px 52px rgba(23, 49, 43, .09);
}
body.customer-brand .business-identity {
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
  padding-bottom: clamp(1.2rem, 3vw, 1.6rem);
  border-bottom: 1px solid var(--line);
}
body.customer-brand .business-name,
body.customer-brand .location-label,
body.customer-brand .customer-intro,
body.customer-brand .customer-result-copy,
body.customer-brand .field-hint,
body.customer-brand .customer-meta { overflow-wrap: anywhere; }
body.customer-brand .customer-choice { text-align: center; }
body.customer-brand .customer-choice .eyebrow,
body.customer-brand .customer-result > .eyebrow { margin: 0 0 .55rem; }
body.customer-brand .visit-heading,
body.customer-brand .customer-result > h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -.025em;
}
body.customer-brand .visit-heading { margin: 0 0 .65rem; font-size: clamp(1.85rem, 6vw, 2.45rem); }
body.customer-brand .customer-intro { max-width: 34rem; margin: 0 auto 1.25rem; color: #43534e; }
body.customer-brand .review-choices { display: grid; gap: .75rem; }
body.customer-brand .review-choices .button-block,
body.customer-brand .customer-feedback-form .button-block,
body.customer-brand .confirmation-review-links .button-block { min-height: 50px; margin: 0; }
body.customer-brand .review-empty-state {
  padding: 1rem;
  border: 1px solid #d7dfdb;
  border-radius: 14px;
  background: #f6f8f6;
}
body.customer-brand .review-empty-state p { margin: 0; }
body.customer-brand .divider { margin: clamp(1.5rem, 5vw, 2.25rem) 0; }
body.customer-brand .private-feedback {
  padding: clamp(1.15rem, 4vw, 1.6rem);
  border: 1px solid #dce2df;
  border-radius: 18px;
  background: #fbfaf6;
}
body.customer-brand .private-feedback > .eyebrow { margin: 0 0 .35rem; }
body.customer-brand .private-feedback h2 { margin-bottom: .45rem; }
body.customer-brand .private-feedback > p.muted { margin-top: 0; }
body.customer-brand .customer-feedback-form { gap: .7rem; margin-top: 1.15rem; text-align: left; }
body.customer-brand .customer-feedback-form label { line-height: 1.3; }
body.customer-brand .field-hint { margin: -.25rem 0 .1rem; font-size: .86rem; }
body.customer-brand .customer-feedback-form textarea { min-height: 150px; font-size: 1rem; line-height: 1.5; }
body.customer-brand .customer-feedback-form textarea[aria-invalid="true"] { border-color: var(--red); background: #fffafa; }
body.customer-brand .customer-meta { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
body.customer-brand .follow-links { text-align: center; }
body.customer-brand .customer-result > h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); }
body.customer-brand .customer-result-copy { max-width: 34rem; margin: 0 auto 1.4rem; color: #43534e; }
body.customer-brand .customer-result .button-row .button { min-height: 48px; min-width: 9rem; }
body.customer-brand .customer-recovery .customer-feedback-form { margin-top: 1.5rem; }
body.customer-brand .customer-recovery textarea[readonly] { color: var(--ink); background: #f6f7f6; }
body.customer-brand .confirmation-review-links { margin-top: 2rem; padding-top: 1.5rem; }
body.customer-brand .confirmation-review-links h2 { margin-bottom: .45rem; }
body.customer-brand .confirmation-review-links .eyebrow { margin-bottom: .35rem; }
body.customer-brand .site-footer { max-width: 42rem; margin: 0 auto; padding-top: .5rem; color: #586660; line-height: 1.6; }

@media (max-width: 520px) {
  body.customer-brand .customer-shell { margin-top: .5rem; }
  body.customer-brand .customer-panel { border-radius: 20px; padding: 1.2rem; }
  body.customer-brand .private-feedback { padding: 1rem; }
  body.customer-brand .customer-result .button-row { display: grid; grid-template-columns: 1fr; justify-content: stretch; }
  body.customer-brand .customer-result .button-row .button,
  body.customer-brand .follow-links .button { width: 100%; }
}

@media (max-width: 340px) {
  body.customer-brand .customer-panel { padding: 1rem; }
  body.customer-brand .business-name { font-size: 1.45rem; }
  body.customer-brand .visit-heading { font-size: 1.75rem; }
}

@media (max-width: 760px) {
  .page-shell { margin: 1rem auto; width: min(100% - 1rem, 1100px); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: center; }
  .message-row { display: block; }
  .message-row time { display: block; margin-top: .5rem; }
  .event-row { grid-template-columns: 1fr; }
  .event-row time { text-align: left; }
  .health-row { grid-template-columns: auto 1fr; }
  .health-meta { grid-column: 2; justify-items: start; text-align: left; }
  .action-history-entry { grid-template-columns: 1fr; }
  .section-heading-row { align-items: flex-start; flex-direction: column; }
  .action-history-entry time, .private-note { grid-column: 1; }
  .business-logo-frame { height: 120px; }
  .business-logo { max-height: 105px; }
  .tap-card { padding: 1.15rem; }
  .review-filter-grid,
  .review-profile-grid,
  .review-history-form { grid-template-columns: 1fr; }
  .history-scan-row,
  .review-row { display: grid; }
  .review-row-actions { min-width: 0; }
  .review-row-actions .button { width: 100%; }
  .review-batch-bar { display: grid; }
}

.ai-task-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.ai-task-grid .subcard {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
}
