html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: Roboto, sans-serif;
  background-color: var(--mdc-theme-background, #f5f5f5);
  color: var(--mdc-theme-on-surface, #1a1a1a);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  box-sizing: border-box;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.spacer {
  flex: 1 1 auto;
}

  .account-menu.svelte-1mzjx0 {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--mdc-theme-on-primary, #fff);
  }

  .menu-user.svelte-1mzjx0 {
    display: flex;
    flex-direction: column;
    padding: 8px 16px 10px;
    list-style: none;
  }

  .menu-user__name.svelte-1mzjx0 {
    font-size: 14px;
    font-weight: 500;
  }

  .menu-user__email.svelte-1mzjx0 {
    font-size: 12px;
    color: var(--s4q-text-secondary);
  }

  .menu-label.svelte-1mzjx0 {
    padding: 8px 16px 2px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--s4q-text-secondary);
    list-style: none;
  }

  .menu-check.svelte-1mzjx0 {
    margin-left: auto;
    padding-left: 16px;
    font-size: 18px;
    opacity: 0.7;
  }

  /* MDC reserves 32px between icon and label - room for two-line items this menu
     does not have. The rows are single-line, so they may sit closer together. */
  .account-menu.svelte-1mzjx0 .mdc-deprecated-list-item__graphic {
    margin-right: 16px;
  }

  /* MDC paints the selected row in the primary color. On the dark surface the
     brand red lands at about 2:1 contrast, which would make the active entry the
     hardest one to read. Its tinted background and the check mark say what is
     selected; the label stays plain text. */
  .account-menu.svelte-1mzjx0 .mdc-deprecated-list-item--selected {
    color: var(--mdc-theme-on-surface, #000);
  }

  .org-switcher.svelte-wcx78p {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--mdc-theme-on-primary, #fff);
  }

  .org-trigger.svelte-wcx78p {
    display: flex;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    padding: 4px 6px 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    max-width: 320px;
  }

  .org-trigger.svelte-wcx78p:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  /* Name over role, right-aligned towards the profile icon. min-width lets the
     name ellipsis do its job instead of pushing the caret out of the bar. */
  .org-trigger__labels.svelte-wcx78p {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
  }

  .org-trigger__name.svelte-wcx78p {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .org-trigger__role.svelte-wcx78p {
    font-size: 11px;
    line-height: 1.2;
    opacity: 0.8;
    white-space: nowrap;
  }

  .org-trigger__caret.svelte-wcx78p {
    flex: none;
    font-size: 20px;
  }

  .menu-check.svelte-wcx78p {
    margin-left: auto;
    padding-left: 16px;
    font-size: 18px;
    opacity: 0.7;
  }

  /* See AccountMenu: MDC's 32px between icon and label is meant for two-line items. */
  .org-switcher.svelte-wcx78p .mdc-deprecated-list-item__graphic {
    margin-right: 16px;
  }

  /* See AccountMenu: the active row keeps the normal text color, the brand red
     is unreadable on the dark surface. Tint and check mark mark it instead. */
  .org-switcher.svelte-wcx78p .mdc-deprecated-list-item--selected {
    color: var(--mdc-theme-on-surface, #000);
  }

  /* Narrow screens: the organization name must not crowd out the app title. It
     shortens, the role stays - it is one line either way. */
  @media (max-width: 700px) {
    .org-trigger.svelte-wcx78p {
      max-width: 42vw;
      padding: 4px 2px 4px 4px;
    }
  }

  .app-title {
    margin-right: 24px !important;
  }

  .app-nav.svelte-whg6dh {
    display: flex;
    gap: 4px;
  }

  .app-nav.svelte-whg6dh a:where(.svelte-whg6dh) {
    display: flex;
    align-items: center;
    color: var(--mdc-theme-on-primary, #fff);
    opacity: 0.8;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 4px;
    white-space: nowrap;
  }

  .app-nav.svelte-whg6dh a:where(.svelte-whg6dh):hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .app-nav.svelte-whg6dh a.is-active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.16);
  }

  .nav-icon.svelte-whg6dh {
    display: none;
    font-size: 20px;
  }

  .app-content.svelte-whg6dh {
    flex: 1 1 auto;
  }

  /* Full width above the content, not a dismissible toast: the state persists until we lift it. */
  .org-suspended.svelte-whg6dh {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--s4q-fill-subtle);
    border-bottom: 1px solid var(--s4q-border-subtle);
    color: var(--s4q-warning);
    font-size: 14px;
    text-align: center;
  }

  .org-suspended.svelte-whg6dh .material-icons:where(.svelte-whg6dh) {
    font-size: 20px;
  }

  /* Narrow screens: the labels no longer fit next to the title, so the nav
     falls back to icons (the accessible name stays via the link's title). */
  @media (max-width: 560px) {
    .app-title {
      margin-right: 8px !important;
      font-size: 16px !important;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .nav-label.svelte-whg6dh {
      display: none;
    }

    .nav-icon.svelte-whg6dh {
      display: inline-block;
    }

    .app-nav.svelte-whg6dh a:where(.svelte-whg6dh) {
      padding: 8px 10px;
    }
  }

  .toast--error .mdc-snackbar__surface {
    background-color: var(--s4q-danger);
  }

  .login-page.svelte-110obhz {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .login-card {
    width: 100%;
    max-width: 380px;
  }

  h1.svelte-110obhz {
    font-size: 22px;
    margin: 0 0 2px;
  }

  .login-subheading.svelte-110obhz {
    margin: 0 0 20px;
    color: var(--s4q-text-secondary);
    font-size: 13px;
  }

  .login-form.svelte-110obhz {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .login-error.svelte-110obhz {
    color: var(--mdc-theme-error, #b3261e);
    font-size: 13px;
    margin: 0;
  }

  .login-forgot.svelte-110obhz {
    display: inline-block;
    margin-top: 20px;
    font-size: 13px;
    color: var(--s4q-text-secondary);
  }

  .password-toggle {
    cursor: pointer;
    user-select: none;
  }


  .session-notice.svelte-15at428 {
    margin: 0 0 20px;
    color: var(--s4q-text-secondary);
    font-size: 13px;
  }

  .session-notice__actions.svelte-15at428 {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .session-notice__error.svelte-15at428 {
    color: var(--mdc-theme-error, #b3261e);
    font-size: 13px;
    margin: 12px 0 0;
  }

  .invite-page.svelte-jk041 {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .invite-card {
    width: 100%;
    max-width: 420px;
  }

  h1.svelte-jk041 {
    font-size: 22px;
    margin: 0 0 4px;
  }

  .invite-hint.svelte-jk041 {
    margin: 0 0 20px;
    color: var(--s4q-text-secondary);
    font-size: 13px;
  }

  .invite-form.svelte-jk041 {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .invite-error.svelte-jk041 {
    color: var(--mdc-theme-error, #b3261e);
    font-size: 13px;
    margin: 0;
  }

  .password-toggle {
    cursor: pointer;
    user-select: none;
  }

  .reset-page.svelte-1r5zizq {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .reset-card {
    width: 100%;
    max-width: 420px;
  }

  h1.svelte-1r5zizq {
    font-size: 22px;
    margin: 0 0 4px;
  }

  .reset-hint.svelte-1r5zizq {
    margin: 0 0 20px;
    color: var(--s4q-text-secondary);
    font-size: 13px;
  }

  .reset-form.svelte-1r5zizq {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .reset-error.svelte-1r5zizq {
    color: var(--mdc-theme-error, #b3261e);
    font-size: 13px;
    margin: 0;
  }

  .reset-back.svelte-1r5zizq {
    display: inline-block;
    margin-top: 20px;
    font-size: 13px;
    color: var(--s4q-text-secondary);
  }

  .password-toggle {
    cursor: pointer;
    user-select: none;
  }

  .device-row {
    margin-bottom: 10px;
  }

  .device-row__inner.svelte-el8foi {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 10px 4px;
  }

  /* The tile says what kind of device it is, its rendering whether it is connected: full colour
     while online, greyed out and dimmed while offline. */
  .device-row__icon.svelte-el8foi {
    flex: none;
    width: 24px;
    height: 24px;
  }

  .device-row__icon.svelte-el8foi:not(.is-online) {
    /* Theme-dependent: the dark theme brightens instead of only dimming, because greyscaled
       brand red would vanish on the dark background. */
    filter: var(--s4q-offline-filter);
  }

  /* Fixed width, not min-width: the columns that follow have to start at the same x position in
     every row, however long the device name is. Wide enough for the longest meta line
     ("Gira HomeServer · Offline, seit 01.01.2026, 00:00") to fit without ellipsis. */
  .device-row__identity.svelte-el8foi {
    width: 320px;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .device-row__name.svelte-el8foi,
  .device-row__meta.svelte-el8foi {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .device-row__name.svelte-el8foi {
    font-weight: 500;
    font-size: 16px;
  }

  .device-row__meta.svelte-el8foi {
    font-size: 12px;
    color: var(--s4q-text-secondary);
  }

  .spacer.svelte-el8foi {
    flex: 1 1 auto;
  }

  /* Below this the fixed identity width only causes ragged wrapping, so the row
     stacks instead - for every row, so they stay aligned with each other. */
  @media (max-width: 720px) {
    .device-row__inner.svelte-el8foi {
      gap: 8px 12px;
    }

    .device-row__identity.svelte-el8foi {
      width: auto;
      flex: 1 1 0;
    }

    .spacer.svelte-el8foi {
      display: none;
    }
  }

  .dialog-subtitle.svelte-zudecy {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--s4q-text-secondary);
    margin-top: 2px;
  }

  .credential.svelte-u51ufo + .credential:where(.svelte-u51ufo) {
    margin-top: 12px;
  }

  .credential__label.svelte-u51ufo {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
  }

  .credential__row.svelte-u51ufo {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--s4q-fill-subtle);
    border-radius: 8px;
    padding: 6px 6px 6px 14px;
  }

  .credential__value.svelte-u51ufo {
    flex: 1 1 auto;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 14px;
    user-select: all;
    word-break: break-all;
  }

  .create-fields.svelte-11zk5im {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 4px;
  }

  .create-field {
    width: 100%;
  }

  .hint.svelte-11zk5im {
    font-size: 13px;
    color: var(--s4q-text-secondary);
    margin: 0 0 16px;
  }

  .hint--warn.svelte-11zk5im {
    margin: 16px 0 0;
    color: var(--s4q-warning);
  }

  .error.svelte-11zk5im {
    color: var(--mdc-theme-error, #b3261e);
    font-size: 13px;
    margin: 12px 0 0;
  }

  .toolbar.svelte-q0902g {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }

  .search-field {
    flex: 1 1 260px;
  }

  .filter-select {
    min-width: 160px;
  }

  .loading.svelte-q0902g {
    display: flex;
    justify-content: center;
    padding: 48px;
  }

  .empty.svelte-q0902g {
    color: var(--s4q-text-secondary);
  }

  .fields.svelte-jneiqm {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 4px;
  }

  .field {
    width: 100%;
  }

  .error.svelte-jneiqm {
    color: var(--mdc-theme-error, #b3261e);
    font-size: 13px;
    margin: 12px 0 0;
  }

  .hint.svelte-14a6nei {
    font-size: 13px;
    color: var(--s4q-text-secondary);
    margin: 0 0 8px;
  }

  .hint--warn.svelte-14a6nei {
    margin: 16px 0 0;
    color: var(--s4q-warning);
  }

  .error.svelte-14a6nei {
    color: var(--mdc-theme-error, #b3261e);
    font-size: 13px;
    margin: 12px 0 0;
  }

  .hint.svelte-1t1uyrj {
    font-size: 13px;
    color: var(--s4q-text-secondary);
    margin: 0 0 8px;
  }

  .error.svelte-1t1uyrj {
    color: var(--mdc-theme-error, #b3261e);
    font-size: 13px;
    margin: 12px 0 0;
  }

  .back-link.svelte-1g1susb {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--s4q-text-secondary);
    text-decoration: none;
    margin-bottom: 8px;
  }

  .back-link.svelte-1g1susb .material-icons {
    font-size: 18px;
  }

  .device-actions.svelte-1g1susb {
    position: relative;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .status-chip.svelte-1g1susb {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--s4q-fill-subtle);
    color: var(--s4q-text-secondary);
  }

  .status-chip--online.svelte-1g1susb {
    background: var(--s4q-success-fill);
    color: var(--s4q-success);
  }

  .section-heading.svelte-1g1susb {
    font-size: 16px;
    margin: 24px 0 8px;
  }

  .facts.svelte-1g1susb {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 20px;
    margin: 0;
    font-size: 13px;
  }

  .facts.svelte-1g1susb dt:where(.svelte-1g1susb) {
    color: var(--s4q-text-secondary);
  }

  .facts.svelte-1g1susb dd:where(.svelte-1g1susb) {
    margin: 0;
  }

  /* Wide content scrolls inside its own container so the page never scrolls sideways. */
  .table-scroll.svelte-1g1susb {
    overflow-x: auto;
  }

  .data-points.svelte-1g1susb {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }

  .data-points.svelte-1g1susb th:where(.svelte-1g1susb),
  .data-points.svelte-1g1susb td:where(.svelte-1g1susb) {
    text-align: left;
    padding: 6px 12px 6px 0;
    border-bottom: 1px solid var(--s4q-border-subtle);
    white-space: nowrap;
  }

  .data-points.svelte-1g1susb th:where(.svelte-1g1susb) {
    font-weight: 500;
    color: var(--s4q-text-secondary);
  }

  .numeric.svelte-1g1susb {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .muted.svelte-1g1susb {
    color: var(--s4q-text-secondary);
  }

  .loading.svelte-1g1susb {
    display: flex;
    justify-content: center;
    padding: 48px;
  }

  .empty.svelte-1g1susb {
    color: var(--s4q-text-secondary);
  }

  .refresh-hint.svelte-1g1susb {
    font-size: 12px;
    color: var(--s4q-text-secondary);
    margin-top: 8px;
  }

  .hint.svelte-1ihkqyo {
    font-size: 13px;
    color: var(--s4q-text-secondary);
    margin: 0 0 16px;
  }

  .fields.svelte-1ihkqyo {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 4px;
  }

  .field {
    width: 100%;
  }

  .error.svelte-1ihkqyo {
    color: var(--mdc-theme-error, #b3261e);
    font-size: 13px;
    margin: 12px 0 0;
  }

  .page.svelte-adbamk .mdc-card + .mdc-card {
    margin-top: 16px;
  }

  h2.svelte-adbamk {
    font-size: 16px;
    margin: 0 0 12px;
  }

  .fields.svelte-adbamk {
    max-width: 420px;
  }

  .actions.svelte-adbamk {
    margin-top: 20px;
  }

  .members-header.svelte-adbamk {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
  }

  .members-header.svelte-adbamk h2:where(.svelte-adbamk) {
    margin: 0;
  }

  .member.svelte-adbamk {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--s4q-border-subtle);
  }

  .member.svelte-adbamk:last-child {
    border-bottom: none;
  }

  /* Fixed width, not min-width: the columns after it have to start at the same x in every row. */
  .member__identity.svelte-adbamk {
    flex: none;
    width: 260px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .member__name.svelte-adbamk,
  .member__email.svelte-adbamk {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .member__name.svelte-adbamk {
    font-size: 14px;
    font-weight: 500;
  }

  .member__self.svelte-adbamk {
    font-weight: 400;
    font-size: 12px;
    color: var(--s4q-text-secondary);
  }

  .member__email.svelte-adbamk {
    font-size: 12px;
    color: var(--s4q-text-secondary);
  }

  .member__pending.svelte-adbamk {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--s4q-fill-subtle);
    color: var(--s4q-warning);
    white-space: nowrap;
  }

  .member__role {
    min-width: 150px;
  }

  .member__actions.svelte-adbamk {
    margin-left: auto;
    display: flex;
    align-items: center;
  }

  .loading.svelte-adbamk {
    display: flex;
    justify-content: center;
    padding: 48px;
  }

  .empty.svelte-adbamk {
    color: var(--s4q-text-secondary);
  }

  @media (max-width: 700px) {
    .member.svelte-adbamk {
      flex-wrap: wrap;
    }

    .member__identity.svelte-adbamk {
      width: 100%;
    }
  }

  .page.svelte-rj7pkj .mdc-card + .mdc-card {
    margin-top: 16px;
  }

  h2.svelte-rj7pkj {
    font-size: 16px;
    margin: 0 0 4px;
  }

  .hint.svelte-rj7pkj {
    font-size: 13px;
    color: var(--s4q-text-secondary);
    margin: 0 0 16px;
  }

  .fields.svelte-rj7pkj {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 420px;
  }

  .fields.svelte-rj7pkj .hint:where(.svelte-rj7pkj) {
    margin: -8px 0 0;
  }

  .actions.svelte-rj7pkj {
    margin-top: 20px;
  }

  .error.svelte-rj7pkj {
    color: var(--mdc-theme-error, #b3261e);
    font-size: 13px;
    margin: 0;
  }

  .password-toggle {
    cursor: pointer;
    user-select: none;
  }

  .boot-loading.svelte-1n46o8q {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }
