/* Access, inspector and settings refinements for the operator workspace. */
:where([hidden]) {
  display: none !important;
}

/* The access state is a quiet entry point, separate from the operator shell. */
.access-screen {
  display: grid;
  min-height: 100dvh;
  align-content: center;
  place-items: center;
  gap: 36px;
  padding: clamp(24px, 7vw, 72px);
  background: var(--background);
}

.access-screen .access-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: min(100%, 420px);
  margin: 0;
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.035em;
}

.access-screen .access-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.access-screen .access {
  width: min(100%, 420px);
  margin: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
}

.access-screen .access h1,
.access-screen .access strong {
  display: block;
  margin: 0;
  color: var(--foreground);
  font-size: clamp(25px, 4vw, 32px);
  font-weight: 650;
  letter-spacing: -.04em;
  line-height: 1.1;
}

.access-screen .access p {
  max-width: 38ch;
  margin: 12px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.55;
}

.access-screen #login,
.access-screen .access-home {
  color: var(--primary);
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.access-screen .tenant-picker {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 650;
}

.access-screen .tenant-picker select,
.access-screen #access-retry {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
}

.access-screen .tenant-picker select {
  padding: 0 12px;
}

.access-screen .tenant-picker .button,
.access-screen #access-retry {
  justify-self: start;
  margin-top: 4px;
  padding-inline: 16px;
}

/* Workspace selection follows the CRM gate: just a question and direct choices. */
.access-screen[data-mode="workspace"] {
  gap: 20px;
  padding: 24px;
  text-align: center;
}

.access-screen[data-mode="workspace"] .access-brand,
.access-screen[data-mode="workspace"] .access-home {
  display: none;
}

.access-screen[data-mode="workspace"] .access {
  width: min(100%, 340px);
  border: 0;
  padding: 0;
}

.access-screen[data-mode="workspace"] .access h1,
.access-screen[data-mode="workspace"] .access strong {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.015em;
  line-height: 1.35;
}

.access-screen[data-mode="workspace"] .access p {
  max-width: 32ch;
  margin: 6px auto 0;
  font-size: 14px;
}

.access-screen[data-mode="workspace"] .tenant-picker {
  width: min(100%, 340px);
  margin: 16px auto 0;
  gap: 8px;
}

.access-screen[data-mode="workspace"] .tenant-option {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  padding: 0 16px;
  color: var(--foreground);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms var(--ease-out, ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .access-screen[data-mode="workspace"] .tenant-option:hover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--sand) 45%, transparent);
  }
}

.access-screen[data-mode="workspace"] .tenant-option:active {
  transform: scale(.98);
}

.access-screen[data-mode="workspace"] .tenant-option:disabled {
  cursor: wait;
  opacity: .55;
}

.access-screen[data-mode="workspace"] .tenant-option[data-module-enabled="false"] {
  border-style: dashed;
  color: var(--muted-foreground);
}

.access-screen #access-retry:not([hidden]) {
  margin-top: 16px;
}

.access-screen .access-home {
  display: inline-block;
  margin-top: 24px;
  font-size: 13px;
}

.app[data-access-state="blocked"] {
  display: none !important;
}

/* Until the session check decides, the shell stays invisible: no flash of the
   calendar before the sign-in redirect or the workspace picker. */
.app[data-access-state="pending"] {
  visibility: hidden;
}

/* The inspector is present only while a booking is selected. */
.inspector[hidden],
.inspector:not(:has(#detail:not([hidden]))) {
  display: none;
}

.inspector {
  flex: 0 0 min(360px, 32vw);
  width: min(360px, 32vw);
  min-width: 0;
}

#inspector-close {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding-inline: 10px;
  font-size: 13px;
  line-height: 1;
}

/* Settings occupy the primary navigation slot, keeping one hierarchy per view. */
#settings-panel {
  max-width: none;
  min-width: 0;
}















#settings-panel .settings-content {
  width: 100%;
  max-width: 1240px;
  min-width: 0;
  container-type: inline-size;
  container-name: settings-content;
}

#settings-panel .settings-content > [data-settings-page] {
  min-width: 0;
}

#settings-panel [data-settings-page] > h2.settings-group,
#settings-panel [data-settings-page="crm"] .settings-group {
  display: none;
}

#settings-panel .settings-section {
  grid-template-columns: minmax(0, 280px) minmax(0, 560px);
  gap: clamp(24px, 4vw, 40px);
}

#settings-panel .settings-section-copy,
#settings-panel .settings-section-body {
  min-width: 0;
}

#settings-panel .settings-section-copy p,
#settings-panel .form-status,
#settings-panel .mail-log-empty {
  color: var(--muted-foreground);
}

.empty-calendar {
  color: var(--muted-foreground);
}

@container settings-content (max-width: 700px) {
  #settings-panel .settings-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-block: 22px;
  }

  #settings-panel .settings-section-copy p {
    max-width: 60ch;
  }

}

@container settings-content (max-width: 520px) {
  #settings-panel .price-editor,
  #settings-panel .price-settings-body,
  #settings-panel .tpl-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  #settings-panel .mail-field,
  #settings-panel .mail-field-wide,
  #settings-panel .mail-field-wide + .mail-field,
  #settings-panel .tpl-meta .mail-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .access-screen {
    place-items: start center;
    padding-top: max(48px, 14dvh);
  }

  .inspector {
    width: 100%;
    min-height: auto;
  }

}


@media (prefers-reduced-motion: reduce) {
  .access-screen[data-mode="workspace"] .tenant-option {
    transition: none;
  }
}

/* Programmatic heading focus announces the gate without a control-shaped ring. */
#access-title:focus { outline: none; }
.access-brand { text-decoration: none; }

/* Fokusring nur für Tastatur; aus dem früheren Inline-Style der Schale. */
:focus:not(:focus-visible){outline:0}
:focus-visible{outline-offset:-3px!important}
