@font-face {
  font-family: "Roboto";
  src: url("/assets/fonts/Roboto-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("/assets/fonts/Roboto-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("/assets/fonts/Roboto-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --app-viewport-height: 100vh;
  --app-viewport-top: 0px;
  color-scheme: light;
  --background: #fcf8f4;
  --foreground: #2b252d;
  --card: #fffdfb;
  --card-foreground: #2b252d;
  --popover: #fffdfb;
  --popover-foreground: #2b252d;
  --primary: #624667;
  --primary-foreground: #ffffff;
  --secondary: #f2e9e3;
  --secondary-foreground: #2b252d;
  --muted: #f2e9e3;
  --muted-foreground: #6e646d;
  --accent: #f1e9f0;
  --accent-foreground: #4a3350;
  --destructive: #a6403b;
  --destructive-foreground: #ffffff;
  --warning: #895b18;
  --warning-foreground: #2b252d;
  --border: #d9ccd5;
  --input: #a995a2;
  --ring: #8d4bcb;
  --radius: 0.5rem;
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-warning: var(--warning);
  --color-warning-foreground: var(--warning-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --lg-deep: #4a3350;
  --lg-primary: #624667;
  --lg-primary-hover: #513957;
  --lg-copper: #c9784f;
  --lg-copper-aa: #a6502e;
  --lg-paper: #f8f0e9;
  --lg-paper-soft: #fcf8f4;
  --lg-surface-muted: #f2e9e3;
  --lg-surface-plum: #f1e9f0;
  --lg-ink: #2b252d;
  --lg-muted: #746b72;
  --lg-border: #dfd3da;
  --lg-border-strong: #bcaab5;
  --lg-surface: #ffffff;
  --lg-success: #2f7252;
  --lg-success-soft: #e9f4ee;
  --lg-warning: #9a641c;
  --lg-warning-soft: #fff4de;
  --lg-danger: #b73535;
  --lg-danger-soft: #faeaea;
  --lg-disabled-bg: #eee8e5;
  --lg-disabled-text: #80777e;
  --lg-focus: #8d4bcb;
  --lg-radius-sm: 6px;
  --lg-radius-md: 8px;
  --lg-radius-lg: 14px;
  --lg-shadow-sm: 0 1px 2px rgb(43 37 45 / 8%);
  --lg-shadow-md: 0 8px 28px rgb(43 37 45 / 12%);
  font-family: "Roboto", ui-sans-serif, system-ui, sans-serif;
  background: var(--lg-paper-soft);
  color: var(--lg-ink);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--lg-paper-soft);
  color: var(--lg-ink);
  font-size: 16px;
  line-height: 1.5;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--lg-primary);
  text-underline-offset: 3px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-block-start: 0;
}

h1 {
  margin-block-end: 8px;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.15;
}

h2 {
  margin-block-end: 8px;
  font-size: 1.375rem;
  line-height: 1.25;
}

h3 {
  margin-block-end: 4px;
  font-size: 1.125rem;
  line-height: 1.35;
}

:focus-visible {
  outline: 3px solid var(--lg-focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  inset: 12px auto auto 12px;
  padding: 10px 14px;
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  box-shadow: var(--lg-shadow-md);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.muted,
.field-help,
.page-description,
.unit-meta,
.room-meta {
  color: var(--lg-muted);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--lg-copper-aa);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--lg-radius-md);
  background: var(--lg-primary);
  color: #fff;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover {
  background: var(--lg-primary-hover);
  color: #fff;
}

.button:active {
  transform: translateY(1px);
}

.button-secondary {
  border-color: var(--lg-border-strong);
  background: var(--lg-surface);
  color: var(--lg-ink);
}

.button-secondary:hover,
.button-ghost:hover {
  border-color: var(--lg-primary);
  background: var(--lg-surface-plum);
  color: var(--lg-deep);
}

.button-ghost {
  background: transparent;
  color: var(--lg-primary);
}

.button-danger {
  background: var(--lg-danger);
}

.button-danger:hover {
  background: #7e2e2a;
  color: #fff;
}

.button-danger-outline {
  border-color: var(--lg-danger);
  background: transparent;
  color: var(--lg-danger);
}

.button-danger-outline:hover {
  border-color: #7e2e2a;
  background: var(--lg-danger-soft);
  color: #7e2e2a;
}

.button-small {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 0.875rem;
}

.button-block {
  width: 100%;
}

.icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  color: var(--lg-primary);
  text-decoration: none;
}

.icon-button:hover {
  border-color: var(--lg-primary);
  background: var(--lg-surface-plum);
  color: var(--lg-deep);
}

.icon-button-danger {
  border-color: var(--lg-danger);
  color: var(--lg-danger);
}

.icon-button-danger:hover {
  border-color: #7e2e2a;
  background: var(--lg-danger-soft);
  color: #7e2e2a;
}

.button:disabled,
.button[aria-disabled="true"],
.icon-button:disabled,
.icon-button[aria-disabled="true"] {
  border-color: var(--lg-border);
  background: var(--lg-disabled-bg);
  color: var(--lg-disabled-text);
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.icon-button svg,
.button svg,
.nav-link svg,
.mobile-navigation svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.field {
  display: grid;
  align-content: start;
  gap: 6px;
}

.field label,
.field-label,
.choice-group legend {
  color: var(--lg-ink);
  font-size: 0.875rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  color: var(--lg-ink);
}

select:not([multiple]) {
  min-height: 44px;
  padding: 10px 42px 10px 12px;
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius-md);
  appearance: none;
  background-color: var(--lg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23624667' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--lg-ink);
  cursor: pointer;
}

select:not([multiple]):hover {
  border-color: var(--lg-primary);
}

select:not([multiple]):disabled {
  border-color: var(--lg-border);
  background-color: var(--lg-paper);
  color: var(--lg-muted);
  cursor: not-allowed;
  opacity: 1;
}

select option {
  background: var(--lg-surface);
  color: var(--lg-ink);
}

.field textarea {
  min-height: 104px;
  resize: vertical;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--lg-danger);
  box-shadow: 0 0 0 1px var(--lg-danger);
}

.field-error {
  margin: 0;
  color: var(--lg-danger);
  font-size: 0.875rem;
}

.field-help {
  margin: 0;
  font-size: 0.8125rem;
}

.choice {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.choice input {
  width: 20px;
  height: 20px;
  accent-color: var(--lg-primary);
}

.field-label-row {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-link {
  color: var(--lg-primary);
  font-size: 0.875rem;
  font-weight: 700;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 6px 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-span {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
}

.form-alert,
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-paper-soft);
}

.form-alert {
  border-color: #e2a6a6;
  background: var(--lg-danger-soft);
  color: #842929;
}

.notice-warning {
  border-color: #e3c38c;
  background: var(--lg-warning-soft);
  color: #704813;
}

.notice svg,
.form-alert svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--lg-paper);
  color: var(--lg-muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.badge-active {
  background: var(--lg-success-soft);
  color: var(--lg-success);
}

.badge-inactive {
  background: #eee9ed;
  color: #675c64;
}

.account-topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--lg-border);
  background: var(--lg-surface);
}

.account-topbar .brand-link,
.account-topbar .button-small {
  min-height: 44px;
}

.account-topbar .brand-link {
  display: inline-flex;
  align-items: center;
}

.brand-link img {
  width: 138px;
}

.account-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-user-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--lg-radius-md);
  color: var(--lg-primary);
  font-weight: 700;
  text-decoration: none;
}

.account-user-link:hover {
  background: var(--lg-paper);
}

.account-user-link svg {
  width: 18px;
}

.account-user-avatar {
  width: 32px;
  height: 32px;
}

.account-page {
  min-height: calc(100vh - 72px);
}

.manage-shell {
  color: var(--foreground);
  background: var(--background);
}

.manage-topbar .brand-link,
.manage-topbar .button-small,
.manage-shell .btn,
.manage-back-link {
  min-height: 44px;
}

.manage-topbar .brand-link,
.manage-back-link {
  display: inline-flex;
  align-items: center;
}

.manage-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 12px;
}

.manage-scope-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--lg-radius-lg);
  background: var(--card);
  box-shadow: var(--lg-shadow-sm);
}

.manage-scope-copy {
  display: grid;
  gap: 4px;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.manage-scope-copy strong {
  color: var(--foreground);
}

.manage-scope-eyebrow {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.manage-scope-form {
  display: grid;
  flex: 0 1 360px;
  gap: 6px;
  min-width: min(320px, 100%);
}

.manage-scope-form label,
.manage-scope-label {
  font-size: 0.8125rem;
  font-weight: 600;
}

.manage-scope-picker {
  position: relative;
  min-width: 0;
}

.manage-scope-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  color: var(--lg-ink);
  text-align: left;
  cursor: pointer;
}

.manage-scope-trigger:hover,
.manage-scope-trigger[aria-expanded="true"] {
  border-color: var(--lg-primary);
}

.manage-scope-trigger > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-scope-trigger svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--lg-primary);
}

.manage-scope-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  box-shadow: var(--lg-shadow-md);
}

.manage-scope-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--lg-border);
}

.manage-scope-search svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--lg-muted);
}

.manage-scope-search input {
  min-width: 0;
  min-height: 40px;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--lg-ink);
}

.manage-scope-options {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
}

.manage-scope-option {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--lg-radius-sm);
  cursor: pointer;
}

.manage-scope-option:hover,
.manage-scope-option:focus,
.manage-scope-option[data-selected] {
  outline: 0;
  background: var(--lg-surface-plum);
  color: var(--lg-deep);
}

.manage-scope-option span,
.manage-scope-option strong,
.manage-scope-option small {
  display: block;
  min-width: 0;
}

.manage-scope-option small,
.manage-scope-status {
  color: var(--lg-muted);
  font-size: 0.75rem;
}

.manage-scope-option svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  opacity: 0;
}

.manage-scope-option[data-selected] svg {
  opacity: 1;
}

.manage-scope-status {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--lg-border);
}

.manage-index-card {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--lg-radius-lg);
  background: var(--card);
  box-shadow: var(--lg-shadow-sm);
  color: var(--foreground);
  text-decoration: none;
  transition:
    border-color 120ms cubic-bezier(0.2, 0, 0, 1),
    background-color 120ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 120ms cubic-bezier(0.2, 0, 0, 1);
}

.manage-index-card:hover {
  border-color: var(--primary);
  background: #fdf8f4;
  box-shadow: var(--lg-shadow-md);
}

.manage-index-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 700;
}

.manage-index-card-title svg {
  width: 18px;
  height: 18px;
}

.manage-index-card code {
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.manage-index-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.manage-index-card-count {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  white-space: nowrap;
}

.notification-template-page {
  display: grid;
  gap: 20px;
}

.notification-template-page > .manage-back-link {
  justify-self: start;
}

.notification-template-page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.notification-template-page-heading h1 {
  margin: 4px 0 6px;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.15;
}

.notification-template-copy p {
  margin: 0;
  color: var(--lg-muted);
}

.notification-template-kicker {
  color: var(--lg-copper-aa);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notification-template-list {
  display: grid;
  gap: 16px;
}

.notification-template-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-lg);
  background: var(--lg-surface);
  box-shadow: var(--lg-shadow-sm);
}

.notification-template-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  padding: 20px;
}

.notification-template-copy {
  min-width: 0;
}

.notification-template-copy h3 {
  margin: 3px 0 5px;
  font-size: 1.125rem;
}

.notification-template-copy code {
  display: block;
  margin-top: 10px;
  color: var(--lg-primary);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.notification-template-card-heading > .notification-template-badge {
  flex-shrink: 0;
  align-self: flex-start;
}

.notification-template-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--lg-border-strong);
  border-radius: 999px;
  background: var(--lg-surface);
  color: var(--lg-primary);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.notification-template-badge-current {
  border-color: #c8dfd3;
  background: #edf7f1;
  color: var(--lg-success);
}

.notification-template-badge-muted {
  border-color: transparent;
  background: var(--lg-surface-muted);
  color: var(--lg-muted);
}

.notification-template-preview {
  border-top: 1px solid var(--lg-border);
}

.notification-template-preview > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  color: var(--lg-primary);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.notification-template-preview > summary::-webkit-details-marker {
  display: none;
}

.notification-template-preview > summary:hover {
  background: var(--lg-surface-plum);
}

.notification-template-preview > summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--lg-focus) 40%, transparent);
  outline-offset: -3px;
}

.notification-template-preview > summary svg {
  width: 18px;
  height: 18px;
}

.notification-template-preview-body {
  display: grid;
  min-width: 0;
  gap: 24px;
  padding: 0 20px 20px;
}

.notification-template-subject {
  color: var(--lg-muted);
  font-size: 0.8125rem;
  margin: 0;
  text-align: left;
}

.notification-template-subject strong {
  color: var(--lg-ink);
}

.notification-template-render {
  min-width: 0;
}

.notification-template-render h4 {
  margin: 0 0 6px;
  color: var(--lg-muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.notification-template-render iframe,
.notification-template-render pre {
  width: 100%;
  height: 590px;
  margin: 0;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: #fff;
}

.notification-template-render iframe {
  display: block;
  pointer-events: none;
}

.notification-template-render pre {
  overflow: auto;
  padding: 16px;
  color: var(--lg-ink);
  font: 0.8125rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notification-template-render.notification-template-render-message pre {
  height: auto;
  min-height: 180px;
  max-height: 590px;
}

.notification-template-context-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notification-template-count {
  color: var(--lg-muted);
  font-size: 0.75rem;
}

.notification-template-context {
  min-width: 0;
  scroll-margin-top: 24px;
}

.notification-template-context > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
  border-bottom: 1px solid var(--lg-border);
}

.notification-template-context > summary::before {
  content: "›";
  color: var(--lg-primary);
  font-size: 1.5rem;
}

.notification-template-context[open] > summary::before {
  transform: rotate(90deg);
}

.notification-template-context > summary > h2 {
  flex: 1;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.notification-template-context[open] > .notification-template-list {
  margin-top: 16px;
}

.notification-template-whatsapp {
  padding: 18px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  color: var(--lg-ink);
  font-size: 0.9375rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.notification-template-whatsapp strong { font-weight: 700; }
.notification-template-whatsapp a { color: var(--lg-primary); }
.notification-template-whatsapp pre { white-space: pre-wrap; }
.notification-template-whatsapp code { font-family: ui-monospace, monospace; }
.notification-template-whatsapp blockquote {
  border-left: 3px solid var(--lg-border-strong);
  margin: 4px 0;
  padding-left: 12px;
  color: var(--lg-muted);
}
.notification-template-whatsapp ul,
.notification-template-whatsapp ol { margin: 4px 0; padding-left: 24px; }

.notification-template-trigger {
  font-size: 0.8125rem;
  line-height: 1.5;
}

.notification-template-formats {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.notification-template-tabs.account-tabs {
  display: flex;
  overflow-x: auto;
}

.notification-template-tabs .account-tab {
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.875rem;
}

.notification-template-tabs .account-tab[aria-selected="true"] {
  border-bottom-color: var(--lg-primary);
  color: var(--lg-primary);
}

.notification-template-formats [role="tabpanel"] {
  min-width: 0;
}

.notification-template-formats [role="tabpanel"][hidden] {
  display: none;
}

.notification-template-event,
.notification-template-history > summary {
  color: var(--lg-muted);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.notification-template-history {
  border-top: 1px solid var(--lg-border);
  padding-top: 12px;
}

.notification-template-history > summary {
  cursor: pointer;
}

.notification-template-version {
  margin-top: 16px;
}

.notification-template-version > h4 {
  margin: 0 0 8px;
  font-size: 0.8125rem;
}

.notification-template-error {
  padding: 12px;
  border-radius: var(--lg-radius-md);
  background: var(--destructive);
  color: #fff;
}

@media (max-width: 860px) {
  .notification-template-page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .notification-template-render iframe,
  .notification-template-render pre {
    height: 520px;
  }
}

@media (max-width: 520px) {
  .notification-template-card-heading,
  .notification-template-preview > summary,
  .notification-template-preview-body {
    padding-right: 14px;
    padding-left: 14px;
  }

  .notification-template-render iframe,
  .notification-template-render pre {
    height: 460px;
  }
}

.manage-scope-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -12px 0 16px;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.manage-scope-notice svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.account-content {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(32px, 7vw, 72px) 0;
}

.tenant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px;
  margin-top: 24px;
}

.tenant-card {
  position: relative;
  min-height: 164px;
  display: grid;
  align-content: space-between;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-lg);
  background: var(--lg-surface);
  box-shadow: var(--lg-shadow-sm);
  color: var(--lg-ink);
  text-decoration: none;
  overflow: hidden;
}

.tenant-card > :not(.tenant-card-brand) {
  position: relative;
  z-index: 2;
}

.tenant-card-brand {
  position: absolute;
  z-index: 1;
  top: -50px;
  right: -44px;
  width: 176px;
  height: 176px;
  display: grid;
  place-items: center;
  padding: 50px 40px 28px 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--lg-primary) 9%, var(--lg-surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lg-primary) 7%, transparent);
  pointer-events: none;
}

.tenant-card-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0.52;
  filter: saturate(0.82);
}

.tenant-card-has-logo > div:first-of-type {
  padding-right: 112px;
}

.tenant-card:hover {
  border-color: var(--lg-primary);
  box-shadow: var(--lg-shadow-md);
}

.tenant-card-arrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--lg-primary);
  font-weight: 700;
}

.organization-page {
  width: min(1120px, calc(100% - 32px));
}

.organization-page .tenant-card h2 {
  margin: 10px 0 4px;
}

.organization-page .tenant-card p,
.organization-invitations h2,
.organization-invitations p {
  margin-bottom: 0;
}

.tenant-card-unavailable {
  background: var(--lg-paper-soft);
  box-shadow: none;
}

.tenant-card-unavailable:hover {
  border-color: var(--lg-border);
  box-shadow: none;
}

.tenant-card-arrow-muted {
  color: var(--lg-muted);
  font-weight: 500;
}

.organization-empty-state {
  grid-column: 1 / -1;
}

.organization-empty-state form {
  margin-top: 12px;
}

.organization-invitations {
  display: grid;
  gap: 20px;
  margin-top: 24px;
  padding: 24px;
}

.organization-invitations ul {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 0;
  list-style: none;
}

.organization-invitations li {
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--lg-border);
}

.organization-invitations li span:nth-child(2) {
  display: grid;
}

.organization-invitations li small {
  color: var(--lg-muted);
}

.organization-invitation-icon {
  color: var(--lg-primary);
}

.organization-invitation-icon svg {
  width: 20px;
}

.organization-create-dialog {
  width: min(600px, 100%);
}

.organization-dialog-body {
  display: grid;
  gap: 18px;
  overflow-y: auto;
  padding: 20px;
}

.onboarding-start {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  padding: 20px;
}

.onboarding-start .state-icon,
.onboarding-start h2,
.onboarding-start p {
  margin: 0;
}

.onboarding-section {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.onboarding-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.onboarding-title h1,
.onboarding-title p {
  margin: 0;
}

.onboarding-title > div > p:last-child {
  margin-top: 5px;
  color: var(--lg-muted);
}

.onboarding-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.38fr);
  align-items: start;
  gap: 16px;
}

.onboarding-checklist,
.onboarding-summary {
  padding: 16px;
}

.onboarding-checklist > h3,
.onboarding-checklist > p,
.onboarding-summary > h3,
.onboarding-summary > p {
  margin: 0;
}

.onboarding-checklist > p {
  margin-top: 4px;
  color: var(--lg-muted);
}

.onboarding-checklist-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.onboarding-checklist-item {
  min-height: 60px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  color: var(--lg-ink);
  text-decoration: none;
}

.onboarding-checklist-item:hover {
  border-color: var(--lg-primary);
  background: var(--lg-surface-plum);
}

.onboarding-checklist-item-done {
  border-color: #b9d9ca;
  background: var(--lg-success-soft);
}

.onboarding-checklist-item-optional {
  border-style: dashed;
}

.onboarding-check-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--lg-surface-plum);
  color: var(--lg-primary);
}

.onboarding-checklist-item-done .onboarding-check-icon {
  background: #d8ede3;
  color: var(--lg-success);
}

.onboarding-checklist-item strong,
.onboarding-checklist-item small {
  display: block;
}

.onboarding-checklist-item small {
  margin-top: 3px;
  color: var(--lg-muted);
}

.onboarding-check-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lg-primary);
  font-size: 0.8125rem;
  font-weight: 700;
}

.onboarding-checklist-item-done .onboarding-check-status {
  color: var(--lg-success);
}

.onboarding-check-status svg,
.onboarding-context svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.onboarding-summary {
  display: grid;
  gap: 10px;
}

.onboarding-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--lg-paper);
}

.onboarding-progress span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--lg-primary);
}

.onboarding-context {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--lg-border);
}

.onboarding-context > * {
  min-height: 56px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  color: var(--lg-ink);
  text-decoration: none;
}

.onboarding-context > * + * {
  border-top: 1px solid var(--lg-border);
}

.onboarding-context strong,
.onboarding-context small {
  display: block;
}

.onboarding-context small {
  margin-top: 3px;
  color: var(--lg-muted);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.72fr);
  background:
    radial-gradient(circle at 12% 18%, rgb(201 120 79 / 24%), transparent 30%),
    var(--lg-deep);
}

.node-access-menu {
  position: relative;
  flex-shrink: 0;
  color: var(--lg-primary);
}

.node-access-menu > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: var(--lg-radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.node-access-menu > summary::-webkit-details-marker { display: none; }
.node-access-menu > summary:hover,
.node-access-menu[open] > summary { background: var(--lg-paper); }
.node-access-menu > summary:focus-visible { outline: 2px solid var(--lg-focus); }
.node-access-menu > summary svg { width: 18px; height: 18px; }
.node-access-menu.is-impersonating > summary { color: var(--lg-ink); background: #f5e8d8; }

.node-access-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  width: 248px;
  max-width: calc(100vw - 32px);
  max-height: 75vh;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  box-shadow: var(--lg-shadow-md);
  color: var(--lg-ink);
}

.node-access-menu-panel a,
.node-access-menu-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
}

.node-access-menu-panel a:hover,
.node-access-menu-panel button:hover { background: var(--lg-paper); }
.node-access-menu-panel svg { width: 16px; height: 16px; }
.node-access-menu-context { padding: 8px 10px; font-size: 0.8rem; overflow-wrap: anywhere; color: var(--lg-muted); }
.node-access-menu-divider { margin: 5px 0; border-top: 1px solid var(--lg-border); }
.node-access-menu-panel form {
  margin: 0;
}

.sidebar-brand-row { display: flex; align-items: center; justify-content: space-between; }
.sidebar-brand-row .node-access-menu { color: white; }
.sidebar-brand-row .node-access-menu > summary span { display: none; }
.sidebar-brand-row .node-access-menu > summary:hover,
.sidebar-brand-row .node-access-menu[open] > summary { color: var(--lg-primary); }
.sidebar-brand-row .node-access-menu-panel { width: 224px; }
.account-topbar + .account-page .auth-shell { min-height: calc(100dvh - 72px); }

.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(32px, 7vw, 88px);
  color: #fff;
}

.auth-brand img {
  width: 160px;
}

.auth-brand > div {
  margin-block: auto;
}

.auth-brand h1 {
  max-width: 620px;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
}

.auth-brand p {
  max-width: 540px;
  color: #eee5ed;
  font-size: 1.125rem;
}

.auth-panel {
  display: grid;
  align-content: center;
  padding: clamp(24px, 6vw, 80px);
  background: var(--lg-paper-soft);
}

.auth-card {
  width: min(100%, 440px);
  margin: 0 auto;
}

.auth-card form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.auth-card > .google-button {
  margin-top: 28px;
}

.google-button {
  gap: 10px;
}

.google-mark {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--lg-border-strong);
  border-radius: 50%;
  background: #fff;
  color: #4285f4;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
}

.auth-divider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 20px 0 0;
  color: var(--lg-muted);
  font-size: 0.8125rem;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: var(--lg-border);
  content: "";
}

.auth-card-review {
  display: grid;
  gap: 16px;
}

.auth-card-review > .state-icon {
  margin-bottom: 0;
}

.oauth-confirmation-summary {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-border);
}

.oauth-confirmation-summary > div {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  background: var(--lg-surface);
}

.oauth-confirmation-summary dt {
  color: var(--lg-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.oauth-confirmation-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.auth-action-stack {
  display: grid;
  gap: 10px;
}

.auth-help-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--lg-primary);
  font-weight: 700;
  text-align: center;
}

.auth-primary-link {
  margin-top: 28px;
}

.auth-card-reset > .auth-help-link {
  width: 100%;
  margin-top: 12px;
}

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

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 16px;
  background: var(--lg-deep);
  color: #fff;
  overflow-y: auto;
}

.sidebar-brand {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 10px;
}

.sidebar-brand img {
  width: 136px;
}

.organization-switcher {
  position: relative;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 24px 0;
  padding: 10px 12px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: var(--lg-radius-md);
  background: rgb(255 255 255 / 7%);
  color: #fff;
  text-decoration: none;
  overflow: hidden;
}

.organization-switcher.has-organization-logo {
  justify-content: flex-start;
  padding-right: 30px;
  padding-left: 60px;
}

.organization-switcher.has-organization-logo > svg {
  position: absolute;
  top: 50%;
  right: 9px;
  margin-left: 0;
  transform: translateY(-50%);
}

.organization-switcher.has-organization-logo > span {
  width: 100%;
}

.organization-switcher.has-organization-logo small {
  white-space: nowrap;
}

.organization-switcher span {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
}

.organization-switcher small,
.sidebar-user small {
  color: #d9ccd8;
  font-size: 0.75rem;
}

.organization-switcher strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-switcher svg {
  position: relative;
  z-index: 1;
  width: 18px;
  flex: 0 0 auto;
}

.organization-switcher-logo {
  position: absolute;
  z-index: 0;
  top: -30px;
  left: -28px;
  width: 96px;
  height: 96px;
  box-sizing: border-box;
  padding: 30px 11px 15px 27px;
  border-radius: 50%;
  background: rgb(255 255 255 / 14%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 6%);
  object-fit: contain;
  object-position: center;
  opacity: 0.52;
  filter: saturate(0.8) brightness(1.1);
  pointer-events: none;
}

.mobile-organization-switch {
  position: relative;
  overflow: hidden;
}

.mobile-organization-switch > svg,
.mobile-organization-switch > span {
  position: relative;
  z-index: 1;
}

.mobile-organization-logo {
  position: absolute;
  z-index: 0;
  inset: 4px 6px 4px auto;
  width: 42px;
  height: calc(100% - 8px);
  object-fit: contain;
  opacity: 0.12;
  pointer-events: none;
}

.sidebar-navigation {
  display: grid;
  gap: 5px;
}

.nav-section-label {
  padding: 10px 12px 5px;
  color: #cbbbc9;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--lg-radius-md);
  color: #f4edf3;
  text-decoration: none;
}

.nav-link:hover,
.nav-link-current {
  background: rgb(255 255 255 / 13%);
  color: #fff;
}

.nav-link-current {
  box-shadow: inset 3px 0 0 var(--lg-copper);
}

.sidebar-footer {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding-top: 20px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  padding: 12px;
  border-block: 1px solid rgb(255 255 255 / 15%);
  color: #fff;
  text-decoration: none;
}

.sidebar-user:hover,
.sidebar-user-current {
  background: rgb(255 255 255 / 10%);
}

.sidebar-user > span:last-child {
  min-width: 0;
  display: grid;
}

.sidebar-user strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lg-copper);
  color: var(--lg-deep);
  font-weight: 700;
}

.mobile-topbar,
.mobile-navigation {
  display: none;
}

.mobile-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-organization-switch {
  min-height: 44px;
  padding: 8px 10px;
  font-size: 0.8125rem;
}

.mobile-navigation-track {
  min-width: 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.mobile-navigation-track::-webkit-scrollbar {
  display: none;
}

.mobile-navigation-track > .mobile-nav-separator {
  flex: 0 0 1px;
  align-self: stretch;
  width: 1px;
  margin: 12px 6px;
  background: var(--lg-border-strong);
}

.mobile-navigation .mobile-navigation-track > a.nav-link:is(:hover, :focus-visible, :active) {
  background: #f6eff7;
  color: var(--lg-primary);
}

.mobile-navigation-track > a,
.mobile-navigation-track > span:not(.mobile-nav-separator) {
  flex: 1 0 auto;
  min-width: 88px;
  min-height: 64px;
  padding: 8px 12px;
  white-space: nowrap;
  scroll-snap-align: start;
  border-radius: 10px;
}

.mobile-navigation.has-overflow .mobile-navigation-track {
  margin-inline: 16px;
}

.mobile-nav-arrow {
  position: absolute;
  top: 6px;
  width: 24px;
  height: 64px;
  padding: 0;
  border: 0;
  background: var(--lg-surface);
  color: var(--lg-primary);
  display: grid;
  place-items: center;
  touch-action: manipulation;
}

.mobile-nav-arrow[hidden] {
  display: none;
}

.mobile-nav-arrow svg {
  width: 16px;
  height: 16px;
}

.mobile-nav-arrow:disabled {
  opacity: 0.3;
}

.mobile-nav-previous { left: 0; }
.mobile-nav-next { right: 0; }

.app-main {
  min-width: 0;
}

.page-content {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.surface {
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-lg);
  background: var(--lg-surface);
  box-shadow: var(--lg-shadow-sm);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}

.tenant-home-page {
  container-type: inline-size;
}

.overview-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.overview-summary-item {
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--lg-ink);
  text-decoration: none;
}

.overview-summary-item + .overview-summary-item {
  border-left: 1px solid var(--lg-border);
}

a.overview-summary-item:hover {
  background: var(--lg-surface-plum);
}

.overview-summary-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--lg-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.overview-summary-label svg {
  width: 18px;
  height: 18px;
  color: var(--lg-primary);
}

.overview-summary-item > strong {
  overflow-wrap: anywhere;
  font-size: 1.125rem;
  line-height: 1.25;
  text-align: right;
}

.overview-note {
  margin-top: 20px;
}

.metric-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  color: inherit;
  text-decoration: none;
}

.metric-card strong {
  font-size: 2rem;
  line-height: 1;
}

.metric-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-card-title svg {
  width: 24px;
  color: var(--lg-primary);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.filter-bar .field {
  position: relative;
}

.filter-bar .field > svg {
  position: absolute;
  z-index: 1;
  left: 12px;
  bottom: 13px;
  width: 18px;
  color: var(--lg-muted);
  pointer-events: none;
}

.filter-bar .search-input {
  padding-left: 40px;
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.unit-list {
  display: grid;
  gap: 14px;
}

.unit-card {
  overflow: clip;
}

.unit-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
}

.unit-summary-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.unit-summary-main,
.room-name,
.schedule-template-card > div,
.tenant-card > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.unit-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.unit-title-row h2 {
  margin: 0;
}

.unit-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  font-size: 0.875rem;
}

.unit-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.unit-meta svg {
  width: 16px;
  height: 16px;
}

.unit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.room-list {
  display: grid;
  border-top: 1px solid var(--lg-border);
  background: var(--lg-paper-soft);
}

.room-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 20px 12px 28px;
  border-bottom: 1px solid var(--lg-border);
}

.room-row:last-child {
  border-bottom: 0;
}

.room-name {
  min-width: 0;
}

.room-name strong {
  display: block;
}

.room-meta {
  margin: 2px 0 0;
  font-size: 0.8125rem;
}

.room-empty {
  margin: 0;
  padding: 16px 20px 18px 28px;
  color: var(--lg-muted);
  font-size: 0.875rem;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 20px;
}

.editor-layout-single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 920px;
}

.editor-card {
  padding: clamp(20px, 4vw, 32px);
}

.editor-card form {
  display: grid;
  gap: 22px;
}

.editor-aside {
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 20px;
}

.unit-map-section {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-paper-soft);
}

.unit-rules-section {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-paper-soft);
}

.unit-rules-section h2,
.unit-rules-section p {
  margin: 0;
}

.unit-rules-section h2 {
  font-size: 1rem;
}

.unit-rules-section p {
  margin-top: 3px;
  color: var(--lg-muted);
  font-size: 0.875rem;
}

.unit-map-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.unit-map-section h2,
.unit-map-section p {
  margin: 0;
}

.unit-map-section h2 {
  font-size: 1rem;
}

.unit-map-section header p {
  margin-top: 3px;
  color: var(--lg-muted);
  font-size: 0.875rem;
}

.unit-map-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.unit-map {
  width: 100%;
  height: 300px;
  overflow: hidden;
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius-md);
  background: #e9e4e9;
  z-index: 0;
}

.unit-map:focus-visible {
  outline: 3px solid var(--lg-focus);
  outline-offset: 3px;
}

.unit-map .leaflet-control-zoom a {
  width: 44px;
  height: 44px;
  line-height: 44px;
}

.unit-map-coordinates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 520px;
  margin-top: 8px;
}

.unit-map-advanced {
  border-top: 1px solid var(--lg-border);
  color: var(--lg-muted);
}

.unit-map-advanced summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--lg-primary);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.unit-map-advanced .field > span {
  font-size: 0.75rem;
}

.type-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.type-option {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  color: var(--lg-ink);
  text-decoration: none;
}

.type-option-current {
  border-color: var(--lg-primary);
  box-shadow: 0 0 0 1px var(--lg-primary);
  background: #f7f1f8;
}

.type-option small {
  color: var(--lg-muted);
}

.page-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 36px 20px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-lg);
  background: var(--lg-surface);
  text-align: center;
}

.page-state p {
  max-width: 520px;
  color: var(--lg-muted);
}

.state-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 50%;
  background: #f2eaf4;
  color: var(--lg-primary);
}

.state-icon svg {
  width: 24px;
  height: 24px;
}

.page-state-error .state-icon {
  background: var(--lg-danger-soft);
  color: var(--lg-danger);
}

.toast-region {
  position: fixed;
  z-index: 140;
  inset: calc(var(--app-viewport-top, 0px) + max(16px, env(safe-area-inset-top))) max(16px, env(safe-area-inset-right)) auto auto;
  width: min(380px, calc(100% - 32px));
  display: grid;
  gap: 10px;
}

.toaster {
  z-index: 140;
  inset: 20px 20px auto auto;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #a9cfb9;
  border-radius: var(--lg-radius-md);
  background: var(--lg-success-soft);
  box-shadow: var(--lg-shadow-md);
  color: #245a40;
  touch-action: manipulation;
}

.toast-region > .toast,
.toast-region > .notice {
  cursor: pointer;
}

.toast svg {
  width: 20px;
  flex: 0 0 auto;
}

.hx-indicator {
  display: none;
}

.page-loading {
  position: fixed;
  z-index: 200;
  inset: 0 0 auto;
  height: 3px;
  overflow: hidden;
  background: rgb(98 70 103 / 14%);
  pointer-events: none;
}

.page-loading[hidden] {
  display: none;
}

.page-loading > span {
  display: block;
  width: 36%;
  height: 100%;
  background: var(--lg-primary);
  animation: page-loading-slide 1s ease-in-out infinite;
}

@keyframes page-loading-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(280%); }
}

@media (prefers-reduced-motion: reduce) {
  .page-loading > span {
    width: 100%;
    animation: none;
  }
}

.htmx-request .hx-indicator,
.htmx-request.hx-indicator {
  display: inline-flex;
}

.htmx-request .button-label {
  opacity: 0;
}

.button-loading {
  display: inline-grid;
}

.button-loading > .button-label,
.button-loading > .hx-indicator {
  grid-area: 1 / 1;
  justify-self: center;
}

.button-loading > .hx-indicator {
  display: inline-flex;
  visibility: hidden;
}

.htmx-request .button-loading > .hx-indicator,
.button-loading.htmx-request > .hx-indicator {
  visibility: visible;
}

.htmx-request .button-loading > .button-label,
.button-loading.htmx-request > .button-label {
  visibility: hidden;
}

@media (max-width: 64rem) {
  .app-shell {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .editor-layout,
  .onboarding-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 48rem) {
  .manage-topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .manage-topbar .account-user {
    width: 100%;
    justify-content: flex-end;
  }

  .manage-shell {
    padding-inline: 16px;
  }

  .manage-scope-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .manage-scope-form {
    flex-basis: auto;
    min-width: 0;
  }

  .app-shell {
    display: block;
    padding: 64px 0 calc(var(--mobile-navigation-height, 80px) + 16px);
  }

  .app-sidebar {
    display: none;
  }

  .mobile-topbar {
    position: fixed;
    z-index: 50;
    inset: 0 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--lg-border);
    background: rgb(255 255 255 / 96%);
    backdrop-filter: blur(12px);
  }

  .mobile-topbar img {
    width: 126px;
  }

  .mobile-topbar > a:first-child {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .mobile-navigation {
    position: fixed;
    z-index: 50;
    inset: auto 0 0;
    min-height: 68px;
    display: block;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--lg-border);
    background: rgb(255 255 255 / 97%);
    backdrop-filter: blur(12px);
  }

  .mobile-navigation-track > a,
  .mobile-navigation-track > span:not(.mobile-nav-separator) {
    min-height: 68px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    color: var(--lg-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
  }

  .mobile-navigation .nav-link-current {
    background: #f6eff7;
    box-shadow: inset 0 3px 0 var(--lg-primary);
    color: var(--lg-primary);
  }

  .page-content {
    width: min(100% - 32px, 1180px);
    padding: 24px 0 40px;
  }

  .page-header {
    display: grid;
    gap: 16px;
  }

  .page-header-actions {
    justify-content: flex-start;
  }

  .account-profile-page {
    width: min(100% - 32px, 980px);
  }

  .account-profile-header {
    align-items: flex-start;
  }

  .account-panel {
    padding: 20px 16px;
  }

  .account-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-email-field {
    grid-column: auto;
  }

  .account-setting-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-setting-row form,
  .account-setting-row .button {
    width: 100%;
  }

  .form-grid,
  .filter-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-actions .button {
    flex: 1;
  }

  .unit-summary {
    display: grid;
  }

  .unit-actions {
    justify-content: flex-start;
  }

  .room-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-left: 20px;
  }

  .room-row .badge {
    grid-column: 1;
  }

  .auth-shell {
    display: block;
    background: var(--lg-paper-soft);
  }

  .auth-brand {
    min-height: 250px;
    padding: 28px 24px 42px;
    background:
      radial-gradient(circle at 10% 20%, rgb(201 120 79 / 28%), transparent 38%),
      var(--lg-deep);
  }

  .auth-brand h1 {
    margin-bottom: 8px;
    font-size: clamp(2.25rem, 12vw, 4rem);
  }

  .auth-panel {
    padding: 32px 24px 48px;
  }

  .account-user > span {
    display: none;
  }

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

  .onboarding-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .onboarding-checklist-item {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .onboarding-check-status {
    grid-column: 2;
    justify-self: start;
  }

  .overview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-summary-item:nth-child(3) {
    grid-column: 1 / -1;
    border-top: 1px solid var(--lg-border);
    border-left: 0;
  }
}

@media (max-width: 30rem) {
  .type-selector {
    grid-template-columns: minmax(0, 1fr);
  }

  .button {
    width: 100%;
  }

  .unit-actions .button,
  .room-row .button {
    width: auto;
  }

  .account-topbar {
    padding-inline: 16px;
  }

  .organization-invitations li {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .organization-invitations li .badge {
    grid-column: 2;
    justify-self: start;
  }

  .onboarding-start {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .onboarding-start .button {
    grid-column: 1 / -1;
  }
}

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

.agenda-page {
  width: min(100% - 32px, 1440px);
}

.agenda-filters,
.agenda-room-filters,
.agenda-template-toolbar,
.agenda-template-actions,
.agenda-row-actions,
.agenda-selection-actions,
.agenda-month-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.agenda-filters {
  padding: 16px;
  margin-bottom: 16px;
  justify-content: space-between;
}

.agenda-filter-field {
  display: grid;
  gap: 4px;
  color: var(--lg-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.agenda-filter-field select {
  min-height: 44px;
}

.agenda-filter-chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  color: var(--lg-ink);
  font-weight: 500;
}

button.agenda-filter-chip {
  cursor: pointer;
}

.agenda-filter-chip-active {
  border-color: var(--lg-primary);
  background: #f3edf4;
  color: var(--lg-primary);
}

.agenda-filter-chip svg {
  width: 18px;
  height: 18px;
}

.agenda-room-picker {
  position: relative;
}

.agenda-room-picker > summary {
  min-width: 220px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  color: var(--lg-ink);
  cursor: pointer;
  list-style: none;
}

.agenda-room-picker > summary::-webkit-details-marker {
  display: none;
}

.agenda-room-picker > summary strong {
  margin-left: auto;
  color: var(--lg-primary);
  font-size: 0.8125rem;
}

.agenda-room-picker > summary svg {
  width: 18px;
  height: 18px;
}

.agenda-room-picker[open] > summary svg:last-child {
  transform: rotate(180deg);
}

.agenda-room-picker-panel {
  width: min(360px, calc(100vw - 40px));
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-lg);
  background: var(--lg-surface);
  box-shadow: var(--lg-shadow-md);
}

.agenda-room-picker-actions {
  display: flex;
  justify-content: flex-end;
}

.agenda-room-picker-actions .button {
  min-height: 44px;
}

.agenda-room-options {
  max-height: min(360px, 50vh);
  display: grid;
  gap: 4px;
  overflow-y: auto;
}

.agenda-room-option {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--lg-radius-md);
  background: transparent;
  color: var(--lg-ink);
  text-align: left;
  cursor: pointer;
}

.agenda-room-option > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--lg-border-strong);
  border-radius: 6px;
}

.agenda-room-option > span svg {
  width: 16px;
  height: 16px;
}

.agenda-room-option-active {
  border-color: #c9a9ce;
  background: #f4edf5;
  color: var(--lg-primary);
  font-weight: 700;
}

.agenda-room-option-active > span {
  border-color: var(--lg-primary);
  background: var(--lg-primary);
  color: #fff;
}

.agenda-room-filter-empty {
  margin: 0;
  color: var(--lg-muted);
  font-size: 0.875rem;
}

.agenda-calendar-shell {
  position: relative;
  overflow-x: auto;
  padding: 0;
}

.agenda-calendar-header {
  min-width: 760px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--lg-border);
}

.agenda-calendar-header h2,
.agenda-calendar-header p {
  margin: 0;
}

.agenda-calendar-header p {
  color: var(--lg-muted);
  font-size: 0.875rem;
}

.agenda-week-header,
.agenda-month-grid {
  min-width: 760px;
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
}

.agenda-week-header {
  background: var(--lg-paper);
  border-bottom: 1px solid var(--lg-border);
}

.agenda-week-header span {
  padding: 10px 12px;
  color: var(--lg-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.agenda-day {
  min-height: 112px;
  position: relative;
  border-right: 1px solid var(--lg-border);
  border-bottom: 1px solid var(--lg-border);
  background: var(--lg-surface);
}

.agenda-day:not(.agenda-day-outside)::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 4px;
  background: var(--lg-border-strong);
  pointer-events: none;
}

.agenda-day.agenda-day-status-available::before {
  background: var(--lg-success);
}

.agenda-day.agenda-day-status-occupied::before {
  background: var(--lg-copper);
}

.agenda-day:nth-child(7n) {
  border-right: 0;
}

.agenda-day-outside {
  padding: 12px;
  background: #f7f2ef;
  color: #9a9097;
}

.agenda-day-past {
  background: #f7f4f2;
  color: #81777e;
}

.agenda-day-past .agenda-day-counts,
.agenda-day-past .agenda-day-edit {
  opacity: 0.58;
}

.agenda-day-past.agenda-day-selected {
  background: #eee5ef;
  color: var(--lg-ink);
}

.agenda-day-selected {
  background: #f4edf5;
  box-shadow: inset 0 0 0 2px var(--lg-primary);
}

.agenda-day-select,
.agenda-day-select button {
  width: 100%;
  min-height: 112px;
}

.agenda-day-select button {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 12px 48px 12px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.agenda-day-number {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.agenda-selected-mark {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lg-primary);
  color: #fff;
  font-size: 0.75rem;
}

.agenda-day-counts {
  display: grid;
  gap: 2px;
  color: var(--lg-muted);
  font-size: 0.75rem;
}

.agenda-day-free {
  color: var(--lg-success);
  font-weight: 700;
}

.agenda-day-maintenance {
  color: var(--lg-copper-aa);
}

.agenda-day-edit {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
}

.agenda-day-edit button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--lg-radius-md);
  background: transparent;
  color: var(--lg-primary);
  cursor: pointer;
}

.agenda-day-edit button:hover {
  background: #eee4ef;
}

.agenda-day-edit svg {
  width: 24px;
  height: 24px;
}

.agenda-selection-bar {
  min-width: 760px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--lg-border-strong);
  background: rgb(255 253 251 / 96%);
  box-shadow: 0 -8px 24px rgb(43 37 45 / 10%);
  backdrop-filter: blur(12px);
}

.agenda-selection-bar > div:first-child {
  display: grid;
}

.agenda-selection-bar span {
  color: var(--lg-muted);
  font-size: 0.875rem;
}

@supports (height: 100dvh) {
  :root { --app-viewport-height: 100dvh; }
}

.dialog-backdrop {
  position: fixed;
  inset: var(--app-viewport-top, 0px) 0 auto;
  height: var(--app-viewport-height, 100dvh);
  --dialog-gap: 24px;
  --dialog-max-height: calc(var(--app-viewport-height, 100dvh) - max(var(--dialog-gap), env(safe-area-inset-top)) - max(var(--dialog-gap), env(safe-area-inset-bottom)));
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: max(var(--dialog-gap), env(safe-area-inset-top)) max(var(--dialog-gap), env(safe-area-inset-right)) max(var(--dialog-gap), env(safe-area-inset-bottom)) max(var(--dialog-gap), env(safe-area-inset-left));
  background: rgb(43 37 45 / 58%);
  overscroll-behavior: contain;
}

html.has-open-dialog {
  overflow: hidden;
  overscroll-behavior: none;
}

.dialog-backdrop[aria-hidden="true"] {
  pointer-events: none;
}

.dialog-backdrop-action {
  z-index: 1010;
}

.agenda-dialog {
  width: min(1180px, 100%);
  max-height: var(--dialog-max-height, calc(100dvh - 48px));
  overflow: hidden;
  box-shadow: var(--lg-shadow-md);
}

.agenda-dialog form {
  max-height: var(--dialog-max-height, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
}

.dialog-backdrop .agenda-dialog > form {
  max-height: calc(var(--dialog-max-height, 100dvh) - 2px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-backdrop .agenda-dialog > form:has(> :is(.agenda-dialog-body, .account-dialog-body, .professional-dialog-body, .organization-dialog-body, .agenda-save-template-body)) {
  overflow: hidden;
}

.agenda-dialog-header,
.agenda-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--lg-surface);
  flex-shrink: 0;
}

.agenda-dialog-header > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.agenda-dialog-header .icon-button {
  flex-shrink: 0;
}

.agenda-dialog-body,
.account-dialog-body,
.professional-dialog-body,
.organization-dialog-body,
.agenda-save-template-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.agenda-dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--lg-border);
}

.agenda-dialog-header h2,
.agenda-dialog-header p {
  margin: 0;
}

.agenda-dialog-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  justify-content: flex-end;
  border-top: 1px solid var(--lg-border);
  box-shadow: 0 -8px 20px rgb(43 37 45 / 7%);
}

@media (max-height: 30rem) {
  .agenda-dialog-header,
  .agenda-dialog-footer {
    padding-block: 8px;
    gap: 8px;
  }

  .agenda-dialog > form > :is(.account-dialog-body, .professional-dialog-body, .organization-dialog-body, .agenda-save-template-body) {
    padding-block: 12px;
  }
}

.agenda-template-toolbar,
.agenda-row-actions,
.agenda-room-tabs,
.agenda-dialog > form > .muted,
.agenda-dialog > form > .field-error,
.agenda-dialog-body > .field-error {
  margin-inline: 20px;
}

.agenda-template-toolbar {
  align-items: end;
  padding-top: 16px;
}

.agenda-template-toolbar label {
  min-width: 220px;
  display: grid;
  flex: 1;
  gap: 4px;
  color: var(--lg-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.agenda-template-toolbar input,
.agenda-template-toolbar select {
  min-height: 44px;
}

.agenda-working-copy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 20px 0;
  color: var(--lg-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.agenda-working-copy-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.agenda-row-actions {
  padding: 12px 0;
}

.agenda-editor-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding: 0 20px 16px;
  overscroll-behavior: contain;
}

.agenda-dialog-body > .agenda-editor-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-y: auto;
}

.agenda-editor-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
}

.agenda-editor-table th,
.agenda-editor-table td {
  padding: 8px;
  border-bottom: 1px solid var(--lg-border);
  text-align: left;
  vertical-align: middle;
}

.agenda-editor-table th {
  background: var(--lg-paper);
  color: var(--lg-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.agenda-editor-table tr:last-child td {
  border-bottom: 0;
}

.agenda-editor-table input:not([type="checkbox"]),
.agenda-editor-table select {
  width: 100%;
  min-width: 100px;
  min-height: 44px;
}

.agenda-editor-table input[type="checkbox"] {
  width: 22px;
  height: 22px;
}

.agenda-row-protected {
  background: #f7f2ef;
}

.agenda-row-protected td[data-label="Estado"] small {
  display: block;
  margin-top: 4px;
  color: var(--lg-muted);
}

.agenda-action-dialog {
  width: min(560px, 100%);
}

.agenda-action-dialog > form > .field,
.agenda-action-summary,
.agenda-credit-choice,
.agenda-save-template-body {
  margin-inline: 20px;
}

.agenda-save-template-body {
  display: grid;
  gap: 12px;
  padding-block: 20px;
}

.agenda-save-template-body p {
  margin: 0;
}

.agenda-action-summary {
  margin-block: 18px 6px;
  color: var(--lg-muted);
}

.agenda-action-dialog > form > .field {
  margin-top: 14px;
}

.agenda-credit-choice {
  display: grid;
  gap: 8px;
  margin-block: 20px;
  padding: 0;
  border: 0;
}

.agenda-credit-choice legend {
  margin-bottom: 8px;
  color: var(--lg-ink);
  font-weight: 700;
}

.agenda-credit-choice label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  cursor: pointer;
}

.agenda-credit-choice input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.agenda-room-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 0 6px;
}

.agenda-room-tab {
  min-height: 44px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  color: var(--lg-ink);
  cursor: pointer;
}

.agenda-room-tab span {
  color: var(--lg-muted);
  font-size: 0.75rem;
}

.agenda-room-tab-active {
  border-color: var(--lg-primary);
  background: #f3edf4;
  color: var(--lg-primary);
}

@media (max-width: 48rem) {

  .agenda-page {
    width: min(100% - 20px, 1440px);
  }

  .agenda-filters,
  .agenda-calendar-header,
  .agenda-selection-bar {
    align-items: stretch;
  }

  .agenda-filters,
  .agenda-calendar-header,
  .agenda-selection-bar,
  .agenda-dialog-footer {
    flex-direction: column;
  }

  .dialog-backdrop {
    --dialog-gap: 12px;
  }

  .agenda-dialog,
  .agenda-dialog form {
    width: 100%;
    max-height: var(--dialog-max-height, calc(100dvh - 24px));
    border-radius: var(--lg-radius-md);
  }

  .agenda-dialog-footer {
    align-items: stretch;
  }

  .agenda-dialog-header {
    align-items: flex-start;
    flex-direction: row;
  }

  .agenda-day-dialog .agenda-dialog-header,
  .agenda-day-dialog .agenda-dialog-footer {
    padding: 12px;
  }

  .agenda-day-dialog .agenda-room-tabs {
    min-height: 48px;
    flex-shrink: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    margin-inline: 12px;
  }

  .agenda-day-dialog .agenda-room-tab {
    flex-shrink: 0;
  }

  .agenda-day-dialog .agenda-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-inline: 12px;
    flex-shrink: 0;
  }

  .agenda-day-dialog .agenda-row-actions .button {
    min-height: 44px;
    width: 100%;
  }

  .agenda-day-dialog .agenda-dialog-footer {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 8px;
  }

  .agenda-day-dialog .agenda-dialog-footer .button {
    min-width: 0;
    padding-inline: 10px;
    font-size: 0.875rem;
  }

  .agenda-day-dialog .agenda-editor-scroll {
    padding-inline: 12px;
  }

  .agenda-dialog-body > .agenda-editor-scroll {
    overflow: visible;
    overscroll-behavior: auto;
  }

  .agenda-editor-table input,
  .agenda-editor-table select {
    min-width: 0;
    max-width: 100%;
    font-size: 16px;
  }

  .agenda-editor-table input[type="time"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius-sm);
    background: var(--lg-surface);
    color: var(--lg-ink);
    appearance: none;
    -webkit-appearance: none;
  }

  .agenda-editor-table input[type="time"]::-webkit-date-and-time-value {
    text-align: left;
  }

  .organization-create-dialog .agenda-dialog-header {
    align-items: flex-start;
    flex-direction: row;
  }

  .agenda-editor-table,
  .agenda-editor-table tbody,
  .agenda-editor-table tr,
  .agenda-editor-table td {
    display: block;
  }

  .agenda-editor-table thead {
    display: none;
  }

  .agenda-editor-table {
    border: 0;
    background: transparent;
  }

  .agenda-editor-table tr {
    margin-bottom: 12px;
    padding: 8px 12px;
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius-md);
    background: var(--lg-surface);
  }

  .agenda-editor-table td {
    min-height: 44px;
    display: grid;
    grid-template-columns: minmax(90px, 0.35fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    border: 0;
  }

  .agenda-editor-table td::before {
    content: attr(data-label);
    color: var(--lg-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .agenda-template-toolbar > *,
  .agenda-template-actions,
  .agenda-template-actions .button,
  .agenda-dialog-footer .button {
    width: 100%;
  }
}

.booking-page {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 32px 0 64px;
}

.booking-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.booking-filters form {
  margin: 0;
}

.booking-filters .booking-site {
  align-self: end;
}

.booking-filter-form {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-picker {
  position: relative;
  flex: 1 1 240px;
}

.filter-picker > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  color: var(--lg-ink);
  cursor: pointer;
  list-style: none;
}

.filter-picker > summary::-webkit-details-marker {
  display: none;
}

.filter-picker > summary strong {
  margin-left: auto;
  color: var(--lg-primary);
  font-size: 0.8125rem;
}

.filter-picker > summary svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.filter-picker[open] > summary svg:last-child {
  transform: rotate(180deg);
}

.filter-picker-panel {
  width: 100%;
  margin-top: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-lg);
  background: var(--lg-surface);
  box-shadow: var(--lg-shadow-md);
}

.filter-picker-options {
  max-height: min(360px, 50vh);
  display: grid;
  gap: 4px;
  overflow-y: auto;
}

.filter-picker-option {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--lg-radius-md);
  color: var(--lg-ink);
  cursor: pointer;
}

.filter-picker-option:hover {
  background: var(--lg-paper-soft);
}

.filter-picker-option:has(input:checked) {
  border-color: #c9a9ce;
  background: #f4edf5;
  color: var(--lg-primary);
  font-weight: 700;
}

.filter-picker-option input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--lg-primary);
}

.filter-picker-empty {
  margin: 0;
  color: var(--lg-muted);
  font-size: 0.875rem;
}

.booking-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.booking-header,
.booking-month-header,
.booking-day-header,
.booking-slot,
.booking-site,
.booking-balance {
  display: flex;
  align-items: center;
}

.booking-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.booking-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.booking-header-actions form {
  margin: 0;
}

.booking-header h1,
.booking-header p {
  margin: 0;
}

.booking-balance,
.booking-site {
  min-height: 44px;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  color: var(--lg-primary);
  font-weight: 700;
}

.booking-balance svg,
.booking-site svg {
  width: 18px;
  height: 18px;
}

.booking-month-card {
  margin-top: 16px;
  padding: 16px;
}

.booking-month-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.booking-month-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.booking-week-labels,
.booking-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.booking-week-labels span {
  padding: 6px 2px;
  color: var(--lg-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.booking-month-grid > form {
  display: contents;
}

.booking-month-day {
  position: relative;
  min-width: 0;
  min-height: 64px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 5px 1px;
  border: 1px solid transparent;
  border-radius: var(--lg-radius-md);
  background: transparent;
  color: var(--lg-ink);
  text-align: center;
}

button.booking-month-day {
  width: 100%;
  cursor: pointer;
}

.booking-month-day small {
  color: var(--lg-muted);
  font-size: 0.625rem;
  line-height: 1.15;
}

.booking-month-available {
  border-color: var(--lg-border);
  background: #f3faf5;
}

.booking-month-available:hover {
  border-color: var(--lg-primary);
  background: #f5eff7;
}

.booking-month-unavailable {
  color: #8f858c;
}

.booking-month-outside {
  color: #b5aab1;
}

.booking-month-counts {
  display: contents;
}

.booking-month-count {
  position: absolute;
  top: 2px;
  left: 2px;
  display: grid;
  place-items: center;
  width: min(22px, calc((100% - 6px) / 2));
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  font-size: clamp(0.5rem, 2.25vw, 0.625rem);
  line-height: 1;
  font-weight: 700;
  color: var(--calendar-color);
  background: var(--calendar-background);
}

.booking-month-morning {
  --calendar-color: #245d92;
  --calendar-background: #e7f1fc;
}

.booking-month-afternoon {
  --calendar-color: #9b541c;
  --calendar-background: #fff0df;
}

.booking-month-count.booking-month-afternoon {
  right: 2px;
  left: auto;
}

.booking-month-own-confirmed {
  --calendar-color: #624667;
  --calendar-background: #eee4f2;
  --calendar-border: #bba3c6;
}

.booking-month-own-prebook {
  --calendar-color: #8a455f;
  --calendar-background: #f8e8ed;
  --calendar-border: #d6acbb;
}

.booking-month-day.booking-month-own-confirmed,
.booking-month-day.booking-month-own-prebook {
  border-color: var(--calendar-border);
  background: var(--calendar-background);
  color: var(--calendar-color);
}

button.booking-month-day.booking-month-own-confirmed:hover,
button.booking-month-day.booking-month-own-prebook:hover {
  border-color: var(--calendar-color);
}

.booking-month-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  margin: 0 0 10px;
  font-size: 0.6875rem;
  color: var(--lg-muted);
}

.booking-month-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.booking-month-key::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1px solid var(--calendar-color);
  border-radius: 3px;
  background: var(--calendar-background);
}

.booking-help {
  margin: 14px 0 0;
  color: var(--lg-muted);
  font-size: 0.875rem;
  text-align: center;
}

.booking-flow-dialog {
  display: flex;
  flex-direction: column;
  width: min(680px, 100%);
}

.booking-flow-dialog > form {
  min-height: 0;
}

.booking-day-body,
.booking-review-body {
  padding: 16px;
}

.booking-selection-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--lg-border);
}

.booking-selection-toolbar > span {
  color: var(--lg-muted);
  font-size: 0.6875rem;
}

.booking-selection-toolbar form {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
}

.booking-selection-toolbar .button {
  width: auto;
  min-height: 44px;
  padding-inline: 8px;
  font-size: 0.8125rem;
}

.booking-selection-toolbar .button svg {
  width: 16px;
  height: 16px;
}

.booking-flow-dialog .booking-slot-selectable {
  display: grid;
  align-items: center;
  cursor: pointer;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin: 0;
}

.booking-slot-selectable:has(input:checked) {
  border-color: var(--lg-primary);
  background: var(--lg-surface-plum);
}

.booking-slot-selectable input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--lg-primary);
}

.booking-selection-footer {
  justify-content: space-between;
  flex-direction: row;
  align-items: center;
}

.booking-flow-dialog > .agenda-dialog-header,
.booking-flow-dialog > .agenda-dialog-footer,
.booking-review-dialog > form > .agenda-dialog-header,
.booking-review-dialog > form > .agenda-dialog-footer {
  padding: 12px 16px;
}

.booking-selection-footer > span {
  color: var(--lg-muted);
  font-size: 0.875rem;
}

.booking-review-item + .booking-review-item {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--lg-border);
}

.booking-review-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.875rem;
}

.booking-review-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.booking-review-summary > div > span,
.booking-review-expiry {
  color: var(--lg-muted);
  font-size: 0.75rem;
}

.booking-review-summary > strong {
  flex-shrink: 0;
}

.booking-review-item .booking-contact-picker {
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 10px 0 4px;
}

.booking-review-item .booking-contact-picker > .field-label {
  display: none;
}

.booking-review-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  gap: 10px;
}

.booking-flow-dialog .agenda-dialog-header > form {
  width: auto;
  flex-shrink: 0;
}

.booking-review-total {
  display: grid;
  gap: 3px;
}

.booking-review-total small {
  color: var(--lg-muted);
  font-size: 0.75rem;
}

.booking-review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.booking-success-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.booking-success-list li {
  display: flex;
  gap: 12px;
  padding-block: 8px;
}

.booking-day-view,
.booking-confirm-view {
  margin-top: 16px;
}

.booking-day-header {
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.booking-day-header h2 {
  margin: 0;
}

.booking-day-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(82px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  padding: 3px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.booking-day-strip form {
  margin: 0;
  scroll-snap-align: center;
}

.booking-day-chip {
  width: 100%;
  min-height: 74px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding: 6px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  color: var(--lg-ink);
  cursor: pointer;
}

.booking-day-chip span,
.booking-day-chip small {
  color: var(--lg-muted);
  font-size: 0.6875rem;
}

.booking-day-chip-empty {
  border-color: var(--lg-border);
  background: var(--lg-disabled-bg);
  color: var(--lg-disabled-text);
}

.booking-day-chip-empty span,
.booking-day-chip-empty small {
  color: var(--lg-disabled-text);
}

.booking-day-chip-current {
  border-color: var(--lg-primary);
  background: #f4edf5;
  color: var(--lg-primary);
  box-shadow: inset 0 0 0 1px var(--lg-primary);
}

.booking-day-chip:hover {
  border-color: var(--lg-primary);
  background: var(--lg-paper-soft);
}

.booking-day-chip-empty:hover {
  border-color: var(--lg-border-strong);
  background: var(--lg-surface-muted);
  color: var(--lg-ink);
}

.booking-day-chip-empty.booking-day-chip-current {
  border-color: var(--lg-primary);
  background: #f4edf5;
  color: var(--lg-primary);
}

.booking-slot-list {
  display: grid;
  gap: 10px;
}

.booking-slot-list > form {
  margin: 0;
}

.booking-time-group > header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 10px;
}

.booking-time-group > header h3 {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 0;
  color: var(--lg-deep);
  font-size: 1.375rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.booking-period-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 16px 0 0;
  font-size: 0.75rem;
  font-weight: 500;
}

.booking-period-label svg {
  width: 16px;
  height: 16px;
}

.booking-period-morning { color: #245d92; }
.booking-period-afternoon { color: #9b541c; }

.booking-period-label + .booking-time-group > header {
  margin-top: 4px;
}

.booking-time-group > header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--lg-border);
}

.booking-time-group > header > span,
.booking-time-slot-details > small {
  color: var(--lg-muted);
  font-size: 0.75rem;
}

.booking-time-group > header > span {
  font-size: 0.6875rem;
  white-space: nowrap;
}

.booking-time-rooms {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.booking-time-slot {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 8px;
  min-height: 76px;
  min-width: 0;
  padding: 7px 10px 7px 7px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.booking-time-slot:hover {
  border-color: var(--lg-border-strong);
  box-shadow: var(--lg-shadow-sm);
}

.booking-slot-pick-form {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: 0;
}

.booking-slot-hit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
  z-index: 0;
}

.booking-slot-hit:hover,
.booking-slot-hit:active {
  background: transparent;
}

.booking-time-slot:has(.booking-slot-hit:focus-visible),
.booking-time-slot:has(.booking-slot-checkbox:focus-visible) {
  outline: 3px solid var(--lg-focus);
  outline-offset: 3px;
}

.booking-slot-hit:focus-visible {
  outline: none;
}

.booking-slot-cover {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 60px;
  min-width: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--lg-radius-sm);
  background: var(--lg-surface-muted);
  overflow: hidden;
}

.booking-slot-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

button.booking-slot-cover:hover {
  filter: brightness(0.94);
}

.booking-slot-cover-empty {
  color: var(--lg-muted);
}

.booking-slot-cover-empty svg {
  width: 22px;
  height: 22px;
}

.booking-time-slot-details {
  position: relative;
  z-index: 1;
  pointer-events: none;
  min-width: 0;
  display: grid;
  align-content: center;
  overflow-wrap: anywhere;
}

.booking-room-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  position: relative;
  pointer-events: auto;
  gap: 6px;
  min-height: 44px;
  max-width: 100%;
  padding: 2px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--lg-ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.booking-room-link:hover {
  color: var(--lg-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.booking-time-slot-price {
  position: relative;
  z-index: 1;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  white-space: nowrap;
}

.booking-time-slot-price > strong {
  font-size: 0.875rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.booking-time-slot-price > small {
  color: var(--lg-muted);
  font-size: 0.6875rem;
  line-height: 1.25;
}

.booking-slot-arrow {
  position: relative;
  z-index: 1;
  pointer-events: none;
  display: grid;
  place-items: center;
  color: var(--lg-primary);
}

.booking-slot-arrow svg {
  width: 18px;
  height: 18px;
}

.booking-slot-checkbox {
  position: relative;
  z-index: 2;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--lg-primary);
  cursor: pointer;
}

.booking-time-slot-multiple:has(input:checked) {
  border-color: var(--lg-primary);
  background: var(--lg-surface-plum);
  box-shadow: 0 0 0 1px var(--lg-primary);
}

.booking-day-dialog {
  width: min(760px, 100%);
}

.booking-selection-footer [data-booking-selection-count] {
  font-size: 0.8125rem;
}

.booking-selection-footer .button {
  width: auto;
  flex: 0 0 auto;
  min-width: 144px;
}

@media (max-width: 22.5rem) {
  .booking-time-slot {
    grid-template-columns: 44px minmax(0, 1fr) auto 20px;
    gap: 6px;
    padding-right: 7px;
  }
  .booking-slot-cover { width: 44px; }
  .booking-room-link { font-size: 0.8125rem; }
  .booking-time-slot-price > strong { font-size: 0.8125rem; }
}

.booking-active-amenities,
.booking-room-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.booking-active-amenities {
  grid-column: 1 / -1;
}

.booking-amenity-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--lg-surface-plum);
  color: var(--lg-primary);
  font-size: 0.8125rem;
}

.booking-amenity-chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.booking-room-dialog {
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
}

.booking-room-dialog .agenda-dialog-header {
  gap: 12px;
  padding: 12px 16px;
}

.booking-room-dialog h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.booking-room-dialog .icon-button {
  flex-shrink: 0;
}

.booking-room-body {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 16px;
}

.booking-room-body h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.booking-room-description p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.booking-room-capacity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--lg-muted);
  font-size: 0.875rem;
}

.booking-room-capacity svg {
  width: 18px;
  height: 18px;
}

.booking-room-gallery {
  position: relative;
  margin: 0;
}

.booking-room-gallery > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  border-radius: var(--lg-radius-md);
  background: var(--lg-paper-soft);
}

.booking-room-gallery figcaption {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgb(0 0 0 / 65%);
  color: white;
  font-size: 0.75rem;
}

.booking-room-thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin-top: -12px;
}

.booking-room-thumbnails button {
  flex: 0 0 80px;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: var(--lg-radius-md);
  background: var(--lg-paper-soft);
  cursor: pointer;
}

.booking-room-thumbnails button[aria-pressed="true"] {
  border-color: var(--lg-primary);
}

.booking-room-thumbnails img {
  display: block;
  width: 100%;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
}

.booking-slot {
  width: 100%;
  min-height: 76px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--lg-border);
  color: var(--lg-ink);
  text-align: left;
  cursor: pointer;
}

.booking-slot-details {
  display: grid;
  gap: 2px;
}

.booking-slot > .booking-slot-price {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.booking-slot > .booking-slot-price > .booking-discount-badge,
.booking-time-slot-price > .booking-discount-badge {
  padding: 3px 6px;
  border: 1px solid #b9d8c7;
  border-radius: 999px;
  background: var(--lg-success-soft);
  color: #245b40;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.booking-slot small,
.booking-slot-details > span {
  color: var(--lg-muted);
}

.booking-slot svg {
  width: 20px;
  height: 20px;
  color: var(--lg-primary);
}

.booking-confirm-view > form:first-child {
  margin-bottom: 12px;
}

.booking-summary,
.booking-option,
.booking-success {
  padding: 20px;
}

.booking-summary dl {
  margin: 0;
}

.booking-summary dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--lg-border);
}

.booking-summary dl div:last-child {
  border-bottom: 0;
}

.booking-summary dt {
  color: var(--lg-muted);
}

.booking-summary dd {
  margin: 0;
  font-weight: 700;
}

.booking-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.booking-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.booking-option-prebook {
  border-color: #c9a9ce;
  background: #fbf7fc;
}

.booking-option h2 {
  margin: 10px 0 4px;
}

.booking-option p {
  color: var(--lg-muted);
}

.booking-option .button {
  width: 100%;
  margin-top: auto;
}

.booking-success {
  margin-top: 20px;
  text-align: center;
}

.booking-success .state-icon {
  margin-inline: auto;
}

.booking-success form {
  display: flex;
  justify-content: center;
}

.booking-upcoming {
  padding: 20px;
}

.booking-upcoming > header h2,
.booking-upcoming > header p {
  margin: 0;
}

.booking-upcoming-list {
  margin-top: 14px;
  border-top: 1px solid var(--lg-border);
}

.booking-upcoming-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(140px, 1.25fr) minmax(135px, 0.9fr) auto minmax(86px, auto);
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--lg-border);
}

.booking-upcoming-row:last-child {
  border-bottom: 0;
}

.booking-upcoming-row time,
.booking-upcoming-place,
.booking-upcoming-cost {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.booking-upcoming-row small,
.booking-upcoming-row time span {
  color: var(--lg-muted);
  font-size: 0.8125rem;
}

.booking-upcoming-action,
.booking-upcoming-action form {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.booking-upcoming-action {
  flex-direction: column;
  gap: 8px;
}

.booking-upcoming-action .button {
  white-space: nowrap;
}

.booking-upcoming-contact {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.booking-upcoming-contact svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.booking-cancel-dialog {
  width: min(680px, 100%);
}

.booking-cancel-dialog .agenda-dialog-body {
  padding: 20px;
}

.booking-cancel-dialog .agenda-dialog-body > p {
  margin: 14px 0 0;
  color: var(--lg-muted);
}

.amenity-create-card,
.amenity-list,
.template-editor-card {
  padding: 20px;
}

.amenity-create-form,
.amenity-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  align-items: end;
  gap: 12px;
}

.amenity-create-card {
  margin-bottom: 16px;
}

.amenity-list {
  display: grid;
  gap: 12px;
}

.amenity-row {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--lg-border);
}

.amenity-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.amenity-active,
.amenity-create-form > .choice {
  min-width: 120px;
}

.amenity-row > .badge {
  min-height: 44px;
  align-self: end;
  justify-content: center;
}

.template-settings-page {
  width: min(100% - 32px, 1180px);
}

.schedule-template-list {
  display: grid;
  gap: 12px;
}

.schedule-template-card {
  min-height: 88px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.schedule-template-card h2,
.schedule-template-card p {
  margin: 0;
}

.schedule-template-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.schedule-template-card-actions form {
  margin: 0;
}

.template-name-field {
  max-width: 520px;
}

.template-editor-card .agenda-row-actions {
  margin-inline: 0;
}

.template-editor-scroll {
  padding-inline: 0;
}

.template-editor-actions {
  justify-content: flex-end;
  padding-top: 16px;
}

@container (max-width: 44rem) {
  .overview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-summary-item:nth-child(3) {
    grid-column: 1 / -1;
    border-top: 1px solid var(--lg-border);
    border-left: 0;
  }
}

.badge-warning {
  background: var(--lg-warning-soft);
  color: #704813;
}

.badge-neutral {
  background: #eee9ed;
  color: #675c64;
}

.notice-error {
  border-color: #e2a6a6;
  background: var(--lg-danger-soft);
  color: #842929;
}

.professionals-page {
  width: min(100% - 32px, 1240px);
  min-width: 0;
}

.professional-filters,
.professional-table-card,
.professional-panel,
.professional-summary,
.pending-invitations {
  margin-top: 20px;
}

.professional-filters {
  padding: 16px;
}

.professional-filters form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.6fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.professional-filters .form-actions {
  margin: 0;
}

.professional-list-filters {
  padding: 0;
}

.professional-list-filters > summary,
.professional-list-filters > summary > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.professional-list-filters > summary {
  min-height: 48px;
  padding: 12px 16px;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  color: var(--lg-primary);
  font-weight: 500;
}

.professional-list-filters > summary::-webkit-details-marker {
  display: none;
}

.professional-list-filters > summary svg {
  width: 20px;
  height: 20px;
}

.professional-list-filters[open] > summary {
  border-bottom: 1px solid var(--lg-border);
}

.professional-list-filters[open] > summary > svg {
  transform: rotate(180deg);
}

.professional-list-filters > form {
  padding: 16px;
}

.professional-mobile-label,
.professional-list-next > small {
  display: none;
}

.professional-contacts-filters form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.professional-contacts-table tbody + tbody {
  border-top: 2px solid var(--lg-border);
}

.professional-table-card,
.professional-panel {
  overflow: hidden;
}

.professional-rules-panel {
  margin-top: 20px;
}

.professional-rules-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.professional-rule-limit,
.professional-rules-actions {
  grid-column: 1 / -1;
}

.professional-rule-limit {
  max-width: 24rem;
}

.professional-rules-actions {
  justify-content: flex-end;
}

.table-scroll {
  overflow-x: auto;
}

.professional-table {
  width: 100%;
  border-collapse: collapse;
}

.professional-table-card .professional-table {
  min-width: 900px;
}

.professional-table-card .professional-table th:first-child,
.professional-table-card .professional-table td:first-child {
  min-width: 260px;
}

.professional-table th,
.professional-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--lg-border);
  text-align: left;
  vertical-align: middle;
}

.professional-table th {
  background: var(--lg-paper-soft);
  color: var(--lg-muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.professional-table tbody tr:last-child td {
  border-bottom: 0;
}

.professional-table td > strong,
.professional-table td > small {
  display: block;
}

.professional-table td > small {
  margin-top: 3px;
  color: var(--lg-muted);
}

.professional-contact-list,
.professional-phone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 5px;
}

.professional-contact-list {
  align-items: flex-start;
  flex-direction: column;
}

.professional-contact-link,
.professional-whatsapp-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--lg-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.professional-contact-link svg,
.professional-whatsapp-link svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.professional-whatsapp-link {
  padding: 4px 8px;
  border: 1px solid var(--lg-border);
  border-radius: 999px;
  background: var(--lg-paper-soft);
  text-decoration: none;
}

.professional-whatsapp-link:hover {
  border-color: var(--lg-primary);
  background: var(--lg-surface-plum);
  color: var(--lg-deep);
}

.professional-table .button-small {
  min-height: 44px;
}

.professional-balance {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
}

.empty-state {
  min-height: 150px;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  color: var(--lg-muted);
  text-align: center;
}

.empty-state strong {
  color: var(--lg-ink);
  font-size: 1rem;
}

.section-heading,
.detail-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.pending-invitations {
  padding: 20px;
}

.pending-invitations ul,
.room-access-group ul,
.suspension-bookings,
.access-diff ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.pending-invitations li {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--lg-border);
}

.pending-invitations li:last-child {
  border-bottom: 0;
}

.pending-invitations li > span:first-child,
.pending-invitations li small {
  display: block;
}

.pending-invitations li small {
  color: var(--lg-muted);
}

.pending-invitation-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.account-profile-page {
  width: min(100% - 48px, 980px);
}

.account-profile-header {
  align-items: center;
}

.account-profile-header > .badge {
  align-self: flex-start;
  justify-self: start;
}

.account-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--lg-border);
}

.account-tab {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 3px solid transparent;
  color: var(--lg-muted);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.account-tab:hover,
.account-tab-current {
  border-bottom-color: var(--lg-primary);
  color: var(--lg-primary);
}

.account-tab svg {
  width: 18px;
  height: 18px;
}

.account-panel {
  margin-top: 20px;
  padding: 24px;
}

.account-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.account-section-heading p {
  margin-top: 4px;
  color: var(--lg-muted);
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.account-email-field {
  grid-column: 1 / -1;
}

.account-email-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.account-form-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

.account-notification-form {
  margin-top: 14px;
}

.account-notification-heading {
  align-items: center;
  margin-bottom: 0;
}

.account-notification-blocks {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-top: 24px;
}

.account-notification-block {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
}

.account-notification-block.has-error {
  border-color: var(--lg-danger);
}

.account-notification-block-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--lg-paper);
  border-bottom: 1px solid var(--lg-border);
}

.account-notification-block-header > div {
  min-width: 0;
}

.account-notification-block-header h3,
.account-notification-block-header p {
  margin: 0;
}

.account-notification-block-header h3 {
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.25;
}

.account-notification-block-header p {
  margin-top: 2px;
  color: var(--lg-muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.account-notification-block-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lg-surface-plum);
  color: var(--lg-primary);
}

.account-notification-block-icon svg {
  width: 18px;
  height: 18px;
}

.account-notification-block-general {
  border-color: #b9d8c8;
}

.account-notification-block-general .account-notification-block-header {
  background: var(--lg-success-soft);
  border-bottom-color: #cce3d6;
}

.account-notification-block-general .account-notification-block-icon {
  background: var(--lg-surface);
  color: var(--lg-success);
}

.account-notification-channel-header,
.account-notification-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(var(--notification-channel-count, 2), 92px);
  align-items: center;
  column-gap: 8px;
  padding: 8px 16px;
}

.account-notification-channel-header {
  min-height: 48px;
  background: var(--lg-paper-soft);
  border-bottom: 1px solid var(--lg-border);
  color: var(--lg-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.account-notification-channel-header > span:not(:first-child) {
  display: grid;
  justify-items: center;
  text-align: center;
}

.account-notification-channel-header small {
  margin-top: 1px;
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.notification-label-mobile {
  display: none;
}

.account-notification-row {
  min-height: 68px;
  border-bottom: 1px solid var(--lg-border);
}

.account-notification-row:last-child {
  border-bottom: 0;
}

.account-notification-copy {
  min-width: 0;
}

.account-notification-copy strong,
.account-notification-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.account-notification-copy strong {
  line-height: 1.25;
}

.account-notification-copy small {
  margin-top: 3px;
  color: var(--lg-muted);
  line-height: 1.3;
}

.account-notification-toggle {
  position: relative;
  justify-self: center;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--lg-radius-sm);
  cursor: pointer;
}

.account-notification-toggle:hover {
  background: var(--lg-primary-soft);
}

.account-notification-toggle input {
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  display: grid;
  place-content: center;
  border: 2px solid #8e7789;
  border-radius: 6px;
  background: var(--lg-surface);
  cursor: inherit;
}

.account-notification-toggle input::before {
  width: 5px;
  height: 10px;
  content: "";
  border: solid var(--lg-surface);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
}

.account-notification-toggle input:checked {
  border-color: var(--lg-primary);
  background: var(--lg-primary);
}

.account-notification-toggle input:checked::before {
  transform: rotate(45deg) scale(1);
}

.account-notification-toggle input:focus-visible {
  outline: 3px solid var(--lg-focus);
  outline-offset: 3px;
}

.account-notification-toggle.is-disabled {
  cursor: not-allowed;
}

.account-notification-toggle.is-disabled:hover {
  background: transparent;
}

.account-notification-toggle.is-disabled input {
  border-color: var(--lg-border-strong);
  background: var(--lg-disabled-bg);
}

.account-notification-toggle.is-disabled input::before {
  transform: rotate(45deg) scale(0);
}

.account-notification-toggle.is-required input {
  border-color: var(--lg-success);
  background: var(--lg-success-soft);
}

.account-notification-toggle.is-required input::before {
  border-color: var(--lg-success);
  transform: rotate(45deg) scale(1);
}

.account-notification-block-error {
  margin: 0;
  padding: 10px 16px;
  background: var(--lg-danger-soft);
  color: var(--lg-danger);
  font-size: 0.8125rem;
  font-weight: 500;
}

.account-notification-form[aria-busy="true"] .account-form-actions .button {
  cursor: wait;
}

.account-settings-list {
  display: grid;
}

.account-setting-row {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--lg-border);
}

.account-setting-row:last-child {
  border-bottom: 0;
}

.account-setting-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-setting-main > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.account-setting-main small {
  overflow-wrap: anywhere;
  color: var(--lg-muted);
}

.account-setting-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lg-primary-soft);
  color: var(--lg-primary);
}

.account-setting-icon svg {
  width: 20px;
  height: 20px;
}

.google-setting-icon .google-mark {
  border-color: transparent;
}

.account-password-dialog {
  width: min(620px, calc(100% - 32px));
}

.account-dialog-body {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.account-confirm-target {
  overflow-wrap: anywhere;
}

.account-contact-confirm-dialog .agenda-dialog-header {
  flex-direction: row;
  align-items: flex-start;
}

.account-contact-confirm-dialog .agenda-dialog-header > div {
  min-width: 0;
}

.account-contact-confirm-dialog .agenda-dialog-header .icon-button {
  flex-shrink: 0;
}

.account-contact-confirm-dialog .agenda-dialog-header,
.account-contact-confirm-dialog .agenda-dialog-footer {
  flex-shrink: 0;
}

.account-contact-confirm-dialog .account-dialog-body {
  min-height: 0;
  overflow-y: auto;
}

.professional-tabs {
  display: flex;
  gap: 4px;
  margin-top: 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--lg-border);
}

.professional-tab {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 3px solid transparent;
  color: var(--lg-muted);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.professional-tab:hover,
.professional-tab-current {
  border-bottom-color: var(--lg-primary);
  color: var(--lg-primary);
}

.professional-tab svg {
  width: 18px;
  height: 18px;
}

.professional-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.34fr);
  gap: 20px;
  margin-top: 20px;
}

.professional-detail-grid > .professional-panel,
.professional-detail-grid > .professional-summary {
  margin-top: 0;
}

.professional-panel,
.professional-summary {
  padding: 20px;
}

.professional-summary div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--lg-border);
}

.professional-summary strong {
  font-size: 1.5rem;
}

.professional-summary-note {
  margin: 12px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
}

.organization-settings-page {
  width: min(100% - 48px, 980px);
}

.organization-settings-panel {
  margin-top: 20px;
  padding: 24px;
}

.organization-settings-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.organization-settings-heading h2,
.organization-settings-heading p {
  margin: 0;
}

.organization-settings-heading p {
  margin-top: 4px;
  color: var(--lg-muted);
}

.organization-settings-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lg-primary-soft);
  color: var(--lg-primary);
}

.organization-settings-icon svg {
  width: 20px;
  height: 20px;
}

.organization-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (min-width: 68.001rem) {
  .organization-settings-rules-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .organization-settings-rules-grid > .field > span:first-child {
    min-height: 3rem;
  }
}

.organization-settings-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

.organization-logo-editor {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.organization-logo-preview {
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-paper-soft);
}

.organization-logo-preview img {
  display: block;
  max-width: 100%;
  max-height: 88px;
  object-fit: contain;
}

.organization-logo-placeholder {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--lg-primary-soft);
  color: var(--lg-primary);
}

.organization-logo-placeholder svg {
  width: 24px;
  height: 24px;
}

.organization-logo-controls,
.organization-logo-upload-row {
  display: grid;
  gap: 12px;
}

.organization-logo-upload {
  display: grid;
  gap: 6px;
}

.organization-logo-upload-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.organization-logo-controls .field {
  min-width: 0;
}

.organization-logo-file-picker {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius-sm);
  background: var(--lg-surface);
  overflow: hidden;
}

.organization-logo-file-picker:focus-within {
  border-color: var(--lg-primary);
  box-shadow: var(--lg-focus-ring);
}

.organization-logo-file-input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.organization-logo-file-picker .button {
  min-height: 42px;
  border-width: 0 1px 0 0;
  border-radius: 0;
  pointer-events: none;
}

.organization-logo-file-name {
  min-width: 0;
  padding-right: 12px;
  color: var(--lg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-logo-remove-button {
  justify-self: start;
}

.professional-profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.professional-profile-actions form {
  margin: 0;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 0;
}

.detail-list div {
  padding: 14px;
  border-radius: var(--lg-radius-md);
  background: var(--lg-paper-soft);
}

.detail-list dt {
  color: var(--lg-muted);
  font-size: 0.8125rem;
}

.detail-list dd {
  margin: 4px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.credit-positive {
  color: var(--lg-success);
}

.credit-negative {
  color: var(--lg-danger);
}

.credit-ledger-tools {
  display: grid;
  grid-template-columns: minmax(240px, 420px) minmax(0, 1fr);
  align-items: end;
  gap: 16px;
  margin-top: 20px;
  margin-bottom: 16px;
}

.credit-ledger-tools > p {
  margin: 0 0 12px;
}

.reservation-cancel-summary {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: var(--lg-radius-md);
  background: var(--lg-paper-soft);
}

.reservation-cancel-summary span {
  color: var(--lg-muted);
}

.room-access-group {
  margin-top: 18px;
}

.room-access-group li,
.access-diff li {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--lg-border);
}

.professional-dialog {
  width: min(760px, 100%);
}

.professional-dialog-body {
  display: grid;
  gap: 16px;
  padding: 20px;
  overflow-y: auto;
}

.professional-dialog-body > p {
  margin: 0;
}

.professional-combobox {
  position: relative;
}

.professional-combobox-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  color: var(--lg-ink);
  text-align: left;
  cursor: pointer;
}

.professional-combobox-trigger:hover,
.professional-combobox-trigger[aria-expanded="true"] {
  border-color: var(--lg-primary);
}

.professional-combobox-trigger > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.professional-combobox-trigger svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--lg-primary);
}

.professional-combobox-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius-md);
  background: var(--lg-surface);
  box-shadow: var(--lg-shadow-md);
}

.professional-combobox-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--lg-border);
}

.professional-combobox-search svg {
  width: 18px;
  height: 18px;
  color: var(--lg-muted);
}

.professional-combobox-search input {
  min-height: 44px;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--lg-ink);
}

.professional-combobox-options {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
}

.professional-combobox-option {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--lg-radius-sm);
  cursor: pointer;
}

.professional-combobox-option:hover,
.professional-combobox-option:focus,
.professional-combobox-option[data-selected] {
  outline: 0;
  background: var(--lg-surface-plum);
  color: var(--lg-deep);
}

.professional-combobox-option span:first-child,
.professional-combobox-option small {
  display: block;
  min-width: 0;
}

.professional-combobox-option small,
.professional-option-balance,
.professional-combobox-status {
  color: var(--lg-muted);
  font-size: 0.8125rem;
}

.professional-combobox-option .badge {
  width: fit-content;
  margin-top: 4px;
}

.professional-combobox-option svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  opacity: 0;
}

.professional-combobox-option[data-selected] svg {
  opacity: 1;
}

.professional-combobox-status {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--lg-border);
}

.balance-preview,
.access-diff {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.balance-preview span {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: var(--lg-radius-md);
  background: var(--lg-paper-soft);
  color: var(--lg-muted);
}

.balance-preview strong {
  color: var(--lg-ink);
  font-size: 1.5rem;
}

.room-access-choices {
  max-height: 420px;
  overflow-y: auto;
}

.room-access-choices fieldset {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
}

.room-access-choices legend {
  padding-inline: 6px;
  font-weight: 700;
}

.access-diff {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.suspension-bookings {
  max-height: 360px;
  overflow-y: auto;
}

.suspension-bookings li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--lg-border);
}

.suspension-bookings li span {
  display: block;
}

.invite-shell {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 24px;
  padding: 32px 20px;
  background: var(--lg-paper-soft);
}

.invite-brand,
.invite-brand img {
  width: 150px;
}

.invite-brand {
  margin: 0 auto;
}

.invite-card {
  width: min(100%, 520px);
}

.invite-card form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.legal-acceptance-choice {
  align-items: flex-start;
  min-height: 52px;
  padding: 12px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: var(--lg-paper-soft);
  line-height: 1.45;
}

.legal-acceptance-choice input {
  flex: 0 0 auto;
  margin-top: 2px;
}

.legal-acceptance-choice a {
  color: var(--lg-primary);
  font-weight: 700;
}

.legal-shell {
  min-height: 100vh;
  display: grid;
  place-content: start center;
  gap: 24px;
  padding: 32px 20px;
  background: var(--lg-paper-soft);
}

.legal-card {
  width: min(100%, 760px);
  padding: clamp(24px, 5vw, 48px);
}

.legal-card h1 {
  margin: 4px 0 8px;
}

.legal-meta {
  margin: 0;
  color: var(--lg-muted);
  font-size: 0.875rem;
}

.legal-content {
  display: grid;
  gap: 16px;
  margin: 32px 0;
  color: var(--lg-ink-soft);
  line-height: 1.7;
}

.legal-content p {
  margin: 0;
}

@media (min-width: 48.001rem) and (max-width: 68rem) {
  .filter-bar {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 180px);
  }

  .filter-bar .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .professional-filters form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .professional-filters .field:first-of-type,
  .professional-filters .form-actions {
    grid-column: 1 / -1;
  }

  .professional-filters .form-actions {
    padding-top: 0;
  }

  .professional-table-card .table-scroll {
    overflow-x: auto;
    scrollbar-gutter: stable;
  }

  .professional-detail-grid,
  .professional-rules-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .professional-rule-limit {
    max-width: none;
  }

  .organization-logo-editor {
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: stretch;
  }

  .organization-logo-upload-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .organization-logo-upload-row > .button {
    justify-self: start;
  }

}

@media (max-width: 48rem) {
  .booking-page {
    width: min(100% - 20px, 720px);
    padding-top: 20px;
  }

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

  .booking-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .booking-balance {
    font-size: 0.8125rem;
  }

  .booking-month-card {
    padding: 10px;
  }

  .booking-month-day {
    min-height: 56px;
  }

  .booking-month-day small {
    font-size: 0.5625rem;
  }

  .booking-day-header h2 {
    min-width: 0;
    flex: 1;
    font-size: 1rem;
  }

  .booking-filter-form,
  .booking-filter-picker,
  .booking-filter-picker > summary,
  .booking-filter-actions,
  .booking-filter-actions .button {
    width: 100%;
  }

  .filter-picker-panel {
    width: 100%;
  }

  .booking-day-strip {
    grid-template-columns: repeat(7, minmax(78px, 1fr));
  }

  .booking-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .booking-upcoming {
    padding: 14px;
  }

  .booking-upcoming-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
  }

  .booking-upcoming-place,
  .booking-upcoming-cost {
    grid-column: 1 / -1;
    overflow-wrap: anywhere;
  }

  .booking-upcoming-row > .badge {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .booking-upcoming-action {
    grid-column: 1 / -1;
    grid-row: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-self: stretch;
  }

  .booking-upcoming-action form,
  .booking-upcoming-action .button {
    width: 100%;
    min-width: 0;
  }

  .booking-upcoming-action .button {
    min-height: 44px;
    padding-inline: 10px;
  }

  .booking-upcoming-action form:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .booking-slot {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .booking-slot svg {
    display: none;
  }

  .agenda-room-picker,
  .agenda-room-picker > summary {
    width: 100%;
  }

  .agenda-room-picker-panel {
    right: auto;
    left: 0;
  }

  .amenity-create-form,
  .amenity-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .amenity-create-form .button,
  .amenity-row .button {
    width: 100%;
  }

  .schedule-template-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .schedule-template-card-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-template-card-actions .button,
  .schedule-template-card-actions form {
    width: 100%;
  }

  .professionals-page {
    width: min(100% - 20px, 1240px);
  }

  .organization-settings-page {
    width: min(100% - 32px, 980px);
  }

  .organization-settings-panel {
    padding: 20px 16px;
  }

  .organization-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .organization-logo-editor,
  .organization-logo-upload-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .organization-logo-preview {
    width: 100%;
  }

  .organization-logo-controls .button,
  .organization-logo-remove-button {
    width: 100%;
  }

  .organization-settings-actions .button {
    width: 100%;
  }

  .professional-filters form,
  .professional-rules-form,
  .professional-detail-grid,
  .detail-list,
  .balance-preview,
  .credit-ledger-tools,
  .access-diff,
  .suspension-bookings li {
    grid-template-columns: minmax(0, 1fr);
  }

  .professional-filters .form-actions,
  .professional-filters .button,
  .section-heading .button,
  .section-heading form,
  .detail-header-actions .button,
  .detail-header-actions form {
    width: 100%;
  }

  .professional-detail-header,
  .detail-header-actions,
  .section-heading,
  .professional-profile-actions,
  .pending-invitations li {
    align-items: stretch;
    flex-direction: column;
  }

  .professional-profile-actions .button,
  .professional-profile-actions form {
    width: 100%;
  }

  .pending-invitation-actions,
  .pending-invitation-actions .button {
    width: 100%;
  }

  .pending-invitation-actions {
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .professional-panel .professional-table,
  .professional-panel .professional-table tbody,
  .professional-panel .professional-table tr,
  .professional-panel .professional-table td,
  .account-credit-panel .professional-table,
  .account-credit-panel .professional-table tbody,
  .account-credit-panel .professional-table tr,
  .account-credit-panel .professional-table td {
    display: block;
  }

  .professional-panel .professional-table thead,
  .account-credit-panel .professional-table thead {
    display: none;
  }

  .professional-panel .professional-table tr,
  .account-credit-panel .professional-table tr {
    padding: 12px;
    border-bottom: 1px solid var(--lg-border);
  }

  .professional-panel .professional-table td,
  .account-credit-panel .professional-table td {
    min-height: 44px;
    display: grid;
    grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border: 0;
  }

  .professional-panel .professional-table td::before,
  .account-credit-panel .professional-table td::before {
    content: attr(data-label);
    color: var(--lg-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .professional-table-card .table-scroll {
    overflow-x: auto;
    scrollbar-gutter: stable;
  }

  .professional-table-card .professional-table th,
  .professional-table-card .professional-table td {
    padding: 10px 12px;
  }

  .professional-list-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    margin-bottom: 0;
  }

  .professional-list-header .page-description,
  .professional-detail-heading .page-description {
    margin: 4px 0 0;
  }

  .professional-list-filters,
  .professional-list-card {
    margin-top: 16px;
  }

  .professional-list-header > form,
  .professional-list-header > form > .button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
  }

  .professional-invite-label {
    display: none;
  }

  .professional-list-card {
    border: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }

  .professional-list-card .table-scroll {
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .professional-list-card .professional-list-table,
  .professional-list-table > tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .professional-list-table > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .professional-list-table .professional-list-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius-md);
    background: var(--lg-surface);
    box-shadow: var(--lg-shadow-sm);
  }

  .professional-list-table .professional-list-item > td {
    min-width: 0;
    padding: 0;
    border: 0;
    font-size: 0.8125rem;
  }

  .professional-list-card .professional-list-table td:first-child {
    min-width: 0;
    grid-column: 1 / -1;
  }

  .professional-list-name {
    display: block;
    padding-inline-end: 112px;
    min-height: 24px;
    font-size: 1rem;
    overflow-wrap: anywhere;
  }

  .professional-list-identity .professional-contact-list {
    margin-top: 4px;
  }

  .professional-list-state {
    position: absolute;
    top: 14px;
    right: 14px;
    max-width: 108px;
  }

  .professional-list-state .badge {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 0.6875rem;
  }

  .professional-list-credit {
    grid-column: 1;
  }

  .professional-list-rooms {
    grid-column: 2;
    text-align: right;
  }

  .professional-mobile-label {
    display: inline;
  }

  .professional-list-credit > span,
  .professional-mobile-label {
    color: var(--lg-muted);
  }

  .professional-list-table .professional-list-credit > strong {
    display: inline;
  }

  .professional-list-next {
    grid-column: 1;
    align-self: center;
    color: var(--lg-muted);
    overflow-wrap: anywhere;
  }

  .professional-list-next > small {
    display: block;
    font-size: 0.6875rem;
  }

  .professional-list-action {
    grid-column: 2;
    align-self: center;
  }

  .professional-list-action > .button {
    min-width: 112px;
    min-height: 44px;
  }

  .professional-detail-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .professional-detail-header .detail-header-actions {
    display: contents;
  }

  .professional-detail-header .professional-back {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    width: auto;
    min-height: 44px;
    padding-inline: 0;
  }

  .professional-detail-header .detail-header-actions > .badge {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    width: fit-content;
    max-width: 108px;
    white-space: normal;
  }

  .professional-detail-heading {
    grid-column: 1 / -1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .professional-dialog,
  .professional-dialog form {
    width: 100%;
    max-height: var(--dialog-max-height, calc(100dvh - 24px));
    border-radius: var(--lg-radius-md);
  }

  .professional-dialog .agenda-dialog-footer .button {
    width: 100%;
  }

  .unit-map-section > header,
  .unit-map-coordinates {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-map-section > header {
    flex-direction: column;
  }

  .unit-map-actions,
  .unit-map-actions .button {
    width: 100%;
  }

  .unit-map-actions {
    display: grid;
  }

  .unit-map {
    height: 240px;
  }

  .account-profile-page {
    width: min(100% - 32px, 980px);
  }

  .account-profile-header {
    align-items: flex-start;
  }

  .account-panel {
    padding: 20px 16px;
  }

  .account-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-email-field {
    grid-column: auto;
  }

  .account-email-control {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-email-control .badge {
    justify-self: flex-start;
  }

  .mobile-tabs[role="tablist"] {
    --mobile-tab-columns: 3;
    display: grid;
    grid-template-columns: repeat(var(--mobile-tab-columns), minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    overflow: visible;
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius-md);
    background: var(--lg-surface);
  }

  .unit-card .button,
  .amenity-list .button {
    min-height: 44px;
  }

  .mobile-tabs[data-tab-count="1"] {
    --mobile-tab-columns: 1;
  }

  .mobile-tabs[data-tab-count="2"],
  .mobile-tabs[data-tab-count="4"] {
    --mobile-tab-columns: 2;
  }

  .mobile-tabs[role="tablist"] > [role="tab"] {
    min-width: 0;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .mobile-tabs[role="tablist"] > [role="tab"] svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .mobile-tabs[role="tablist"] > [aria-selected="true"] {
    border-bottom-color: var(--lg-primary);
    background: var(--lg-primary-soft, #f3edf4);
    color: var(--lg-primary);
  }

  .account-notification-panel {
    padding: 8px;
  }

  .account-notification-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
  }

  .account-notification-blocks {
    margin-top: 16px;
  }

  .account-notification-block-header {
    min-height: 58px;
    padding: 8px;
  }

  .account-notification-channel-header,
  .account-notification-row {
    grid-template-columns: minmax(124px, 1fr) repeat(var(--notification-channel-count, 2), 44px);
    column-gap: 0;
    padding: 8px;
  }

  .account-notification-channel-header {
    min-height: 40px;
    font-size: 0.625rem;
  }

  .account-notification-channel-header small,
  .notification-label-desktop,
  .account-notification-copy small {
    display: none;
  }

  .notification-label-mobile {
    display: inline;
  }

  .account-notification-row {
    min-height: 64px;
  }

  .account-notification-copy strong {
    font-size: 0.8125rem;
  }

  .account-notification-panel .account-form-actions,
  .account-notification-panel .account-form-actions .button {
    width: 100%;
  }

  .account-setting-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-setting-row form,
  .account-setting-row .button {
    width: 100%;
  }

  .account-password-dialog,
  .account-password-dialog form {
    width: 100%;
    max-height: var(--dialog-max-height, calc(100dvh - 24px));
    border-radius: var(--lg-radius-md);
  }

  .account-password-dialog .agenda-dialog-footer .button {
    width: 100%;
  }

  .account-password-dialog.account-contact-confirm-dialog,
  .account-contact-confirm-dialog form {
    width: 100%;
    max-height: var(--dialog-max-height, calc(100dvh - 24px));
    border-radius: var(--lg-radius-md);
  }

  .account-contact-confirm-dialog form {
    width: 100%;
  }
}

.nav-link-disabled {
  color: #cbbbc9;
  cursor: not-allowed;
  opacity: 0.72;
}

.professional-dashboard-page {
  width: min(920px, calc(100% - 48px));
  display: grid;
  gap: 18px;
  margin: 0 auto;
  padding: 40px 0 64px;
}

.professional-dashboard-header h1 {
  margin-bottom: 6px;
}

.professional-dashboard-header > p:last-child,
.professional-announcement p,
.professional-upcoming-empty p {
  margin-bottom: 0;
  color: var(--lg-muted);
}

.professional-announcement,
.professional-balance,
.professional-urgent,
.professional-upcoming {
  padding: 20px;
}

.professional-announcement {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  border-color: #d9bfdc;
  background: #fcf8fd;
}

.professional-announcement h2,
.professional-urgent h2 {
  font-size: 1.125rem;
}

.professional-announcement details {
  margin-top: 10px;
}

.professional-announcement summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--lg-primary);
  font-weight: 700;
  cursor: pointer;
}

.professional-announcement details > p,
.professional-announcement-more article {
  padding: 12px;
  border-left: 3px solid var(--lg-border);
  white-space: pre-line;
}

.professional-announcement-more article + article {
  margin-top: 10px;
}

.professional-section-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lg-surface-plum);
  color: var(--lg-primary);
}

.professional-section-icon svg {
  width: 21px;
  height: 21px;
}

.professional-suspension {
  margin: 0;
}

.professional-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.professional-balance-value {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.professional-balance-value > div {
  display: grid;
}

.professional-balance-value strong {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.15;
}

.professional-balance-value small,
.professional-schedule-summary small,
.professional-upcoming-item small {
  color: var(--lg-muted);
}

.professional-balance-actions,
.professional-urgent-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.professional-urgent {
  display: grid;
  gap: 16px;
  border-color: #e7c58e;
  background: #fffaf0;
}

.professional-urgent-heading,
.professional-schedule-summary {
  display: flex;
  align-items: center;
  gap: 14px;
}

.professional-urgent-heading .badge {
  margin-bottom: 6px;
}

.professional-schedule-summary {
  padding: 14px;
  border: 1px solid #eadccf;
  border-radius: var(--lg-radius-md);
  background: rgb(255 255 255 / 70%);
}

.professional-schedule-summary time,
.professional-schedule-summary > span {
  display: grid;
}

.professional-schedule-summary time {
  min-width: 120px;
  padding-right: 14px;
  border-right: 1px solid var(--lg-border);
}

.professional-urgent-actions {
  justify-content: flex-start;
}

.professional-upcoming {
  padding-bottom: 4px;
}

.professional-upcoming > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
}

.professional-upcoming > header h2 {
  margin-bottom: 0;
}

.professional-upcoming > header > a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
}

.professional-upcoming-list {
  display: grid;
}

.professional-upcoming-item {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(145px, 0.9fr) minmax(120px, 0.8fr) minmax(130px, 1fr) minmax(170px, 1.1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-top: 1px solid var(--lg-border);
  color: var(--lg-ink);
  text-decoration: none;
}

.professional-upcoming-item:hover {
  color: var(--lg-deep);
  background: var(--lg-paper-soft);
}

.professional-upcoming-status,
.professional-upcoming-item time,
.professional-upcoming-place,
.professional-upcoming-meta {
  min-width: 0;
  display: grid;
}

.professional-upcoming-status {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.professional-upcoming-status svg {
  width: 18px;
  color: var(--lg-primary);
}

.professional-upcoming-item > svg {
  width: 18px;
  color: var(--lg-primary);
}

.professional-upcoming-empty {
  padding-bottom: 20px;
}

.professional-region-error {
  border-color: var(--lg-danger);
  background: var(--lg-danger-soft);
}

.professional-dashboard-page .button-small,
.announcements-manager-page .button-small {
  min-height: 44px;
}

.announcements-manager-page {
  width: min(980px, calc(100% - 48px));
}

.announcement-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--lg-border);
  border-radius: 999px;
  background: var(--lg-surface);
  color: var(--lg-primary);
  font-weight: 700;
  text-decoration: none;
}

.filter-chip:hover,
.filter-chip-current {
  border-color: var(--lg-primary);
  background: var(--lg-surface-plum);
  color: var(--lg-deep);
}

.announcement-admin-list {
  display: grid;
  gap: 12px;
}

.announcement-admin-card,
.announcement-admin-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
}

.announcement-admin-card h2 {
  margin: 8px 0 3px;
  font-size: 1.125rem;
}

.announcement-admin-card p,
.announcement-admin-empty p {
  margin: 0;
  color: var(--lg-muted);
}

.announcement-admin-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.announcement-editor-card {
  padding: 22px;
}

.announcement-editor-card form {
  display: grid;
  gap: 18px;
}

.announcement-period-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.announcement-editor-actions {
  justify-content: flex-end;
}

@media (min-width: 48.001rem) and (max-width: 52.3125rem) {
  .account-notification-channel-header,
  .account-notification-row {
    grid-template-columns: minmax(180px, 1fr) repeat(var(--notification-channel-count, 2), 64px);
  }

  .app-shell-professional {
    display: block;
    padding: 64px 0 calc(var(--mobile-navigation-height, 80px) + 16px);
  }

  .app-shell-professional > .app-sidebar {
    display: none;
  }

  .app-shell-professional > .mobile-topbar {
    position: fixed;
    z-index: 50;
    inset: 0 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--lg-border);
    background: rgb(255 255 255 / 96%);
    backdrop-filter: blur(12px);
  }

  .app-shell-professional > .mobile-topbar img {
    width: 126px;
  }

  .app-shell-professional > .mobile-topbar > a:first-child {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .app-shell-professional > .mobile-navigation {
    position: fixed;
    z-index: 50;
    inset: auto 0 0;
    min-height: 68px;
    display: block;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--lg-border);
    background: rgb(255 255 255 / 97%);
    backdrop-filter: blur(12px);
  }

  .app-shell-professional > .mobile-navigation .mobile-navigation-track > a,
  .app-shell-professional > .mobile-navigation .mobile-navigation-track > span:not(.mobile-nav-separator) {
    min-height: 68px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    color: var(--lg-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
  }

  .app-shell-professional > .mobile-navigation .nav-link-current {
    background: #f6eff7;
    box-shadow: inset 0 3px 0 var(--lg-primary);
    color: var(--lg-primary);
  }

  .professional-dashboard-page {
    width: min(100% - 32px, 720px);
    padding: 24px 0 40px;
  }

  .professional-upcoming-item {
    grid-template-columns: minmax(135px, 0.9fr) minmax(112px, 0.7fr) minmax(120px, 1fr) minmax(150px, 1fr) auto;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 48rem) {
  .professional-dashboard-page {
    width: min(100% - 20px, 720px);
    gap: 14px;
    padding-top: 20px;
  }

  .professional-dashboard-header h1 {
    font-size: 1.625rem;
  }

  .professional-announcement,
  .professional-balance,
  .professional-urgent,
  .professional-upcoming {
    padding: 16px;
  }

  .professional-balance {
    align-items: stretch;
    flex-direction: column;
  }

  .professional-balance-actions,
  .professional-balance-actions .button,
  .professional-urgent-actions,
  .professional-urgent-actions .button,
  .professional-urgent-actions form {
    width: 100%;
  }

  .professional-upcoming-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 14px 0;
  }

  .professional-upcoming-status,
  .professional-upcoming-item time,
  .professional-upcoming-place,
  .professional-upcoming-meta {
    grid-column: 1;
  }

  .professional-upcoming-item > svg {
    grid-column: 2;
    grid-row: 1 / span 4;
  }

  .professional-schedule-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .professional-schedule-summary time {
    width: 100%;
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid var(--lg-border);
  }

  .announcements-manager-page {
    width: min(100% - 32px, 980px);
  }

  .announcement-admin-card,
  .announcement-admin-empty {
    align-items: stretch;
    flex-direction: column;
  }

  .announcement-admin-actions,
  .announcement-admin-actions form,
  .announcement-admin-actions .button,
  .announcement-editor-actions,
  .announcement-editor-actions .button {
    width: 100%;
  }

  .announcement-period-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.account-email-update {
    display: grid;
    gap: 18px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
/* Lembretes por organização: seleção nativa, sem depender de JavaScript. */
.organization-reminder-rule { min-width: 0; border: 0; margin: 0; padding: 0; }
.organization-reminder-rule legend { font-weight: 700; margin-bottom: .75rem; }
.organization-reminder-options { display: grid; gap: .6rem; margin-bottom: 1rem; }
.organization-reminder-options label { display: flex; align-items: center; gap: .5rem; }
.organization-reminder-options input[type="radio"] { width: 1rem; height: 1rem; flex: 0 0 auto; }
.organization-reminder-rule .organization-reminder-custom { display: none; }
.organization-reminder-rule:has(input[value="custom"]:checked) .organization-reminder-custom { display: grid; }
.organization-reminder-custom { gap: .5rem; }
.organization-reminder-rows { display: grid; gap: .5rem; }
.organization-reminder-row { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.organization-time-control { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, 1fr); gap: .5rem; min-width: 0; }
.organization-time-control > :is(input, select) { width: 100%; min-width: 0; min-height: 44px; }
.organization-reminder-row > .organization-time-control { flex: 1; }
.organization-reminder-row > .icon-button { flex: 0 0 44px; }
.organization-reminder-add { justify-self: start; }

/* Diálogos de fluxo ocupam a área útil no celular; confirmações têm opt-out. */
@media (max-width: 48rem) {
  .dialog-backdrop:has(> .agenda-dialog:not([data-dialog-size="compact"])) {
    --dialog-gap: 0px;
    --dialog-max-height: var(--app-viewport-height, 100dvh);
    padding: 0;
    place-items: stretch;
  }

  :is(.dialog-backdrop > .agenda-dialog, dialog.agenda-dialog[open], dialog.modframe-dialog[open]):not([data-dialog-size="compact"]):not(.modframe-confirm-dialog):not(:has(> [class~="sm:max-w-sm"])) {
    --dialog-max-height: var(--app-viewport-height, 100dvh);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    height: var(--app-viewport-height, 100dvh);
    max-height: var(--app-viewport-height, 100dvh);
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
  }

  :is(dialog.agenda-dialog[open], dialog.modframe-dialog[open]):not([data-dialog-size="compact"]):not(.modframe-confirm-dialog):not(:has(> [class~="sm:max-w-sm"])) {
    position: fixed;
    inset: var(--app-viewport-top, 0px) 0 auto;
    transform: none;
  }

  .dialog-backdrop > .agenda-dialog:not([data-dialog-size="compact"]) > form,
  dialog.agenda-dialog[open]:not([data-dialog-size="compact"]) > form {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  dialog.modframe-dialog[open]:not(.modframe-confirm-dialog):not(:has(> [class~="sm:max-w-sm"])) > div {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    overflow-y: auto;
  }

  .agenda-dialog:not([data-dialog-size="compact"]) .agenda-dialog-header {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .agenda-dialog:not([data-dialog-size="compact"]) .agenda-dialog-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .agenda-dialog:not([data-dialog-size="compact"]) :is(.agenda-dialog-header, .agenda-dialog-footer) {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  :is(.dialog-backdrop > .agenda-dialog[data-dialog-enter], dialog.agenda-dialog[open], dialog.modframe-dialog[open]):not([data-dialog-size="compact"]):not(.modframe-confirm-dialog):not(:has(> [class~="sm:max-w-sm"])) {
    animation: lugora-dialog-rise 180ms ease-out;
  }

  @media (prefers-reduced-motion: reduce) {
    :is(.dialog-backdrop > .agenda-dialog, dialog.agenda-dialog[open], dialog.modframe-dialog[open]) {
      animation: none;
    }
  }
}

@keyframes lugora-dialog-rise {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Troca de organização no shell, com o mesmo destino no desktop e mobile. */
.app-shell .mobile-topbar { gap: 8px; padding-inline: 12px; }
.app-shell .mobile-topbar > a.mobile-tenant-brand {
  display: flex;
  flex: 0 1 110px;
  min-width: 64px;
}
.app-shell .mobile-topbar > a.mobile-tenant-brand > img { width: 100%; height: auto; max-width: 110px; object-fit: contain; }
.mobile-topbar .mobile-topbar-actions { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
.mobile-topbar-actions > .icon-button,
.mobile-topbar-actions > .node-access-menu { flex-shrink: 0; }
.mobile-topbar-actions .node-access-menu > summary { width: 44px; padding: 0; justify-content: center; }
.mobile-topbar-actions .node-access-menu > summary > span,
.mobile-topbar-actions .node-access-menu > summary > svg:last-child { display: none; }
.mobile-topbar .mobile-organization-switch { flex: 0 1 170px; min-width: 44px; min-height: 44px; gap: 6px; padding: 6px 8px; text-decoration: none; }
.mobile-topbar .mobile-organization-switch > .mobile-organization-logo { position: static; flex: 0 0 24px; width: 24px; height: 24px; opacity: 1; object-fit: contain; }
.mobile-organization-switch > .mobile-organization-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-organization-switch > svg { flex: 0 0 14px; width: 14px; height: 14px; }
.mobile-organization-fallback { display: flex; flex: 0 0 20px; }
.mobile-organization-fallback svg { width: 20px; height: 20px; }
.mobile-organization-switch.has-organization-logo > .mobile-organization-fallback { display: none; }
.mobile-topbar .mobile-organization-switch > [hidden] { display: none; }

/* Agenda: a mesma estrutura/formulário, com apresentação própria no mobile. */
.agenda-mobile-day-content,
.agenda-mobile-legend,
.agenda-mobile-calendar-actions,
.agenda-day-mobile-tools,
.agenda-day-mobile-selection,
.agenda-mobile-only,
.agenda-empty-icon,
.agenda-note-toggle { display: none; }

@media (max-width: 48rem) {
  .agenda-page { width: calc(100% - 24px); padding-top: 12px; }
  .agenda-page-header { display: block; min-height: 0; margin: 0; padding: 0; }
  .agenda-page-header > div:first-child { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .agenda-page-header > a { display: none; }
  .agenda-page .agenda-filters { flex-direction: row; flex-wrap: nowrap; gap: 8px; padding: 8px; margin-bottom: 12px; }
  .agenda-page .agenda-filters > form { min-width: 0; flex: 1; }
  .agenda-page .agenda-filter-field { min-width: 0; }
  .agenda-page .agenda-filter-field select { width: 100%; min-width: 0; }
  .agenda-page .agenda-filter-chip { display: block; min-width: 0; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; padding-inline: 8px; }
  .agenda-page .agenda-filter-chip svg { display: inline; vertical-align: middle; width: 16px; margin-right: 4px; }
  .agenda-page .agenda-room-filters { flex: 1; min-width: 0; }
  .agenda-page .agenda-room-picker { width: 100%; min-width: 0; }
  .agenda-page .agenda-room-picker > summary { min-width: 0; gap: 4px; padding-inline: 8px; font-size: 12px; }
  .agenda-page .agenda-room-picker-panel { width: min(320px, calc(100vw - 40px)); min-width: 0; max-width: calc(100vw - 40px); }
  .agenda-page .agenda-calendar-shell { overflow: visible; padding: 12px; }
  .agenda-page .agenda-calendar-header { min-width: 0; flex-direction: row; align-items: center; gap: 8px; padding: 0 0 12px; border-bottom: 0; }
  .agenda-page .agenda-calendar-header > div:first-child { min-width: 0; }
  .agenda-page .agenda-calendar-header h2 { font-size: 21px; line-height: 1.2; }
  .agenda-page .agenda-calendar-header p { display: none; }
  .agenda-page .agenda-month-actions { flex-wrap: nowrap; flex-shrink: 0; gap: 4px; }
  .agenda-mobile-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--lg-muted); font-size: 11px; margin-bottom: 12px; }
  .agenda-mobile-legend > form { margin-left: auto; }
  .agenda-mobile-legend .button { padding-inline: 6px; font-size: 12px; }
  .agenda-mobile-legend > span { display: inline-flex; align-items: center; gap: 4px; }
  .agenda-mobile-legend i { width: 8px; height: 8px; border-radius: 3px; }
  .agenda-legend-free { background: #d7e9df; }
  .agenda-legend-reserved { background: #d9c5e1; }
  .agenda-legend-hold { background: #edc9d4; }
  .agenda-page :is(.agenda-week-header, .agenda-month-grid) { min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .agenda-page .agenda-month-grid { grid-auto-rows: 62px; }
  .agenda-page .agenda-week-header { border: 0; background: transparent; margin-bottom: 5px; }
  .agenda-page .agenda-week-header span { min-width: 0; text-align: center; padding: 0; font-size: 10px; }
  .agenda-page .agenda-month-grid > .agenda-day { min-width: 0; min-height: 62px; border: 0; border-radius: 7px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--lg-border); }
  .agenda-page .agenda-month-grid > .agenda-day-selected { background: #f4edf5; box-shadow: inset 0 0 0 2px var(--lg-primary); }
  .agenda-page .agenda-day::before { display: none; }
  .agenda-page .agenda-day-has-free { background: #f3faf5; }
  .agenda-page .agenda-month-grid > .agenda-day-outside { padding: 5px 1px; background: transparent; box-shadow: none; }
  .agenda-page .agenda-month-grid > .agenda-day-unused-week { display: none; }
  .agenda-page .agenda-day-outside > .agenda-day-number { justify-content: center; opacity: .6; font-size: 14px; }
  .agenda-page :is(.agenda-day-select, .agenda-day-edit) { position: absolute; inset: 0; min-height: 0; }
  .agenda-page .agenda-day-select { display: none; }
  .agenda-page .agenda-day-edit button,
  .agenda-page .agenda-day-select button { display: flex; flex-direction: row; align-items: flex-start; justify-content: center; width: 100%; height: 100%; min-height: 0; padding: 5px 1px; border: 0; border-radius: 0; background: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-y; }
  .agenda-page .agenda-day-edit button:hover { background: transparent; }
  .agenda-desktop-only,
  .agenda-page .agenda-day-select :is(.agenda-day-number, .agenda-day-counts) { display: none; }
  .agenda-mobile-day-content { display: grid; justify-items: center; align-content: start; gap: 3px; min-width: 0; width: 100%; }
  .agenda-mobile-day-content > strong { font-size: 15px; line-height: 18px; color: var(--lg-ink); }
  .agenda-mobile-free { font-size: 10px; line-height: 12px; color: var(--lg-success); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .agenda-mobile-counts { display: flex; justify-content: center; gap: 3px; min-height: 13px; max-width: 100%; }
  .agenda-mobile-counts > span { min-width: 16px; max-width: 30px; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; border-radius: 4px; font-size: 9px; line-height: 13px; color: var(--lg-primary); background: #eee4f2; }
  .agenda-mobile-counts > .agenda-mobile-hold { background: #f6e3e9; color: #99506b; }
  .agenda-day-today .agenda-mobile-day-content > strong { border-bottom: 2px solid var(--lg-primary); }
  .agenda-select-days .agenda-day-select { display: block; }
  .agenda-select-days .agenda-day-edit { display: none; }
  .agenda-mobile-calendar-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--lg-border); }
  .agenda-mobile-calendar-actions .button { width: auto; min-width: 0; font-size: 12px; padding-inline: 6px; }
  .agenda-page .agenda-selection-bar { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; justify-content: stretch; position: static; min-width: 0; gap: 10px; margin-top: 8px; padding: 12px; border: 1px solid var(--lg-border); border-radius: var(--lg-radius-md); background: var(--lg-paper); box-shadow: none; backdrop-filter: none; }
  .agenda-page .agenda-selection-bar > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .agenda-page .agenda-selection-bar strong { font-size: 13px; }
  .agenda-page .agenda-selection-bar span { font-size: 12px; white-space: nowrap; }
  .agenda-page .agenda-selection-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); min-width: 0; gap: 8px; }
  .agenda-page .agenda-selection-actions .button { width: 100%; min-width: 0; padding-inline: 8px; font-size: 13px; }
  .agenda-day-dialog .agenda-room-tabs,
  .agenda-day-dialog .agenda-day-desktop-actions { display: none; }
  .agenda-day-mobile-tools { display: grid; flex: 0 0 auto; position: relative; z-index: 3; padding: 12px 16px; border-bottom: 1px solid var(--lg-border); gap: 8px; background: var(--lg-surface); }
  .agenda-mobile-room-picker { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; font-size: 13px; }
  .agenda-mobile-room-picker select { width: 100%; min-width: 0; }
  .agenda-day-mobile-toolbar { display: flex; align-items: center; gap: 8px; }
  .agenda-day-mobile-toolbar > .button { flex: 1; min-width: 0; white-space: nowrap; padding-inline: 8px; }
  .agenda-day-mobile-toolbar > [hidden] { display: none; }
  .agenda-day-more { position: relative; flex: 0 0 44px; }
  .agenda-day-more > summary { list-style: none; }
  .agenda-day-more-menu { display: grid; position: absolute; top: 48px; right: 0; width: 210px; padding: 4px; z-index: 5; border: 1px solid var(--lg-border); border-radius: var(--lg-radius-md); background: var(--lg-surface); box-shadow: var(--lg-shadow-md); }
  .agenda-day-more-menu button { text-align: left; border: 0; background: transparent; color: var(--lg-primary); padding: 10px; min-height: 44px; border-radius: var(--lg-radius-sm); }
  .agenda-day-more-menu button:disabled { color: var(--lg-muted); }
  .agenda-day-dialog .agenda-day-table tbody { display: grid; gap: 10px; }
  .agenda-day-dialog .agenda-day-table tr:not(:has(> td[colspan])) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; margin: 0; padding: 12px; }
  .agenda-day-dialog .agenda-day-table td { display: block; min-width: 0; min-height: 0; padding: 0; }
  .agenda-day-dialog .agenda-day-table td::before { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 400; text-transform: none; }
  .agenda-day-dialog .agenda-day-table td:first-child:not([colspan]) { display: none; grid-column: 1 / -1; }
  .agenda-day-dialog.agenda-select-rows .agenda-day-table tr:not(.agenda-row-protected) > td:first-child:not([colspan]) { display: block; }
  .agenda-day-dialog .agenda-day-table .agenda-day-empty { margin: 0; padding: 28px 12px; border: 0; background: transparent; }
  .agenda-day-empty .page-state { display: grid; justify-items: center; gap: 12px; padding: 0; min-height: 0; border: 0; background: transparent; box-shadow: none; color: var(--lg-muted); }
  .agenda-day-empty .page-state p { margin: 0; font-size: 14px; }
  .agenda-empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: var(--lg-primary); background: #f1e8f3; }
  .agenda-empty-icon svg { width: 24px; height: 24px; }
  .agenda-day-table td:first-child::before { display: none; }
  .agenda-day-table .agenda-slot-selection { display: flex; gap: 8px; align-items: center; min-height: 44px; font-size: 12px; color: var(--lg-primary); }
  .agenda-slot-selection .agenda-mobile-only { display: inline; }
  .agenda-day-dialog .agenda-day-table td:nth-child(n+6) { grid-column: 1 / -1; }
  .agenda-day-dialog .agenda-day-table td:nth-child(n+6)::before { display: none; }
  .agenda-day-dialog .agenda-day-table td.agenda-day-no-actions { display: none; }
  .agenda-day-dialog .agenda-day-table :is(input:not([type="checkbox"]), select) { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
  .agenda-day-dialog .agenda-day-note:not(.agenda-note-open) > input { display: none; }
  .agenda-day-dialog .agenda-note-toggle { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--lg-primary); font-size: 12px; text-align: left; }
  .agenda-note-toggle svg { width: 16px; height: 16px; transition: transform .15s; }
  .agenda-note-open .agenda-note-toggle svg { transform: rotate(180deg); }
  .agenda-day-dialog .agenda-day-table td[data-label="Ações"] .button { width: 100%; min-height: 44px; }
  .agenda-day-dialog .agenda-row-protected { background: var(--lg-paper); }
  .agenda-day-dialog .agenda-row-protected td[data-label="Observação"]::before { display: block; }
  .agenda-day-dialog .agenda-row-protected-confirmed .badge { color: var(--lg-primary); background: #eee4f2; }
  .agenda-day-dialog .agenda-row-protected-hold .badge { color: #99506b; background: #f6e3e9; }
  .agenda-day-dialog .agenda-row-protected small { color: var(--lg-muted); font-size: 12px; margin-top: 4px; }
  .agenda-day-mobile-selection { display: none; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; font-size: 12px; color: var(--lg-primary); background: #f1e8f3; }
  .agenda-select-rows .agenda-day-mobile-selection { display: flex; }
  .agenda-day-mobile-selection > div { display: flex; gap: 6px; }
  .agenda-day-dialog .agenda-dialog-footer { grid-template-columns: auto minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .agenda-page { width: calc(100% - 16px); }
  .agenda-page .agenda-calendar-shell { padding-inline: 6px; }
  .agenda-page :is(.agenda-week-header, .agenda-month-grid) { column-gap: 0; margin-inline: -10px; }
  .agenda-page .agenda-calendar-header h2 { font-size: 19px; }
  .agenda-day-mobile-tools { padding-inline: 12px; }
}

/* Equipe e acessos: tabela no desktop, cartões no mobile. */
.team-page{max-width:1180px}.team-tabs{display:flex;gap:8px;border-bottom:1px solid var(--lg-border);margin:20px 0}.team-tabs a{padding:12px 18px;min-height:44px;border-bottom:3px solid transparent;text-decoration:none;color:var(--lg-muted);font-weight:600}.team-tabs a.active{color:var(--lg-primary);border-color:var(--lg-primary)}.team-filters{display:grid;grid-template-columns:minmax(0,1fr) 210px auto;align-items:end;gap:16px;padding:16px;margin-bottom:16px}.team-filters .field{min-width:0}.team-table-wrap{overflow:hidden}.team-table{width:100%;border-collapse:collapse;font-size:14px}.team-table th{text-align:left;background:var(--lg-paper);color:var(--lg-muted);text-transform:uppercase;font-size:11px;padding:12px 16px}.team-table td{border-top:1px solid var(--lg-border);padding:16px;vertical-align:middle}.team-table td:last-child{text-align:right}.team-table td:last-child form{display:inline-block}.team-person{display:flex;align-items:center;gap:10px;min-width:0}.team-person .avatar{flex:0 0 36px;width:36px;height:36px;background:#eee5f0;color:var(--lg-primary)}.team-person strong,.team-person small{display:block}.team-person small{font-size:12px;color:var(--lg-muted);margin-top:4px;overflow-wrap:anywhere}.team-chips{display:flex;flex-wrap:wrap;gap:5px}.team-role-chip{display:inline-flex;border:1px solid #d8c8df;border-radius:6px;padding:3px 7px;font-size:11px;color:var(--lg-primary);background:#faf7fb}.team-areas{font-size:12px;color:var(--lg-muted);max-width:250px;line-height:1.6}.team-pagination{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.team-role-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.team-role-card{padding:22px}.team-role-card>svg{width:28px;height:28px;color:var(--lg-primary);margin-bottom:12px}.team-role-card h2{font-size:20px}.team-role-card p{color:var(--lg-muted);font-size:14px}.team-access-dialog{width:min(680px,calc(100% - 48px))}.team-access-dialog fieldset{border:0;padding:0;margin:0 0 20px;min-width:0}.team-access-dialog legend{font-size:14px;font-weight:700;margin-bottom:10px}.team-access-dialog .field{display:grid;gap:6px;margin-bottom:14px}.team-management-choice{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.team-management-choice label{display:flex;align-items:center;gap:7px;min-height:44px;padding:10px 8px;border:1px solid var(--lg-border);border-radius:8px;font-size:13px}.team-management-choice label:has(:checked){border-color:var(--lg-primary);background:#f5edf7}.team-area-options,.team-extra{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}.team-check{display:flex;align-items:center;gap:10px;padding:10px 12px;min-height:52px;border:1px solid var(--lg-border);border-radius:8px;font-size:13px}.team-check input{flex:0 0 18px;width:18px;height:18px;accent-color:var(--lg-primary)}.team-check strong{font-weight:600}.team-check small{display:block;font-size:12px;color:var(--lg-muted);margin-top:3px}.team-check:has(:checked){background:#fbf8fc;border-color:#cbb5d3}.team-check:has(:disabled){opacity:.65}.team-access-dialog .agenda-dialog-footer{display:flex;justify-content:flex-end;gap:8px}
@media(max-width:48rem){.team-page{width:calc(100% - 24px)}.team-page .page-header{gap:12px}.team-page h1{font-size:26px}.team-tabs a{flex:1;text-align:center}.team-filters{grid-template-columns:1fr;padding:12px;gap:12px}.team-filters .button{width:100%}.team-table,.team-table tbody{display:block}.team-table thead{display:none}.team-table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 8px;padding:16px 12px;border-top:1px solid var(--lg-border)}.team-table tr:first-child{border-top:0}.team-table td{display:block;padding:0;border:0;min-width:0}.team-table td:nth-child(1){grid-column:1;grid-row:1}.team-table td:nth-child(2){grid-column:1/-1;grid-row:2;padding-left:46px}.team-table td:nth-child(3){grid-column:1;grid-row:3;padding-left:46px}.team-table td:nth-child(4){grid-column:2;grid-row:1;align-self:start}.team-table td:nth-child(5){grid-column:2;grid-row:3;align-self:end}.team-table .badge{font-size:10px}.team-table .button{min-height:44px;padding-inline:8px;font-size:12px}.team-role-grid{grid-template-columns:1fr}.team-management-choice,.team-area-options,.team-extra{grid-template-columns:1fr}.team-access-dialog .agenda-dialog-header,.team-access-dialog .agenda-dialog-body{padding-inline:16px}.team-access-dialog .agenda-dialog-footer{display:grid;grid-template-columns:auto minmax(0,1fr);padding:12px 16px}.team-access-dialog input:not([type=checkbox]):not([type=radio]){font-size:16px;min-width:0}}

/* Component rules must preserve conditional field visibility. */
.team-access-dialog [hidden]{display:none!important}

.team-access-dialog .agenda-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px;
}
.team-access-dialog .agenda-dialog-body > fieldset,
.team-access-dialog .agenda-dialog-body > .field,
.team-access-dialog .agenda-dialog-body > p {
  margin: 0;
}
.team-access-dialog legend { margin-bottom: 12px; }
.team-access-dialog .team-extra { margin-top: 0; }
.team-access-dialog .team-editor-contact { overflow-wrap: anywhere; }
.team-management-choice input { accent-color: var(--lg-primary); }
.team-check > span { min-width: 0; }
.team-role-details {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--lg-muted);
  font-size: 14px;
  line-height: 1.6;
}
.team-role-details strong { color: var(--lg-ink); font-weight: 600; }
@media (max-width: 48rem) {
  .team-access-dialog .agenda-dialog-body { padding: 20px 16px; gap: 20px; }
  .team-access-dialog .agenda-dialog-footer .button { min-height: 44px; }
}

.team-editor-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--lg-paper);
  border: 1px solid var(--lg-border);
  border-radius: 10px;
}
.team-editor-person .avatar { width: 40px; height: 40px; flex: 0 0 40px; background: #eee5f0; color: var(--lg-primary); }
.team-editor-person > div { min-width: 0; }
.team-editor-person strong, .team-editor-person small { display: block; overflow-wrap: anywhere; }
.team-editor-person small { margin-top: 3px; color: var(--lg-muted); font-size: 13px; }
.team-role-picker { display: grid; gap: 8px; }
.team-role-picker select { min-height: 48px; font-size: 16px; font-weight: 600; }
.team-role-summary { margin: 0; color: var(--lg-muted); font-size: 13px; line-height: 1.5; }
.team-operator-options { display: grid; gap: 20px; }
.team-access-dialog .team-operator-options fieldset { margin: 0; }
.team-invite-identity { display: grid; gap: 14px; }
.team-access-dialog .team-invite-identity .field { margin: 0; }
.team-access-dialog .team-area-options { margin-top: 0; }
.team-access-dialog .team-professional-removal { display: flex; align-items: flex-start; gap: 10px; padding: 12px; margin: 0; font-size: 13px; line-height: 1.5; }
.team-professional-removal > svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.team-matrix { overflow: hidden; }
.team-matrix table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.team-matrix th, .team-matrix td { padding: 14px 12px; border-bottom: 1px solid var(--lg-border); text-align: center; vertical-align: middle; }
.team-matrix th:first-child { width: 36%; text-align: left; }
.team-matrix thead th { background: var(--lg-paper); font-size: 13px; font-weight: 700; }
.team-matrix tbody th { font-weight: 500; }
.team-matrix tbody tr:last-child > * { border-bottom: 0; }
.team-matrix tbody tr:hover { background: #fbf8fc; }
.team-matrix-value { display: grid; grid-template: 18px / 18px; place-content: center; }
.team-matrix-value input { grid-area: 1 / 1; width: 18px; height: 18px; margin: 0; opacity: 1; accent-color: var(--lg-primary); }

.team-role-short { display: none; }
.team-matrix-legend { color: var(--lg-muted); margin: 12px 0 0; font-size: 12px; line-height: 1.5; }
@media (max-width: 48rem) {
  .team-matrix table { font-size: 12px; }
  .team-matrix th, .team-matrix td { padding: 12px 4px; }
  .team-matrix th:first-child { padding-left: 10px; width: 36%; }
  .team-matrix thead th { font-size: 11px; }
  .team-role-name { display: none; }
  .team-role-short { display: inline; text-decoration: none; }
  .team-matrix-value { grid-template: 16px / 16px; }
  .team-matrix-value input { width: 16px; height: 16px; }

  .team-editor-person { padding: 12px; gap: 10px; }
}

.team-matrix-value input:disabled {
  appearance: none;
  display: inline-grid;
  place-items: center;
  opacity: 1;
  border: 1px solid #a48ba9;
  border-radius: 4px;
  background: var(--lg-surface);
}
.team-matrix-value input:checked,
.team-matrix-value input:indeterminate { background: var(--lg-primary); border-color: var(--lg-primary); }
.team-matrix-value input:checked::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
.team-matrix-value input:indeterminate::after { content: none; }

.team-access-dialog .team-role-picker .field { margin: 0; }

/* A barra vertical pode reduzir a área útil abaixo dos 320 px do viewport. */
html:has(.team-component) { min-width: 0; }

@media (min-width: 22.5rem) and (max-width: 48rem) {
  .team-operator-options .team-area-options,
  .team-operator-options .team-extra { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.team-matrix-value input[data-role-optional]:disabled { background: var(--lg-primary); border-color: var(--lg-primary); }
.team-matrix-value .team-matrix-asterisk {
  grid-area: 1 / 1;
  place-self: center;
  color: white;
  font: 700 20px/1 Arial, sans-serif;
  transform: translateY(3px);
  pointer-events: none;
}
.team-matrix .team-matrix-group th {
  width: auto;
  padding: 10px 12px;
  background: var(--lg-surface-plum);
  color: var(--lg-primary);
  border-top: 1px solid var(--lg-border);
  border-bottom: 1px solid var(--lg-border);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}
@media (max-width: 48rem) {
  .team-matrix .team-matrix-group th { padding: 9px 10px; font-size: 11px; }
  .team-matrix-value .team-matrix-asterisk { font-size: 18px; }
}

.room-photo-section { min-width: 0; border-block: 1px solid var(--lg-border); padding-block: 20px; }
.room-photo-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.room-photo-heading h2 { margin: 0; font-size: 18px; }
.room-photo-heading .button:focus-within { outline: 3px solid var(--lg-focus); outline-offset: 2px; }
.room-photo-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.room-photo-card { min-width: 0; overflow: hidden; border: 1px solid var(--lg-border); border-radius: 10px; background: var(--lg-surface); }
.room-photo-card > img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.room-photo-card:has([name="cover_photo"]:checked) { border-color: var(--lg-primary); box-shadow: 0 0 0 1px var(--lg-primary); }
.room-photo-card:has([data-room-photo-remove]:checked) > img { opacity: .3; }
.room-photo-actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; }
.room-photo-actions > label, .room-photo-actions > button { flex: 1 1 68px; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; margin: 0; padding: 4px; font-size: 12px; }
.room-photo-actions input { accent-color: var(--lg-primary); margin: 0; }
.room-photo-actions label { cursor: pointer; border-radius: 6px; }
.room-photo-actions label:hover { background: var(--lg-paper); }
.room-photo-actions label:has(:focus-visible) { outline: 2px solid var(--lg-focus); }
.room-photo-empty { padding: 16px 0 0; margin: 0; font-size: 14px; }
[data-room-photo-error][hidden], [data-room-photo-empty][hidden] { display: none !important; }
.room-name-with-photo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.room-name-with-photo > div { min-width: 0; }
.room-cover-thumb { width: 64px; height: 52px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.room-description-summary { margin: 5px 0 0; color: var(--lg-muted); font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 48rem) {
  .room-photo-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .room-cover-thumb { width: 48px; height: 48px; }
}

html:has(.facilities-component) { min-width: 0; }
.facilities-component .field-label-row { flex-wrap: wrap; gap: 8px; }
@media (max-width: 48rem) {
  .facilities-component:has([data-room-editor]) .page-header { display: flex; flex-direction: row; align-items: flex-start; gap: 12px; }
  .facilities-component:has([data-room-editor]) .page-header > div { min-width: 0; flex: 1; }
  .facilities-component:has([data-room-editor]) .page-header > .button { width: auto; flex-shrink: 0; padding-inline: 8px; }
}

/* Panorama: a data pertence ao grupo, não à primeira reserva. */
html:has(.overview-component) { min-width: 0; }
.overview-page { max-width: 1180px; }
.overview-filter { margin-bottom: 20px; overflow: hidden; }
.overview-filter > summary { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 12px 20px; cursor: pointer; list-style: none; }
.overview-filter > summary::-webkit-details-marker { display: none; }
.overview-filter > summary > svg { width: 18px; height: 18px; flex-shrink: 0; }
.overview-filter > summary > svg:last-child { margin-left: auto; transition: transform .15s; }
.overview-filter[open] > summary > svg:last-child { transform: rotate(90deg); }
.overview-filter > summary:focus-visible { outline: 2px solid var(--lg-focus); outline-offset: -3px; border-radius: inherit; }
.overview-count { display: inline-flex; align-items: center; justify-content: center; min-width: 25px; padding: 3px 7px; background: var(--lg-surface-plum); color: var(--lg-primary); border-radius: 20px; font-size: 12px; font-weight: 700; line-height: 1.3; }
.overview-filter-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--lg-muted); font-size: 13px; }
.overview-filter-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 16px; border-top: 1px solid var(--lg-border); padding: 20px; }
.overview-filter-form .field { min-width: 0; margin: 0; }
.overview-filter-form .field > :is(input, select) { min-width: 0; width: 100%; }
.overview-period { grid-column: span 2; min-width: 0; margin: 0; padding: 0; border: 0; }
.overview-period legend { margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.overview-period > div { display: flex; align-items: center; gap: 10px; }
.overview-period .field { flex: 1; }
.overview-period > div > span { color: var(--lg-muted); font-size: 13px; }
.overview-filter-actions, .overview-errors { grid-column: 1 / -1; }
.overview-filter-actions { display: flex; align-items: center; gap: 8px; }
.overview-filter-actions .button { width: auto; white-space: nowrap; }
.overview-errors .field-error { margin: 0 0 6px; }
.overview-results { padding: 24px; }
.overview-results-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.overview-results-heading .eyebrow { margin: 0 0 6px; }
.overview-title { display: flex; align-items: center; gap: 10px; }
.overview-title h2 { margin: 0; font-size: 22px; }
.overview-search { position: relative; flex: 0 1 280px; min-width: 0; margin: 0; }
.overview-search > svg { position: absolute; top: 50%; left: 12px; width: 18px; height: 18px; transform: translateY(-50%); pointer-events: none; color: var(--lg-muted); }
.overview-search input { width: 100%; min-width: 0; padding-left: 38px; }
.overview-list { min-width: 0; }
.overview-group-title { font-size: 18px; margin: 26px 0 14px; overflow-wrap: anywhere; }
.overview-group-title:first-child { margin-top: 0; }
.overview-day { --overview-tone: #92739c; --overview-tone-soft: #f3edf5; border-left: 3px solid var(--overview-tone); padding-left: 18px; margin-bottom: 26px; }
.overview-day-tone-1 { --overview-tone: #c1916d; --overview-tone-soft: #faf0e8; }
.overview-day:last-child { margin-bottom: 0; }
.overview-day-anchor { display: flex; align-items: center; gap: 14px; margin-bottom: 2px; }
.overview-calendar-mark { display: flex; flex: 0 0 54px; flex-direction: column; justify-content: center; align-items: center; height: 62px; border-radius: 10px; background: var(--overview-tone-soft); color: var(--lg-deep); }
.overview-calendar-mark span { font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.overview-calendar-mark strong { font-size: 29px; line-height: 1.1; }
.overview-day-anchor h3 { margin: 0 0 5px; font-size: 18px; line-height: 1.2; }
.overview-day-anchor time { color: var(--lg-muted); font-size: 12px; }
.overview-day-rule { height: 1px; flex: 1; min-width: 12px; background: var(--lg-border); }
.overview-reservation { display: grid; grid-template-columns: 110px minmax(220px, 2fr) minmax(100px, 1fr) 96px 126px; grid-template-rows: 12px auto auto; align-items: start; gap: 6px 16px; padding: 16px 0; border-bottom: 1px solid var(--lg-border); }
.overview-reservation:last-child { border-bottom: 0; }
/* Rótulo, informação principal e complemento compartilham as mesmas faixas. */
.overview-time, .overview-people, .overview-professional, .overview-contact, .overview-place, .overview-status-column { grid-row: 1 / -1; display: grid; grid-template-rows: 12px auto auto; grid-template-rows: subgrid; row-gap: 6px; align-items: start; }
.overview-time { grid-column: 1; font-variant-numeric: tabular-nums; }
.overview-time > strong { grid-row: 2; font-size: 16px; line-height: 20px; white-space: nowrap; }
.overview-next-label { grid-row: 3; color: var(--lg-primary); font-size: 10px; line-height: 16px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.overview-next { background: #faf7fb; border-radius: 8px; padding-inline: 10px; margin-inline: -10px; }
.overview-people { grid-column: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; column-gap: 14px; }
.overview-people:not(:has(.overview-contact)) { grid-template-columns: minmax(0, 1fr); }
.overview-professional, .overview-contact, .overview-place { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.overview-professional > small, .overview-contact > small { grid-row: 3; color: var(--lg-muted); font-size: 12px; line-height: 16px; font-weight: 400; }
.overview-person-name { grid-row: 2; display: flex; align-items: flex-start; gap: 5px; line-height: 20px; }
.overview-person-name > svg { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; color: var(--lg-primary); }
.overview-person-name > strong { min-width: 0; }
.overview-contact > strong, .overview-place > strong { grid-row: 2; line-height: 20px; }
.overview-place { grid-column: 3; }
.overview-place small { grid-row: 3; color: var(--lg-muted); font-size: 12px; line-height: 16px; }
.overview-actions { display: contents; }
.overview-status-column { grid-column: 4; width: 96px; }
.overview-status-column > .overview-status { grid-row: 2; justify-self: start; align-self: start; min-height: 20px; }
.overview-actions > form { grid-column: 5; grid-row: 2 / -1; align-self: start; margin: 0; }
.overview-actions .button { width: 126px; }
.overview-reservation .overview-column-label { grid-row: 1; color: var(--lg-muted); font-size: 10px; line-height: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.overview-actions .button { min-height: 44px; white-space: nowrap; padding-inline: 12px; font-size: 13px; }
.overview-status { white-space: nowrap; font-size: 11px; }
.overview-status-confirmed { color: var(--lg-success); background: var(--lg-success-soft); }
.overview-status-hold { color: var(--lg-primary); background: var(--lg-surface-plum); }
.overview-status-cancelled { color: var(--lg-danger); background: var(--lg-danger-soft); }
.overview-status-expired, .overview-status-unknown { color: var(--lg-muted); background: var(--lg-surface-muted); }
.overview-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--lg-border); padding-top: 16px; margin-top: 22px; color: var(--lg-muted); font-size: 13px; }
.overview-pagination > div { display: flex; align-items: center; gap: 10px; }
.overview-pagination form { margin: 0; }
.overview-detail-dialog { width: min(570px, 100%); }
.overview-detail-dialog .overview-detail-body { padding: 20px; }
.overview-detail-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.overview-detail-summary > div { display: flex; flex-direction: column; gap: 6px; }
.overview-detail-summary > div > strong { font-size: 20px; }
.overview-detail-summary > div > span { color: var(--lg-muted); }
.overview-detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0; }
.overview-detail-fields > div { min-width: 0; }
.overview-detail-fields dt { color: var(--lg-muted); font-size: 12px; margin-bottom: 5px; }
.overview-detail-fields dd { margin: 0; font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.overview-detail-section { border-top: 1px solid var(--lg-border); margin-top: 22px; padding-top: 18px; overflow-wrap: anywhere; }
.overview-detail-section h3 { font-size: 15px; margin: 0 0 12px; }
.overview-detail-section p { margin: 8px 0 0; font-size: 14px; }
.overview-detail-contact { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; font-size: 14px; }
.overview-detail-contact > span { color: var(--lg-muted); }
@media (max-width: 70rem) {
  .overview-reservation { grid-template-columns: 110px minmax(0, 1fr) 126px; grid-template-rows: 12px auto auto 12px auto auto; }
  .overview-place { grid-column: 2; grid-row: 4 / 7; grid-template-rows: subgrid; }
  .overview-time { grid-column: 1; grid-row: 1 / 4; }
  .overview-people { grid-column: 2; grid-row: 1 / 4; }
  .overview-status-column { grid-column: 3; grid-row: 1 / 4; justify-self: end; }
  .overview-actions > form { grid-column: 3; grid-row: 5 / 7; }
}
@media (max-width: 48rem) {
  .overview-page .page-header { margin-bottom: 18px; }
  .overview-page .page-header h1 { font-size: 26px; }
  .overview-filter { margin-bottom: 16px; }
  .overview-filter > summary { padding: 12px 14px; gap: 8px; }
  .overview-filter-summary { font-size: 12px; }
  .overview-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px 14px; }
  .overview-period { grid-column: 1 / -1; }
  .overview-period > div { gap: 6px; }
  .overview-period input { padding-inline: 8px; }
  .overview-filter-actions { gap: 4px; }
  .overview-filter-actions .button:first-child { flex: 1; }
  .overview-results { padding: 18px 14px; }
  .overview-results-heading { flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 22px; }
  .overview-title h2 { font-size: 21px; }
  .overview-search { flex: auto; }
  .overview-day { padding-left: 10px; margin-bottom: 24px; }
  .overview-day-anchor { gap: 10px; }
  .overview-day-anchor h3 { font-size: 18px; }
  .overview-reservation { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto auto; gap: 12px; padding: 16px 0; }
  .overview-reservation.overview-next { padding-inline: 10px; }
  .overview-time { grid-column: 1; grid-row: 1; grid-template-rows: 12px 20px auto; row-gap: 4px; align-self: start; }
  .overview-time > strong { font-size: 16px; }
  .overview-people { grid-column: 1 / -1; grid-row: 2; grid-template-rows: 12px auto auto; column-gap: 12px; }
  .overview-place { grid-column: 1; grid-row: 3; grid-template-rows: 12px auto auto; }
  .overview-status-column { grid-column: 2; grid-row: 1; grid-template-rows: 12px 20px auto; row-gap: 4px; width: auto; justify-self: start; }
  .overview-actions > form { grid-column: 2; grid-row: 3; align-self: start; justify-self: stretch; margin-top: 18px; }
  .overview-actions .button { width: 100%; padding-inline: 8px; font-size: 12px; gap: 5px; }
  .overview-actions .button > svg { width: 16px; height: 16px; }
  .overview-detail-dialog .overview-detail-body { padding: 18px 16px; }
  .overview-detail-dialog .agenda-dialog-footer { flex-direction: row; }
  .overview-detail-dialog .agenda-dialog-footer .button { width: auto; }
}
@media (max-width: 22.5rem) {
  .overview-period > div { flex-direction: column; align-items: stretch; gap: 6px; }
  .overview-period .field { flex: auto; }
  .overview-filter-form > .field:last-of-type { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .overview-filter > summary > svg:last-child { transition: none; }
}

/* Confirmação de presença: separada do estado operacional da reserva. */
.booking-confirmation-choice{display:flex;align-items:center;gap:10px;min-height:44px;font-size:.875rem;line-height:1.4;padding:6px 0;cursor:pointer}.booking-confirmation-choice input{flex:none;width:20px;height:20px;accent-color:var(--color-primary,#624667)}.booking-contact-confirmation{display:flex;align-items:center;gap:5px;color:#624667;line-height:1.4}.booking-contact-confirmation svg{width:15px;height:15px;flex:none}.booking-presence-detail{display:grid;gap:8px;padding-top:16px;border-top:1px solid var(--color-border,#dfd3da)}.booking-presence-detail h3,.booking-presence-detail p{margin:0}.booking-presence-detail small{color:#746b72}.booking-presence-detail p{overflow-wrap:anywhere}

.booking-contact-confirmation[data-confirmation-status="confirmed"]{color:#2f7252}.booking-contact-confirmation[data-confirmation-status="declined"]{color:#9a641c}

/* Presença do contato: mesmo indicador, compacto e separado da reserva. */
.booking-presence{display:inline-flex;align-items:center;justify-self:start;gap:5px;max-width:100%;width:fit-content;padding:3px 7px;border-radius:6px;background:#f2efed;color:#746b72;font-size:11px;font-weight:500;line-height:1.35;vertical-align:middle;overflow-wrap:anywhere}
.booking-presence>svg{width:13px!important;height:13px!important;flex:none;color:inherit!important}.booking-presence>span{min-width:0}
.booking-presence[data-presence-status="confirmed"]{background:#e8f4ed;color:#2f7252}.booking-presence[data-presence-status="declined"],.booking-presence[data-presence-status="unavailable"],.booking-presence[data-presence-status="invalidated"]{background:#fff3de;color:#8c5c13}.booking-presence[data-presence-status="pending"],.booking-presence[data-presence-status="scheduled"],.booking-presence[data-presence-status="after_booking"]{background:#f1eaf4;color:#624667}
.booking-status-stack{display:grid;justify-items:start;align-content:start;gap:7px;min-width:0}.professional-upcoming-status>.booking-presence{grid-column:1/-1}.professional-upcoming-status{align-content:start;row-gap:6px}.overview-status-column>.booking-presence{grid-row:3;align-self:start}.professional-table td>.booking-presence{display:flex;margin-top:6px}.agenda-row-protected .booking-presence{margin-top:6px}.booking-success-list li>.booking-presence{align-self:start}.booking-upcoming-place>.booking-presence{margin-top:3px}
.booking-confirmation-control{display:grid;gap:0;margin:4px 0}.booking-confirmation-choice:has(input:disabled){cursor:default;color:#746b72}.booking-confirmation-info{display:flex;align-items:flex-start;gap:6px;margin:0 0 8px;padding:0 0 0 30px;color:#8c5c13;font-size:12px;line-height:1.4}.booking-confirmation-info[hidden]{display:none}.booking-confirmation-info>svg{width:14px;height:14px;flex:none;margin-top:1px}.booking-confirmation-info span{min-width:0;overflow-wrap:anywhere}

/* Reserva e confirmação do contato têm rótulos próprios, em todos os tamanhos. */
.overview-reservation { grid-template-columns: 110px minmax(220px, 2fr) minmax(100px, 1fr) 148px 126px; }
.overview-status-column { width: 148px; grid-template-rows: auto auto; align-content: start; gap: 10px; }
.overview-status-group { display: grid; justify-items: start; align-content: start; gap: 4px; min-width: 0; }
.overview-status-group > .overview-column-label { grid-row: auto; }
.overview-detail-statuses { display: grid; gap: 12px; flex: 0 1 164px; min-width: 0; }
.overview-detail-statuses .overview-column-label { color: var(--lg-muted); font-size: 10px; line-height: 1.35; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }

/* Revisão: resumo ao lado do contato no desktop; campos inteiros no mobile. */
.booking-review-dialog { width: min(880px, 100%); }
.booking-review-dialog .booking-review-item { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 1.8fr); align-items: start; gap: 24px; min-width: 0; }
.booking-review-dialog .booking-review-summary { min-width: 0; gap: 12px; }
.booking-review-dialog .booking-review-summary > div { gap: 5px; }
.booking-review-dialog .booking-review-contact { min-width: 0; }
.booking-review-dialog .booking-contact-picker { margin: 0; }
.booking-review-dialog .booking-confirmation-control { margin: 6px 0 0; }
.booking-review-dialog .booking-confirmation-info { margin-bottom: 0; }
.booking-review-dialog .booking-review-item + .booking-review-item { margin-top: 18px; padding-top: 18px; }
.booking-review-dialog .booking-review-footer { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.booking-review-dialog .booking-review-actions { grid-template-columns: repeat(2, minmax(124px, 1fr)); }
.booking-review-dialog .booking-review-total { min-width: 0; }
@media (max-width: 70rem) {
  .overview-reservation { grid-template-columns: 110px minmax(0, 1fr) 148px; }
}
@media (max-width: 48rem) {
  .overview-reservation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-status-column { width: auto; max-width: 100%; grid-template-rows: auto auto; gap: 10px; }
}
@media (max-width: 40rem) {
  .booking-review-dialog .booking-review-item { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .booking-review-dialog .booking-review-summary { gap: 12px; }
  .booking-review-dialog .booking-review-footer { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .booking-review-dialog .booking-review-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
  .booking-review-dialog .booking-review-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; }
  .booking-review-dialog .booking-review-summary > div { display: contents; }
  .booking-review-dialog .booking-review-summary > div > strong { grid-column: 1; grid-row: 1; }
  .booking-review-dialog .booking-review-summary > strong { grid-column: 2; grid-row: 1; justify-self: end; }
  .booking-review-dialog .booking-review-summary > div > span { grid-column: 1; grid-row: 2; }
  .booking-review-dialog .booking-review-expiry { grid-column: 2; grid-row: 2; text-align: right; }
}
@media (min-width: 70.001rem) {
  .overview-reservation { grid-template-rows: 12px min-content auto; }
}
