/* [project]/packages/shared-ui/globals.css [app-client] (css) */
:root {
  --bg: #f5f6fa;
  --surface: #fff;
  --surface-2: #f0f1f7;
  --border: #e6e8f0;
  --ink: #11131a;
  --muted: #6b7086;
  --muted-2: #9298ab;
  --brand: #16a34a;
  --brand-dark: #0f6e37;
  --brand-soft: #e7f7ee;
  --accent: #7c5cff;
  --accent-soft: #efeaff;
  --lime: #d3f26a;
  --danger: #e5484d;
  --warning: #d99a2b;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px #11131a0d, 0 1px 1px #11131a0a;
  --shadow-md: 0 8px 24px #11131a12, 0 2px 6px #11131a0a;
  --shadow-lg: 0 20px 50px #11131a1f, 0 6px 16px #11131a0f;
  --sidebar-bg: #0d1310;
  --sidebar-ink: #e8ede9;
  --sidebar-muted: #8b9a90;
  --sidebar-active: #1a241d;
  --lightningcss-light: initial;
  --lightningcss-dark: ;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c10;
    --surface: #15171e;
    --surface-2: #1b1e27;
    --border: #262a35;
    --ink: #f2f3f7;
    --muted: #9a9fb0;
    --muted-2: #6d7285;
    --brand: #34d399;
    --brand-dark: #10b981;
    --brand-soft: #103322;
    --accent: #9c8bff;
    --accent-soft: #241f3d;
    --shadow-sm: 0 1px 2px #0006;
    --shadow-md: 0 8px 24px #00000073;
    --shadow-lg: 0 24px 60px #0000008c;
    --lightningcss-light: ;
    --lightningcss-dark: initial;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Inter, Roboto, Helvetica, Arial, sans-serif;
  transition: background-color .2s, color .2s;
}

a {
  color: inherit;
  text-decoration: none;
}

input[type="checkbox"] {
  accent-color: var(--brand);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%237b8794' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  padding-right: 36px !important;
}

h1, h2, h3 {
  letter-spacing: -.03em;
  font-weight: 700;
}

p {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

button {
  font-family: inherit;
}

.app-shell {
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  display: grid;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  flex-direction: column;
  gap: 8px;
  height: 100vh;
  padding: 26px 18px;
  display: flex;
  position: sticky;
  top: 0;
}

.brand {
  letter-spacing: -.02em;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 28px;
  font-size: 18px;
  font-weight: 800;
  display: flex;
}

.sidebar-head {
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  display: flex;
}

.sidebar-head .brand {
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}

.sidebar-collapse-toggle {
  display: none;
}

.brand .mark {
  background: linear-gradient(135deg, var(--lime), var(--brand));
  color: #0d1310;
  letter-spacing: 0;
  border-radius: 10px;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 13px;
  font-weight: 900;
  display: inline-grid;
}

.mark-logo img {
  object-fit: contain;
  display: block;
}

.brand .mark-logo {
  background: none;
}

.brand .mark-logo img {
  width: 100%;
  height: 100%;
}

.login-visual-brand .mark-logo img {
  width: 36px;
  height: 36px;
}

.nav-section {
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 14px 12px 6px;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-home-switcher {
  margin: 4px 0 6px;
  position: relative;
}

.sidebar-home-switcher-trigger {
  border-radius: var(--radius-sm);
  background: var(--sidebar-active);
  width: 100%;
  color: var(--sidebar-ink);
  font: inherit;
  cursor: pointer;
  text-align: left;
  border: 1px solid #ffffff1a;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
}

.sidebar-home-switcher-trigger:hover {
  background: #ffffff14;
}

.sidebar-home-switcher-trigger:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 1px;
}

.sidebar-home-switcher-icon {
  width: 16px;
  height: 16px;
  color: var(--sidebar-muted);
  flex-shrink: 0;
  display: flex;
}

.sidebar-home-switcher-icon svg {
  width: 16px;
  height: 16px;
}

.sidebar-home-switcher-name {
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  overflow: hidden;
}

.sidebar-home-switcher-chevron {
  color: var(--sidebar-muted);
  flex-shrink: 0;
}

.sidebar-home-switcher-menu {
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  gap: 2px;
  padding: 6px;
  display: grid;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
}

.sidebar-home-switcher-menu button {
  border-radius: var(--radius-sm);
  width: 100%;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
}

.sidebar-home-switcher-menu button:hover {
  background: var(--surface-2);
}

.sidebar-home-switcher-menu button.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
}

.sidebar-home-switcher-menu .sidebar-home-switcher-icon {
  color: inherit;
}

nav.primary-nav {
  gap: 2px;
  display: grid;
}

nav.primary-nav a {
  border-radius: var(--radius-sm);
  color: var(--sidebar-muted);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  transition: background-color .15s, color .15s;
  display: flex;
}

nav.primary-nav a svg {
  opacity: .85;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

nav.primary-nav a:hover {
  color: var(--sidebar-ink);
  background: var(--sidebar-active);
}

nav.primary-nav a[data-active="true"] {
  color: #fff;
  background: var(--sidebar-active);
  box-shadow: inset 0 0 0 1px #ffffff0f;
}

nav.primary-nav a[data-active="true"] svg {
  opacity: 1;
  color: var(--lime);
}

.sidebar-profile {
  border-top: 1px solid #ffffff14;
  margin-top: auto;
  padding-top: 14px;
  position: relative;
}

.sidebar-profile-trigger {
  border-radius: var(--radius-sm);
  width: 100%;
  color: var(--sidebar-ink);
  cursor: pointer;
  text-align: left;
  background: none;
  border: 0;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  transition: background-color .15s;
  display: flex;
}

.sidebar-profile-trigger:hover {
  background: var(--sidebar-active);
}

.sidebar-profile-icon {
  background: var(--sidebar-active);
  width: 32px;
  height: 32px;
  color: var(--sidebar-ink);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
  position: relative;
  overflow: hidden;
}

.sidebar-profile-name {
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
}

.profile-dropdown.profile-dropdown-sidebar {
  width: auto;
  position: absolute;
  inset: auto 0 calc(100% + 8px);
}

.content-topbar {
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  display: flex;
}

.profile-menu {
  position: relative;
}

.profile-trigger {
  background: linear-gradient(135deg, var(--lime), var(--brand));
  color: #0d1310;
  cursor: pointer;
  border: 0;
  border-radius: 50%;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 14px;
  font-weight: 800;
  transition: box-shadow .15s;
  display: inline-grid;
  position: relative;
  overflow: hidden;
}

.profile-trigger:hover {
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.profile-avatar-img {
  object-fit: cover;
  border-radius: 50%;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.profile-menu-scrim {
  z-index: 59;
  position: fixed;
  inset: 0;
}

.profile-dropdown {
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 200px;
  box-shadow: var(--shadow-lg);
  gap: 2px;
  padding: 14px;
  display: grid;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
}

.profile-dropdown-name {
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
}

.profile-dropdown-email, .profile-dropdown-home {
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  overflow: hidden;
}

.profile-dropdown-home {
  margin-bottom: 10px;
}

.profile-dropdown-role {
  color: var(--muted);
  margin-bottom: 10px;
  font-size: 11px;
}

.profile-dropdown-signout {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  transition: background-color .15s;
}

.profile-dropdown-signout:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.profile-dropdown-manage {
  color: var(--brand-dark);
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.notification-bell {
  position: relative;
}

.notification-bell-trigger {
  border: 1px solid var(--border);
  background: var(--surface);
  width: 38px;
  height: 38px;
  color: var(--ink);
  cursor: pointer;
  border-radius: 50%;
  place-items: center;
  transition: background-color .15s, border-color .15s;
  display: inline-grid;
  position: relative;
}

.notification-bell-trigger:hover {
  background: var(--surface-2);
  border-color: var(--brand);
}

.notification-bell-badge {
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  display: inline-grid;
  position: absolute;
  top: -2px;
  right: -2px;
}

.notification-bell-warning {
  color: #1a1300;
  border: 2px solid var(--surface);
  background: #f59e0b;
  border-radius: 999px;
  place-items: center;
  width: 16px;
  height: 16px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  display: inline-grid;
  position: absolute;
  bottom: -2px;
  left: -2px;
}

.notification-push-error {
  color: var(--danger);
}

.notification-dropdown {
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 420px;
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  display: flex;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  overflow: hidden;
}

.notification-dropdown-header {
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  display: flex;
}

.notification-dropdown-header p {
  color: var(--ink);
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.notification-dropdown-header button {
  color: var(--brand-dark);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.notification-enable-push {
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-dark);
  cursor: pointer;
  text-align: left;
  margin: 10px 14px 0;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
}

.notification-push-hint {
  color: var(--muted);
  margin: 10px 14px 0;
  font-size: 12px;
  line-height: 1.5;
}

.notification-empty {
  text-align: center;
  color: var(--muted);
  padding: 24px 14px;
  font-size: 13px;
}

.notification-list {
  overflow-y: auto;
}

.notification-row {
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  transition: background-color .15s;
  display: flex;
}

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

.notification-row:hover {
  background: var(--surface-2);
}

.notification-row-unread {
  background: var(--brand-soft);
}

.notification-row-unread:hover {
  background: var(--brand-soft);
  filter: brightness(.97);
}

.notification-row-main {
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  flex-direction: column;
  flex: 1;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 10px 14px;
  display: flex;
}

.notification-row-delete {
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: 0;
  flex-shrink: 0;
  padding: 10px 14px 10px 0;
  font-size: 18px;
  line-height: 1;
}

.notification-row-delete:hover {
  color: var(--danger);
}

.notification-row-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.notification-row-body {
  color: var(--muted);
  font-size: 12px;
}

.notification-row-time {
  color: var(--muted);
  margin-top: 2px;
  font-size: 11px;
}

.profile-dropdown-manage:hover {
  color: var(--brand);
}

.auth-loading {
  background: var(--bg);
  min-height: 100vh;
  color: var(--muted);
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  display: grid;
}

.menu-toggle {
  background: var(--sidebar-active);
  color: var(--sidebar-ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 0;
  justify-content: center;
  align-items: center;
  width: 38px;
  height: 38px;
  display: none;
}

.content {
  width: 100%;
  max-width: 1240px;
  padding: 40px clamp(20px, 4vw, 64px) 80px;
}

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

.eyebrow {
  color: var(--brand);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.drawer-device-type {
  font-size: 15px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.4vw, 42px);
}

h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.status-card-group {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  display: flex;
}

.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  display: flex;
}

.status-card p {
  color: var(--ink);
  white-space: nowrap;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.pulse {
  background: var(--warning);
  border-radius: 50%;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  position: relative;
}

.pulse.online {
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.pulse.online:after {
  content: "";
  border: 1px solid var(--brand);
  opacity: .5;
  border-radius: 50%;
  animation: 2s ease-out infinite pulse-ring;
  position: absolute;
  inset: -4px;
}

.pulse.offline {
  background: var(--danger);
}

@keyframes pulse-ring {
  0% {
    opacity: .6;
    transform: scale(.8);
  }

  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

.grid {
  grid-template-columns: 1fr;
  gap: 18px;
  display: grid;
}

.hero-card, .empty-panel, .device-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  transition: box-shadow .2s, transform .2s;
}

.hero-card {
  color: #fff;
  background: radial-gradient(120% 140% at 0 0, #1d5c42 0%, #0f2f22 60%, #0b1f17 100%);
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  display: flex;
  position: relative;
  overflow: hidden;
}

.hero-card:after {
  content: "";
  background: radial-gradient(circle, #d3f26a40, #0000 70%);
  border-radius: 50%;
  width: 220px;
  height: 220px;
  position: absolute;
  bottom: -60px;
  right: -60px;
}

.hero-card p:not(.eyebrow) {
  color: #cfe3d7;
  max-width: 430px;
}

.hero-card .eyebrow {
  color: var(--lime);
}

.hero-card h2 {
  font-size: 26px;
}

.hero-card a {
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  background: #ffffff1f;
  border-radius: 999px;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 16px;
  padding: 10px 16px;
  font-weight: 700;
  transition: background-color .15s;
  display: inline-flex;
}

.hero-card a:hover {
  background: #fff3;
}

.empty-panel {
  max-width: 760px;
  margin-top: 8px;
}

.empty-panel h1 {
  margin-top: 0;
}

.wide-panel {
  max-width: 1080px;
}

.account-page {
  max-width: 820px;
  margin: 8px auto 0;
}

.account-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 24px;
  margin-top: 24px;
  display: grid;
}

.account-main-column {
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  display: flex;
}

.account-page .account-layout .panel-section {
  margin-top: 0;
}

.my-sessions {
  flex-direction: column;
  gap: 14px;
  display: flex;
}

.my-sessions-row {
  gap: 6px;
}

.my-sessions-row-header {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  display: flex;
}

.my-sessions-device {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .account-layout {
    grid-template-columns: 1fr;
  }
}

.account-edit-button {
  margin-top: 16px;
}

.panel-section {
  margin-top: 32px;
}

.panel-section:first-of-type {
  margin-top: 24px;
}

.panel-section h2 {
  font-size: 17px;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 20px 0 8px;
  display: grid;
}

.stat-grid .metric-card {
  min-height: 128px;
  padding: 20px;
}

.stat-grid strong {
  font-size: 36px;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 4px;
  overflow-x: auto;
}

table.data-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 13px;
}

table.data-table th, table.data-table td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  padding: 12px 16px;
}

table.data-table th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
}

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

table.data-table tbody tr:hover {
  background: var(--surface-2);
}

table.data-table tbody tr.clickable-row {
  cursor: pointer;
}

table.data-table td.mono {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

table.data-table td.audit-details {
  text-overflow: ellipsis;
  max-width: 320px;
  overflow: hidden;
}

.date-range-picker {
  position: relative;
}

.date-range-trigger {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
}

.date-range-trigger:hover {
  border-color: var(--brand);
}

.date-range-trigger svg {
  color: var(--muted-2);
  flex-shrink: 0;
}

.date-range-scrim {
  z-index: 59;
  position: fixed;
  inset: 0;
}

.date-range-popover {
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 280px;
  box-shadow: var(--shadow-lg);
  padding: 14px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
}

.date-range-popover-header {
  color: var(--ink);
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
}

.date-range-popover-header button {
  background: var(--surface-2);
  color: var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 0;
  width: 26px;
  height: 26px;
  font-size: 16px;
  line-height: 1;
}

.date-range-popover-header button:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.date-range-popover-select-group {
  flex: 1;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  display: flex;
}

.date-range-popover-select-group select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background-color: var(--surface);
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
  padding: 4px 24px 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.date-range-popover-select-group select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}

.date-range-weekdays, .date-range-grid {
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  display: grid;
}

.date-range-weekdays span {
  text-align: center;
  color: var(--muted-2);
  padding-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
}

.date-range-day {
  color: var(--ink);
  font: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 7px 0;
  font-size: 12px;
}

.date-range-day:hover {
  background: var(--surface-2);
}

.date-range-day-inrange {
  background: var(--brand-soft);
  border-radius: 0;
}

.date-range-day-selected {
  background: var(--brand);
  color: #04150c;
  font-weight: 700;
}

.date-range-day-today:not(.date-range-day-selected) {
  box-shadow: inset 0 0 0 1px var(--brand);
}

.date-range-clear {
  width: 100%;
  margin-top: 10px;
}

.audit-pagination {
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 13px;
  display: flex;
}

.audit-pagination-controls {
  align-items: center;
  gap: 12px;
  display: flex;
}

.audit-pagination-controls .secondary-button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.badge {
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
}

.badge-admin {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-online {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.badge-offline {
  background: var(--surface-2);
  color: var(--muted-2);
}

.badge-update {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-debug {
  color: var(--muted);
  background: #94a3b81f;
}

.badge-info {
  color: #60a5fa;
  background: #60a5fa1f;
}

.badge-warn {
  color: #fbbf24;
  background: #fbbf241f;
}

.badge-error {
  color: #f87171;
  background: #f871711f;
}

.device-row-firmware {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.icon-button {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--danger);
  cursor: pointer;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  transition: background-color .15s;
}

.icon-button:hover {
  background: #fbeaea;
}

.icon-button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.icon-button-positive {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--brand-dark);
  cursor: pointer;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  transition: background-color .15s;
}

.icon-button-positive:hover {
  background: var(--brand-soft);
}

.icon-button-positive:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.upload-form {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-top: 4px;
  padding: 18px;
  display: flex;
}

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

.upload-form input, .upload-form select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background-color: var(--surface);
  color: var(--ink);
  padding: 9px 12px;
  font-size: 13px;
}

.upload-form button {
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #04150c;
  cursor: pointer;
  border: 0;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
}

.upload-form button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.login-page {
  background: var(--bg);
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
  display: grid;
}

.login-visual {
  color: #fff;
  background: radial-gradient(130% 130% at 20% 10%, #1d5c42 0%, #0f2f22 55%, #060b08 100%);
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 48px;
  display: flex;
  position: relative;
  overflow: hidden;
}

.login-visual:after {
  content: "";
  background: radial-gradient(circle, #d3f26a38, #0000 70%);
  border-radius: 50%;
  width: 320px;
  height: 320px;
  position: absolute;
  top: -80px;
  right: -80px;
}

.login-visual-brand {
  align-items: center;
  gap: 12px;
  display: flex;
  position: absolute;
  top: 48px;
  left: 48px;
}

.login-visual-org {
  letter-spacing: .06em;
  color: #cfe3d7;
  font-size: 13px;
  font-weight: 700;
}

.login-visual-title {
  letter-spacing: -.03em;
  color: #fff;
  max-width: 360px;
  margin: 0;
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
}

.login-visual-footer {
  color: #ffffff8c;
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  position: absolute;
  bottom: 40px;
  left: 48px;
}

.login-visual-footer strong {
  color: #fffc;
  font-weight: 700;
}

.login-form-side {
  place-items: center;
  padding: 24px;
  display: grid;
}

.login-page section {
  width: 100%;
  max-width: 420px;
  padding: 8px;
}

.login-page form {
  gap: 14px;
  margin: 26px 0 18px;
  display: grid;
}

.login-page label {
  color: var(--ink);
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  display: grid;
}

.login-page input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}

.login-page input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}

.login-page form button {
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #04150c;
  cursor: pointer;
  border: 0;
  margin-top: 6px;
  padding: 13px;
  font-weight: 700;
  transition: transform .15s, box-shadow .15s;
}

.login-page form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px #16a34a4d;
}

.login-page .password-toggle {
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 0;
  margin-top: 0;
  padding: 4px;
  font-weight: normal;
}

.login-page .password-toggle:hover {
  box-shadow: none;
  color: var(--ink);
  transform: none;
}

.form-error {
  color: var(--danger);
  margin: -4px 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.login-alt-action {
  color: var(--muted);
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
}

.login-alt-action a {
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}

.login-alt-action a:hover {
  text-decoration: underline;
}

.member-shell {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eaf1ff;
  --lime: #93c5fd;
}

@media (prefers-color-scheme: dark) {
  .member-shell {
    --brand: #60a5fa;
    --brand-dark: #3b82f6;
    --brand-soft: #17233a;
    --lime: #7dd3fc;
  }
}

.login-page.member-login {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --lime: #93c5fd;
}

.login-page.member-login .login-visual {
  background: radial-gradient(130% 130% at 20% 10%, #1e3a6e 0%, #10203f 55%, #060a14 100%);
}

.login-page.member-login .login-visual:after {
  background: radial-gradient(circle, #7dd3fc38, #0000 70%);
}

.login-page.member-login form button:hover {
  box-shadow: 0 10px 24px #2563eb4d;
}

.member-shell .hero-card {
  background: radial-gradient(120% 140% at 0 0, #1e3a6e 0%, #10203f 60%, #0a1428 100%);
}

.member-shell .hero-card:after {
  background: radial-gradient(circle, #7dd3fc40, #0000 70%);
}

.panel-toolbar {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 16px;
  display: flex;
}

.playground-panel-toolbar {
  justify-content: flex-end;
  margin-top: 0;
}

.panel-toolbar-end {
  justify-content: flex-end;
  margin-top: 20px;
  margin-bottom: 16px;
  display: flex;
}

.row-actions {
  gap: 8px;
  display: flex;
}

.row-actions-equal {
  margin-top: auto;
}

.row-actions-equal > button {
  text-align: center;
  flex: 1;
  padding: 12px;
}

.tab-group {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 4px;
  padding: 4px;
  display: flex;
}

.tab-group button {
  color: var(--ink-muted, var(--ink));
  font: inherit;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, color .15s;
}

.tab-group button[data-active="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px #00000014;
}

.search-input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 200px;
  max-width: 360px;
  font: inherit;
  background: var(--surface-2);
  color: var(--ink);
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}

.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}

.device-picker {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.device-picker-trigger {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  width: 100%;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color .15s;
  display: flex;
}

.device-picker-trigger:hover {
  border-color: var(--brand);
}

.device-picker-trigger-label {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.device-picker-trigger svg {
  color: var(--muted-2);
  flex-shrink: 0;
}

.device-picker-scrim {
  z-index: 59;
  position: fixed;
  inset: 0;
}

.device-picker-list {
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 240px;
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  display: flex;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  overflow-y: auto;
}

.device-picker-item {
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  display: flex;
}

.device-picker-item:hover {
  background: var(--surface-2);
}

.device-picker-item-main {
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  display: flex;
}

.device-picker-item-main strong {
  font-size: 13px;
}

.device-picker-item-main span.mono {
  color: var(--muted-2);
  font-size: 11px;
}

.device-picker-empty {
  color: var(--muted);
  margin: 0;
  padding: 10px;
  font-size: 13px;
}

.primary-button {
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #04150c;
  cursor: pointer;
  border: 0;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  transition: transform .15s, box-shadow .15s;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px #16a34a4d;
}

.claim-device-id {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 10px 10px 16px;
  display: flex;
}

.claim-device-id code {
  letter-spacing: .02em;
  color: var(--ink);
  flex: 1;
  font-size: 14px;
  font-weight: 700;
}

.claim-device-id button {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--brand-dark);
  cursor: pointer;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  transition: background-color .15s;
}

.claim-device-id + label {
  margin-top: 14px;
}

.field-hint {
  color: var(--muted-2);
  margin-top: -4px;
  font-size: 12px;
}

.claim-device-id button:hover {
  background: var(--brand-soft);
}

.device-list {
  gap: 12px;
  margin-top: 20px;
  display: grid;
}

.device-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  transition: box-shadow .15s, border-color .15s;
  display: flex;
}

.device-row:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}

.device-row-main h2 {
  margin-bottom: 2px;
  font-size: 16px;
}

.device-row-id {
  color: var(--muted-2);
  font-size: 12px;
}

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

.drawer-section {
  flex-direction: column;
  gap: 10px;
  display: flex;
}

.member-history-list {
  flex-direction: column;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
}

.history-retention-card {
  margin: 24px 0;
}

.premium-payment-card {
  margin-top: 24px;
}

.admin-user-home-list, .admin-user-home-devices {
  flex-direction: column;
  gap: 10px;
  display: flex;
}

.admin-user-home-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 14px;
}

.admin-user-home-heading {
  color: var(--muted);
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
  display: flex;
}

.admin-user-home-heading > div {
  flex-direction: column;
  gap: 3px;
  display: flex;
}

.admin-user-home-heading strong {
  color: var(--ink);
  font-size: 15px;
}

.admin-user-home-heading > div > span {
  color: var(--brand-dark);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

.admin-user-home-details {
  gap: 7px;
  margin: 12px 0;
  font-size: 12px;
  display: grid;
}

.admin-user-home-details > div {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  display: grid;
}

.admin-user-home-details dt, .admin-user-home-devices > p {
  color: var(--muted);
  font-weight: 700;
}

.admin-user-home-details dd, .admin-user-home-devices > p {
  margin: 0;
}

.admin-user-home-device {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  display: flex;
}

.admin-user-home-device span, .admin-user-home-devices > span {
  color: var(--muted);
  font-size: 12px;
}

.automation-form-card {
  margin-top: 24px;
}

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

.automation-full-field {
  grid-column: 1 / -1;
}

.automation-full-field > span:first-child {
  color: var(--muted);
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
  display: block;
}

.automation-form select, .automation-form input[type="datetime-local"], .automation-form input[type="time"] {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background-color: var(--surface-2);
  color: var(--ink);
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}

.automation-form select:focus, .automation-form input[type="datetime-local"]:focus, .automation-form input[type="time"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}

.automation-form > label {
  min-width: 0;
  color: var(--muted);
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
}

.automation-weekday-picker {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -4px;
  display: flex;
}

.automation-weekday-pill {
  border: 1px solid var(--border);
  background: var(--surface-2);
  min-width: 46px;
  height: 36px;
  color: var(--ink);
  cursor: pointer;
  border-radius: 999px;
  justify-content: center;
  align-items: center;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  transition: background-color .15s, border-color .15s, color .15s;
  display: inline-flex;
}

.automation-weekday-pill:hover {
  border-color: var(--brand);
}

.automation-weekday-pill-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #04150c;
}

.automation-weekday-pill:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.automation-form .row-actions {
  grid-column: 1 / -1;
}

.automation-timezone {
  color: var(--muted);
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}

.automation-list-section {
  margin-top: 24px;
}

.automation-list {
  flex-direction: column;
  gap: 10px;
  display: flex;
}

.automation-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px;
  display: flex;
}

.automation-row > div:first-child {
  flex-direction: column;
  gap: 4px;
  display: flex;
}

.automation-row span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 640px) {
  .automation-form {
    grid-template-columns: 1fr;
  }

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

.history-retention-controls {
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
  display: flex;
}

.history-retention-controls label {
  color: var(--muted);
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
}

.history-retention-controls input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 110px;
  font: inherit;
  background: var(--surface-2);
  color: var(--ink);
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}

.history-retention-controls input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}

.member-history-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  width: 100%;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 15px 16px;
  display: flex;
}

.member-history-item:hover {
  border-color: var(--brand);
}

.member-history-item > div, .member-history-meta {
  flex-direction: column;
  gap: 4px;
  display: flex;
}

.member-history-item strong {
  color: var(--ink);
}

.member-history-item span, .member-history-item time {
  color: var(--muted);
  font-size: 13px;
}

.member-history-meta {
  text-align: right;
  flex-shrink: 0;
  align-items: flex-end;
}

@media (max-width: 640px) {
  .member-history-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .member-history-meta {
    text-align: left;
    align-items: flex-start;
  }
}

.device-row-static {
  cursor: default;
}

.device-row-static:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

.device-row-date {
  color: var(--muted-2);
  white-space: nowrap;
  font-size: 12px;
}

.device-row-owner {
  color: var(--muted);
  white-space: nowrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
}

.device-row-owner-name {
  color: var(--brand-dark);
  font-weight: 700;
}

.message-banner {
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 4px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
}

.message-banner-error {
  color: var(--danger);
  background: #fbeaea;
}

.toast-stack {
  z-index: 80;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, 100vw - 32px);
  display: flex;
  position: fixed;
  bottom: 24px;
  right: 24px;
}

.toast {
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  animation: .2s toast-in;
}

.toast-success {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.toast-error {
  border-color: var(--danger);
  color: var(--danger);
  background: #fbeaea;
}

.toast-info {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .toast-stack {
    max-width: none;
    bottom: 16px;
    left: 16px;
    right: 16px;
  }
}

@media (max-width: 980px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }
}

.sidebar-profile {
  display: none;
}

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

  .sidebar {
    z-index: 40;
    width: 250px;
    box-shadow: var(--shadow-lg);
    transition: transform .2s;
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
  }

  .sidebar[data-open="true"] {
    transform: translateX(0);
  }

  .topbar {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px clamp(20px, 4vw, 64px) 0;
    display: flex;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .content-topbar {
    display: none;
  }

  .sidebar-profile {
    display: block;
  }

  .content {
    padding-top: 16px;
  }

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

  .page-header {
    display: grid;
  }

  .sidebar-scrim {
    z-index: 30;
    background: #0006;
    display: block;
    position: fixed;
    inset: 0;
  }
}

@media (min-width: 801px) {
  .topbar, .sidebar-scrim {
    display: none;
  }

  .sidebar-collapse-toggle {
    width: 24px;
    height: 24px;
    color: var(--sidebar-muted);
    cursor: pointer;
    background: none;
    border: 1px solid #ffffff26;
    border-radius: 6px;
    flex-shrink: 0;
    place-items: center;
    padding: 0;
    font-size: 13px;
    line-height: 1;
    display: grid;
  }

  .sidebar-collapse-toggle:hover {
    background: var(--sidebar-active);
    color: var(--sidebar-ink);
  }

  .app-shell[data-sidebar-collapsed="true"] {
    grid-template-columns: 76px 1fr;
  }

  .sidebar[data-collapsed="true"] {
    padding-left: 14px;
    padding-right: 14px;
  }

  .sidebar[data-collapsed="true"] .sidebar-head {
    flex-direction: column;
    gap: 10px;
  }

  .sidebar[data-collapsed="true"] .brand {
    justify-content: center;
    padding: 0;
  }

  .sidebar[data-collapsed="true"] .brand .mark {
    width: 30px;
    height: 30px;
  }

  .sidebar[data-collapsed="true"] .nav-section {
    display: none;
  }

  .sidebar[data-collapsed="true"] nav.primary-nav a {
    justify-content: center;
    padding: 10px;
  }

  .app-shell[data-sidebar-collapsed="true"] .content {
    max-width: 1600px;
  }
}

.modal-overlay {
  z-index: 70;
  background: #090d0b8c;
  place-items: safe center;
  padding: 24px;
  display: grid;
  position: fixed;
  inset: 0;
  overflow-y: auto;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  overflow-wrap: anywhere;
  padding: 26px;
}

.conflict-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  max-height: 240px;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 10px 0 0;
  padding: 12px;
  font: 12px / 1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow: auto;
}

.wide-modal-card {
  max-width: 720px;
}

.device-log-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  display: flex;
}

.device-log-row:hover {
  border-color: var(--brand);
}

.device-log-row-name {
  color: var(--ink);
  font-weight: 700;
}

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

.playground-modal-card {
  position: relative;
}

.playground-modal-card .modal-close-button {
  position: absolute;
  top: 18px;
  right: 18px;
}

.modal-close-button {
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  border: 0;
  border-radius: 50%;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  font-size: 18px;
  line-height: 1;
}

.library-manager-card .modal-close-button {
  color: #ccc;
  background: #2d2d2d;
}

.library-manager-card .modal-close-button:hover {
  background: #3f3f46;
}

.modal-header h2 {
  margin: 0;
}

.modal-card > h2 {
  margin: 0 0 8px;
}

.modal-card > p, .modal-card > .primary-button {
  margin-bottom: 16px;
}

.modal-card form {
  gap: 14px;
  display: grid;
}

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

.required-mark {
  color: var(--danger);
}

.modal-card select, .modal-card input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background-color: var(--surface-2);
  color: var(--ink);
  padding: 10px 14px;
  font-size: 14px;
}

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

.settings-card select, .settings-card input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background-color: var(--surface-2);
  color: var(--ink);
  padding: 10px 14px;
  font-size: 14px;
}

.settings-card select:focus, .settings-card input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}

.password-field {
  position: relative;
}

.password-field input {
  box-sizing: border-box;
  width: 100%;
  padding-right: 42px;
}

.password-toggle {
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 4px;
  display: flex;
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--ink);
}

.modal-card select:focus, .modal-card input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}

.modal-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
  display: flex;
}

.setup-mode-tabs {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 4px 0 18px;
  padding: 5px;
  display: grid;
}

.setup-mode-tabs button {
  border-radius: calc(var(--radius-md) - 4px);
  color: var(--muted);
  font: inherit;
  background: none;
  border: 0;
  padding: 9px 6px;
  font-size: .85rem;
  font-weight: 700;
}

.setup-mode-tabs button.active {
  background: var(--surface);
  color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
}

.setup-mode-help {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  margin: 4px 0 16px;
  padding: 14px;
}

.setup-mode-help h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.setup-mode-help p {
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.5;
}

.ble-scan-stage {
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 12px 0 20px;
  display: flex;
}

.ble-scan-visual {
  background: var(--accent-soft);
  width: 88px;
  height: 88px;
  color: var(--accent);
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  display: flex;
  position: relative;
}

.ble-scan-visual-active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.ble-scan-icon {
  z-index: 1;
  width: 34px;
  height: 34px;
  position: relative;
}

.ble-scan-icon svg {
  width: 100%;
  height: 100%;
}

.ble-scan-ring {
  border: 2px solid var(--brand);
  opacity: .6;
  border-radius: 50%;
  animation: 2s ease-out infinite ble-scan-pulse;
  position: absolute;
  inset: 0;
}

.ble-scan-ring-delay {
  animation-delay: 1s;
}

@keyframes ble-scan-pulse {
  0% {
    opacity: .6;
    transform: scale(.9);
  }

  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

.ble-scan-hint {
  max-width: 300px;
}

.ble-discovered-form {
  animation: .25s ble-fade-up;
}

.modal-card label.ble-static-toggle, .ble-static-toggle {
  color: var(--muted);
  align-items: center;
  gap: 9px;
  margin: 4px 0 12px;
  font-size: .92rem;
  display: flex;
}

.ble-static-toggle input {
  width: auto;
  margin: 0;
}

.modal-card label.checkbox-label, .checkbox-label {
  color: var(--muted);
  align-items: center;
  gap: 9px;
  margin: 4px 0 12px;
  font-size: .92rem;
  display: flex;
}

.checkbox-label input {
  width: auto;
  margin: 0;
  padding: 0;
}

.ble-static-network-fields {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 0 0 16px;
  padding: 14px;
  display: grid;
}

.ble-static-network-fields label:last-child {
  grid-column: 1 / -1;
}

@media (max-width: 560px) {
  .ble-static-network-fields {
    grid-template-columns: 1fr;
  }

  .ble-static-network-fields label:last-child {
    grid-column: auto;
  }
}

@keyframes ble-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ble-discovered-summary {
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  margin-bottom: 16px;
  padding: 14px;
  display: flex;
}

.settings-card-icon {
  background: var(--brand-soft);
  width: 44px;
  height: 44px;
  color: var(--brand-dark);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
}

.settings-card-icon svg {
  width: 22px;
  height: 22px;
}

.modal-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  padding: 14px 0;
}

.icon-picker {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  display: flex;
}

.modal-section .icon-picker {
  margin-bottom: 0;
}

.modal-section .settings-card-subhead {
  margin: 0 0 10px;
}

.icon-picker-option {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  width: 40px;
  height: 40px;
  color: var(--muted);
  cursor: pointer;
  justify-content: center;
  align-items: center;
  display: flex;
}

.icon-picker-option svg {
  width: 20px;
  height: 20px;
}

.icon-picker-option:hover {
  border-color: var(--brand);
  color: var(--ink);
}

.icon-picker-option-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.ble-discovered-icon {
  background: var(--brand-soft);
  width: 44px;
  height: 44px;
  color: var(--brand-dark);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
}

.ble-discovered-icon svg {
  width: 22px;
  height: 22px;
}

.ble-discovered-name {
  color: var(--ink);
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
}

.device-controls {
  flex-direction: column;
  gap: 8px;
  display: flex;
}

.device-controls-buttons {
  flex-wrap: wrap;
  gap: 8px;
  display: flex;
}

.device-controls-buttons button {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  transition: background-color .15s, border-color .15s;
}

.device-controls-buttons button:hover:not(:disabled) {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.device-controls-buttons button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.device-controls-hint {
  color: var(--muted-2);
  font-size: 12px;
}

.gate-controls {
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px;
  display: flex;
}

.gate-control-button {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  width: 58px;
  height: 58px;
  color: var(--ink);
  cursor: pointer;
  justify-content: center;
  align-items: center;
  transition: background-color .15s, border-color .15s, color .15s;
  display: flex;
}

.gate-control-button svg {
  width: 26px;
  height: 26px;
}

.gate-control-button:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.gate-control-button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.gate-control-button-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.gate-control-button-danger:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
  background: #fbeaea;
}

.gate-control-button-active {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.switch-grid {
  gap: 10px;
  display: grid;
}

.switch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 80px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
  display: flex;
}

.switch-card:hover:not(:disabled) {
  box-shadow: var(--shadow-md);
}

.switch-card:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.switch-card-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.switch-card-state {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

.switch-card-on {
  background: var(--brand);
  border-color: var(--brand);
}

.switch-card-on .switch-card-name, .switch-card-on .switch-card-state {
  color: #04150c;
}

.inline-edit-trigger {
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  background: none;
  border: 0;
  align-items: center;
  gap: 6px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
}

.inline-edit-trigger svg {
  color: var(--muted-2);
  flex-shrink: 0;
}

.inline-edit-trigger:hover svg {
  color: var(--brand-dark);
}

.inline-edit-editing {
  align-items: center;
  gap: 4px;
  min-width: 0;
  display: inline-flex;
}

.inline-edit-input {
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 700;
}

.inline-edit-input:focus {
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}

.inline-edit-confirm, .inline-edit-cancel {
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 0;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 26px;
  height: 26px;
  display: inline-flex;
}

.inline-edit-confirm {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.inline-edit-confirm:hover {
  background: var(--brand);
  color: #04150c;
}

.inline-edit-cancel {
  background: var(--surface-2);
  color: var(--muted);
}

.inline-edit-cancel:hover {
  color: var(--ink);
}

.inline-edit-confirm:disabled, .inline-edit-cancel:disabled {
  opacity: .6;
  cursor: default;
}

.switch-edit-list {
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
}

.switch-edit-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  display: flex;
}

.switch-edit-index {
  background: var(--brand-soft);
  width: 22px;
  height: 22px;
  color: var(--brand-dark);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
}

.switch-edit-row .switch-edit-name, .switch-edit-row .inline-edit-editing {
  flex: 1;
  min-width: 0;
}

.switch-edit-row .switch-edit-name {
  justify-content: space-between;
  width: 100%;
  display: flex;
}

.switch-edit-row .switch-edit-name span {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.modal-actions button[type="submit"], .secondary-button {
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 0;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
}

.modal-actions button[type="submit"] {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #04150c;
}

.modal-actions button[type="submit"]:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.modal-actions button.danger-button[type="submit"] {
  background: var(--danger);
  color: #fff;
}

.secondary-button {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border);
}

.danger-button {
  border-radius: var(--radius-sm);
  background: var(--danger);
  color: #fff;
  cursor: pointer;
  border: 0;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  transition: transform .15s, box-shadow .15s;
}

.danger-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px #e5484d59;
}

.danger-button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.drawer-close {
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  border: 0;
  border-radius: 50%;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  font-size: 18px;
  line-height: 1;
}

.drawer-overlay {
  z-index: 70;
  background: #090d0b66;
  justify-content: flex-end;
  display: flex;
  position: fixed;
  inset: 0;
}

.detail-drawer {
  background: var(--surface);
  width: 100%;
  max-width: 420px;
  height: 100%;
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  gap: 20px;
  padding: 26px;
  animation: .2s drawer-in;
  display: flex;
  overflow-y: auto;
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.detail-drawer-header {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  display: flex;
}

.detail-drawer-header h2 {
  margin: 0;
}

.detail-list {
  gap: 12px;
  margin: 0;
  display: grid;
}

.modal-card .detail-list {
  margin-bottom: 16px;
}

.detail-list > div {
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px 12px;
  padding-bottom: 12px;
  display: flex;
}

.detail-list dt {
  color: var(--muted);
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
}

.detail-list dd {
  color: var(--ink);
  text-align: right;
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.detail-list dd.mono {
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
}

.detail-channel-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background-color: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  background-position: right 8px center;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  padding-right: 28px !important;
}

.detail-channel-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}

.detail-channel-select:disabled {
  opacity: .6;
  cursor: default;
}

.account-fields {
  max-width: 420px;
}

.account-fields > div {
  justify-content: flex-start;
}

.account-fields dt {
  width: 90px;
}

.account-fields dd {
  text-align: left;
  flex: none;
}

.account-google-link {
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  display: flex;
}

.account-google-link h3 {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 1rem;
  display: flex;
}

.nowrap {
  white-space: nowrap;
}

.account-google-link .settings-card-hint {
  margin: 0;
}

.account-google-identity {
  align-items: flex-start;
  gap: 12px;
  display: flex;
}

.account-google-identity .account-google-avatar {
  margin-top: 2px;
}

.account-google-avatar {
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.admin-google-linked {
  align-items: center;
  gap: 8px;
  display: inline-flex;
}

.admin-google-avatar {
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.google-sign-in {
  justify-content: center;
  min-height: 44px;
  margin-top: 14px;
  display: flex;
}

.account-google-link .google-sign-in {
  margin-top: 0;
}

.google-sign-in-button {
  width: 320px;
  max-width: 100%;
  height: 44px;
  position: relative;
}

.google-sign-in-real {
  z-index: 1;
  opacity: 0;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.google-sign-in-fake {
  z-index: 2;
  pointer-events: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  position: absolute;
  inset: 0;
}

@media (max-width: 640px) {
  .account-google-link {
    flex-direction: column;
    align-items: flex-start;
  }
}

.detail-list dd.id-value {
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  display: flex;
}

.detail-list-full {
  flex-direction: column;
  align-items: stretch;
}

.detail-list-full dd {
  text-align: left;
  flex: none;
  width: 100%;
}

.code-view {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #1a1d27;
  overflow: hidden;
}

.code-view-bar {
  background: #ffffff0f;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  display: flex;
}

.code-view-dot {
  background: #ffffff2e;
  border-radius: 999px;
  width: 9px;
  height: 9px;
}

.code-view-lang {
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff6;
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
}

.code-view-body {
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  margin: 0;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow: auto;
}

.copy-button {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--brand-dark);
  cursor: pointer;
  flex-shrink: 0;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  transition: background-color .15s;
}

.copy-button:hover {
  background: var(--brand-soft);
}

.link-button {
  font: inherit;
  color: var(--brand-dark);
  cursor: pointer;
  background: none;
  border: 0;
  align-items: center;
  gap: 5px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
}

.back-link {
  color: var(--muted);
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
}

.back-link:hover {
  color: var(--brand-dark);
}

.detail-remove {
  text-align: center;
  width: 100%;
  margin-top: auto;
  padding: 12px;
}

@media (max-width: 640px) {
  .detail-drawer {
    max-width: 100%;
  }
}

.home-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 20px;
  display: grid;
}

.unhomed-devices-card {
  margin-top: 24px;
}

.home-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  display: flex;
}

a.home-card {
  color: inherit;
  text-decoration: none;
  transition: box-shadow .15s, border-color .15s;
}

a.home-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}

.home-card-header {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  display: flex;
}

.settings-card-title {
  align-items: center;
  gap: 14px;
  display: flex;
}

.home-card-header .icon-button-view {
  flex-shrink: 0;
  margin-top: 2px;
}

.home-card-header h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.home-card-address {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 13px;
}

.home-card-devices, .home-room-group {
  flex-direction: column;
  gap: 12px;
  display: flex;
}

.home-room-group + .home-room-group {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 12px;
}

.home-room-group-dragging {
  opacity: .5;
}

.resizable-box {
  flex-direction: column;
  display: flex;
}

.home-room-group-devices {
  flex-flow: wrap;
  align-content: flex-start;
  align-items: flex-start;
  gap: 12px;
  min-height: 64px;
  display: flex;
  overflow-y: auto;
}

.home-room-group-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  min-height: 64px;
  color: var(--muted);
  justify-content: center;
  align-items: center;
  font-size: 13px;
  display: flex;
}

.home-device-row-controls {
  min-height: 56px;
  overflow-y: auto;
}

.card-resize-handle {
  background: var(--border);
  cursor: row-resize;
  touch-action: none;
  border-radius: 999px;
  align-self: center;
  width: 48px;
  height: 6px;
  margin-top: 8px;
}

.card-resize-handle:hover {
  background: var(--muted-2);
}

.card-resize-handle-corner {
  cursor: nwse-resize;
  touch-action: none;
  background-image: linear-gradient(135deg, transparent 0 40%, var(--muted-2) 40% 55%, transparent 55% 100%),
    linear-gradient(135deg, transparent 0 65%, var(--muted-2) 65% 80%, transparent 80% 100%);
  width: 14px;
  height: 14px;
  position: absolute;
  bottom: 6px;
  right: 6px;
}

.card-resize-handle-corner:hover {
  background-image: linear-gradient(135deg, transparent 0 40%, var(--ink) 40% 55%, transparent 55% 100%),
    linear-gradient(135deg, transparent 0 65%, var(--ink) 65% 80%, transparent 80% 100%);
}

.home-room-group-header {
  align-items: center;
  gap: 6px;
  display: flex;
}

.room-drag-handle {
  color: var(--muted-2);
  cursor: grab;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: inline-flex;
}

.room-header-icon {
  flex-shrink: 0;
  display: inline-flex;
}

.room-header-icon svg {
  width: 14px;
  height: 14px;
}

.room-drag-handle:hover {
  color: var(--ink);
}

.room-drag-handle:active {
  cursor: grabbing;
}

.home-device-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-direction: column;
  flex: 320px;
  gap: 10px;
  max-width: 100%;
  padding: 14px 14px 20px;
  display: flex;
  position: relative;
}

.home-device-row-header {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  display: flex;
}

.home-device-row-title {
  align-items: center;
  gap: 8px;
  min-width: 0;
  display: flex;
}

.home-device-row-title .room-drag-handle {
  margin-top: 2px;
}

.home-device-row-dragging {
  opacity: .5;
}

.home-device-row-name {
  color: var(--ink);
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 700;
  display: flex;
}

.home-device-row-actions {
  align-items: center;
  gap: 8px;
  display: flex;
}

.unhomed-device-row {
  flex: 0 320px;
}

.icon-button-view {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  width: 30px;
  height: 30px;
  color: var(--muted);
  cursor: pointer;
  justify-content: center;
  align-items: center;
  display: flex;
}

.icon-button-view svg {
  width: 16px;
  height: 16px;
  display: block;
}

.icon-button-view:hover {
  color: var(--ink);
  border-color: var(--brand);
}

.home-member-list {
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
}

.home-member-row {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  display: flex;
}

.settings-card-list {
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
  display: flex;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  display: flex;
}

.settings-card-hint {
  color: var(--muted);
  font-size: 13px;
}

.settings-card-hint.settings-card-error {
  color: #f87171;
}

.switch-count-editor {
  align-items: center;
  gap: 10px;
  display: flex;
}

.switch-count-editor input {
  width: 72px;
}

.delete-room-warning {
  margin-top: 18px;
}

.delete-room-warning-label {
  color: var(--danger);
  font-weight: 600;
}

.settings-card-subhead {
  color: var(--muted);
  margin: 4px 0 -4px;
  font-size: 12px;
  font-weight: 700;
}

.settings-card-header-row {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  display: flex;
}

.invite-banner-list {
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  display: flex;
}

.invite-banner {
  background: var(--brand-soft);
  border: 1px solid var(--brand);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  display: flex;
}

.invite-banner p {
  color: var(--ink);
  margin: 0;
  font-size: 14px;
}

.invite-banner-actions {
  gap: 10px;
  display: flex;
}

.invite-banner-highlighted {
  box-shadow: 0 0 0 3px var(--brand);
}

.invite-landing {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  min-height: 100dvh;
  padding: 24px;
  display: flex;
}

.invite-landing-brand {
  color: var(--brand);
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  display: flex;
}

.invite-landing-brand img {
  display: block;
}

.invite-landing-card {
  text-align: center;
  align-items: center;
  width: 100%;
  max-width: 420px;
}

.invite-landing-home-icon {
  margin: 0 auto;
}

.invite-landing-card h1 {
  margin: 4px 0 0;
  font-size: 22px;
}

.invite-landing-actions {
  gap: 12px;
  width: 100%;
  margin-top: 8px;
  display: flex;
}

.invite-landing-actions button {
  flex: 1;
}

.home-member-row.room-row {
  align-items: flex-start;
}

.home-settings-device-actions {
  flex-shrink: 0;
  margin-top: 1px;
}

.room-row-name {
  color: var(--ink);
  font-weight: 700;
  display: block;
}

.room-row .settings-card-hint {
  margin: 2px 0 0;
}

.room-row-open {
  text-align: left;
  cursor: pointer;
  min-width: 0;
  font: inherit;
  background: none;
  border: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 0;
  display: flex;
}

.member-row-info {
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  display: flex;
}

.member-row-info .settings-card-icon {
  font-size: 12px;
  font-weight: 700;
}

.room-row-icon {
  width: 32px;
  height: 32px;
}

.room-row-icon svg {
  width: 16px;
  height: 16px;
}

.modal-card input, .modal-card select, .login-page input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.modal-card .checkbox-label input, .modal-card .ble-static-toggle input {
  width: auto;
}

.form-row label {
  min-width: 0;
}

.phone-country-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background-color: var(--surface-2);
  color: var(--ink);
  height: 100%;
  padding: 10px 14px;
  font-size: 14px;
}

.login-page .phone-country-select {
  background-color: var(--surface);
}

.playground-grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  display: grid;
}

.playground-grid .settings-card {
  margin: 0;
}

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

.menu-bar {
  flex-wrap: wrap;
  gap: 0;
  display: flex;
}

.menu-bar-item {
  position: relative;
}

.menu-bar-trigger {
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 5px;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: 13px;
  display: flex;
}

.menu-bar-trigger:hover, .menu-bar-trigger[aria-expanded="true"] {
  background: var(--surface-2);
}

.menu-bar-value {
  color: var(--muted);
  font-weight: 400;
}

.menu-bar-panel {
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 240px;
  box-shadow: var(--shadow-md);
  border-radius: 8px;
  flex-direction: column;
  margin-top: 2px;
  padding: 4px;
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
}

.menu-list {
  flex-direction: column;
  max-height: 260px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  overflow: auto;
}

.menu-list button, .menu-action {
  width: 100%;
  color: var(--ink);
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  background: none;
  border: 0;
  border-radius: 5px;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  font-size: 13px;
  text-decoration: none;
  display: flex;
}

.menu-list button:hover, .menu-list button.active, .menu-action:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
}

.menu-action:disabled {
  opacity: .4;
  cursor: default;
  background: none;
}

.menu-action-check {
  flex-shrink: 0;
  width: 12px;
  font-size: 11px;
}

.menu-action-label {
  text-overflow: ellipsis;
  flex: 1;
  overflow: hidden;
}

.menu-label-with-dot {
  align-items: center;
  gap: 6px;
  display: inline-flex;
}

.menu-action-shortcut, .menu-action-arrow {
  color: var(--muted);
  flex-shrink: 0;
  font-size: 12px;
}

.menu-action:hover:not(:disabled) .menu-action-shortcut, .menu-action:hover:not(:disabled) .menu-action-arrow {
  color: #fffc;
}

.menu-list-meta {
  color: var(--muted);
  flex-shrink: 0;
  font-size: 12px;
}

.menu-panel-divider {
  background: var(--border);
  height: 1px;
  margin: 4px 6px;
}

.menu-submenu {
  position: relative;
}

.menu-submenu-panel {
  z-index: 21;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 200px;
  max-height: 320px;
  box-shadow: var(--shadow-md);
  border-radius: 8px;
  flex-direction: column;
  padding: 4px;
  display: flex;
  position: absolute;
  top: -4px;
  left: 100%;
  overflow: auto;
}

.ide-window .menu-bar {
  background: #323233;
  border-bottom: 1px solid #333;
  padding: 3px 6px;
}

.ide-window .menu-bar-trigger {
  color: #ccc;
}

.ide-window .menu-bar-trigger:hover, .ide-window .menu-bar-trigger[aria-expanded="true"] {
  color: #fff;
  background: #ffffff1f;
}

.ide-window .menu-bar-panel, .ide-window .menu-submenu-panel {
  background: #252526;
  border-color: #454545;
  box-shadow: 0 6px 20px #00000073;
}

.ide-window .menu-action, .ide-window .menu-list button {
  color: #ccc;
}

.ide-window .menu-action:disabled {
  color: #6e6e6e;
  opacity: 1;
}

.ide-window .menu-action-shortcut, .ide-window .menu-action-arrow, .ide-window .menu-list-meta {
  color: #8c8c8c;
}

.ide-window .menu-panel-divider {
  background: #454545;
}

.hidden-file-input {
  display: none;
}

.playground-ide {
  display: block;
}

.ide-window {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  height: calc(100vh - 190px);
  min-height: 560px;
  box-shadow: var(--shadow-sm);
  flex-direction: column;
  display: flex;
  overflow: hidden;
}

.ide-window-resizer {
  cursor: ns-resize;
  background: #2d2d2d;
  border-top: 1px solid #333;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  height: 10px;
  display: flex;
}

.ide-window-resizer-grip {
  background: #ffffff2e;
  border-radius: 2px;
  width: 32px;
  height: 3px;
}

.ide-window-resizer:hover .ide-window-resizer-grip {
  background: var(--accent);
}

.ide-window .menu-bar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 4px 8px;
}

.ide-toolbar {
  background: #2d2d2d;
  border-bottom: 1px solid #333;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  display: flex;
}

.ide-run {
  background: var(--brand);
  color: #fff;
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
}

.ide-run:hover:not(:disabled) {
  background: var(--brand-dark);
}

.ide-run-upload {
  background: var(--accent);
}

.ide-run-upload:hover:not(:disabled) {
  filter: brightness(1.12);
}

.ide-run:disabled {
  color: #8c8c8c;
  cursor: default;
  background: #3f3f46;
}

.ide-toolbar-spacer {
  flex: 1;
}

.ide-chip {
  color: #ccc;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: 1px solid #454545;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
}

.ide-chip:hover {
  border-color: var(--accent);
  color: #fff;
}

.ide-toolbar-menus {
  gap: 6px;
  display: flex;
}

.ide-window .ide-toolbar .ide-toolbar-menus {
  background: none;
  border-bottom: 0;
  padding: 0;
}

.ide-toolbar-menus .ide-chip-menu .menu-bar-trigger {
  color: #fff;
  background: #5a5a63;
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
}

.ide-toolbar-menus .ide-chip-menu .menu-bar-trigger:hover, .ide-toolbar-menus .ide-chip-menu .menu-bar-trigger[aria-expanded="true"] {
  background: #71717a;
}

.ide-toolbar-menus .ide-chip-menu .menu-bar-panel {
  left: auto;
  right: 0;
}

.ide-body {
  flex: 1;
  min-height: 0;
  display: grid;
}

.ide-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  display: flex;
  position: relative;
  overflow: auto;
}

.ide-sidebar-head {
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  display: flex;
}

.ide-sidebar-title {
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

.ide-sidebar-collapse {
  width: 20px;
  height: 20px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 4px;
  place-items: center;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  display: grid;
}

.ide-sidebar-collapse:hover {
  background: var(--surface);
  color: var(--ink);
}

.ide-sidebar-rail {
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  display: flex;
}

.ide-sidebar-rail:hover {
  background: var(--surface);
}

.ide-sidebar-rail-chevron {
  width: 20px;
  height: 20px;
  color: var(--ink);
  background: #ffffff1f;
  border-radius: 50%;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  display: grid;
}

.ide-sidebar-rail:hover .ide-sidebar-rail-chevron {
  background: var(--accent);
  color: #fff;
}

.ide-sidebar-rail-label {
  writing-mode: vertical-rl;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  transform: rotate(180deg);
}

.ide-sidebar-resizer {
  cursor: col-resize;
  z-index: 5;
  width: 6px;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
}

.ide-sidebar-resizer:after {
  content: "";
  background: #ffffff2e;
  width: 2px;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 2px;
}

.ide-sidebar-resizer:hover:after {
  background: var(--accent);
}

.ide-main {
  background: #1e1e1e;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.ide-tabs {
  background: #252526;
  align-items: stretch;
  min-height: 35px;
  display: flex;
  overflow-x: auto;
}

.ide-tab {
  color: #969696;
  white-space: nowrap;
  background: #2d2d2d;
  border-right: 1px solid #1e1e1e;
  align-items: center;
  gap: 2px;
  padding: 0 4px 0 12px;
  display: flex;
}

.ide-tab.active {
  border-top: 1px solid var(--accent);
  color: #fff;
  background: #1e1e1e;
}

.ide-tab-label {
  color: inherit;
  font: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  align-items: center;
  gap: 6px;
  padding: 8px 2px;
  font-size: 12px;
  display: flex;
}

.ide-tab-label.ide-tab-example {
  color: #9d9d9d;
  font-style: italic;
}

.ide-tab-dot {
  background: var(--warning);
  border-radius: 50%;
  width: 7px;
  height: 7px;
}

.ide-tab-close {
  width: 20px;
  height: 20px;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 4px;
  place-items: center;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  display: grid;
}

.ide-tab-close:hover {
  background: #ffffff1f;
}

.ide-editor {
  flex: 1;
  min-height: 0;
}

.ide-empty {
  color: #6e7681;
  place-items: center;
  height: 100%;
  font-size: 13px;
  display: grid;
}

.ide-panel {
  background: #1e1e1e;
  border-top: 1px solid #333;
  flex-direction: column;
  display: flex;
  position: relative;
}

.ide-panel-resizer {
  cursor: row-resize;
  z-index: 5;
  height: 6px;
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
}

.ide-panel-resizer:after {
  content: "";
  background: #ffffff2e;
  height: 2px;
  position: absolute;
  top: 2px;
  left: 0;
  right: 0;
}

.ide-panel-resizer:hover:after {
  background: var(--accent);
}

.ide-panel-head {
  color: #ccc;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid #333;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 11px;
  display: flex;
}

.ide-panel-head button {
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  font-size: 15px;
  line-height: 1;
}

.ide-panel-tabs {
  gap: 14px;
  display: flex;
}

.ide-panel-tabs button {
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid #0000;
  padding: 2px 0;
  font-size: 11px;
}

.ide-panel-tabs button[data-active="true"] {
  border-bottom-color: var(--accent);
  color: #fff;
}

.ide-panel-tools {
  align-items: center;
  gap: 8px;
  display: flex;
}

.ide-panel-status {
  color: #8c8c8c;
  white-space: nowrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  display: inline-flex;
}

.ide-panel-tools select, .ide-panel-tools button:not([aria-label]) {
  color: #ccc;
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  background: #2d2d2d;
  border: 1px solid #454545;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
}

.ide-panel-tools select:disabled, .ide-panel-tools button:not([aria-label]):disabled {
  opacity: .5;
  cursor: default;
}

.ide-panel-tools button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.ide-serial-log {
  flex: 1;
  min-height: 0;
}

.ide-serial-warning {
  color: #e8b566;
  background: #d99a2b1f;
  border-bottom: 1px solid #333;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 12px;
  display: flex;
}

.ide-serial-warning-close {
  width: 18px;
  height: 18px;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 4px;
  flex-shrink: 0;
  place-items: center;
  margin-left: auto;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  display: grid;
}

.ide-serial-warning-close:hover {
  background: #ffffff26;
}

.ide-serial-warning-actions {
  gap: 6px;
  display: flex;
}

.ide-serial-warning-actions button {
  color: #e8b566;
  font: inherit;
  cursor: pointer;
  background: none;
  border: 1px solid #e8b566;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
}

.ide-serial-warning-actions button:hover {
  color: #1e1e1e;
  background: #e8b566;
}

.ide-serial-input {
  border-top: 1px solid #333;
  gap: 8px;
  padding: 8px 10px;
  display: flex;
}

.ide-serial-input input {
  color: #ccc;
  min-width: 0;
  font: inherit;
  background: #2d2d2d;
  border: 1px solid #454545;
  border-radius: 6px;
  flex: 1;
  padding: 5px 10px;
  font-size: 12px;
}

.ide-serial-input input:disabled {
  opacity: .5;
}

.ide-serial-input button {
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
}

.ide-serial-input button:disabled {
  color: #8c8c8c;
  cursor: default;
  background: #3f3f46;
}

.ide-run-monitor {
  background: #3f3f46;
}

.ide-run-monitor:hover:not(:disabled) {
  background: #52525b;
}

.ide-run-monitor.active {
  background: var(--warning);
  color: #1e1e1e;
}

.menu-section-label {
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 8px 2px;
  font-size: 10px;
}

.ide-window .menu-section-label {
  color: #8c8c8c;
}

.menu-panel-note {
  background: var(--surface-2);
  max-width: 260px;
  color: var(--muted);
  white-space: normal;
  border-radius: 6px;
  margin: 4px 8px 6px;
  padding: 8px;
  font-size: 11px;
  line-height: 1.5;
}

.ide-window .menu-panel-note {
  color: #b3b3b3;
  background: #ffffff0f;
}

.ide-panel pre {
  color: #ccc;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  flex: 1;
  margin: 0;
  padding: 10px;
  font: 12px / 1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow: auto;
}

.ide-statusbar {
  background: var(--accent);
  color: #fff;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 5px 12px;
  font-size: 11px;
  display: flex;
}

.ide-status-spacer {
  flex: 1;
}

.ide-status-dot {
  background: var(--danger);
  border-radius: 50%;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  display: inline-block;
}

.ide-status-dot.ok {
  background: #22c55e;
}

.ide-status-button {
  color: inherit;
  font: inherit;
  cursor: pointer;
  background: #ffffff2e;
  border: 0;
  border-radius: 4px;
  padding: 2px 8px;
}

.ide-status-button:hover {
  background: #ffffff4d;
}

.ide-status-build {
  align-items: center;
  gap: 4px;
  display: inline-flex;
}

.ide-status-build button {
  width: 14px;
  height: 14px;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 3px;
  place-items: center;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  display: grid;
}

.ide-status-build button:hover {
  background: #ffffff40;
}

.playground-explorer-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
}

.library-search-results {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  padding: 4px;
  display: flex;
  overflow: auto;
}

.library-search-row {
  border-radius: 6px;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  display: flex;
}

.library-search-row:hover {
  background: var(--surface);
}

.library-search-info {
  min-width: 0;
}

.library-search-title {
  align-items: baseline;
  gap: 8px;
  display: flex;
}

.library-search-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.library-search-sentence {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
}

.library-search-author {
  color: var(--muted-2);
  margin: 2px 0 0;
  font-size: 11px;
}

.library-install-row {
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  display: flex;
}

.library-install-row:has(label) {
  align-items: flex-end;
}

.library-section-label {
  color: var(--ink);
  margin: 18px 0 6px;
  font-size: 13px;
  font-weight: 700;
}

.library-manager-card .library-section-label {
  color: #ccc;
}

.library-install-row label, .library-install-row > p {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.library-manager-card {
  color: #ccc;
  background: #1e1e1e;
  border: 1px solid #333;
}

.library-manager-card > h2 {
  color: #fff;
}

.library-manager-card label {
  color: #ccc;
}

.library-manager-card select, .library-manager-card input {
  color: #fff;
  background-color: #2d2d2d;
  border: 1px solid #3f3f46;
}

.library-manager-card select:focus, .library-manager-card input:focus {
  border-color: #007fd4;
  outline: none;
}

.library-manager-card .settings-card-hint {
  color: #9d9d9d;
}

.library-manager-card .settings-card-hint.settings-card-error {
  color: #f87171;
}

.library-manager-card .menu-panel-divider {
  border-color: #333;
}

.library-manager-card .library-search-results, .library-manager-card .playground-explorer-panel {
  background: #252526;
  border-color: #333;
}

.library-manager-card .library-search-row:hover {
  background: #2d2d2d;
}

.library-manager-card .library-search-name, .library-manager-card .playground-explorer-file-name {
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.library-manager-card .library-search-sentence {
  color: #9d9d9d;
}

.library-manager-card .library-search-author, .library-manager-card .menu-list-meta {
  color: #6e7681;
}

.library-manager-card .playground-explorer-row {
  border-color: #333;
}

.library-manager-card .secondary-button {
  color: #fff;
  background: #3f3f46;
  border: 1px solid #3f3f46;
}

.library-manager-card .secondary-button:hover:not(:disabled) {
  background: #5a5a63;
}

.library-manager-card .primary-button {
  color: #fff;
  background: #0e639c;
}

.library-manager-card .primary-button:hover:not(:disabled) {
  box-shadow: none;
  background: #17b;
  transform: none;
}

.library-manager-card .primary-button:disabled {
  color: #6e7681;
  cursor: not-allowed;
  background: #3f3f46;
}

.playground-explorer-row {
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 10px;
  padding: 2px 10px;
  display: flex;
}

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

.playground-explorer-row:hover {
  background: var(--surface);
}

.playground-explorer-row-folder {
  padding: 0 10px;
}

.playground-explorer-file-name {
  min-width: 0;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: 0;
  flex: 1;
  padding: 6px 0;
  font-size: 13px;
  text-decoration: none;
  overflow: hidden;
}

.playground-explorer-file-name:hover {
  text-decoration: underline;
}

.playground-explorer-folder-name {
  font-weight: 700;
}

.playground-explorer-row.active {
  background: var(--surface);
}

.playground-explorer-row.active .playground-explorer-file-name {
  color: var(--accent, var(--ink));
}

.playground-files-card {
  padding: 14px;
}

.finder-window {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  flex-direction: column;
  min-height: 640px;
  display: flex;
  overflow: hidden;
}

.finder-toolbar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  display: flex;
}

.finder-nav {
  gap: 4px;
  display: flex;
}

.finder-nav button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  width: 30px;
  height: 30px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  place-items: center;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  display: grid;
}

.finder-nav button:hover:not(:disabled) {
  background: var(--surface);
}

.finder-nav button:disabled {
  opacity: .35;
  cursor: default;
}

.finder-path {
  font-size: 13px;
  font-weight: 700;
}

.finder-toolbar-spacer {
  flex: 1;
}

.finder-view-switch button {
  padding: 5px 12px;
  font-size: 12px;
}

.finder-tool {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 8px;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
}

.finder-tool:hover {
  background: var(--surface);
}

.finder-tool.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.finder-tool.danger:hover:not(:disabled) {
  background: #fbeaea;
}

.finder-tool:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.finder-body {
  flex: 1;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 0;
  display: grid;
}

.finder-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
  display: flex;
  overflow: auto;
}

.finder-sidebar-heading {
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 12px 6px 4px;
  font-size: 11px;
}

.finder-sidebar-heading:first-child {
  margin-top: 0;
}

.finder-sidebar button {
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 8px;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  display: flex;
  overflow: hidden;
}

.finder-sidebar button:hover {
  background: var(--surface-2);
}

.finder-sidebar button.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.finder-sidebar-count {
  color: var(--muted);
  font-size: 11px;
}

.finder-content {
  padding: 16px;
  overflow: auto;
}

.finder-empty {
  color: var(--muted);
  text-align: center;
  grid-column: 1 / -1;
  padding: 40px 0;
  font-size: 13px;
}

.finder-grid {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  align-content: start;
  gap: 4px;
  display: grid;
}

.finder-tile {
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  background: none;
  border: 1px solid #0000;
  border-radius: 10px;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  display: flex;
}

.finder-tile:hover {
  background: var(--surface);
}

.finder-tile.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.finder-tile-name {
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  text-align: center;
  -webkit-box-orient: vertical;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
}

.finder-tile-meta {
  color: var(--muted);
  font-size: 10px;
}

.finder-tile-editing input {
  box-sizing: border-box;
  border: 1px solid var(--accent);
  text-align: center;
  border-radius: 4px;
  width: 100%;
  padding: 2px 4px;
  font-size: 12px;
}

.finder-glyph {
  flex-shrink: 0;
  width: 50px;
  height: 42px;
}

.finder-glyph-folder-back, .finder-glyph-folder-front {
  fill: var(--accent);
}

.finder-glyph-folder-back {
  opacity: .55;
}

.finder-glyph-page {
  fill: var(--surface);
  stroke: var(--muted-2);
  stroke-width: 2px;
}

.finder-glyph-fold {
  fill: var(--muted-2);
}

.finder-glyph-file {
  display: inline-flex;
  position: relative;
}

.finder-glyph-ext {
  background: var(--muted);
  color: var(--surface);
  letter-spacing: .04em;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 8px;
  font-weight: 700;
  position: absolute;
  bottom: 2px;
  right: 2px;
}

.finder-list {
  flex-direction: column;
  display: flex;
}

.finder-list-head, .finder-list-row {
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  font-size: 12px;
  display: grid;
}

.finder-list-head-trash, .finder-list-row-trash {
  grid-template-columns: minmax(0, 2.6fr) minmax(0, .8fr) minmax(0, 1.2fr) auto;
}

.finder-list-head {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 11px;
  position: sticky;
  top: 0;
}

.finder-list-row {
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
}

.finder-list-row:hover {
  background: var(--surface);
}

.finder-list-row.selected {
  background: var(--accent-soft);
}

.finder-list-row > span {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.finder-list-name {
  color: var(--ink);
  align-items: center;
  gap: 8px;
  font-size: 13px;
  display: flex;
}

.finder-list-name .finder-glyph {
  width: 22px;
  height: 18px;
}

.finder-list-name .finder-glyph-ext {
  display: none;
}

.finder-list-name input {
  border: 1px solid var(--accent);
  border-radius: 4px;
  flex: 1;
  min-width: 0;
  padding: 2px 6px;
  font-size: 13px;
}

.finder-list-actions {
  justify-content: flex-end;
  gap: 2px;
  display: flex;
}

.finder-statusbar {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 11px;
  display: flex;
}

.finder-context-menu {
  z-index: 60;
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 190px;
  box-shadow: var(--shadow-lg);
  border-radius: 10px;
  flex-direction: column;
  padding: 5px;
  display: flex;
  position: fixed;
}

.finder-context-menu button, .finder-context-menu a {
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  text-decoration: none;
}

.finder-context-menu button:hover, .finder-context-menu a:hover {
  background: var(--surface-2);
}

.finder-context-menu button.danger {
  color: var(--danger);
}

@media (max-width: 720px) {
  .finder-body {
    grid-template-columns: 1fr;
  }

  .finder-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-flow: wrap;
  }

  .finder-sidebar-heading {
    display: none;
  }

  .finder-list-head, .finder-list-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }

  .finder-list-head > span:nth-child(n+3), .finder-list-row > span:nth-child(n+3) {
    display: none;
  }
}

.playground-breadcrumb {
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  display: flex;
}

.playground-breadcrumb button {
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 4px 6px;
}

.playground-breadcrumb button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.playground-breadcrumb button.active {
  color: var(--ink);
  font-weight: 700;
}

.playground-breadcrumb-sep {
  color: var(--muted);
  margin: 0 2px;
}

.playground-explorer-action {
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}

.playground-explorer-action:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.playground-explorer-action-danger:hover {
  color: var(--danger);
}

.playground-grid > .settings-card select, .playground-grid > .settings-card input {
  box-sizing: border-box;
  width: 100%;
}

@media (max-width: 720px) {
  .ide-body {
    grid-template-columns: 1fr !important;
  }

  .ide-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 170px;
  }

  .ide-sidebar-resizer {
    display: none;
  }

  .ide-window {
    height: auto;
    min-height: 520px;
  }
}

/* [project]/frontend-portal/app/globals.css [app-client] (css) */


/*# sourceMappingURL=_052_w1i._.css.map*/