:root {
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --accent: #1559ac;
  --line: #dbe2ec;
  --muted: #566474;
  background: #edf2f9;
}
button.secondary { color: #134a8a; background: #e7f0fd; }
.quiet { color: #47596d; }
:focus-visible { outline-color: #3779cc; }
.in-owner { background: #e2eaf4; }
.in-owner > header, .in-owner > .testbar { display: none; }
.owner-workspace {
  display: grid;
  grid-template: auto minmax(0,1fr) / 226px minmax(0,1fr);
  max-width: 1108px;
  height: min(940px, calc(100dvh - 48px));
  gap: 0;
  padding: 0;
  margin: 24px auto;
  background: #f5f7fb;
  border-radius: 22px;
  box-shadow: 0 14px 42px #203f6330;
  overflow: hidden;
}
.owner-profile, .owner-navigation { border-right: 1px solid var(--line); background: #eaf0f8; }
.owner-profile { display: flex; align-items: center; gap: 10px; padding: 21px 14px 16px; min-width: 0; }
.owner-profile strong, .owner-profile small { display: block; overflow-wrap: anywhere; }
.owner-profile small { margin-top: 3px; font-size: .79rem; color: var(--muted); }
.owner-profile .avatar { width: 42px; height: 42px; background: #dce9f9; color: #154988; font-size: 1.15rem; }
.owner-navigation { grid-column: 1; padding: 6px 12px 12px; }
.owner-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  background: transparent;
  color: #45566a;
  text-align: left;
  font-size: .9rem;
  font-weight: 650;
}
.owner-nav-item[aria-current] { color: #154988; background: #d7e7fc; }
.owner-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 50px;
  background: #a83346;
  color: white;
  font-size: .75rem;
  font-weight: 700;
}
.owner-nav-item .owner-count { margin-left: auto; }
.owner-content {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 0;
  overflow: auto;
  scrollbar-color: #a8b8c9 transparent;
  padding: 23px clamp(18px,4vw,47px) 30px;
}
.owner-content h1 { margin: 12px 0 14px; font-size: clamp(2rem,4vw,3rem); line-height: 1.06; }
.owner-content h2 { font-size: 1.19rem; }
.owner-toolbar, .owner-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.owner-toolbar { justify-content: space-between; }
.owner-tools { gap: 4px; }
.owner-tools button { font-size: .82rem; min-height: 44px; padding: 7px 8px; }
.owner-tools .owner-count { margin-left: 5px; }
.owner-nav-item svg, .record-date-actions svg, .record-row svg, .sheet-heading svg { width: 19px; height: 19px; flex: none; }
.owner-content .entry, .owner-content .service {
  margin-block: 10px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.owner-content .entry p:last-child { margin-bottom: 0; }
.owner-content .entry .actions { margin-top: 12px; }
.record-scopes, .record-date-actions, .service-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.record-scopes { margin-bottom: 12px; }
.record-scopes button, .record-date-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: #273445;
  font-size: .88rem;
}
.record-scopes button[aria-pressed="true"] { color: #154988; background: #e7f0fd; border-color: transparent; }
.record-date-actions button { justify-content: center; min-width: 44px; padding-inline: 9px; }
.record-day { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 10px; min-height: 44px; }
.record-day h2 { margin: 0; }
.record-next { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; margin-bottom: 16px; background: #e7f0fd; border: 1px solid #cbdff9; border-radius: 14px; }
.record-next p { margin: 0 0 4px; color: #134a8a; font-size: .85rem; font-weight: 650; }
.record-next h3 { margin: 0 0 3px; font-size: 1.14rem; }
.record-next button { padding: 8px 12px; font-size: .86rem; min-height: 44px; }
.visits-title { margin-block: 12px 8px; }
.record-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }
.record-list li + li { border-top: 1px solid #e6ebf2; }
.record-row { display: grid; grid-template-columns: 58px minmax(0,1fr) auto 16px; align-items: center; gap: 9px; width: 100%; min-height: 67px; padding: 9px 12px; background: #fff; color: #202a38; text-align: left; }
.record-row:focus-visible { outline-offset: -4px; }
.record-row small { display: block; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.record-row .status { width: fit-content; font-size: .76rem; padding: 4px 7px; }
.record-time { font-variant-numeric: tabular-nums; }
.record-row .visit-arrow { width: 15px; height: 15px; color: var(--muted); }
.sheet-heading h2 { margin-top: 0; }
.sheet-heading button { display: inline-grid; place-items: center; }
#confirm-dialog .entry:last-child { border-bottom: 0; }
#confirm-dialog form .error:empty { display: none; }
.schedule-grid button.day-off[aria-pressed=true] { box-shadow: inset 0 0 0 2px var(--accent); }
.demo-link { display: inline-block; padding: 10px 4px; margin-top: 10px; margin-left: 8px; }
.service-tools { margin-bottom: 10px; }
.schedule-date-visits { margin: 8px 0 12px; }
.schedule-date-visits button { padding: 4px 6px; min-height: 44px; }
details.entry summary { cursor: pointer; font-weight: 650; }
@media (max-width: 760px) {
  .owner-workspace { height: 100dvh; margin: 0; border-radius: 0; grid-template: auto minmax(0,1fr) auto / minmax(0,1fr); box-shadow: none; }
  .owner-profile { padding: max(8px, env(safe-area-inset-top)) 14px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .owner-profile .avatar { width: 36px; height: 36px; }
  .owner-content { grid-area: 2 / 1; padding: 12px 14px 24px; }
  .owner-navigation { grid-area: 3 / 1; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 2px; padding: 5px 4px max(6px,env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); }
  .owner-nav-item { flex-direction: column; justify-content: center; gap: 3px; min-height: 49px; padding: 4px 0; font-size: .75rem; }
  .owner-nav-item svg { width: 18px; height: 18px; }
  .owner-nav-item .owner-count { position: absolute; top: 1px; left: calc(50% + 4px); min-width: 17px; height: 17px; font-size: .72rem; }
  .owner-tools button { padding-inline: 4px; }
  .record-day h2 { font-size: .97rem; }
  .record-row { grid-template-columns: 43px minmax(0,1fr) 12px; gap: 5px 7px; padding: 8px 9px; }
  .record-row .record-time { grid-row: 1 / span 2; }
  .record-row .status { grid-column: 2; grid-row: 2; }
  .record-row .visit-arrow { grid-column: 3; grid-row: 1 / span 2; }
  .in-owner #notice { bottom: calc(62px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .owner-content { padding-inline: 10px; }
  .record-scopes { gap: 4px; }
  .record-scopes button { padding-inline: 7px; }
  .record-next { flex-wrap: wrap; }
}

.record-quick { margin: 0 0 12px; }
.record-quick button { min-height: 44px; padding: 8px 12px; }
.quick-break-review { margin-block: 12px; }
.quick-break-review > p { margin-bottom: 10px; }
.schedule-impact { margin: 14px 0; padding: 12px; border-radius: 10px; background: #fff3db; color: #493713; }
.schedule-impact > p { margin: 4px 0 8px; color: #614b25; }
.schedule-impact ul { list-style: none; margin: 0; padding: 0; }
.schedule-impact li { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 0; border-top: 1px solid #eddbb4; }
.schedule-impact li span { display: block; margin-top: 2px; font-size: .87rem; }
.schedule-impact li button, .day-pause button { min-height: 44px; padding: 7px 10px; }
.day-pause { margin: 6px 0 8px; padding: 8px; border-radius: 8px; background: #f3f6fb; }
.day-pause .time-fields { margin: 0 0 2px; }
.day-pause button { color: #3f526a; }
#confirm-dialog:has([data-form="dayEditor"], [data-form="quickBreak"]) { max-height: calc(100dvh - 24px); }

.settings-intro { color: var(--muted); margin-bottom: 22px; }
.settings-group { margin-bottom: 22px; }
.settings-group h2 { margin: 0 0 8px; }
.settings-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 8px 16px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.settings-row:last-child { border-bottom: 1px solid var(--line); }
.settings-row h3 { margin: 0; font-size: 1rem; }
.settings-value { margin: 3px 0 0; color: #244a76; font-weight: 650; overflow-wrap: anywhere; }
.settings-description { margin: 2px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.settings-row button { min-height: 44px; padding: 8px 12px; font-size: .88rem; }
.setting-options { display: grid; gap: 8px; }
.setting-option {
  display: grid;
  grid-template-columns: 20px minmax(0,1fr);
  align-items: start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}
.setting-option:has(input:checked) { border-color: #9bb9dc; background: #eaf2fc; }
.setting-option input { width: 18px; min-height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.setting-option small { display: block; margin-top: 3px; color: var(--muted); font-size: .86rem; font-weight: 400; }
#confirm-dialog:has(.setting-options, .contact-fields) { max-height: calc(100dvh - 24px); }
@media (max-width: 540px) {
  .settings-row { grid-template-columns: minmax(0,1fr); }
  .settings-row button { justify-self: start; }
  .settings-intro { margin-bottom: 16px; }
  .settings-group { margin-bottom: 18px; }
}

.bot-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bot-identity p { width: 100%; margin: 0; }
.connection-actions { display: grid; gap: 8px; margin-top: 15px; }
.connection-actions button, .connection-key button { text-align: left; }
.connection-footnote { margin: 10px 0 0; }
.connection-review { margin: 12px 0; }
.connection-key { display: grid; gap: 7px; justify-items: start; padding: 12px; margin-bottom: 12px; border-radius: 10px; background: #f0f5fc; }
.connection-key p { margin: 0; }
.copy-status:empty { display: none; }
.connection-links { margin: 0 0 14px; }
.connection-links > div { padding: 9px 0; border-bottom: 1px solid var(--line); }
.connection-links dt { font-weight: 650; }
.connection-links dd { margin: 3px 0 0; color: var(--muted); }
.bot-chat-archive { margin-top: 16px; }
.bot-chat-archive summary { cursor: pointer; font-weight: 650; padding: 8px 0; }
.bot-chat-archive section { margin-top: 10px; }

.product-workspace {
  --workspace-navigation: #e7eef7;
  --workspace-controls: #edf3fa;
  border: 1px solid #d4dfec;
  box-shadow: 0 16px 40px #203f6326;
}
.product-workspace :is(.owner-profile,.owner-navigation) { background: var(--workspace-navigation); }
.product-workspace .owner-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
  margin-bottom: 12px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--workspace-controls);
}
.product-workspace .owner-tools > a { display: inline-flex; min-height: 44px; align-items: center; }
@supports (backdrop-filter: blur(12px)) {
  .product-workspace .owner-topbar {
    background: rgb(231 239 248 / 76%);
    backdrop-filter: blur(12px);
  }
}
@media (max-width: 760px) {
  .product-workspace { border: 0; box-shadow: none; }
  .product-workspace .owner-topbar { padding: 5px 8px 0; }
  .product-workspace .owner-topbar :is(.owner-toolbar,.owner-tools) { display: contents; }
}
