:root {
  font-family: system-ui, sans-serif;
  color-scheme: light dark;
  --canvas: #f7f5ef;
  --surface: #fff;
  --ink: #171d31;
  --muted: #525b71;
  --line: #dce0e8;
  --frame: #c8cedb;
  --wash: #f5f7fd;
  --selected: #e9efff;
  --accent: #244fd5;
  --accent-hover: #1b3eae;
  --accent-ink: #fff;
  --positive: #25654b;
  --paused: #805416;
  --error: #b0222d;
  --focus: #244fd5;
  background: var(--canvas);
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #141720;
    --surface: #1d2230;
    --ink: #edf0fa;
    --muted: #b4bed4;
    --line: #363e51;
    --frame: #47516a;
    --wash: #252c3d;
    --selected: #293c70;
    --accent: #a8bdff;
    --accent-hover: #c0cfff;
    --accent-ink: #16234f;
    --positive: #92d8b7;
    --paused: #efc584;
    --error: #ff9fa7;
    --focus: #a8bdff;
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
[hidden] {
  display: none !important;
}
[role="status"]:empty {
  display: none;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--frame);
}

.topbar-inner {
  min-height: 66px;
  margin-inline: auto;
  padding: 10px clamp(16px, 3.5vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-size: clamp(1rem, 2.6vw, 1.35rem);
  font-weight: 760;
  letter-spacing: -0.035em;
}

.account-bar {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 24px);
  font-size: 0.9rem;
}

#account {
  font-weight: 650;
  overflow-wrap: anywhere;
}
#logout {
  flex-shrink: 0;
}

main {
  max-width: 1240px;
  padding-inline: clamp(16px, 3.5vw, 44px);
  margin: clamp(24px, 4vw, 48px) auto 60px;
}

.page-heading {
  margin-bottom: clamp(24px, 3vw, 36px);
}
h1,
h2,
h3,
p {
  margin: 0 0 0.65rem;
}
h1 {
  font-size: clamp(2.1rem, 4.8vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
}
h2 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}
h3,
legend {
  font-size: 1.05rem;
  font-weight: 680;
}
p {
  line-height: 1.5;
}
.page-heading p {
  color: var(--muted);
  font-size: 1.05rem;
}

.workspace,
#signin {
  background: var(--surface);
  border: 1px solid var(--frame);
  border-radius: 14px;
}
#signin {
  max-width: 520px;
  padding: clamp(16px, 3vw, 28px);
}
.confirmation-dialog {
  width: min(100% - 32px, 540px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--frame);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 76px #0006;
}
.confirmation-dialog h2[tabindex="-1"]:focus {
  outline: none;
}
.confirmation-dialog::backdrop {
  background: rgb(10 15 29 / 68%);
}
.flightaware-review-parameters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 6px 12px;
  overflow-wrap: anywhere;
}
.flightaware-review-parameters dd {
  margin: 0;
}
body:has(.confirmation-dialog[open]) {
  overflow: hidden;
}
.confirmation-target {
  padding: 12px 14px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
  font-weight: 650;
  overflow-wrap: anywhere;
}
.confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin: 20px 0 0;
}
#contact-changes {
  padding-left: 1.4rem;
  overflow-wrap: anywhere;
}
.contact-photo-preview {
  display: block;
  height: auto;
  max-width: 100%;
  margin-top: 8px;
  border-radius: 6px;
}
.contact-preview-values {
  margin: 6px 0 14px;
  white-space: pre-wrap;
}
#calendly-note-review-details dd {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.workspace {
  min-width: 0;
}
.service-directory {
  min-width: 0;
  padding: 18px 12px;
}
.service-directory > h2 {
  margin: 2px 8px 16px;
}
#services {
  display: grid;
  gap: 5px;
}
.service-row {
  min-width: 0;
}
.service-row summary {
  display: flex;
  list-style: none;
  cursor: pointer;
  align-items: center;
  gap: 13px;
  min-height: 62px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 10px;
}
.service-row summary::-webkit-details-marker {
  display: none;
}
.service-row summary:hover {
  background: var(--wash);
}
.service-row summary[aria-current="true"] {
  border-color: var(--accent);
  background: var(--selected);
}
.service-icon {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #375bb7;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 750;
}
[data-service="meet"] .service-icon {
  background: #28734b;
}
[data-service="contacts"] .service-icon {
  background: #245bd4;
}
[data-service="pagespeed"] .service-icon {
  background: #6749b6;
}
[data-service="flightaware"] .service-icon {
  background: #a64d35;
}
.service-caption {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.service-name {
  font-size: 0.925rem;
  line-height: 1.3;
  font-weight: 680;
}
.service-status,
.service-state {
  font-size: 0.83rem;
  color: var(--muted);
}
.service-state {
  margin: 0.32rem 0 0;
}
.service-status[data-state="connected"],
.service-state[data-state="connected"] {
  color: var(--positive);
}
.service-status[data-state="paused"],
.service-state[data-state="paused"] {
  color: var(--paused);
}

.service-settings {
  min-width: 0;
  padding: 0 10px 20px;
}
.service-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 17px 0;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.service-heading h2 {
  margin: 0;
}
.service-heading .service-action {
  flex: 0 0 auto;
  white-space: nowrap;
}
.service-action[role="switch"] {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: transparent;
  padding-inline: 6px;
}
.service-action[role="switch"]::before {
  content: "";
  width: 36px;
  height: 21px;
  border: 1px solid var(--frame);
  border-radius: 20px;
  background:
    radial-gradient(circle at 10px center, var(--muted) 6px, transparent 6.5px),
    var(--wash);
}
.service-action[aria-checked="true"]::before {
  border-color: var(--accent);
  background:
    radial-gradient(
      circle at 26px center,
      var(--accent-ink) 6px,
      transparent 6.5px
    ),
    var(--accent);
}

.service-body > section:not([hidden]) + section,
#pagespeed-owner,
#pagespeed-audit,
#flightaware-lookup,
#flightaware-key-management {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.field-pair {
  display: grid;
  gap: 0 16px;
}
.field-pair > div {
  min-width: 0;
}
.field-pair input {
  width: 100%;
}
#flightaware-date-window,
#flightaware-allowance {
  font-size: 0.9rem;
}
.muted,
.provider-identity,
.service-message {
  color: var(--muted);
}
.service-message {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

button {
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font:
    650 0.875rem/1.35 system-ui,
    sans-serif;
  cursor: pointer;
}
button:hover {
  background: var(--accent-hover);
}
button.secondary {
  border-color: var(--frame);
  background: var(--surface);
  color: var(--ink);
}
button.secondary:hover {
  background: var(--wash);
}
#flightaware-actions button,
#assistant-access summary,
a {
  color: var(--accent);
}
button.destructive {
  border-color: var(--error);
  background: var(--surface);
  color: var(--error);
}
button.destructive:hover {
  background: var(--wash);
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
input,
select {
  display: block;
  width: min(100%, 29rem);
  min-width: 0;
  margin: 6px 0 12px;
  padding: 9px 10px;
  border: 1px solid var(--frame);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
input[type="checkbox"] {
  display: inline;
  width: auto;
  margin: 0 0.35rem 0 0;
  accent-color: var(--accent);
}
form {
  margin: 12px 0;
}
fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}
#pagespeed-controls,
#contact-fields {
  margin: 0;
  padding: 0;
  border: 0;
}
.service-access fieldset,
#pagespeed-members {
  max-height: 18rem;
  overflow: auto;
  margin: 12px 0;
}
.service-members label,
#pagespeed-member-list label {
  display: block;
  padding: 4px;
  overflow-wrap: anywhere;
}
#assistant-access {
  margin: 22px 0 0;
}
#assistant-access > summary {
  border: 1px solid var(--frame);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
}
#assistant-access > summary:hover {
  background: var(--wash);
}
#assistant-list {
  padding: 12px 5px 0;
}
#assistant-list button {
  margin-left: 5px;
}
.assistant-permissions {
  margin: 0 0 14px;
  font-size: 0.875rem;
}
.assistant-permissions summary {
  cursor: pointer;
}
.assistant-permissions ul {
  padding-left: 1.4rem;
}
#message {
  margin-top: 16px;
  color: var(--muted);
}
#message[data-tone="success"] {
  color: var(--positive);
}
#message[data-tone="error"] {
  color: var(--error);
}
:where(button, input, select, summary, a):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (min-width: 760px) {
  .workspace {
    display: grid;
    grid-template-columns: minmax(235px, 1fr) minmax(0, 2fr);
  }
  .service-directory {
    padding: 23px 15px;
  }
  .service-directory > h2 {
    margin-left: 9px;
  }
  #service-inspector {
    border-left: 1px solid var(--frame);
  }
  .service-settings {
    padding: 6px clamp(18px, 2.8vw, 36px) 26px;
  }
  .field-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 759px) {
  .service-row summary::after {
    content: "";
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    width: 7px;
    height: 7px;
    margin-inline: auto 3px;
    transform: rotate(45deg);
  }
  .service-row details[open] > summary::after {
    transform: rotate(225deg);
  }
}

.street-view-page {
  max-width: 50rem;
}

.street-view-page img {
  display: block;
  max-width: 100%;
  height: auto;
}

.street-view-page textarea {
  width: 100%;
}

.policy-page {
  max-width: 48rem;
}

.policy-page p {
  line-height: 1.6;
}

.policy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 2rem;
}
