@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  color: #172033;
  background:
    radial-gradient(circle at top left, rgba(183, 178, 255, 0.12), transparent 0 24%),
    linear-gradient(180deg, #f4efe7 0%, #f7f4ee 44%, #f1ede4 100%);
  line-height: 1.5;
  font-weight: 500;
  font-size: 15.5px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --bg: #f6f2ea;
  --paper: rgba(255, 252, 246, 0.92);
  --paper-strong: #fffdf8;
  --panel-dark: #1d2b52;
  --panel-dark-2: #2c4578;
  --ink: #1b2233;
  --muted-ink: #53627f;
  --lavender: #b7b2ff;
  --lavender-deep: #7f79df;
  --accent-warm: #efb15f;
  --line: rgba(31, 43, 74, 0.18);
  --line-strong: rgba(31, 43, 74, 0.32);
  --shadow: 0 20px 40px rgba(31, 42, 72, 0.1);
  --shadow-soft: 0 10px 24px rgba(31, 42, 72, 0.08);
  --hero-shadow: 0 22px 44px rgba(22, 34, 67, 0.22);
  --body-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0));
  --body-accent-top: linear-gradient(135deg, rgba(183, 178, 255, 0.08), transparent 40%);
  --body-accent-bottom: linear-gradient(180deg, rgba(27, 38, 68, 0.05), transparent 100%);
  --body-accent-orb: radial-gradient(circle, rgba(183, 178, 255, 0.12), transparent 68%);
  --card-gradient-top: rgba(255, 255, 255, 0.96);
  --card-gradient-bottom: rgba(247, 243, 235, 0.94);
  --modal-gradient-top: rgba(255, 255, 255, 0.98);
  --modal-gradient-bottom: rgba(247, 243, 235, 0.98);
  --auth-gradient-top: rgba(255, 255, 255, 0.92);
  --auth-gradient-bottom: rgba(247, 243, 235, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-muted: rgba(244, 239, 231, 0.88);
  --surface-table: rgba(255, 255, 255, 0.72);
  --surface-checkbox: rgba(255, 255, 255, 0.52);
  --overlay-backdrop: rgba(16, 24, 42, 0.34);
  --input-bg: rgba(255, 255, 255, 0.86);
  --input-bg-focus: #fff;
  --placeholder: rgba(83, 98, 127, 0.62);
  --success-bg: rgba(236, 251, 240, 0.98);
  --success-border: rgba(59, 130, 83, 0.24);
  --success-ink: #163320;
  --warning-bg: rgba(255, 245, 222, 0.98);
  --warning-border: rgba(191, 126, 24, 0.24);
  --warning-ink: #5e3d08;
  --error-bg: rgba(255, 237, 237, 0.98);
  --error-border: rgba(191, 72, 72, 0.24);
  --error-ink: #6f1d1d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  position: relative;
  overflow-x: hidden;
  background:
    var(--body-overlay),
    var(--bg);
  transition: background-color 0.22s ease, color 0.22s ease;
}

body.is-busy {
  cursor: progress;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: 0;
  left: 0;
  width: 100%;
  height: 320px;
  background:
    var(--body-accent-top),
    var(--body-accent-bottom);
}

body::after {
  right: -120px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: var(--body-accent-orb);
}

body[data-theme='dark'] {
  --bg: #111827;
  --paper: rgba(20, 28, 46, 0.92);
  --paper-strong: #172135;
  --panel-dark: #0f1728;
  --panel-dark-2: #203255;
  --ink: #edf2ff;
  --muted-ink: #9ba8c6;
  --line: rgba(148, 163, 184, 0.22);
  --line-strong: rgba(191, 203, 226, 0.34);
  --shadow: 0 24px 46px rgba(3, 8, 20, 0.42);
  --shadow-soft: 0 12px 26px rgba(3, 8, 20, 0.28);
  --hero-shadow: 0 24px 48px rgba(3, 8, 20, 0.42);
  --body-overlay: linear-gradient(180deg, rgba(8, 12, 22, 0.16), rgba(8, 12, 22, 0));
  --body-accent-top: linear-gradient(135deg, rgba(127, 121, 223, 0.18), transparent 40%);
  --body-accent-bottom: linear-gradient(180deg, rgba(13, 18, 33, 0.36), transparent 100%);
  --body-accent-orb: radial-gradient(circle, rgba(127, 121, 223, 0.18), transparent 68%);
  --card-gradient-top: rgba(22, 31, 49, 0.98);
  --card-gradient-bottom: rgba(18, 26, 42, 0.96);
  --modal-gradient-top: rgba(21, 30, 48, 0.98);
  --modal-gradient-bottom: rgba(18, 26, 42, 0.98);
  --auth-gradient-top: rgba(21, 30, 48, 0.98);
  --auth-gradient-bottom: rgba(18, 26, 42, 0.96);
  --surface-soft: rgba(24, 35, 56, 0.9);
  --surface-strong: rgba(28, 40, 62, 0.94);
  --surface-muted: rgba(25, 36, 57, 0.92);
  --surface-table: rgba(19, 29, 47, 0.92);
  --surface-checkbox: rgba(26, 39, 62, 0.92);
  --overlay-backdrop: rgba(4, 8, 18, 0.56);
  --input-bg: rgba(15, 24, 39, 0.94);
  --input-bg-focus: rgba(18, 30, 48, 0.98);
  --placeholder: rgba(155, 168, 198, 0.72);
  --success-bg: rgba(18, 57, 37, 0.96);
  --success-border: rgba(70, 177, 114, 0.42);
  --success-ink: #dff8e8;
  --warning-bg: rgba(79, 52, 10, 0.96);
  --warning-border: rgba(214, 158, 46, 0.42);
  --warning-ink: #ffe8b3;
  --error-bg: rgba(87, 28, 28, 0.96);
  --error-border: rgba(221, 103, 103, 0.44);
  --error-ink: #ffe0e0;
}

button,
input,
select {
  font: inherit;
}

#app {
  position: relative;
  z-index: 1;
}

.global-loading-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(16, 24, 42, 0.16);
  backdrop-filter: blur(4px);
  z-index: 80;
  animation: fadeIn 0.18s ease;
}

.global-loading-card {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  min-width: min(240px, calc(100vw - 2rem));
  padding: 1.4rem 1.5rem 1.2rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  text-align: center;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.global-loading-title {
  font-size: 1rem;
}

.global-loading-copy {
  max-width: 28ch;
  color: var(--muted-ink);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
}

.global-loading-progress {
  display: grid;
  gap: 0.4rem;
  width: min(100%, 28rem);
  margin: 0.1rem 0 0;
  padding: 0;
  list-style: none;
}

.global-loading-progress-item {
  width: min(100%, 28rem);
  padding: 0.45rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted-ink);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
}

.global-loading-progress-item-ok {
  color: #1d6b46;
}

.global-loading-progress-item-error {
  color: #a14d3d;
}

.global-loading-progress-item-pending {
  color: var(--panel-dark-2);
}

.global-loading-icon {
  width: 176px;
  height: 176px;
}

.global-loading-icon svg {
  width: 100%;
  height: 100%;
}

.global-loading-fallback {
  display: inline-flex;
  width: 70px;
  height: 70px;
  border-radius: 999px;
  border: 4px solid rgba(127, 121, 223, 0.16);
  border-top-color: var(--lavender-deep);
  animation: loaderSpin 0.85s linear infinite;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-branding-layout {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 520px);
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.auth-branding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 120px;
}

.auth-logo-panel {
  display: grid;
  place-items: center;
}

.auth-branding-logo {
  display: block;
  max-width: min(320px, 42vw);
  max-height: 120px;
  object-fit: contain;
}

.shell {
  width: min(1240px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.auth-card,
.card,
.modal-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-card::before,
.card::before,
.modal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: inherit;
  pointer-events: none;
}

.auth-card {
  width: min(520px, 100%);
  border-radius: 24px;
  padding: 1.6rem 1.55rem 1.45rem;
  background:
    linear-gradient(180deg, var(--auth-gradient-top), var(--auth-gradient-bottom)),
    var(--paper);
}

.auth-copy {
  margin: 0 0 1.25rem;
  color: var(--muted-ink);
  font-size: 1rem;
  max-width: 38ch;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1.6rem 1.75rem;
  border-radius: 28px;
  background:
    linear-gradient(135deg, var(--panel-dark) 0%, var(--panel-dark-2) 100%);
  border: 1px solid rgba(102, 124, 187, 0.22);
  box-shadow: var(--hero-shadow);
}

.hero > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 700px;
}

.hero-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  flex: 0 0 auto;
  align-self: flex-start;
}

.sub-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: nowrap;
  margin-top: 1rem;
  align-items: center;
}

.cards-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.cards-toolbar-main,
.cards-toolbar-secondary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.kicker,
.eyebrow {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--muted-ink);
}

.hero .kicker {
  color: rgba(224, 230, 247, 0.82);
}

h1,
h2 {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero h1 {
  color: #f7f9ff;
}

.hero-hostname {
  margin: 0.75rem 0 0;
  color: rgba(224, 230, 247, 0.88);
  font-size: 1rem;
  font-weight: 600;
}

.hero-hostname strong {
  color: #ffffff;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(2.05rem, 3.7vw, 3.2rem);
  line-height: 1.02;
  font-weight: 700;
}

h2 {
  font-weight: 700;
}

.hero .sub-actions .text-button {
  color: rgba(228, 234, 248, 0.88);
}

.hero .sub-actions .text-button:hover {
  color: #ffffff;
}

.hero .selection-button {
  background: rgba(183, 178, 255, 0.9);
  border-color: rgba(183, 178, 255, 0.55);
  font-size: 0.98rem;
  min-width: 12.5rem;
  white-space: nowrap;
}

.hero .sub-actions .text-button {
  font-size: 0.99rem;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.15rem;
}

.jeedoms-grid-shell {
  display: grid;
  gap: 1rem;
  view-transition-name: jeedoms-grid-shell;
}

.jeedoms-grid-shell .card,
.jeedoms-grid-shell.no-card-reveal .card {
  animation: none !important;
}

.jeedoms-toggle-wrap {
  display: flex;
  justify-content: center;
  padding-top: 0.1rem;
}

.jeedoms-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100%, 430px);
  min-height: 62px;
  padding: 0.85rem 0.95rem 0.85rem 1rem;
  border: 1px solid rgba(127, 121, 223, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(242, 238, 255, 0.96) 100%);
  box-shadow: 0 18px 34px rgba(58, 57, 112, 0.12);
  color: var(--ink);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.jeedoms-toggle-button:hover {
  transform: translateY(-2px);
  border-color: rgba(127, 121, 223, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(236, 231, 255, 0.98) 100%);
  box-shadow: 0 22px 38px rgba(58, 57, 112, 0.16);
}

.jeedoms-grid-shell.is-collapsed .jeedoms-toggle-button {
  animation: jeedomsToggleFloat 1.8s ease-in-out infinite;
}

.jeedoms-toggle-copy {
  display: grid;
  gap: 0.12rem;
  text-align: left;
}

.jeedoms-toggle-copy strong {
  font-size: 0.98rem;
  font-weight: 800;
}

.jeedoms-toggle-copy span {
  color: var(--muted-ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.jeedoms-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(183, 178, 255, 0.26);
  color: var(--lavender-deep);
  flex: 0 0 auto;
}

.jeedoms-toggle-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jeedoms-grid-shell.is-collapsed .jeedoms-toggle-icon svg {
  animation: jeedomsToggleChevronBounce 1.8s ease-in-out infinite;
}

@keyframes jeedomsToggleFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

@keyframes jeedomsToggleChevronBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

.admin-section {
  margin-top: 1.2rem;
}

.branding-admin-modal {
  width: min(900px, 100%);
}

#open-branding-modal {
  background: #050505;
  border-color: #050505;
  color: #ffffff;
}

#open-branding-modal:hover {
  background: #202020;
  border-color: #202020;
  color: #ffffff;
}

.branding-admin-modal .card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.branding-admin-modal .card-top > .ghost-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.branding-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.branding-admin-item {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-table);
}

.branding-admin-preview {
  min-height: 130px;
  display: grid;
  place-items: center;
  padding: 0.8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--line-strong);
  text-align: center;
}

.branding-preview-image {
  display: block;
  max-width: 100%;
  max-height: 110px;
  object-fit: contain;
}

.branding-admin-item .actions {
  align-items: center;
  flex-wrap: wrap;
}

.security-settings-panel {
  display: grid;
  gap: 1rem;
}

.security-settings-status {
  display: grid;
  gap: 0.18rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--warning-border);
  border-radius: 14px;
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.security-settings-status.is-ok {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success-ink);
}

.security-toggle-card {
  align-items: flex-start;
}

.security-toggle-card span {
  display: grid;
  gap: 0.22rem;
}

.security-toggle-card small,
.field-hint {
  color: var(--muted-ink);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
}

.security-jeedom-link {
  width: fit-content;
  text-decoration: none;
}

.security-proxy-help {
  display: grid;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-table);
}

.security-proxy-help p {
  margin: 0;
  color: var(--muted-ink);
  line-height: 1.45;
}

.https-diagnostics-panel {
  gap: 0.8rem;
}

.https-diagnostics-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.https-diagnostics-head p {
  margin: 0.25rem 0 0;
}

.https-diagnostics-list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.https-diagnostic-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: var(--surface-soft);
}

.https-diagnostic-item.is-ok {
  color: var(--success-ink);
}

.https-diagnostic-item.is-error {
  color: var(--danger-ink);
}

.https-diagnostic-item.is-warning {
  color: var(--warning-ink);
}

.https-diagnostic-icon {
  display: inline-flex;
  width: 1.15rem;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.https-diagnostic-item small {
  margin-left: 0.3rem;
  color: var(--muted-ink);
}

.https-diagnostics-actions {
  flex-wrap: wrap;
}

.network-diagnostic {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.network-diagnostic p {
  margin: 0;
}

.network-diagnostic-error {
  color: var(--danger-ink);
}

.network-diagnostic-fallback {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid var(--warning-border);
  border-radius: 12px;
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.network-diagnostic-fallback p {
  margin: 0;
}

.network-diagnostic-notice {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--warning-border);
  border-radius: 10px;
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.security-network-results {
  display: grid;
  gap: 0.55rem;
}

.security-network-results p {
  margin: 0;
}

.security-network-table-wrap {
  display: grid;
  gap: 0.45rem;
  overflow-x: auto;
}

.security-network-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.security-network-table th,
.security-network-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.security-network-table th {
  color: var(--muted-ink);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.security-network-table tr:last-child td {
  border-bottom: 0;
}

.network-setup-modal {
  max-width: 620px;
}

.network-setup-modal .card-top {
  position: relative;
  align-items: flex-start;
  padding-right: 6rem;
}

.network-setup-modal .card-top > .ghost-button {
  position: absolute;
  top: 0;
  right: 0;
}

.security-network-empty {
  min-height: 96px;
  align-content: center;
}

.admin-card {
  display: grid;
  gap: 1rem;
}

.admin-card h2 {
  margin: 0;
  font-size: 1.55rem;
}

.admin-section-footer {
  justify-content: space-between;
  align-items: center;
}

.sync-cta-button {
  min-width: 320px;
  background: linear-gradient(135deg, #1f9d62 0%, #17804e 100%);
  border-color: rgba(23, 128, 78, 0.58);
  color: #f7fff9;
  box-shadow: 0 18px 28px rgba(23, 128, 78, 0.2);
}

.sync-cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 30px rgba(23, 128, 78, 0.24);
}

.master-rights-modal {
  width: min(1180px, 100%);
}

.designs-modal {
  width: min(1080px, 100%);
}

.design-export-modal {
  width: min(1120px, 100%);
}

.design-export-summary {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(31, 43, 74, 0.08);
  border-radius: 18px;
  background: rgba(183, 178, 255, 0.08);
}

.design-export-summary p {
  margin: 0;
}

.design-export-inline-check {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(31, 43, 74, 0.1);
  background: var(--surface-soft);
}

.design-export-inline-check-solo {
  width: min(540px, 100%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 242, 255, 0.84)),
    var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.design-export-check-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 10px;
  background: rgba(183, 178, 255, 0.16);
  border: 1px solid rgba(127, 119, 235, 0.18);
}

.design-export-check-control input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #7f77eb;
  cursor: pointer;
}

.design-export-inline-check-copy {
  display: grid;
  gap: 0.18rem;
}

.design-export-inline-check-copy strong {
  font-size: 0.96rem;
  color: var(--ink);
}

.design-export-inline-check-copy small {
  color: var(--muted-ink);
  font-size: 0.82rem;
  line-height: 1.45;
}

.design-export-inline-check span,
.design-export-inline-check-copy {
  font-size: 0.92rem;
  color: var(--ink);
}

.design-export-groups {
  display: grid;
  gap: 1rem;
  max-height: min(56vh, 620px);
  overflow-y: auto;
  margin-bottom: 0.9rem;
}

.design-export-group {
  border: 1px solid rgba(31, 43, 74, 0.08);
  border-radius: 18px;
  background: var(--surface-table);
  overflow: hidden;
}

.design-export-group-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--surface-muted);
  border-bottom: 1px solid rgba(31, 43, 74, 0.08);
  color: var(--muted-ink);
}

.design-export-options {
  display: grid;
}

.design-export-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(31, 43, 74, 0.08);
  cursor: pointer;
}

.design-export-options .design-export-option:last-child {
  border-bottom: 0;
}

.design-export-option-copy {
  display: grid;
  gap: 0.12rem;
}

.design-export-option-copy strong {
  font-size: 0.95rem;
  color: var(--ink);
}

.design-export-option-copy small {
  color: var(--muted-ink);
  font-size: 0.82rem;
}

.design-import-feedback-card {
  width: min(720px, calc(100% - 1.5rem));
  border-width: 1px;
}

.design-import-feedback-card .editor-head {
  align-items: start;
  gap: 1rem;
}

.design-import-feedback-card .notification-banner-copy {
  max-width: 100%;
}

.notification-banner {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 1.5rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.05rem;
  border-radius: 18px;
  border: 1px solid var(--success-border);
  background: var(--success-bg);
  color: var(--success-ink);
  box-shadow: 0 18px 34px rgba(19, 56, 29, 0.16);
  z-index: 40;
}

.notification-banner-copy {
  display: grid;
  gap: 0.14rem;
}

.notification-banner-copy strong {
  font-size: 0.98rem;
}

.notification-banner-copy span {
  color: rgba(22, 51, 32, 0.84);
}

.notification-banner-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
}

.notification-success {
  border-color: rgba(59, 130, 83, 0.24);
  background: rgba(236, 251, 240, 0.98);
  color: #163320;
}

.notification-warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.notification-warning .notification-banner-copy span {
  color: rgba(94, 61, 8, 0.84);
}

.notification-error {
  border-color: var(--error-border);
  background: var(--error-bg);
  color: var(--error-ink);
}

.notification-error .notification-banner-copy span {
  color: rgba(111, 29, 29, 0.84);
}

.card {
  position: relative;
  padding: 0.88rem 0.92rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, var(--card-gradient-top), var(--card-gradient-bottom)),
    var(--paper);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 40px rgba(31, 42, 72, 0.12);
  border-color: var(--line-strong);
}

/* A transformed card becomes the containing block of fixed modals. Freeze
   cards while any modal is open so the backdrop and dialog never jump with
   the pointer hovering over the page. */
body:has(.modal-backdrop) .card,
body:has(.modal-backdrop) .card:hover {
  transform: none;
  transition: none;
}

.select-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.select-chip-compact {
  min-width: 17px;
  min-height: 17px;
  gap: 0;
}

.select-chip input {
  width: 17px;
  height: 17px;
  accent-color: var(--lavender-deep);
  cursor: pointer;
}

.card-top-spacer {
  width: 17px;
  min-height: 17px;
}

.card-select {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  z-index: 1;
}

.card-select input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--lavender-deep);
  cursor: pointer;
}

.card-has-selection h2,
.card-has-selection .mini,
.card-has-selection .actions {
  padding-left: 1.4rem;
}

.static-chip {
  min-height: 17px;
}

.card h2 {
  margin: 0 0 0.22rem;
  font-size: 1.08rem;
  line-height: 1.2;
}

.mini {
  margin: 0 0 0.72rem;
  color: var(--muted-ink);
  font-size: 0.79rem;
  word-break: break-word;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin-bottom: 1rem;
}

.portal-groups-section {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(31, 43, 74, 0.12);
}

.rights-target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  min-height: 58px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-checkbox);
  color: var(--ink);
}

.checkbox-card input {
  margin: 0;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.modal-inline-note {
  margin: 0;
  flex: 1 1 260px;
}

.meta {
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0.16rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--line);
}

.status-ok {
  background: rgba(183, 178, 255, 0.28);
  color: #293251;
}

body[data-theme='dark'] .status-ok {
  background: rgba(183, 178, 255, 0.22);
  color: #eef2ff;
  border-color: rgba(183, 178, 255, 0.34);
}

.status-warn {
  background: rgba(252, 244, 198, 0.96);
  color: #624d10;
}

.edit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.22rem 0.7rem;
  border: 1px solid rgba(31, 43, 74, 0.12);
  border-radius: 10px;
  background: var(--surface-strong);
  color: #596176;
  box-shadow: 0 6px 14px rgba(31, 42, 72, 0.08);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.edit-badge:hover {
  transform: translateY(-1px);
  filter: none;
  color: #293251;
  box-shadow: 0 10px 18px rgba(31, 42, 72, 0.12);
}

.edit-badge.icon-only {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
}

.card-edit-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
}

.card-master-badge {
  position: absolute;
  top: 10px;
  right: 46px;
  z-index: 1;
  min-height: 30px;
  padding: 0.16rem 0.58rem;
  font-size: 0.74rem;
  white-space: nowrap;
}

.edit-badge.icon-only svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  font-size: 0.92rem;
}

.user-context-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.22rem 0 0.35rem;
  padding: 0.5rem 0.78rem;
  border: 1px solid rgba(127, 121, 223, 0.2);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(183, 178, 255, 0.18), var(--surface-strong));
  box-shadow: 0 10px 20px rgba(31, 42, 72, 0.06);
}

.user-context-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(183, 178, 255, 0.26);
  color: #3f4484;
  flex: 0 0 auto;
}

.user-context-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.user-context-copy {
  display: grid;
  gap: 0.04rem;
  line-height: 1.05;
}

.user-context-copy strong {
  font-size: 0.98rem;
  color: var(--ink);
  font-weight: 800;
}

.user-context-copy span {
  font-size: 0.73rem;
  color: var(--muted-ink);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.account-menu {
  position: relative;
}

.account-session-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.45rem 0.72rem 0.45rem 0.62rem;
  border-radius: 16px;
  text-align: left;
}

.account-session-presence {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #35d07f;
  box-shadow: 0 0 0 4px rgba(53, 208, 127, 0.16);
  flex: 0 0 auto;
}

.account-session-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: currentColor;
  flex: 0 0 auto;
}

.account-session-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.account-session-copy {
  display: grid;
  gap: 0.04rem;
  line-height: 1.05;
}

.account-session-copy strong {
  font-size: 0.93rem;
  font-weight: 800;
}

.account-session-copy span {
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.76;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  display: grid;
  gap: 0.4rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
  box-shadow: 0 18px 32px rgba(19, 30, 57, 0.12);
  z-index: 12;
}

.account-dropdown-button {
  width: 100%;
  min-height: 42px;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.account-dropdown-button:hover {
  transform: translateY(-1px);
  background: rgba(183, 178, 255, 0.12);
  border-color: var(--line-strong);
}

.account-dropdown-button.danger {
  color: #8d3e3e;
}

.account-dropdown-button.warning {
  color: #b86b10;
  background: rgba(255, 243, 227, 0.96);
  border-color: rgba(232, 171, 84, 0.38);
}

.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: var(--overlay-backdrop);
  backdrop-filter: blur(10px);
  z-index: 30;
  animation: fadeIn 0.18s ease;
}

.modal-card {
  width: min(760px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 1.3rem;
  border-radius: 22px;
  background:
    linear-gradient(180deg, var(--modal-gradient-top), var(--modal-gradient-bottom)),
    var(--paper-strong);
  animation: modalIn 0.2s ease;
}

.modal-card-minimal {
  background:
    linear-gradient(180deg, var(--modal-gradient-top), var(--modal-gradient-bottom)),
    var(--paper-strong);
  box-shadow: 0 20px 40px rgba(22, 31, 57, 0.12);
}

.modal-card-small {
  width: min(560px, 100%);
}

.allowed-connections-modal {
  width: min(760px, 100%);
}

.notification-card {
  max-width: 520px;
}

.notification-info {
  border-color: rgba(31, 43, 74, 0.24);
}

.notification-success {
  border-color: rgba(82, 126, 88, 0.42);
}

.notification-warning {
  border-color: rgba(176, 125, 36, 0.42);
}

.notification-error {
  border-color: rgba(168, 77, 77, 0.44);
}

.credentials {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.form-section {
  display: grid;
  gap: 0.95rem;
  padding: 0.2rem 0 0.1rem;
}

.section-title {
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field {
  display: grid;
  gap: 0.42rem;
}

.field-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  position: relative;
}

.field-help-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(127, 121, 223, 0.28);
  border-radius: 999px;
  background: rgba(183, 178, 255, 0.18);
  color: #3f4484;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.field-help-tooltip:hover,
.field-help-tooltip:focus-visible {
  transform: translateY(-1px);
  background: rgba(183, 178, 255, 0.3);
  border-color: rgba(127, 121, 223, 0.42);
}

.field-help-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 48px));
  padding: 0.72rem 0.85rem;
  border-radius: 14px;
  background: rgba(31, 43, 74, 0.96);
  color: #fffdf7;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: 0 16px 30px rgba(22, 31, 57, 0.24);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 20;
}

.field-help-tooltip::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(31, 43, 74, 0.96);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0.16s ease;
  z-index: 19;
}

.field-help-tooltip:hover::after,
.field-help-tooltip:hover::before,
.field-help-tooltip:focus-visible::after,
.field-help-tooltip:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

.field-help-tooltip:hover::after,
.field-help-tooltip:focus-visible::after {
  transform: translateX(-50%) translateY(-2px);
}

.field-tight {
  gap: 0.18rem;
}

.field span {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.field input,
.select-input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--ink);
  padding: 0.78rem 1rem;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease;
  font-size: 1rem;
}

.compact-field {
  min-width: 220px;
}

.input-shell input {
  padding-right: 3.5rem;
}

.field input::placeholder {
  color: var(--placeholder);
}

.select-input {
  color: rgba(83, 98, 127, 0.88);
}

.field input:focus,
.select-input:focus {
  border-color: rgba(127, 121, 223, 0.52);
  background: var(--input-bg-focus);
  box-shadow:
    0 0 0 4px rgba(183, 178, 255, 0.2),
    0 10px 20px rgba(31, 42, 72, 0.06);
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(183, 178, 255, 0.14);
  color: var(--ink);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.password-toggle:hover,
.password-toggle.is-active {
  background: rgba(183, 178, 255, 0.28);
  border-color: rgba(127, 121, 223, 0.4);
  box-shadow: 0 8px 18px rgba(78, 63, 129, 0.1);
}

.confirm-copy {
  display: grid;
  gap: 0.35rem;
  color: var(--muted-ink);
  font-size: 1rem;
}

.inline-note {
  margin: 0;
  color: var(--muted-ink);
  font-size: 1.03rem;
}

.master-help-copy {
  margin-bottom: 0.2rem;
  font-size: 1rem;
  line-height: 1.5;
  max-width: none;
  white-space: nowrap;
}

.modal-intro {
  margin-top: 0.35rem;
  max-width: 48ch;
}

.rights-empty-note {
  margin-bottom: 0.9rem;
}

.remote-pages-picker {
  display: grid;
  gap: 0.8rem;
}

.remote-pages-grid {
  border: 1px solid rgba(31, 43, 74, 0.1);
  border-radius: 18px;
  background: var(--surface-table);
  overflow: hidden;
}

.remote-pages-grid-head,
.remote-page-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) 130px;
  gap: 0.75rem;
  align-items: center;
}

.remote-pages-grid-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(31, 43, 74, 0.08);
  background: var(--surface-muted);
  color: var(--muted-ink);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.remote-pages-list {
  display: grid;
  max-height: min(50vh, 520px);
  overflow-y: auto;
}

.remote-page-row {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(31, 43, 74, 0.08);
}

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

.remote-page-cell {
  min-width: 0;
}

.remote-page-cell input {
  width: 100%;
}

.remote-page-path {
  min-width: 0;
}

.remote-page-actions {
  display: flex;
  justify-content: flex-end;
}

.wide-button {
  justify-content: flex-start;
  width: 100%;
}

.icon-button {
  min-width: 110px;
}

.remote-pages-modal .editor-head {
  margin-bottom: 1rem;
}

.remote-pages-modal .editor-head h2 {
  margin-bottom: 0;
}

.remote-pages-editor-modal {
  width: min(980px, 100%);
}

.modal-actions {
  margin-top: 0.15rem;
}

.remote-pages-designs-to-pages-button.is-empty-state {
  color: #ffffff;
  background: #000000;
  border-color: #000000;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
  animation: remotePagesEmptyButtonBounce 1.15s ease-in-out infinite;
}

.remote-pages-designs-to-pages-button.is-empty-state:hover {
  color: #ffffff;
  background: #171717;
  border-color: #171717;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.26);
}

@keyframes remotePagesEmptyButtonBounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .remote-pages-designs-to-pages-button.is-empty-state {
    animation: none;
  }
}

.design-import-assist-modal {
  width: min(860px, 100%);
}

.design-import-assist-list {
  display: grid;
  gap: 0.85rem;
  max-height: min(48vh, 520px);
  overflow-y: auto;
  padding-right: 0.2rem;
}

.design-import-assist-item {
  display: grid;
  gap: 0.7rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(31, 43, 74, 0.1);
  border-radius: 18px;
  background: var(--surface-table);
}

.design-import-assist-copy {
  display: grid;
  gap: 0.25rem;
}

.design-import-assist-copy strong {
  font-size: 1rem;
}

.design-import-assist-copy span {
  color: var(--muted-ink);
  font-size: 0.94rem;
}

.confirm-copy p,
.detail-list {
  margin-top: 0;
}

.detail-list {
  margin-bottom: 1rem;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.42rem;
  font-size: 0.96rem;
}

.detail-ok {
  color: #2d6e47;
}

.detail-error {
  color: #8b3939;
}

.detail-pending {
  color: #4c4a8c;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
}

.portal-group-actions {
  align-items: flex-start;
}

.portal-group-actions-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
  margin-left: auto;
  justify-content: flex-end;
}

.remote-page-action-group {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  max-width: 100%;
}

.remote-page-action-group-wide {
  width: 100%;
}

.remote-page-action-group-paired > .ghost-button:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.remote-page-action-group-paired > .compact-icon-button {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.remote-page-action-group-single > .ghost-button:first-child {
  border-radius: 10px;
}

.compact-icon-button {
  width: 35px;
  min-width: 35px;
  padding: 0;
}

.compact-icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.compact-more-button {
  min-width: 44px;
  padding-inline: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.rights-toolbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.rights-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: end;
}

.rights-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-bottom: 0.95rem;
  padding: 0.22rem;
  border: 1px solid rgba(31, 43, 74, 0.1);
  border-radius: 16px;
  background: var(--surface-muted);
  width: fit-content;
  max-width: 100%;
}

.rights-tab {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted-ink);
  border-radius: 12px;
  font-weight: 700;
}

.rights-tab.is-active {
  background: rgba(183, 178, 255, 0.28);
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(31, 43, 74, 0.08);
}

.master-users-tabs {
  margin-bottom: 1rem;
}

.rights-table {
  display: grid;
  gap: 0.3rem;
}

.rights-table-scrollable {
  gap: 0;
  border: 1px solid rgba(31, 43, 74, 0.1);
  border-radius: 18px;
  background: var(--surface-table);
  overflow: hidden;
}

.rights-table-head,
.rights-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 1rem;
  align-items: center;
}

.rights-table-head {
  color: var(--muted-ink);
  font-size: 0.92rem;
  font-weight: 800;
  padding: 0.85rem 1rem;
  background: var(--surface-muted);
  border-bottom: 1px solid rgba(31, 43, 74, 0.08);
}

.rights-table-body {
  display: grid;
  max-height: min(56vh, 620px);
  overflow-y: auto;
}

.rights-row {
  min-height: 60px;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(31, 43, 74, 0.08);
}

.rights-table-body .rights-row:last-child {
  border-bottom: 0;
}

.rights-select {
  min-height: 44px;
}

.designs-toolbar {
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.design-create-inline-field {
  min-width: 240px;
  flex: 1 1 260px;
}

.design-create-inline-field span {
  font-size: 0.9rem;
  line-height: 1.1;
}

.design-create-input {
  min-height: 42px !important;
  padding: 0.52rem 0.85rem !important;
  font-size: 0.95rem !important;
}

.compact-toolbar-button {
  min-height: 42px;
  padding: 0.5rem 0.9rem;
  white-space: nowrap;
  align-self: flex-end;
}

.designs-modal .rights-table-head,
.designs-modal .rights-row {
  grid-template-columns: minmax(0, 1fr) 220px auto;
}

.modal-actions-spaced {
  margin-top: 1rem;
}

.rights-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.master-users-table {
  margin-top: 0.35rem;
}

.master-users-table-head,
.master-users-table-row {
  grid-template-columns: minmax(0, 1.15fr) minmax(180px, 0.65fr) minmax(240px, 1fr);
}

.master-users-table-head {
  align-items: center;
}

.master-users-table-user {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.master-users-table-row {
  cursor: pointer;
}

.master-users-table-row.is-selected {
  background: rgba(183, 178, 255, 0.16);
}

.master-users-sort-button {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.master-users-table-group-field {
  margin: 0;
}

.master-users-table-group-field span {
  display: none;
}

.master-users-table-toolbar {
  margin-bottom: 0.75rem;
  display: grid;
  gap: 0.75rem;
}

.network-scan-results-head,
.network-scan-results-row {
  grid-template-columns: 92px minmax(0, 1fr) minmax(240px, 1fr) 190px;
}

.network-scan-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}

.network-scan-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.network-scan-progress {
  margin: 0.4rem 0 0.8rem;
}

.network-scan-checkbox-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.network-scan-checkbox-cell input {
  width: 18px;
  height: 18px;
  accent-color: #d9881b;
  cursor: pointer;
}

.network-scan-checkbox-cell input:disabled {
  cursor: not-allowed;
}

.network-scan-status-cell {
  display: flex;
  justify-content: flex-end;
}

.network-scan-duplicate-note {
  margin: 0.3rem 0 0;
}

.master-users-table-search {
  margin-bottom: 0.9rem;
}

.master-users-table-search-input-wrap {
  position: relative;
}

.master-users-table-search-input-wrap input {
  padding-right: 3rem;
}

.master-users-table-search-clear {
  position: absolute;
  top: 50%;
  right: 0.8rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(89, 97, 118, 0.12);
  color: #48506a;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

body[data-theme='dark'] .master-users-table-search-clear {
  color: var(--muted-ink);
}

body[data-theme='dark'] .master-users-table-search-clear:hover {
  color: var(--ink);
}

.master-users-table-search-clear:hover {
  background: rgba(89, 97, 118, 0.2);
  color: #222b44;
  transform: translateY(-50%) scale(1.03);
}

.master-users-table-search-clear:focus-visible {
  outline: 2px solid rgba(127, 121, 223, 0.42);
  outline-offset: 2px;
}

.master-users-table-search-clear span {
  font-size: 1.2rem;
  line-height: 1;
}

.allowed-connections-table {
  gap: 0;
}

.allowed-connections-table-head,
.allowed-connections-row {
  grid-template-columns: minmax(0, 1fr) 96px;
}

.allowed-connections-table .rights-table-body {
  max-height: min(46vh, 420px);
}

.allowed-connections-label {
  display: block;
  line-height: 1.35;
  word-break: break-word;
}

.allowed-connections-check {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.allowed-connections-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.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;
}

.button,
.panel-button,
.ghost-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 35px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0.36rem 0.76rem;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
  color: var(--ink);
  position: relative;
  font-weight: 600;
  font-size: 0.87rem;
}

.button::after,
.panel-button::after,
.ghost-button::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: inherit;
  pointer-events: none;
}

.button,
.panel-button {
  background: rgba(183, 178, 255, 0.76);
  box-shadow: 0 12px 24px rgba(100, 86, 165, 0.14);
}

.hero .panel-button.alt {
  background: rgba(255, 255, 255, 0.96);
  color: #223150;
  border-color: rgba(255, 255, 255, 0.18);
}

.hero #new-connection {
  background: linear-gradient(135deg, #dff6e7 0%, #c8efd6 100%);
  color: #1d5a3b;
  border-color: rgba(70, 145, 100, 0.34);
}

#open-network-scan-modal,
#open-bulk-admin-credentials-modal {
  background: linear-gradient(135deg, #ffe8c7 0%, #ffd7a2 100%);
  color: #8d4f08;
  border-color: rgba(196, 122, 23, 0.32);
}

.hero .panel-button.warning-soft {
  background: linear-gradient(135deg, #ffd7a2 0%, #ffbf6f 100%);
  color: #8a4700;
  border-color: rgba(201, 118, 15, 0.36);
  box-shadow: 0 16px 30px rgba(184, 118, 25, 0.2);
}

.hero #account-menu-button {
  background: linear-gradient(135deg, #eef9f1 0%, #dbf2e2 100%);
  color: #1f5c3d;
  border-color: rgba(62, 152, 98, 0.34);
}

.panel-button.alt,
.ghost-button {
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
}

.text-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-ink);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  box-shadow: none;
}

.selection-button {
  min-height: 44px;
  padding: 0.58rem 1.15rem;
}

.ghost-button.danger {
  color: #8f3d3d;
  border-color: rgba(143, 61, 61, 0.24);
  background: rgba(255, 235, 235, 0.9);
}

.panel-button.danger-soft {
  color: #a33f3f;
  border-color: rgba(176, 74, 74, 0.28);
  background: linear-gradient(135deg, rgba(255, 238, 238, 0.98) 0%, rgba(255, 226, 226, 0.94) 100%);
  box-shadow: 0 12px 22px rgba(163, 63, 63, 0.12);
}

.ghost-button[data-action="open-designs-manager"] {
  background: linear-gradient(135deg, #ffe8c7 0%, #ffd7a2 100%);
  color: #8d4f08;
  border-color: rgba(196, 122, 23, 0.32);
}

.button:hover,
.panel-button:hover,
.ghost-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.panel-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.button:hover,
.panel-button:hover {
  background: rgba(183, 178, 255, 0.92);
  box-shadow: 0 16px 28px rgba(100, 86, 165, 0.16);
}

.hero .panel-button.alt:hover {
  background: #ffffff;
  box-shadow: 0 16px 28px rgba(19, 29, 55, 0.16);
}

.hero #new-connection:hover {
  background: linear-gradient(135deg, #e8fbef 0%, #d3f4df 100%);
  box-shadow: 0 16px 28px rgba(34, 114, 70, 0.16);
}

#open-network-scan-modal:hover,
#open-bulk-admin-credentials-modal:hover {
  background: linear-gradient(135deg, #fff0d7 0%, #ffe0b4 100%);
  box-shadow: 0 16px 28px rgba(191, 123, 27, 0.18);
}

.hero .panel-button.warning-soft:hover {
  background: linear-gradient(135deg, #ffe2b8 0%, #ffc97f 100%);
  box-shadow: 0 18px 30px rgba(184, 118, 25, 0.24);
}

.hero #account-menu-button:hover {
  background: linear-gradient(135deg, #f5fdf7 0%, #e4f7ea 100%);
  box-shadow: 0 16px 28px rgba(34, 114, 70, 0.18);
}

.ghost-button:hover {
  background: #fff;
  border-color: var(--line-strong);
}

body[data-theme='dark'] .button:hover,
body[data-theme='dark'] .panel-button:hover,
body[data-theme='dark'] .ghost-button:hover,
body[data-theme='dark'] .jeedoms-toggle-button:hover {
  background: rgba(183, 178, 255, 0.18);
  color: var(--ink);
  border-color: rgba(183, 178, 255, 0.42);
  box-shadow: 0 14px 26px rgba(3, 8, 20, 0.24);
}

body[data-theme='dark'] .hero .panel-button.alt:hover,
body[data-theme='dark'] .hero #account-menu-button:hover {
  background: rgba(183, 178, 255, 0.2);
  color: var(--ink);
  border-color: rgba(183, 178, 255, 0.44);
  box-shadow: 0 16px 28px rgba(3, 8, 20, 0.24);
}

body[data-theme='dark'] .ghost-button.danger:hover,
body[data-theme='dark'] .panel-button.danger-soft:hover {
  background: rgba(143, 61, 61, 0.22);
  color: #ffd7d7;
  border-color: rgba(221, 103, 103, 0.42);
  box-shadow: 0 14px 26px rgba(38, 10, 10, 0.26);
}

body[data-theme='dark'] #open-network-scan-modal:hover,
body[data-theme='dark'] #open-bulk-admin-credentials-modal:hover,
body[data-theme='dark'] .ghost-button[data-action="open-designs-manager"]:hover {
  background: rgba(217, 136, 27, 0.2);
  color: #ffe8b3;
  border-color: rgba(214, 158, 46, 0.42);
  box-shadow: 0 14px 26px rgba(44, 28, 6, 0.24);
}

body[data-theme='dark'] #open-group-rights-modal:hover,
body[data-theme='dark'] #open-group-allowed-connections-modal:hover,
body[data-theme='dark'] .ghost-button.rights-tab:hover {
  background: rgba(183, 178, 255, 0.2);
  color: var(--ink);
  border-color: rgba(183, 178, 255, 0.46);
  box-shadow: 0 16px 28px rgba(3, 8, 20, 0.24);
}

body[data-theme='dark'] .ghost-button[data-action="remote-page"]:hover,
body[data-theme='dark'] .ghost-button[data-action="copy-remote-url"]:hover,
body[data-theme='dark'] .ghost-button[data-action="show-more-remote-pages"]:hover,
body[data-theme='dark'] #open-remote-pages-menu:hover {
  background: rgba(183, 178, 255, 0.18);
  color: var(--ink);
  border-color: rgba(183, 178, 255, 0.42);
  box-shadow: 0 12px 24px rgba(3, 8, 20, 0.22);
}

.ghost-button[data-action="open-designs-manager"]:hover {
  background: linear-gradient(135deg, #fff0d7 0%, #ffe0b4 100%);
  box-shadow: 0 16px 28px rgba(191, 123, 27, 0.18);
  border-color: rgba(196, 122, 23, 0.4);
}

.text-button:hover {
  color: var(--ink);
}

.theme-toggle-button {
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.5rem 0.9rem;
}

.theme-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.98rem;
  line-height: 1;
}

.theme-toggle-copy {
  font-weight: 800;
}

@media (max-width: 980px) {
  .auth-branding-layout {
    width: min(100%, 520px);
    margin-inline: auto;
  }

  .auth-card {
    width: 100%;
    justify-self: center;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
    align-items: stretch;
  }

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

  .sub-actions {
    flex-wrap: wrap;
  }

  .cards-toolbar {
    align-items: stretch;
  }

  .cards-toolbar-main,
  .cards-toolbar-secondary {
    width: 100%;
  }

  .jeedoms-toggle-button {
    width: 100%;
  }

  .editor-head {
    flex-direction: column;
  }

  .master-help-copy {
    white-space: normal;
  }

  .rights-table-head,
  .rights-row {
    grid-template-columns: 1fr;
  }

  .rights-table-head {
    display: none;
  }

  .rights-table-body {
    max-height: min(52vh, 520px);
  }

  .rights-row {
    gap: 0.55rem;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 1rem, 100%);
    padding-top: 1rem;
  }

  .auth-shell,
  .modal-backdrop {
    padding: 0.8rem;
  }

  .auth-branding-layout {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .auth-branding-header {
    gap: 0.8rem;
    min-height: 86px;
  }

  .hero,
  .auth-card,
  .modal-card,
  .card {
    border-radius: 18px;
  }

  .branding-admin-grid {
    grid-template-columns: 1fr;
  }

  .jeedoms-toggle-button {
    min-height: 58px;
    padding: 0.8rem 0.85rem 0.8rem 0.9rem;
  }

  .jeedoms-toggle-copy strong {
    font-size: 0.93rem;
  }

  h1 {
    font-size: 2.15rem;
  }

  .card h2 {
    font-size: 1.65rem;
  }

  .field input,
  .select-input {
    min-height: 48px;
  }

  .remote-pages-grid {
    border: 0;
    background: transparent;
  }

  .remote-pages-grid-head {
    display: none;
  }

  .remote-pages-list {
    max-height: min(52vh, 460px);
    gap: 0.8rem;
  }

  .remote-page-row {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.8rem;
    border: 1px solid rgba(31, 43, 74, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
  }

  .remote-page-actions {
    justify-content: stretch;
  }

  .remote-page-actions .icon-button {
    width: 100%;
  }

  .rights-actions {
    align-items: stretch;
  }

  .compact-field {
    min-width: 100%;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes jeedomCardReveal {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes loaderSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
