/* "Management Suite" is written in Great Vibes (SIL Open Font License: assets/fonts/GreatVibes-OFL.txt).
   The file holds only basic letters, digits and punctuation, which keeps it small. */
@font-face {
  font-display: block;
  font-family: "Hastings Script";
  font-style: normal;
  font-weight: 400;
  src: url("assets/fonts/great-vibes.woff2") format("woff2");
}
.topbar {
  flex-wrap: wrap;
}
.topbar .brand {
  color: inherit;
  text-decoration: none;
}
.workspace-label {
  color: var(--blue);
  font-family: "Hastings Script", "Segoe Script", "Brush Script MT", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.1;
  white-space: nowrap;
}
.signin-card .signin-suite {
  font-size: 2.15rem;
  margin: 2px 0 0;
  white-space: normal;
}
.app-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.app-nav a {
  align-items: center;
  color: var(--navy);
  display: inline-flex;
  gap: 7px;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.app-nav a:hover,
.app-nav a[aria-current="page"] {
  background: var(--sky);
  color: var(--blue);
}
.account-slot {
  min-width: 0;
  position: relative;
}
.account-menu-wrap {
  position: relative;
}
.account-chip {
  align-items: center;
  background: #fff;
  border: 1px solid #c8d7e2;
  border-radius: 999px;
  color: var(--navy);
  display: inline-flex;
  gap: 9px;
  max-width: 255px;
  padding: 6px 10px 6px 6px;
}
.account-chip:hover {
  background: var(--sky);
}
.avatar {
  align-items: center;
  background: var(--navy);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 34px;
  font-size: 0.75rem;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  letter-spacing: 0.03em;
  overflow: hidden;
  width: 34px;
}
.avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.account-chip-text {
  display: grid;
  min-width: 0;
  text-align: left;
}
.account-chip-text strong,
.account-chip-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-chip-text strong {
  font-size: 0.875rem;
  line-height: 1.2;
}
.account-chip-text small {
  color: var(--muted);
  font-size: 0.7rem;
}
.account-menu {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px #10364d20;
  max-width: calc(100vw - 24px);
  min-width: 245px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 10;
  transform-origin: top right;
}
.account-menu-head {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 2px;
  margin-bottom: 6px;
  padding: 8px;
}
.account-menu-head small {
  overflow-wrap: anywhere;
}
.account-menu a,
.account-menu button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--navy);
  display: flex;
  gap: 9px;
  font: inherit;
  font-size: 0.9rem;
  padding: 10px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}
.account-theme {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 10px 4px 6px;
}
.account-theme > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0 6px;
  text-transform: uppercase;
}
.theme-choice-group {
  display: grid;
  gap: 4px;
}
.theme-choice-group button {
  justify-content: flex-start;
}
.theme-choice-group button.selected {
  background: var(--sky);
  color: var(--blue);
  font-weight: 800;
}
.account-menu a:hover,
.account-menu button:hover,
.account-menu a:focus-visible,
.account-menu button:focus-visible {
  background: var(--sky);
}
.signout-button {
  color: #8f3030 !important;
}
.signout-all-button {
  color: #8f3030 !important;
  font-size: 0.9em;
}
.site-credit {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 12px auto 26px;
  padding: 0 4vw;
  text-align: center;
}
.site-credit a {
  color: inherit;
}
.signin-shell {
  display: grid;
  min-height: calc(100vh - 74px);
  place-items: center;
}
.signin-card,
.connection-card,
.storage-card,
.activity-card,
.mini-history {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 3px 8px #213b4b04;
}
.signin-card {
  max-width: 460px;
  padding: 32px;
  text-align: center;
  width: min(100%, 460px);
  position: relative;
  --sparkle-core: #1f78ad;
  --sparkle-soft: rgba(120, 199, 243, 0.9);
  --sparkle-glow: rgba(40, 126, 177, 0.35);
}
:root[data-theme="dark"] .signin-card {
  --sparkle-core: #ffffff;
  --sparkle-soft: rgba(120, 199, 243, 0.85);
  --sparkle-glow: rgba(120, 199, 243, 0.6);
}
/* Sign-in glint: two soft lights travel around the card's border, always on opposite sides. Purely decorative. */
@property --sparkle-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.signin-sparkle {
  border-radius: inherit;
  filter: drop-shadow(0 0 4px var(--sparkle-glow));
  inset: -1px;
  pointer-events: none;
  position: absolute;
}
.signin-sparkle::before {
  animation: signin-orbit 9s linear infinite;
  /* The pattern repeats every half turn, so the second light always sits directly across from the first. */
  background: repeating-conic-gradient(
    from var(--sparkle-angle),
    transparent 0turn 0.15turn,
    var(--sparkle-soft) 0.4turn,
    var(--sparkle-core) 0.475turn,
    transparent 0.5turn
  );
  border-radius: inherit;
  content: "";
  inset: 0;
  padding: 1.5px;
  position: absolute;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
@keyframes signin-orbit {
  to {
    --sparkle-angle: 1turn;
  }
}
@media (prefers-reduced-motion: reduce) {
  .signin-sparkle::before {
    --sparkle-angle: 40deg;
    animation: none;
    opacity: 0.7;
  }
}
/* Sign-in ambiance: tiny lights that ambient.mjs fades in and out at random spots and times inside the card, behind
   the logo and the button. The lights across the rest of the page are the shared background (backdrop.js). */
.ambient {
  --ambient-core: #4ea8df;
  --ambient-glow: rgba(40, 126, 177, 0.4);
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
:root[data-theme="dark"] .ambient {
  --ambient-core: #ffffff;
  --ambient-glow: rgba(120, 199, 243, 0.75);
}
.signin-page .signin-shell,
.signin-page .site-credit {
  position: relative;
  z-index: 1;
}
.signin-card {
  isolation: isolate;
}
.ambient-card {
  border-radius: inherit;
  position: absolute;
  z-index: -1;
}
.ambient-sprite {
  background: radial-gradient(circle, var(--ambient-core) 0 35%, var(--ambient-glow) 60%, transparent 72%);
  border-radius: 50%;
  box-shadow: 0 0 6px 1px var(--ambient-glow);
  opacity: 0;
  position: absolute;
}
/* Now and then a light is a four-point twinkle, like the sparkle in the logo. */
.ambient-sprite.is-star {
  background: radial-gradient(circle, var(--ambient-core) 0 14%, transparent 34%);
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 0 3px var(--ambient-glow));
}
.ambient-sprite.is-star::before,
.ambient-sprite.is-star::after {
  background: linear-gradient(90deg, transparent, var(--ambient-core), transparent) center / 100% 1.5px no-repeat;
  content: "";
  inset: 0;
  position: absolute;
}
.ambient-sprite.is-star::after {
  background: linear-gradient(transparent, var(--ambient-core), transparent) center / 1.5px 100% no-repeat;
}
@media (prefers-reduced-motion: reduce) {
  .ambient {
    display: none;
  }
}
.signin-logo {
  height: 96px;
  object-fit: contain;
  width: 230px;
}
/* The sign-in page is also the app's public home page, so it says what the app does: Google's brand check turns down
   a home page that is only a sign-in button. */
.signin-lead {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 10px auto 0;
  max-width: 32ch;
}
#signin-fallback {
  margin: 18px 0 0;
}
.signin-about {
  border-top: 1px solid var(--line);
  margin: 28px 0 0;
  padding: 20px 0 0;
  text-align: left;
}
.signin-about h2 {
  color: var(--navy);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  margin: 0 0 14px;
  text-align: center;
  text-transform: uppercase;
}
.signin-features {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.signin-features li {
  align-items: flex-start;
  color: var(--ink);
  display: flex;
  font-size: 0.92rem;
  gap: 12px;
  line-height: 1.4;
}
.signin-features li > .ui-icon,
.signin-features li > i[data-icon] {
  color: var(--blue);
  height: 20px;
  width: 20px;
}
.signin-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 18px 0 0;
}
.signin-note a {
  color: var(--blue);
  font-weight: 700;
}
/* Sign in with Google. Google's rules set the colours (white, or #131314 in dark mode), the full-colour "G" on white
   and the wording. The pill shape, size and motion are ours, so the button sits comfortably in the card. */
.google-signin {
  --google-fill: #fff;
  --google-stroke: #747775;
  --google-text: #1f1f1f;
  --google-layer: #1f1f1f;
  --google-glow: rgba(40, 126, 177, 0.22);
  --google-sheen: rgba(120, 199, 243, 0.38);
  --google-accent: #287eb1;
  align-items: center;
  background: var(--google-fill);
  border: 1px solid var(--google-stroke);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(16, 54, 77, 0.08), 0 10px 24px -16px rgba(16, 54, 77, 0.5);
  color: var(--google-text);
  display: flex;
  font: 500 16px/20px "Google Sans", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  gap: 12px;
  isolation: isolate;
  justify-content: center;
  margin: 28px auto 4px;
  min-height: 52px;
  overflow: hidden;
  padding: 8px 24px;
  position: relative;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  width: min(100%, 320px);
  -webkit-tap-highlight-color: transparent;
}
/* Both layers sit under the logo and the words, so the "G" is never tinted. */
.google-signin::before,
.google-signin::after {
  border-radius: inherit;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}
.google-signin::before {
  background: var(--google-layer);
  opacity: 0;
  transition: opacity 0.2s ease;
}
/* A soft light crosses the button when the page opens, on hover, and again every 10–30 seconds, echoing the glints on the card. */
.google-signin::after {
  animation: google-sheen 1.2s ease 0.8s backwards;
  background: linear-gradient(105deg, transparent 25%, var(--google-sheen) 50%, transparent 75%);
  transform: translateX(-105%);
}
/* signin.mjs switches data-glint between "a" and "b"; a new animation name is what starts the light again. */
.google-signin[data-glint="a"]::after {
  animation: google-sheen-again 1.2s ease;
}
.google-signin[data-glint="b"]::after {
  animation: google-sheen 1.2s ease;
}
.google-signin:hover {
  box-shadow: 0 0 0 4px var(--google-glow), 0 14px 28px -16px rgba(16, 54, 77, 0.6);
  transform: translateY(-1px);
}
.google-signin:hover::before {
  opacity: 0.08;
}
.google-signin:hover::after {
  transform: translateX(105%);
  transition: transform 0.9s ease;
}
.google-signin:active {
  transform: translateY(0) scale(0.99);
}
.google-signin:active::before {
  opacity: 0.12;
}
.google-signin:focus-visible {
  outline: 2px solid var(--google-accent);
  outline-offset: 3px;
}
.google-signin-mark {
  background: #fff;
  border-radius: 50%;
  display: grid;
  flex: none;
  height: 32px;
  place-items: center;
  position: relative;
  width: 32px;
}
.google-signin-mark svg {
  display: block;
  height: 20px;
  width: 20px;
}
/* While Google opens, a ring turns around the logo. */
.google-signin-mark::after {
  border: 2px solid transparent;
  border-radius: 50%;
  border-right-color: var(--google-accent);
  border-top-color: var(--google-accent);
  content: "";
  inset: -4px;
  opacity: 0;
  position: absolute;
  transition: opacity 0.2s ease;
}
.google-signin[aria-busy="true"] {
  cursor: progress;
}
.google-signin[aria-busy="true"]:hover {
  transform: none;
}
.google-signin.is-busy .google-signin-mark::after {
  animation: google-spin 0.8s linear infinite;
  opacity: 1;
}
@keyframes google-sheen {
  from {
    transform: translateX(-105%);
  }
  to {
    transform: translateX(105%);
  }
}
@keyframes google-sheen-again {
  from {
    transform: translateX(-105%);
  }
  to {
    transform: translateX(105%);
  }
}
@keyframes google-spin {
  to {
    transform: rotate(1turn);
  }
}
:root[data-theme="dark"] .google-signin {
  --google-fill: #131314;
  --google-stroke: #8e918f;
  --google-text: #e3e3e3;
  --google-layer: #e3e3e3;
  --google-glow: rgba(120, 199, 243, 0.2);
  --google-sheen: rgba(255, 255, 255, 0.18);
  --google-accent: #78c7f3;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.85);
}
:root[data-theme="dark"] .google-signin:hover {
  box-shadow: 0 0 0 4px var(--google-glow), 0 14px 30px -14px rgba(0, 0, 0, 0.9);
}
@media (prefers-reduced-motion: reduce) {
  .google-signin,
  .google-signin::before,
  .google-signin-mark::after {
    transition: none;
  }
  .google-signin::after {
    display: none;
  }
  .google-signin:hover,
  .google-signin:active {
    transform: none;
  }
  .google-signin.is-busy .google-signin-mark::after {
    animation: none;
  }
}
.signin-message,
.connection-banner {
  background: var(--sky);
  border: 1px solid #c8d7e2;
  border-radius: 8px;
  color: var(--navy);
  margin: 18px 0 0;
  padding: 12px 14px;
}
/* Preview email (email-preview.mjs): the customer email in a frame, at computer or phone width. The email
   itself always keeps its light look, like the invoice paper. */
.email-preview-dialog {
  background: var(--surface);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 60px #0a22334d;
  color: var(--ink);
  max-height: calc(100dvh - 24px);
  padding: 0;
  width: min(780px, calc(100vw - 24px));
}
.email-preview-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100dvh - 24px);
  padding: 18px 20px 16px;
}
.email-preview-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.email-preview-head .eyebrow {
  margin: 0 0 2px;
}
.email-preview-head h2 {
  color: var(--navy);
  font-size: 1.2rem;
  margin: 0;
}
.email-preview-head h2:focus {
  outline: none;
}
.email-preview-meta {
  display: grid;
  font-size: 0.9rem;
  gap: 4px;
  margin: 0;
}
.email-preview-meta div {
  display: grid;
  gap: 8px;
  grid-template-columns: 4.8em minmax(0, 1fr);
}
.email-preview-meta dt {
  color: var(--muted);
  font-weight: 700;
}
.email-preview-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.email-preview-views {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.email-preview-views .chip-button {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}
.email-preview-views .chip-button[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.email-preview-stage {
  background: #eef3f7;
  border: 1px solid var(--line);
  border-radius: 12px;
  color-scheme: light;
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}
.email-preview-stage iframe {
  background: #eef3f7;
  border: 0;
  display: block;
  height: min(68dvh, 900px);
  max-width: 100%;
  transition: width 220ms var(--ease-out, ease);
  width: 100%;
}
.email-preview-dialog[data-view="phone"] .email-preview-stage iframe {
  width: 390px;
}
.email-preview-note {
  margin: 0;
}
@media (max-width: 640px) {
  .email-preview-dialog {
    border-radius: 0;
    height: 100dvh;
    max-height: 100dvh;
    max-width: 100vw;
    width: 100vw;
  }
  .email-preview-shell {
    height: 100%;
    max-height: none;
    padding: 14px 14px calc(12px + env(safe-area-inset-bottom));
  }
  /* A phone already shows the phone width. */
  .email-preview-views {
    display: none;
  }
  .email-preview-stage iframe {
    height: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .email-preview-stage iframe {
    transition: none;
  }
}
/* Error pages (404.html, 500.html) reuse the sign-in card; these are the parts only they have. */
.error-brand {
  border-radius: 10px;
  display: inline-block;
}
.error-code {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 26px 0 0;
  text-transform: uppercase;
}
.error-title {
  color: var(--navy);
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 8px 0 0;
}
.error-text {
  color: var(--muted);
  line-height: 1.55;
  margin: 12px auto 0;
  max-width: 34ch;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 26px 0 0;
}
.error-actions .button {
  margin: 0;
}
.activity-tools {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-tabs .selected {
  background: var(--blue);
  color: #fff;
}
.activity-search {
  max-width: 520px;
}
.date-filter {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0;
  min-width: 0;
  padding: 14px 16px 12px;
}
.date-filter legend {
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0 6px;
}
.date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-button {
  background: #fff;
  border: 1px solid #b9d3e4;
  border-radius: 999px;
  color: var(--navy);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 7px 14px;
}
.chip-button:hover {
  background: var(--sky);
  border-color: var(--blue);
}
.chip-button.selected {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.chip-button:focus-visible {
  outline: 3px solid #9cc9e8;
  outline-offset: 2px;
}
.date-range {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: 12px;
}
.date-pair {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.8fr);
}
.date-range .button {
  margin: 0;
}
.date-filter-help {
  font-size: 0.82rem;
  margin: 10px 0 0;
}
.storage-card {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 14px 16px;
}
.storage-card span,
.activity-time,
.activity-card p span {
  color: var(--muted);
}
.storage-card #export-note {
  flex-basis: 100%;
}
.activity-list {
  display: grid;
  gap: 12px;
  min-height: 180px;
}
.activity-card {
  padding: 16px;
}
.activity-main {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}
/* Long unbroken text such as cody@hastingsexteriorcleaning.com wraps instead of pushing every card off a phone screen. */
.activity-main > div {
  min-width: 0;
}
.activity-main strong,
.activity-main p {
  overflow-wrap: anywhere;
}
.activity-main p,
.activity-time {
  margin: 4px 0 0;
}
.detail-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}
.detail-list div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
}
.detail-list dt {
  color: var(--muted);
  font-weight: 700;
}
.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.lookup-list {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.lookup-list li {
  display: grid;
  gap: 10px;
  grid-template-columns: 110px minmax(0, 1fr);
}
.lookup-list time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}
.lookup-list span {
  overflow-wrap: anywhere;
}
#load-more-activity {
  margin-top: 16px;
}
.mini-history {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  padding: 12px;
}
.mini-history small {
  margin: 0;
}
.connection-card {
  margin: 18px 0;
  overflow-wrap: break-word;
  padding: 20px;
}
.connections-page h1,
.setup-guide h1,
.setup-guide h2,
.activity-card strong,
.activity-search {
  align-items: center;
  display: flex;
  gap: 10px;
}
.activity-search {
  flex-wrap: wrap;
}
.setup-guide > a:first-child {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}
.activity-search input {
  flex-basis: 100%;
}
.setup-checklist {
  display: grid;
  gap: 10px;
  min-height: 250px;
}
.check-row {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 4px;
  padding: 12px;
}
.check-row.ok strong {
  color: #1b6f3a;
}
.check-row.bad strong {
  color: #9a332b;
}
.check-row.checking strong {
  color: var(--muted);
}
.check-row.off strong {
  color: var(--info-ink);
}
.check-row strong a {
  color: inherit;
  text-underline-offset: .15em;
}
.check-row strong {
  align-items: center;
  display: flex;
  gap: 8px;
}
.check-row span {
  color: var(--muted);
}
.connections-page .setup-guide {
  max-width: 980px;
}
.invoice-cards {
  min-height: 180px;
}
.account-panel {
  min-height: 420px;
}
.connection-card {
  min-height: 150px;
}
@media (max-width: 800px) {
  .topbar {
    align-items: flex-start;
    gap: 10px;
    padding: 14px 4vw;
  }
  /* A zero starting width lets the logo block share the top row with the account button and shrink to fit,
     instead of pushing the button onto a row of its own (where its menu would open off the screen). */
  .topbar .brand {
    flex: 1 1 0;
    gap: 12px;
    min-width: 0;
  }
  .brand img {
    flex: 0 1 138px;
    height: 56px;
    min-width: 0;
    width: 138px;
  }
  /* Script lettering can wrap onto two lines, so the account button never gets pushed off the screen. */
  .workspace-label {
    font-size: 1.35rem;
    line-height: 1;
    max-width: none;
    min-width: 0;
    white-space: normal;
  }
  /* The account button sits beside the logo; the menu gets its own row below. */
  .app-nav {
    flex: 1 1 100%;
    margin: 2px -4vw 0;
    order: 3;
    overflow-x: auto;
    padding: 0 4vw 4px;
  }
  .app-nav a {
    padding: 8px 10px;
  }
  .account-slot {
    flex: 0 0 auto;
    order: 2;
  }
  .account-chip {
    max-width: 120px;
    padding-right: 8px;
  }
  .account-chip-text small {
    display: none;
  }
  .account-chip-text strong {
    max-width: 62px;
  }
  .account-menu {
    right: 0;
  }
  .signin-card {
    padding: 24px 18px;
  }
  .activity-main {
    display: grid;
  }
  .activity-main .pill {
    justify-self: start;
  }
  .detail-list div {
    grid-template-columns: 1fr;
    gap: 1px;
  }
  .lookup-list li {
    grid-template-columns: 5em minmax(0, 1fr);
  }
  .storage-card {
    align-items: start;
    display: grid;
  }
  .date-range {
    align-items: stretch;
    display: grid;
  }
  .date-pair {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}
/* On phones the four menu links don't fit on one line, so they sit two by two (none hidden off to the side). */
@media (max-width: 540px) {
  .app-nav {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    overflow: visible;
    padding: 0;
  }
  .app-nav a {
    border: 1px solid #d5e1ea;
    justify-content: center;
    padding: 10px 8px;
    text-align: center;
  }
  .app-nav a[aria-current="page"] {
    border-color: transparent;
  }
}
/* Phones show just the picture; the name and email are in the account menu (and still read out). */
@media (max-width: 540px) {
  .account-chip {
    max-width: none;
    padding: 4px;
  }
  .account-chip-text {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }
}
/* The smallest phones get a smaller logo and lettering so both still fit beside the account button, and the menu
   links may wrap onto two lines ("Invoices & payments" is wider than half the screen). */
@media (max-width: 360px) {
  .topbar .brand {
    gap: 8px;
  }
  .brand img {
    flex-basis: 112px;
    height: 46px;
    width: 112px;
  }
  .workspace-label {
    font-size: 1.15rem;
  }
  .app-nav a {
    line-height: 1.2;
    white-space: normal;
  }
}

/* Settings page */
.settings-page .setup-guide {
  max-width: 980px;
}
/* The app's base form style draws a card; here each section is its own card instead. */
#settings-form {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 18px;
  margin-top: 14px;
  overflow: visible;
  padding: 0;
}
.settings-intro {
  color: var(--muted);
}
.settings-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 4px;
}
.settings-jump a {
  background: var(--sky);
  border-radius: 999px;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 12px;
  text-decoration: none;
}
.settings-jump a:hover,
.settings-jump a:focus-visible {
  background: #d8ebf6;
}
.settings-card {
  margin: 0;
  scroll-margin-top: 16px;
}
.settings-card h2 {
  margin: 0 0 4px;
}
.settings-card .help {
  margin: 0;
}
.settings-card .settings-note {
  font-size: 0.9rem;
  margin-top: 14px;
}
.settings-card .grid {
  margin: 16px 0 0;
}
.settings-card label small {
  white-space: normal;
}
.settings-gap {
  margin-top: 16px;
}
.settings-card .address-wrap {
  margin-top: 16px;
}
.settings-toggle {
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 16px 0 0;
  padding: 12px 14px;
}
.settings-toggle:has(input:checked) {
  background: #f1f9f4;
  border-color: #b9e0c9;
}
.settings-toggle strong {
  color: var(--navy);
  display: block;
}
.settings-toggle small {
  margin-top: 2px;
}
.letterhead-preview,
.payment-preview {
  background: #fbfdfe;
  border: 1px dashed #c8d7e2;
  border-radius: 10px;
  margin: 18px 0 0;
  padding: 14px 16px;
}
.letterhead-preview figcaption,
.payment-preview figcaption {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.letterhead {
  display: grid;
  gap: 3px;
  font-size: 0.85rem;
  color: #4a5d6c;
  overflow-wrap: anywhere;
}
.letterhead strong {
  color: var(--navy);
  font-size: 1rem;
}
.letterhead .letterhead-web {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
}
.payment-preview dl {
  display: grid;
  gap: 8px;
  margin: 0;
}
.payment-preview dl div {
  display: grid;
  gap: 12px;
  grid-template-columns: 96px minmax(0, 1fr);
}
.payment-preview dt {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
}
.payment-preview dd {
  color: #4a5d6c;
  font-size: 0.85rem;
  margin: 0;
  overflow-wrap: anywhere;
}
.payment-preview dd.is-blank {
  color: var(--muted);
  font-style: italic;
}
.settings-example {
  background: var(--sky);
  border-radius: 8px;
  color: var(--navy);
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 16px 0 0;
  padding: 10px 12px;
}
.settings-example:empty {
  display: none;
}
.workday-picker {
  border: 0;
  margin: 16px 0 0;
  min-width: 0;
  padding: 0;
}
.workday-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.day-chip {
  position: relative;
}
.day-chip input {
  cursor: pointer;
  height: 100%;
  inset: 0;
  margin: 0;
  opacity: 0;
  position: absolute;
  width: 100%;
}
.day-chip span {
  align-items: center;
  background: #fff;
  border: 1px solid #b9d3e4;
  border-radius: 999px;
  color: var(--navy);
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 700;
  gap: 5px;
  justify-content: center;
  min-height: 40px;
  min-width: 64px;
  padding: 8px 12px;
}
.day-chip input:checked + span {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.day-chip input:checked + span::before {
  content: "✓";
  content: "✓" / "";
  font-size: 0.8rem;
}
.day-chip input:focus-visible + span {
  outline: 3px solid #9fcdea;
  outline-offset: 2px;
}
.workday-picker[aria-invalid="true"] .day-chip span {
  border-color: #d0564d;
}
.workday-picker > small {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  margin-top: 8px;
}
.calendar-access {
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #344a5b;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 16px 0 0;
  overflow-wrap: anywhere;
  padding: 10px 12px;
}
.calendar-access[data-tone="ok"] {
  background: #f1f9f4;
  border-color: #b9e0c9;
}
.calendar-access[data-tone="warn"] {
  background: #fff8e8;
  border-color: #f0d59c;
}
.calendar-admin {
  margin-top: 8px;
}
.calendar-admin summary {
  color: var(--navy);
  cursor: pointer;
  font-weight: 700;
}
.calendar-admin ol {
  margin: 8px 0 0;
  padding-left: 20px;
}
.calendar-admin li + li {
  margin-top: 4px;
}
.calendar-admin code {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 0.8rem;
  padding: 1px 5px;
}
.calendar-admin p {
  margin: 8px 0 0;
}
.calendar-check-row {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
}
.calendar-check-result {
  color: #344a5b;
  flex: 1 1 260px;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.calendar-check-result:empty {
  display: none;
}
.calendar-check-result p {
  font-weight: 700;
  margin: 0 0 4px;
}
.calendar-check-result[data-tone="warn"] p {
  color: #8a5a00;
}
.calendar-check-result ul {
  margin: 0;
  padding-left: 18px;
}
.calendar-check-result li.is-ok::marker {
  color: #1d7a46;
}
.calendar-check-result li.is-bad::marker {
  color: #b3261e;
}
.settings-actions {
  align-items: center;
  background: #ffffffee;
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 14px;
  bottom: 12px;
  box-shadow: 0 10px 28px #10364d1f;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  margin: 22px 0 0;
  padding: 12px 16px;
  position: sticky;
  z-index: 5;
}
.settings-status {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}
.settings-status[data-tone="dirty"] {
  color: #8a5a00;
  font-weight: 700;
}
.settings-status[data-tone="saved"] {
  color: #1f7a4d;
  font-weight: 700;
}
.settings-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.settings-buttons .button {
  margin: 0;
}
@media (max-width: 800px) {
  .settings-actions {
    align-items: stretch;
    bottom: 8px;
    flex-direction: column;
  }
  .settings-buttons .button {
    flex: 1 1 140px;
    min-width: 0;
  }
  .payment-preview dl div {
    gap: 2px;
    grid-template-columns: 1fr;
  }
}
/* Tablets and laptops: the logo, menu links and account button don't fit on one line, so the logo and
   account button (picture, name and email) share the top row and the menu links get a full row below. */
@media (min-width: 801px) and (max-width: 1439px) {
  .topbar {
    row-gap: 12px;
  }
  .topbar .brand {
    flex: 1 1 auto;
    min-width: 0;
  }
  .account-slot {
    order: 2;
  }
  .app-nav {
    border-top: 1px solid var(--line);
    flex: 1 1 100%;
    margin-left: 0;
    order: 3;
    padding-top: 10px;
  }
}
/* Employees don't get the administrator pages (account-ui.mjs sets data-role once it knows who is signed in). */
:root[data-role="staff"] .app-nav a[href="activity.html"] {
  display: none;
}
.admin-only-note {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin: 48px auto;
  max-width: 520px;
  padding: 32px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.admin-only-note > .ui-icon {
  color: var(--blue);
}
.admin-only-note h1 {
  font-size: 1.4rem;
  margin: 0;
}
.admin-only-note p {
  color: var(--muted);
  margin: 0;
}
