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

:root {
  --bg: #0f172a;
  --panel: #111c33;
  --panel-soft: #142442;
  --accent: #4f8cff;
  --accent-2: #ffb44a;
  --text: #e8eefc;
  --muted: #9db0d5;
  --border: rgba(148, 163, 184, 0.2);
  --radius: 18px;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
  --matrix-color-a: #5eead4;
  --matrix-color-b: #38bdf8;
  --matrix-fade: rgba(7, 10, 20, 0.15);
  --matrix-button-ink: #0b1324;
  --matrix-button-border: rgba(255, 255, 255, 0.35);
  --matrix-button-border-hover: rgba(255, 255, 255, 0.6);
  --matrix-button-glow: rgba(56, 189, 248, 0.45);
  --field-bg: rgba(12, 19, 36, 0.9);
  --field-option-bg: #0f172a;
  --modal-bg: rgba(12, 19, 36, 0.95);
}

.light-style {
  --matrix-color-a: #0f766e;
  --matrix-color-b: #1d4ed8;
  --matrix-fade: rgba(248, 250, 252, 0.1);
  --matrix-button-ink: #f8fafc;
  --matrix-button-border: rgba(15, 23, 42, 0.2);
  --matrix-button-border-hover: rgba(15, 23, 42, 0.35);
  --matrix-button-glow: rgba(29, 78, 216, 0.35);
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-soft: #e2e8f0;
  --accent: #2563eb;
  --accent-2: #f59e0b;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  --field-bg: #ffffff;
  --field-option-bg: #ffffff;
  --modal-bg: rgba(255, 255, 255, 0.96);
}

* {
  box-sizing: border-box;
}

.d-none {
  display: none !important;
}

body {
  margin: 0;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #1a2b4f, #0b1224 55%);
}

.light-style body {
  background: radial-gradient(circle at top left, #ffffff, #e2e8f0 60%);
}

.page-content {
  opacity: 1;
  transform: none;
  transition: none;
}

html.ui-visible .page-content {
  opacity: 1;
  transform: none;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 320ms ease, visibility 0s linear 320ms;
}

.page-loader__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(79, 140, 255, 0.24), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(255, 180, 74, 0.16), transparent 40%),
    #060b18;
}

.light-style .page-loader__backdrop {
  background:
    radial-gradient(circle at 20% 10%, rgba(37, 99, 235, 0.12), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(245, 158, 11, 0.1), transparent 40%),
    #f8fafc;
}

.page-loader__card {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 2.5rem));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.8rem 1.4rem 1.25rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  text-align: center;
}

.light-style .page-loader__card {
  background: rgba(255, 255, 255, 0.9);
}

.page-loader__logo {
  width: min(220px, 54vw);
  max-width: 100%;
  margin: 0 auto 0.55rem;
}

.page-loader__logo-img {
  width: 100%;
  height: auto;
  display: block;
}

.page-loader__wordmark {
  min-height: 1.3em;
  display: inline-block;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1.75rem, 5.2vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.page-loader__wordmark::after {
  content: "|";
  margin-left: 0.08em;
  color: var(--accent);
  animation: type-cursor 0.95s steps(1) infinite;
}

.page-loader__label {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.page-loader__track {
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.page-loader__bar {
  height: 100%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: page-loader-sweep 1.4s ease-in-out infinite;
}

html.page-loading .page-loader {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms ease;
}

html.page-ready .page-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes page-loader-sweep {
  0% {
    transform: translateX(-120%);
  }
  50% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(260%);
  }
}

@keyframes type-cursor {
  0%, 45% {
    opacity: 1;
  }
  46%, 100% {
    opacity: 0;
  }
}

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

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

input {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  color: var(--text);
}

select,
textarea {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  color: var(--text);
}

select {
  background-color: var(--field-bg);
}

select option,
select optgroup {
  background-color: var(--field-option-bg);
  color: var(--text);
}

select:focus {
  outline: 2px solid rgba(79, 140, 255, 0.35);
  border-color: rgba(79, 140, 255, 0.6);
}

input:focus {
  outline: 2px solid rgba(79, 140, 255, 0.35);
  border-color: rgba(79, 140, 255, 0.6);
}

.landing-page-matrix {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.2;
  pointer-events: none;
}

.light-style .landing-page-matrix {
  opacity: 0.6;
}

.landing-page-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2rem;
}

.ssh-group {
  margin-top: 0.75rem;
  padding: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.52);
}

.ssh-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.ssh-group-title {
  font-weight: 600;
}

.ssh-group-body {
  display: grid;
  gap: 0.65rem;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  margin: 0 0 0.6rem;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

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

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
  background: rgba(12, 19, 36, 0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(20px);
}

.light-style .topbar {
  background: rgba(248, 250, 252, 0.92);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-mark__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text);
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--panel);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
}

.search:focus-within,
.search.is-open {
  border-color: rgba(79, 140, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}

.search input {
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
  min-width: 220px;
}

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

.search-icon {
  color: var(--muted);
}

.topbar-search-dropdown {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  width: min(560px, calc(100vw - 2rem));
  min-width: 100%;
  max-height: 420px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 35;
}

.topbar-search-results {
  max-height: 330px;
  overflow-y: auto;
  padding: 0.45rem;
  display: grid;
  gap: 0.4rem;
}

.topbar-search-empty {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
}

.topbar-search-item {
  display: grid;
  gap: 0.25rem;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
  background: rgba(148, 163, 184, 0.08);
  transition: background 150ms ease, border-color 150ms ease;
}

.topbar-search-item:hover,
.topbar-search-item.is-active {
  border-color: rgba(79, 140, 255, 0.42);
  background: rgba(79, 140, 255, 0.18);
}

.topbar-search-item__meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.topbar-search-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.14);
  flex-shrink: 0;
}

.topbar-search-kind--resource {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.14);
}

.topbar-search-kind--wiki {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(96, 165, 250, 0.14);
}

.topbar-search-item__subtitle {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.topbar-search-item__title {
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.25;
}

.topbar-search-item__snippet {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.light-style .topbar-search-item {
  background: rgba(148, 163, 184, 0.12);
}

.light-style .topbar-search-item:hover,
.light-style .topbar-search-item.is-active {
  background: rgba(37, 99, 235, 0.12);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
  padding: 0.4rem 0.6rem;
  text-decoration: none;
  cursor: pointer;
}

.icon-btn.is-active {
  border-color: rgba(79, 140, 255, 0.55);
  background: rgba(79, 140, 255, 0.2);
}

.user-menu {
  position: relative;
}

.user-menu__toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 0 0 rgba(79, 140, 255, 0);
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

.user-menu__toggle::-webkit-details-marker {
  display: none;
}

.user-menu[open] .user-menu__toggle {
  border-color: rgba(79, 140, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.16);
}

.user-menu__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-menu__avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.3), rgba(245, 158, 11, 0.28));
}

.user-menu__dropdown {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(84vw, 180px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 0.35rem;
  display: grid;
  gap: 0.2rem;
  z-index: 25;
}

.user-menu__dropdown form {
  margin: 0;
}

.user-menu__item {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 0.48rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.user-menu__item:hover,
.user-menu__item:focus-visible,
.user-menu__item.is-active {
  background: rgba(79, 140, 255, 0.18);
  outline: none;
}

.user-menu__item-btn {
  cursor: pointer;
  font: inherit;
}

.notification-menu {
  position: relative;
}

.notification-toggle {
  position: relative;
  min-width: 2.4rem;
}

.notification-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(90vw, 360px);
  max-height: 420px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  z-index: 25;
}

.notification-dropdown__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.notification-dropdown__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.notification-dropdown__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.notification-dropdown__clear {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.notification-dropdown__clear:hover {
  text-decoration: underline;
}

.notification-dropdown__trash {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 0.2rem 0.35rem;
  line-height: 1;
  cursor: pointer;
}

.notification-dropdown__trash:hover {
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
}

.notification-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 0.5rem;
  display: grid;
  gap: 0.45rem;
  align-content: start;
  grid-auto-rows: min-content;
}

.notification-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: rgba(148, 163, 184, 0.08);
}

.notification-item__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.notification-item__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
}

.notification-item__time {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

.notification-item__body {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}

.notification-item--warning {
  border-color: rgba(245, 158, 11, 0.35);
}

.notification-item--error {
  border-color: rgba(239, 68, 68, 0.4);
}

.notification-item--success {
  border-color: rgba(34, 197, 94, 0.38);
}

.notification-empty {
  margin: 0;
  padding: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--panel);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1f2a44;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.user-name {
  font-size: 0.9rem;
}

.user-role {
  font-size: 0.7rem;
  color: var(--muted);
}

.sidenav {
  position: relative;
  padding: 2rem 1.6rem;
  border-right: 1px solid var(--border);
  background: rgba(12, 19, 36, 0.9);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow: hidden;
}

.sidenav-backdrop {
  display: none;
}

.light-style .sidenav {
  background: rgba(248, 250, 252, 0.9);
}

.sidenav-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidenav-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.sidenav-nav {
  display: grid;
  gap: 0.6rem;
}

.nav-item {
  text-decoration: none;
  color: var(--text);
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  background: transparent;
  transition: background 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  background: var(--panel-soft);
}

.sidenav-card {
  background: var(--panel);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sidenav-card-title {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.sidenav-widget-subtitle {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.sidenav-widget-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.sidenav-widget-stat {
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.52);
  padding: 0.45rem 0.5rem;
  display: grid;
  gap: 0.1rem;
}

.light-style .sidenav-widget-stat {
  background: rgba(255, 255, 255, 0.89);
}

.sidenav-widget-stat__label {
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}

.sidenav-widget-stat strong {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.1;
}

.sidenav-widget-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.sidenav-widget-actions {
  display: grid;
  gap: 0.4rem;
}

.sidenav-widget-actions .ghost-btn {
  text-decoration: none;
  text-align: center;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.app-content {
  padding: 2rem 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.main-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.15), rgba(255, 180, 74, 0.1));
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
}

.primary-btn {
  background: var(--accent);
  color: #0a0f1d;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
}

.primary-btn.full {
  width: 100%;
}

.secondary-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
}

.hero-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.metric-value {
  font-size: 2rem;
  font-weight: 600;
}

.metric-label {
  color: var(--muted);
  font-size: 0.8rem;
}

.progress {
  margin: 1rem 0;
  height: 8px;
  background: #1e2b48;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7ed957, #4f8cff);
}

.light-style .progress {
  background: #dbe5f2;
}

.light-style .progress span {
  background: linear-gradient(90deg, #16a34a, #2563eb);
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
}

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

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.4rem;
  border: 1px solid var(--border);
}

.card-wide {
  grid-column: span 2;
}

.list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.metric-row {
  display: flex;
  gap: 1.2rem;
}

.tag-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  background: rgba(79, 140, 255, 0.2);
  color: #c9dbff;
  border: 1px solid transparent;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.light-style .tag {
  background: rgba(37, 99, 235, 0.12);
  color: #1e3a8a;
  border-color: rgba(37, 99, 235, 0.28);
}

.table-wrap {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.4rem;
  border: 1px solid var(--border);
}

.overview-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 1rem;
  align-items: start;
}

.overview-dashboard--full {
  grid-template-columns: minmax(0, 1fr);
}

.overview-main {
  min-width: 0;
  display: grid;
  gap: 1rem;
}

.overview-side {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.overview-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.overview-intro h2 {
  margin-bottom: 0.4rem;
}

.overview-intro p {
  margin: 0;
}

.overview-intro-meta {
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.overview-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.overview-kpi {
  display: grid;
  gap: 0.28rem;
}

.overview-kpi-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.overview-kpi-value {
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  line-height: 1.15;
}

.overview-kpi-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

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

.overview-panels--health-rail {
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 2.08fr);
  align-items: start;
}

.overview-health-rail {
  display: grid;
  gap: 1.35rem;
  min-width: 0;
  align-content: start;
}

.overview-health-rail-card + .overview-health-rail-card {
  margin-top: 0.15rem;
}

.overview-health-rail-card {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.overview-health-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.overview-health-kpi {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.48);
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.18rem;
}

.light-style .overview-health-kpi {
  background: rgba(248, 250, 252, 0.88);
  border-color: rgba(15, 23, 42, 0.12);
}

.overview-health-kpi span {
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.overview-health-kpi strong {
  font-size: 1.05rem;
  line-height: 1.2;
}

.overview-health-list,
.overview-alert-stream {
  display: grid;
  gap: 0.5rem;
  max-height: 290px;
  overflow-y: auto;
  align-content: start;
  padding-right: 0.2rem;
}

.overview-health-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.48);
  padding: 0.6rem 0.7rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 150ms ease, transform 150ms ease;
}

.overview-health-item:hover {
  border-color: rgba(79, 140, 255, 0.6);
  transform: translateY(-1px);
}

.light-style .overview-health-item {
  background: rgba(248, 250, 252, 0.9);
}

.overview-health-item p {
  margin: 0.25rem 0 0;
}

.overview-alert-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.48);
  padding: 0.6rem 0.7rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}

.light-style .overview-alert-row {
  background: rgba(248, 250, 252, 0.9);
}

.overview-alert-copy {
  display: grid;
  gap: 0.24rem;
}

.overview-alert-copy strong {
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.overview-alert-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.overview-alert-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.76rem;
}

.overview-alert-meta .overview-resource-link {
  font-size: 0.76rem;
}

.overview-alert-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.overview-alert-btn {
  padding: 0.28rem 0.62rem;
  font-size: 0.74rem;
  line-height: 1.2;
}

.overview-panels--with-ask {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.overview-panels--with-ask .overview-chat-card {
  grid-column: 1 / 2;
  height: 100%;
  min-height: 0;
}

.overview-planner-panel {
  grid-column: 1 / -1;
}

.overview-panels--health-rail .overview-planner-panel {
  grid-column: 2 / 3;
}

.overview-panels--with-ask .overview-planner-panel {
  grid-column: 2 / -1;
}

.overview-panel,
.overview-table-panel,
.overview-followups {
  display: grid;
  gap: 0.65rem;
}

.overview-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.overview-panel-head h3 {
  margin-bottom: 0;
}

.overview-chart-canvas {
  width: 100%;
  height: 220px;
  display: block;
}

.overview-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.overview-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.32rem;
}

.overview-dot-healthy {
  background: #22c55e;
}

.overview-dot-unhealthy {
  background: #ef4444;
}

.overview-dot-unknown {
  background: #94a3b8;
}

.overview-dot-error {
  background: #f97316;
}

.overview-dot-warning {
  background: #facc15;
}

.overview-dot-info {
  background: #60a5fa;
}

.overview-table-wrap {
  overflow-x: auto;
}

.overview-table-wrap--tasks {
  max-height: 420px;
  overflow-y: auto;
}

.overview-table th,
.overview-table td {
  padding: 0.65rem 0.35rem;
}

.overview-resource-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.overview-resource-link:hover {
  text-decoration: underline;
}

.overview-followups-list {
  display: grid;
  gap: 0.55rem;
}

.overview-followup-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.48);
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.light-style .overview-followup-item {
  background: rgba(148, 163, 184, 0.08);
}

.overview-followup-item p {
  margin: 0.28rem 0 0;
}

.overview-chat-card {
  display: grid;
  gap: 0.65rem;
  align-content: stretch;
}

.overview-ask-widget-slot {
  min-height: 0;
  height: 100%;
}

.overview-ask-widget-slot .ask-terminal-widget--embedded {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.overview-ask-widget-slot .ask-terminal-widget--embedded .ask-terminal-widget__head {
  cursor: default;
  touch-action: auto;
}

.overview-chat-head {
  align-items: center;
}

.overview-sudo-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.overview-chat-widget.ask-chat-widget {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: #09111d;
  min-height: 340px;
}

.light-style .overview-chat-widget.ask-chat-widget {
  background: #eff6ff;
  border-color: rgba(15, 23, 42, 0.12);
}

.overview-chat-widget .overview-chat-messages {
  max-height: 300px;
}

.overview-chat-form {
  margin: 0;
}

.overview-chat-compose {
  display: grid;
  gap: 0.55rem;
}

.overview-chat-compose textarea {
  min-height: 76px;
  resize: vertical;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  padding: 0.65rem 0.72rem;
  background: rgba(15, 23, 42, 0.52);
  color: #e2e8f0;
}

.overview-chat-compose textarea:focus {
  outline: 2px solid rgba(79, 140, 255, 0.45);
  border-color: rgba(79, 140, 255, 0.7);
}

.light-style .overview-chat-compose textarea {
  background: rgba(255, 255, 255, 0.90);
  color: #0f172a;
}

.overview-chat-compose .primary-btn {
  justify-self: end;
}

.overview-notify-card {
  display: grid;
  gap: 0.65rem;
}

.overview-notify-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.overview-notify-list {
  max-height: 360px;
  overflow-y: auto;
  display: grid;
  gap: 0.45rem;
  align-content: start;
  grid-auto-rows: min-content;
}

@media (max-width: 1500px) {
  .overview-panels--health-rail {
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.75fr);
  }

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

@media (max-width: 1180px) {
  .overview-dashboard {
    grid-template-columns: 1fr;
  }

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

  .overview-health-rail,
  .overview-panels--health-rail .overview-planner-panel {
    grid-column: 1 / -1;
  }

  .overview-panels--with-ask .overview-chat-card,
  .overview-panels--with-ask .overview-planner-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .overview-intro {
    flex-direction: column;
  }

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

  .overview-health-kpis {
    grid-template-columns: 1fr;
  }

  .overview-chat-widget .overview-chat-messages {
    max-height: 220px;
  }

  .overview-notify-actions .ghost-btn {
    width: 100%;
  }
}

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

.settings-layout {
  align-items: start;
}

.settings-folder-panel {
  position: sticky;
  top: 1rem;
}

.settings-folder-link {
  text-decoration: none;
  color: var(--text);
}

.settings-folder-link:hover {
  color: var(--text);
}

.settings-header {
  display: grid;
  gap: 0.85rem;
  min-height: 132px;
  align-content: start;
}

.settings-header p {
  max-width: 62ch;
}

.settings-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.settings-subnav-link {
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: rgba(15, 23, 42, 0.48);
  font-weight: 500;
}

.light-style .settings-subnav-link {
  background: rgba(148, 163, 184, 0.08);
}

.settings-subnav-link.active {
  color: #0a0f1d;
  background: var(--accent);
  border-color: transparent;
}

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

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

.settings-field {
  display: grid;
  gap: 0.35rem;
}

.settings-field span {
  font-size: 0.83rem;
  color: var(--muted);
}

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

.settings-api-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem;
  background: rgba(15, 23, 42, 0.48);
}

.light-style .settings-api-box {
  background: rgba(148, 163, 184, 0.08);
}

.settings-api-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.settings-api-box code {
  font-size: 0.86rem;
  word-break: break-all;
}

.settings-hint {
  font-size: 0.82rem;
}

.settings-connector-list {
  display: grid;
  gap: 0.6rem;
}

.settings-connector-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.settings-connector-item.is-disabled {
  opacity: 0.82;
}

.light-style .settings-connector-item {
  background: rgba(148, 163, 184, 0.08);
}

.settings-connector-item h4 {
  margin: 0 0 0.2rem;
}

.settings-connector-item p {
  margin: 0;
}

.settings-connector-meta {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.settings-connector-identity {
  color: var(--muted);
  font-size: 0.78rem;
}

.settings-connector-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.settings-connector-actions form {
  margin: 0;
}

.settings-connector-actions .secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.settings-connector-actions .secondary-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.settings-next {
  border-style: dashed;
}

.settings-key-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-key-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.48);
  display: grid;
  gap: 0.7rem;
}

.light-style .settings-key-card {
  background: rgba(148, 163, 184, 0.08);
}

.settings-key-card h4 {
  margin: 0;
}

.settings-key-card-single {
  max-width: 640px;
}

.settings-key-form {
  display: grid;
  gap: 0.55rem;
}

.settings-key-list {
  display: grid;
  gap: 0.4rem;
}

.settings-key-item {
  display: grid;
  gap: 0.15rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
}

.settings-key-item code {
  font-size: 0.82rem;
}

.team-tabs {
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--field-bg);
}

.team-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  text-decoration: none;
  color: var(--muted);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-weight: 500;
}

.team-tab.active {
  background: var(--accent);
  color: #0a0f1d;
}

.team-status {
  margin-top: 0.9rem;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
}

.team-status-success {
  background: rgba(34, 197, 94, 0.16);
  color: #b7f0a0;
}

.team-status-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #ffd39c;
}

.team-status-info {
  background: rgba(79, 140, 255, 0.16);
  color: #c9dbff;
}

.light-style .team-status-success {
  color: #166534;
}

.light-style .team-status-warning {
  color: #92400e;
}

.light-style .team-status-info {
  color: #1e40af;
}

.directory-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.directory-actions .table-header {
  align-items: center;
}

.directory-actions .table-actions {
  flex-wrap: wrap;
}

.directory-users-panel {
  display: grid;
  gap: 0.75rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 7rem);
}

.directory-users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.directory-users-toolbar h3 {
  margin: 0;
}

.directory-users-list {
  display: grid;
  gap: 0.55rem;
  overflow: auto;
  padding-right: 0.15rem;
}

.directory-user-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.50);
  color: var(--text);
  padding: 0.6rem 0.65rem;
  text-align: left;
  display: grid;
  gap: 0.35rem;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.light-style .directory-user-row {
  background: rgba(148, 163, 184, 0.08);
}

.directory-user-row:hover {
  border-color: rgba(79, 140, 255, 0.55);
  transform: translateY(-1px);
}

.directory-user-row.is-active {
  border-color: rgba(79, 140, 255, 0.85);
  background: rgba(79, 140, 255, 0.2);
}

.directory-user-row--pending {
  cursor: default;
  border-style: dashed;
}

.directory-user-row--pending:hover {
  border-color: var(--border);
  transform: none;
}

.directory-user-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.directory-mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.directory-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.directory-detail-panel {
  display: grid;
  gap: 1rem;
}

.directory-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.directory-detail-head h2 {
  margin: 0 0 0.2rem;
}

.directory-detail-head p {
  margin: 0;
}

.directory-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.directory-meta-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.directory-meta-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.48);
  padding: 0.75rem;
}

.light-style .directory-meta-card {
  background: rgba(148, 163, 184, 0.08);
}

.directory-meta-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.directory-meta-card p {
  margin: 0;
  color: var(--text);
}

.directory-section {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  display: grid;
  gap: 0.6rem;
}

.directory-section-head h4 {
  margin: 0;
}

.directory-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

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

.directory-team-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.48);
  padding: 0.65rem;
  display: grid;
  gap: 0.5rem;
}

.light-style .directory-team-card {
  background: rgba(148, 163, 184, 0.08);
}

.directory-team-head {
  display: grid;
  gap: 0.45rem;
}

.directory-team-members {
  display: grid;
  gap: 0.4rem;
}

.directory-team-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.directory-empty-state {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}

.directory-empty-state p {
  margin: 0;
}

.modal-fieldset {
  margin: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  gap: 0.55rem;
}

.modal-fieldset legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.invite-preview {
  display: grid;
  gap: 0.5rem;
}

.invite-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.invite-preview-frame {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.invite-preview-text {
  margin: 0;
  min-height: 120px;
  white-space: pre-wrap;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: rgba(15, 23, 42, 0.48);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.83rem;
  line-height: 1.5;
  overflow: auto;
}

.light-style .invite-preview-text {
  background: rgba(148, 163, 184, 0.08);
}

.directory-feature-grid {
  display: grid;
  gap: 0.55rem;
}

.directory-feature-grid .checkbox {
  align-items: start;
}

.directory-feature-grid .checkbox span {
  display: grid;
  gap: 0.2rem;
}

.directory-feature-grid .checkbox strong {
  font-size: 0.9rem;
}

.team-member-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  max-height: 320px;
  overflow: auto;
  padding-right: 0.15rem;
}

.team-member-option {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.46);
  padding: 0.55rem 0.6rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.light-style .team-member-option {
  background: rgba(148, 163, 184, 0.08);
}

.team-member-option input {
  margin-top: 0.2rem;
}

.team-member-option span {
  display: grid;
  gap: 0.12rem;
}

.team-member-stack {
  display: grid;
  gap: 0.35rem;
}

.team-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.table-actions {
  display: flex;
  gap: 0.6rem;
}

.table-actions-col {
  text-align: right;
  width: 120px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.icon-btn-small {
  padding: 0.3rem 0.45rem;
  font-size: 0.8rem;
}

.icon-btn.danger {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.icon-btn.danger:hover {
  background: rgba(248, 113, 113, 0.15);
}

.inline-form {
  display: inline;
}

.resources-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.wiki-layout {
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
}

.wiki-layout.is-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.wiki-layout.is-sidebar-collapsed .wiki-sidebar {
  display: none;
}

.team-hub-page {
  display: grid;
  gap: 1rem;
}

.team-hub-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.team-hub-head h2 {
  margin-bottom: 0.35rem;
}

.team-hub-head p {
  margin: 0;
}

.team-hub-kpis {
  margin-top: 0.85rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-membership-tags {
  margin-top: 0.9rem;
}

.team-page-shell {
  align-items: start;
}

.resources-layout.team-page-shell {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
}

.team-page-shell--single {
  display: block;
}

.team-page-main {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.team-page-nav {
  display: grid;
  gap: 0.75rem;
}

.team-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.52fr);
  gap: 1rem;
  align-items: start;
}

.team-workbench--planner-only {
  grid-template-columns: minmax(0, 1fr);
}

.team-chat-panel,
.team-planner-panel {
  display: grid;
  gap: 0.75rem;
}

.team-chat-widget {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(79, 140, 255, 0.12), transparent 42%),
    #0a1019;
  min-height: 410px;
}

.team-chat-feed {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.46);
  min-height: 300px;
  max-height: 500px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.6rem;
  padding: 0.7rem;
}

.team-chat-empty {
  color: var(--muted);
  font-size: 0.88rem;
}

.team-chat-msg {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 0.55rem;
  gap: 0.28rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 10px;
  padding: 0.52rem 0.62rem 0.56rem;
  max-width: min(95%, 92%);
  background: rgba(30, 41, 59, 0.95);
}

.team-chat-msg--mine {
  align-self: flex-end;
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.42);
}

.team-chat-msg--mine .team-chat-msg__author .comment-avatar-fallback {
  background: rgba(16, 185, 129, 0.78);
  border-color: rgba(110, 231, 183, 0.7);
}

.team-chat-msg--mine .team-chat-msg__meta strong {
  color: #d1fae5;
}

.team-chat-msg--mine .team-chat-msg__body {
  color: #d1fae5;
}

.team-chat-msg--mine .team-chat-msg__meta {
  color: rgba(209, 250, 229, 0.75);
}

.team-chat-msg--other {
  align-self: flex-start;
}

.team-chat-msg--other .team-chat-msg__author .comment-avatar-fallback {
  background: rgba(79, 140, 255, 0.78);
  border-color: rgba(147, 197, 253, 0.62);
}

.team-chat-msg__author .comment-avatar-fallback {
  width: 22px;
  height: 22px;
  font-size: 0.62rem;
}

.team-chat-compose {
  display: grid;
  gap: 0.55rem;
}

.team-chat-compose .resource-note-chat {
  --note-chat-surface: rgba(15, 23, 42, 0.82);
  --note-chat-ink: #d8e2f2;
  --note-chat-muted: #94a3b8;
  max-width: none;
  margin-left: 0;
}

.light-style .team-chat-compose .resource-note-chat {
  --note-chat-surface: rgba(15, 23, 42, 0.82);
  --note-chat-ink: #d8e2f2;
  --note-chat-muted: #94a3b8;
}

.team-chat-compose [data-team-chat-input] {
  resize: none;
  min-height: 44px;
  max-height: 7.5rem;
  margin-left: 0;
  padding-left: 4.9rem;
}

.team-chat-compose [data-team-chat-input]:focus,
.team-chat-compose [data-team-chat-input]:not(:placeholder-shown),
.team-chat-compose .resource-note-chat.has-file [data-team-chat-input] {
  margin-left: 0;
  padding-left: 1rem;
}

.team-chat-compose .resource-note-upload-hints {
  top: 50%;
  left: 0.65rem;
  gap: 0.25rem;
  transform: translateY(-50%);
}

.team-chat-compose .resource-note-upload-icon {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

.team-chat-compose .resource-note-label-send {
  color: #f8fafc;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.72), rgba(17, 24, 39, 0.72)),
    linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.42);
}

.team-chat-compose .resource-note-label-send:hover,
.team-chat-compose .resource-note-label-send:focus-visible {
  background-image:
    linear-gradient(rgba(30, 41, 59, 0.88), rgba(30, 41, 59, 0.88)),
    linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb);
  box-shadow: 0 12px 22px rgba(2, 6, 23, 0.5);
}

.team-chat-compose .resource-note-label-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.team-chat-compose .resource-note-label-files {
  left: 0.2rem;
}

.team-chat-msg__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.75rem;
  grid-column: 2;
}

.team-chat-msg__meta strong {
  color: var(--text);
  font-size: 0.78rem;
}

.team-chat-msg__body {
  margin: 0;
  word-break: break-word;
  line-height: 1.35;
  font-size: 0.9rem;
  grid-column: 2;
}

.team-chat-msg__attachment {
  grid-column: 2;
  margin-top: 0.25rem;
}

.team-chat-msg__file {
  grid-column: 2;
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.25rem;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.45);
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.team-chat-msg__file:hover,
.team-chat-msg__file:focus-visible {
  border-color: rgba(56, 189, 248, 0.55);
}

.team-chat-msg__author {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.team-chat-compose-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.team-chat-file-meta {
  overflow-wrap: anywhere;
}

.team-chat-active-team {
  display: grid;
  justify-items: end;
  gap: 0.1rem;
}

.planner-panel {
  gap: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background:
    radial-gradient(circle at top right, rgba(79, 140, 255, 0.12), transparent 45%),
    radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.08), transparent 40%),
    var(--panel);
}

.light-style .planner-panel {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.1), transparent 45%),
    radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.08), transparent 40%),
    var(--panel);
}

.planner-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.85rem;
}

.planner-head-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.planner-notify-btn {
  flex: 0 0 auto;
}

.planner-title h3 {
  margin: 0;
}

.planner-title p {
  margin: 0.28rem 0 0;
}

.planner-toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.planner-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.planner-today-btn {
  height: 30px;
  padding: 0.25rem 0.62rem;
  font-size: 0.78rem;
}

.planner-month-label {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.planner-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  padding: 0.2rem;
  background: rgba(15, 23, 42, 0.52);
}

.light-style .planner-view-switch {
  background: rgba(255, 255, 255, 0.9);
}

.planner-view-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.planner-view-btn.is-active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.32), rgba(79, 140, 255, 0.36));
  color: #eef5ff;
}

.light-style .planner-view-btn.is-active {
  color: #0b1224;
}

.planner-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.planner-stat-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 0.55rem 0.62rem;
  display: grid;
  gap: 0.2rem;
  background: rgba(15, 23, 42, 0.48);
}

.light-style .planner-stat-card {
  background: rgba(255, 255, 255, 0.88);
}

.planner-stat-card span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.planner-stat-card strong {
  font-size: 1.25rem;
  line-height: 1.15;
}

.planner-stat-card small {
  color: var(--muted);
  font-size: 0.74rem;
}

.planner-stat-card--today {
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.18);
}

.planner-stat-card--week {
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.planner-stat-card--done {
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.2);
}

.planner-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.planner-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.planner-filters .planner-toolbar {
  margin-left: auto;
}

.planner-filter-chip {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.50);
  color: var(--muted);
  padding: 0.26rem 0.55rem;
  font-size: 0.74rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.light-style .planner-filter-chip {
  background: rgba(255, 255, 255, 0.88);
}

.planner-filter-chip span {
  font-weight: 600;
  color: inherit;
  opacity: 0.92;
}

.planner-filter-chip.is-active {
  color: #ebf4ff;
  border-color: rgba(79, 140, 255, 0.6);
  background: rgba(79, 140, 255, 0.26);
}

.light-style .planner-filter-chip.is-active {
  color: #0b1224;
}

.planner-body {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.2fr);
  gap: 0.75rem;
  align-items: stretch;
}

.planner-agenda-shell {
  order: 1;
}

.planner-calendar-shell {
  order: 2;
}

.planner-panel--agenda .planner-body {
  grid-template-columns: minmax(0, 1fr);
}

.planner-panel--agenda .planner-calendar-shell {
  display: none;
}

.planner-panel--agenda .planner-agenda {
  max-height: 65vh;
}

.planner-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.planner-weekday {
  text-align: center;
  font-size: 0.73rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.planner-day {
  min-height: 74px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.54);
  color: var(--text);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.34rem;
  align-content: space-between;
  padding: 0.45rem 0.48rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.light-style .planner-day {
  background: rgba(255, 255, 255, 0.90);
}

.planner-day:hover {
  border-color: rgba(79, 140, 255, 0.55);
  transform: translateY(-1px);
}

.planner-day.is-outside {
  opacity: 0.45;
}

.planner-day.is-today {
  border-color: rgba(34, 197, 94, 0.55);
}

.planner-day.is-selected {
  border-color: rgba(79, 140, 255, 0.86);
  background: rgba(79, 140, 255, 0.24);
}

.planner-day.has-items {
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.planner-day__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
}

.planner-day__num {
  font-size: 0.86rem;
  font-weight: 700;
}

.planner-day__count {
  font-size: 0.7rem;
  border-radius: 999px;
  padding: 0.05rem 0.42rem;
  border: 1px solid rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.24);
}

.planner-day__dots {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  min-height: 8px;
}

.planner-day-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
}

.planner-day-dot--meeting {
  background: #38bdf8;
}

.planner-day-dot--delivery {
  background: #fb923c;
}

.planner-day-dot--follow-up {
  background: #c084fc;
}

.planner-day-dot--review {
  background: #34d399;
}

.planner-agenda-shell {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.50);
  padding: 0.7rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.55rem;
  min-height: 298px;
}

.light-style .planner-agenda-shell {
  background: rgba(255, 255, 255, 0.88);
}

.planner-agenda-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
}

.planner-agenda-head h4 {
  margin: 0;
}

.planner-agenda {
  display: grid;
  gap: 0.42rem;
  max-height: 340px;
  overflow: auto;
  padding-right: 0.15rem;
  align-content: start;
  grid-auto-rows: min-content;
}

.planner-panel:not(.planner-panel--agenda) .planner-agenda-shell,
.planner-panel:not(.planner-panel--agenda) .planner-calendar-shell {
  height: 100%;
  min-height: 0;
}

.planner-panel:not(.planner-panel--agenda) .planner-body {
  height: 520px;
  min-height: 520px;
}

.planner-panel:not(.planner-panel--agenda) .planner-agenda {
  max-height: none;
  height: 100%;
  min-height: 0;
}

.overview-planner-panel .planner-calendar {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto repeat(6, minmax(0, 1fr));
  align-content: stretch;
}

.overview-planner-panel .planner-day {
  min-height: 0;
  height: 100%;
}

.planner-empty {
  margin: 0;
  padding: 0.5rem 0.35rem;
}

.planner-agenda-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  margin-top: 0.18rem;
  padding: 0.34rem 0.2rem 0.12rem;
}

.planner-agenda-divider__text {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.planner-agenda-divider:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.planner-agenda-divider strong {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.planner-agenda-divider__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.planner-section-action-btn {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.42);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.12rem 0.5rem;
  cursor: pointer;
}

.planner-section-action-btn:hover {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(37, 99, 235, 0.46);
}

.planner-section-action-btn--icon {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.9rem;
}

.light-style .planner-section-action-btn {
  background: rgba(15, 23, 42, 0.05);
  color: #1e293b;
  border-color: rgba(37, 99, 235, 0.32);
}

.light-style .planner-section-action-btn:hover {
  background: rgba(37, 99, 235, 0.13);
}

.planner-agenda-section-items {
  display: grid;
  gap: 0.34rem;
  align-content: start;
  grid-auto-rows: min-content;
}

.planner-agenda-group {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.48);
  padding: 0.45rem;
  display: grid;
  gap: 0.35rem;
}

.light-style .planner-agenda-group {
  background: rgba(248, 250, 252, 0.82);
}

.planner-agenda-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}

.planner-agenda-group__items {
  display: grid;
  gap: 0.34rem;
  align-content: start;
  grid-auto-rows: min-content;
}

.planner-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.42rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.38rem 0.42rem;
  background: rgba(2, 8, 23, 0.26);
}

.light-style .planner-item {
  background: rgba(255, 255, 255, 0.85);
}

.planner-item input[type="checkbox"] {
  margin: 0.1rem 0 0;
  accent-color: #4f8cff;
}

.planner-done-confirm {
  position: fixed;
  z-index: 3000;
  min-width: 138px;
  border: 1px solid rgba(79, 140, 255, 0.4);
  border-radius: 12px;
  background: rgba(9, 14, 28, 0.97);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.52);
  padding: 0.48rem 0.52rem;
  display: grid;
  gap: 0.44rem;
}

.light-style .planner-done-confirm {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.planner-done-confirm__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.planner-done-confirm__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.planner-done-confirm__btn {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #fff;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.planner-done-confirm__btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.planner-done-confirm__btn:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.8);
  outline-offset: 2px;
}

.planner-done-confirm__btn--confirm {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-color: rgba(34, 197, 94, 0.7);
}

.planner-done-confirm__btn--cancel {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: rgba(239, 68, 68, 0.75);
}

.planner-item.is-done {
  opacity: 0.6;
}

.planner-item__body {
  display: grid;
  gap: 0.14rem;
}

.planner-item__title {
  line-height: 1.24;
  font-size: 0.9rem;
}

.planner-item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.42rem;
}

.planner-item__badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.planner-item-badge-btn {
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  color: #dbeafe;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.1rem 0.5rem;
  cursor: pointer;
  white-space: nowrap;
}

.planner-item-badge-btn:hover {
  background: rgba(59, 130, 246, 0.28);
}

.light-style .planner-item-badge-btn {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
}

.planner-item__actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.planner-item-action-btn {
  border: 1px solid rgba(59, 130, 246, 0.32);
  border-radius: 999px;
  background: rgba(30, 64, 175, 0.2);
  color: #dbeafe;
  font-size: 0.64rem;
  letter-spacing: 0.01em;
  padding: 0.08rem 0.42rem;
  cursor: pointer;
}

.planner-item-action-btn:hover {
  background: rgba(37, 99, 235, 0.3);
}

.light-style .planner-item-action-btn {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
}

.planner-comments-list {
  display: grid;
  gap: 0.45rem;
  max-height: 320px;
  overflow: auto;
  padding-right: 0.2rem;
}

.planner-comment-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.5rem;
  background: rgba(15, 23, 42, 0.50);
}

.planner-comment-item__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}

.planner-comment-item__text {
  margin: 0.2rem 0 0;
  white-space: pre-wrap;
}

.planner-comment-quickreact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.planner-comment-quickreact__label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-right: 0.15rem;
}

.planner-comment-quickreact__btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.18rem 0.6rem;
  transition: background 0.15s, border-color 0.15s;
}

.planner-comment-quickreact__btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: var(--accent, #6366f1);
}

/* Inline comment strip on agenda task rows */
.planner-item__inline-comment {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.planner-item__react-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.15rem 0.55rem;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.planner-item__react-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent, #6366f1);
}

.planner-item__react-btn.is-sent {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent, #6366f1);
  opacity: 0.7;
}

.planner-item__react-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.planner-item__comment-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  flex: 1 1 6rem;
  font-size: 0.7rem;
  min-width: 0;
  padding: 0.18rem 0.45rem;
}

.planner-item__comment-input:focus {
  border-color: var(--accent, #6366f1);
  outline: none;
}

.planner-item__comment-send {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid var(--accent, #6366f1);
  border-radius: 6px;
  color: var(--accent, #6366f1);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.18rem 0.55rem;
  transition: background 0.15s;
  white-space: nowrap;
}

.planner-item__comment-send:hover {
  background: rgba(99, 102, 241, 0.32);
}

.planner-item__comment-send.is-sent {
  background: rgba(99, 102, 241, 0.35);
  opacity: 0.7;
}

.planner-item__comment-send:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.planner-item__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.7rem;
}

.planner-item__time {
  color: var(--muted);
}

.planner-item__source {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.14);
  color: #c7ddff;
  padding: 0.02rem 0.32rem;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.light-style .planner-item__source {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
}

.planner-kind-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.04rem 0.38rem;
  border: 1px solid transparent;
  font-size: 0.64rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.planner-kind-pill--meeting {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}

.planner-kind-pill--delivery {
  background: rgba(251, 146, 60, 0.2);
  border-color: rgba(251, 146, 60, 0.35);
  color: #fed7aa;
}

.planner-kind-pill--follow-up {
  background: rgba(192, 132, 252, 0.2);
  border-color: rgba(192, 132, 252, 0.35);
  color: #e9d5ff;
}

.planner-kind-pill--review {
  background: rgba(52, 211, 153, 0.2);
  border-color: rgba(52, 211, 153, 0.35);
  color: #bbf7d0;
}

.light-style .planner-kind-pill--meeting {
  color: #0369a1;
}

.light-style .planner-kind-pill--delivery {
  color: #9a3412;
}

.light-style .planner-kind-pill--follow-up {
  color: #7e22ce;
}

.light-style .planner-kind-pill--review {
  color: #047857;
}

.planner-quick-add {
  border-top: 1px dashed var(--border);
  padding-top: 0.7rem;
  display: grid;
  gap: 0.52rem;
}

.planner-quick-add label {
  display: grid;
  gap: 0.22rem;
}

.planner-quick-add label span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.planner-quick-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.planner-submit-wrap {
  display: flex;
  align-items: end;
}

.planner-submit-wrap .secondary-btn {
  width: 100%;
}

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

.planner-integration-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.58rem 0.64rem;
  background: rgba(15, 23, 42, 0.46);
}

.light-style .planner-integration-card {
  background: rgba(255, 255, 255, 0.89);
}

@media (max-width: 1400px) {
  .planner-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .planner-agenda-shell {
    min-height: 0;
  }

  .planner-panel:not(.planner-panel--agenda) .planner-body {
    height: auto;
    min-height: 0;
  }

  .planner-panel:not(.planner-panel--agenda) .planner-agenda-shell,
  .planner-panel:not(.planner-panel--agenda) .planner-calendar-shell {
    height: auto;
  }

  .planner-panel:not(.planner-panel--agenda) .planner-agenda {
    height: auto;
    max-height: 340px;
  }
}

@media (max-width: 980px) {
  .planner-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .planner-head-actions {
    width: 100%;
    margin-left: 0;
  }

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

  .planner-filters .planner-toolbar {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

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

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

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

@media (max-width: 640px) {
  .planner-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .planner-filters .planner-toolbar {
    align-items: stretch;
  }

  .planner-nav {
    width: 100%;
    justify-content: space-between;
  }

  .planner-month-label {
    width: 100%;
  }

  .planner-view-switch {
    width: 100%;
    justify-content: space-between;
  }

  .planner-view-btn {
    flex: 1 1 auto;
    text-align: center;
  }

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

.resources-main {
  display: grid;
  gap: 1rem;
}

.team-filter-banner {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.48);
  padding: 0.65rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.light-style .team-filter-banner {
  background: rgba(148, 163, 184, 0.08);
}

.team-filter-note {
  margin-top: 0.6rem;
}

.team-folder-panel {
  padding: 0.9rem;
  position: sticky;
  top: 1rem;
}

.team-folder-panel--chat-docked {
  position: static;
}

.team-page-chat-slot {
  display: grid;
  gap: 0.75rem;
}

.wiki-scope-form {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.wiki-scope-select {
  width: 100%;
  min-width: 0;
  min-height: 2.45rem;
}

.wiki-scope-resource-field {
  margin-top: -0.1rem;
}

.wiki-scope-lock {
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.7rem 0.75rem;
  background: rgba(15, 23, 42, 0.52);
}

.wiki-resource-label {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.light-style .wiki-scope-lock {
  background: rgba(255, 255, 255, 0.88);
}

.team-folder-title {
  font-weight: 700;
}

.team-folder-subtitle {
  margin-top: 0.2rem;
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.team-folder-tree {
  display: grid;
  gap: 0.35rem;
}

.team-folder-group {
  display: grid;
  gap: 0.3rem;
  padding-top: 0.35rem;
}

.team-folder-group-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-folder-btn {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  min-width: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.team-folder-btn:hover {
  border-color: rgba(79, 140, 255, 0.35);
  background: rgba(79, 140, 255, 0.12);
}

.team-folder-btn.is-active {
  border-color: rgba(79, 140, 255, 0.55);
  background: rgba(79, 140, 255, 0.2);
}

.folder-icon {
  width: 2.2rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.12rem 0.35rem;
  display: inline-flex;
  justify-content: center;
}

.wiki-main {
  align-content: start;
}

.wiki-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.wiki-sidebar-head-copy {
  min-width: 0;
}

.wiki-sidebar-head .team-folder-subtitle {
  margin-bottom: 0;
}

.wiki-sidebar-toggle {
  margin-top: 0.05rem;
  flex-shrink: 0;
}

.wiki-banner {
  justify-content: space-between;
  border-radius: 16px;
  border-color: rgba(79, 140, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(79, 140, 255, 0.16), rgba(15, 23, 42, 0.24)),
    rgba(15, 23, 42, 0.52);
  padding: 0.8rem 0.9rem;
  flex-wrap: wrap;
}

.light-style .wiki-banner {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(255, 255, 255, 0.75)),
    rgba(255, 255, 255, 0.88);
}

.wiki-banner-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wiki-sidebar-reopen {
  display: none;
}

.wiki-sidebar-reopen.is-visible {
  display: inline-flex;
}

.wiki-banner-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.wiki-resource-chip {
  display: inline-block;
  max-width: min(42vw, 360px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

@media (max-width: 980px) {
  .wiki-resource-chip {
    max-width: min(72vw, 300px);
  }
}

.wiki-sidebar {
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(79, 140, 255, 0.14), rgba(15, 23, 42, 0.28)),
    var(--panel);
}

.light-style .wiki-sidebar {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0.96)),
    var(--panel);
}

.wiki-sidebar-pages {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.wiki-sidebar-pages-head {
  margin-bottom: 0;
}

.wiki-sidebar-pages-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.wiki-sidebar-search {
  margin-bottom: 0;
}

.wiki-sidebar-tree {
  display: grid;
  gap: 0.35rem;
  max-height: calc(100vh - 24rem);
  overflow: auto;
  padding-right: 0.15rem;
}

.wiki-tree-node {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(6, 12, 24, 0.42);
}

.light-style .wiki-tree-node {
  background: rgba(255, 255, 255, 0.9);
}

.wiki-tree-node__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.5rem;
  border-radius: 12px;
}

.wiki-tree-node__summary::-webkit-details-marker {
  display: none;
}

.wiki-tree-node__label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 0.82rem;
}

.wiki-tree-node__count {
  font-size: 0.72rem;
  color: var(--muted);
}

.wiki-tree-node__children {
  display: grid;
  gap: 0.22rem;
  padding: 0 0.35rem 0.35rem 0.35rem;
}

.wiki-tree-node--folder > .wiki-tree-node__children {
  margin-left: 0.45rem;
  border-left: 1px dashed var(--border);
  padding-left: 0.55rem;
}

.wiki-tree-page {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.34rem 0.42rem;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}

button.wiki-tree-page {
  width: 100%;
  text-align: left;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.wiki-tree-page:hover,
.wiki-tree-page:focus-visible {
  border-color: var(--accent-soft);
  background: rgba(79, 140, 255, 0.1);
}

.wiki-tree-page.is-active {
  border-color: rgba(79, 140, 255, 0.55);
  background: rgba(79, 140, 255, 0.16);
}

.wiki-sidebar-page-list {
  display: grid;
  gap: 0.3rem;
  max-height: calc(100vh - 24rem);
  overflow: auto;
  padding-right: 0.15rem;
}

.wiki-sidebar-page-link {
  align-items: flex-start;
  padding: 0.42rem 0.5rem;
  border-radius: 12px;
}

.wiki-sidebar-page-link .folder-icon {
  width: 2rem;
  margin-top: 0.06rem;
}

.wiki-sidebar-page-copy {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.wiki-sidebar-page-copy strong,
.wiki-sidebar-page-copy small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiki-sidebar-page-copy strong {
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.22;
}

.wiki-sidebar-page-copy small {
  font-size: 0.74rem;
}

.wiki-status-panel {
  border-style: solid;
}

.wiki-editor-page {
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: none;
  margin: 0;
}

.wiki-shell {
  display: block;
}

.wiki-shell--single {
  display: block;
}

.wiki-detail-panel {
  display: grid;
  gap: 1rem;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(79, 140, 255, 0.06), rgba(15, 23, 42, 0.18)),
    var(--panel);
}

.light-style .wiki-detail-panel {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.04), rgba(255, 255, 255, 0.96)),
    var(--panel);
}

.wiki-detail-panel--wide {
  width: 100%;
  max-width: none;
}

.wiki-detail-head code {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.wiki-rendered {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(4, 10, 24, 0.46);
  padding: 1.15rem 1.2rem;
  min-height: 260px;
  line-height: 1.62;
  overflow: auto;
}

.light-style .wiki-rendered {
  background: rgba(255, 255, 255, 0.89);
}

.wiki-rendered h1,
.wiki-rendered h2,
.wiki-rendered h3,
.wiki-rendered h4 {
  margin-top: 1.3rem;
  margin-bottom: 0.5rem;
}

.wiki-rendered h1:first-child,
.wiki-rendered h2:first-child,
.wiki-rendered h3:first-child,
.wiki-rendered h4:first-child {
  margin-top: 0;
}

.wiki-rendered p,
.wiki-rendered ul,
.wiki-rendered ol,
.wiki-rendered pre,
.wiki-rendered blockquote {
  margin-top: 0;
  margin-bottom: 0.92rem;
}

.wiki-rendered ul,
.wiki-rendered ol {
  padding-left: 1.2rem;
}

.wiki-rendered ul.contains-task-list {
  list-style: none;
  padding-left: 0;
}

.wiki-rendered .task-list-item {
  list-style: none;
}

.wiki-rendered .task-list-item input[type="checkbox"] {
  margin-right: 0.42rem;
  transform: translateY(1px);
}

.wiki-rendered a {
  color: var(--accent);
}

.wiki-rendered blockquote {
  border-left: 3px solid rgba(79, 140, 255, 0.72);
  padding: 0.12rem 0 0.12rem 0.82rem;
  color: var(--muted);
}

.wiki-rendered pre {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.7);
  padding: 0.85rem;
  overflow: auto;
}

.light-style .wiki-rendered pre {
  background: rgba(15, 23, 42, 0.05);
}

.wiki-rendered code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.84rem;
}

.wiki-rendered :not(pre) > code {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  background: rgba(15, 23, 42, 0.45);
}

.wiki-rendered table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.95rem;
  font-size: 0.9rem;
}

.wiki-rendered th,
.wiki-rendered td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.58rem;
  vertical-align: top;
}

.wiki-rendered th {
  background: rgba(79, 140, 255, 0.16);
  text-align: left;
}

.wiki-rendered hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.wiki-rendered details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.58rem 0.72rem;
  margin-bottom: 0.85rem;
}

.wiki-rendered summary {
  cursor: pointer;
  font-weight: 600;
}

.wiki-rendered .mermaid {
  display: grid;
  justify-content: center;
  min-height: 120px;
}

.modal-content-wide {
  width: min(1080px, 94vw);
}

.modal-content.modal-content-invite {
  width: min(880px, 95vw);
}

.wiki-editor-form {
  display: grid;
  gap: 1rem;
}

.wiki-editor-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  border-radius: 18px;
  padding: 1rem 1.05rem;
  background:
    linear-gradient(135deg, rgba(79, 140, 255, 0.13), rgba(15, 23, 42, 0.28)),
    var(--panel);
}

.light-style .wiki-editor-topbar {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0.94)),
    var(--panel);
}

.wiki-editor-topbar-meta {
  display: grid;
  gap: 0.35rem;
  justify-items: end;
  text-align: right;
}

.wiki-editor-derived {
  display: grid;
  gap: 0.2rem;
}

.wiki-editor-derived strong {
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.06rem;
  font-weight: 600;
}

.wiki-editor-main {
  display: grid;
  gap: 0.95rem;
}

.wiki-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.wiki-editor-grid label,
.wiki-editor-grid section {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.wiki-editor-grid textarea {
  min-height: 560px;
  resize: vertical;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(2, 6, 23, 0.58);
  color: #e2e8f0;
  padding: 1rem 1.05rem;
  line-height: 1.6;
  font-size: 0.98rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.wiki-editor-grid textarea:focus {
  outline: 2px solid rgba(79, 140, 255, 0.44);
  border-color: rgba(79, 140, 255, 0.66);
}

.wiki-editor-preview {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(4, 10, 24, 0.42);
  color: var(--text);
  min-height: 560px;
  max-height: 700px;
  overflow: auto;
  padding: 1rem 1.1rem;
  line-height: 1.62;
  font-size: 0.95rem;
}

.wiki-editor-settings {
  display: grid;
  gap: 0.8rem;
}

.wiki-editor-settings h3 {
  margin: 0;
}

.wiki-editor-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.wiki-editor-settings-grid label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.wiki-editor-resource-field {
  display: grid;
  gap: 0.4rem;
}

.wiki-editor-scope-lock {
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.72rem;
  background: rgba(15, 23, 42, 0.50);
}

.light-style .wiki-editor-scope-lock {
  background: rgba(148, 163, 184, 0.08);
}

.wiki-editor-team-field {
  display: grid;
  gap: 0.4rem;
  grid-column: 1 / -1;
}

.wiki-editor-team-field select {
  min-height: 6.6rem;
}

.wiki-editor-actions {
  padding-top: 0.35rem;
}

.light-style .wiki-editor-grid textarea,
.light-style .wiki-editor-preview {
  border-color: rgba(15, 23, 42, 0.15);
}

.light-style .wiki-editor-grid textarea {
  background: #ffffff;
  color: #0f172a;
}

.light-style .wiki-editor-preview {
  background: rgba(255, 255, 255, 0.96);
}

.resource-ops-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.8fr);
  gap: 1rem;
  align-items: start;
}

.alerts-wrap {
  padding: 1rem;
}

.alerts-header {
  margin-bottom: 0.7rem;
}

.alerts-count {
  min-width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  padding: 0 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(79, 140, 255, 0.2);
  color: #c9dbff;
  border: 1px solid rgba(79, 140, 255, 0.4);
}

.light-style .alerts-count {
  color: #1d4ed8;
}

.alerts-list {
  display: grid;
  gap: 0.55rem;
  max-height: 420px;
  overflow: auto;
  padding-right: 0.2rem;
}

.alert-item {
  text-decoration: none;
  color: var(--text);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.48);
  padding: 0.65rem 0.75rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.light-style .alert-item {
  background: rgba(148, 163, 184, 0.08);
}

.alert-item:hover {
  border-color: rgba(79, 140, 255, 0.55);
  transform: translateY(-1px);
}

.alert-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 0.36rem;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

.alert-item-critical .alert-dot {
  background: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18);
}

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

.alert-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
}

.alert-pill {
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.alert-item-critical .alert-pill {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

.light-style .alert-pill {
  color: #92400e;
}

.light-style .alert-item-critical .alert-pill {
  color: #991b1b;
}

.alert-time {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.alert-title {
  margin-top: 0.25rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.alert-text {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.alert-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.alert-empty-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.theme-switcher {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  cursor: pointer;
}

.theme-switcher__input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switcher__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #2196f3;
  transition: 0.4s;
  z-index: 0;
  overflow: hidden;
  border-radius: 34px;
}

.theme-switcher__sun-moon {
  position: absolute;
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: #ffd700;
  transition: transform 0.4s ease, background-color 0.4s ease;
  border-radius: 50%;
}

.theme-switcher__sun-moon-core {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease;
}

.theme-switcher__stars {
  transform: translateY(-32px);
  opacity: 0;
  transition: 0.4s;
}

.theme-switcher__moon-dot {
  opacity: 0;
  transition: 0.4s;
  fill: #8b8b8b;
}

.theme-switcher__moon-dot--1 {
  left: 10px;
  top: 3px;
  position: absolute;
  width: 6px;
  height: 6px;
  z-index: 4;
}

.theme-switcher__moon-dot--2 {
  left: 2px;
  top: 10px;
  position: absolute;
  width: 10px;
  height: 10px;
  z-index: 4;
}

.theme-switcher__moon-dot--3 {
  left: 16px;
  top: 18px;
  position: absolute;
  width: 3px;
  height: 3px;
  z-index: 4;
}

.theme-switcher__light-ray {
  position: absolute;
  fill: #ffffff;
  opacity: 0.1;
  z-index: -1;
}

.theme-switcher__light-ray--1 {
  left: -8px;
  top: -8px;
  width: 43px;
  height: 43px;
}

.theme-switcher__light-ray--2 {
  left: -50%;
  top: -50%;
  width: 55px;
  height: 55px;
}

.theme-switcher__light-ray--3 {
  left: -18px;
  top: -18px;
  width: 60px;
  height: 60px;
}

.theme-switcher__cloud {
  position: absolute;
  animation-name: theme-switcher-cloud-move;
  animation-duration: 6s;
  animation-iteration-count: infinite;
}

.theme-switcher__cloud--light {
  fill: #eeeeee;
}

.theme-switcher__cloud--dark {
  fill: #cccccc;
  animation-delay: 1s;
}

.theme-switcher__cloud--1 {
  left: 30px;
  top: 15px;
  width: 40px;
}

.theme-switcher__cloud--2 {
  left: 44px;
  top: 10px;
  width: 20px;
}

.theme-switcher__cloud--3 {
  left: 18px;
  top: 24px;
  width: 30px;
}

.theme-switcher__cloud--4 {
  left: 36px;
  top: 18px;
  width: 40px;
}

.theme-switcher__cloud--5 {
  left: 48px;
  top: 14px;
  width: 20px;
}

.theme-switcher__cloud--6 {
  left: 22px;
  top: 26px;
  width: 30px;
}

@keyframes theme-switcher-cloud-move {
  0% {
    transform: translateX(0px);
  }

  40% {
    transform: translateX(4px);
  }

  80% {
    transform: translateX(-4px);
  }

  100% {
    transform: translateX(0px);
  }
}

.theme-switcher__star {
  fill: #ffffff;
  position: absolute;
  transition: 0.4s;
  animation-name: theme-switcher-star-twinkle;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

.theme-switcher__star--1 {
  width: 20px;
  top: 2px;
  left: 3px;
  animation-delay: 0.3s;
}

.theme-switcher__star--2 {
  width: 6px;
  top: 16px;
  left: 3px;
}

.theme-switcher__star--3 {
  width: 12px;
  top: 20px;
  left: 10px;
  animation-delay: 0.6s;
}

.theme-switcher__star--4 {
  width: 18px;
  top: 0px;
  left: 18px;
  animation-delay: 1.3s;
}

@keyframes theme-switcher-star-twinkle {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.2);
  }

  80% {
    transform: scale(0.8);
  }

  100% {
    transform: scale(1);
  }
}

.theme__toggle:checked + .theme-switcher__slider {
  background-color: #0b0b0b;
}

.theme__toggle:focus + .theme-switcher__slider {
  box-shadow: 0 0 1px #2196f3;
}

.theme__toggle:checked + .theme-switcher__slider .theme-switcher__sun-moon {
  transform: translateX(26px);
  background-color: #ffffff;
}

.theme__toggle:checked + .theme-switcher__slider .theme-switcher__sun-moon-core {
  transform: rotate(180deg);
}

.theme__toggle:checked + .theme-switcher__slider .theme-switcher__moon-dot {
  opacity: 1;
}

.theme__toggle:checked + .theme-switcher__slider .theme-switcher__stars {
  transform: translateY(0);
  opacity: 1;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.status {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.status.warning {
  background: rgba(255, 180, 74, 0.2);
  color: #ffd39c;
}

.status.success {
  background: rgba(126, 217, 87, 0.2);
  color: #b7f0a0;
}

.status.danger {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

.status.info {
  background: rgba(79, 140, 255, 0.2);
  color: #c9dbff;
}

.light-style .status.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.32);
}

.light-style .status.success {
  background: rgba(34, 197, 94, 0.18);
  color: #166534;
  border-color: rgba(22, 163, 74, 0.3);
}

.light-style .status.danger {
  background: rgba(239, 68, 68, 0.18);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.3);
}

.light-style .status.info {
  background: rgba(37, 99, 235, 0.16);
  color: #1e3a8a;
  border-color: rgba(37, 99, 235, 0.3);
}

.footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: auto;
}

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

.auth-card {
  width: min(480px, 92vw);
  background: rgba(12, 19, 36, 0.9);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  display: grid;
  gap: 1.6rem;
  position: relative;
  z-index: 1;
}

.auth-card-split {
  width: min(860px, 94vw);
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1fr);
  padding: 0;
  overflow: hidden;
}

.auth-panel {
  padding: 2.5rem;
  background: linear-gradient(140deg, rgba(79, 140, 255, 0.25), rgba(15, 23, 42, 0.7));
  display: grid;
  gap: 1.2rem;
  align-content: start;
}

.auth-brand {
  width: 180px;
}

.auth-brand__img {
  width: 100%;
  height: auto;
  display: block;
}

.auth-panel h1 {
  font-size: 2rem;
}

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

.stat-value {
  font-size: 1.4rem;
  font-weight: 600;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.auth-panel-foot {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-form-wrap {
  padding: 2.5rem;
  display: grid;
  gap: 1.5rem;
  background: rgba(9, 14, 28, 0.9);
}

.auth-header {
  display: grid;
  gap: 1rem;
  align-items: center;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-form label,
.field {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-form input {
  width: 100%;
}

.auth-flash {
  font-size: 0.92rem;
  line-height: 1.35;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.auth-flash.success {
  color: #86efac;
}

.auth-flash.warning {
  color: #fcd34d;
}

.auth-flash.info {
  color: #93c5fd;
}

.field-help {
  font-size: 0.75rem;
  color: var(--muted);
}

.setup-step-title {
  margin: 0;
  font-size: 1.05rem;
}

.setup-step-sub {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.setup-next-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 0.7rem;
  padding: 0;
}

.setup-next-btn {
  display: block;
  width: auto;
  min-width: 190px;
  margin: 0;
  padding: 0.85rem 1.35rem;
  border: 0;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.72), rgba(17, 24, 39, 0.72)),
    linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  color: #f8fafc;
  box-shadow: 0 2rem 3rem rgba(2, 6, 23, 0.45);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform;
}

.setup-next-btn:hover,
.setup-next-btn:focus {
  background-image:
    linear-gradient(rgba(30, 41, 59, 0.88), rgba(30, 41, 59, 0.88)),
    linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb);
  color: #f8fafc;
}

.setup-next-btn__label {
  color: #f8fafc;
  line-height: 1.2;
}

.login-signin-btn {
  width: 100%;
  min-width: 0;
}

.setup-next-btn.is-jiggling {
  animation: chatbot-jiggle 1.5s ease-in-out 1;
}

@keyframes chatbot-shine {
  0% {
    background-position: 0% 50%;
  }
  80% {
    background-position: 50% 90%;
  }
  100% {
    background-position: 91% 100%;
  }
}

@keyframes chatbot-jiggle {
  0%,
  80%,
  100% {
    transform: translateY(0);
  }
  83% {
    transform: translateY(-3px);
  }
  86% {
    transform: translateY(3px);
  }
  89% {
    transform: translateY(-2px);
  }
  92% {
    transform: translateY(2px);
  }
}

@media (max-width: 640px) {
  .setup-next-wrap {
    justify-content: stretch;
  }

  .setup-next-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .setup-next-btn.is-jiggling,
  .setup-next-btn__label {
    animation: none;
  }
}

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

.connector-btn {
  border: 1px solid var(--border);
  border-radius: 14px;
  min-height: 74px;
  background: var(--panel);
  color: var(--text);
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  text-align: left;
  cursor: pointer;
  opacity: 0.96;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.connector-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.6rem 1.4rem rgba(15, 23, 42, 0.2);
}

.connector-btn__logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.connector-btn__label {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.connector-btn__status {
  justify-self: end;
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  border: 1px solid currentColor;
  opacity: 0.75;
}

.connector-btn-openai {
  background: linear-gradient(120deg, #f8fafc, #e8edf6);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.14);
}

.connector-btn-openai .connector-btn__label {
  font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
}

.connector-btn-microsoft {
  background: linear-gradient(120deg, #f4f7fb, #e2e8f0);
  color: #1f2937;
  border-color: rgba(31, 41, 55, 0.16);
}

.connector-btn-microsoft .connector-btn__label {
  font-family: "Segoe UI", "Calibri", sans-serif;
}

.connector-btn-github {
  background: linear-gradient(120deg, #111827, #1f2937);
  color: #f8fafc;
  border-color: rgba(248, 250, 252, 0.2);
}

.connector-btn-github .connector-btn__logo {
  filter: brightness(0) invert(1);
}

.connector-btn-github .connector-btn__label {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.connector-btn-asana {
  background: linear-gradient(120deg, #f26a43, #f03d44);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.connector-btn-asana .connector-btn__label {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.connector-btn-twilio {
  background: linear-gradient(120deg, #f22f46, #d91f35);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.connector-btn-twilio .connector-btn__logo-mark {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.14);
}

.connector-btn-twilio .connector-btn__label {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.connector-btn-placeholder {
  grid-template-columns: 36px 1fr auto;
  background: linear-gradient(120deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.1));
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.3);
  cursor: not-allowed;
}

.connector-btn__logo-mark {
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 50%;
  border: 1px solid currentColor;
}

.connector-config {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(12, 19, 36, 0.35);
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.light-style .connector-config {
  background: rgba(255, 255, 255, 0.65);
}

.connector-config__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.connector-config__title {
  margin: 0;
  font-size: 0.95rem;
}

.connector-config__back {
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

.connector-config__body {
  display: grid;
  gap: 0.75rem;
}

.connector-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.connector-panel-actions .secondary-btn {
  text-decoration: none;
}

.connector-panel-actions .ms-signin-btn {
  margin-top: 0;
}

.connector-help {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

.connector-help p {
  margin: 0 0 0.4rem;
  color: var(--muted);
}

.connector-help code {
  display: block;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font-size: 0.8rem;
  word-break: break-all;
  margin-bottom: 0.65rem;
}

.light-style .connector-help code {
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
}

.connector-help ul {
  margin: 0;
  padding-left: 1.1rem;
}

.connector-support {
  border-left: 3px solid rgba(79, 140, 255, 0.75);
  padding: 0.15rem 0 0.15rem 0.7rem;
}

.connector-support p {
  margin: 0 0 0.4rem;
  color: var(--muted);
}

.connector-support p:last-child {
  margin-bottom: 0;
}

.ms-signin-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  margin-top: 0.2rem;
  line-height: 0;
  text-decoration: none;
}

.ms-signin-btn img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 41px;
  border-radius: 8px;
  box-shadow: 0 0.55rem 1.3rem rgba(15, 23, 42, 0.28);
}

.ms-signin-btn:hover img,
.ms-signin-btn:focus img {
  transform: translateY(-1px);
  transition: transform 140ms ease;
}

.github-signin-btn {
  border: 1px solid #3d444d;
  background: #24292f;
  color: #f6f8fa;
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  justify-self: start;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.github-signin-btn img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

.github-signin-btn:hover,
.github-signin-btn:focus {
  background: #2f363d;
  border-color: #57606a;
  transform: translateY(-1px);
}

.asana-signin-btn {
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: linear-gradient(120deg, #f26a43, #f03d44);
  color: #ffffff;
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  justify-self: start;
}

.asana-signin-btn img {
  width: 18px;
  height: 18px;
}

.asana-signin-btn:hover,
.asana-signin-btn:focus {
  transform: translateY(-1px);
}

.setup-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 0.6rem;
}

.setup-complete-btn {
  min-width: 220px;
}

.secondary-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: 0.7rem 1.1rem;
  font-weight: 500;
  cursor: pointer;
}

.secondary-btn:hover {
  background: rgba(148, 163, 184, 0.08);
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
}

.checkbox input {
  width: auto;
}

.text-link {
  color: var(--text);
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.form-error {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  font-size: 0.85rem;
}

.auth-social-login {
  display: grid;
  gap: 0.7rem;
}

.auth-social-login__heading {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.65rem;
}

.auth-social-login__rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.45), transparent);
}

.auth-social-login__label {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-social-login__providers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
  width: 100%;
}

.auth-social-provider {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.58rem 0.82rem;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.auth-social-provider img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.auth-social-provider:hover,
.auth-social-provider:focus {
  transform: translateY(-1px);
  background: rgba(79, 140, 255, 0.15);
  border-color: rgba(79, 140, 255, 0.55);
  box-shadow: 0 0.7rem 1.45rem rgba(15, 23, 42, 0.24);
}

.auth-social-provider--github {
  border-color: #3d444d;
  background: #24292f;
  color: #f6f8fa;
}

.auth-social-provider--github img {
  filter: brightness(0) invert(1);
}

.auth-social-provider--github:hover,
.auth-social-provider--github:focus {
  background: #2f363d;
  border-color: #57606a;
}

.light-style .auth-social-provider {
  background: rgba(15, 23, 42, 0.04);
}

.light-style .auth-social-provider:hover,
.light-style .auth-social-provider:focus {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0.6rem 1.15rem rgba(15, 23, 42, 0.12);
}

.auth-footer {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 40;
}

.modal.is-active {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 20, 0.65);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: min(520px, 92vw);
  background: var(--modal-bg);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 1.6rem;
  z-index: 1;
  display: grid;
  gap: 1rem;
  box-shadow: var(--shadow);
  margin-top: 7rem;
  max-height: calc(100vh - 8.5rem);
  overflow: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.modal-form {
  display: grid;
  gap: 0.9rem;
}

.modal-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-form label.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.modal-form label.checkbox input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.status-orb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.status-orb.is-loading {
  opacity: 0;
  pointer-events: none;
}

.status-slot {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.status-loader.is-active {
  display: inline-flex;
}

.status-orb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(79, 140, 255, 0.35);
}

.status-orb[data-status="healthy"] {
  background: rgba(34, 197, 94, 0.85);
  border-color: rgba(34, 197, 94, 0.9);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.45);
}

.status-orb[data-status="unhealthy"] {
  background: rgba(248, 113, 113, 0.85);
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.45);
}

.status-orb[data-status="unknown"] {
  background: rgba(148, 163, 184, 0.5);
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: none;
}

.resource-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.resource-detail {
  display: grid;
  gap: 1.5rem;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-title {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 560px;
}

.detail-title-main {
  min-width: 0;
  display: grid;
  gap: 0.42rem;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  min-width: 0;
}

.detail-title-row h1 {
  margin: 0;
  min-width: 0;
  flex: 1 1 340px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.detail-env-row {
  min-width: 0;
}

.detail-resource-type {
  font-size: 0.96rem;
  letter-spacing: 0.01em;
}

.detail-back-link {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  flex: 0 0 auto;
}

.detail-connect-btn {
  height: 30px;
  padding: 0.2rem 0.75rem;
  font-size: 0.82rem;
}

.detail-resource-env-btn {
  width: 100%;
  max-width: min(100%, 780px);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  font-size: 0.75rem;
  padding: 0.34rem 0.7rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.4);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.detail-resource-env-btn span {
  opacity: 0.92;
  overflow: hidden;
  text-overflow: ellipsis;
}

.light-style .detail-resource-env-btn {
  background: rgba(255, 255, 255, 0.78);
}

.detail-resource-env-btn.is-copied {
  border-color: rgba(107, 228, 168, 0.7);
  color: #6be4a8;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.detail-wiki-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
}

.detail-actions-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 0.24rem;
  background: rgba(15, 23, 42, 0.42);
}

.light-style .detail-actions-icons {
  background: rgba(255, 255, 255, 0.82);
}

.detail-edit-btn,
.detail-health-btn,
.detail-alert-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  padding: 0;
}

.detail-edit-btn svg,
.detail-health-btn svg,
.detail-alert-btn svg {
  opacity: 0.92;
}

.detail-health-btn .health-pulse-icon polyline {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-health-btn .health-pulse-back {
  stroke: rgba(255, 255, 255, 0.28);
}

.detail-health-btn .health-pulse-front {
  stroke: #ffffff;
  stroke-dasharray: 48, 144;
  stroke-dashoffset: 192;
  animation: detail-health-pulse-dash 1.4s linear infinite;
}

.detail-health-btn:hover svg,
.detail-health-btn:focus-visible svg,
.detail-edit-btn:hover svg,
.detail-edit-btn:focus-visible svg,
.detail-alert-btn:hover svg,
.detail-alert-btn:focus-visible svg {
  opacity: 1;
}

.detail-health-btn.is-loading {
  opacity: 0.68;
  pointer-events: none;
}

.detail-health-btn.is-loading .health-pulse-front {
  animation-duration: 0.9s;
}

@media (max-width: 1220px) {
  .detail-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .detail-title-row h1 {
    flex-basis: 100%;
    font-size: clamp(1.36rem, 7vw, 2rem);
  }

  .detail-actions-icons {
    width: 100%;
    justify-content: flex-start;
  }
}

@keyframes detail-health-pulse-dash {
  72.5% {
    opacity: 0;
  }

  to {
    stroke-dashoffset: 0;
  }
}

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

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

.detail-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem;
  display: grid;
  gap: 0.8rem;
  box-shadow: var(--shadow);
}

.alert-modal-content {
  width: min(680px, 92vw);
  gap: 1.1rem;
  margin-top: 5rem;
}

.alert-modal-list {
  display: grid;
  gap: 0.75rem;
}

.alert-settings-form {
  display: grid;
  gap: 1rem;
}

.alert-option-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.52);
  padding: 0.8rem;
  display: grid;
  gap: 0.7rem;
}

.light-style .alert-option-card {
  background: rgba(255, 255, 255, 0.8);
}

.alert-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.alert-option-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.alert-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.alert-option-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.alert-option-grid .checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  background: rgba(15, 23, 42, 0.48);
  font-size: 0.84rem;
}

.light-style .alert-option-grid .checkbox {
  background: rgba(248, 250, 252, 0.85);
  border-color: rgba(15, 23, 42, 0.16);
}

.alert-option-grid .checkbox input[type="checkbox"] {
  margin: 0;
}

.overview-card {
  align-content: start;
  gap: 0.9rem;
}

.overview-card-head {
  align-items: center;
}

.overview-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

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

.overview-signal {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.48);
  padding: 0.6rem 0.7rem;
  display: grid;
  gap: 0.25rem;
}

.overview-signal strong {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.overview-health-action {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.overview-meta-item {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.44);
  padding: 0.5rem 0.6rem;
  display: grid;
  gap: 0.2rem;
}

.overview-meta-value {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.overview-meta-code {
  font-size: 0.76rem;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.overview-notes {
  margin-top: 0.1rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  display: grid;
  gap: 0.3rem;
}

.overview-notes p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  max-height: 6.4rem;
  overflow: auto;
  overflow-wrap: anywhere;
  padding-right: 0.2rem;
}

.ssh-terminal-card {
  gap: 0.9rem;
}

.gradient-btn {
  border: none;
  padding: 0.3rem 0.9rem;
  line-height: 1;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #0b1020;
  font-weight: 600;
  background: linear-gradient(135deg, #ff7ad9 0%, #8b5cff 45%, #4fd1ff 100%);
  box-shadow: 0 10px 24px rgba(79, 209, 255, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.gradient-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(255, 122, 217, 0.28);
}

.gradient-btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.terminal-hint {
  font-size: 0.85rem;
}

.resource-notes-feed {
  max-height: 420px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.48);
  padding: 0.6rem;
  display: grid;
  gap: 0.55rem;
  align-content: start;
  grid-auto-rows: min-content;
}

.resource-note {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 8, 23, 0.36);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  display: grid;
  gap: 0.45rem;
}

.resource-note.is-self {
  border-color: rgba(79, 209, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(79, 209, 255, 0.15);
}

.resource-note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.comment-author {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.35);
  flex-shrink: 0;
}

.comment-avatar-fallback {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  background: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
  flex-shrink: 0;
}

.resource-note-body {
  white-space: normal;
  overflow-wrap: anywhere;
}

.resource-note-attachment {
  display: inline-flex;
  width: fit-content;
  max-width: min(360px, 100%);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.resource-note-attachment img {
  display: block;
  width: 100%;
  height: auto;
}

.resource-note-form {
  display: grid;
  gap: 0.55rem;
}

.resource-note-chat {
  --note-chat-surface: rgba(15, 23, 42, 0.82);
  --note-chat-ink: #d8e2f2;
  --note-chat-muted: #94a3b8;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: end;
  width: 100%;
  max-width: 560px;
  margin-left: auto;
}

.light-style .resource-note-chat {
  --note-chat-surface: #e9e9e9;
  --note-chat-ink: #4c4c4c;
  --note-chat-muted: #959595;
}

.resource-note-upload-hints {
  position: absolute;
  left: 0.4rem;
  display: flex;
  color: var(--note-chat-muted);
  transition: all 0.5s;
}

.resource-note-upload-icon {
  margin: 5px;
  padding: 2px;
  cursor: pointer;
  transition: all 0.5s;
}

.resource-note-upload-icon:hover {
  color: var(--note-chat-ink);
  transform: scale(1.08);
}

.resource-note-input-text {
  max-width: 100%;
  width: 100%;
  margin-left: 72px;
  padding: 0.75rem 1rem;
  padding-right: 46px;
  border-radius: 50px;
  border: none;
  outline: none;
  background-color: var(--note-chat-surface);
  color: var(--note-chat-ink);
  font-size: 14px;
  line-height: 18px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 500;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.05);
  resize: none;
  min-height: 46px;
  max-height: 160px;
  z-index: 2;
}

.resource-note-input-text::placeholder {
  color: var(--note-chat-muted);
}

.resource-note-input-text::selection {
  background-color: var(--note-chat-ink);
  color: var(--note-chat-surface);
}

.resource-note-input-text:focus {
  box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.26);
}

.resource-note-input-text:focus,
.resource-note-input-text:not(:placeholder-shown),
.resource-note-chat.has-file .resource-note-input-text {
  margin-left: 42px;
}

.resource-note-input-text:focus ~ .resource-note-upload-hints,
.resource-note-input-text:not(:placeholder-shown) ~ .resource-note-upload-hints,
.resource-note-chat.has-file .resource-note-upload-hints {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  filter: blur(5px);
}

.resource-note-label-files {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateX(-20px) translateY(-50%) scale(1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--note-chat-muted);
  background-color: var(--note-chat-surface);
  border-radius: 50px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.05);
  z-index: 3;
}

.resource-note-label-files input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.resource-note-input-text:focus ~ .resource-note-label-files,
.resource-note-input-text:not(:placeholder-shown) ~ .resource-note-label-files,
.resource-note-chat.has-file .resource-note-label-files {
  transform: translateX(0) translateY(-50%) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.resource-note-label-files:hover,
.resource-note-label-files:focus-visible {
  color: var(--note-chat-ink);
}

.resource-note-label-voice,
.resource-note-label-send {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%) scale(1);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: none;
  outline: none;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.05);
  z-index: 3;
}

.resource-note-label-voice {
  color: var(--note-chat-muted);
  overflow: hidden;
  background: transparent;
}

.resource-note-label-voice:hover,
.resource-note-label-voice:focus-visible {
  color: var(--note-chat-ink);
}

.resource-note-icon-voice {
  position: absolute;
  transition: all 0.3s;
}

.resource-note-label-send {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) scale(0.25);
  color: #f8fafc;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.72), rgba(17, 24, 39, 0.72)),
    linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.42);
  border-radius: 50px;
}

.resource-note-label-send:hover,
.resource-note-label-send:focus-visible {
  background-image:
    linear-gradient(rgba(30, 41, 59, 0.88), rgba(30, 41, 59, 0.88)),
    linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb);
  box-shadow: 0 12px 22px rgba(2, 6, 23, 0.5);
}

.resource-note-label-send:active {
  transform: translateY(-50%) scale(0.9);
}

.resource-note-input-text:focus ~ .resource-note-label-send,
.resource-note-input-text:not(:placeholder-shown) ~ .resource-note-label-send,
.resource-note-chat.has-file .resource-note-label-send {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateY(-50%) scale(1);
}

.resource-note-input-text:focus ~ .resource-note-label-voice,
.resource-note-input-text:not(:placeholder-shown) ~ .resource-note-label-voice,
.resource-note-chat.has-file .resource-note-label-voice {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) scale(0.25);
}

.resource-note-ai {
  display: none;
}

.resource-note-voice-text {
  display: none;
}

.resource-note-meta {
  padding-left: 0.15rem;
}

.health-history-list {
  display: grid;
  gap: 0.55rem;
  max-height: 320px;
  overflow: auto;
}

.health-chart-wrap {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.50);
  padding: 0.6rem 0.7rem 0.5rem;
  display: grid;
  gap: 0.45rem;
}

.health-chart-canvas {
  width: 100%;
  height: 180px;
  display: block;
}

.health-chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.health-chart-summary {
  min-height: 1.1rem;
  line-height: 1.35;
}

.health-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.32rem;
}

.health-dot.latency {
  background: #4fd1ff;
}

.health-dot.fallback {
  background: #f59e0b;
}

.health-dot.ssh {
  background: #e2e8f0;
}

.health-dot.ping-loss {
  background: #f59e0b;
}

.health-dot.healthy {
  background: #22c55e;
}

.health-dot.unhealthy {
  background: #ef4444;
}

.health-dot.unknown {
  background: #94a3b8;
}

.health-dot.method {
  background: #38bdf8;
}

.health-history-row {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: rgba(15, 23, 42, 0.50);
  display: grid;
  gap: 0.35rem;
}

.health-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.health-history-error {
  color: #fca5a5;
  font-size: 0.82rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.health-history-latest {
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.vm-health-head {
  margin-top: 0.35rem;
}

.health-check-btn-muted {
  height: 30px;
  padding: 0.2rem 0.7rem;
  font-size: 0.82rem;
  opacity: 0.86;
}

.health-check-btn-muted:hover,
.health-check-btn-muted:focus {
  opacity: 1;
}

.settings-api-generated {
  border: 1px solid rgba(79, 209, 255, 0.35);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  background: rgba(56, 189, 248, 0.12);
  display: grid;
  gap: 0.25rem;
}

.settings-api-generated code {
  word-break: break-all;
}

.resource-key-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.55rem;
}

.resource-key-form label {
  margin: 0;
}

.resource-key-list {
  display: grid;
  gap: 0.45rem;
}

#resource-api-keys {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#resource-api-keys .resource-key-list {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 100%;
  overflow: auto;
  padding-right: 0.2rem;
  align-content: start;
}

.resource-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  background: rgba(15, 23, 42, 0.46);
}

@media (max-width: 640px) {
  .overview-signal-grid,
  .overview-meta-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .resource-note-chat {
    max-width: 100%;
  }

  .resource-note-input-text {
    margin-left: 52px;
    min-height: 42px;
  }

  .resource-note-input-text:focus,
  .resource-note-input-text:not(:placeholder-shown),
  .resource-note-chat.has-file .resource-note-input-text {
    margin-left: 42px;
  }
}

.terminal-wrap {
  margin-top: 1.5rem;
}

.terminal-window {
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(8, 12, 24, 0.9);
  box-shadow: 0 24px 60px rgba(3, 10, 20, 0.45);
  overflow: hidden;
}

.terminal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(20, 30, 54, 0.9), rgba(12, 18, 38, 0.85));
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.terminal-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.terminal-dots {
  display: inline-flex;
  gap: 0.45rem;
}

.terminal-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  color: #2b0b0b;
  border: none;
  padding: 0;
}

.terminal-dot svg {
  width: 9px;
  height: 9px;
  fill: #5a4a00;
}

.terminal-dot--close {
  background: #ff6b6b;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.6);
}

.terminal-dot--close:hover {
  filter: brightness(1.05);
}

.terminal-dot--copy {
  background: #ffd166;
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.6);
}

.terminal-dot--expand {
  background: #6ee7b7;
  box-shadow: 0 0 0 1px rgba(110, 231, 183, 0.6);
}

.terminal-title {
  font-size: 0.85rem;
  color: var(--muted);
}


.web-terminal-shell {
  height: 520px;
  padding: 12px 16px 18px;
  background: linear-gradient(180deg, rgba(7, 10, 20, 0.95), rgba(10, 14, 22, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(79, 209, 255, 0.12), 0 20px 50px rgba(3, 10, 20, 0.35);
  border-radius: 0 0 18px 18px;
  color: #d7e2f2;
}

.detail-card-title {
  margin: 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.placeholder-block {
  height: 120px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.cloud-logs-card {
  align-content: start;
}

.detail-card-full {
  grid-column: 1 / -1;
}

.cloud-logs-list {
  display: grid;
  gap: 0.7rem;
  max-height: 460px;
  overflow: auto;
  padding-right: 0.25rem;
}

.cloud-log-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.48);
  display: grid;
  gap: 0.45rem;
}

.cloud-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.cloud-log-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cloud-log-level {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
}

.cloud-log-level-danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.cloud-log-level-warning {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.cloud-log-level-muted {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.cloud-log-level-info {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.cloud-log-message {
  white-space: pre-wrap;
  word-break: break-word;
}

.cloud-log-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.84rem;
}

.cloud-log-details pre {
  margin: 0.45rem 0 0;
  padding: 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(2, 8, 23, 0.45);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.xterm-viewport {
  background: transparent !important;
}

.toast {
  position: fixed;
  top: 96px;
  right: 32px;
  z-index: 50;
  background: rgba(12, 19, 36, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  box-shadow: 0 18px 40px rgba(4, 9, 18, 0.45);
  min-width: 240px;
  backdrop-filter: blur(8px);
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast-hidden {
  opacity: 0;
  transform: translateY(-12px);
}

.toast-body {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--text);
}

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff7ad9, #8b5cff, #4fd1ff);
  color: #0b1020;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.toast-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.toast-text {
  font-size: 0.8rem;
  color: var(--muted);
}

.resource-link {
  color: var(--text);
  text-decoration: none;
}

.resource-link:hover {
  color: var(--accent);
}

.typing-indicator {
  width: 16px;
  height: 10px;
  position: relative;
  z-index: 1;
}

.typing-circle {
  width: 4px;
  height: 4px;
  position: absolute;
  border-radius: 50%;
  background-color: var(--text);
  left: 15%;
  transform-origin: 50%;
  animation: typing-circle7124 0.5s alternate infinite ease;
}

@keyframes typing-circle7124 {
  0% {
    top: 6px;
    height: 3px;
    border-radius: 50px 50px 25px 25px;
    transform: scaleX(1.6);
  }

  40% {
    height: 4px;
    border-radius: 50%;
    transform: scaleX(1);
  }

  100% {
    top: 0%;
  }
}

.typing-circle:nth-child(2) {
  left: 45%;
  animation-delay: 0.2s;
}

.typing-circle:nth-child(3) {
  left: auto;
  right: 15%;
  animation-delay: 0.3s;
}

.typing-shadow {
  width: 3px;
  height: 2px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.25);
  position: absolute;
  top: 9px;
  transform-origin: 50%;
  z-index: 0;
  left: 15%;
  filter: blur(1px);
  animation: typing-shadow046 0.5s alternate infinite ease;
}

@keyframes typing-shadow046 {
  0% {
    transform: scaleX(1.4);
  }

  40% {
    transform: scaleX(1);
    opacity: 0.7;
  }

  100% {
    transform: scaleX(0.2);
    opacity: 0.4;
  }
}

.typing-shadow:nth-child(4) {
  left: 45%;
  animation-delay: 0.2s;
}

.typing-shadow:nth-child(5) {
  left: auto;
  right: 15%;
  animation-delay: 0.3s;
}

@media (max-width: 880px) {
  .auth-card-split {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    text-align: center;
  }

  .auth-panel-stats {
    justify-items: center;
  }

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

  .setup-next-btn {
    width: 60%;
    min-width: 0;
  }
}

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

  .mobile-menu-btn {
    display: inline-flex;
  }

  .sidenav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 320px);
    z-index: 40;
    transform: translateX(-108%);
    transition: transform 220ms ease;
    border-right: 1px solid var(--border);
    border-top: none;
  }

  .app-shell.sidebar-open .sidenav {
    transform: translateX(0);
  }

  .sidenav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(2, 6, 23, 0.55);
    z-index: 35;
  }

  .app-shell.sidebar-open .sidenav-backdrop {
    display: block;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    justify-content: space-between;
  }

  .search {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .notification-dropdown {
    right: -0.35rem;
    width: min(92vw, 320px);
  }

  .user-chip {
    display: none;
  }

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

  .card-wide {
    grid-column: auto;
  }

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

  .team-hub-kpis {
    grid-template-columns: 1fr;
  }

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

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

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

  .directory-users-panel {
    position: static;
    max-height: none;
  }

  .directory-detail-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .directory-meta-grid,
  .directory-team-grid {
    grid-template-columns: 1fr;
  }

  .team-member-picker {
    grid-template-columns: 1fr;
  }

  .team-folder-panel {
    position: static;
  }

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

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

  .settings-field-full {
    grid-column: auto;
  }

  .settings-api-box,
  .settings-connector-item {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .wiki-editor-grid,
  .wiki-editor-settings-grid {
    grid-template-columns: 1fr;
  }

  .wiki-editor-topbar {
    flex-direction: column;
  }

  .wiki-editor-topbar-meta {
    width: 100%;
    justify-items: start;
    text-align: left;
  }

  .wiki-sidebar-page-list {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .user-chip {
    width: 100%;
    justify-content: space-between;
  }

  .footer {
    flex-direction: column;
    gap: 0.4rem;
  }

  .directory-users-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .directory-user-row {
    padding: 0.55rem;
  }
}

.chatbot-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1100;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(79, 140, 255, 0.65);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.96), rgba(37, 99, 235, 0.96));
  color: #f8fbff;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.45);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.chatbot-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.5);
  filter: brightness(1.05);
}

.chatbot-fab:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.85);
  outline-offset: 3px;
}

.chatbot-fab-icon {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.light-style .chatbot-fab {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
}

@media (max-width: 767px) {
  .chatbot-fab {
    right: 0.9rem;
    bottom: 0.9rem;
    width: 52px;
    height: 52px;
  }
}

.floating-ask-alshival {
  position: fixed;
  right: 1.25rem;
  bottom: calc(1.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 1100;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-block;
  line-height: 0;
  border-radius: 12px;
  cursor: pointer;
  animation: chatbot-jiggle 3.4s ease-in-out infinite;
}

.floating-ask-alshival__logo {
  display: block;
  width: clamp(124px, 14vw, 172px);
  height: auto;
  filter: drop-shadow(0 10px 22px rgba(2, 6, 23, 0.48));
  transition: transform 0.18s ease;
}

.floating-ask-alshival:hover .floating-ask-alshival__logo,
.floating-ask-alshival:focus-visible .floating-ask-alshival__logo {
  transform: translateY(-1px);
}

.floating-ask-alshival:focus-visible {
  outline: 2px solid rgba(107, 228, 168, 0.75);
  outline-offset: 3px;
}

.floating-ask-agent-bubble {
  position: fixed;
  right: 1rem;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1.75rem + clamp(84px, 9.45vw, 116px) + 0.7rem);
  z-index: 1101;
  width: min(360px, calc(100vw - 2rem));
  padding: 0.7rem 0.85rem 0.8rem;
  border: 1px solid rgba(107, 228, 168, 0.35);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(12, 19, 31, 0.97) 0%, rgba(9, 16, 28, 0.97) 100%);
  box-shadow: 0 18px 46px rgba(2, 6, 23, 0.56);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
  transition: opacity 160ms ease, transform 180ms ease;
}

.floating-ask-agent-bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.floating-ask-agent-bubble::after {
  content: '';
  position: absolute;
  right: 34px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: #0a1220;
  border-right: 1px solid rgba(107, 228, 168, 0.35);
  border-bottom: 1px solid rgba(107, 228, 168, 0.35);
  transform: rotate(45deg);
}

.floating-ask-agent-bubble__close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.5);
  color: #9fb0c8;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.floating-ask-agent-bubble__close:hover {
  background: rgba(15, 23, 42, 0.75);
  color: #dbeafe;
}

.floating-ask-agent-bubble__close:focus-visible {
  outline: 2px solid rgba(107, 228, 168, 0.7);
  outline-offset: 1px;
}

.floating-ask-agent-bubble__content {
  color: #e2e8f0;
  font-size: 0.88rem;
  line-height: 1.45;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  padding-right: 1.35rem;
  max-height: min(36vh, 260px);
  overflow: auto;
}

.floating-ask-agent-bubble__content > *:first-child {
  margin-top: 0;
}

.floating-ask-agent-bubble__content > *:last-child {
  margin-bottom: 0;
}

.floating-ask-agent-bubble__content p,
.floating-ask-agent-bubble__content ul,
.floating-ask-agent-bubble__content ol,
.floating-ask-agent-bubble__content pre,
.floating-ask-agent-bubble__content blockquote {
  margin: 0 0 0.45rem;
}

.floating-ask-agent-bubble__content ul,
.floating-ask-agent-bubble__content ol {
  padding-left: 1.15rem;
}

.floating-ask-agent-bubble__content a {
  color: #93c5fd;
  text-decoration: underline;
}

.floating-ask-agent-bubble__content code {
  background: rgba(15, 23, 42, 0.72);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.floating-ask-agent-bubble__content pre {
  background: rgba(15, 23, 42, 0.78);
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.55rem 0.65rem;
  overflow: auto;
}

.floating-ask-agent-bubble__content pre code {
  background: transparent;
  border: 0;
  padding: 0;
}

.overview-ask-embedded .floating-ask-alshival {
  display: none;
}

.ask-widget-popout-body .floating-ask-alshival {
  display: none;
}

.ask-widget-popout-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.ask-widget-popout-body .page-content {
  height: 100vh;
  height: 100dvh;
}

.ask-widget-open .floating-ask-agent-bubble {
  display: none;
}

.ask-widget-popout-page {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 0.65rem;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(30, 64, 175, 0.24) 0%, rgba(12, 19, 31, 0.04) 58%),
    #09111d;
  overflow: hidden;
}

.ask-widget-popout-frame {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.ask-widget-popout-mount {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ask-widget-popout-frame .ask-terminal-widget--embedded {
  position: relative;
  inset: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: auto;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  flex: 1;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.52);
  overflow: hidden;
}

.ask-widget-popout-frame .ask-terminal-widget--embedded .ask-terminal-widget__head {
  cursor: default;
  touch-action: auto;
}

.ask-widget-popout-frame .ask-terminal-widget--embedded .ask-terminal-widget__body {
  height: auto !important;
  flex: 1;
  min-height: 0;
}

.ask-widget-popout-frame .ask-terminal-widget--embedded .ask-terminal-widget__body.ask-chat-widget {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  gap: 0.5rem;
  padding: 0.6rem;
  overflow: hidden;
}

.ask-widget-popout-frame .ask-terminal-widget--embedded .ask-chat-widget__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.1rem;
}

.ask-widget-popout-frame .ask-terminal-widget--embedded .ask-chat-widget__composer {
  flex: 0 0 auto;
  margin-top: auto;
  width: 100%;
  position: relative;
  bottom: auto;
  z-index: 2;
  background: #0a1019;
  padding-bottom: max(0.2rem, env(safe-area-inset-bottom, 0px));
}

.ask-widget-popout-frame .ask-terminal-widget--embedded .resource-note-chat {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
}

.ask-widget-popout-frame .ask-terminal-widget--embedded .resource-note-input-text {
  width: 100%;
  max-width: none;
  margin-left: 0 !important;
  padding-left: 1rem !important;
  padding-right: 3rem;
  max-height: min(28vh, 220px);
}

.ask-widget-popout-frame .ask-terminal-widget--embedded .resource-note-upload-hints {
  display: none;
}

.ask-widget-popout-frame .ask-terminal-widget--embedded .resource-note-label-send {
  right: 0.35rem;
}

.ask-widget-popout-frame .ask-terminal-widget--embedded .ask-chat-msg {
  max-width: min(92%, 78ch);
}

@media (max-width: 767px) {
  .ask-widget-popout-page {
    padding: 0;
  }

  .ask-widget-popout-frame .ask-terminal-widget--embedded {
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .ask-widget-popout-frame .ask-terminal-widget--embedded .ask-terminal-widget__head {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    gap: 0.35rem;
  }

  .ask-widget-popout-frame .ask-terminal-widget--embedded .ask-terminal-widget__popout,
  .ask-widget-popout-frame .ask-terminal-widget--embedded .ask-terminal-widget__chatback {
    display: none;
  }
}

.ask-terminal-widget {
  position: fixed;
  right: 1.25rem;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1.75rem + clamp(84px, 9.45vw, 116px) + 0.75rem);
  z-index: 1099;
  width: min(440px, calc(100vw - 2.5rem));
  height: clamp(280px, 46vh, 460px);
  border: 1px solid rgba(107, 228, 168, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, #0c131f 0%, #0a1019 100%);
  box-shadow: 0 24px 56px rgba(2, 6, 23, 0.58);
  overflow: hidden;
}

.ask-terminal-widget__head {
  height: 44px;
  padding: 0 0.75rem 0 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #cbd5e1;
  background: rgba(12, 19, 31, 0.95);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.ask-terminal-widget__head strong {
  margin-right: auto;
}

.ask-terminal-widget__spacer {
  margin-right: auto;
  flex: 1 1 auto;
  min-width: 0;
}

.ask-terminal-widget__head.is-dragging {
  cursor: grabbing;
}

.ask-terminal-dragging {
  user-select: none;
}

.ask-terminal-widget__close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font-size: 1.1rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
}

.ask-terminal-widget__close:hover {
  border-color: rgba(107, 228, 168, 0.48);
  color: #d1fae5;
}

.ask-terminal-widget__close:focus-visible {
  outline: 2px solid rgba(107, 228, 168, 0.75);
  outline-offset: 2px;
}

.ask-terminal-widget__sudo {
  height: 30px;
  border: 1px solid rgba(107, 228, 168, 0.38);
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.14);
  color: #d1fae5;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 0.55rem;
  cursor: pointer;
  touch-action: manipulation;
}

.ask-terminal-widget__clear {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(248, 113, 113, 0.46);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.28);
  color: #fca5a5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.ask-terminal-widget__clear:hover {
  border-color: rgba(248, 113, 113, 0.72);
  background: rgba(127, 29, 29, 0.42);
  color: #fecaca;
}

.ask-terminal-widget__clear:focus-visible {
  outline: 2px solid rgba(248, 113, 113, 0.78);
  outline-offset: 2px;
}

.ask-terminal-widget__clear:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ask-terminal-widget__popout,
.ask-terminal-widget__chatback {
  height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.74);
  color: #cbd5e1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 0.5rem;
  cursor: pointer;
  touch-action: manipulation;
}

.ask-terminal-widget__sudo:hover {
  border-color: rgba(107, 228, 168, 0.56);
  background: rgba(16, 185, 129, 0.22);
}

.ask-terminal-widget__popout:hover,
.ask-terminal-widget__chatback:hover {
  border-color: rgba(148, 163, 184, 0.56);
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
}

.ask-terminal-widget__sudo:focus-visible {
  outline: 2px solid rgba(107, 228, 168, 0.75);
  outline-offset: 2px;
}

.ask-terminal-widget__popout:focus-visible,
.ask-terminal-widget__chatback:focus-visible {
  outline: 2px solid rgba(148, 163, 184, 0.75);
  outline-offset: 2px;
}

.ask-terminal-widget__body {
  height: calc(100% - 44px);
}

.terminal-inline-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.terminal-inline-bar {
  min-height: 36px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(9, 14, 24, 0.92);
}

.terminal-inline-meta {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
}

.terminal-inline-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.terminal-inline-hint {
  font-size: 0.75rem;
  color: #8ca0be;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-inline-status {
  font-size: 0.73rem;
  color: #34d399;
}

.terminal-inline-status.error {
  color: #fb7185;
}

.terminal-inline-body {
  flex: 1;
  min-height: 0;
  padding: 0.35rem 0.45rem 0.45rem;
  background: #090e17;
}

.ask-terminal-widget__error {
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: #fecaca;
}

.ask-chat-widget {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.55rem;
  background: #0a1019;
}

.ask-chat-widget__messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.15rem 0.15rem 0.1rem;
}

.ask-chat-msg {
  max-width: 92%;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.4;
  word-break: break-word;
}

.ask-chat-msg__body {
  overflow-wrap: anywhere;
}

.ask-chat-msg--assistant {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.95);
  color: #dbe8fb;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.ask-chat-msg--user {
  align-self: flex-end;
  background: rgba(16, 185, 129, 0.2);
  color: #d1fae5;
  border: 1px solid rgba(16, 185, 129, 0.42);
}

.alshival-markdown > *:first-child {
  margin-top: 0;
}

.alshival-markdown > *:last-child {
  margin-bottom: 0;
}

.alshival-markdown p,
.alshival-markdown ul,
.alshival-markdown ol,
.alshival-markdown pre,
.alshival-markdown blockquote {
  margin: 0 0 0.45rem;
}

.alshival-markdown ul,
.alshival-markdown ol {
  padding-left: 1.15rem;
}

.alshival-markdown blockquote {
  border-left: 2px solid rgba(148, 163, 184, 0.35);
  padding-left: 0.55rem;
  color: #aab9ce;
}

.alshival-markdown code {
  background: rgba(15, 23, 42, 0.72);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.alshival-markdown pre {
  background: rgba(15, 23, 42, 0.78);
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.55rem 0.65rem;
  overflow: auto;
}

.alshival-markdown pre code {
  background: transparent;
  border: 0;
  padding: 0;
}

.alshival-markdown--chat a {
  color: #93c5fd;
  text-decoration: underline;
}

.ask-chat-msg--user .alshival-markdown--chat a {
  color: #bbf7d0;
}

.team-chat-msg--mine .alshival-markdown--chat a {
  color: #67e8f9;
}

.ask-chat-widget__composer {
  margin: 0;
}

.ask-terminal-widget .resource-note-chat {
  --note-chat-surface: rgba(15, 23, 42, 0.82);
  --note-chat-ink: #d8e2f2;
  --note-chat-muted: #94a3b8;
}

.light-style .ask-terminal-widget .resource-note-chat {
  --note-chat-surface: rgba(15, 23, 42, 0.82);
  --note-chat-ink: #d8e2f2;
  --note-chat-muted: #94a3b8;
}

.ask-terminal-widget .resource-note-input-text {
  max-height: 7.5rem;
  margin-left: 0;
  padding-left: 4.9rem;
}

.ask-terminal-widget .resource-note-input-text:focus,
.ask-terminal-widget .resource-note-input-text:not(:placeholder-shown),
.ask-terminal-widget .resource-note-chat.has-file .resource-note-input-text {
  margin-left: 0;
  padding-left: 1rem;
}

.ask-terminal-widget .resource-note-upload-hints {
  top: 50%;
  left: 0.65rem;
  gap: 0.25rem;
  transform: translateY(-50%);
}

.ask-terminal-widget .resource-note-upload-icon {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

.ask-terminal-widget .resource-note-label-send {
  color: #f8fafc;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.72), rgba(17, 24, 39, 0.72)),
    linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.42);
}

.ask-terminal-widget .resource-note-label-send.ask-chat-widget__action {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateY(-50%) scale(1);
}

.ask-terminal-widget .resource-note-label-send:hover,
.ask-terminal-widget .resource-note-label-send:focus-visible {
  background-image:
    linear-gradient(rgba(30, 41, 59, 0.88), rgba(30, 41, 59, 0.88)),
    linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb);
  box-shadow: 0 12px 22px rgba(2, 6, 23, 0.5);
}

.ask-terminal-widget .resource-note-label-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.landing-page-content {
  padding-bottom: 4.2rem;
}

@media (max-width: 767px) {
  body.ask-widget-open {
    overflow: hidden;
  }

  .ask-terminal-widget {
    top: env(safe-area-inset-top, 0px);
    right: 0;
    bottom: env(safe-area-inset-bottom, 0px);
    left: 0;
    width: 100dvw;
    min-width: 100dvw;
    max-width: 100dvw;
    height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    min-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
  }

  .ask-terminal-widget--embedded {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    height: clamp(340px, 56vh, 520px);
    border: 1px solid rgba(107, 228, 168, 0.28);
    border-radius: 14px;
    box-shadow: 0 24px 56px rgba(2, 6, 23, 0.58);
  }

  .ask-terminal-widget__head {
    font-size: 0.8rem;
  }

  .ask-terminal-widget__sudo {
    padding: 0 0.45rem;
    font-size: 0.62rem;
  }

  .ask-terminal-widget__popout,
  .ask-terminal-widget__chatback {
    padding: 0 0.4rem;
    font-size: 0.58rem;
  }

  .ask-terminal-widget__body {
    height: auto;
    flex: 1;
    min-height: 0;
  }

  .ask-terminal-widget__body.ask-chat-widget {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.5rem;
  }

  .ask-terminal-widget__body.ask-chat-widget .ask-chat-widget__messages {
    min-height: 0;
    overflow-y: auto;
  }

  .ask-terminal-widget__body.ask-chat-widget .ask-chat-widget__composer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-top: 0.25rem;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #0a1019;
  }

  .terminal-inline-hint {
    display: none;
  }

  .ask-widget-open .floating-ask-alshival {
    display: none;
  }

  .ask-widget-open .floating-ask-agent-bubble {
    display: none;
  }

  .floating-ask-alshival {
    right: 0.9rem;
    bottom: calc(1.15rem + env(safe-area-inset-bottom, 0px));
  }

  .floating-ask-alshival__logo {
    width: clamp(108px, 32vw, 144px);
  }

  .floating-ask-agent-bubble {
    right: 0.72rem;
    width: min(340px, calc(100vw - 1.45rem));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 1.15rem + clamp(80px, 30vw, 112px) + 0.5rem);
  }

  .floating-ask-agent-bubble::after {
    right: 26px;
  }

  .landing-page-content {
    padding-bottom: 3.8rem;
  }
}

/* ── Task Detail Drawer ────────────────────────────────────────────── */

@keyframes drawer-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.task-drawer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.35);
}

.task-drawer__panel {
  width: min(480px, 96vw);
  height: 100%;
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  animation: drawer-slide-in 0.22s ease;
  overflow: hidden;
}

.task-drawer__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.task-drawer__title {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-drawer__ext-link {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  flex-shrink: 0;
}

.task-drawer__ext-link:hover {
  color: var(--link);
}

.task-drawer__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  padding: 0.2rem 0.3rem;
  flex-shrink: 0;
  line-height: 1;
}

.task-drawer__close:hover {
  color: var(--text);
}

.task-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-drawer__section-title {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

.task-drawer__meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
  font-size: 0.82rem;
}

.task-drawer__meta-grid > span:nth-child(odd) {
  color: var(--muted);
  font-weight: 500;
}

.task-drawer__notes {
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-drawer__skeleton {
  font-size: 0.82rem;
  font-style: italic;
}

.task-drawer__assignee-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.82rem;
  cursor: pointer;
  color: inherit;
}

.task-drawer__assignee-btn:hover {
  border-color: var(--link);
  color: var(--link);
}

.task-drawer__assignee-select {
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.3rem;
  background: var(--card-bg);
  color: inherit;
  max-width: 100%;
}

.task-drawer__subtask-list,
.task-drawer__attachment-list,
.task-drawer__dep-list,
.task-drawer__comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.task-drawer__subtask-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.task-drawer__subtask-row.is-done .task-drawer__subtask-title {
  text-decoration: line-through;
  opacity: 0.55;
}

.task-drawer__attachment-row {
  font-size: 0.85rem;
}

.task-drawer__dep-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.task-drawer__dep-remove {
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
  flex-shrink: 0;
}

.task-drawer__dep-add {
  display: flex;
  gap: 0.5rem;
}

.task-drawer__dep-input {
  flex: 1;
  font-size: 0.82rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-bg);
  color: inherit;
}

.task-drawer__dep-add-btn {
  font-size: 0.82rem;
  padding: 0.25rem 0.7rem;
  flex-shrink: 0;
}

.task-drawer__comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-drawer__comment-textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.85rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-bg);
  color: inherit;
  resize: vertical;
}

.task-drawer__comment-post {
  align-self: flex-start;
  font-size: 0.82rem;
  padding: 0.3rem 0.8rem;
}

/* ── Planner title button (drawer trigger) ─────────────────────────── */

.planner-item__title-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-weight: inherit;
  font-size: inherit;
  padding: 0;
  text-align: left;
  line-height: inherit;
}

.planner-item__title-btn:hover {
  text-decoration: underline;
}

.planner-item__ext-link {
  color: var(--muted);
  font-size: 0.68rem;
  margin-left: 0.25rem;
  vertical-align: middle;
  text-decoration: none;
}

.planner-item__ext-link:hover {
  color: var(--link);
}
