:root {
  color-scheme: dark;
  --bg: #080811;
  --surface: #11101c;
  --surface-alt: #171526;
  --empty: #363640;
  --empty-line: #50505b;
  --ink: #f8f3e7;
  --muted: #a39aa9;
  --line: rgba(255, 255, 255, 0.1);
  --brand-accent: #f3bf4f;
  --brand-accent-dark: #d99c2b;
  --client-accent: #f3bf4f;
  --focus: #f3bf4f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.auth-loading .app-shell {
  visibility: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 78% 0%, rgba(84, 55, 132, 0.28), transparent 30rem),
    radial-gradient(circle at 16% 6%, rgba(243, 191, 79, 0.08), transparent 24rem),
    radial-gradient(circle at 44% 100%, rgba(77, 199, 161, 0.08), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

.test-body {
  min-height: 100vh;
  background: #f6f7fb;
  color: #080811;
}

.test-body[data-background="dark"] {
  background: #080811;
  color: #f8f3e7;
}

.test-toolbar {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 2;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: #080811;
  color: var(--ink);
}

.test-toolbar h1 {
  font-size: 26px;
}

.test-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.test-page-shell {
  padding: 42px 24px;
}

.test-page-content {
  width: min(1180px, 100%);
  margin: 0 auto;
}

#testEmbedMount {
  width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--brand-accent);
  color: #100d17;
  cursor: pointer;
  font-weight: 900;
  padding: 0 16px;
  box-shadow: 0 10px 24px rgba(243, 191, 79, 0.12);
}

button:hover {
  background: var(--brand-accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

button.is-idle {
  opacity: 0.48;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  padding: 28px;
}

body:not(.signed-out) .app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
}

.signed-out .app-shell {
  grid-template-columns: minmax(300px, 420px);
  align-content: center;
  justify-content: center;
}

.signed-out .access-pane {
  display: grid;
  width: 100%;
}

.editor-pane,
.access-pane {
  min-width: 0;
}

.access-pane {
  display: none;
  align-content: start;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom:100px;
}

.topbar > div:first-child {
  margin-right: auto;
}

.identity-pill {
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-client-control {
  width: min(260px, 100%);
}

.topbar-menu {
  position: relative;
}

.topbar-menu-list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 6px;
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu-button {
  display: flex;
  align-items: center;
  justify-content: start;
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  text-align: left;
}

.menu-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.danger-menu-button {
  color: #ff9c8d;
}

.danger-menu-button:hover {
  background: rgba(240, 104, 87, 0.12);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
}

h2 {
  font-family: var(--serif);
  font-size: 18px;
}

.eyebrow {
  color: var(--brand-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 42%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.settings-grid label {
  width: 110px;
}

.settings-grid .theme-control {
  width: 92px;
}

.settings-grid .color-control {
  width: 92px;
}

.color-control input {
  min-height: 40px;
  padding: 4px;
  cursor: pointer;
}

.schedule-control-group {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  justify-self: stretch;
}

.schedule-control-group > button,
.schedule-control-group label {
  flex: 0 0 auto;
  white-space: nowrap;
}

.expanded-schedule-title {
  flex: 1 1 360px;
  margin-right: auto;
  min-width: min(320px, 100%);
}

.expanded-schedule-title-inner {
  display: flex;
  align-items: end;
  gap: 10px;
  min-width: 0;
}

.expanded-schedule-name {
  flex: 1 1 auto;
  min-height: 42px;
  border: 1px solid transparent;
  align-content: center;
}

.expanded-schedule-name-input {
  flex: 1 1 auto;
  width: 100%;
}

.schedule-close-button {
  flex: 0 0 auto;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0d17;
  color: var(--ink);
}

select {
  color-scheme: dark;
}

select option {
  background: #0d0d17;
  color: var(--ink);
}

input,
select {
  min-height: 40px;
  padding: 8px 10px;
}

textarea {
  min-height: 154px;
  resize: vertical;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.calendar-editor {
  display: grid;
  gap: 16px;
  padding: 22px;
  overflow-x: auto;
}

.calendar-editor {
  grid-template-columns: 44px repeat(7, minmax(132px, 1fr));
  background: #0b0b14;
}

.row-tools-column {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 44px;
}

.row-tools-spacer {
  height: 16px;
}

.row-tool {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 146px;
}

.row-move-button {
  width: 20px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  box-shadow: none;
}

.row-move-button:hover:not(:disabled) {
  border-color: rgba(243, 191, 79, 0.52);
  color: var(--ink);
  background: rgba(243, 191, 79, 0.08);
}

.row-move-button:disabled {
  cursor: default;
  opacity: 0.24;
}

.day-column {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 132px;
}

.day-column h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
  text-align: center;
}

.day-column h3 {
  color: var(--ink);
}

.editor-slot {
  display: grid;
  align-content: center;
  min-height: 96px;
  border: 1px solid var(--empty-line);
  border-radius: 8px;
  background: var(--empty);
}

.editor-slot {
  gap: 6px;
  min-height: 146px;
}

.editor-slot:focus-within {
  border-color: var(--client-accent);
  background: var(--surface-alt);
}

.filled-slot.editor-slot:focus-within {
  background: var(--surface-alt);
}

.slot-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}

.slot-title-input,
.slot-time-input {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
}

.slot-title-input {
  padding: 0 10px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
}

.slot-title-select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background-color: #20202a;
  color: var(--ink);
  color-scheme: dark;
  text-overflow: ellipsis;
}

.slot-automation-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(176, 176, 195, 0.8);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.slot-time-input {
  padding: 8px 10px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.slot-time-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  align-items: center;
  padding: 2px 8px 0;
}

.slot-time-select {
  min-width: 0;
  min-height: 30px;
  padding: 3px 4px;
  border-radius: 7px;
  background-color: #0d0d17;
  color: var(--ink);
  color-scheme: dark;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.slot-title-select option,
.slot-time-select option {
  background: #0d0d17;
  color: var(--ink);
}

.unbookable-slot.filled-slot {
  border-color: rgba(255, 255, 255, 0.18);
}

.slot-automation-dot.is-on {
  border-color: var(--client-accent);
  background: var(--client-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--client-accent) 18%, transparent);
  animation: vektorSchedulerBlip 1.6s ease-out infinite;
}

@keyframes vektorSchedulerBlip {
  0% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--client-accent) 18%, transparent);
  }
  70% {
    box-shadow: 0 0 0 9px color-mix(in srgb, var(--client-accent) 0%, transparent);
  }
  100% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--client-accent) 0%, transparent);
  }
}

.slot-time-separator {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.slot-automation-select {
  width: calc(100% - 20px);
  min-height: 32px;
  margin: 0 10px;
  padding: 4px 8px;
  font-size: 12px;
}

.slot-title-input::placeholder,
.slot-time-input::placeholder {
  color: #85838d;
  opacity: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.ghost-button,
.secondary-button,
.danger-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}

.ghost-button:hover,
.secondary-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.danger-button {
  border-color: rgba(240, 104, 87, 0.42);
  color: #ff9c8d;
}

.danger-button:hover {
  background: rgba(240, 104, 87, 0.12);
}

.auth-panel,
.schedule-list-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.embed-inline-panel {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) repeat(4, minmax(140px, max-content)) minmax(max-content, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}

.embed-inline-panel #expandedDeleteButton {
  grid-column: 1;
  justify-self: start;
}

.embed-inline-panel [data-copy-target="staticEmbedCode"] {
  grid-column: 2;
}

.embed-inline-panel [data-copy-target="bookingEmbedCode"] {
  grid-column: 3;
}

.embed-inline-panel [data-copy-target="leadEmbedCode"] {
  grid-column: 4;
}

.embed-inline-panel #testEmbedButton {
  grid-column: 5;
}

.embed-inline-panel textarea {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.embed-inline-panel .status-line {
  grid-column: 1 / -1;
  text-align: center;
}

.embed-inline-panel .status-line:empty {
  display: none;
}

.slot-title-settings,
.lead-option-settings {
  display: grid;
  gap: 12px;
}

.slot-title-builder {
  display: grid;
}

.slot-title-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.lead-option-setting {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f0e19;
  padding: 12px;
}

.lead-option-setting__header,
.lead-conditional-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.lead-conditional-setting-list {
  display: grid;
  gap: 8px;
}

[data-copy-target="staticEmbedCode"] {
  border: 1px solid rgba(243, 191, 79, 0.7);
  background: rgba(243, 191, 79, 0.14);
  color: #dffcf2;
  box-shadow: 0 10px 24px rgba(243, 191, 79, 0.08);
}

[data-copy-target="staticEmbedCode"]:hover {
  background: rgba(243, 191, 79, 0.22);
}

[data-copy-target="leadEmbedCode"] {
  border: 1px solid rgba(77, 199, 161, 0.58);
  background: rgba(77, 199, 161, 0.18);
  color: #dffcf2;
  box-shadow: 0 10px 24px rgba(77, 199, 161, 0.08);
}

[data-copy-target="leadEmbedCode"]:hover {
  background: rgba(77, 199, 161, 0.28);
}

.schedule-list-panel {
  margin-bottom: 16px;
  display: grid;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.schedule-rows {
  display: grid;
  gap: 14px;
}

.list-context-heading {
  display: grid;
  gap: 2px;
  padding: 0 2px 2px;
}

.list-context-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.list-context-heading strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.1;
}

.schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 42%),
    var(--surface);
  box-shadow: none;
  overflow: hidden;
  cursor: pointer;
}

.client-row.is-selected {
  border-color: rgba(243, 191, 79, 0.72);
  background:
    linear-gradient(135deg, rgba(243, 191, 79, 0.11), transparent 42%),
    var(--surface);
}

.client-schedules-button {
  flex: 0 0 auto;
}

.schedule-collapsed-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.015);
}

.schedule-row:not(.expanded):hover {
  border-color: color-mix(in srgb, var(--brand-accent) 45%, var(--line));
}

.schedule-row:not(.expanded):hover .schedule-row-main span {
  color: var(--brand-accent);
}

.schedule-row.expanded {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  cursor: default;
}

.schedule-row-main {
  display: grid;
  justify-items: start;
  gap: 3px;
  min-height: 48px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.schedule-row-main span {
  font-weight: 900;
}

.schedule-row-title-field {
  flex: 1 1 360px;
  align-content: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.schedule-row-meta {
  display: inline-grid;
  align-items: center;
  min-height: 42px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.schedule-name-input {
  min-height: 48px;
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  box-shadow: none;
}

.schedule-name-input:focus-visible {
  outline: 0;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(243, 191, 79, 0.16);
}

.expanded-schedule-mount {
  grid-column: 1 / -1;
}

.expanded-schedule-mount .panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
}

#newScheduleMount {
  margin-top: 16px;
}

.stack {
  display: grid;
  gap: 12px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented-control button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.segmented-control button:hover,
.segmented-control button.is-selected {
  border-color: var(--brand-accent);
  background: rgba(243, 191, 79, 0.12);
}

.status-line {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.status-error {
  color: #ff9c8d;
}

.auth-panel #authStatus {
  min-height: 0;
  padding: 12px 14px;
  border: 1px solid rgba(243, 191, 79, 0.44);
  border-radius: 8px;
  background: rgba(243, 191, 79, 0.1);
  color: #ffe4a8;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.auth-panel #authStatus:empty {
  display: none;
}

.auth-panel #authStatus.status-error {
  border-color: rgba(240, 104, 87, 0.5);
  background: rgba(240, 104, 87, 0.12);
  color: #ffb7ad;
}

.editor-list {
  display: grid;
  gap: 8px;
}

.inline-editor-list {
  padding: 0 18px 14px;
}

.modal-dialog {
  width: min(420px, calc(100vw - 28px));
  border: 0;
  border-radius: 14px;
  padding: 0;
  box-shadow: var(--shadow);
}

.automation-dialog {
  width: min(620px, calc(100vw - 28px));
}

.builder-dialog {
  width: min(720px, calc(100vw - 28px));
}

.modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.modal-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.builder-dialog .modal-panel {
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}

.automation-list {
  display: grid;
  gap: 8px;
}

.workflow-settings {
  display: grid;
  gap: 12px;
}

.automation-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f0e19;
}

.automation-item label {
  min-width: 0;
}

.editor-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.editor-pill:hover {
  border-color: rgba(255, 92, 72, 0.6);
  background: rgba(255, 92, 72, 0.12);
  color: #ffd3cc;
}

.editor-pill span {
  min-width: 0;
}

.editor-pill__remove {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font-size: 17px;
  line-height: 1;
}

.editor-pill__remove:hover {
  border-color: rgba(255, 92, 72, 0.75);
  background: rgba(255, 92, 72, 0.24);
  color: #fff4f2;
}

.filled-slot.editor-slot {
  border-width: 2px;
  border-color: var(--client-accent);
  background: var(--surface-alt);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  background: #0f0e19;
  border: 1px solid var(--line);
  border-radius: 10px;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px;
  }

  .settings-grid,
  .embed-inline-panel,
  .button-row {
    grid-template-columns: 1fr;
  }

  .schedule-control-group {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    justify-self: stretch;
    gap: 10px;
  }

  .schedule-control-group label {
    flex: 1 1 92px;
    width: auto;
  }

  .schedule-control-group button {
    flex: 1 1 132px;
  }

  .schedule-collapsed-bar {
    flex-wrap: wrap;
  }

  .schedule-row-title-field {
    flex-basis: 100%;
  }

  .expanded-schedule-title {
    flex: 1 1 100%;
    min-width: 0;
    margin-right: 0;
  }

  .expanded-schedule-title-inner {
    flex-wrap: wrap;
  }

  .embed-inline-panel #expandedDeleteButton,
  .embed-inline-panel [data-copy-target="staticEmbedCode"],
  .embed-inline-panel [data-copy-target="bookingEmbedCode"],
  .embed-inline-panel [data-copy-target="leadEmbedCode"],
  .embed-inline-panel #testEmbedButton {
    grid-column: auto;
    justify-self: stretch;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 25px;
  }

  .calendar-editor {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 12px;
    overflow-x: visible;
  }

  .row-tools-column {
    display: none;
  }

  .day-column {
    gap: 16px;
  }

  .day-column h3 {
    font-size: 18px;
  }

  .editor-slot {
    min-height: 96px;
  }
}
