html {
  font-size: 13.86px; /* 10% under 15.4px — scales rem-based type globally */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  height: 100%;
}

:root {
  /* HITS Solutions cascade — cyan / navy / lime / mist (from HITS.Jobs v4) */
  --hits-primary: #1aa6e0;
  --hits-primary-hover: #0f8fc4;
  --hits-primary-rgb: 26, 166, 224;
  --hits-primary-subtle: #eaf6fc;
  --hits-accent: #8cc63f;
  --hits-accent-hover: #7ab335;
  --hits-focus-ring: rgba(26, 166, 224, 0.25);
  --hits-navy: #0b3d6e;
  --hits-secondary: #e8eef3;

  --hits-canvas: #f2f4f7;
  --hits-surface: #ffffff;
  --hits-stroke: #d5dee6;
  --hits-text: #0a1c33;
  --hits-text-muted: #6b7a86;
  --hits-radius-sm: 8px;
  --hits-radius-md: 10px;
  --hits-btn-radius: 0.5rem;
  --hits-space-xs: 0.25rem;
  --hits-space-sm: 0.5rem;
  --hits-space-md: 0.75rem;
  --hits-space-lg: 1rem;
  --hits-space-xl: 1.5rem;

  --hits-success: #5aa312;
  --hits-success-subtle: #eef8e4;
  --hits-warning: #b8860b;
  --hits-warning-subtle: #fff8e0;
  --hits-danger: #a80000;
  --hits-danger-subtle: #fde7e9;

  --hits-shadow-sm: 0 1px 2px rgba(10, 28, 51, 0.08), 0 0 2px rgba(10, 28, 51, 0.05);
  --hits-shadow-md: 0 2px 6px rgba(10, 28, 51, 0.08), 0 0 2px rgba(10, 28, 51, 0.05);
  --hits-shadow-lg: 0 8px 20px rgba(10, 28, 51, 0.1), 0 0 2px rgba(10, 28, 51, 0.06);

  --hits-font-sans: "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  --hits-font-display: "Sora", "Figtree", system-ui, sans-serif;
}

html[data-hits-density="compact"] {
  --hits-space-xs: 0.125rem;
  --hits-space-sm: 0.375rem;
  --hits-space-md: 0.5rem;
  --hits-space-lg: 0.75rem;
  --hits-space-xl: 1rem;
}

html[data-hits-density="comfortable"] {
  --hits-space-xs: 0.35rem;
  --hits-space-sm: 0.65rem;
  --hits-space-md: 1rem;
  --hits-space-lg: 1.25rem;
  --hits-space-xl: 1.75rem;
}

@media (min-width: 768px) {
  html {
    font-size: 15.84px; /* 10% under 17.6px */
  }
}

body {
  background: var(--hits-canvas);
  color: var(--hits-text);
  font-family: var(--hits-font-sans);
}

html[lang="ar"] body {
  font-family: "Figtree", "Noto Sans Arabic", "Segoe UI", "Arabic UI Text", "Tahoma", var(--hits-font-sans);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--hits-font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hits-text);
}

/* HITS is always uppercase in product wordmarks */
.hits-wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--hits-font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  line-height: 1;
  color: inherit;
}
.hits-wordmark__hits {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hits-wordmark__product {
  color: var(--hits-primary);
  letter-spacing: 0;
  font-weight: 700;
  text-transform: none;
}
.hits-wordmark--ink {
  color: var(--hits-text);
}
.hits-wordmark--ink .hits-wordmark__product {
  color: var(--hits-primary);
}
.hits-mark {
  display: block;
  flex-shrink: 0;
}

.btn-accent {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--hits-accent);
  --bs-btn-border-color: var(--hits-accent);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--hits-accent-hover);
  --bs-btn-hover-border-color: var(--hits-accent-hover);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--hits-accent-hover);
  --bs-btn-active-border-color: var(--hits-accent-hover);
  color: #fff;
  background: var(--hits-accent);
  border-color: var(--hits-accent);
}
.btn-accent:hover {
  color: #fff;
  background: var(--hits-accent-hover);
  border-color: var(--hits-accent-hover);
}

/* Global loading bar (navigation / API / realtime) */
.global-loading-bar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.06);
}

.global-loading-bar__inner {
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(var(--hits-primary-rgb), 0.9), rgba(255, 255, 255, 0));
  transform: translateX(-60%);
  animation: hits-loading 0.95s ease-in-out infinite;
}

@keyframes hits-loading {
  0% { transform: translateX(-60%); opacity: 0.35; }
  50% { opacity: 1; }
  100% { transform: translateX(260%); opacity: 0.35; }
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--hits-canvas);
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  font-family: var(--hits-font-sans);
}

.login-root {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.login-left,
.login-right {
  flex: 1 1 50%;
  min-width: 0;
}

.login-left {
  position: relative;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  color: #fff;
  background: #000;
  overflow: hidden;
}

.login-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: hits-login-drift 28s ease-in-out infinite alternate;
}

@keyframes hits-login-drift {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.04) translate(-1.5%, 1%); }
}

@keyframes hits-login-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes hits-login-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-left-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.25rem 2.5rem 2rem;
  text-align: start;
}

.login-panel-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
}

.login-panel-brand .hits-wordmark {
  color: #fff;
  font-size: 1.2rem;
}

.login-panel-copy {
  max-width: 26rem;
  animation: hits-login-fade-up 0.35s ease forwards;
}

.login-orbit {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  margin-bottom: 1.5rem;
}

.login-orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(77, 184, 233, 0.4);
  box-shadow: 0 0 28px rgba(26, 166, 224, 0.2);
  animation: hits-login-pulse 3.2s ease-in-out infinite;
}

.login-orbit-core {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #1aa6e0, #0b3d6e 60%, #061526 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 30px rgba(26, 166, 224, 0.35);
}

.login-hero-title {
  margin: 0 0 0.9rem;
  font-family: var(--hits-font-display);
  font-size: clamp(2rem, 3.2vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: #fff;
  max-width: 14ch;
}

.login-hero-subtitle {
  margin: 0;
  max-width: 28rem;
  font-size: 0.98rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.74);
}

.login-panel-footer {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.login-right {
  background:
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(77, 184, 233, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(140, 198, 63, 0.1), transparent 50%),
    var(--hits-canvas);
  border-inline-start: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

.login-right-inner {
  width: 100%;
  max-width: 26rem;
  background: var(--hits-surface);
  border: 1px solid rgba(15, 30, 45, 0.08);
  border-radius: 16px;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: var(--hits-shadow-lg);
  animation: hits-login-fade-up 0.35s ease 0.08s both;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.login-brand-icon {
  width: auto;
  height: auto;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  background: transparent;
  padding: 0;
}

.login-brand-title {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.login-brand-subtitle {
  font-size: 0.85rem;
  color: var(--hits-text-muted);
}

.login-welcome {
  font-family: var(--hits-font-display);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
  color: var(--hits-text);
}

.login-input {
  border-radius: 10px;
  border-color: rgba(15, 30, 45, 0.14);
}

.login-input:focus {
  border-color: var(--hits-primary);
  box-shadow: 0 0 0 3px rgba(26, 166, 224, 0.22);
}

.login-submit {
  border-radius: 999px;
  padding: 0.9rem 1rem;
  font-weight: 700;
  background: var(--hits-accent);
  border-color: var(--hits-accent);
  box-shadow: 0 0.75rem 1.5rem rgba(140, 198, 63, 0.28);
}

.login-submit:hover {
  background: var(--hits-accent-hover);
  border-color: var(--hits-accent-hover);
}

.login-link {
  color: var(--hits-primary);
  text-decoration: none;
}

.login-link:hover {
  text-decoration: underline;
}

.login-hint {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}

.login-hints-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hits-text-muted);
  margin-bottom: 0.65rem;
}

.login-hints-list {
  display: grid;
  gap: 0.45rem;
}

.login-hint-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  text-align: start;
  border: 1px solid var(--hits-stroke);
  background: var(--hits-primary-subtle);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  color: var(--hits-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-hint-chip:hover {
  border-color: rgba(26, 166, 224, 0.55);
  box-shadow: var(--hits-shadow-sm);
}

.login-hint-chip__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hits-navy);
}

.login-hint-chip__email {
  font-size: 0.72rem;
  color: var(--hits-text-muted);
  word-break: break-all;
}

@media (min-width: 992px) {
  .login-left {
    display: flex;
    flex: 1 1 46%;
  }

  .login-right {
    flex: 1 1 54%;
  }

  .login-brand--mobile {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .login-root {
    flex-direction: column;
  }

  .login-right {
    border-inline-start: none;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .login-form .form-control-lg {
    font-size: 16px;
  }
}

[dir="rtl"] .login-root {
  flex-direction: row-reverse;
}

@media (max-width: 991.98px) {
  [dir="rtl"] .login-root {
    flex-direction: column;
  }
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: 0.5rem;
  z-index: 2000;
  padding: 0.5rem 0.75rem;
  color: #fff;
  background: var(--hits-primary);
  border-radius: 0.375rem;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem var(--hits-focus-ring);
}

/* Global primary button theme (match login button) */
.btn {
  border-radius: var(--hits-btn-radius);
}

.btn-primary {
  background: var(--hits-primary);
  border-color: var(--hits-primary);
  border-radius: var(--hits-btn-radius);
  box-shadow: 0 0.75rem 1.5rem rgba(var(--hits-primary-rgb), 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--hits-primary-hover);
  border-color: var(--hits-primary-hover);
}

.btn-primary:active,
.btn-primary.active {
  background: var(--hits-primary-hover);
  border-color: var(--hits-primary-hover);
}

.btn-primary:disabled,
.btn-primary.disabled {
  background: var(--hits-primary);
  border-color: var(--hits-primary);
  opacity: 0.65;
  box-shadow: none;
}

/* Simple inline SVG charts (no external JS libs) */
.hits-donut {
  width: 7.25rem;
  height: 7.25rem;
}

.hits-donut__track {
  fill: none;
  stroke: rgba(15, 23, 42, 0.1);
  stroke-width: 12;
}

.hits-donut__value {
  fill: none;
  stroke: var(--hits-primary);
  stroke-width: 12;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  stroke-dasharray: 0 999;
}

.hits-donut__label {
  font-weight: 800;
  font-size: 16.2px;
  fill: #0f172a;
}

.hits-mini-bars {
  width: 100%;
  height: auto;
}

.hits-mini-bars__axis {
  stroke: rgba(15, 23, 42, 0.12);
  stroke-width: 2;
}

.hits-mini-bars__bar {
  fill: rgba(var(--hits-primary-rgb), 0.22);
  stroke: rgba(var(--hits-primary-rgb), 0.65);
  stroke-width: 2;
}

.hits-mini-bars__value {
  font-weight: 800;
  font-size: 12.6px;
  fill: #0f172a;
}

.hits-mini-bars__caption {
  font-size: 10.8px;
  fill: #64748b;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--hits-canvas);
  overflow: hidden;
  overflow-x: clip;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left));
  background: var(--hits-surface);
  border-bottom: 1px solid var(--hits-stroke);
  box-shadow: var(--hits-shadow-sm);
}

.hits-topbar-filter-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  flex-shrink: 0;
}

.hits-topbar-filter-field .col-form-label {
  white-space: nowrap;
}

.hits-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.hits-nav-toggle .app-icon {
  width: 1.35rem;
  height: 1.35rem;
}

.hits-mobile-toolbar {
  flex-shrink: 0;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.hits-mobile-toolbar-form .col-6 {
  min-width: 0;
}

.hits-mobile-toolbar .mission-select {
  max-width: 100%;
}

.app-sidebar.offcanvas-lg {
  --bs-offcanvas-width: min(22rem, calc(100vw - 1.25rem));
}

.brand-link,
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.user-pill {
  min-height: 2.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}

.brand-link small {
  display: block;
  color: var(--hits-text-muted);
  font-size: 0.75rem;
  line-height: 1;
  font-family: var(--hits-font-sans);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark .app-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.brand-mark,
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--hits-primary), var(--hits-navy));
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
}

.avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
}

.mission-select {
  max-width: 12rem;
}

.search-box {
  flex: 1 1 auto;
  max-width: 28rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: auto;
}

.hits-ai-assistant-trigger,
.hits-quick-actions-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding-inline: 0.5rem;
}

.hits-culture-picker__code {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.topbar-actions .dropdown-menu {
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 992px) {
  .app-topbar {
    --hits-topbar-control-size: 2.25rem;
    gap: 0.75rem;
  }

  .topbar-actions .hits-topbar-control.btn {
    width: var(--hits-topbar-control-size);
    height: var(--hits-topbar-control-size);
    min-width: var(--hits-topbar-control-size);
    min-height: var(--hits-topbar-control-size);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .topbar-actions .hits-topbar-control.btn.dropdown-toggle::after {
    display: none;
  }

  .topbar-actions .hits-topbar-control.btn .app-icon {
    width: 1.125rem;
    height: 1.125rem;
  }

  .topbar-actions .user-pill.hits-topbar-control {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 2.5rem;
    padding: 0.25rem 0.5rem;
  }

  /* Base .offcanvas is visibility:hidden + fixed + off-screen; .offcanvas-lg lg rules do not undo that. */
  .app-sidebar.offcanvas-lg {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: static;
    visibility: visible;
    transform: none;
    height: auto;
    max-height: none;
  }
}

.app-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.hits-ai-assistant {
  --bs-offcanvas-width: min(34rem, 100vw);
}

.hits-ai-assistant .offcanvas-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.hits-ai-assistant__body {
  min-height: 0;
}

.hits-ai-assistant__actions {
  flex: 0 0 auto;
  background: #f8f9fa;
}

.hits-ai-assistant__action {
  white-space: normal;
}

.hits-ai-assistant__action--coach {
  margin-top: 0.25rem;
}

.hits-ai-assistant__idle,
.hits-ai-assistant__loading {
  flex: 0 0 auto;
  min-height: 8rem;
}

.hits-ai-assistant__result {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
}

.hits-ai-assistant__loading-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(var(--hits-primary-rgb), 0.12);
  border-radius: 1rem;
  background: #fff;
}

.hits-ai-assistant__spinner {
  flex: 0 0 auto;
  margin-top: 0.15rem;
}

.hits-ai-assistant__frame {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--hits-surface);
  border-radius: var(--hits-radius-md);
}

.hits-ai-assistant__tabs {
  border-bottom: 1px solid var(--hits-stroke);
  background: var(--hits-canvas);
  border-radius: var(--hits-radius-sm) var(--hits-radius-sm) 0 0;
}

.hits-ai-assistant__tab-host {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hits-ai-assistant__tab-pane[hidden] {
  display: none !important;
}

.hits-operation-ai-hub-strip {
  flex-shrink: 0;
}

.hits-operation-context-strip {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 0.75rem;
}

.hits-table-dense.table > :not(caption) > * > * {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.hits-kanban-dense .hitsdo-kanban-card,
.hits-kanban-dense .border.rounded.p-3 {
  padding: 0.65rem !important;
}

body.hits-ai-coach-embed {
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

.hits-ai-coach-shell {
  height: 100%;
}

.hits-ai-coach {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* Full-page coach (non-embed): fill viewport under page header */
.page-shell > .hits-ai-coach,
#ai-coach-body .hits-ai-coach {
  min-height: calc(100vh - 12rem);
  min-height: calc(100dvh - 12rem);
}

.hits-ai-coach__header,
.hits-ai-coach__composer {
  flex: 0 0 auto;
}

.hits-ai-coach__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: #f8f9fa;
}

.hits-ai-coach__bubble {
  max-width: min(92%, 44rem);
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
  line-height: 1.7;
  font-size: 0.98rem;
  box-shadow: 0 0.125rem 0.35rem rgba(15, 23, 42, 0.05);
}

.hits-ai-coach__bubble--user {
  background: #fff;
  border: 1px solid #dee2e6;
}

.hits-ai-coach__bubble--assistant {
  margin-left: auto;
  background: #e7f1ff;
  border: 1px solid rgba(var(--hits-primary-rgb), 0.15);
}

.hits-ai-coach__bubble--thinking {
  background: #fff;
  border-style: dashed;
}

.hits-ai-coach__bubble--error {
  margin-left: auto;
  background: #fff5f5;
  border: 1px solid #f1aeb5;
}

.hits-ai-coach__suggestions {
  margin-left: auto;
  max-width: min(92%, 44rem);
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 1rem;
  padding: 0.95rem 1rem;
}

.hits-ai-coach__prompt {
  min-height: 5.25rem;
  resize: vertical;
}

.hits-ai-coach__thinking {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.hits-ai-coach__form.is-submitting .hits-ai-coach__prompt {
  background: #f8f9fa;
}

.hits-ai-coach__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 7.5rem;
}

.hits-ai-coach__submit-spinner {
  display: none;
}

.hits-ai-coach__form.is-submitting .hits-ai-coach__submit-spinner {
  display: inline-block;
}

.hits-ai-richtext {
  color: inherit;
  line-height: 1.75;
  word-break: break-word;
}

.hits-ai-richtext__heading {
  margin: 0 0 0.65rem;
  font-weight: 700;
  font-size: 1rem;
}

.hits-ai-richtext__paragraph {
  margin: 0 0 0.9rem;
}

.hits-ai-richtext__paragraph:last-child {
  margin-bottom: 0;
}

.hits-ai-richtext__list {
  margin: 0 0 0.9rem 1.25rem;
  padding: 0;
}

.hits-ai-richtext__list:last-child {
  margin-bottom: 0;
}

.hits-ai-richtext__list li + li {
  margin-top: 0.35rem;
}

.hits-ai-richtext__codeblock {
  margin: 0 0 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
  white-space: pre-wrap;
  overflow-x: auto;
}

.hits-ai-richtext__inlinecode {
  padding: 0.08rem 0.35rem;
  border-radius: 0.35rem;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.94em;
}

.app-sidebar {
  width: 18rem;
  flex: 0 0 18rem;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 0;
  max-height: 100%;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border-inline-end: 1px solid #dee2e6;
}

.app-sidebar .offcanvas-header {
  flex-shrink: 0;
}

.app-sidebar .offcanvas-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.app-sidebar .offcanvas-body > nav {
  flex: 0 0 auto;
}

.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.125rem;
  padding: 0.5rem 0.75rem;
  color: var(--hits-text);
  border-radius: var(--hits-radius-sm);
  border-inline-start: 3px solid transparent;
  touch-action: manipulation;
}

.app-sidebar .nav-link span {
  flex: 1 1 auto;
}

.app-sidebar .nav-link .app-icon {
  color: var(--hits-text-muted);
}

.app-sidebar .nav-link:hover {
  background: var(--hits-secondary);
}

.app-sidebar .nav-link.active {
  color: var(--hits-navy);
  font-weight: 600;
  background: var(--hits-primary-subtle);
  border-inline-start-color: var(--hits-primary);
}

.app-sidebar .nav-link.active .app-icon {
  color: var(--hits-primary);
}

.nav-section {
  margin: 1rem 0 0.35rem;
  padding: 0 0.75rem;
  color: #6c757d;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-section--toggle {
  cursor: pointer;
  user-select: none;
}

.nav-section--toggle::after {
  content: "▾";
  float: right;
  opacity: 0.65;
}

.nav-section--toggle[aria-expanded="false"]::after {
  content: "▸";
}

.nav-section-body {
  display: flex;
  flex-direction: column;
}

.app-content,
#main-content {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
  background-color: var(--hits-canvas);
}

.page-shell,
.auth-shell {
  min-height: 100%;
  padding: 1.5rem;
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  background-color: var(--hits-canvas);
}

.page-shell-wide {
  max-width: 1600px;
}

.hits-flat-surface,
.metric-card,
.surface-card {
  background: var(--hits-surface);
  border: 1px solid var(--hits-stroke);
  border-radius: var(--hits-radius-md);
  box-shadow: none;
}

.metric-card {
  padding: 1.25rem;
}

.metric-value {
  margin: 0.35rem 0;
  font-size: 2rem;
  font-weight: 700;
}

.gradient-blue,
.gradient-purple,
.gradient-auth {
  background: var(--hits-canvas);
  border: 1px solid var(--hits-stroke);
  border-radius: var(--hits-radius-md);
  box-shadow: none;
}

.code-panel {
  color: #fff;
  background: #111827;
  border-radius: 1rem;
}

.canvas-board {
  min-height: 42rem;
  background-color: #fff;
  background-image: radial-gradient(#dee2e6 1px, transparent 1px);
  background-size: 24px 24px;
}

.whiteboard-surface {
  height: 48rem;
  overflow: hidden;
  border-radius: 0.75rem;
}

.whiteboard-item {
  position: absolute;
  padding: 0.75rem;
  color: #111827;
  text-align: left;
  white-space: pre-wrap;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.08);
  cursor: grab;
}

.whiteboard-item:focus {
  outline: 3px solid rgba(13, 110, 253, 0.35);
}

.whiteboard-item.okr-objective {
  border-inline-start: 4px solid var(--hits-primary);
  font-size: 0.9rem;
  line-height: 1.35;
}

.whiteboard-item.okr-kr {
  border-inline-start: 4px solid #16a34a;
  font-size: 0.82rem;
  line-height: 1.35;
}

.whiteboard-item.okr-initiative {
  border-inline-start: 4px solid #ca8a04;
  font-size: 0.78rem;
  line-height: 1.3;
}

.wb-okr-panel {
  max-height: min(28rem, 55vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.whiteboard-cursor {
  position: absolute;
  z-index: 100000;
  padding: 0.1rem 0.35rem;
  color: #111827;
  font-size: 0.75rem;
  background: #fff;
  border-inline-start: 3px solid var(--hits-primary);
  border-radius: 0.25rem;
  pointer-events: none;
}

.kanban-card {
  border-inline-start: 4px solid var(--hits-primary) !important;
}

.dashboard-home-skeleton .dashboard-skeleton-line,
.dashboard-home-skeleton .dashboard-skeleton-pill,
.dashboard-home-skeleton .dashboard-skeleton-badge {
  background: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 40%, #e9ecef 80%);
  background-size: 200% 100%;
  animation: dashboard-skeleton-shimmer 1.2s ease-in-out infinite;
}

.dashboard-home-skeleton .dashboard-skeleton-badge {
  width: 5rem;
  height: 1.5rem;
}

.dashboard-home-skeleton .dashboard-skeleton-pill {
  width: 18rem;
  max-width: 100%;
  height: 2.25rem;
}

@keyframes dashboard-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

.my-tasks-kanban__lane {
  min-height: 14rem;
}

.white-space-preline {
  white-space: pre-line;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

.chart-bars {
  height: 12rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.75rem;
}

.chart-bars span {
  display: inline-block;
  width: 2rem;
  min-height: 1rem;
  background: linear-gradient(180deg, var(--hits-primary), var(--hits-navy));
  border-radius: 0.35rem 0.35rem 0 0;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.75rem;
}

.heatmap-cell {
  display: flex;
  min-height: 8rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.85rem;
  text-align: left;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 0.75rem;
}

.sticky-note {
  background: #fff8db;
  border: 1px solid #ffe69c;
  border-radius: 0.75rem;
}

/* OKR delivery rollup explainer (tasks → initiatives → KR) */
.okr-flow-diagram {
  --okr-flow-muted: rgba(15, 23, 42, 0.55);
}

.okr-flow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.25rem;
}

.okr-flow-box {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  background: #fff;
  white-space: nowrap;
}

.okr-flow-arrow {
  color: var(--okr-flow-muted);
  font-size: 0.75rem;
  user-select: none;
}

@media (max-width: 991.98px) {
  .app-topbar {
    --hits-topbar-control-size: 2.75rem;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    min-height: 3.25rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .app-topbar .hits-topbar-brand {
    width: auto;
    height: var(--hits-topbar-control-size);
    flex: 0 0 auto;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.25rem;
  }

  .app-topbar .hits-topbar-brand .hits-topbar-mark {
    width: 2rem;
    height: 2rem;
  }

  .app-topbar .hits-topbar-brand .hits-wordmark {
    font-size: 0.95rem;
  }

  .app-topbar .hits-topbar-control {
    width: var(--hits-topbar-control-size);
    height: var(--hits-topbar-control-size);
    min-width: var(--hits-topbar-control-size);
    min-height: var(--hits-topbar-control-size);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .app-topbar .hits-topbar-control.dropdown-toggle::after {
    display: none;
  }

  .app-topbar .hits-topbar-control .app-icon {
    width: 1.25rem;
    height: 1.25rem;
  }

  .app-topbar .user-pill.hits-topbar-control {
    border-radius: 50%;
    gap: 0;
    min-height: 0;
    padding: 0;
  }

  .app-topbar .user-pill.hits-topbar-control .avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    font-size: 0.8rem;
  }

  .app-topbar .topbar-actions {
    gap: 0.35rem;
  }

  /* Mobile drawer: full viewport height, scroll nav inside the panel (not the page). */
  #appNavDrawer.app-sidebar.offcanvas {
    height: 100%;
    max-height: 100dvh;
  }

  #appNavDrawer.app-sidebar .offcanvas-body {
    max-height: none;
    padding-top: 0.25rem;
  }

  .app-sidebar .nav-link {
    min-height: 2.75rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  /* iOS Safari: 16px+ on inputs avoids automatic zoom on focus. */
  .form-control:not(.form-control-sm):not(.form-control-lg),
  .form-select:not(.form-select-sm):not(.form-select-lg) {
    font-size: 16px;
  }
}

/* Bootstrap 5.3 color mode — HITS shell overrides */
[data-bs-theme="dark"] {
  color-scheme: dark;
  --hits-canvas: #0a1c33;
  --hits-surface: #12263d;
  --hits-stroke: #2a3f55;
  --hits-text: #f2f4f7;
  --hits-text-muted: #9aadc0;
  --hits-primary-subtle: rgba(26, 166, 224, 0.16);
  --hits-secondary: #16324a;
  --hits-navy: #eaf6fc;
  --hits-focus-ring: rgba(26, 166, 224, 0.45);
  --hits-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --hits-shadow-md: 0 2px 6px rgba(0, 0, 0, 0.4);
  --hits-shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .app-shell {
  background: var(--bs-body-bg);
}

[data-bs-theme="dark"] .app-topbar {
  background: var(--bs-body-bg);
  border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .brand-link small {
  color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .page-shell,
[data-bs-theme="dark"] .auth-shell {
  background-color: var(--bs-body-bg);
}

[data-bs-theme="dark"] .hits-flat-surface,
[data-bs-theme="dark"] .surface-card,
[data-bs-theme="dark"] .metric-card {
  background: var(--hits-surface);
  border-color: var(--hits-stroke);
  box-shadow: none;
}

[data-bs-theme="dark"] .gradient-blue,
[data-bs-theme="dark"] .gradient-purple,
[data-bs-theme="dark"] .gradient-auth {
  background: var(--hits-surface);
  border-color: var(--hits-stroke);
}

[data-bs-theme="dark"] .login-shell {
  background: var(--hits-canvas);
}

[data-bs-theme="dark"] .login-right {
  background:
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(26, 166, 224, 0.14), transparent 55%),
    var(--hits-canvas);
}

[data-bs-theme="dark"] .login-left {
  background: #000;
}

[data-bs-theme="dark"] .login-right-inner {
  background: var(--hits-surface);
  border-color: var(--hits-stroke);
}

[data-bs-theme="dark"] .login-hero-title {
  color: #fff;
}

[data-bs-theme="dark"] .login-hero-subtitle,
[data-bs-theme="dark"] .login-brand-subtitle {
  color: rgba(255, 255, 255, 0.74);
}

[data-bs-theme="dark"] .login-welcome {
  color: var(--hits-text);
}

[data-bs-theme="dark"] .login-hint {
  border-top-color: var(--hits-stroke);
}

[data-bs-theme="dark"] .login-input {
  border-color: var(--hits-stroke);
  background: var(--hits-surface);
  color: var(--hits-text);
}

[data-bs-theme="dark"] .login-hint-chip {
  background: var(--hits-primary-subtle);
  border-color: var(--hits-stroke);
  color: var(--hits-text);
}

[data-bs-theme="dark"] .hits-donut__label,
[data-bs-theme="dark"] .hits-mini-bars__value {
  fill: var(--bs-body-color);
}

[data-bs-theme="dark"] .hits-mini-bars__caption {
  fill: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .hits-mini-bars__axis {
  stroke: var(--bs-border-color);
}

[data-bs-theme="dark"] .canvas-board {
  background-color: var(--bs-body-bg);
  background-image: radial-gradient(var(--bs-border-color) 1px, transparent 1px);
}

[data-bs-theme="dark"] .whiteboard-item {
  color: var(--bs-body-color);
  background: var(--bs-secondary-bg);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .whiteboard-cursor {
  color: var(--bs-body-color);
  background: var(--bs-body-bg);
}

[data-bs-theme="dark"] .chart-bars {
  background: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .heatmap-cell,
[data-bs-theme="dark"] .okr-flow-box {
  background: var(--bs-secondary-bg);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .okr-flow-diagram {
  --okr-flow-muted: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .sticky-note {
  background: #3d3520;
  border-color: #5c4f2a;
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .dashboard-home-skeleton .dashboard-skeleton-line,
[data-bs-theme="dark"] .dashboard-home-skeleton .dashboard-skeleton-pill,
[data-bs-theme="dark"] .dashboard-home-skeleton .dashboard-skeleton-badge {
  background: linear-gradient(90deg, #2d3338 0%, #3d444a 40%, #2d3338 80%);
  background-size: 200% 100%;
}

[data-bs-theme="dark"] .hits-ai-coach__bubble--assistant {
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .hits-ai-coach__bubble--thinking {
  background: var(--bs-tertiary-bg);
  color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .hits-ai-richtext__codeblock {
  background: #0d1117;
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .hits-ai-assistant__loading-card {
  background: var(--bs-secondary-bg);
  border-color: var(--bs-border-color);
}
