:root {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #17201c;
  background: #f4f5f2;
  font-size: 16px;
  line-height: 1.5;
  --muted: #56625b;
  --line: #d9dfda;
  --accent: #246b50;
  --accent-hover: #1b533e;
  --paper: #fff;
  --danger: #8b3129;
  --radius: 12px;
  --control-radius: 8px;
  --focus: #246b50;
  scrollbar-color: #a2afa6 #f4f5f2;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
::selection { background: #cde3d6; color: #17201c; }
button, input { font: inherit; }
button, a.button { touch-action: manipulation; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
main { max-width: 1180px; margin: auto; padding: 36px 28px 80px; }
header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
h1 { font-size: clamp(28px, 3.5vw, 40px); letter-spacing: -.025em; line-height: 1.15; margin: 0 0 12px; text-wrap: balance; }
header p { margin: 6px 0 0; max-width: 65ch; color: var(--muted); }
header .headerLead { color: #17201c; font-size: 18px; }
h2, h3 { line-height: 1.3; margin: 0 0 8px; text-wrap: balance; }
h2 { font-size: 24px; letter-spacing: -.015em; }
h3 { font-size: 18px; }
.status { flex-shrink: 0; color: var(--muted); border: 1px solid var(--line); padding: 8px 12px; border-radius: var(--control-radius); font-size: 14px; background: var(--paper); }
main > section { padding: 32px 0; border-bottom: 1px solid var(--line); }
.intro { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1.5fr); gap: 36px; align-items: start; }
.intro form h3 { margin-bottom: 16px; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.field { min-width: 0; }
.muted { color: var(--muted); margin: 0; line-height: 1.6; max-width: 68ch; }
.small { font-size: 14px; }
label { font-size: 14px; font-weight: 650; display: block; margin-bottom: 6px; }
input { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid #aab7ae; border-radius: var(--control-radius); background: var(--paper); color: #17201c; caret-color: var(--accent); }
select { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid #aab7ae; border-radius: var(--control-radius); background: var(--paper); color: #17201c; font: inherit; }
input::placeholder { color: #65716b; opacity: 1; }
input:hover { border-color: #7f9587; }
button, a.button { min-height: 46px; border: 1px solid transparent; border-radius: var(--control-radius); padding: 10px 16px; background: var(--accent); color: #fff; font-weight: 650; cursor: pointer; line-height: 1.35; text-align: center; }
a.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button:hover, a.button:hover { background: var(--accent-hover); }
button:active, a.button:active { background: #164732; }
button.secondary, a.button.secondary { background: var(--paper); color: #17201c; border-color: #bec9c1; }
button.secondary:hover, a.button.secondary:hover { background: #edf3ee; border-color: #879b8e; }
button.danger { background: transparent; color: var(--danger); border-color: transparent; }
button.danger:hover { background: #fff1ee; border-color: #dcb3ac; }
button.danger:active { background: #f8ddd6; }
button:disabled { opacity: .6; cursor: wait; }
.message:empty { display: none; }
.message { font-size: 14px; margin: 12px 0 0; }
.sectionHead, .detailHead, .officeHead, .source, .sync { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.sectionHead, .detailHead { margin-bottom: 24px; }
.sectionHead > div, .detailHead > div:first-child { min-width: 0; }
.customerList { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.customerList > .muted { padding: 20px; }
.customer { display: flex; justify-content: space-between; gap: 24px; align-items: center; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--paper); color: #17201c; padding: 18px 20px; min-height: 86px; text-align: left; }
.customer:last-child { border-bottom: 0; }
.customer:hover { background: #f0f4ef; }
.customer.active { background: #e6f0e8; }
.customer:focus-visible { outline-offset: -4px; }
.customer > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.customer strong, .customer small, .metrics { display: block; }
.customer strong { font-size: 17px; }
.customer small { color: var(--muted); font-size: 14px; margin-top: 4px; font-weight: 400; }
.metrics { flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; }
.metrics b { font-size: 24px; line-height: 1.2; }
#detail { scroll-margin-top: 92px; }
.detailHead { align-items: flex-start; }
.detailGrid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .7fr); gap: 32px; align-items: start; }
.office { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.officeHead { align-items: flex-start; margin-bottom: 12px; }
.officeTitle { display: grid; gap: 4px; min-width: 0; }
.officeTitle strong { font-size: 17px; overflow-wrap: anywhere; }
.officeHead code { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.officeHead .danger { margin-top: -5px; flex-shrink: 0; }
.source { border-top: 1px solid var(--line); padding: 16px 0; align-items: flex-start; }
.source > span { min-width: 0; overflow-wrap: anywhere; }
.source small, .source em { display: block; }
.source b { font-size: 15px; text-transform: capitalize; }
.source small { color: var(--muted); font-size: 14px; margin-top: 4px; }
.source em { font-size: 14px; color: var(--danger); font-style: normal; margin-top: 8px; }
.itemActions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.source .itemActions { flex-shrink: 0; gap: 4px; }
.source .itemActions button { font-size: 14px; padding-inline: 12px; }
.sourceForm, .inlineForm { display: flex; gap: 10px; margin-top: 14px; align-items: flex-start; }
.sourceForm { padding-top: 16px; border-top: 1px solid var(--line); }
.sourceFormFields { display: grid; grid-template-columns: minmax(130px,.55fr) minmax(0,1fr); gap: 6px 10px; flex: 1; min-width: 0; }
.sourceFormFields label { margin: 0; align-self: end; }
.sourceProviderOptions { grid-column: 1/-1; display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; border: 0; padding: 0; margin: 0 0 4px; }
.sourceProviderOptions legend { width: 100%; font-size: 14px; font-weight: 650; padding: 0; margin-bottom: 6px; }
.sourceProviderOptions label { position: relative; margin: 0; cursor: pointer; }
.sourceProviderOptions input { position: absolute; width: 1px; height: 1px; min-height: 1px; opacity: 0; }
.sourceProviderOptions span { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border: 1px solid #bec9c1; border-radius: 8px; background: var(--paper); color: #17201c; }
.sourceProviderOptions input:checked+span { border: 2px solid var(--accent); padding: 7px 13px; background: #e6f0e8; font-weight: 650; }
.sourceProviderOptions input:focus-visible+span { outline: 3px solid var(--focus); outline-offset: 3px; }
.sourceForm button, .inlineForm button { flex-shrink: 0; }
.googleAdminPreview { flex: 1 0 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.googleAdminPreview>strong,.googleAdminPreview>small { display: block; }
.googleAdminPreview>small { margin: 4px 0 10px; color: var(--muted); }
.googleAdminReview { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.googleAdminReview img { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; object-fit: cover; }
.googleAdminReview p { margin: 4px 0; overflow-wrap: anywhere; }
.googleAdminReview small { color: var(--muted); }
.integration { background: #202724; color: #eef3f0; border-radius: var(--radius); padding: 24px; }
.integration h3 { margin-bottom: 16px; }
.integration .button { width: 100%; }
.integration p { color: #bdc8c2; line-height: 1.65; font-size: 14px; }
.integration > code { display: block; overflow-wrap: anywhere; color: #fff; font-size: 13px; margin: 16px 0; }
.integration pre { overflow: auto; padding: 16px; background: #151a18; border-radius: var(--control-radius); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.integration a:focus-visible { outline-color: #bddeca; }
.syncPanel { margin-top: 32px; }
.syncPanel > summary { font-size: 18px; font-weight: 650; padding: 12px 0; cursor: pointer; }
.syncPanel > summary:hover { color: var(--accent); }
.sync { padding: 16px 0; border-top: 1px solid var(--line); font-size: 14px; align-items: flex-start; }
.sync span:first-child { min-width: 200px; }
.sync span:last-child { text-align: right; overflow-wrap: anywhere; }
.sync small { display: block; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.sync.error span:last-child { color: var(--danger); }
.notice { position: sticky; top: 12px; z-index: 10; padding: 14px 18px; border: 1px solid var(--accent); border-radius: var(--control-radius); background: #e9f0ec; color: #174b37; line-height: 1.55; overflow-wrap: anywhere; margin: 20px 0 0; }
.notice.error { border-color: var(--danger); background: #fff1ee; color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.preview main { max-width: 860px; }
.preview header { display: block; padding-bottom: 24px; }
.preview h1 { font-size: clamp(28px, 4vw, 36px); margin-top: 20px; }
.preview .widgetExample { margin-top: 28px; background: var(--paper); padding: clamp(18px,4vw,32px); border: 1px solid var(--line); border-radius: var(--radius); }
.preview .backLink { color: var(--accent); font-weight: 650; text-underline-offset: 4px; }
.preview .backLink:hover { color: var(--accent-hover); }
@media (max-width: 1050px) {
  .intro { grid-template-columns: 1fr; gap: 24px; }
  .detailGrid { grid-template-columns: minmax(0,1fr) minmax(270px,.65fr); gap: 24px; }
  .source { flex-direction: column; gap: 12px; }
  .source .itemActions { justify-content: flex-start; }
}
@media (max-width: 800px) {
  main { padding: 28px 20px 64px; }
  header { gap: 16px; }
  .detailGrid { display: block; }
  .integration { margin-top: 28px; }
  .detailHead { flex-direction: column; gap: 16px; }
  .detailHead .itemActions { justify-content: flex-start; }
  .sync { flex-direction: column; gap: 8px; }
  .sync span:first-child { min-width: 0; }
  .sync span:last-child { text-align: left; }
}
@media (max-width: 560px) {
  main { padding-inline: 18px; }
  header { flex-direction: column; }
  .status { font-size: 13px; }
  main > section { padding: 28px 0; }
  .fields { grid-template-columns: 1fr; gap: 16px; }
  .fields > button { width: 100%; }
  .sectionHead { align-items: flex-start; gap: 12px; }
  .sectionHead .muted { font-size: 14px; }
  .sectionHead button { padding-inline: 12px; }
  .customer { padding: 16px; gap: 12px; }
  .customer strong { font-size: 16px; }
  .customer small { font-size: 13px; }
  .office { padding: 16px; }
  .officeHead { flex-direction: column; gap: 10px; }
  .officeHead .danger { margin-top: 0; padding-inline: 0; }
  .sourceForm, .inlineForm { flex-direction: column; }
  .sourceFormFields { width: 100%; }
  .sourceForm button, .inlineForm button { width: 100%; }
  .itemActions { justify-content: flex-start; }
  .source .itemActions { width: 100%; }
  .notice { top: 8px; padding: 12px 14px; font-size: 14px; }
  .integration { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.preview main { max-width: 1280px; }
.previewLayout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.preview .widgetExample { margin-top: 0; min-width: 0; }
.previewImplementation { min-width: 0; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.previewLayout h2 { margin: 0 0 18px; font-size: 22px; }
.previewImplementation p { line-height: 1.6; }
.previewImplementation label { display: block; margin: 20px 0 8px; font-weight: 650; }
.previewImplementation textarea { display: block; width: 100%; resize: vertical; padding: 14px; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--bg); color: inherit; font: 13px/1.6 ui-monospace, monospace; overflow-wrap: anywhere; }
.previewImplementation textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.previewImplementation button { margin-top: 14px; }
.previewImplementation code { overflow-wrap: anywhere; }
@media (max-width: 850px) { .previewLayout { grid-template-columns: minmax(0, 1fr); } }
