:root {
  color-scheme: dark;
  --page: #101114;
  --sidebar: #15171c;
  --panel: #1d2027;
  --panel-strong: #252936;
  --border: #343a46;
  --text: #f2f4f8;
  --muted: #aeb6c4;
  --teal: #49d5bd;
  --green: #79d279;
  --amber: #e4bd4f;
  --red: #ef7a73;
  --blue: #7aa7ff;
  --violet: #b29cff;
  --scrollbar-track: #11131a;
  --scrollbar-thumb: #3f4654;
  --scrollbar-thumb-hover: #596274;
  --scrollbar-thumb-active: #6b778a;
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  border: 3px solid var(--scrollbar-track);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--scrollbar-thumb-hover), var(--scrollbar-thumb));
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

[hidden] {
  display: none !important;
}

.loading-indicator {
  animation: loading-indicator-blink 0.9s ease-in-out infinite;
}

@keyframes loading-indicator-blink {
  0%, 100% {
    opacity: 0.38;
  }

  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-indicator {
    animation: none;
  }
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  letter-spacing: 0;
}

.icon-sprite {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  padding: 20px 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.sidebar-header {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 22px;
  background: var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  color: inherit;
  cursor: pointer;
  gap: 12px;
  min-height: 48px;
  min-width: 0;
  flex: 1;
  text-decoration: none;
}

.brand:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.brand:hover .brand-title {
  color: var(--teal);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.brand-mark-image {
  display: block;
  width: 40px;
  height: 40px;
}

.brand-title {
  font-weight: 700;
}

.brand-copy,
.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-note,
.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.sidebar-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  border-color: #358d7f;
}

.sidebar-toggle-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  transition: transform 0.16s ease;
}

.sidebar-toggle-icon span {
  position: absolute;
  top: 7px;
  left: 3px;
  display: block;
  width: 11px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: 1px 50%;
}

.sidebar-toggle-icon span:nth-child(1) {
  transform: rotate(-45deg);
}

.sidebar-toggle-icon span:nth-child(2) {
  display: none;
}

.sidebar-toggle-icon span:nth-child(3) {
  transform: rotate(45deg);
}

.app-shell.sidebar-collapsed .sidebar-toggle-icon span:nth-child(1) {
  transform-origin: 10px 50%;
  transform: rotate(45deg);
}

.app-shell.sidebar-collapsed .sidebar-toggle-icon span:nth-child(3) {
  transform-origin: 10px 50%;
  transform: rotate(-45deg);
}

.nav-list {
  display: grid;
  gap: 5px;
  flex: 0 0 auto;
  align-content: start;
  grid-auto-rows: max-content;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

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

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

.sidebar-footer {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding-top: 18px;
}
.message-form-status:empty {
  display: none;
}

.sidebar-version {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.app-shell.sidebar-collapsed .sidebar {
  padding: 18px 10px;
}

.app-shell.sidebar-collapsed .sidebar-header {
  display: grid;
  flex: 0 0 auto;
  grid-template-rows: 48px 36px;
  gap: 8px;
  justify-items: center;
  min-height: 92px;
  margin-bottom: 16px;
}

.table-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 13px;
}

.table-pagination span {
  margin-right: auto;
}

.app-shell.sidebar-collapsed .brand {
  justify-content: center;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-label {
  display: none;
}

.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px 4px;
}

.main-surface {
  padding: 22px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 300;
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

.topbar p {
  margin-top: 4px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar-context {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.topbar-updated {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}

.profile-menu {
  position: relative;
}

.profile-menu-trigger {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid #358d7f;
  border-radius: 50%;
  background: #174d47;
  color: var(--text);
  cursor: pointer;
}

.profile-menu-trigger:focus-visible,
.profile-menu-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.profile-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #d9b84d;
  color: #151515;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.profile-menu-popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 9px);
  right: 0;
  width: 240px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #171a22;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
}

.profile-menu-header {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.profile-menu-header span,
.profile-menu-header small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-header small {
  margin-top: 4px;
  font-size: 11px;
  text-transform: uppercase;
}

.profile-menu-item {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 9px 16px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-menu-item:last-child {
  border-bottom: 0;
}

.profile-menu-item:hover {
  background: #222731;
}

.profile-menu-item:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.profile-menu-item:disabled:hover {
  background: transparent;
}

.profile-menu-item.danger {
  color: #ff8f8f;
}

.profile-menu-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

body.profile-density-compact .content-band {
  padding-top: 10px;
  padding-bottom: 10px;
}

.profile-settings-band {
  width: 100%;
}

.profile-identity-header {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 24px;
  padding: 18px 24px 22px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar-button {
  position: relative;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.profile-avatar-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.profile-page-avatar {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: #ffd952;
  color: #151515;
  font-size: 34px;
  line-height: 1;
}

.profile-avatar-edit-indicator {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid #171a22;
  border-radius: 50%;
  background: var(--teal);
  color: #101820;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
  pointer-events: auto;
}

.profile-avatar-edit-indicator svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.profile-identity-details {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.profile-identity-details h3,
.profile-identity-details p {
  margin: 0;
}

.profile-identity-details h3 {
  font-size: 24px;
}

.profile-identity-details p,
.profile-identity-details small {
  color: var(--muted);
}

.profile-avatar-library-backdrop {
  position: fixed;
  z-index: 3200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 8, 13, 0.76);
}

.profile-avatar-library {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 16px;
  width: min(960px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  min-height: 0;
  border: 1px solid rgba(95, 209, 255, 0.28);
  border-radius: 8px;
  background: #171a22;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.48);
  padding: 16px;
}

.profile-avatar-library-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.profile-avatar-library-header h3,
.profile-avatar-library-header p {
  margin: 0;
}

.profile-avatar-library-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.profile-avatar-library-header .icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.profile-avatar-color-section {
  display: grid;
  gap: 9px;
}

.profile-avatar-color-section strong {
  font-size: 13px;
}

.profile-avatar-color-list,
.profile-avatar-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.profile-avatar-categories {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 2px 2px 8px;
  overscroll-behavior-inline: contain;
}

.profile-avatar-color,
.profile-avatar-category,
.profile-avatar-option {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.profile-avatar-color {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(135, 184, 220, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
  padding: 0;
}

.profile-avatar-color span {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
}

.profile-avatar-category {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid rgba(135, 184, 220, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
}

.profile-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 4px 2px;
}

.profile-avatar-option {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(135, 184, 220, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0;
}

.profile-avatar-option span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #151515;
  font-size: 21px;
  line-height: 1;
}

.profile-avatar-color:hover,
.profile-avatar-color:focus-visible,
.profile-avatar-category:hover,
.profile-avatar-category:focus-visible,
.profile-avatar-option:hover,
.profile-avatar-option:focus-visible,
.profile-avatar-color.active,
.profile-avatar-category.active,
.profile-avatar-option.active {
  border-color: rgba(95, 209, 255, 0.92);
  outline: none;
}

.profile-avatar-color.active,
.profile-avatar-option.active {
  box-shadow: 0 0 0 2px rgba(95, 209, 255, 0.22);
}

.profile-avatar-category.active {
  background: rgba(52, 114, 240, 0.22);
  color: var(--text);
}

@media (max-width: 640px) {
  .profile-avatar-library-backdrop {
    place-items: stretch;
  }

  .profile-avatar-library {
    width: 100%;
    max-height: calc(100vh - 32px);
  }

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

.login-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: hidden;
  background-color: #05070c;
  background:
    repeating-linear-gradient(90deg, rgba(73, 213, 189, 0.11) 0 1px, transparent 1px 84px),
    repeating-linear-gradient(0deg, rgba(122, 167, 255, 0.075) 0 1px, transparent 1px 84px),
    linear-gradient(115deg, transparent 0 42%, rgba(73, 213, 189, 0.18) 43%, rgba(73, 213, 189, 0.04) 47%, transparent 50% 100%),
    linear-gradient(245deg, transparent 0 52%, rgba(228, 189, 79, 0.11) 53%, transparent 58% 100%),
    linear-gradient(180deg, #04060b 0%, #0b111a 52%, #05070d 100%);
}

.login-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #101211;
}

.login-background::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 18% 24%, rgba(47, 171, 110, 0.18), transparent 28%),
    radial-gradient(circle at 82% 38%, rgba(221, 188, 112, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 42%, rgba(0, 0, 0, 0.45));
}

.login-background canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  opacity: 0.15;
}

.login-shell::before,
.login-shell::after {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
}

.login-shell::before {
  z-index: -2;
  background:
    repeating-linear-gradient(90deg, transparent 0 35px, rgba(242, 244, 248, 0.055) 35px 36px, transparent 36px 72px),
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(242, 244, 248, 0.04) 35px 36px, transparent 36px 72px),
    linear-gradient(102deg, transparent 0 33%, rgba(73, 213, 189, 0.28) 38%, rgba(73, 213, 189, 0.06) 42%, transparent 47% 100%),
    linear-gradient(75deg, transparent 0 56%, rgba(122, 167, 255, 0.16) 60%, transparent 65% 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  animation: login-grid-drift 30s linear infinite alternate;
}

.login-shell::after {
  z-index: -1;
  background:
    repeating-linear-gradient(180deg, rgba(242, 244, 248, 0.052) 0 1px, transparent 1px 7px),
    linear-gradient(90deg, transparent 0 45%, rgba(73, 213, 189, 0.2) 49%, transparent 54% 100%),
    linear-gradient(135deg, transparent 0 63%, rgba(122, 167, 255, 0.16) 64%, transparent 67% 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 82%, transparent 100%);
  opacity: 0.74;
  mix-blend-mode: screen;
  animation: login-scan 13s ease-in-out infinite alternate;
}

.login-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  border: 1px solid rgba(122, 167, 255, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(31, 36, 48, 0.92), rgba(15, 18, 27, 0.94)),
    linear-gradient(135deg, rgba(73, 213, 189, 0.08), transparent 42%);
  box-shadow:
    0 30px 110px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(73, 213, 189, 0.12) inset,
    0 0 42px rgba(73, 213, 189, 0.14);
  backdrop-filter: blur(18px);
  padding: 22px;
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, #49d5bd 24%, #7aa7ff 58%, #e4bd4f 82%, transparent);
  opacity: 0.95;
}

@keyframes login-grid-drift {
  from { transform: translate3d(-36px, -24px, 0); }
  to { transform: translate3d(36px, 24px, 0); }
}

@keyframes login-scan {
  from { transform: translate3d(-5%, -2%, 0) skewX(-8deg); }
  to { transform: translate3d(5%, 2%, 0) skewX(-8deg); }
}

@media (prefers-reduced-motion: reduce) {
  .login-background canvas {
    display: none;
  }

  .login-shell::before,
  .login-shell::after {
    animation: none;
  }
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.login-form input {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.google-login-button {
  min-height: 42px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: #3c4043;
  padding: 9px 14px;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.google-login-button:hover,
.google-login-button:focus-visible {
  background: #f8fafd;
  border-color: #d2e3fc;
  outline: 2px solid rgba(66, 133, 244, 0.28);
  outline-offset: 2px;
}

.google-login-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.subtabs {
  margin-bottom: 14px;
}

.primary-route-tabs {
  flex: 0 0 auto;
}

.tab-panel > .subtabs,
.tab-panel > .shopify-workspace-header {
  position: sticky;
  top: var(--page-tabs-top, 0px);
  z-index: 240;
  flex-shrink: 0;
  background: var(--page);
  box-shadow: 0 8px 0 var(--page);
}

.tab-panel > .section-heading:has(+ .subtabs) {
  position: sticky;
  top: 0;
  z-index: 250;
  background: var(--panel);
}

.operations-subtab-panel > .section-heading:has(+ .subtabs) {
  position: sticky;
  top: var(--page-tabs-height, 0px);
  z-index: 235;
  background: var(--panel);
}

.tab-panel > .shopify-workspace-header > .subtabs {
  position: static;
}

.tab-panel > .shopify-workspace-subtabs,
.operations-subtab-panel > .subtabs,
.tab-panel .crypto-simulator-tabs {
  position: sticky;
  top: var(--page-subtabs-top, var(--page-tabs-height, 0px));
  z-index: 230;
  flex-shrink: 0;
  background: var(--panel);
  box-shadow: 0 8px 0 var(--panel);
}

.operations-subtab-panel:has(> .subtabs) {
  overflow: clip;
}

.tab-panel {
  scroll-padding-top: var(--page-header-height, var(--page-tabs-height, 0px));
}

.operations-subtabs {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #191c22;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 8px 13px;
  font: inherit;
  cursor: pointer;
}

.tab-nav-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-button.compact {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.tab-button:hover,
.tab-button:focus-visible,
.tab-button.active {
  color: var(--text);
  border-color: #358d7f;
  background: var(--panel-strong);
}

.tab-panel,
.subtab-panel,
.marketing-subtab-panel,
.finance-subtab-panel,
.operations-subtab-panel {
  min-width: 0;
}

.tab-panel:not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#shopify-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.shopify-workspace-header,
.shopify-workspace-groups,
.shopify-workspace-subtabs {
  flex: 0 0 auto;
}

.shopify-workspace-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.shopify-workspace-groups {
  min-width: 0;
  margin-bottom: 0;
}

.shopify-workspace-subtabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.shopify-workspace-subtabs .tab-nav-icon {
  color: var(--teal);
}

.shopify-workspace-subtabs[hidden] {
  display: none;
}

.shopify-workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.shopify-workspace-actions .button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.shopify-workspace-root {
  flex: 1 1 auto;
  min-height: 440px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: #101114;
}

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

  .shopify-workspace-header .shopify-workspace-actions {
    justify-self: end;
  }

  .shopify-workspace-actions .button {
    flex: 1 1 0;
    justify-content: center;
  }

  .shopify-workspace-root {
    min-height: 560px;
  }
}

.operations-shopify-panel:not([hidden]) {
  display: flex;
  min-height: 560px;
  flex-direction: column;
  gap: 10px;
}

#shopifySettingsWorkspaceSlot {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
}

#shopifySettingsWorkspaceSlot .shopify-workspace-root {
  width: 100%;
}

#mail-data-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#mail-data-panel > .subtabs {
  flex: 0 0 auto;
}

#finance-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#finance-panel > .subtabs {
  flex: 0 0 auto;
}

#finance-panel > .finance-subtab-panel:not([hidden]):not(#finance-transactions) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.operations-subtab-panel[hidden] {
  display: none;
}

.llm-subtabs {
  margin: 14px 0;
  padding: 0 16px;
}

.message-chat-settings-subtabs {
  padding: 0 16px;
}

.llm-profile-new-button {
  margin-left: auto;
}

.llm-profile-panel {
  position: fixed;
  inset: 0;
  z-index: 340;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 7, 12, 0.76);
  backdrop-filter: blur(12px);
}

.llm-profile-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(73, 213, 189, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 36, 48, 0.98), rgba(15, 18, 27, 0.98));
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(73, 213, 189, 0.12) inset;
}

.llm-profile-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.llm-profile-dialog-heading h3 {
  margin: 0;
  font-size: 17px;
}

.llm-profile-dialog .llm-profile-form {
  overflow-y: auto;
  border-bottom: 0;
}

.llm-profile-dialog .llm-form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .llm-profile-panel {
    place-items: stretch;
    padding: 0;
  }

  .llm-profile-dialog {
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
}

.marketing-settings-subtabs {
  margin: 14px 16px 0;
}

.marketing-settings-subtab-panel[hidden] {
  display: none;
}

.marketing-social-settings-summary {
  padding: 16px;
}

.marketing-settings-block {
  border-top: 1px solid var(--border);
}

.llm-subtab-panel[hidden] {
  display: none;
}

.financial-provider-subtabs {
  margin: 0 0 14px;
  padding: 0 16px;
}

#operations-bank-accounts .section-heading {
  border-bottom: 0;
}

.financial-provider-panel[hidden] {
  display: none;
}

.financial-provider-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 0 16px;
  margin-bottom: 14px;
}

.financial-provider-actions .inline-status {
  flex: 1 1 280px;
  min-width: 0;
}

.financial-provider-actions .button {
  flex: 0 0 auto;
  margin-left: auto;
}

.plaid-config-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.plaid-config-card {
  min-height: 78px;
  padding: 12px;
}

.plaid-config-card .metric-value {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.llm-test-form {
  grid-template-columns: minmax(240px, 2fr) repeat(2, minmax(140px, 1fr));
}

.llm-test-prompt {
  grid-column: 1 / -1;
}

.llm-test-output {
  min-height: 160px;
  margin: 0 16px 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0d1016;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.llm-route-form {
  margin: 0 16px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #151821;
  overflow: hidden;
}

.llm-route-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.llm-route-heading h3 {
  margin: 0;
  font-size: 16px;
}

.llm-route-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.llm-route-collapse-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
}

.llm-route-collapse-toggle:hover,
.llm-route-collapse-toggle:focus-visible {
  border-color: #358d7f;
}

.llm-route-form.is-collapsed .llm-route-content {
  display: none;
}

.llm-route-form.is-collapsed .llm-route-heading {
  border-bottom: 0;
}

.llm-route-form.is-collapsed .llm-route-collapse-toggle .section-collapse-icon {
  transform: rotate(-45deg) translate(1px, 1px);
}

.llm-route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}

.llm-route-model-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.llm-route-model-group legend {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.llm-route-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.llm-route-select-all {
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.llm-route-select-all:hover,
.llm-route-select-all:focus-visible {
  border-color: var(--teal);
}

.llm-route-select-all:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.llm-route-model-list {
  display: grid;
  align-content: start;
  max-height: 360px;
  overflow: auto;
}

.llm-route-model-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(52, 58, 70, 0.72);
}

.llm-route-model-option:last-child {
  border-bottom: 0;
}

.llm-route-model-option:hover,
.llm-route-model-option:focus-within {
  background: var(--panel-strong);
}

.llm-route-model-option.is-selected {
  border-color: rgba(73, 213, 189, 0.58);
  background: rgba(73, 213, 189, 0.11);
  box-shadow: inset 3px 0 0 var(--teal);
}

.llm-route-model-option.is-selected .llm-route-model-state {
  color: #9df3e4;
  font-weight: 700;
}

.llm-route-model-selector {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}

.llm-route-model-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.llm-route-model-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.llm-route-model-copy strong,
.llm-route-model-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.llm-route-model-copy small,
.llm-route-model-state {
  color: var(--muted);
  font-size: 12px;
}

.llm-route-model-option.is-disabled .llm-route-model-copy {
  opacity: 0.62;
}

.llm-route-primary-button {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-strong);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}

.llm-route-primary-button:hover,
.llm-route-primary-button:focus-visible {
  border-color: #f0c35a;
  color: var(--text);
}

.llm-route-primary-button.is-primary {
  border-color: #f0c35a;
  background: rgba(240, 195, 90, 0.16);
  color: #ffe2a0;
  font-weight: 700;
}

.llm-route-primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.llm-route-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 14px 14px;
}

.llm-route-actions .inline-status {
  margin-right: auto;
}

@media (max-width: 720px) {
  .llm-route-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .llm-route-model-option {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .llm-route-model-selector {
    grid-column: 1 / -1;
  }

  .llm-route-model-state {
    grid-column: 1;
  }

  .llm-route-primary-button {
    grid-column: 2;
  }
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #358d7f;
  border-radius: 6px;
  background: #236e64;
  color: var(--text);
  padding: 8px 13px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.action-button-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-only-action {
  width: 38px;
  min-width: 38px;
  padding: 8px;
}

.icon-only-action .action-button-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.button.secondary {
  border-color: var(--border);
  background: var(--panel-strong);
}

.button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.responsive-icon-action .responsive-action-icon {
  display: none;
}

.responsive-icon-action.responsive-action-existing-icon .responsive-action-icon {
  display: block;
}

#sidebarToggle,
#refreshButton {
  border: 0;
  background: transparent;
  box-shadow: none;
}

#sidebarToggle:hover,
#refreshButton:hover {
  color: var(--teal);
}

#sidebarToggle:focus-visible,
#refreshButton:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

#refreshButton.responsive-icon-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#refreshButton.responsive-icon-action .responsive-action-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(124px, 1fr);
  grid-template-rows: 1fr;
  gap: 12px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.dashboard-section {
  margin-bottom: 18px;
  min-width: 0;
}

.dashboard-heading {
  margin-bottom: 10px;
}

#dashboard-panel .summary-grid {
  grid-auto-columns: minmax(150px, 1fr);
  grid-template-rows: repeat(2, minmax(88px, auto));
}

#dashboard-panel .metric-panel {
  min-height: 88px;
}

.dashboard-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.dashboard-insight-card {
  padding: 0;
  min-width: 0;
  overflow: hidden;
}

.dashboard-card-heading {
  padding: 14px 16px 10px;
  margin: 0;
}

.dashboard-card-heading h2 {
  font-size: 15px;
}

.dashboard-chart-bars {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.dashboard-bar-row {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.dashboard-bar-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-bar-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-bar-label strong {
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #252a33;
  overflow: hidden;
}

.dashboard-bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.dashboard-bar-fill.warning {
  background: var(--warning);
}

.dashboard-bar-fill.danger,
.dashboard-bar-fill.expense {
  background: var(--danger);
}

.dashboard-bar-fill.ready,
.dashboard-bar-fill.income {
  background: var(--success);
}

.dashboard-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 0;
}

.tab-panel > .summary-grid {
  margin-bottom: 18px;
}

.metric-panel,
.content-band {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.metric-panel {
  min-height: 96px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.metric-value {
  font-size: 26px;
  color: var(--text);
}

.metric-value.money {
  font-size: 20px;
}

.content-band {
  margin-bottom: 18px;
  overflow: hidden;
}

.tab-panel.content-band,
.subtab-panel.content-band,
.marketing-subtab-panel.content-band,
.finance-subtab-panel.content-band {
  margin-bottom: 0;
}

#messages.content-band {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

#accounts.content-band {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#messages > .section-heading {
  position: sticky;
  top: 0;
  z-index: 220;
  border-radius: 8px 8px 0 0;
  background: var(--panel);
}

#messageSearchForm {
  position: sticky;
  top: 0;
  z-index: 210;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.app-shell.message-detail-active #messages > .section-heading,
.app-shell.message-detail-active #messageSearchForm {
  position: static;
}

.app-shell.message-detail-active .topbar {
  display: none;
}

.app-shell.message-routing-active #messageSearchForm {
  visibility: hidden;
}

.section-heading {
  position: relative;
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
  padding: 16px;
  padding-right: 58px;
  border-bottom: 1px solid var(--border);
}

.section-heading h2 {
  min-width: 0;
}

.section-heading .section-note {
  min-width: 0;
  margin-left: auto;
  text-align: right;
  overflow-wrap: anywhere;
}

.section-collapse-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
}

.section-collapse-toggle:hover,
.section-collapse-toggle:focus-visible {
  border-color: #358d7f;
}

.section-collapse-icon {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 120ms ease;
}

.content-band.section-collapsed > :not(.section-heading) {
  display: none !important;
}

.content-band.section-collapsed .section-heading {
  border-bottom: 0;
}

.content-band.section-collapsed .section-collapse-icon {
  transform: rotate(-45deg) translate(1px, 1px);
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-user-heading-actions {
  margin-left: auto;
}

.auth-group-heading-actions {
  margin-left: auto;
}

.attachment-section-actions {
  margin-left: auto;
}

.message-batch-analysis-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.message-selection-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

.message-select-all-control {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-strong);
}

.message-selection-actions .message-action-button:disabled {
  cursor: not-allowed;
}

.message-test-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.message-test-toggle input {
  appearance: none;
  position: relative;
  width: 38px;
  height: 22px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #12141a;
  cursor: pointer;
}

.message-test-toggle input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 120ms ease, background 120ms ease;
}

.message-test-toggle input:checked {
  border-color: #358d7f;
  background: #236e64;
}

.message-test-toggle input:checked::before {
  transform: translateX(16px);
  background: var(--text);
}

.message-test-toggle input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.feature-refresh-actions {
  min-width: 180px;
}

.feature-refresh-actions .section-note {
  white-space: nowrap;
}

.shopify-commission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.shopify-commission-grid .metric-value.money {
  color: #36d399;
}

.shopify-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.shopify-toolbar .section-note {
  margin-right: auto;
}

.shopify-month-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.shopify-month-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.shopify-month-form input[type="month"] {
  min-height: 34px;
  width: 146px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
}

.auto-sync-preview {
  border-bottom: 1px solid var(--border);
}

.auto-sync-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}

.auto-sync-preview-heading h3 {
  margin: 0;
  font-size: 16px;
}

.auto-sync-preview-form {
  border-bottom: 0;
}

.auto-sync-preview .table-frame {
  padding-top: 8px;
}

.domain-readiness-panel {
  border-bottom: 1px solid var(--border);
}

.domain-readiness-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
}

.domain-readiness-heading h3 {
  margin: 0;
  font-size: 16px;
}

.compact-table td,
.compact-table th {
  height: 38px;
}

.table-frame {
  overflow-x: hidden;
}

.account-form,
.finance-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.account-toolbar {
  display: grid;
  grid-template-columns: minmax(140px, 190px) minmax(140px, 220px) minmax(160px, 220px) auto auto;
  gap: 10px;
  align-items: center;
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--border);
}

.account-domain-filter-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  min-width: 0;
}

.account-domain-filter-reset.icon-button.message-action-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
}

.account-form-dialog .account-form {
  overflow-y: auto;
  border-bottom: 0;
}

.auth-user-form-dialog .auth-user-form {
  overflow-y: auto;
  border-bottom: 0;
}

.auth-group-form-dialog .auth-group-form {
  overflow-y: auto;
  border-bottom: 0;
}

.auth-user-form-status,
.auth-user-form-actions {
  grid-column: 1 / -1;
}

.auth-group-form-status,
.auth-group-form-actions {
  grid-column: 1 / -1;
}

.auth-user-form-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.auth-group-form-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.auth-user-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.auth-group-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.account-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.account-form-open-button {
  justify-self: end;
}

.finance-form.report-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.marketing-project-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.marketing-project-form .marketing-project-notes {
  grid-column: span 2;
}

.marketing-project-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.marketing-ad-monitor-form {
  grid-template-columns: repeat(5, minmax(145px, 1fr));
}

.marketing-ad-monitor-form .marketing-ad-product-query {
  grid-column: span 2;
}

.marketing-ad-monitor-enabled {
  align-self: end;
  min-height: 38px;
}

.marketing-ad-monitor-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.marketing-ad-monitors-table,
.marketing-ad-snapshots-table {
  width: auto;
  min-width: 100%;
  table-layout: auto;
}

.marketing-ad-monitors-table td:first-child,
.marketing-ad-monitors-table td:nth-child(2) {
  min-width: 170px;
}

.marketing-ad-result-metrics {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.marketing-ad-monitors-table th:last-child,
.marketing-ad-monitors-table td:last-child {
  width: 1%;
  min-width: 218px;
  white-space: nowrap;
}

.marketing-social-account-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.marketing-social-account-form .marketing-social-enabled {
  align-self: end;
  min-height: 38px;
}

.marketing-social-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: span 3;
  flex-wrap: wrap;
}

.marketing-social-account-id {
  display: block;
  max-width: 280px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marketing-settings-block .table-frame {
  overflow-x: auto;
}

.marketing-social-accounts-table {
  width: auto;
  min-width: 100%;
  table-layout: auto;
}

.marketing-social-accounts-table th:last-child,
.marketing-social-accounts-table td:last-child {
  width: 1%;
  min-width: 140px;
  white-space: nowrap;
}

.account-form label,
.finance-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.account-form input,
.account-form select,
.account-toolbar input,
.account-toolbar select,
.finance-form input,
.finance-form select,
.finance-form textarea {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.finance-form textarea {
  resize: vertical;
}

.llm-suggestion-field {
  position: relative;
  min-width: 0;
}

.llm-suggestion-list {
  position: absolute;
  z-index: 220;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #171a20;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}

.llm-suggestion-list[hidden] {
  display: none;
}

.llm-suggestion-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.llm-suggestion-option:last-child {
  border-bottom: 0;
}

.llm-suggestion-option:hover,
.llm-suggestion-option.active {
  background: rgba(79, 209, 197, 0.12);
}

.llm-suggestion-value,
.llm-suggestion-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.llm-suggestion-label {
  color: var(--muted);
}

.llm-model-metadata {
  grid-column: 1 / -1;
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.llm-model-metadata[hidden] {
  display: none;
}

.llm-model-metadata-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.llm-model-metadata-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.llm-model-metadata-source {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
}

.llm-model-metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px 14px;
}

.llm-model-metadata-item {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.llm-model-metadata-label,
.llm-model-metadata-note {
  color: var(--muted);
  font-size: 11px;
}

.llm-model-metadata-value {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.llm-model-metadata-state {
  color: var(--muted);
  font-size: 13px;
}

.llm-model-metadata-state.error {
  color: var(--red);
}

.llm-model-metadata-footnote {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.llm-api-key-settings {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(220px, 1.2fr);
  grid-column: span 2;
  gap: 6px 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.llm-api-key-settings legend {
  padding: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.llm-api-key-mode-control {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.llm-api-key-mode-label {
  color: var(--muted);
  font-size: 13px;
}

.llm-api-key-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
}

.finance-form .llm-api-key-mode-option {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.finance-form .llm-api-key-mode-option input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
}

.llm-api-key-mode-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.llm-api-key-mode-option input:checked + span {
  background: #236e64;
  color: var(--text);
}

.llm-api-key-mode-option input:focus-visible + span {
  outline: 2px solid rgba(79, 209, 197, 0.45);
  outline-offset: 1px;
}

.llm-max-prompt-settings {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.llm-max-prompt-settings legend {
  padding: 0;
  color: var(--muted);
  font-size: 13px;
}

.llm-max-prompt-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 94px;
  gap: 6px;
  min-width: 0;
}

.llm-max-prompt-unit {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-form .environment-switch {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 13px;
}

.finance-form .environment-switch legend {
  padding: 0;
}

.environment-toggle {
  position: relative;
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 58px minmax(86px, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  cursor: pointer;
}

.environment-toggle-label {
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

.environment-toggle[data-environment="sandbox"] .environment-toggle-label-sandbox,
.environment-toggle[data-environment="production"] .environment-toggle-label-production {
  color: var(--text);
  font-weight: 800;
}

.finance-form .environment-toggle-input {
  appearance: none;
  position: relative;
  width: 58px;
  height: 30px;
  min-height: 30px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #2a303b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.environment-toggle-input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 160ms ease, background-color 160ms ease;
}

.environment-toggle-input:checked {
  border-color: #358d7f;
  background: #236e64;
}

.environment-toggle-input:checked::before {
  transform: translateX(28px);
}

.environment-toggle-input:focus-visible {
  outline: 2px solid rgba(79, 209, 197, 0.35);
  outline-offset: 2px;
}

.account-form .checkbox-row,
.finance-form .checkbox-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 38px;
  padding: 6px 0;
  cursor: pointer;
}

.account-form .checkbox-row input[type="checkbox"],
.finance-form .checkbox-row input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 46px;
  height: 26px;
  min-height: 26px;
  flex: 0 0 46px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #12141a;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.account-form .checkbox-row input[type="checkbox"]::before,
.finance-form .checkbox-row input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 120ms ease, background 120ms ease;
}

.account-form .checkbox-row input[type="checkbox"]:checked,
.finance-form .checkbox-row input[type="checkbox"]:checked {
  border-color: #358d7f;
  background: #236e64;
}

.account-form .checkbox-row input[type="checkbox"]:checked::before,
.finance-form .checkbox-row input[type="checkbox"]:checked::before {
  transform: translateX(20px);
  background: var(--text);
}

.account-form .checkbox-row input[type="checkbox"]:focus-visible,
.finance-form .checkbox-row input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.form-status {
  min-height: 28px;
  padding: 0 16px 12px;
  color: var(--muted);
  font-size: 13px;
}

.message-form-status {
  padding-top: 12px;
}

.section-actions .message-form-status {
  max-width: 560px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-status {
  min-height: 0;
  padding: 0;
  align-self: center;
}

.llm-test-actions,
.llm-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.llm-test-actions .button {
  width: 116px;
  flex: 0 0 116px;
}

.llm-test-actions .inline-status {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-error-popup {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  width: min(560px, calc(100vw - 36px));
  max-height: min(560px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(255, 107, 107, 0.5);
  border-radius: 8px;
  background: rgba(20, 12, 16, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 107, 107, 0.12) inset;
  overflow: hidden;
}

.admin-error-popup[data-variant="success"] {
  border-color: rgba(54, 211, 153, 0.52);
  background: rgba(10, 22, 18, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(54, 211, 153, 0.14) inset;
}

.admin-error-popup[hidden] {
  display: none;
}

.admin-error-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 107, 107, 0.28);
  color: #ffb4b4;
}

.admin-error-popup[data-variant="success"] .admin-error-popup-header {
  border-bottom-color: rgba(54, 211, 153, 0.28);
  color: #a9f5cf;
}

#adminErrorClose {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
}

#adminErrorClose svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

#adminErrorClose:hover {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
}

#adminErrorClose:focus-visible {
  border: 0;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.admin-error-popup pre {
  min-height: 96px;
  max-height: 440px;
  margin: 0;
  padding: 12px;
  color: var(--text);
  white-space: pre-wrap;
  overflow: auto;
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  height: 44px;
  padding: 10px 12px;
  border-bottom: 1px solid #2b303a;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

#accounts > .table-frame thead th {
  border-bottom: 0;
  background: var(--panel);
}

#accounts > .table-frame {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

#accounts > .table-frame table {
  width: auto;
  min-width: 100%;
  table-layout: auto;
}

#accounts > .table-frame thead {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--panel);
  box-shadow: 0 1px 0 #2b303a;
}

.account-fetch-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.account-fetch-state .badge {
  align-self: center;
}

.account-fetch-time {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.account-fetch-date {
  color: var(--muted);
}

.financial-provider-panel .table-frame tbody tr:last-child td {
  border-bottom: 0;
}

#finance-transactions {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  height: auto;
  min-height: 0;
}

#finance-transactions.section-collapsed {
  height: auto;
  min-height: 0;
}

.finance-transaction-quick-filters {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(25, 28, 34, 0.78);
}

.quick-filter-title {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.quick-filter-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.quick-filter-control select,
.quick-filter-control input {
  min-height: 38px;
  min-width: 160px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 8px 34px 8px 10px;
  font: inherit;
}

.finance-amount-filter-control input {
  min-width: 108px;
  width: 108px;
}

.quick-filter-month-actions {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}

.quick-filter-month-actions .quick-filter-control {
  flex: 0 1 auto;
}

.quick-filter-month-actions .finance-filter-icon-button {
  flex: 0 0 38px;
}

.finance-sandbox-toggle {
  flex: 0 0 auto;
}

.finance-column-settings,
.finance-category-settings {
  position: relative;
  flex: 0 0 auto;
}

.finance-column-settings-panel,
.finance-category-settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

.finance-column-settings-panel[hidden],
.finance-category-settings-panel[hidden] {
  display: none;
}

.finance-column-settings-title,
.finance-category-settings-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.finance-column-option,
.finance-category-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.finance-column-option input,
.finance-category-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #358d7f;
}

.finance-category-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 38px;
  width: 38px;
  padding: 8px;
  color: #fff;
  white-space: nowrap;
}

.finance-category-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #fff;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.finance-category-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.quick-filter-summary {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-quick-filter-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 720px) {
  .finance-transaction-quick-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-filter-control {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-filter-month-actions {
    width: 100%;
  }

  .quick-filter-month-actions .quick-filter-control {
    flex: 1 1 auto;
  }

  .quick-filter-control select,
  .finance-sandbox-toggle,
  .finance-column-settings,
  .finance-transaction-quick-filters .button {
    width: 100%;
  }

  .quick-filter-month-actions .finance-filter-icon-button {
    flex: 0 0 38px;
    width: 38px;
  }

  .finance-quick-filter-actions {
    width: 100%;
    margin-left: 0;
  }

  .finance-quick-filter-actions .finance-filter-icon-button {
    flex: 0 0 38px;
    width: 38px;
  }

  .finance-quick-filter-actions #financeCsvOpenButton {
    flex: 1 1 auto;
  }

  .finance-column-settings-panel {
    left: 0;
    right: auto;
    width: 100%;
  }
}

.finance-csv-panel {
  position: fixed;
  inset: 0;
  z-index: 86;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(5, 7, 12, 0.76);
  backdrop-filter: blur(12px);
}

.finance-csv-panel[hidden] {
  display: none;
}

.finance-csv-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 24px));
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(73, 213, 189, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 36, 48, 0.98), rgba(15, 18, 27, 0.98));
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(73, 213, 189, 0.12) inset;
  overflow: auto;
}

.finance-csv-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.finance-csv-heading h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.finance-csv-meta {
  color: var(--muted);
  font-size: 13px;
}

.finance-csv-dialog-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  border-bottom: 0;
}

.finance-csv-file-label,
.finance-csv-dialog-actions {
  grid-column: 1 / -1;
}

.finance-csv-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.finance-csv-dialog-actions .form-status {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-csv-dialog-actions .button {
  flex: 0 0 180px;
}

@media (max-width: 720px) {
  .finance-csv-panel {
    padding: 0;
  }

  .finance-csv-dialog {
    width: 100vw;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }

  .finance-csv-dialog-form {
    grid-template-columns: 1fr;
  }

  .finance-csv-dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-csv-dialog-actions .button {
    flex-basis: auto;
    width: 100%;
  }
}

.finance-transaction-account-subtabs {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #191c22;
}

.finance-transaction-account-count {
  color: var(--muted);
  font-size: 12px;
}

.finance-transaction-table-frame {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}

.finance-transaction-table-frame table {
  width: auto;
  min-width: 100%;
  table-layout: auto;
}

.finance-transaction-table-frame thead {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--panel);
  box-shadow: 0 1px 0 #2b303a;
}

.finance-transaction-table-frame thead th {
  position: sticky;
  top: 0;
  z-index: 130;
  background: var(--panel);
}

.finance-transaction-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-align: left;
}

.finance-transaction-sort-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.finance-sort-indicator {
  min-width: 34px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: right;
}

.finance-transaction-sort-button.active .finance-sort-indicator {
  color: var(--accent);
}

.finance-transaction-table-frame tbody tr.finance-transaction-row-income td {
  color: #7ee0a0;
}

.finance-transaction-table-frame tbody tr.finance-transaction-row-expense td {
  color: #ff8f8f;
}

.finance-transaction-table-frame th[data-finance-transaction-column="description"],
.finance-transaction-table-frame td[data-finance-transaction-column="description"] {
  width: min(720px, 52vw);
  max-width: min(720px, 52vw);
  min-width: 280px;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  word-break: normal;
}

.finance-transaction-table-frame td[data-finance-transaction-column="description"] {
  line-height: 1.35;
  vertical-align: top;
}

.finance-transaction-table-frame th[data-finance-transaction-column="accounting_category"],
.finance-transaction-table-frame td[data-finance-transaction-column="accounting_category"] {
  min-width: 240px;
  width: 280px;
  vertical-align: top;
}

.finance-accounting-category-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.finance-accounting-category-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.finance-accounting-category-input {
  min-height: 32px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  padding: 6px 8px;
}

.finance-accounting-category-input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(84, 160, 255, 0.28);
  outline-offset: 1px;
}

.finance-accounting-category-apply-all {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-strong);
  color: #fff;
  cursor: pointer;
  padding: 0;
}

.finance-accounting-category-apply-all:hover,
.finance-accounting-category-apply-all:focus-visible {
  border-color: var(--accent);
  outline: 2px solid rgba(84, 160, 255, 0.22);
  outline-offset: 1px;
}

.finance-accounting-category-apply-all:disabled {
  cursor: wait;
  opacity: 0.6;
}

.finance-accounting-category-apply-all svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.finance-accounting-category-menu {
  display: none;
  max-height: 148px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-strong);
  padding: 4px;
}

.finance-accounting-category-cell:focus-within .finance-accounting-category-menu {
  display: grid;
  gap: 2px;
}

.finance-accounting-category-option {
  width: 100%;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 6px 7px;
  text-align: left;
  white-space: normal;
}

.finance-accounting-category-option:hover,
.finance-accounting-category-option:focus,
.finance-accounting-category-option.active {
  background: rgba(84, 160, 255, 0.16);
  outline: none;
}

.finance-accounting-category-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 6px 7px;
}

.finance-accounting-category-source {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.message-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: inherit;
  cursor: pointer;
}

.message-sort-button:hover,
.message-sort-button:focus-visible,
.message-sort-button.is-sort-active {
  color: var(--text);
}

.message-sort-button:focus-visible {
  outline: 1px solid rgba(73, 213, 189, 0.72);
  outline-offset: 3px;
}

.message-status-heading .message-sort-button,
.message-sort-icon-button {
  justify-content: center;
}

.message-sort-indicator {
  display: inline-block;
  flex: 0 0 auto;
  width: 0;
  height: 0;
  opacity: 0.88;
}

.message-sort-button.is-sort-asc .message-sort-indicator {
  border-right: 4px solid transparent;
  border-bottom: 6px solid currentColor;
  border-left: 4px solid transparent;
}

.message-sort-button.is-sort-desc .message-sort-indicator {
  border-top: 6px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.empty-row {
  color: var(--muted);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px;
}

.feature-item {
  min-width: 0;
  min-height: 138px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #191c22;
  padding: 13px;
}

.feature-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.feature-top > div {
  min-width: 0;
}

.feature-badges {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.feature-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.feature-area,
.feature-summary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.feature-meter {
  height: 7px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #12141a;
}

.feature-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-self: flex-start;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--text);
}

.badge.partial {
  color: var(--amber);
  border-color: rgba(228, 189, 79, 0.45);
}

.badge.planned,
.badge.later {
  color: var(--blue);
  border-color: rgba(122, 167, 255, 0.45);
}

.badge.complete {
  color: var(--green);
  border-color: rgba(121, 210, 121, 0.45);
}

.badge.error {
  color: var(--red);
  border-color: rgba(239, 122, 115, 0.45);
}

.badge.finance {
  color: var(--violet);
  border-color: rgba(178, 156, 255, 0.45);
}

.badge.completion {
  color: var(--teal);
  border-color: rgba(73, 213, 189, 0.45);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

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

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: auto;
    max-height: min(38vh, 320px);
  }

  .app-shell.sidebar-collapsed .sidebar {
    display: grid;
    grid-template-columns: max-content max-content minmax(0, 1fr) 36px;
    grid-template-rows: 48px;
    column-gap: 10px;
    align-items: center;
  }

  .main-surface {
    height: auto;
  }

  .topbar-context {
    display: none;
  }

  .profile-menu {
    position: fixed;
    z-index: 320;
    top: 23px;
    right: 73px;
  }

  .app-shell.sidebar-collapsed .sidebar-header {
    display: contents;
  }

  .sidebar-toggle-icon span {
    left: 1px;
    width: 14px;
    transform: none;
    transform-origin: 50% 50%;
  }

  .sidebar-toggle-icon span:nth-child(1),
  .app-shell.sidebar-collapsed .sidebar-toggle-icon span:nth-child(1) {
    top: 3px;
    transform: none;
    transform-origin: 50% 50%;
  }

  .sidebar-toggle-icon span:nth-child(2) {
    top: 7px;
    display: block;
    transform: none;
  }

  .sidebar-toggle-icon span:nth-child(3),
  .app-shell.sidebar-collapsed .sidebar-toggle-icon span:nth-child(3) {
    top: 11px;
    transform: none;
    transform-origin: 50% 50%;
  }

  .app-shell.sidebar-collapsed .brand-copy {
    display: block;
  }

  .app-shell.sidebar-collapsed .brand {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
  }

  .app-shell.sidebar-collapsed .sidebar-footer {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-start;
    margin-top: 0;
    padding-top: 0;
  }

  .sidebar-footer,
  .app-shell.sidebar-collapsed .sidebar-footer {
    position: fixed;
    z-index: 320;
    top: 36px;
    right: 125px;
    margin: 0;
    padding: 0;
  }

  .app-shell.sidebar-collapsed .sidebar-toggle {
    grid-column: 4;
    grid-row: 1;
  }

  .app-shell.sidebar-collapsed .nav-list {
    display: none;
  }

  .feature-grid,
  .account-form,
  .account-toolbar,
  .finance-form,
  .finance-form.report-form {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .marketing-social-form-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .button.responsive-icon-action,
  .message-folder-filter-button.responsive-icon-action {
    display: inline-grid;
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    place-items: center;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
  }

  .responsive-icon-action .responsive-action-label {
    display: none;
  }

  .responsive-icon-action .responsive-action-icon {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .message-folder-filter-button.responsive-icon-action::after {
    content: none;
  }
}

@media (max-width: 640px) {
  .main-surface {
    padding: 14px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    justify-content: flex-end;
    gap: 10px;
  }

  .topbar-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .topbar-updated {
    min-width: 0;
    margin-left: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  .feature-grid,
  .account-form,
  .finance-form,
  .finance-form.report-form {
    grid-template-columns: 1fr;
  }

  .marketing-ad-monitor-form .marketing-ad-product-query,
  .marketing-ad-monitor-form-actions {
    grid-column: 1;
  }

  .account-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
  }

  #accountProviderFilter {
    grid-column: 1;
    grid-row: 1;
  }

  #accountDomainFilterControl {
    grid-column: 2 / 4;
    grid-row: 1;
  }

  #accountStatusFilter {
    grid-column: 1;
    grid-row: 2;
  }

  #queueSyncableAccountsButton {
    grid-column: 2;
    grid-row: 2;
  }

  .account-form-open-button {
    grid-column: 3;
    grid-row: 2;
    width: 38px;
  }

  .llm-api-key-settings {
    grid-template-columns: 1fr;
    grid-column: 1;
  }
}

.message-search {
  display: grid;
  grid-template-columns: 38px minmax(140px, 180px) minmax(140px, 180px) 38px minmax(180px, 240px) minmax(180px, 1fr) auto auto;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.message-search input {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.message-search .message-select-all-control .message-select-checkbox {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
}

.message-inline-actions,
.attachment-inline-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.message-search .message-test-toggle input {
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 999px;
}

.attachment-filter-form {
  align-items: center;
  grid-template-columns: minmax(180px, 260px) minmax(180px, 260px) minmax(150px, 210px) minmax(160px, 220px) minmax(140px, 180px) 38px 38px;
  justify-content: start;
}

@media (min-width: 981px) and (max-width: 1280px) {
  .attachment-filter-form {
    grid-template-columns: repeat(5, minmax(0, 1fr)) 38px 38px;
  }

  #attachmentAccountFilter {
    grid-column: 1 / 4;
  }

  #attachmentDomainFilter {
    grid-column: 4 / -1;
  }

  #attachmentFolderFilterControl {
    grid-column: 1;
  }

  #attachmentContentTypeFilterControl {
    grid-column: 2;
  }

  #attachmentContentAvailableFilterControl {
    grid-column: 3;
  }

  #attachmentFilterSubmit {
    grid-column: 6;
  }

  #clearAttachmentFilters {
    grid-column: 7;
  }
}

.message-filter-button,
.attachment-filter-button,
.finance-filter-icon-button {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  width: 38px;
  padding: 0;
}

.message-filter-button svg,
.attachment-filter-button svg,
.finance-filter-icon-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 720px) {
  .message-search {
    grid-template-columns: 38px minmax(0, 1fr) 38px 38px;
  }

  .message-search .message-select-all-control {
    grid-column: 1;
  }

  #messageDomainFilter {
    grid-column: 2 / -1;
  }

  #messageAccountFilter {
    grid-column: 1 / 4;
  }

  #resetMessageAccountFilter {
    grid-column: 4;
  }

  #messageFolderFilterControl {
    grid-column: 1 / -1;
  }

  #messageSearch {
    grid-column: 1 / 3;
  }
}

@media (max-width: 980px) {
  .attachment-filter-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) repeat(5, 38px);
  }
}

@media (max-width: 640px) {
  .attachment-filter-form {
    grid-template-columns: repeat(5, 38px);
  }

  #attachmentAccountFilter,
  #attachmentDomainFilter {
    grid-column: 1 / -1;
  }
}

.audit-filter-form {
  align-items: center;
  grid-template-columns: minmax(260px, 420px) 38px 38px;
  justify-content: start;
}

.audit-page-size {
  min-height: 38px;
  width: 150px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.audit-url-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.audit-risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.audit-risk-high {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.14);
}

.audit-risk-medium {
  color: #ffd166;
  background: rgba(255, 209, 102, 0.14);
}

.audit-risk-low {
  color: #79d279;
  background: rgba(121, 210, 121, 0.14);
}

.audit-filter-button,
.audit-pagination-button {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  width: 38px;
  padding: 0;
}

.audit-filter-button svg,
.audit-pagination-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.backup-filter-form {
  align-items: center;
  grid-template-columns: minmax(150px, 190px) minmax(220px, 320px) minmax(130px, 160px) 38px 38px 38px;
  justify-content: start;
}

.backup-filter-form select {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.backup-filter-button {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  width: 38px;
  padding: 0;
}

.backup-filter-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.message-folder-filter {
  position: relative;
  min-width: 0;
}

.message-folder-filter-button {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.message-folder-filter-button::after {
  content: "v";
  flex: 0 0 auto;
  color: var(--muted);
}

.message-folder-filter-menu {
  position: absolute;
  z-index: 2500;
  top: calc(100% + 4px);
  left: 0;
  min-width: min(280px, calc(100vw - 32px));
  max-height: 280px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #4b5565;
  border-radius: 6px;
  background: #24272b;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
  padding: 6px;
}

.message-folder-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  border-radius: 4px;
  color: var(--text);
  padding: 6px 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
  white-space: normal;
  cursor: pointer;
}

.message-folder-filter-option:hover,
.message-folder-filter-option:focus-within {
  background: #303844;
}

.message-folder-filter-option input {
  width: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  accent-color: var(--teal);
}

.message-folder-filter-option.pinned {
  color: var(--teal);
}

.message-folder-filter-options {
  display: grid;
  gap: 2px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.filter-combobox-input {
  min-width: 0;
}

.filter-combobox-options {
  position: fixed;
  z-index: 3000;
  overflow-y: auto;
  border: 1px solid #4b5565;
  border-radius: 6px;
  background: #24272b;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
  padding: 4px;
}

.filter-combobox-option {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  padding: 7px 8px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.filter-combobox-option.multiselect {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
}

.filter-combobox-option.selected {
  background: #263a36;
}

.filter-combobox-checkbox {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: #49d5bd;
  pointer-events: none;
}

.filter-combobox-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.filter-combobox-option:hover,
.filter-combobox-option:focus-visible,
.filter-combobox-option.active {
  background: #303844;
  outline: none;
}

.filter-combobox-primary {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.filter-combobox-secondary,
.filter-combobox-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.filter-combobox-empty {
  padding: 8px;
}

.filter-combobox-actions {
  position: sticky;
  bottom: -4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  border-top: 1px solid #4b5565;
  background: #24272b;
  padding: 8px;
}

.filter-combobox-selection-count {
  color: var(--muted);
  font-size: 12px;
}

.filter-combobox-apply {
  min-height: 32px;
  border: 1px solid #49d5bd;
  border-radius: 4px;
  background: #176b60;
  color: #f2f4f8;
  padding: 6px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.filter-combobox-apply:hover,
.filter-combobox-apply:focus-visible {
  background: #218578;
  outline: 2px solid #7be2d2;
  outline-offset: 1px;
}

.filter-combobox-apply:disabled {
  border-color: #4b5565;
  background: #30343b;
  color: #8f98a8;
  cursor: not-allowed;
}

.message-list-frame {
  container: message-list / inline-size;
  border: 1px solid rgba(52, 58, 70, 0.95);
  border-radius: 8px;
  background: #1b1f29;
  overflow: hidden;
}

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

.message-list-empty {
  padding: 18px;
}

.message-list-item {
  display: grid;
  grid-template-columns: 42px 42px 24px minmax(0, 1fr) minmax(96px, 108px) max-content;
  grid-template-areas: "select important attachment main meta actions";
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 8px 0;
  border-top: 1px solid rgba(122, 167, 255, 0.16);
  border-bottom: 1px solid rgba(122, 167, 255, 0.26);
  background: #1b1f29;
  box-shadow: inset 0 -1px 0 rgba(242, 244, 248, 0.06);
}

.message-list-item.is-newly-synced {
  animation: message-list-reveal 420ms ease-out both;
}

@keyframes message-list-reveal {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

@media (prefers-reduced-motion: reduce) {
  .message-list-item.is-newly-synced {
    animation: none;
  }
}

.message-list-item:hover {
  background: #202634;
}

.message-list-item.message-sender-risk-malicious {
  border-left: 3px solid rgba(239, 122, 115, 0.92);
  background: rgba(70, 34, 38, 0.72);
}

.message-list-item.message-sender-risk-malicious:hover {
  background: rgba(82, 39, 44, 0.82);
}

.message-list-item.message-sender-risk-malicious .message-subject-button,
.message-list-item.message-sender-risk-malicious .message-preview,
.message-list-item.message-sender-risk-malicious .message-received-cell {
  color: #ffd7d4;
}

.message-list-item.message-sender-risk-malicious .message-folder-pill {
  border-color: rgba(239, 122, 115, 0.46);
  color: #ffd7d4;
}

.message-list-item.message-sender-risk-high {
  border-left: 3px solid rgba(228, 189, 79, 0.9);
  background: rgba(66, 55, 31, 0.72);
}

.message-list-item.message-sender-risk-high:hover {
  background: rgba(76, 64, 37, 0.82);
}

.message-list-item.message-sender-risk-high .message-subject-button,
.message-list-item.message-sender-risk-high .message-preview,
.message-list-item.message-sender-risk-high .message-received-cell {
  color: #ffe7a3;
}

.message-list-item.message-sender-risk-high .message-folder-pill {
  border-color: rgba(228, 189, 79, 0.46);
  color: #ffe7a3;
}

.message-list-item.message-sender-risk-trusted {
  border-left: 3px solid rgba(121, 210, 121, 0.76);
  background: rgba(31, 58, 43, 0.62);
}

.message-list-item.message-sender-risk-trusted:hover {
  background: rgba(37, 68, 50, 0.72);
}

.message-list-item.message-sender-risk-trusted .message-subject-button,
.message-list-item.message-sender-risk-trusted .message-preview,
.message-list-item.message-sender-risk-trusted .message-received-cell {
  color: #c9f6c9;
}

.message-list-item.message-sender-risk-trusted .message-folder-pill {
  border-color: rgba(121, 210, 121, 0.4);
  color: #c9f6c9;
}

.message-sender-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-list-item.is-unread .message-subject-button,
.message-list-item.is-unread .message-sender-cell {
  font-weight: 750;
}

.message-list-item.is-read,
.message-list-item.is-read * {
  font-weight: 400;
}

.message-select-cell {
  grid-area: select;
}

.message-important-toggle {
  grid-area: important;
  justify-self: center;
}

.message-attachment-indicator {
  grid-area: attachment;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 32px;
  justify-self: center;
  color: var(--muted);
}

.message-attachment-indicator svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.message-list-main {
  grid-area: main;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.message-list-sender-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.message-list-status-icons {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  min-width: 0;
}

.message-thread-count {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  margin-left: 7px;
  padding: 0 5px;
  border: 1px solid rgba(122, 167, 255, 0.36);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 1px;
}

.message-preview {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-list-meta {
  grid-area: meta;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  padding-right: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
}

.message-received-cell {
  display: grid;
  justify-items: center;
  gap: 1px;
  width: 100%;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
}

.message-folder-pill {
  max-width: 100%;
  border: 1px solid rgba(122, 167, 255, 0.22);
  border-radius: 999px;
  color: var(--muted);
  padding: 2px 8px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-list-status-icons .message-folder-pill {
  max-width: 96px;
  flex: 0 1 auto;
}

.message-actions-cell {
  grid-area: actions;
  height: auto;
  min-width: 0;
  overflow: visible;
  white-space: normal;
  justify-self: end;
  padding-right: 16px;
}

.message-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  min-width: 0;
}

@container message-list (max-width: 900px) {
  .message-list-item {
    grid-template-columns: 42px 42px 24px minmax(0, 1fr) minmax(96px, 108px);
    grid-template-areas:
      "select important attachment main meta"
      ". . . actions actions";
    row-gap: 6px;
  }

  .message-select-cell {
    grid-area: select;
  }

  .message-important-toggle {
    grid-area: important;
  }

  .message-list-main {
    grid-area: main;
  }

  .message-list-meta {
    grid-area: meta;
  }

  .message-actions-cell {
    grid-area: actions;
    justify-self: stretch;
  }

  .message-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    width: 100%;
  }
}

@container message-list (max-width: 600px) {
  .message-list-item {
    grid-template-columns: 42px 42px 24px minmax(0, 1fr);
    grid-template-areas:
      "select important attachment main"
      ". . . meta"
      "actions actions actions actions";
  }

  .message-actions-cell {
    padding-left: 10px;
  }
}

.message-table {
  min-width: 0;
}

.message-table th,
.message-table td {
  min-width: 0;
}

.message-col-select {
  width: 40px;
}

.message-select-heading,
.message-select-cell {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  padding-right: 6px;
  padding-left: 10px;
  text-align: center;
}

.message-select-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
}

.message-col-from {
  width: 18%;
}

.message-col-subject {
  width: 28%;
}

.message-col-folder {
  width: 8%;
}

.message-col-read {
  width: 36px;
}

.message-col-flag {
  width: 36px;
}

.message-status-heading,
.message-status-cell {
  width: 36px;
  padding-right: 4px;
  padding-left: 4px;
  font-size: 0;
  line-height: 1;
  text-align: center;
}

.message-status-heading svg,
.message-read-status svg,
.message-replied-status svg,
.message-flag-status svg {
  display: block;
  width: 16px;
  height: 16px;
  margin: 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-read-status,
.message-replied-status,
.message-flag-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.message-replied-status {
  color: #8fc5ff;
}

.message-read-status.is-read {
  color: var(--teal);
}

.message-read-status.is-unread {
  color: var(--text);
}

.message-flag-status.is-flagged {
  color: var(--amber);
}

.message-flag-status.is-unflagged {
  color: var(--muted);
}

.message-col-labels {
  width: 10%;
}

.message-label-cell {
  min-width: 0;
}

.message-label-content {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
}

.message-label-empty {
  color: var(--muted);
}

.message-label-icon,
.message-ai-analysis-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.message-label-icon {
  color: var(--blue);
}

.message-ai-analysis-icon {
  color: var(--text);
}

.message-ai-analysis-icon.is-analyzing {
  animation: message-analysis-pulse 0.9s ease-in-out infinite;
  color: var(--text);
}

.message-ai-analysis-icon.message-ai-risk-malicious {
  color: var(--red);
}

.message-ai-analysis-icon.message-ai-risk-high {
  color: var(--amber);
}

.message-ai-analysis-icon.message-ai-risk-trusted {
  color: var(--green);
}

@keyframes message-analysis-pulse {
  0%, 100% {
    opacity: 0.35;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.message-label-icon svg,
.message-ai-analysis-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-col-received {
  width: 232px;
}

td.message-received-cell {
  overflow: visible;
  text-overflow: clip;
}

.message-col-action {
  width: 184px;
}

.message-subject-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font: inherit;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.message-subject-button:hover,
.message-subject-button:focus-visible {
  color: var(--teal);
  text-decoration: underline;
  outline: none;
}

.message-sender-risk-malicious {
  color: #ff9b96;
  font-weight: 700;
}

td.message-sender-risk-malicious {
  background: rgba(239, 122, 115, 0.12);
}

.message-sender-risk-high {
  color: var(--amber);
  font-weight: 700;
}

td.message-sender-risk-high {
  background: rgba(228, 189, 79, 0.1);
}

.message-sender-risk-trusted {
  color: var(--green);
  font-weight: 700;
}

td.message-sender-risk-trusted {
  background: rgba(121, 210, 121, 0.1);
}

.message-actions .button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 13px;
}

.attachment-action-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.attachment-action-cell .button {
  flex: 0 0 32px;
}

.message-detail-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(5, 7, 12, 0.76);
  backdrop-filter: blur(12px);
}

.message-detail-panel[hidden] {
  display: none;
}

.attachment-content-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(5, 7, 12, 0.76);
  backdrop-filter: blur(12px);
}

.attachment-content-panel[hidden] {
  display: none;
}

.attachment-content-dialog {
  position: relative;
  width: min(1120px, calc(100vw - 24px));
  height: min(820px, calc(100vh - 24px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(122, 167, 255, 0.26);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 36, 48, 0.98), rgba(15, 18, 27, 0.98));
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(73, 213, 189, 0.12) inset;
  overflow: hidden;
}

.attachment-content-heading {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.attachment-content-heading h3 {
  font-size: 18px;
  margin: 0 0 8px;
}

.attachment-content-meta,
.attachment-content-warning {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.attachment-content-warning {
  padding: 10px 12px;
  border: 1px solid rgba(228, 189, 79, 0.5);
  border-radius: 8px;
  background: rgba(44, 39, 22, 0.76);
  color: #fff4c7;
}

.attachment-content-text {
  min-height: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(52, 58, 70, 0.9);
  border-radius: 8px;
  background: rgba(12, 14, 20, 0.86);
  color: var(--text);
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: var(--attachment-content-font-size, 13px)/1.5 "Cascadia Mono", Consolas, monospace;
}

.attachment-content-image-frame {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  border: 1px solid rgba(52, 58, 70, 0.9);
  border-radius: 8px;
  background: rgba(12, 14, 20, 0.86);
}

.attachment-content-image-frame[hidden] {
  display: none;
}

.attachment-content-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.attachment-content-pdf-frame {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(52, 58, 70, 0.9);
  border-radius: 8px;
  background: #202124;
}

.attachment-content-pdf-frame[hidden] {
  display: none;
}

.attachment-pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(52, 58, 70, 0.9);
  background: #17191f;
}

.attachment-pdf-navigation-button {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex: 0 0 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.attachment-pdf-navigation-button > svg {
  width: 16px;
  height: 16px;
}

.attachment-pdf-page-status {
  min-width: 104px;
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

.attachment-pdf-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: start center;
  padding: 16px;
  overflow: auto;
  background: #2c2f36;
}

.attachment-pdf-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #ffffff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.attachment-content-font-controls {
  position: absolute;
  right: 30px;
  bottom: 30px;
  z-index: 2;
  margin-left: 0;
}

.message-detail-dialog {
  width: min(90vw, calc(100vw - 24px));
  height: min(1040px, calc(100vh - 24px));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(122, 167, 255, 0.26);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 36, 48, 0.98), rgba(15, 18, 27, 0.98));
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(73, 213, 189, 0.12) inset;
  overflow: hidden;
}

@media (max-width: 720px) {
  .message-detail-panel {
    padding: 0;
  }

  .message-detail-dialog {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .message-detail-toolbar,
  .message-detail-tool-group {
    min-width: 0;
    max-width: 100%;
  }

  .message-detail-tool-group {
    flex-wrap: wrap;
  }

  .message-detail-tool-group + .message-detail-tool-group {
    padding-left: 0;
    border-left: 0;
  }

  .message-routing-controls input {
    flex: 1 1 180px;
    width: auto;
    min-width: 0;
  }
}

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

.message-detail-identity {
  display: flex;
  flex: 1 1 auto;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.message-detail-avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 999px;
  background: #284358;
  color: #d8eef8;
  font-size: 12px;
  font-weight: 800;
}

.message-detail-heading-copy {
  min-width: 0;
}

.message-detail-heading h3 {
  font-size: 18px;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.message-detail-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
}

.message-detail-meta strong {
  color: var(--text);
}

.message-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(52, 58, 70, 0.9);
  border-radius: 8px;
  background: rgba(18, 20, 26, 0.72);
}

.message-detail-tool-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.message-detail-tool-group + .message-detail-tool-group {
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

.message-detail-action-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.message-detail-action-status.is-busy {
  color: #fff4c7;
  animation: message-detail-status-pulse 0.9s ease-in-out infinite;
}

@keyframes message-detail-status-pulse {
  0%, 100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

.message-analysis-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.message-analysis-controls select {
  width: min(260px, 100%);
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
}

.message-analysis-controls select[aria-current="true"] {
  border-color: rgba(73, 213, 189, 0.72);
  box-shadow: 0 0 0 1px rgba(73, 213, 189, 0.24);
}

.message-routing-controls {
  min-width: min(100%, 360px);
}

.message-routing-controls input {
  width: min(220px, 42vw);
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
}

.message-detail-apply-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.message-detail-apply-all input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.message-routing-panel {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(5, 7, 12, 0.76);
  backdrop-filter: blur(12px);
}

.message-routing-panel[hidden] {
  display: none;
}

.message-subject-match-panel {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(5, 7, 12, 0.76);
  backdrop-filter: blur(12px);
}

.message-subject-match-panel[hidden] {
  display: none;
}

.message-subject-match-dialog {
  width: min(620px, calc(100vw - 24px));
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(122, 167, 255, 0.26);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 36, 48, 0.98), rgba(15, 18, 27, 0.98));
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(73, 213, 189, 0.12) inset;
}

.message-subject-match-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.message-subject-match-field input {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 5px 8px;
  font: inherit;
}

.message-subject-match-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.message-subject-match-help code {
  color: var(--text);
  padding: 1px 4px;
  border: 1px solid rgba(52, 58, 70, 0.9);
  border-radius: 4px;
  background: rgba(12, 14, 20, 0.68);
}

.message-subject-match-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.message-routing-dialog {
  width: min(1180px, calc(100vw - 24px));
  max-height: min(760px, calc(100vh - 24px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(122, 167, 255, 0.26);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 36, 48, 0.98), rgba(15, 18, 27, 0.98));
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(73, 213, 189, 0.12) inset;
  overflow: hidden;
}

.message-routing-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-routing-heading h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.message-routing-status,
.message-routing-preview {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.message-routing-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  align-items: center;
}

.message-routing-form input,
.message-routing-form select {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
}

.message-routing-form select {
  width: 100%;
}

.message-routing-form select[multiple] {
  min-height: 82px;
  padding: 6px 8px;
}

.message-routing-form select option {
  background: #12141a;
  color: var(--text);
}

.message-routing-form input:disabled,
.message-routing-form select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.message-routing-label-select {
  grid-row: span 2;
}

.message-routing-form .message-test-toggle {
  width: 100%;
  min-height: 38px;
  justify-self: stretch;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  gap: 8px;
}

.message-routing-form .message-test-toggle span {
  line-height: 1;
}

.message-routing-form .message-test-toggle input {
  flex: 0 0 56px;
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 999px;
}

.message-routing-form .message-test-toggle input::before {
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
}

.message-routing-form .message-test-toggle input:checked::before {
  transform: translateX(24px);
}

.message-routing-table {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow: auto;
}

.message-routing-row {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(160px, 1.2fr) minmax(220px, 2fr) minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(52, 58, 70, 0.9);
  border-radius: 8px;
  background: rgba(13, 15, 20, 0.84);
  font-size: 12px;
}

.message-routing-row-toggle {
  justify-self: start;
}

.message-routing-row strong,
.message-routing-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-routing-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .message-routing-panel {
    padding: 0;
  }

  .message-routing-dialog {
    width: 100vw;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }

  .message-routing-row {
    grid-template-columns: 1fr;
  }

  .message-routing-actions {
    justify-content: flex-start;
  }
}

.message-batch-analysis-status {
  max-width: 320px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
}

.message-detail-risk-banner {
  grid-row: 3;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(228, 189, 79, 0.78);
  border-radius: 8px;
  background: rgba(44, 39, 22, 0.96);
  color: #fff4c7;
  box-shadow: 0 0 0 1px rgba(228, 189, 79, 0.14) inset, 0 14px 34px rgba(0, 0, 0, 0.32);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.message-detail-risk-banner[hidden] {
  display: none;
}

.message-detail-risk-banner.high {
  border-color: rgba(239, 122, 115, 0.86);
  background: rgba(55, 25, 24, 0.96);
  color: #fff0ee;
  box-shadow: 0 0 0 1px rgba(239, 122, 115, 0.2) inset, 0 14px 38px rgba(95, 26, 22, 0.34);
}

.message-detail-risk-banner.moderate {
  border-color: rgba(228, 189, 79, 0.78);
}

.message-detail-risk-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-weight: 800;
}

.message-detail-risk-copy {
  min-width: 0;
}

.message-detail-risk-title {
  color: var(--text);
  font-weight: 800;
}

.message-detail-risk-message {
  margin-top: 2px;
  color: inherit;
}

.message-detail-content-workspace {
  --message-reply-panel-width: 420px;
  --message-local-chat-panel-width: 420px;
  grid-row: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.message-detail-content-workspace.reply-open {
  grid-template-columns: minmax(280px, 1fr) var(--message-reply-panel-width);
}

.message-detail-content-workspace.chat-open {
  grid-template-columns: minmax(280px, 1fr) var(--message-local-chat-panel-width);
}

.message-detail-body-frame {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.message-local-chat-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #12141a;
}

.message-local-chat-panel[hidden] {
  display: none;
}

.message-reply-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #12141a;
  overflow: hidden;
}

.message-reply-panel[hidden] {
  display: none;
}

.message-side-panel-resize-handle {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: -8px;
  width: 15px;
  cursor: col-resize;
  touch-action: none;
}
.junk-panel {
  align-content: start;
  display: grid;
  flex: 1 1 auto;
  gap: 18px;
  grid-auto-rows: max-content;
  min-height: 0;
  overflow-y: auto;
}
.junk-panel[hidden] {
  display: none;
}
.junk-panel > .content-band {
  margin-bottom: 0;
}
.junk-heading,
.junk-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.junk-heading {
  margin-bottom: 18px;
  padding: 16px 16px 0;
  border-bottom: 0;
}
.junk-heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}
.junk-heading h3,
.junk-heading p,
.junk-panel .section-heading h3,
.junk-panel .section-heading p {
  margin: 0;
}
.junk-heading p,
.junk-panel .section-heading p,
.junk-setting-row small,
.junk-learning-state {
  color: var(--muted);
}
.junk-heading p,
.junk-panel .section-heading p {
  margin-top: 4px;
  font-size: 13px;
}
.junk-summary-grid {
  grid-auto-columns: minmax(150px, 1fr);
}
.junk-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr);
  gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.junk-settings-form,
.junk-marking-workflow {
  min-width: 0;
}
.junk-marking-workflow {
  border-left: 1px solid var(--border);
  padding-left: 28px;
}
.junk-learning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}
.junk-learning-actions .button {
  display: inline-flex;
  margin: 0;
}
.junk-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 70px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.junk-setting-row > span:first-child {
  display: grid;
  gap: 5px;
}
.junk-setting-row small {
  font-size: 12px;
  line-height: 1.45;
}
.junk-setting-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.junk-threshold-control {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 44px;
  align-items: center;
  gap: 10px;
}
.junk-threshold-control input {
  width: 100%;
  accent-color: var(--accent);
}
.junk-threshold-control output {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.junk-auto-move-setting small {
  color: var(--warning);
}
.junk-settings-actions {
  min-height: 58px;
  padding-top: 14px;
}
.junk-settings-actions .form-status {
  margin: 0;
}
.junk-learning-state {
  font-size: 13px;
  line-height: 1.5;
}
.junk-evidence-preview {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.junk-evidence-preview[hidden] {
  display: none;
}
.junk-evidence-preview-list {
  display: grid;
}
.junk-evidence-preview-item {
  display: grid;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.junk-evidence-preview-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.junk-evidence-preview-heading strong,
.junk-evidence-preview-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.junk-evidence-preview-heading strong {
  min-width: 0;
  font-size: 13px;
}
.junk-evidence-preview-subject {
  color: var(--text);
  font-size: 12px;
}
.junk-evidence-preview-meta,
.junk-evidence-preview-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.junk-feedback-section {
  padding-top: 0;
}
.junk-feedback-section .section-heading {
  margin-bottom: 12px;
}
.junk-label-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 0 16px 14px;
  border-bottom: 1px solid var(--border);
}
.junk-label-tabs .tab-button {
  min-width: 96px;
}
.junk-label-panel {
  padding-top: 14px;
}
.junk-feedback-section .table-frame {
  overflow-x: auto;
}
.junk-feedback-section table {
  table-layout: auto;
}
.junk-feedback-section table :is(th, td):nth-child(-n + 2) {
  width: 1%;
}
.junk-feedback-section table td:nth-child(n + 3):nth-child(-n + 5) {
  max-width: 0;
}
.junk-feedback-section table :is(th, td):last-child {
  width: 1%;
}
.junk-automatic-labels-table :is(th, td):is(:nth-child(1), :nth-child(2), :nth-child(5), :nth-child(6)) {
  width: 1%;
}
.junk-automatic-labels-table td:is(:nth-child(3), :nth-child(4), :nth-child(7)) {
  max-width: 0;
}
.junk-feedback-section .junk-automatic-labels-table :is(th, td):nth-child(5) {
  min-width: 104px;
  max-width: none;
}
.junk-feedback-section .junk-automatic-labels-table :is(th, td):nth-child(7) {
  width: auto;
}
.junk-feedback-actions {
  padding-top: 5px;
  padding-bottom: 5px;
  overflow: visible;
}
.junk-feedback-row.is-clickable {
  cursor: pointer;
}
.junk-feedback-row.is-clickable:hover > td:not(.junk-feedback-actions) {
  background: rgba(55, 201, 190, 0.06);
}
.junk-message-detail-button:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.junk-feedback-action-buttons {
  display: flex;
  gap: 6px;
  width: max-content;
}
.junk-feedback-filter-form,
.junk-automatic-labels-filter-form {
  align-items: center;
  grid-template-columns: minmax(260px, 420px) minmax(140px, 180px) 38px 38px;
  justify-content: start;
  margin-bottom: 14px;
}
#junkFeedbackLabelFilter {
  min-height: 38px;
  height: 38px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}
#junkAutomaticLabelsLabelFilter {
  min-height: 38px;
  height: 38px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}
.junk-feedback-filter-button,
.junk-feedback-pagination-button {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  width: 38px;
  min-width: 38px;
  padding: 8px;
}
.junk-feedback-filter-button svg,
.junk-feedback-pagination-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.junk-feedback-page-size {
  min-height: 38px;
  width: 140px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12141a;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}
.junk-feedback-label {
  display: inline-block;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border));
  border-radius: 4px;
  padding: 3px 7px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.junk-feedback-label.not-junk {
  border-color: color-mix(in srgb, var(--success) 45%, var(--border));
  color: var(--success);
}
.junk-automatic-label {
  display: inline-block;
  border: 1px solid color-mix(in srgb, var(--teal) 48%, var(--border));
  border-radius: 4px;
  padding: 3px 7px;
  color: #70d8c6;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.junk-automatic-label.is-spam {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--border));
  color: var(--danger);
}
.junk-automatic-confidence {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .junk-workspace {
    grid-template-columns: 1fr;
  }
  .junk-marking-workflow {
    border-top: 1px solid var(--border);
    border-left: 0;
    padding-top: 22px;
    padding-left: 0;
  }
}
@media (max-width: 640px) {
  .junk-heading,
  .junk-settings-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .junk-heading-actions {
    width: 100%;
  }
  .junk-heading-actions .button {
    flex: 1 1 auto;
  }
  .junk-setting-row,
  .junk-setting-range {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }
  .junk-threshold-control {
    grid-template-columns: minmax(0, 1fr) 44px;
  }
  .junk-feedback-filter-form,
  .junk-automatic-labels-filter-form {
    grid-template-columns: minmax(0, 1fr) 38px 38px;
  }
  #junkFeedbackQuickFilter,
  #junkFeedbackLabelFilter,
  #junkAutomaticLabelsQuickFilter,
  #junkAutomaticLabelsLabelFilter {
    grid-column: 1 / -1;
  }
}

.message-side-panel-resize-handle::after {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 7px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  content: "";
  transition: background 120ms ease;
}

.message-side-panel-resize-handle:hover::after,
.message-side-panel-resize-handle:focus-visible::after,
.message-side-panel-resize-handle.is-resizing::after {
  background: var(--teal);
}

.message-side-panel-resize-handle:focus-visible {
  outline: 0;
}

.message-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(31, 36, 48, 0.88);
}

.message-reply-form {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(140px, 1fr) auto auto;
  min-height: 0;
}

.message-reply-field {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(52, 58, 70, 0.78);
  color: var(--muted);
  font-size: 12px;
}

.message-reply-field input,
.message-reply-field select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: 0;
}

.message-reply-field select {
  color-scheme: dark;
  background: var(--panel);
}

.message-reply-field select option {
  background: var(--panel-strong);
  color: var(--text);
}

.message-reply-field input:focus,
.message-reply-field select:focus {
  box-shadow: inset 0 -1px 0 var(--teal);
}

.message-reply-format-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  overflow-x: hidden;
}

.message-reply-format-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  font-size: 13px;
}

.message-reply-format-spacer {
  display: none;
}

.message-reply-ai-model {
  flex: 1 1 72px;
  width: auto;
  min-width: 72px;
  max-width: 150px;
  height: 30px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(8, 10, 15, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.message-reply-ai-button {
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
}

.message-reply-ai-button[aria-busy="true"] {
  border-color: rgba(73, 213, 189, 0.72);
  color: #d8fff8;
  animation: message-detail-status-pulse 0.9s ease-in-out infinite;
}

.message-reply-editor {
  min-width: 0;
  min-height: 140px;
  padding: 14px;
  background: rgba(8, 10, 15, 0.78);
  color: var(--text);
  font-family: "Segoe UI", Inter, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  overflow: auto;
  outline: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-reply-editor:focus {
  box-shadow: inset 0 0 0 1px rgba(73, 213, 189, 0.58);
}

.message-reply-editor.is-dragover {
  background: rgba(35, 78, 76, 0.72);
  box-shadow: inset 0 0 0 2px var(--teal);
}

.message-reply-editor:empty::before {
  color: var(--muted);
  content: attr(data-placeholder);
  pointer-events: none;
}

.message-reply-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 8px 10px 8px 12px;
  border-top: 1px solid var(--border);
  background: rgba(31, 36, 48, 0.72);
}

.message-reply-status {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.message-reply-status.busy {
  color: #fff4c7;
  animation: message-detail-status-pulse 0.9s ease-in-out infinite;
}

.message-reply-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 112px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: rgba(8, 10, 15, 0.72);
  overflow: auto;
}

.message-reply-attachment-list[hidden] {
  display: none;
}

.message-reply-attachment {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 30px;
  padding: 2px 3px 2px 8px;
  border: 1px solid rgba(122, 167, 255, 0.28);
  border-radius: 6px;
  background: #1b1f29;
  color: var(--text);
  font-size: 11px;
}

.message-reply-attachment > svg,
.message-reply-attachment-remove svg,
.message-reply-attachment-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-reply-attachment-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-reply-attachment-size {
  color: var(--muted);
  white-space: nowrap;
}

.message-reply-attachment-remove {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
}

.message-reply-footer-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.message-reply-attachment-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
}

.message-reply-send {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 12px;
}

.message-reply-send svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#messageDetailReplyToggle[aria-expanded="true"] {
  border-color: rgba(73, 213, 189, 0.72);
  background: rgba(73, 213, 189, 0.18);
  color: #d8fff8;
}

.message-local-chat-header,
.message-local-chat-tools,
.message-local-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-local-chat-header {
  justify-content: space-between;
}

.message-local-chat-panel select,
.message-local-chat-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(8, 10, 15, 0.92);
  color: var(--text);
}

.message-local-chat-panel select {
  min-height: 36px;
  padding: 6px 8px;
}

.message-local-chat-preset-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.message-local-chat-quick-prompt,
.message-local-chat-canned-response {
  font-size: 12px;
}

.message-chat-settings-subtab-panel[hidden] {
  display: none;
}

.message-chat-settings-subtab-panel {
  padding-top: 16px;
}

.message-chat-preset-form {
  margin-bottom: 16px;
}

.message-chat-preset-content-field,
.message-chat-preset-form-actions {
  grid-column: 1 / -1;
}

.message-chat-preset-content-field textarea {
  min-height: 112px;
  resize: vertical;
}

.message-chat-preset-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.message-chat-preset-form-actions .inline-status {
  margin-right: auto;
}

.message-chat-preset-table {
  table-layout: fixed;
}

.message-chat-preset-table th:first-child,
.message-chat-preset-table td:first-child {
  width: 76px;
}

.message-chat-preset-table th:nth-last-child(2),
.message-chat-preset-table td:nth-last-child(2) {
  width: 96px;
}

.message-chat-preset-table th:last-child,
.message-chat-preset-table td:last-child {
  width: 104px;
}

.message-chat-preset-content {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.trusted-domain-heading {
  margin-bottom: 12px;
}

.trusted-domain-form {
  grid-template-columns: minmax(240px, 1fr) auto;
  margin-bottom: 16px;
}

.trusted-domain-form-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.trusted-domain-form-actions .inline-status {
  margin-right: auto;
}

.trusted-domain-table {
  table-layout: fixed;
}

.trusted-domain-table th:nth-child(2),
.trusted-domain-table td:nth-child(2),
.trusted-domain-table th:nth-child(3),
.trusted-domain-table td:nth-child(3) {
  width: 132px;
}

.trusted-domain-table th:nth-child(4),
.trusted-domain-table td:nth-child(4) {
  width: 196px;
}

.trusted-domain-table th:last-child,
.trusted-domain-table td:last-child {
  width: 104px;
}

.trusted-domain-value {
  overflow-wrap: anywhere;
}

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

  .message-chat-settings-subtab-panel .table-frame {
    overflow-x: auto;
  }
}

.message-local-chat-transcript {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  overflow: auto;
  padding-right: 3px;
}

.message-local-chat-turn {
  max-width: 92%;
  padding: 9px 10px;
  border: 1px solid rgba(122, 167, 255, 0.2);
  border-radius: 6px;
  background: rgba(31, 36, 48, 0.88);
  font-size: var(--message-body-font-size, 14px);
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-local-chat-turn-row {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.message-local-chat-turn-row.user {
  align-self: flex-end;
  justify-content: flex-end;
}

.message-local-chat-turn-group.user {
  display: flex;
  flex-direction: column;
  align-self: flex-end;
  align-items: flex-end;
  gap: 3px;
  max-width: 100%;
}

.message-local-chat-response {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 92%;
}

.message-local-chat-response .message-local-chat-turn {
  max-width: 100%;
}

.message-local-chat-metrics {
  padding: 0 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.message-local-chat-turn.user {
  border-color: rgba(73, 213, 189, 0.32);
  background: rgba(24, 68, 65, 0.58);
}

.message-local-chat-retry {
  display: inline-flex;
  flex: 0 0 26px;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(73, 213, 189, 0.24);
  border-radius: 4px;
  background: rgba(8, 10, 15, 0.72);
  color: var(--muted);
  cursor: pointer;
}

.message-local-chat-retry:hover,
.message-local-chat-retry:focus-visible {
  border-color: rgba(73, 213, 189, 0.58);
  color: var(--text);
}

.message-local-chat-retry:disabled {
  cursor: wait;
  opacity: 0.45;
}

.message-local-chat-retry svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-local-chat-form {
  align-items: flex-end;
}

.message-local-chat-form textarea {
  min-height: 66px;
  max-height: 150px;
  resize: vertical;
  padding: 8px;
  font: inherit;
  font-size: var(--message-body-font-size, 14px);
}

.message-local-chat-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.message-local-chat-turn-group.user .message-local-chat-status {
  max-width: 92%;
  padding: 0 2px;
  text-align: right;
  overflow-wrap: anywhere;
}

.message-local-chat-status.busy {
  animation: message-detail-status-pulse 1s ease-in-out infinite;
}

@media (max-width: 720px) {
  .message-detail-content-workspace.chat-open,
  .message-detail-content-workspace.reply-open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .message-detail-content-workspace.chat-open .message-detail-body-frame,
  .message-detail-content-workspace.reply-open .message-detail-body-frame {
    display: none;
  }

  .message-side-panel-resize-handle {
    display: none;
  }
}

.message-detail-body {
  background: #12141a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: "Segoe UI", Inter, sans-serif;
  font-size: var(--message-body-font-size, 14px);
  line-height: 1.65;
  height: 100%;
  margin: 0;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  overflow-wrap: anywhere;
}

.message-detail-body table {
  width: auto;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.message-detail-body > table {
  width: 100%;
}

.message-detail-body td > table {
  display: inline-table;
  vertical-align: top;
}

.message-detail-body > table,
.message-detail-body > table > tbody > tr > td > table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

.message-detail-body > table > tbody > tr > td > table {
  display: table;
  margin-left: auto;
  margin-right: auto;
}

.message-detail-body th,
.message-detail-body td {
  height: auto;
  padding: 2px 4px;
  border: 0;
  color: inherit;
  font-size: inherit;
  text-align: inherit;
  text-transform: none;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: normal;
  overflow: visible;
  text-overflow: clip;
}

.message-detail-body td[style*="width:1%"] {
  white-space: nowrap;
  overflow-wrap: normal;
}

.message-detail-body[data-reading-theme="light"] {
  background: #ffffff;
  border-color: #c9d0da;
  color: #17191f;
  color-scheme: light;
}

.message-thread {
  display: grid;
  gap: 8px;
}

.message-thread-item {
  min-width: 0;
  border: 1px solid rgba(122, 167, 255, 0.24);
  border-radius: 6px;
  background: #171b24;
  overflow: hidden;
}

.message-thread-item[open] {
  border-color: rgba(73, 213, 189, 0.42);
  background: #12161d;
}

.message-thread-item summary {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(120px, 0.4fr) minmax(160px, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 8px 12px;
  cursor: pointer;
  list-style-position: inside;
}

.message-thread-item summary:hover {
  background: rgba(122, 167, 255, 0.07);
}

.message-thread-sender,
.message-thread-preview,
.message-thread-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-thread-sender {
  font-weight: 700;
}

.message-thread-preview,
.message-thread-meta {
  color: var(--muted);
  font-size: 12px;
}

.message-thread-meta {
  text-align: left;
}

.message-thread-body {
  padding: 14px;
  border-top: 1px solid rgba(122, 167, 255, 0.18);
  background: #0f1218;
}

.message-detail-body[data-reading-theme="light"] .message-thread-item {
  border-color: #c9d0da;
  background: #f4f6f8;
}

.message-detail-body[data-reading-theme="light"] .message-thread-item[open],
.message-detail-body[data-reading-theme="light"] .message-thread-body {
  border-color: #d9dee6;
  background: #ffffff;
}

.message-detail-body[data-reading-theme="light"] .message-thread-item summary:hover {
  background: #edf2f7;
}

.message-detail-body[data-reading-theme="light"] .message-thread-preview,
.message-detail-body[data-reading-theme="light"] .message-thread-meta {
  color: #596273;
}

@media (max-width: 720px) {
  .message-thread-item summary {
    grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  }

  .message-thread-preview {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.message-body-image {
  display: block;
  max-width: min(100%, 520px);
  max-height: 420px;
  margin: 8px 0;
  border: 1px solid rgba(52, 58, 70, 0.95);
  border-radius: 6px;
  background: #0b0d12;
  object-fit: contain;
}

.message-detail-body[data-reading-theme="light"] .message-body-image {
  border-color: #c9d0da;
  background: #f4f6f8;
}

.message-body-image-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  border-radius: 6px;
}

.message-body-image-link:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.message-body-font-controls {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  border: 1px solid rgba(52, 58, 70, 0.95);
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.92);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36);
  padding: 4px;
}

.message-body-font-button {
  min-height: 28px;
  width: 28px;
  padding: 2px 0;
  border-radius: 999px;
  font-size: 16px;
  line-height: 1;
}

.message-body-font-size {
  min-width: 38px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.message-detail-body p {
  margin: 0 0 12px;
}

.message-detail-body a {
  color: var(--teal);
  overflow-wrap: anywhere;
}

.message-detail-body[data-reading-theme="light"] a,
.message-detail-body[data-reading-theme="light"] .message-body-link {
  color: #006b5f;
}

.message-detail-body[data-reading-theme="light"] .message-body-link:hover,
.message-detail-body[data-reading-theme="light"] .message-body-link:focus-visible {
  color: #004d45;
}

.message-body-link {
  color: #8de8d8;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.message-body-link:hover,
.message-body-link:focus-visible {
  color: #c3fff4;
}

.message-body-link-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(73, 213, 189, 0.42);
  border-radius: 4px;
  background: rgba(73, 213, 189, 0.1);
  text-decoration: none;
  vertical-align: middle;
}

.message-body-link-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-url-safety {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 1px 6px;
  border: 1px solid rgba(228, 189, 79, 0.42);
  border-radius: 6px;
  background: rgba(228, 189, 79, 0.12);
  color: #fff4c7;
  vertical-align: baseline;
}

.message-url-safety svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-url-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.message-url-safety-safe {
  border-color: rgba(121, 210, 121, 0.62);
  background: rgba(121, 210, 121, 0.14);
  color: #d8ffd8;
}

.message-url-safety-unsafe {
  border-color: rgba(235, 87, 87, 0.68);
  background: rgba(235, 87, 87, 0.14);
  color: #ffd8d8;
}

.message-markdown-quote {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 3px solid rgba(73, 213, 189, 0.62);
  border-radius: 6px;
  background: rgba(18, 20, 26, 0.58);
  color: var(--muted);
}

.message-markdown-list {
  margin: 0 0 12px;
  padding-left: 24px;
}

.message-markdown-list li + li {
  margin-top: 4px;
}

.message-markdown-image-placeholder {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 7px;
  border: 1px solid rgba(122, 167, 255, 0.28);
  border-radius: 999px;
  background: rgba(37, 41, 54, 0.72);
  color: var(--muted);
  font-size: 0.9em;
}

.message-html-blocked-placeholder {
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.38);
  border-radius: 6px;
  color: #ffd166;
  display: inline-block;
  font-size: 0.88em;
  font-weight: 650;
  margin: 0 0.2rem;
  padding: 0.08rem 0.35rem;
  vertical-align: baseline;
}

.message-detail-body[data-reading-theme="light"] .message-url-safety {
  border-color: #b58a16;
  background: #fff7dc;
  color: #6b4f00;
}

.message-detail-body[data-reading-theme="light"] .message-url-safety-safe {
  border-color: #6fa778;
  background: #edf7ed;
  color: #185c24;
}

.message-detail-body[data-reading-theme="light"] .message-url-safety-unsafe {
  border-color: #cf7777;
  background: #fdeeee;
  color: #9d1c1c;
}

.message-detail-body[data-reading-theme="light"] .message-markdown-quote {
  border-left-color: #168578;
  background: #f3f6f8;
  color: #3f4856;
}

.message-detail-body[data-reading-theme="light"] .message-markdown-image-placeholder {
  border-color: #aeb8c7;
  background: #eef2f7;
  color: #3f4856;
}

.message-detail-body[data-reading-theme="light"] .message-html-blocked-placeholder {
  border-color: #b58a16;
  background: #fff7dc;
  color: #6b4f00;
}

.message-detail-body p:last-child {
  margin-bottom: 0;
}

.message-detail-attachment-row {
  grid-row: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.message-detail-attachments {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  max-height: 150px;
  overflow: auto;
}

.message-detail-attachments ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.message-detail-attachments li {
  margin-bottom: 6px;
}

.attachment-filename-link {
  appearance: none;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-filename-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.attachment-files-cell,
.attachment-types-cell,
.attachment-actions-cell {
  white-space: nowrap;
  overflow: hidden;
  overflow-wrap: normal;
}

#attachments > .table-frame {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

#attachments > .table-frame table {
  min-width: 760px;
}

.attachment-file-list,
.attachment-type-list,
.attachment-action-stack {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.attachment-type-list > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-file-item,
.attachment-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.attachment-file-item .attachment-filename-link,
.attachment-file-item .attachment-filename-blocked,
.attachment-action-file {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-file-meta,
.attachment-action-file {
  color: var(--muted);
  font-size: 12px;
}

.attachment-action-file {
  max-width: 140px;
}

.attachment-filename-blocked,
.attachment-danger-blocked {
  color: var(--danger);
}

.attachment-save-button {
  margin-left: 0;
}

.attachment-save-unavailable {
  color: var(--muted);
  font-size: 12px;
}

.message-detail-attachment-title {
  color: var(--text);
  font-weight: 700;
}

.message-detail-empty {
  margin-top: 6px;
}

.icon-button.message-action-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex: 0 0 32px;
  padding: 0;
}

.message-actions .icon-button.message-action-button {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex-basis: 32px;
}

.icon-button.message-action-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-action-button.junk-action {
  border-color: rgba(239, 122, 115, 0.78);
  background: rgba(239, 122, 115, 0.18);
  color: #ffd7d4;
  box-shadow: 0 0 0 1px rgba(239, 122, 115, 0.2) inset;
}

.message-action-button.junk-action:hover,
.message-action-button.junk-action:focus-visible {
  border-color: var(--red);
  background: rgba(239, 122, 115, 0.28);
}

.message-action-button.flag-action {
  border-color: rgba(228, 189, 79, 0.78);
  background: rgba(228, 189, 79, 0.18);
  color: #ffe7a3;
  box-shadow: 0 0 0 1px rgba(228, 189, 79, 0.2) inset;
}

.message-action-button.flag-action:hover,
.message-action-button.flag-action:focus-visible {
  border-color: var(--amber);
  background: rgba(228, 189, 79, 0.28);
}

.message-action-button.not-junk-action {
  border-color: rgba(121, 210, 121, 0.78);
  background: rgba(121, 210, 121, 0.18);
  color: #d8ffd8;
  box-shadow: 0 0 0 1px rgba(121, 210, 121, 0.2) inset;
}

.message-action-button.not-junk-action:hover,
.message-action-button.not-junk-action:focus-visible {
  border-color: var(--green);
  background: rgba(121, 210, 121, 0.28);
}

.message-action-button.ai-suggested-action {
  border-color: rgba(239, 122, 115, 0.92);
  background: rgba(239, 122, 115, 0.32);
  color: #ffd7d4;
  box-shadow: 0 0 0 1px rgba(239, 122, 115, 0.34) inset, 0 0 18px rgba(239, 122, 115, 0.24);
}

.message-action-button.ai-suggested-action:hover,
.message-action-button.ai-suggested-action:focus-visible {
  border-color: var(--red);
  background: rgba(239, 122, 115, 0.28);
}

.message-action-button.auto-ban-action {
  border-color: #9f3030;
  background: #641f24;
  color: #ffd7d7;
  box-shadow: 0 0 0 1px rgba(159, 48, 48, 0.42) inset;
}

.message-action-button.auto-ban-action:hover,
.message-action-button.auto-ban-action:focus-visible {
  border-color: #d14a4a;
  background: #7d262c;
}

.message-action-button.not-junk-suggested-action {
  border-color: rgba(121, 210, 121, 0.92);
  background: rgba(121, 210, 121, 0.32);
  color: #d8ffd8;
  box-shadow: 0 0 0 1px rgba(121, 210, 121, 0.34) inset, 0 0 18px rgba(121, 210, 121, 0.24);
}

.message-action-button.not-junk-suggested-action:hover,
.message-action-button.not-junk-suggested-action:focus-visible {
  border-color: var(--green);
  background: rgba(121, 210, 121, 0.28);
}

.message-action-button.flag-suggested-action {
  border-color: rgba(228, 189, 79, 0.78);
  background: rgba(228, 189, 79, 0.18);
  color: #ffe7a3;
  box-shadow: 0 0 0 1px rgba(228, 189, 79, 0.2) inset, 0 0 14px rgba(228, 189, 79, 0.16);
}

.message-action-button.flag-suggested-action:hover,
.message-action-button.flag-suggested-action:focus-visible {
  border-color: var(--amber);
  background: rgba(228, 189, 79, 0.28);
}

.message-action-button.important-action-active {
  border-color: var(--amber);
  background: rgba(228, 189, 79, 0.3);
  color: #ffe7a3;
  box-shadow: 0 0 0 1px rgba(228, 189, 79, 0.28) inset, 0 0 14px rgba(228, 189, 79, 0.2);
}

.message-action-button.important-action-active:hover,
.message-action-button.important-action-active:focus-visible {
  background: rgba(228, 189, 79, 0.4);
}

.message-action-button.safe-action {
  border-color: #2f8f68;
  background: #174d3a;
  color: #d8ffec;
  box-shadow: 0 0 0 1px rgba(47, 143, 104, 0.4) inset;
}

.message-action-button.safe-action:hover,
.message-action-button.safe-action:focus-visible {
  border-color: #49b883;
  background: #1e6249;
}

.message-action-button.safe-action-active {
  border-color: #58c994;
  background: #236f53;
  color: #e3fff3;
  box-shadow: 0 0 0 1px rgba(88, 201, 148, 0.36) inset, 0 0 16px rgba(35, 111, 83, 0.3);
}

.message-action-button.safe-action-active:hover,
.message-action-button.safe-action-active:focus-visible {
  background: #2a8060;
}

.message-detail-toolbar #messageDetailFlagToggle {
  border-color: rgba(228, 189, 79, 0.86);
  background: rgba(228, 189, 79, 0.24);
  color: #ffe7a3;
  box-shadow: 0 0 0 1px rgba(228, 189, 79, 0.24) inset, 0 0 14px rgba(228, 189, 79, 0.18);
}

.message-detail-toolbar #messageDetailJunk {
  border-color: rgba(239, 122, 115, 0.92);
  background: rgba(239, 122, 115, 0.3);
  color: #ffd7d4;
  box-shadow: 0 0 0 1px rgba(239, 122, 115, 0.32) inset, 0 0 16px rgba(239, 122, 115, 0.22);
}

.message-detail-toolbar #messageDetailAutoBan {
  border-color: #9f3030;
  background: #641f24;
  color: #ffd7d7;
  box-shadow: 0 0 0 1px rgba(159, 48, 48, 0.42) inset;
}

.message-detail-toolbar #messageDetailNotJunk {
  border-color: rgba(121, 210, 121, 0.92);
  background: rgba(121, 210, 121, 0.3);
  color: #d8ffd8;
  box-shadow: 0 0 0 1px rgba(121, 210, 121, 0.32) inset, 0 0 16px rgba(121, 210, 121, 0.22);
}

.message-detail-toolbar #messageDetailUnsubscribe.unsubscribe-action-complete:disabled {
  border-color: #58c994;
  background: #236f53;
  color: #e3fff3;
  box-shadow: 0 0 0 1px rgba(88, 201, 148, 0.4) inset, 0 0 16px rgba(35, 111, 83, 0.34);
  opacity: 1;
}

.message-detail-toolbar #messageDetailFlagToggle:hover,
.message-detail-toolbar #messageDetailFlagToggle:focus-visible {
  border-color: var(--amber);
  background: rgba(228, 189, 79, 0.34);
}

.message-detail-toolbar #messageDetailJunk:hover,
.message-detail-toolbar #messageDetailJunk:focus-visible {
  border-color: var(--red);
  background: rgba(239, 122, 115, 0.38);
}

.message-detail-toolbar #messageDetailAutoBan:hover,
.message-detail-toolbar #messageDetailAutoBan:focus-visible {
  border-color: #d14a4a;
  background: #7d262c;
}

.message-detail-toolbar #messageDetailNotJunk:hover,
.message-detail-toolbar #messageDetailNotJunk:focus-visible {
  border-color: var(--green);
  background: rgba(121, 210, 121, 0.38);
}

.message-detail-toolbar .message-action-button:disabled {
  cursor: not-allowed;
}

.account-actions,
.operation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.account-actions {
  flex-wrap: nowrap;
  min-width: 170px;
}

.auth-user-actions {
  flex-wrap: wrap;
}

.auth-user-action.icon-button.message-action-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
}

.auth-user-action.icon-button.message-action-button:hover,
.auth-user-action.icon-button.message-action-button:focus-visible {
  border-color: rgba(73, 213, 189, 0.82);
  background: rgba(73, 213, 189, 0.18);
  color: #dcfff9;
  box-shadow: 0 0 0 1px rgba(73, 213, 189, 0.24) inset, 0 8px 18px rgba(0, 0, 0, 0.24);
}

.auth-user-pat-dialog {
  width: min(680px, calc(100vw - 32px));
}

#authUserPatDialogTitle {
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.auth-user-pat-content {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
}

.auth-user-pat-content label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
}

.auth-user-pat-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px 38px 38px;
  gap: 8px;
  align-items: center;
}

.auth-user-pat-value input {
  height: 38px;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 8px 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  line-height: 1.4;
}

.auth-user-pat-value .icon-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--panel-strong);
}

.auth-user-pat-value input:focus-visible,
.auth-user-pat-value .icon-button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.auth-user-pat-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.auth-user-pat-preview {
  font-family: "IBM Plex Mono", monospace;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .auth-user-pat-dialog {
    width: 100vw;
  }
}

@media (max-width: 980px) {
  .auth-user-actions-cell {
    padding-inline: 9px;
  }

  .auth-user-actions {
    flex-direction: column;
    min-width: 0;
  }
}

.operation-actions .button,
.account-actions .button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 13px;
}

.llm-subtab-panel .table-frame {
  overflow-x: auto;
}

.llm-profile-table {
  min-width: 100%;
  table-layout: auto;
  font-size: 13px;
}

.llm-profile-table th,
.llm-profile-table td {
  padding: 8px 10px;
}

.llm-profile-display-column {
  width: 15%;
  max-width: 190px;
}

.llm-profile-model-column {
  width: 15%;
  max-width: 190px;
}

.llm-profile-endpoint-column {
  width: 28%;
  max-width: 320px;
}

.llm-profile-status-column,
.llm-profile-actions-column,
.llm-profile-actions {
  width: 1%;
  white-space: nowrap;
}

.llm-profile-api-key-column {
  width: 12%;
  max-width: 180px;
}

.llm-profile-api-key-value {
  display: inline-block;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.llm-profile-tested-column {
  width: 1%;
  text-align: center;
  white-space: nowrap;
}

.llm-profile-last-tested {
  display: grid;
  justify-items: center;
  gap: 1px;
  width: max-content;
  margin: 0 auto;
  line-height: 1.15;
}

.llm-profile-actions {
  display: table-cell;
  vertical-align: middle;
}

.llm-profile-action-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  white-space: nowrap;
}

.llm-profile-action-buttons .icon-button.message-action-button {
  min-height: 32px;
  padding: 0;
}

.llm-status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(242, 244, 248, 0.08);
}

.llm-profile-status-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  min-width: 0;
}

.llm-profile-enabled-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.llm-profile-enabled-toggle input {
  appearance: none;
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #12141a;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.llm-profile-enabled-toggle input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 120ms ease, background 120ms ease;
}

.llm-profile-enabled-toggle input:checked {
  border-color: #358d7f;
  background: #236e64;
}

.llm-profile-enabled-toggle input:checked::before {
  transform: translateX(14px);
  background: var(--text);
}

.llm-profile-enabled-toggle input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.llm-profile-enabled-toggle input:disabled {
  cursor: wait;
  opacity: 0.65;
}

.llm-status-disabled {
  background: #6f7785;
}

.llm-status-good {
  background: #36d399;
}

.llm-status-unknown {
  background: #f6c453;
}

.llm-status-failed {
  background: var(--red);
}
