.app-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}
.app-toast--success { background: #16a34a; }
.app-toast--error   { background: #dc2626; }
.app-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

:root {
  --font-display: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

  --bg-app: #fdf5f5;
  --bg-device: rgba(255, 255, 255, 0.72);
  /* Outer canvas = area outside the phone frame */
  --bg-outer-canvas:
    radial-gradient(980px 640px at 8% -2%, rgba(197, 34, 51, 0.48), transparent 52%),
    radial-gradient(860px 560px at 92% 13%, rgba(165, 28, 48, 0.39), transparent 46%),
    radial-gradient(700px 460px at 76% 92%, rgba(167, 51, 63, 0.34), transparent 48%),
    linear-gradient(140deg, #fff7f8 0%, #ffeef2 50%, #fff6f8 100%);
  --bg-outer-canvas-wash: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8));

  /* Inner wallpaper = area inside the phone frame */
  --bg-inner-wallpaper:
    radial-gradient(980px 640px at 8% -2%, rgba(197, 34, 51, 0.34), transparent 52%),
    radial-gradient(860px 560px at 92% 13%, rgba(165, 28, 48, 0.28), transparent 46%),
    radial-gradient(700px 460px at 76% 92%, rgba(167, 51, 63, 0.24), transparent 48%),
    linear-gradient(140deg, #fffafb 0%, #fff3f6 50%, #fffbfc 100%);
  --bg-inner-wallpaper-wash: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7));
  --bg-inner-panel-wash-1: linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.42));
  --bg-inner-panel-wash-2: linear-gradient(rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.52));
  --text-main: #1f2430;
  --text-muted: #8f95ab;
  --text-sub: #5f667b;
  
  --accent-violet: #c52233;
  --accent-violet-soft: #f8d9dd;
  --accent-pink: #a51c30;
  --accent-blue: #a7333f;
  --accent-teal: #74121d;
  --accent-orange: #580c1f;
  
  --border-light: rgba(255, 255, 255, 0.78);
  --shadow-soft: 0 3px 12px rgba(88, 12, 31, 0.08);
  --shadow-float: 0 10px 24px rgba(88, 12, 31, 0.12);

  --mobile-device-max-width: 400px;
  --safe-top-base: 40px;
  --safe-bottom-base: 30px;
  --safe-inset-top: env(safe-area-inset-top, 0px);
  --safe-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: max(var(--safe-top-base), var(--safe-inset-top));
  --safe-bottom: max(var(--safe-bottom-base), var(--safe-inset-bottom));
  --nav-height: 80px;
  --nav-offset: 24px;
  --nav-clearance: calc(var(--nav-height) + var(--nav-offset) + var(--safe-bottom));
  --composer-height: 72px;
  --composer-clearance: calc(var(--nav-clearance) + var(--composer-height) + 12px);
  --chat-font-size: 14px;
}

.terminal-placeholder {
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(197, 34, 51, 0.08);
  color: var(--text-sub);
  font-size: 12px;
  border: 1px solid rgba(165, 28, 48, 0.24);
  display: grid;
  gap: 10px;
}

.terminal-placeholder-guidance {
  text-align: left;
  background: linear-gradient(135deg, rgba(197, 34, 51, 0.09), rgba(255, 255, 255, 0.78));
  box-shadow: 0 3px 10px rgba(165, 28, 48, 0.12);
  margin-top: 0;
  margin-bottom: 10px;
}

.terminal-placeholder__top {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.terminal-placeholder__icon {
  display: none;
}

.terminal-placeholder__title {
  margin: 0;
  font-weight: 800;
  font-size: 13px;
  color: #1f2937;
}

.terminal-placeholder__body {
  display: grid;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-sub);
}

.terminal-placeholder__body p {
  margin: 0;
}

.terminal-placeholder__jump {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: #a51c30;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: normal;
  text-decoration: none;
  cursor: pointer;
}

.terminal-placeholder__jump::after {
  content: "";
}

.terminal-placeholder__jump:hover,
.terminal-placeholder__jump:focus-visible {
  color: #c52233;
}

.terminal-placeholder__jump:focus-visible {
  outline: 2px solid rgba(197, 34, 51, 0.35);
  outline-offset: 2px;
  border-radius: 4px;
}

.terminal-placeholder__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.terminal-placeholder__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(165, 28, 48, 0.3);
  background: rgba(197, 34, 51, 0.09);
  color: #1f2937;
  font-weight: 600;
}

.terminal-placeholder--warning {
  border-color: rgba(165, 28, 48, 0.32);
  background: rgba(197, 34, 51, 0.1);
}

.terminal-placeholder--warning .terminal-placeholder__icon {
  display: none;
}

.terminal-placeholder--warning .terminal-placeholder__title {
  color: #a51c30;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:where(
  button,
  input,
  textarea,
  select,
  [role="button"],
  .pill-btn,
  .icon-btn-circle,
  .chat-list-item,
  .setting-item,
  .setting-toggle,
  .skills-tab-btn,
  .log-tab,
  .terminal-entry
):focus-visible {
  outline: 2px solid rgba(197, 34, 51, 0.78);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(197, 34, 51, 0.18);
}

input::placeholder,
textarea::placeholder {
  color: rgba(96, 103, 128, 0.72);
}

body {
  margin: 0;
  font-family: var(--font-body);
  background:
    var(--bg-outer-canvas-wash),
    var(--bg-outer-canvas);
  background-blend-mode: normal, screen, screen, screen, normal;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-main);
  overflow: hidden;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 320px;
  height: 320px;
  background: rgba(197, 34, 51, 0.08);
  top: -80px;
  left: -60px;
}

body::after {
  width: 280px;
  height: 280px;
  background: rgba(165, 28, 48, 0.07);
  right: -40px;
  bottom: -70px;
}

.device {
  width: 100%;
  max-width: var(--mobile-device-max-width);
  height: calc(100vh - 16px);
  height: calc(100dvh - 16px);
  max-height: 780px;
  margin: 8px auto;
  background:
    var(--bg-inner-wallpaper-wash),
    var(--bg-inner-wallpaper);
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(88, 12, 31, 0.04);
  display: flex;
  flex-direction: column;
  border-radius: 36px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 1;
}

/* Status Bar */
.status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  z-index: 50;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
}

.status-app-name {
  position: absolute;
  left: 48%;
  transform: translateX(-50%);
  display: inline-block;
  color: #8b95a9;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  pointer-events: none;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.battery-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(197, 34, 51, 0.12);
  color: #a51c30;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.battery-wrap .status-icon {
  width: 14px;
  height: 14px;
}

.status-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.5px;
}

@media (max-width: 560px) {
  .status-bar,
  .home-indicator {
    display: none;
  }

  .app {
    padding-top: var(--safe-top);
  }
}

/* Main App Area */
.app {
  flex: 1;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: var(--safe-top);
  position: relative;
}

.init-screen {
  position: absolute;
  inset: 0;
  z-index: 180;
  padding: 70px 26px 38px;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(420px 260px at 50% 20%, rgba(165, 28, 48, 0.04), transparent 68%),
    linear-gradient(180deg, #f9f7f7 0%, #fff9f9 100%);
}

.device.initializing-active .init-screen {
  display: flex;
}

.device.initializing-active .status-bar,
.device.initializing-active .app,
.device.initializing-active .floating-nav,
.newbie-active .floating-nav,
.contacts-active .floating-nav,
.device.initializing-active .home-indicator,
.newbie-active .home-indicator,
.contacts-active .home-indicator,
.device.initializing-active .side-panel {
  opacity: 0;
  pointer-events: none;
}

.init-screen__content {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #5f0f22;
}

.init-screen__badge {
  width: 240px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 48px;
}

.init-screen__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: pulse-slow 3s ease-in-out infinite;
}

@keyframes pulse-slow {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.03);
    opacity: 0.96;
  }
}

.init-screen__title {
  margin: -12px 0 24px;
  font-family: var(--font-display);
  font-size: clamp(12px, 3.2vw, 16px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 800;
  white-space: nowrap;
  background: linear-gradient(90deg, #a51c30 0%, #74121d 52%, #580c1f 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.init-screen__beta-badge {
  margin: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(167, 51, 63, 0.34);
  background: rgba(255, 255, 255, 0.72);
  color: #a7333f;
  font-family: var(--font-display), sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.init-screen__invite {
  width: min(300px, 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 22px;
}

.init-screen__invite-label {
  margin-left: 4px;
  font-family: var(--font-display), sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(109, 20, 38, 0.72);
}

.init-screen__invite-input {
  width: 100%;
  border: 1px solid rgba(174, 88, 105, 0.3);
  border-radius: 16px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: #74121d;
  font-family: var(--font-display), sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.init-screen__invite-input::placeholder {
  color: rgba(116, 18, 29, 0.5);
}

.init-screen__invite-input:focus {
  border-color: rgba(167, 51, 63, 0.8);
  box-shadow: 0 0 0 3px rgba(167, 51, 63, 0.16);
}

.init-screen__invite-feedback {
  margin: 2px 4px 0;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 700;
  color: #a7333f;
  text-align: left;
}

.init-screen__button {
  margin-top: 0;
  margin-bottom: 40px;
  width: min(300px, 100%);
  border: none;
  border-radius: 999px;
  padding: 18px 36px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(109, 20, 38, 0.12);
  color: #a7333f;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.init-screen__button span {
  margin-left: 12px;
}

.init-screen__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(109, 20, 38, 0.2);
}

.init-screen__button:active {
  transform: translateY(1px);
}

.init-screen__button.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.init-screen__button.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(167, 51, 63, 0.24);
  border-top-color: #a7333f;
  transform: translate(-50%, -50%);
  animation: init-screen-button-spin 0.8s linear infinite;
}

@keyframes init-screen-button-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.init-screen__version {
  margin: 0;
  color: rgba(176, 74, 92, 0.45);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

@media (max-width: 420px) {
  .init-screen {
    padding: 30px 20px 20px;
  }
}

.tab-view {
  display: none;
  flex-direction: column;
  height: 100%;
  position: relative;
  animation: fadeIn 0.3s ease;
}

.tab-view.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes chatDrawerIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes chatDrawerOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(18px); }
}

/* Scroll Containers */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 120px; /* Space for floating nav */
  padding-top: 10px;
  /* Hide scrollbar */
  scrollbar-width: none; 
  -ms-overflow-style: none;
}
.content-scroll::-webkit-scrollbar { 
  display: none; 
}

/* Keep scrolling behavior, hide visible scrollbar tracks across app panes */
.content-scroll,
.chat-thread,
.chat-code-block,
.newbie-drawer,
.contacts-drawer,
.share-drawer,
.share-payload,
.config-main-view,
.config-profile-subpage,
.config-pill-tabs,
.skills-hub-scroll,
.skills-store-scroll,
.skills-market-row,
.logs-content,
.term-tabs,
.log-tabs,
.gateway-dev-log,
.side-panel-body,
.settings-content,
.settings-subpage {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.content-scroll::-webkit-scrollbar,
.chat-thread::-webkit-scrollbar,
.chat-code-block::-webkit-scrollbar,
.newbie-drawer::-webkit-scrollbar,
.contacts-drawer::-webkit-scrollbar,
.share-drawer::-webkit-scrollbar,
.share-payload::-webkit-scrollbar,
.config-main-view::-webkit-scrollbar,
.config-profile-subpage::-webkit-scrollbar,
.config-pill-tabs::-webkit-scrollbar,
.skills-hub-scroll::-webkit-scrollbar,
.skills-store-scroll::-webkit-scrollbar,
.skills-market-row::-webkit-scrollbar,
.logs-content::-webkit-scrollbar,
.term-tabs::-webkit-scrollbar,
.log-tabs::-webkit-scrollbar,
.gateway-dev-log::-webkit-scrollbar,
.side-panel-body::-webkit-scrollbar,
.settings-content::-webkit-scrollbar,
.settings-subpage::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Lobsters Header */
.header-glass {
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 4px rgba(88, 12, 31, 0.04);
}

.header-glass--lobsters {
  justify-content: flex-start;
  gap: 10px;
}

.header-glass--lobsters.is-detail {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 6px rgba(88, 12, 31, 0.045);
  z-index: 220;
  isolation: isolate;
}

.header-glass--lobsters.is-detail::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.28));
  pointer-events: none;
}

.header-glass--lobsters.is-detail > * {
  position: relative;
  z-index: 1;
}

.header-glass--lobsters.is-detail .icon-btn-circle,
.header-glass--lobsters.is-detail .chat-live-chip--header {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-glass--lobsters .page-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-glass--lobsters.is-detail [data-gateway-main-title] {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #111827;
  opacity: 1;
}

.header-glass--lobsters .header-actions {
  margin-left: auto;
  align-items: center;
}

.header-glass--lobsters [data-gateway-header-back],
.header-glass--lobsters [data-gateway-header-status] {
  display: none;
}

.header-glass--lobsters.is-detail [data-gateway-header-back] {
  display: inline-flex;
}

.header-glass--lobsters.is-detail [data-gateway-header-status] {
  display: inline-flex;
}

.tab-view[data-tab-view="skills"] > .header-glass,
.logs-content > .header-glass,
.settings-content > .header-glass {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.hero-title {
  margin: 4px 0 6px;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.04em;
  color: var(--text-main);
  line-height: 1.1;
}

.hero-sub {
  margin: 0;
  color: var(--text-sub);
  font-size: 12px;
  max-width: 240px;
}

.gradient-text {
  background: linear-gradient(120deg, #c52233, #a51c30, #74121d);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tags {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-app);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: var(--shadow-soft);
  font-weight: 700;
  font-size: 12px;
}

.hero-pill.soft {
  background: rgba(255,255,255,0.85);
}

.hero-badge {
  min-width: 96px;
  background: linear-gradient(160deg, #fdf1f2, #f8e2e6);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 12px 10px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.badge-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent-violet-soft);
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  color: var(--accent-violet);
}

.badge-text {
  margin: 0;
  font-weight: 800;
  font-size: 12px;
  color: var(--text-main);
}

.hero-chip {
  background: var(--bg-app);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.accent-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-violet);
  stroke-width: 2.5px;
}

.brand-icon {
  width: 30px;
  height: 30px;
  stroke-width: 4px;
}

.icon-btn-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.1s;
}
.icon-btn-circle:active {
  transform: scale(0.95);
}

/* Welcome Card */
.welcome-card {
  margin: 0 24px 24px;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-orange));
  border-radius: 24px;
  padding: 20px;
  color: white;
  box-shadow: 0 4px 10px rgba(88, 12, 31, 0.18);
}

.welcome-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
}

.welcome-text {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
}

/* Lobsters WeChat-style */
.lobsters-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 0 14px calc(var(--nav-clearance) + 20px);
}

.chat-drawer-open .lobsters-shell {
  padding-bottom: 20px;
}

.lobsters-tabs {
  display: flex;
  gap: 10px;
  padding: 12px 0 6px;
}

.lobsters-tab-btn {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
}

.lobsters-tab-btn.active {
  background: var(--accent-violet-soft);
  color: var(--accent-violet);
}

.chat-list-view,
.chat-detail-view {
  display: none;
  flex: 1;
  position: relative;
}

.gateway-list-view,
.gateway-detail-view {
  display: none;
  flex: 1;
  min-height: 0;
  position: relative;
}

.chat-drawer-open .chat-detail-view {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 120;
  padding: 0 14px;
  animation: chatDrawerIn 0.25s ease;
}

.chat-drawer-open .gateway-detail-view {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 120;
  padding: 0 14px;
  animation: chatDrawerIn 0.25s ease;
}

.chat-drawer-open .header-glass--lobsters.is-detail + .lobsters-shell .gateway-detail-view {
  top: -58px;
}

.chat-drawer-open .gateway-detail-view.is-exiting {
  animation: chatDrawerOut 0.22s ease forwards;
  pointer-events: none;
}

.chat-drawer-open .gateway-detail-view .config-backdrop,
.chat-drawer-open .gateway-detail-view .newbie-backdrop,
.chat-drawer-open .gateway-detail-view .contacts-backdrop,
.chat-drawer-open .gateway-detail-view .share-backdrop,
.chat-drawer-open .gateway-detail-view .config-drawer,
.chat-drawer-open .gateway-detail-view .newbie-drawer,
.chat-drawer-open .gateway-detail-view .contacts-drawer,
.chat-drawer-open .gateway-detail-view .share-drawer {
  left: -14px;
  right: -14px;
}

.chat-drawer-open .chat-detail-view .chat-thread {
  padding-bottom: calc(var(--composer-height) + var(--safe-bottom) + 12px);
}

.chat-drawer-open .gateway-detail-view .chat-thread {
  padding-bottom: calc(var(--composer-height) + var(--safe-bottom) + 12px);
}

.chat-drawer-open .header-glass--lobsters.is-detail + .lobsters-shell .gateway-detail-view .chat-thread {
  padding-top: 72px;
}

.chat-drawer-open .chat-detail-view .chat-composer {
  bottom: var(--safe-bottom);
}

.chat-drawer-open .gateway-detail-view .chat-composer {
  bottom: var(--safe-bottom);
}

.chat-list-view.active,
.chat-detail-view.active {
  display: flex;
  flex-direction: column;
}

.gateway-list-view.active,
.gateway-detail-view.active {
  display: flex;
  flex-direction: column;
}

.chat-detail-view .chat-composer,
.gateway-detail-view .chat-composer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--nav-clearance);
  z-index: 20;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 11px;
}

.chat-list-item {
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid transparent;
  border-radius: 25px;
  width: calc(100% - 10px);
  margin-inline: auto;
  padding: 16px 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.035);
  backdrop-filter: blur(16px);
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.chat-list-item:hover {
  transform: translateY(-0.5px);
  box-shadow: 0 5px 10px rgba(88, 12, 31, 0.06);
}

.chat-list-item.active {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 5px 11px rgba(88, 12, 31, 0.07);
}

.chat-list-avatar {
  width: 44px;
  height: 44px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(253, 235, 238, 0.95), rgba(255, 255, 255, 0.9));
  color: #a51c30;
  display: grid;
  place-items: center;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 3px 8px rgba(88, 12, 31, 0.05);
  backdrop-filter: blur(14px);
  position: relative;
}

.chat-list-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.chat-list-avatar::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #22c55e;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.chat-list-avatar[data-tone="warning"]::after {
  background: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.22);
}

.chat-list-avatar[data-tone="idle"]::after {
  background: #94a3b8;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.28);
}

.chat-list-avatar[data-tone="error"]::after {
  background: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
}

.chat-list-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

/* ── Row layout (new) ────────────────────────────────── */
.chat-list-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.chat-list-row--top {
  gap: 6px;
}

.chat-list-row--bottom {
  gap: 6px;
  min-width: 0;
}

.chat-list-preview-time {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #8f95ab;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-list-preview-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #7c8397;
}

/* ── Name ─────────────────────────────────────────────── */
.chat-list-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

/* ── Status chip ──────────────────────────────────────── */
.chat-list-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-sub);
}

.chat-list-status[data-tone="ok"]      { color: #047857; }
.chat-list-status[data-tone="warning"] { color: #b45309; }
.chat-list-status[data-tone="error"]   { color: #b91c1c; }
.chat-list-status[data-tone="idle"]    { color: #64748b; }

/* ── Controls ─────────────────────────────────────────── */
.chat-list-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.chat-list-controls .icon-btn-circle,
.chat-list-row--bottom > .icon-btn-circle {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(229, 231, 235, 0.8);
  color: #737b92;
  box-shadow: 0 2px 5px rgba(65, 53, 93, 0.05);
}

.chat-list-controls .icon-btn-circle i,
.chat-list-controls .icon-btn-circle svg,
.chat-list-row--bottom > .icon-btn-circle i,
.chat-list-row--bottom > .icon-btn-circle svg {
  width: 12px;
  height: 12px;
}

/* ── Legacy selectors (unused but kept to avoid breakage) */
.chat-list-top,
.chat-list-titleline,
.chat-list-meta,
.chat-list-preview,
.chat-list-time { display: none; }

.chat-detail-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 6px 2px 12px;
}

.chat-detail-header--template {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0;
}

.chat-detail-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  min-width: 0;
  flex-wrap: nowrap;
}

.gateway-pipeline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.85);
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.01em;
  max-width: 230px;
  overflow: hidden;
  white-space: nowrap;
}

.gateway-pipeline-shell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-width: 0;
}

.gateway-pipeline--panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  max-width: 100%;
  width: 100%;
  justify-content: initial;
  overflow: visible;
  white-space: normal;
  padding: 6px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.gateway-pipeline--panel .gateway-pipeline-node {
  min-width: 0;
  justify-content: center;
  padding: 2px 6px;
}

.gateway-pipeline--panel .gateway-pipeline-sep {
  justify-self: center;
}

.gateway-pipeline--panel .gateway-pipeline-node strong {
  font-size: 10px;
}

.gateway-pipeline--panel .gateway-pipeline-node em {
  display: none;
}

.gateway-pipeline-node {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 6px;
  background: rgba(241, 245, 249, 0.85);
  color: #64748b;
  box-shadow: 0 1px 2px rgba(51, 65, 85, 0.08);
}

.gateway-pipeline-node strong {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gateway-pipeline-node em {
  display: none;
}

.gateway-pipeline-node[data-stage="ok"] {
  background: rgba(236, 253, 245, 0.9);
  color: #047857;
}

.gateway-pipeline-node[data-stage="pending"] {
  background: rgba(255, 251, 235, 0.95);
  color: #b45309;
}

.gateway-pipeline-node[data-stage="error"] {
  background: rgba(254, 242, 242, 0.95);
  color: #b91c1c;
}

.gateway-pipeline-node[data-stage="off"] {
  background: rgba(248, 250, 252, 0.95);
  color: #64748b;
}

.gateway-pipeline-sep {
  color: rgba(100, 116, 139, 0.7);
  font-size: 9px;
}

.chat-detail-controls .chat-live-chip--header,
.header-glass--lobsters .header-actions .chat-live-chip--header {
  padding: 4px 7px;
  font-size: 10px;
  gap: 5px;
  min-width: 0;
}

.chat-detail-controls .chat-live-chip--header[data-action="gateway-reconnect"],
.header-glass--lobsters .header-actions .chat-live-chip--header[data-action="gateway-reconnect"] {
  cursor: pointer;
  user-select: none;
  transition: transform 0.14s ease, box-shadow 0.16s ease;
}

.chat-detail-controls .chat-live-chip--header[data-action="gateway-reconnect"]:hover,
.header-glass--lobsters .header-actions .chat-live-chip--header[data-action="gateway-reconnect"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(64, 51, 95, 0.1);
}

.chat-detail-controls .chat-live-chip--header[data-action="gateway-reconnect"]:active,
.header-glass--lobsters .header-actions .chat-live-chip--header[data-action="gateway-reconnect"]:active {
  transform: translateY(0);
  box-shadow: none;
}

.chat-detail-controls .chat-detail-status,
.header-glass--lobsters .header-actions .chat-detail-status {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.chat-detail-controls .icon-btn-circle {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(64, 51, 95, 0.08);
}

.chat-detail-controls .icon-btn-circle i,
.chat-detail-controls .icon-btn-circle svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 360px) {
  .chat-detail-controls {
    gap: 4px;
  }

  .chat-detail-controls .chat-live-chip--header,
  .header-glass--lobsters .header-actions .chat-live-chip--header {
    padding: 3px 6px;
  }

  .chat-detail-controls .chat-detail-status,
  .header-glass--lobsters .header-actions .chat-detail-status {
    max-width: 78px;
  }

  .gateway-pipeline {
    max-width: 170px;
    gap: 2px;
    padding: 3px 5px;
  }

  .gateway-pipeline--panel {
    max-width: 100%;
    width: 100%;
    padding: 0;
  }

  .gateway-pipeline-node {
    min-height: 22px;
    padding: 1px 4px;
  }

  .chat-detail-controls .icon-btn-circle {
    width: 28px;
    height: 28px;
  }
}

.chat-live-chip {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(226, 231, 240, 0.9);
  border-radius: 999px;
  padding: 6px 10px;
  box-shadow: 0 2px 8px rgba(88, 12, 31, 0.06);
  color: #4b5563;
  font-size: 11px;
}

.chat-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.14);
}

.chat-live-chip[data-tone="warning"] .chat-live-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.chat-live-chip[data-tone="error"] .chat-live-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.chat-live-chip[data-tone="idle"] .chat-live-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.18);
}

.chat-detail-header--list {
  grid-template-columns: 1fr;
}

.chat-live-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 10px;
}

.chat-live-row--padded {
  padding: 10px 4px 12px;
}

.chat-live-row--under-profile {
  padding-top: 6px;
  padding-bottom: 0;
}

.config-divider--after-pipeline {
  margin: 8px 0 12px;
}

.chat-live-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9aa3b6;
}

.chat-detail-title {
  margin: 11px 0 0;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9aa3b6;
}

.chat-detail-title[data-gateway-detail-title] {
  margin: 0;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.07em;
  color: #4a5064;
  line-height: 1.1;
  justify-self: start;
  align-self: center;
  max-width: min(46vw, 240px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-detail-status {
  font-family: var(--font-display);
  font-size: 13px;
  color: #334155;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.chat-detail-status[data-tone="ok"] {
  color: #047857;
}

.chat-detail-status[data-tone="warning"] {
  color: #b45309;
}

.chat-detail-status[data-tone="error"] {
  color: #b91c1c;
}

.chat-detail-status[data-tone="idle"] {
  color: #64748b;
}

.chat-detail-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gateway-config {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
}

.gateway-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gateway-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
}

.gateway-field input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  font-size: 12px;
}

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

.chat-thread {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  padding-bottom: var(--composer-clearance);
}
.chat-thread::-webkit-scrollbar { display: none; }

.chat-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 76%) 38px;
  column-gap: 8px;
  align-items: flex-start;
  justify-content: center;
  flex: 0 0 auto;
}

.chat-row.me {
  justify-content: center;
}

.chat-row--connection-inline {
  grid-template-columns: minmax(0, 1fr);
  column-gap: 0;
}

.chat-row--center-inline {
  grid-template-columns: minmax(0, 1fr);
  column-gap: 0;
}

.chat-row--connection-inline > div:not(.chat-avatar-stack) {
  grid-column: 1;
  justify-self: center;
  align-items: center;
  text-align: center;
  width: min(100%, 520px);
}

.chat-avatar-stack {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  align-self: start;
}

.chat-avatar-stack--bot {
  grid-column: 1;
}

.chat-avatar-stack--user {
  grid-column: 3;
}

.chat-row--clustered {
  margin-top: -4px;
}

.chat-row--inline.chat-row--clustered {
  margin-top: -6px;
}

.chat-row--inline.is-expanded.chat-row--clustered,
.chat-row--inline.is-expanded + .chat-row--inline.chat-row--clustered {
  margin-top: 0;
}

.chat-row--clustered:not(.me) .chat-bubble,
.chat-row--clustered:not(.me) .chat-inline,
.chat-row--clustered:not(.me) .chat-structured {
  border-top-left-radius: 10px;
}

.chat-row--clustered.me .chat-bubble,
.chat-row--clustered.me .chat-inline,
.chat-row--clustered.me .chat-structured {
  border-top-right-radius: 10px;
}

.chat-row > div:not(.chat-avatar-stack) {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  max-width: none;
  justify-self: start;
  align-items: flex-start;
  text-align: left;
}

.chat-row.me > div:not(.chat-avatar-stack) {
  justify-self: end;
  align-items: flex-end;
  text-align: right;
}

.chat-row.me.chat-row--me-multiline > div:not(.chat-avatar-stack) {
  justify-self: start;
  align-items: flex-start;
  text-align: left;
}

.chat-row.chat-row--connection-inline > div:not(.chat-avatar-stack) {
  grid-column: 1;
  justify-self: center;
  align-items: center;
  text-align: center;
  width: min(100%, 520px);
}

.chat-row.chat-row--center-inline > div:not(.chat-avatar-stack) {
  grid-column: 1;
  justify-self: center;
  align-items: center;
  text-align: center;
  width: min(76%, 520px);
}

.chat-row.chat-row--connection-inline.me > div:not(.chat-avatar-stack) {
  justify-self: center;
  align-items: center;
  text-align: center;
}

.chat-row.chat-row--connection-inline .chat-inline {
  align-items: center;
}

.chat-row.chat-row--connection-inline .chat-inline-text {
  display: block;
  text-align: center;
}

.chat-bubble {
  max-width: 100%;
  display: inline-block;
  min-height: 0;
  padding: 7px 13px;
  border-radius: 11px;
  font-size: var(--chat-font-size, 14px);
  line-height: 1.3;
  box-shadow: 0 2px 6px rgba(70, 60, 99, 0.05);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  color: var(--text-main);
  word-break: break-word;
  white-space: normal;
}

.chat-md {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-md > * {
  margin: 0;
}

.chat-md p {
  line-height: 1.34;
}

.chat-emoji {
  display: inline-block;
  font-size: 0.9em;
  line-height: 1;
  vertical-align: -0.08em;
  letter-spacing: 0;
}

.chat-md-h1,
.chat-md-h2,
.chat-md-h3,
.chat-md-h4 {
  margin: 0;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: #111827;
}

.chat-md-h1 {
  font-size: 18px;
  font-weight: 800;
}

.chat-md-h2 {
  font-size: 16px;
  font-weight: 800;
}

.chat-md-h3 {
  font-size: 15px;
  font-weight: 700;
}

.chat-md-h4 {
  font-size: 14px;
  font-weight: 700;
}

.chat-md-hr {
  margin: 2px 0;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.chat-md ul,
.chat-md ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}

.chat-task-list {
  list-style: none;
  padding-left: 0;
}

.chat-task-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.chat-task-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
  accent-color: #c52233;
}

.chat-md blockquote {
  margin: 0;
  padding: 4px 0 4px 10px;
  border-left: 2px solid rgba(148, 163, 184, 0.55);
  color: #475569;
}

.chat-md a {
  color: #a51c30;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.chat-md code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 12px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid rgba(203, 213, 225, 0.8);
  background: rgba(248, 250, 252, 0.95);
  color: #334155;
  white-space: break-spaces;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-code-wrap {
  border: 1px solid rgba(148, 163, 184, 0.33);
  border-radius: 11px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.chat-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.95);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.chat-code-lang {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-code-copy {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(51, 65, 85, 0.9);
  color: #e2e8f0;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.16s ease;
}

.chat-code-copy:hover {
  background: rgba(71, 85, 105, 0.95);
  border-color: rgba(148, 163, 184, 0.48);
}

.chat-code-copy:active {
  transform: translateY(1px);
}

.chat-code-copy.is-copied {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(74, 222, 128, 0.65);
  color: #dcfce7;
}

.chat-code-block {
  margin: 0;
  padding: 10px 12px;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: #e2e8f0;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 12px;
  line-height: 1.5;
  tab-size: 2;
}

.chat-code-block code {
  display: block;
  min-width: 0;
  border: none;
  padding: 0;
  background: transparent;
  color: inherit;
}

.chat-syn-comment {
  color: #94a3b8;
}

.chat-syn-keyword {
  color: #7dd3fc;
  font-weight: 600;
}

.chat-syn-string {
  color: #86efac;
}

.chat-syn-number {
  color: #fbbf24;
}

.chat-syn-literal {
  color: #fca5a5;
  font-weight: 600;
}

.chat-bubble.streaming {
  position: relative;
}

.chat-stream-cursor {
  display: inline-block;
  width: 0.55ch;
  margin-left: 1px;
  border-right: 2px solid currentColor;
  vertical-align: text-bottom;
  opacity: 0.75;
  animation: chatStreamCursorBlink 0.95s steps(1, end) infinite;
}

@keyframes chatStreamCursorBlink {
  0%, 45% {
    opacity: 0.75;
  }
  46%, 100% {
    opacity: 0;
  }
}

.chat-bubble.thinking {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 48px;
}

.chat-bubble.thinking-note {
  opacity: 0.65;
  font-style: italic;
}

.chat-bubble.thinking span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-sub);
  animation: thinkingPulse 1.2s ease-in-out infinite;
}

.chat-bubble.thinking span:nth-child(2) { animation-delay: 0.15s; }
.chat-bubble.thinking span:nth-child(3) { animation-delay: 0.3s; }

@keyframes thinkingPulse {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-4px); opacity: 1; }
}

.chat-row.me .chat-bubble {
  background: rgba(197, 34, 51, 0.8);
  border-color: rgba(197, 34, 51, 0.7);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(88, 12, 31, 0.1);
}

.chat-row.me .chat-md a {
  color: #ffecef;
}

.chat-row.me .chat-md code {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f8fafc;
}

.chat-row.me .chat-md blockquote {
  border-left-color: rgba(255, 255, 255, 0.34);
  color: rgba(255, 255, 255, 0.9);
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #ffffff;
  background: #ffffff;
  border: 1px solid rgba(226, 231, 240, 0.9);
  box-shadow: 0 2px 6px rgba(88, 12, 31, 0.08);
  flex-shrink: 0;
  align-self: start;
  overflow: hidden;
}

.chat-avatar--bot {
  grid-column: 1;
}

.chat-avatar--user {
  grid-column: 3;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.chat-avatar-img {
  object-fit: cover;
  display: block;
}

.chat-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 0;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.chat-time-row {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 6px 0;
}

.chat-time-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(100, 116, 139, 0.82);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(8px);
}

.hide-timestamps .chat-meta,
.hide-timestamps .chat-time-row {
  display: none;
}

.chat-row--inline > div:not(.chat-avatar-stack),
.chat-row--inline.is-expanded > div:not(.chat-avatar-stack) {
  width: 100%;
  max-width: 100%;
}

.chat-row--center-inline .chat-inline-header {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: 8px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  min-height: 20px;
}

.chat-row--inline {
  min-height: 20px;
}

.chat-row--connection-inline.chat-row--inline > div:not(.chat-avatar-stack) > div {
  width: auto;
}

.chat-row--connection-inline .chat-inline-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: auto;
  max-width: 100%;
}

.chat-row--connection-inline .chat-inline-text {
  text-align: center;
  white-space: normal;
}

.chat-row--inline .chat-avatar-stack {
  min-height: 22px;
  height: 22px;
}

.chat-row--inline .chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.chat-row--inline .chat-avatar--bot,
.chat-row--inline .chat-avatar--user {
  position: absolute;
  top: 0;
  left: 50%;
}

.chat-row--inline .chat-avatar--bot {
  transform: translateX(-50%);
}

.chat-row--inline .chat-avatar--user {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  transform: translateX(-50%);
}

.chat-row--inline > div:not(.chat-avatar-stack) > div {
  width: 100%;
}

.chat-row--inline .chat-meta {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--text-muted);
}

.chat-inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border-radius: 0;
  font-size: 12px;
  line-height: 1.5;
  background: transparent;
  color: var(--text-sub);
  border: none;
  font-family: var(--font-body);
  opacity: 0.92;
  width: 100%;
  max-width: 100%;
}

.chat-row--center-inline .chat-inline {
  align-items: center;
  gap: 4px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-sub);
  border: none;
  box-shadow: none;
  opacity: 0.92;
}

.chat-inline-header {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: 8px;
  width: 100%;
  max-width: 100%;
}

.chat-inline-header .chat-inline-badge {
  grid-column: 1;
}

.chat-inline-header .chat-inline-text {
  grid-column: 2;
}

.chat-inline-header .chat-inline-toggle {
  grid-column: 3;
  justify-self: end;
}

.chat-inline--meta {
  color: #475569;
}

.chat-inline--tool {
  color: #4338ca;
}

.chat-inline--warning {
  color: #c2410c;
}

.chat-inline--error {
  color: #b91c1c;
}

.chat-inline--app-error {
  color: #dc2626;
  font-weight: 600;
}

.chat-inline-badge {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  background: transparent;
  color: inherit;
  border: none;
}

.chat-row--center-inline .chat-inline-badge {
  padding: 0;
  border-radius: 0;
  font-size: 12px;
  letter-spacing: 0.01em;
  text-transform: none;
  background: transparent;
  border: none;
}

.chat-inline-badge::after {
  content: ":";
  margin-left: 4px;
  color: inherit;
}

.chat-row--center-inline .chat-inline-badge::after {
  content: ":";
}

.chat-inline-badge--tool {
  color: #a51c30;
}

.chat-inline-badge--warning {
  color: #b45309;
}

.chat-inline-badge--meta {
  color: #64748b;
}

.chat-inline-badge--error,
.chat-inline-badge--app-error {
  color: #b91c1c;
}

.chat-inline--tool .chat-inline-text {
  color: #3730a3;
}

.chat-inline--warning .chat-inline-text {
  color: #9a3412;
}

.chat-inline--error .chat-inline-text,
.chat-inline--app-error .chat-inline-text {
  color: #991b1b;
}

.chat-inline-text {
  vertical-align: middle;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-size: 12px;
  font-weight: 400;
  color: inherit;
}

.chat-row--center-inline .chat-inline-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: inherit;
  text-align: left;
}

.chat-inline-toggle {
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  cursor: pointer;
  padding: 0;
  opacity: 0.75;
  text-underline-offset: 2px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  min-width: 40px;
  text-align: right;
  white-space: nowrap;
}

.chat-row--center-inline .chat-inline-toggle {
  width: auto;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #6b7280;
  box-shadow: none;
  opacity: 0.75;
}

.chat-row--center-inline .chat-inline-toggle:hover {
  text-decoration: underline;
  border-color: transparent;
  box-shadow: none;
}

.chat-inline-full {
  margin: 2px 0 0;
  padding: 2px 0 0 10px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-left: 2px solid rgba(148, 163, 184, 0.42);
  position: static;
  float: none;
  clear: both;
  width: 100%;
  box-sizing: border-box;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: inherit;
}

.chat-row--center-inline .chat-inline-full {
  margin: 2px 0 0;
  padding: 2px 0 0 10px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-left: 2px solid rgba(148, 163, 184, 0.42);
  color: inherit;
  text-align: left;
}

.chat-inline-full[hidden] {
  display: none !important;
}

.chat-inline.is-expanded {
  opacity: 0.9;
}

.chat-inline.is-expanded .chat-inline-header {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: 8px;
  width: 100%;
  max-width: 100%;
}

.chat-inline.is-expanded .chat-inline-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.chat-inline.is-expanded .chat-inline-toggle {
  justify-self: end;
}

.chat-inline.is-expanded .chat-inline-full {
  display: block;
}

.chat-structured {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  padding: 12px 14px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
}

.chat-structured--info {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.9);
}

.chat-structured--warning {
  border-color: rgba(251, 146, 60, 0.5);
  background: rgba(255, 237, 213, 0.55);
}

.chat-structured--error {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(254, 226, 226, 0.6);
}

.chat-structured-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.chat-structured-subtitle {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 8px;
}

.chat-structured-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-structured-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-sub);
}

.chat-structured-label {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-structured-value {
  color: var(--text-main);
  text-align: right;
  word-break: break-word;
}

.chat-structured-raw {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.chat-structured-raw summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-sub);
}

.chat-structured-raw pre {
  margin: 8px 0 0;
  padding: 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 11px;
  white-space: pre-wrap;
}

.chat-muted {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
  padding: 2px 0;
  line-height: 1.4;
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  box-shadow: 0 6px 14px rgba(88, 12, 31, 0.08);
  backdrop-filter: blur(14px);
}

.chat-composer--template {
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  left: 0;
  right: 0;
  width: min(340px, calc(100% - 28px));
  margin-left: auto;
  margin-right: auto;
  transform: none;
}

.composer-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #9aa3b6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.composer-icon-btn i {
  width: 17px;
  height: 17px;
}

.composer-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(197, 34, 51, 0.32);
  background: rgba(255, 255, 255, 0.86);
  color: #a51c30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform 0.14s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  cursor: pointer;
}

.composer-send-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 245, 246, 0.96);
  border-color: rgba(197, 34, 51, 0.42);
  color: #8f1728;
}

.composer-send-btn:active {
  transform: translateY(0);
  background: rgba(252, 231, 235, 0.82);
  border-color: rgba(197, 34, 51, 0.48);
}

.composer-send-btn i {
  width: 17px;
  height: 17px;
}

.chat-composer input {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  font-size: 14px;
  color: var(--text-main);
}

/* Lobsters config drawer */
.config-backdrop,
.newbie-backdrop,
.contacts-backdrop,
.share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 38, 68, 0.28);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 30;
}

.config-backdrop {
  z-index: 250;
}

.config-backdrop.active,
.newbie-backdrop.active,
.contacts-backdrop.active,
.share-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.newbie-drawer,
.contacts-drawer,
.share-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  padding: 18px 20px calc(var(--nav-clearance) + 24px);
  max-height: calc(100% - 24px);
  overflow-y: auto;
  box-shadow: 0 -10px 24px rgba(49, 40, 78, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.25s ease, opacity 0.2s ease, visibility 0.2s ease;
  z-index: 40;
  pointer-events: none;
}

.contacts-drawer.active {
  transform: translateY(0%);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.newbie-drawer.active {
  transform: translateY(0%);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.share-drawer.active {
  transform: translateY(0%);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: fadeIn 0.3s ease;
}

.wizard-step[hidden] {
  display: none !important;
}

.wizard-qr-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wizard-qr-video-wrap {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(223, 230, 244, 0.95);
  background: radial-gradient(circle at 50% 35%, #f9fbff 0%, #eef3fb 68%, #e7edf8 100%);
  min-height: 230px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 8px 18px rgba(26, 32, 44, 0.08);
}

.wizard-qr-video {
  width: 100%;
  height: min(58vw, 290px);
  min-height: 230px;
  display: block;
  object-fit: cover;
  object-position: center center;
  background: #eef3fb;
}

.wizard-qr-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  pointer-events: none;
}

.wizard-qr-overlay::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(62vw, 200px);
  height: min(62vw, 200px);
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
}

.wizard-qr-overlay span {
  position: relative;
  z-index: 1;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: rgba(248, 251, 255, 0.96);
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.45);
}

.wizard-qr-hint {
  margin-top: 2px;
}

.wizard-qr-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.contacts-drawer [data-wizard-step="qr-import"] .wizard-qr-stage:has([data-contact-qr-error][hidden]) + .wizard-qr-actions {
  margin-top: 10px;
}

.share-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  animation: fadeIn 0.3s ease;
}

.share-step[hidden] {
  display: none !important;
}

.share-warning-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(248, 113, 113, 0.22);
  background: linear-gradient(165deg, rgba(255, 246, 247, 0.95), rgba(255, 255, 255, 0.86));
}

.share-warning-card .wizard-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(248, 113, 113, 0.14);
  color: #b91c1c;
}

.share-warning-card .wizard-icon-box i,
.share-warning-card .wizard-icon-box svg {
  width: 22px;
  height: 22px;
}

.share-warning-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.share-warning-copy strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.share-warning-copy p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #6f7789;
}

.share-qr-mode {
  margin: -2px 0 0;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.share-qr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(226, 231, 240, 0.9);
  background: rgba(255, 255, 255, 0.72);
}

.share-qr-box {
  position: relative;
  width: min(76vw, 260px);
  height: min(76vw, 260px);
}

.share-qr-image {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  border: 1px solid rgba(226, 231, 240, 0.9);
  background: rgba(255, 255, 255, 0.95);
  padding: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.share-qr-panel.is-loading .share-qr-image {
  opacity: 0.1;
  filter: blur(4px) grayscale(0.8);
}

.share-qr-panel.is-loading .share-qr-box::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(197, 34, 51, 0.14);
  border-top-color: #c52233;
  border-radius: 50%;
  animation: share-qr-spin 0.8s linear infinite;
  pointer-events: none;
}

@keyframes share-qr-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.share-payload-row {
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(88, 12, 31, 0.05);
}

.share-payload-row label {
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 800;
  text-transform: uppercase;
  color: #9f7882;
}

.share-payload {
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  font-weight: 700;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  color: #4b5563;
  text-align: left;
  max-height: 110px;
  overflow: auto;
}

.wizard-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px 0;
}

.wizard-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.01);
  width: 100%;
}

.wizard-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 16px rgba(100, 90, 140, 0.08);
  border-color: rgba(197, 34, 51, 0.35);
}

.wizard-card:active {
  transform: scale(0.98);
}

.wizard-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(197, 34, 51, 0.1);
  color: #a51c30;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.wizard-card:hover .wizard-icon-box {
  transform: scale(1.1) rotate(-3deg);
  background: rgba(197, 34, 51, 0.18);
}

.wizard-icon-box i,
.wizard-icon-box svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.wizard-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wizard-card h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.wizard-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 500;
}

.wizard-card-integration {
  font-family: var(--font-display);
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #a51c30 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 1px;
}

.wizard-unavailable-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(248, 113, 113, 0.24);
  background: linear-gradient(170deg, rgba(255, 247, 248, 0.94), rgba(255, 255, 255, 0.92));
  text-align: center;
}

.wizard-unavailable-card .wizard-icon-box {
  width: 52px;
  height: 52px;
  background: rgba(248, 113, 113, 0.16);
  color: #b91c1c;
}

.wizard-unavailable-card h4 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.wizard-unavailable-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #6f7789;
}

.wizard-cloud-plan-card {
  gap: 12px;
  margin-top: 4px;
}

.wizard-cloud-plan-card .wizard-icon-box {
  background: rgba(197, 34, 51, 0.12);
  color: #a51c30;
}

.wizard-cloud-plan-card.is-loading .wizard-icon-box i,
.wizard-cloud-plan-card.is-loading .wizard-icon-box svg {
  animation: spin 0.9s linear infinite;
}

.wizard-cloud-plan-status {
  margin-top: 4px !important;
}

.wizard-cloud-connected-card {
  margin-bottom: 12px;
  border-color: rgba(16, 185, 129, 0.28);
  background: linear-gradient(170deg, rgba(236, 253, 245, 0.92), rgba(255, 255, 255, 0.94));
}

.wizard-cloud-connected-card .wizard-icon-box {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
}

.wizard-cloud-connected-section {
  gap: 12px;
}

.contacts-drawer [data-wizard-step="newbie-cloud-connected"] .wizard-cloud-connected-section {
  margin-bottom: 14px;
}

.contacts-drawer [data-wizard-step="newbie-cloud-connected"] .config-actions--single {
  margin-top: 10px;
  margin-bottom: 8px;
}

.wizard-cloud-connected-section [data-terrapod-cloud-connection-id-input] {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: #1f2937;
  background: rgba(241, 245, 249, 0.82);
}

.config-drawer {
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(235, 238, 247, 0.9);
  border-radius: 0;
  overflow: hidden;
  box-shadow: -8px 0 20px rgba(49, 40, 78, 0.1);
  backdrop-filter: blur(20px);
  transform: translateX(112%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.25s ease, opacity 0.2s ease, visibility 0.2s ease;
  z-index: 260;
  pointer-events: none;
}

.config-drawer.active {
  transform: translateX(0%);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.config-main-view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: calc(var(--safe-top) + 16px) 18px calc(var(--safe-bottom) + 16px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.config-main-view::-webkit-scrollbar {
  display: none;
}

.config-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.config-drawer-header--share-confirm {
  justify-content: center;
}

.config-drawer-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.01em;
  text-align: center;
  flex: 1;
}

.config-drawer-header .page-title {
  font-size: 22px;
  justify-content: center;
  text-align: center;
}

.share-helper--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.newbie-drawer .config-drawer-header .page-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.contacts-drawer [data-wizard-step="newbie-cloud-plan"] .config-drawer-header .page-title {
  display: block;
  line-height: 1.1;
  color: #1f232b;
}

.newbie-drawer .config-drawer-header .page-title .line {
  font-family: inherit;
}

.newbie-drawer .config-drawer-header .page-title .line--hero {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--accent-violet);
}

.newbie-drawer .config-drawer-header .page-title .line--sub {
  font-size: 20px;
  font-weight: 600;
  color: #737b92;
  letter-spacing: 0.04em;
}

.newbie-drawer .config-drawer-header .page-title .line--title {
  font-size: 22px;
  font-weight: 800;
  color: #4a5064;
}

.newbie-drawer .config-drawer-header {
  margin-bottom: 6px;
}

.newbie-drawer .config-divider {
  margin: 10px 0 12px;
}

.contacts-drawer [data-wizard-step="newbie-connect"] .config-drawer-header {
  justify-content: center;
  margin-bottom: 6px;
}

.contacts-drawer [data-wizard-step="newbie-connect"] .config-drawer-header .page-title {
  flex: 0;
  font-size: 26px;
  line-height: 1.05;
  white-space: nowrap;
  margin: 16px 0 18px;
}

.contacts-drawer [data-wizard-step="newbie-connect"] .config-divider {
  margin: 8px 0 10px;
}

.contacts-drawer [data-wizard-step="newbie-connect"] .wizard-options {
  margin-top: 10px;
}

.newbie-drawer .wizard-card-content {
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
}

.newbie-drawer .wizard-corner-badge,
.contacts-drawer .wizard-corner-badge {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #c52233, #a51c30);
  color: #fff;
  border-radius: 0 22px 0 16px;
  box-shadow: -2px 2px 8px rgba(88, 12, 31, 0.2);
  pointer-events: none;
}

.newbie-drawer .wizard-corner-badge--limited,
.contacts-drawer .wizard-corner-badge--limited {
  top: 0;
  right: 0;
  width: 64px;
  height: 64px;
  background: transparent;
  border-radius: 0 22px 0 0;
  box-shadow: none;
  overflow: hidden;
  z-index: 1;
}

.newbie-drawer .wizard-corner-badge span,
.contacts-drawer .wizard-corner-badge span {
  display: none;
}

.newbie-drawer .wizard-corner-badge--limited span,
.contacts-drawer .wizard-corner-badge--limited span {
  position: absolute;
  display: block;
  width: 100px;
  padding: 4px 0;
  background: rgba(197, 34, 51, 0.14);
  color: #a51c30;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  top: 10px;
  right: -28px;
  transform: rotate(45deg);
}

.newbie-drawer .wizard-corner-badge svg,
.contacts-drawer .wizard-corner-badge svg {
  width: 14px;
  height: 14px;
}

.newbie-drawer .wizard-corner-badge--limited i,
.contacts-drawer .wizard-corner-badge--limited i,
.newbie-drawer .wizard-corner-badge--limited svg,
.contacts-drawer .wizard-corner-badge--limited svg {
  display: none;
}

.newbie-drawer .wizard-card--featured,
.contacts-drawer .wizard-card--featured {
  position: relative;
  background: rgba(255, 246, 247, 0.9);
  border: 2px solid rgba(197, 34, 51, 0.3);
  box-shadow: 0 4px 12px rgba(88, 12, 31, 0.14);
}

.newbie-drawer .wizard-card--featured:hover,
.contacts-drawer .wizard-card--featured:hover {
  border-color: rgba(197, 34, 51, 0.62);
  box-shadow: 0 8px 20px rgba(88, 12, 31, 0.2);
  background: #fff;
}

.newbie-drawer .wizard-card--featured .wizard-icon-box,
.contacts-drawer .wizard-card--featured .wizard-icon-box {
  background: linear-gradient(135deg, #fbe3e6, #f3c9d1);
  color: #a51c30;
}

.newbie-drawer .wizard-card h4 {
  font-family: "Avenir Next Rounded", "Nunito", "Segoe UI Rounded", var(--font-display);
  color: #4a5064;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0;
}

.newbie-drawer .wizard-step {
  color: #5f667b;
}

.config-header-spacer {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.config-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-top: 12px;
  position: relative;
  border-radius: 25px;
  width: calc(100% - 8px);
  margin-inline: auto;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 8px rgba(60, 49, 89, 0.07);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.2s ease;
}

.config-profile-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(60, 49, 89, 0.12);
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(165, 28, 48, 0.28);
}

.config-profile-card:focus-visible {
  outline: 2px solid rgba(197, 34, 51, 0.45);
  outline-offset: 2px;
}

.config-profile-avatar {
  width: 78px;
  height: 78px;
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: #fde7ea;
  object-fit: cover;
  box-shadow: 0 6px 12px rgba(88, 12, 31, 0.08);
}

.config-profile-copy {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.config-profile-copy h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: #232a3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-profile-copy p {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: 0.09em;
  font-weight: 800;
  text-transform: uppercase;
  color: #8f95ab;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-profile-share-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.9);
  color: #9099ad;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform 0.16s ease, box-shadow 0.18s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.config-profile-share-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.98);
  border-color: transparent;
  color: #6f7a92;
  box-shadow: 0 6px 14px rgba(73, 84, 114, 0.16);
}

.config-profile-share-btn:active {
  transform: none;
  box-shadow: 0 2px 6px rgba(73, 84, 114, 0.1);
}

.config-profile-share-btn i,
.config-profile-share-btn svg {
  width: 28px;
  height: 28px;
}

.config-profile-enter {
  margin-left: auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9aa3b6;
}

.config-helper--profile-jump {
  margin: 8px 2px 6px;
}

.config-profile-subpage {
  position: absolute;
  inset: 0;
  padding: calc(var(--safe-top) + 16px) 18px calc(var(--safe-bottom) + 16px);
  background: linear-gradient(180deg, rgba(244, 247, 253, 0.98) 0%, rgba(232, 237, 247, 0.98) 100%);
  border-radius: 0;
  box-shadow: inset 0 -18px 36px rgba(44, 37, 67, 0.08);
  backdrop-filter: blur(20px);
  transform: translateX(108%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.24s ease, opacity 0.2s ease, visibility 0.2s ease;
  z-index: 5;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.config-profile-subpage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--safe-bottom) + 16px);
  background: linear-gradient(180deg, rgba(230, 236, 247, 0) 0%, rgba(216, 223, 237, 0.78) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 0;
}

.config-profile-subpage > * {
  position: relative;
  z-index: 1;
}

.config-profile-subpage.active {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.config-profile-subpage.active::after {
  opacity: 0.72;
}

.config-profile-history-sync {
  gap: 8px;
  padding: 0;
  border-radius: 0;
  width: 100%;
  margin-inline: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.config-profile-history-sync .config-section-title {
  color: #8f98af;
  letter-spacing: 0.14em;
}

.config-profile-history-sync .config-helper {
  margin: 0;
  color: #7e879c;
}

.config-actions--history-sync {
  margin-top: 2px;
  gap: 8px;
}

.config-actions--history-sync .pill-btn {
  min-height: 40px;
}

.config-profile-history-sync .config-meta {
  margin: 2px 0 0;
}

.config-profile-path-settings {
  gap: 8px;
  padding: 0;
  border-radius: 0;
  width: 100%;
  margin-inline: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.config-profile-path-settings .config-section-title {
  color: #8f98af;
  letter-spacing: 0.14em;
}

.config-profile-path-settings .config-helper {
  margin: 0;
  color: #7e879c;
}

.config-profile-path-settings .path-settings-list {
  margin: 2px 0 0;
}

.config-pill-tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.config-pill-tabs::-webkit-scrollbar {
  display: none;
}

.config-pill-tab {
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.95);
  color: #929ab0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.config-pill-tab.active {
  background: linear-gradient(145deg, #c52233, #a51c30);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 12px rgba(88, 12, 31, 0.22);
}

.config-note-card {
  margin-top: 12px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.74);
  padding: 18px 18px 60px;
  box-shadow: 0 6px 12px rgba(88, 12, 31, 0.14);
  position: relative;
}

.config-note-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9aa3b6;
}

.config-note-card pre {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #566074;
  white-space: pre-wrap;
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

.config-note-save {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f6f7fb;
  color: #4b5563;
  border: 1px solid #dfe3ed;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.config-note-save:hover {
  background: #eff2f8;
  border-color: #d1d7e4;
  color: #1f2937;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.config-note-save:active {
  transform: translateY(1px) scale(0.99);
}

.config-advanced {
  display: none;
}

.config-advanced.active {
  display: block;
}

.config-helper {
  font-size: 11px;
  color: var(--text-sub);
  margin: 0 0 10px;
  line-height: 1.45;
}

.config-helper--center {
  text-align: center;
}

.config-helper-link {
  border: none;
  background: transparent;
  padding: 0;
  color: #a51c30;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.config-helper-link:hover {
  color: #74121d;
}

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

.config-section--terrarium-info {
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(229, 236, 247, 0.95);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 2px 6px rgba(88, 12, 31, 0.05);
}

.client-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.client-id-label {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.client-id-chip {
  border: 1px solid rgba(226, 231, 240, 0.9);
  background: rgba(255, 255, 255, 0.86);
  color: #374151;
  border-radius: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.client-id-chip:hover {
  border-color: rgba(197, 34, 51, 0.26);
  background: rgba(252, 246, 247, 0.94);
}

.client-id-chip:active {
  background: rgba(252, 231, 235, 0.72);
}

.client-id-chip.is-copied {
  border-color: rgba(197, 34, 51, 0.34);
  background: rgba(252, 231, 235, 0.84);
  color: #74121d;
}

.client-id-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.client-id-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: 0.76;
}

.config-section--terrarium-info [data-env-info] {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(229, 236, 247, 0.95);
  background: rgba(246, 248, 252, 0.74);
  color: #697286;
}

.config-section--collapsible {
  gap: 12px;
}

.config-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.config-section-toggle:hover {
  box-shadow: 0 10px 20px rgba(88, 12, 31, 0.1);
}

.config-section-toggle i {
  transition: transform 0.2s ease;
}

.config-section-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

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

.config-section-body[hidden] {
  display: none;
}

.config-section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9aa3b6;
}

.config-section-title--spaced {
  margin-bottom: 10px;
}

.path-settings-list {
  margin: 0 0 10px;
  padding-top: 1px;
  border-top: none;
  border-bottom: none;
}

.path-settings-list .settings-group {
  border-bottom: none;
  margin-bottom: 8px;
}

.path-settings-list .settings-group:last-child {
  margin-bottom: 0;
}

.path-settings-list--profile .settings-group {
  margin-bottom: 10px;
}

.path-settings-list .settings-row {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 2px 6px rgba(88, 12, 31, 0.04);
}

.path-settings-list--profile .settings-row {
  border-radius: 16px;
  border: 1px solid rgba(229, 236, 247, 0.95);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 5px 10px rgba(88, 12, 31, 0.07);
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.path-settings-list--profile .settings-row:hover {
  transform: translateY(-1px);
  border-color: rgba(210, 221, 239, 0.96);
  box-shadow: 0 9px 18px rgba(69, 62, 100, 0.1);
}

.path-settings-list--profile .settings-row:active {
  transform: translateY(0);
}

.path-settings-list .settings-row::after {
  display: none;
}

.path-settings-list .settings-row:active {
  transform: translateY(1px);
  background: rgba(255, 255, 255, 0.58);
}

.config-profile-path-settings .path-settings-list--profile .settings-row:active {
  transform: translateY(0);
}

.path-settings-list .settings-group[data-mode-locked="true"] .settings-row {
  opacity: 0.72;
}

.path-settings-list .settings-row-left {
  gap: 10px;
}

.path-settings-list .settings-group[data-section="beacon-direct-mode"] > .settings-row .settings-row-left,
.path-settings-list .settings-group[data-section="beacon-terrabus-mode"] > .settings-row .settings-row-left {
  padding-left: 8px;
}

.path-settings-list .settings-row-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(203, 210, 223, 0.8);
  background: rgba(255, 255, 255, 0.32);
  color: #8c95a8;
}

.path-settings-list .settings-row-icon[data-tone="gray"] {
  color: #64748b;
}

.path-settings-list .settings-row-icon[data-tone="primary"] {
  color: #c52233;
}

.path-settings-list .settings-row-text strong {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.005em;
  color: #4b5563;
}

.config-profile-path-settings .path-settings-list--profile [data-cli-path-input],
.config-profile-path-settings .path-settings-list--profile [data-skills-path-input] {
  border-color: rgba(223, 232, 245, 0.95);
  background: rgba(255, 255, 255, 0.82);
}

.path-settings-list .settings-row-text span {
  font-size: 11px;
  color: #97a0b2;
}

.path-settings-list .settings-details-body {
  padding: 6px 12px 10px 30px;
  border-top: none;
  background: transparent;
}

.path-settings-list--profile .settings-details-body {
  margin: 0;
  padding: 8px 0 10px;
  border-radius: 0;
  background: transparent;
}

[data-beacon-terrabus-body].settings-details-body {
  padding-right: 20px;
}

.path-settings-list .settings-details-body.is-mode-locked {
  opacity: 0.52;
  filter: grayscale(0.18);
}

.path-settings-list .settings-details-body.is-mode-locked input,
.path-settings-list .settings-details-body.is-mode-locked textarea,
.path-settings-list .settings-details-body.is-mode-locked select,
.path-settings-list .settings-details-body.is-mode-locked button {
  cursor: not-allowed;
}

.path-settings-list .settings-details-body .config-helper {
  margin: 0 0 8px;
}

.path-settings-list [data-cli-path-input],
.path-settings-list [data-skills-path-input] {
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #4b5563;
}

.path-settings-list [data-cli-path-input]:focus,
.path-settings-list [data-skills-path-input]:focus {
  outline: none;
  border-color: rgba(197, 34, 51, 0.56);
  box-shadow: 0 0 0 3px rgba(197, 34, 51, 0.16);
}

.path-settings-list .settings-details-body .config-actions {
  justify-content: flex-start;
  gap: 8px;
}

.path-settings-list .settings-details-body .config-actions .pill-btn {
  flex: 0 0 auto;
  min-width: 136px;
  padding: 8px 12px;
}

.config-info-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 12px rgba(60, 49, 89, 0.08);
}

.config-info-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(197, 34, 51, 0.14);
  color: #a51c30;
  flex-shrink: 0;
}

.config-info-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.config-info-copy strong {
  font-size: 14px;
  color: #2a3244;
  font-family: var(--font-display);
}

.config-info-copy small {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #97a0b4;
  font-weight: 700;
}

.config-info-badge {
  margin-left: auto;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #0f9f47;
  background: rgba(187, 247, 208, 0.72);
}

.config-divider {
  height: 1px;
  background: var(--border-light);
  margin: 16px 0;
}

.config-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 0px;
}

.config-row--terrabus-beacon-id {
  margin-bottom: 12px;
}

.config-row label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.config-value {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(226, 231, 240, 0.9);
  background: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  overflow-wrap: anywhere;
}

.config-row input {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.config-row input:focus {
  outline: none;
  border-color: rgba(197, 34, 51, 0.56);
  box-shadow: 0 0 0 3px rgba(197, 34, 51, 0.16);
}

.config-avatar-row {
  margin-top: 2px;
}

.config-avatar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(226, 231, 240, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.52);
}

.config-avatar-preview {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  object-fit: cover;
  background: #fde7ea;
  box-shadow: 0 4px 8px rgba(88, 12, 31, 0.08);
}

.config-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.config-avatar-actions .pill-btn {
  flex: 0 0 auto;
  min-width: 120px;
  padding: 8px 12px;
}

.config-meta {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-sub);
  background: rgba(252, 231, 235, 0.82);
  border: 1px solid rgba(197, 34, 51, 0.22);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 16px;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.config-meta strong {
  color: var(--text-main);
}

.config-meta[data-tone="ok"] {
  color: #047857;
  background: rgba(209, 250, 229, 0.86);
}

.config-meta[data-tone="error"] {
  color: #b91c1c;
  background: rgba(254, 226, 226, 0.9);
}

.config-actions {
  display: flex;
  gap: 10px;
  margin-top: 0px;
}

.config-actions--single {
  justify-content: center;
}

.config-actions--single .pill-btn {
  flex: 0 1 220px;
}

.config-actions .pill-btn {
  flex: 1;
}

.config-actions--danger .pill-btn {
  flex: 1;
}

/* Terminal feed entries */
.terminal-entry {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 20px;
  padding: 13px 15px;
  box-shadow: 0 4px 10px rgba(88, 12, 31, 0.06);
  backdrop-filter: blur(14px);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.22s ease;
}

.terminal-entry:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(88, 12, 31, 0.1);
}

.terminal-entry-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.terminal-entry-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
  font-size: 13px;
}

.terminal-entry-time {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.terminal-entry-preview {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobster-card {
  background: white;
  border-radius: 24px;
  padding: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  transition: transform 0.1s;
}

.lobster-card:active {
  transform: scale(0.98);
}

.lobster-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.lobster-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.lobster-info h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.lobster-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.lobster-content {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-sub);
  margin-bottom: 12px;
}

.lobster-actions {
  display: flex;
  gap: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.action-item {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.2s;
}
.action-item:hover { color: var(--accent-pink); }

/* Skills View */

.skills-search {
  position: relative;
  width: clamp(112px, 30vw, 138px);
  height: 36px;
  flex: 0 0 auto;
}

.skills-search--launch {
  width: clamp(128px, 34vw, 156px);
}

.skills-search-trigger {
  position: absolute;
  inset: 0;
  height: 36px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #646f88;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.16s ease, color 0.16s ease, background 0.16s ease, opacity 0.12s ease;
}

.skills-search-trigger:active {
  transform: scale(0.96);
}

.skills-search.is-open .skills-search-trigger {
  border-color: rgba(197, 34, 51, 0.48);
  color: #a51c30;
  background: rgba(197, 34, 51, 0.1);
}

.skills-search-trigger i,
.skills-search-trigger svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.skills-search-field {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  height: 36px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  transition: opacity 0.16s ease, border-color 0.16s ease;
}

.skills-search.is-open .skills-search-field {
  opacity: 1;
  pointer-events: auto;
}

.skills-search.is-open .skills-search-trigger {
  opacity: 0;
  pointer-events: none;
}

.skills-search-field:focus-within {
  border-color: rgba(197, 34, 51, 0.56);
}

.skills-search-field i,
.skills-search-field svg,
.skills-search-clear i,
.skills-search-clear svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
  color: #7d859b;
}

.skills-search-field input {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  width: 100%;
}

.skills-search-field input[type="search"]::-webkit-search-decoration,
.skills-search-field input[type="search"]::-webkit-search-cancel-button,
.skills-search-field input[type="search"]::-webkit-search-results-button,
.skills-search-field input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.skills-search-field input::placeholder {
  color: #9aa2b7;
  font-weight: 500;
}

.skills-search-clear {
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7d859b;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 0.08s ease, color 0.16s ease, background 0.16s ease;
}

.skills-search-clear:active {
  transform: scale(0.92);
}

.skills-search-clear:hover {
  color: #a51c30;
  background: rgba(197, 34, 51, 0.12);
}

.skills-search:not(.is-open) .skills-search-clear {
  display: none;
}

.skills-search:not(.is-open) .skills-search-field input {
  width: 0;
}

.skills-hub-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 18px 126px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
}

.skills-hub-scroll::-webkit-scrollbar {
  display: none;
}

.skills-panel {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 16px rgba(88, 12, 31, 0.08);
  backdrop-filter: blur(14px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skills-panel--marketplace {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0;
  outline: none;
}

.tab-view[data-tab-view="skills"] .skills-panel:not(.skills-panel--marketplace) {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.skills-panel--marketplace .skills-panel-head {
  position: relative;
  z-index: 20;
  overflow: visible;
  padding: 2px 14px 0;
}

.skills-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.skills-store-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  border: none;
  background: transparent;
  color: #7a8398;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.skills-store-link-btn i,
.skills-store-link-btn svg {
  width: 13px;
  height: 13px;
}

.skills-store-link-btn:hover {
  color: #a51c30;
}

.skills-store-link-btn:active {
  transform: translateY(1px);
}

.skill-config-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 28, 39, 0.32);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 108;
}

.skill-config-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.skill-config-page {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 88%;
  background: #fff8f9;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 32px rgba(88, 12, 31, 0.14);
  transform: translateY(104%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.22s ease;
  z-index: 110;
  display: flex;
  flex-direction: column;
}

.skill-config-page.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.skill-config-header {
  padding: 14px 18px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(197, 34, 51, 0.16);
  flex-shrink: 0;
}

.skill-config-drag-handle {
  width: 36px;
  height: 4px;
  background: rgba(197, 34, 51, 0.26);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
  cursor: pointer;
}

.skill-config-title-stack {
  flex: 1;
  min-width: 0;
}

.skill-config-slug-label {
  font-size: 10px;
  font-weight: 600;
  color: #8f95ab;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
  line-height: 1.2;
}

.skill-config-name-label {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-config-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 100px;
  scrollbar-width: none;
}

.skill-config-scroll::-webkit-scrollbar {
  display: none;
}

.skill-config-loading[hidden],
.skill-config-error[hidden] {
  display: none;
}

.skill-config-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 32px 0;
  justify-content: center;
  color: var(--text-sub);
  font-size: 13px;
}

.skill-config-loading i,
.skill-config-loading svg {
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
}

.skill-config-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 8px;
  font-size: 12px;
  color: #dc2626;
  line-height: 1.4;
}

.skill-config-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skill-config-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.skill-config-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #4a5064;
  display: flex;
  align-items: center;
  gap: 5px;
}

.skill-config-field-label .skill-config-field-key {
  font-weight: 400;
  color: #8f95ab;
  font-family: monospace;
  font-size: 11px;
}

.skill-config-field-desc {
  font-size: 11px;
  color: #8f95ab;
  line-height: 1.4;
  margin: 0;
}

.skill-config-input,
.skill-config-textarea,
.skill-config-select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid rgba(197, 34, 51, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
  font-family: inherit;
}

.skill-config-input:focus,
.skill-config-textarea:focus,
.skill-config-select:focus {
  border-color: var(--accent-violet);
}

.skill-config-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.skill-config-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-config-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-violet);
  cursor: pointer;
  flex-shrink: 0;
}

.skill-config-raw-label {
  font-size: 12px;
  font-weight: 600;
  color: #4a5064;
  margin: 0 0 6px;
}

.skill-config-raw-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(197, 34, 51, 0.22);
  border-radius: 8px;
  background: rgba(255, 247, 249, 0.95);
  font-size: 12px;
  font-family: "SF Mono", "Fira Code", monospace;
  color: var(--text-main);
  resize: vertical;
  min-height: 260px;
  outline: none;
  line-height: 1.6;
  transition: border-color 0.15s ease;
}

.skill-config-raw-textarea:focus {
  border-color: var(--accent-violet);
}

.skill-config-no-config[hidden] {
  display: none;
}

.skill-config-no-config {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  color: #8f95ab;
}

.skill-config-no-config i,
.skill-config-no-config svg {
  width: 36px;
  height: 36px;
  color: var(--accent-violet);
}

.skill-config-no-config p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sub);
}

.skill-config-section-divider {
  border: none;
  border-top: 1px solid rgba(197, 34, 51, 0.16);
  margin: 6px 0;
}

.skill-config-missing-env[hidden] {
  display: none;
}

.skill-config-missing-env {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-radius: 9px;
  margin-bottom: 4px;
}

.skill-config-missing-env-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
}

.skill-config-missing-env-list {
  margin: 0;
  padding: 0 0 0 4px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.skill-config-missing-env-list li {
  font-size: 12px;
  color: var(--text-sub);
}

.skill-env-input-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.skill-env-label {
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.02em;
}

.skill-env-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.skill-env-input {
  width: 100%;
  padding: 7px 36px 7px 10px;
  border-radius: 7px;
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-family: var(--font-mono, monospace);
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.skill-env-input:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.15);
}

.skill-env-eye-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: #a0828a;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}

.skill-env-eye-btn:hover {
  color: #d97706;
}

.skill-config-missing-env-list code {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  padding: 1px 5px;
  color: #b45309;
}

.skill-config-desc-card[hidden] {
  display: none;
}

.skill-config-desc-card {
  display: block;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 9px;
  margin-bottom: 8px;
}

.skill-config-desc-text {
  margin: 0;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.6;
  word-break: break-word;
  white-space: normal;
  overflow-wrap: anywhere;
}

.skill-config-section {
  border: 1px solid rgba(197, 34, 51, 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.skill-config-section-title {
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #6f3442;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(248, 217, 221, 0.35);
  border-bottom: 1px solid rgba(197, 34, 51, 0.16);
}

.skill-config-section-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 250, 251, 0.85);
}

.skill-config-section .skill-config-section {
  border-radius: 7px;
}

.skill-config-section .skill-config-section .skill-config-section-title {
  font-size: 10px;
  background: rgba(248, 217, 221, 0.28);
}

.skill-config-select-wrap {
  position: relative;
}

.skill-config-select-wrap::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #a24c5e;
  pointer-events: none;
}

.skill-config-select-wrap .skill-config-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  cursor: pointer;
  width: 100%;
}

option.skill-config-option-active {
  font-weight: 700;
  color: var(--accent-violet);
}

.skill-config-array-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(197, 34, 51, 0.16);
}

.skill-config-array-item {
  background: #fff;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-config-array-item:first-child {
  border-radius: 0;
}

.skill-config-array-item:last-child {
  border-radius: 0 0 9px 9px;
}

.skill-config-array-item-key {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-violet);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.skill-config-array-item-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-config-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.skill-config-input-row .skill-config-input {
  flex: 1;
  min-width: 0;
}

.skill-config-secret-toggle {
  flex-shrink: 0;
  width: 32px;
  height: 34px;
  border: 1px solid rgba(197, 34, 51, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #8f95ab;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}

.skill-config-secret-toggle:hover {
  color: var(--accent-violet);
  border-color: var(--accent-violet);
}

.skills-store-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 28, 39, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 26;
}

.skills-store-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.skills-store-page {
  position: absolute;
  inset: 0;
  --skills-store-surface: #ffffff;
  --skills-store-border: rgba(15, 23, 42, 0.07);
  --skills-store-divider: rgba(15, 23, 42, 0.06);
  --skills-store-heading: #3b3246;
  --skills-store-kicker: #9f7882;
  --skills-store-muted: #7f6a74;
  --skills-store-card-shadow: 0 2px 6px rgba(88, 12, 31, 0.05);
  background:
    var(--bg-inner-panel-wash-1),
    var(--bg-inner-panel-wash-2),
    var(--bg-inner-wallpaper);
  transform: translateX(104%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.26s ease, opacity 0.2s ease;
  z-index: 27;
  display: flex;
  flex-direction: column;
}

.skills-store-page.active {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.skills-store-header {
  padding: calc(var(--safe-top) + 0px) 18px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 0;
  border-bottom: 1px solid var(--skills-store-divider);
  background: var(--skills-store-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translateY(-6px);
}

.skills-store-title-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.skills-store-header .skills-search {
  justify-self: end;
  width: clamp(118px, 31vw, 154px);
}

.skills-store-header > .icon-btn-circle,
.skills-store-header > .skills-store-title-stack,
.skills-store-header > .skills-search {
  transform: translateY(-7px);
}

.skills-store-title-stack span {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--skills-store-kicker);
}

.skills-store-title-stack h3 {
  margin: 0;
  font-family: "Avenir Next Rounded", "Nunito", "Segoe UI Rounded", var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--skills-store-heading);
  line-height: 1.0;
  margin-bottom: 6px;
}

.skills-store-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 18px calc(var(--nav-clearance) + 16px);
  padding: 12px 18px calc(var(--nav-clearance) + 16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skills-store-scroll::-webkit-scrollbar {
  display: none;
}

.skills-store-open .skills-store-scroll {
  padding-bottom: calc(var(--safe-bottom) + 18px);
}

.skills-store-market-row {
  margin: 0;
  min-height: 198px;
  position: relative;
  z-index: 1;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.skills-store-feature {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  background: linear-gradient(145deg, #5f68f2, #7c5cf0 58%, #9f6cf2);
  color: #f8faff;
  box-shadow: var(--skills-store-card-shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.skills-store-feature-eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}

.skills-store-feature h4 {
  margin: 0;
  font-size: 22px;
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.skills-store-feature p {
  margin: 0;
  font-size: 12px;
  color: rgba(243, 246, 255, 0.92);
}

.skills-store-feature .skills-store-get {
  margin-top: 6px;
  align-self: flex-start;
}

.skills-store-section {
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
  z-index: 0;
}

.skills-store-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.skills-store-section-head h4 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--skills-store-heading);
}

.skills-store-section-head span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--skills-store-kicker);
}

.skills-store-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skills-store-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 16px;
  border: 1px solid var(--skills-store-border);
  background: var(--skills-store-surface);
  box-shadow: var(--skills-store-card-shadow);
}

.skills-store-rank {
  width: 16px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #9a7f89;
}

.skills-store-row-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--skills-store-border);
  background: #ffffff;
  color: #a51c30;
  box-shadow: none;
}

.skills-store-row-icon[data-tone="primary"],
.skills-store-row-icon[data-tone="indigo"] {
  color: #a51c30;
  background: #ffffff;
  border-color: var(--skills-store-border);
}

.skills-store-row-icon[data-tone="secondary"],
.skills-store-row-icon[data-tone="blue"] {
  color: #a51c30;
  background: #ffffff;
  border-color: var(--skills-store-border);
}

.skills-store-row-icon[data-tone="tertiary"],
.skills-store-row-icon[data-tone="green"] {
  color: #a51c30;
  background: #ffffff;
  border-color: var(--skills-store-border);
}

.skills-store-row-icon i,
.skills-store-row-icon svg {
  width: 17px;
  height: 17px;
}

.skills-store-row-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.skills-store-row-copy strong {
  font-size: 13px;
  color: var(--skills-store-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skills-store-row-copy p {
  margin: 0;
  font-size: 11px;
  color: var(--skills-store-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skills-store-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #9a7f89;
}

.skills-store-get,
.skills-market-get {
  border: 1px solid rgba(197, 34, 51, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: rgba(197, 34, 51, 0.8);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 7px 11px;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.1s ease;
}

.skills-store-get:hover,
.skills-market-get:hover {
  border-color: rgba(197, 34, 51, 0.56);
  color: rgba(197, 34, 51, 0.92);
  box-shadow: 0 2px 6px rgba(88, 12, 31, 0.16);
}

.skills-store-get:active,
.skills-market-get:active {
  transform: translateY(1px);
}

.skills-store-get.is-open,
.skills-market-get.is-open {
  border-color: rgba(197, 34, 51, 0.56);
  color: rgba(197, 34, 51, 0.92);
  box-shadow: 0 2px 8px rgba(88, 12, 31, 0.18);
}

.skills-store-get:disabled,
.skills-market-get:disabled {
  cursor: default;
}

.skills-install-popover {
  position: absolute;
  z-index: 1250;
  min-width: 170px;
  max-width: min(240px, calc(100vw - 20px));
  border-radius: 14px;
  border: 1px solid rgba(180, 191, 219, 0.5);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 32px rgba(54, 68, 100, 0.2);
  padding: 8px;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  backdrop-filter: blur(8px);
}

.skills-install-popover.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.skills-install-popover-title {
  margin: 0;
  padding: 2px 4px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #7f8aa6;
}

.skills-install-popover-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.skills-install-popover-option {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(247, 249, 255, 0.72);
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.skills-install-popover-option:hover {
  border-color: rgba(129, 140, 248, 0.38);
  background: rgba(238, 242, 255, 0.9);
}

.skills-install-popover-avatar {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  object-fit: cover;
}

.skills-install-popover-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #818cf8;
}

.skills-delete-sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1300;
  background: rgba(15, 23, 42, 0.26);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.skills-delete-sheet-backdrop.is-open {
  opacity: 1;
}

.skills-delete-sheet {
  width: min(360px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(208, 216, 235, 0.64);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  transform: translateY(14px);
  transition: transform 0.18s ease;
}

.skills-delete-sheet-backdrop.is-open .skills-delete-sheet {
  transform: translateY(0);
}

.skills-delete-sheet-copy {
  padding: 14px 16px;
  text-align: center;
}

.skills-delete-sheet-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #1f2a44;
}

.skills-delete-sheet-detail {
  margin: 6px 0 0;
  font-size: 12px;
  color: #5f6d8b;
  line-height: 1.4;
}

.skills-delete-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(224, 231, 255, 0.8);
}

.skills-delete-sheet-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.98);
  color: #a51c30;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 10px;
  cursor: pointer;
}

.skills-delete-sheet-btn--danger {
  color: #dc2626;
}

.skills-market-actions {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.skills-market-actions--row {
  margin-left: auto;
  margin-top: 0;
}

.skills-library-add-btn {
  border: 1px solid rgba(157, 171, 196, 0.52);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.94));
  color: #5a667f;
  padding: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(64, 75, 103, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition: border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.1s ease;
}

.skills-library-add-btn--icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
}

.skills-library-add-btn i,
.skills-library-add-btn svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}

.skills-library-add-btn:hover {
  border-color: rgba(118, 137, 174, 0.62);
  color: #425372;
  box-shadow: 0 2px 6px rgba(64, 75, 103, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.skills-library-add-btn:active {
  transform: translateY(1px);
}

.skills-library-add-btn.is-added {
  border-color: rgba(71, 192, 145, 0.52);
  background: linear-gradient(180deg, rgba(241, 253, 248, 0.98), rgba(230, 250, 241, 0.92));
  color: #067a5f;
  box-shadow: 0 1px 2px rgba(34, 122, 93, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.skills-library-add-btn:disabled {
  cursor: default;
  transform: none;
}

.skills-store-get.is-added,
.skills-market-get.is-added {
  border-color: rgba(148, 163, 184, 0.4);
  color: #64748b;
  background: rgba(241, 245, 249, 0.92);
}

.skills-store-empty {
  margin: 0;
  border-radius: 14px;
  border: 1px dashed rgba(197, 34, 51, 0.35);
  background: rgba(252, 231, 235, 0.4);
  padding: 12px;
  font-size: 11px;
  color: #8f95ab;
}

.skills-kicker {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9aa3b6;
}

.skills-kicker-title {
  white-space: nowrap;
  letter-spacing: 0.12em;
}

.skills-kicker-source {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: -6px;
}

.skills-kicker-source::after {
  content: "";
  position: absolute;
  right: 7px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid rgba(143, 152, 171, 0.92);
  border-bottom: 1.5px solid rgba(143, 152, 171, 0.92);
  transform: rotate(45deg) translateY(-1px);
  opacity: 1;
  pointer-events: none;
}

.skills-kicker-source-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 2px 5px rgba(15, 23, 42, 0.08);
  color: #8f98ab;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  padding: 3px 20px 3px 9px;
  width: 82px;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.skills-kicker-source-select:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 3px 8px rgba(15, 23, 42, 0.12);
}

.skills-kicker-source-select:focus-visible {
  outline: 2px solid rgba(197, 34, 51, 0.28);
  outline-offset: 1px;
}

.skills-panel--library {
  gap: 10px;
}

.skills-panel-head--library {
  align-items: flex-start;
}

.skills-library-headline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.skills-library-meta {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-sub);
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.skills-market-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 1px 2px 5px;
  margin-bottom: 0;
  scrollbar-width: none;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.skills-market-row::-webkit-scrollbar {
  display: none;
}

.skills-grid.skills-grid--installed {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skills-source-group {
  display: block;
}

.skills-source-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0 8px;
  cursor: pointer;
  user-select: none;
  outline: none;
}

.skills-source-summary::-webkit-details-marker,
.skills-source-summary::marker {
  display: none;
  content: "";
}

.skills-source-chevron {
  width: 11px;
  height: 11px;
  color: var(--text-sub);
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.skills-source-group[open] > .skills-source-summary .skills-source-chevron {
  transform: rotate(90deg);
}

.skills-source-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.skills-source-count {
  font-size: 10px;
  color: var(--text-sub);
  opacity: 0.45;
  font-weight: 500;
}

.skills-chip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 8px;
  padding-bottom: 4px;
  overflow: visible;
}

.skills-market-card {
  flex: 0 0 156px;
  min-height: 178px;
  border-radius: 18px;
  border: 1px solid rgba(218, 226, 240, 0.9);
  background: #fff;
  box-shadow: var(--skills-store-card-shadow);
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.18s ease;
}

.skills-market-card:hover {
  transform: none;
  border-color: rgba(206, 216, 232, 0.95);
}

.skills-market-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #a51c30;
  border: 1px solid rgba(220, 228, 242, 0.9);
  background: #fff;
  box-shadow: none;
}

.skills-market-icon svg,
.skills-market-icon i {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.skills-market-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.skills-market-meta {
  display: flex;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #8f95ab;
}

.skills-market-get {
  margin-top: auto;
}

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

.status-dropdown {
  border-top: 1px solid rgba(226, 231, 240, 0.75);
  padding: 8px 12px 14px;
  background: rgba(248, 250, 255, 0.8);
  transition: max-height 0.25s ease, opacity 0.2s ease;
  overflow: hidden;
}

.status-dropdown[hidden] {
  display: block;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.status-dropdown-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 8px;
}

.skills-empty {
  grid-column: 1 / -1;
  border-radius: 14px;
  border: 1px dashed rgba(197, 34, 51, 0.35);
  background: rgba(252, 231, 235, 0.4);
  padding: 14px 16px;
  font-size: 11px;
  color: #8f95ab;
  text-align: center;
  width: 100%;
}

.skill-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.1s ease;
  width: 100%;
  max-width: 78px;
  margin: 0 auto;
  overflow: visible;
}

.skill-chip .skill-status-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-sub);
}

.skill-chip[data-status="ready"] .skill-status-pill {
  background: rgba(16, 185, 129, 0.12);
  color: #0f766e;
}

.skill-chip[data-status="error"] .skill-status-pill {
  background: rgba(248, 113, 113, 0.15);
  color: #b91c1c;
}

.skill-chip[data-status="pending"] .skill-status-pill {
  background: rgba(251, 191, 36, 0.18);
  color: #92400e;
}

.skill-icon-wrap {
  position: relative;
  display: inline-flex;
  overflow: visible;
}

.skill-env-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  padding: 1px 5px;
  border-radius: 20px;
  background: #f59e0b;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  white-space: nowrap;
  letter-spacing: 0.01em;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.skill-icon-box .skill-initial {
  font-weight: 800;
  font-size: 16px;
  color: var(--accent-violet);
}

.skill-icon-box .skill-emoji {
  font-size: 20px;
  line-height: 1;
}

.skill-icon-box .skill-fallback-icon {
  width: 20px;
  height: 20px;
  color: #5c55d9;
  stroke-width: 2.2px;
}
.skill-chip:hover { transform: none; }

.skill-chip:active { transform: scale(0.97); }

.skill-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid white;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transition: shadow 0.2s;
}

.skill-chip:hover .skill-icon-box {
  box-shadow: var(--shadow-soft);
}

.gloss-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  pointer-events: none;
}

.skill-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  text-align: center;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.skills-upload-card {
  margin: 0;
  padding: 15px;
  border-radius: 22px;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skills-upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.skills-upload-header h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.skills-upload-header p {
  margin: 0;
  font-size: 12px;
  color: var(--text-sub);
}

.skills-upload-body {
  border-radius: 18px;
  border: 1px dashed rgba(197, 34, 51, 0.38);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(197, 34, 51, 0.08);
  cursor: pointer;
}

.skills-upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(253, 235, 238, 0.95), rgba(255, 255, 255, 0.92));
  color: #a51c30;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 14px rgba(88, 12, 31, 0.1);
}

.skills-upload-icon svg,
.skills-upload-icon i {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.skills-upload-text span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.skills-upload-text small {
  font-size: 11px;
  color: var(--text-sub);
}

.skills-upload-status {
  font-size: 11px;
  color: var(--text-muted);
}

.skills-upload-status[data-tone="ready"] {
  color: #0f766e;
}

.skills-upload-status[data-tone="idle"] {
  color: var(--text-muted);
}

.skills-upload-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(254, 226, 226, 0.55);
  color: #b91c1c;
  font-size: 12px;
}

.skills-upload-error strong {
  font-size: 12px;
  display: block;
  margin-bottom: 4px;
}

.skills-upload-error p {
  margin: 0;
  color: #b45309;
  font-size: 11px;
}

.skills-tab-btn {
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.66);
  border-radius: 14px;
  padding: 9px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-sub);
  box-shadow: 0 8px 22px rgba(88, 12, 31, 0.09);
  cursor: pointer;
  transition: all 0.2s ease;
}

.skills-tab-btn.active {
  background: linear-gradient(145deg, rgba(253, 235, 238, 0.96), rgba(255, 255, 255, 0.92));
  color: #a51c30;
  border-color: rgba(197, 34, 51, 0.4);
  box-shadow: 0 12px 24px rgba(88, 12, 31, 0.18);
}

.skills-tab-btn:active {
  transform: translateY(1px);
}

.icon-btn-circle.loading i {
  animation: spin 0.9s linear infinite;
}

.skill-chip.skeleton {
  cursor: default;
}

.skill-chip.skeleton .skill-icon-box {
  background: #e2e8f0;
  border-color: #e2e8f0;
  box-shadow: none;
}

.skill-chip.skeleton .skill-label {
  width: 56px;
}

.skill-chip.skeleton .skeleton-line {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Custom Dropzone */
.custom-dropzone {
  margin-top: 16px;
  background: white;
  border: 2px dashed #e2e8f0;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
  position: sticky;
  bottom: 20px;
  z-index: 1;
  backdrop-filter: blur(20px);
}

.drop-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.drop-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--accent-violet-soft);
  color: var(--accent-violet);
  display: grid;
  place-items: center;
}

.drop-text {
  flex: 1;
}

.drop-title {
  margin: 0;
  font-weight: 700;
  color: var(--text-main);
  font-size: 14px;
}

.drop-sub {
  margin: 4px 0 0;
  color: var(--text-sub);
  font-size: 12px;
}

.custom-dropzone input[type="file"] {
  opacity: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Logs Tab */
.logs-content {
  padding: 0 18px 120px;
  flex: 1;
  overflow-y: auto;
}

.logs-content .header-glass {
  margin: 0 -18px;
  border-radius: 0;
}

.terminal-beacon-bar {
  margin-top: 16px;
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.terminal-beacon-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  color: #9aa3b6;
  white-space: nowrap;
}

.terminal-beacon-field {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.terminal-beacon-field::after {
  content: "";
  position: absolute;
  right: 7px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid rgba(143, 152, 171, 0.92);
  border-bottom: 1.5px solid rgba(143, 152, 171, 0.92);
  transform: rotate(45deg) translateY(-1px);
  pointer-events: none;
}

.terminal-beacon-select {
  appearance: none;
  -webkit-appearance: none;
  width: 82px;
  max-width: 100%;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 2px 5px rgba(15, 23, 42, 0.08);
  color: #8f98ab;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  padding: 3px 20px 3px 9px;
  cursor: pointer;
}

.terminal-beacon-select:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 3px 8px rgba(15, 23, 42, 0.12);
}

.terminal-beacon-select:focus-visible {
  outline: 2px solid rgba(197, 34, 51, 0.45);
  outline-offset: 1px;
}

.terminal-beacon-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: #64748b;
}

@media (max-width: 560px) {
  .terminal-beacon-select {
    width: min(100%, 82px);
  }

  .terminal-beacon-meta {
    white-space: normal;
    text-overflow: clip;
  }
}

.term-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 4px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.term-tabs::-webkit-scrollbar { display: none; }

.term-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(226, 232, 240, 0.56);
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-bottom-color: rgba(203, 213, 225, 0.52);
  padding: 6px 10px;
  border-radius: 12px 12px 0 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
}

.term-tab-add {
  padding: 4px 7px;
  min-width: 26px;
  justify-content: center;
  border-radius: 10px 10px 0 0;
  background: rgba(226, 232, 240, 0.42);
}

.term-tab-add:hover {
  background: rgba(197, 34, 51, 0.16);
  color: var(--accent-violet);
}

.term-tab-plus {
  font-size: 16px;
  line-height: 1;
  font-weight: 500;
}

.term-tabs-empty {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
}

.term-tab.active {
  background: #0b1020;
  border-color: rgba(148, 163, 184, 0.5);
  border-bottom-color: #0b1020;
  color: #e2e8f0;
}

.term-tab.dead .term-tab-label {
  opacity: 0.5;
  text-decoration: line-through;
}

.term-tab-close {
  font-size: 14px;
  line-height: 1;
  opacity: 0.4;
  cursor: pointer;
  padding: 0 2px;
}

.term-tab-close:hover {
  opacity: 1;
}

.term-shells {
  flex: 1;
  min-height: 0;
  position: relative;
  margin-top: -2px;
}

.terminal-examples {
  margin-top: 16px;
  padding: 14px 16px 10px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.07);
  color: var(--text-sub);
  font-size: 12px;
}

.terminal-examples::before {
  content: none;
}

.terminal-examples h3 {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
  font-weight: 700;
}

.terminal-examples h3::before {
  content: none;
}

.terminal-examples ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
}

.terminal-examples li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-left: -6px;
  padding: 4px 8px 4px 6px;
  border-radius: 10px;
  border: none;
  background: transparent;
  line-height: 1.32;
}

.terminal-examples li[data-terminal-quick-command] {
  cursor: pointer;
  user-select: none;
  transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}

.terminal-examples li[data-terminal-quick-command]:hover {
  border-color: rgba(148, 163, 184, 0.7);
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.terminal-examples li[data-terminal-quick-command]:focus-visible {
  outline: 2px solid rgba(197, 34, 51, 0.5);
  outline-offset: 2px;
}

.terminal-examples code {
  font-family: "Fira Code", "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 11.5px;
  background: transparent;
  border: none;
  color: #334155;
  padding: 0;
  border-radius: 0;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-ligatures: contextual;
}

.terminal-shell {
  height: 420px;
  margin-top: 0;
  border-radius: 3px 18px 18px 18px;
  overflow: hidden;
  background: #0b1020;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-top-color: #0b1020;
  position: relative;
  box-shadow: var(--shadow-soft);
}

.terminal-shell::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border-top-right-radius: 18px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
}

.terminal-shell .xterm {
  padding: 14px;
}

.terminal-shell .xterm-viewport {
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-top-right-radius: 16px;
  background-color: #0b1020 !important;
}

.terminal-shell .xterm-viewport::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.logs-hint {
  margin: 8px 0 12px;
  color: var(--text-sub);
  font-size: 12px;
}

.logs-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-entry {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 10px;
}

.log-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 14px;
  margin: 0;
}

.log-time {
  color: var(--text-sub);
  font-size: 11px;
}

.log-body {
  margin: 0;
  color: var(--text-sub);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-body-block {
  margin: 0;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 12px;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

.log-empty {
  color: var(--text-sub);
  font-size: 12px;
  text-align: center;
  padding: 12px 0;
}

.log-command-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.log-input-shell {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow-soft);
}

.log-input-shell .prompt {
  color: var(--accent-violet);
  font-weight: 800;
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

.log-input-shell input {
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text-main);
  background: transparent;
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

.pill-btn {
  background: rgba(197, 34, 51, 0.8);
  color: white;
  border: 1px solid rgba(197, 34, 51, 0.7);
  border-radius: 14px;
  padding: 10px 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 10px rgba(88, 12, 31, 0.14);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.pill-btn:active { transform: translateY(1px); }

.pill-btn:hover {
  background: rgba(197, 34, 51, 0.88);
  border-color: rgba(197, 34, 51, 0.78);
  box-shadow: 0 6px 14px rgba(88, 12, 31, 0.18);
}

.pill-btn.ghost {
  background: rgba(255, 255, 255, 0.62);
  color: #4b5563;
  border: 1px solid rgba(226, 231, 240, 0.9);
  box-shadow: 0 5px 12px rgba(88, 12, 31, 0.08);
}

.pill-btn.danger {
  background: linear-gradient(140deg, #f97373, #ef4444);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.12);
}

.pill-btn.danger[data-action="delete-bot-cache"] {
  background: rgba(197, 34, 51, 0.8);
  border-color: rgba(197, 34, 51, 0.7);
  box-shadow: 0 4px 10px rgba(88, 12, 31, 0.14);
}

.pill-btn.danger[data-action="delete-bot-cache"]:hover {
  background: rgba(197, 34, 51, 0.88);
  border-color: rgba(197, 34, 51, 0.78);
  box-shadow: 0 6px 14px rgba(88, 12, 31, 0.18);
}

.pill-btn.ghost.danger {
  background: rgba(254, 226, 226, 0.7);
  color: #b91c1c;
  border-color: rgba(248, 113, 113, 0.4);
}

.pill-btn.danger:disabled,
.pill-btn.ghost.danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Side Log Panel */
.side-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 320px;
  max-width: 80vw;
  height: calc(100% - 24px);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 20px;
  box-shadow: 0 22px 54px rgba(39, 30, 62, 0.26);
  transform: translateX(110%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  z-index: 260;
  backdrop-filter: blur(20px);
}

.side-panel.open {
  transform: translateX(0);
}

.gateway-dev-panel {
  width: min(340px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gateway-dev-meta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-sub);
  padding: 0 12px;
  white-space: pre-line;
}

.gateway-dev-log {
  flex: 1;
  margin: 0 12px 14px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 11px;
  color: var(--text-main);
  overflow-y: auto;
  white-space: pre-wrap;
}

.side-panel-header-glass {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.9);
}

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

.log-tabs {
  flex: 1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.log-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(88, 12, 31, 0.1);
  white-space: nowrap;
}

.log-tab.active {
  background: linear-gradient(145deg, rgba(253, 235, 238, 0.96), rgba(255, 255, 255, 0.92));
  border-color: rgba(197, 34, 51, 0.4);
  color: #a51c30;
}

.log-tab-close {
  font-weight: 800;
  color: var(--text-sub);
  padding-left: 4px;
}

.side-panel-body {
  flex: 1;
  padding: 0 12px 14px;
  overflow-y: auto;
}

/* Hide legacy toast overlays */
#toast-container,
.toast {
  display: none !important;
}

/* Settings View */
.settings-content {
  padding: 0 20px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-clearance) + 14px);
  scrollbar-width: none;
}
.settings-content::-webkit-scrollbar { display: none; }

.settings-content .header-glass {
  margin: 0 -20px;
  border-radius: 0;
}

.settings-section {
  margin-top: 18px;
}

.settings-section-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9aa3b6;
}

.settings-card {
  background: #ffffff;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.96);
  box-shadow:
    0 5px 14px rgba(165, 28, 48, 0.08),
    0 2px 6px rgba(100, 116, 139, 0.08);
  overflow: hidden;
}

.settings-subpage-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0s linear 0.16s;
  z-index: 30;
}

.settings-subpage {
  position: absolute;
  inset: 0;
  --settings-subpage-accent-surface: #ffffff;
  --settings-subpage-accent-surface-strong: #ffffff;
  --settings-subpage-accent-border: rgba(15, 23, 42, 0.07);
  --settings-subpage-divider: rgba(15, 23, 42, 0.06);
  --settings-subpage-inner-surface: #ffffff;
  --settings-subpage-bubble-shadow:
    0 4px 11px rgba(165, 28, 48, 0.07),
    0 2px 5px rgba(100, 116, 139, 0.08);
  background:
    linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.62)),
    var(--bg-inner-wallpaper-wash),
    var(--bg-inner-wallpaper);
  background-repeat: no-repeat;
  background-size:
    100% 100%,
    100% calc(100% + var(--safe-top)),
    100% calc(100% + var(--safe-top));
  background-position:
    0 0,
    0 calc(-1 * var(--safe-top)),
    0 calc(-1 * var(--safe-top));
  backdrop-filter: none;
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-clearance) + 14px);
  overflow-y: auto;
  transition: transform 0.18s ease, opacity 0.16s ease, visibility 0s linear 0.18s;
}

.settings-subpage.active {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0s linear 0s;
}

.settings-subpage-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.2s ease, visibility 0s linear 0s;
}

.settings-subpage .header-glass {
  margin: 0;
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--settings-subpage-divider);
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: sticky;
  top: 0;
  z-index: 1;
  display: block;
}

.settings-subpage[data-settings-subpage-view] .header-glass {
  padding-bottom: 16px;
}

.settings-subpage-header {
  margin-top: 8px;
  margin-bottom: 0;
}

.settings-subpage-header h3 {
  font-family: "Avenir Next Rounded", "Nunito", "Segoe UI Rounded", var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #3b3246;
  position: relative;
  top: 1px;
}

.settings-subpage .settings-section {
  margin: 14px 18px 0;
}

.settings-subpage[data-settings-subpage-view] .settings-section {
  margin-top: 24px;
}

.settings-subpage .settings-section-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: #9f7882;
}

.settings-subpage .config-helper {
  margin: 0 0 12px 10px;
  color: #88656f;
  font-size: 12.5px;
}

.settings-subpage .settings-card {
  border-radius: 22px;
  background: var(--settings-subpage-accent-surface);
  border: 1px solid var(--settings-subpage-accent-border);
  box-shadow: var(--settings-subpage-bubble-shadow);
}

.settings-subpage .settings-card--base-model-auth {
  background: var(--settings-subpage-inner-surface);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--settings-subpage-bubble-shadow);
}

.settings-subpage .settings-card--base-model-auth .settings-row {
  background: #ffffff;
}

.settings-subpage .settings-row {
  padding: 14px 16px;
  background: #ffffff;
}

.settings-subpage .settings-row:active {
  background: #f8fafc;
}

.settings-subpage .settings-row::after {
  left: 72px;
  background: var(--settings-subpage-divider);
}

.settings-subpage .settings-row-text strong {
  font-size: 14px;
  letter-spacing: 0.01em;
}

.settings-subpage .settings-row-text span {
  font-size: 12px;
  color: #8b6872;
}

.settings-subpage .settings-row-meta {
  font-size: 11px;
  font-weight: 700;
  color: #9a757e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-subpage .settings-details-body {
  padding: 14px 16px 14px 72px;
  background: var(--settings-subpage-inner-surface);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.07);
  position: relative;
}

.settings-subpage [data-credential-kind] .settings-card {
  background: var(--settings-subpage-inner-surface);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--settings-subpage-bubble-shadow);
}

.settings-subpage [data-credential-kind] .settings-details-body {
  padding: 14px 16px 8px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.settings-subpage [data-credential-kind] .settings-details-body .config-row:last-child {
  margin-bottom: 0;
}

.settings-subpage [data-credential-kind] .settings-details-aside {
  display: none;
}

.settings-credential-warning {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 14px;
  border-radius: 0;
  border: 0;
  border-top: 1px solid var(--settings-subpage-divider);
  background: transparent;
  margin: 0;
}

.settings-credential-copy strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.settings-credential-copy p {
  margin: 4px 0 0;
  font-size: 11px;
  color: #896873;
}

.settings-credential-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-credential-actions .pill-btn {
  flex: 1 1 140px;
}

.settings-credential-target-row {
  margin-top: 6px;
  margin-bottom: 2px;
  gap: 10px;
}

.settings-credential-target-row label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9a747d;
}

.settings-credential-target-row select {
  width: 100%;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 36px 10px 13px;
  border-radius: 16px;
  border: 1px solid rgba(165, 28, 48, 0.16);
  font-size: 13px;
  font-family: var(--font-display);
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(124, 70, 79, 0.82) 50%),
    linear-gradient(135deg, rgba(124, 70, 79, 0.82) 50%, transparent 50%);
  background-size: 5px 5px, 5px 5px;
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96);
  color: #4b5563;
}

.settings-credential-target-row select::-ms-expand {
  display: none;
}

.settings-credential-target-row select:focus {
  outline: none;
  border-color: rgba(197, 34, 51, 0.56);
  box-shadow: 0 0 0 3px rgba(197, 34, 51, 0.16);
}

.settings-credential-target-hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: #8b6872;
}

.settings-subpage .icon-btn-circle {
  background: #ffffff;
  border-color: rgba(165, 28, 48, 0.14);
  color: #9d2a3a;
  box-shadow: 0 1px 3px rgba(165, 28, 48, 0.08);
}

.settings-subpage .pill-btn {
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(165, 28, 48, 0.1);
}

.settings-subpage .pill-btn:hover {
  box-shadow: 0 3px 8px rgba(165, 28, 48, 0.12);
}

.settings-subpage .pill-btn.ghost {
  background: #ffffff;
  border-color: rgba(165, 28, 48, 0.16);
  box-shadow: none;
}

.settings-subpage .pill-btn.danger {
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.1);
}

.settings-subpage .pill-btn.ghost.danger {
  background: rgba(254, 226, 226, 0.45);
  border-color: rgba(185, 28, 28, 0.24);
  box-shadow: none;
}

.settings-subpage .settings-row-pill {
  padding: 5px 9px;
  background: #ffffff;
  color: #64748b;
  border-color: rgba(148, 163, 184, 0.36);
}

.settings-subpage .settings-row-pill[data-tone="idle"] {
  background: #ffffff;
  color: #9f2f3f;
  border-color: rgba(165, 28, 48, 0.24);
}

.settings-subpage .settings-row-pill[data-tone="ok"] {
  background: #ffffff;
  border-color: rgba(110, 231, 183, 0.5);
}

.settings-subpage .settings-row-pill[data-tone="warn"] {
  background: #ffffff;
  border-color: rgba(250, 204, 21, 0.45);
}

.settings-subpage .settings-row-pill[data-tone="error"] {
  background: #ffffff;
  border-color: rgba(248, 113, 113, 0.46);
}

.settings-credential-warning .config-meta {
  margin: 0;
}

.settings-subpage .settings-details-aside {
  position: absolute;
  left: 18px;
  top: 16px;
  display: flex;
  align-items: flex-start;
}

.settings-subpage .settings-sync-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  border: 1px solid rgba(165, 28, 48, 0.24);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 6px rgba(165, 28, 48, 0.12);
  color: #a51c30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.settings-subpage .settings-sync-btn i {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.settings-subpage .settings-sync-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(165, 28, 48, 0.3);
  box-shadow: 0 3px 8px rgba(165, 28, 48, 0.14);
}

.settings-subpage .settings-sync-btn:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(165, 28, 48, 0.1);
}

.settings-subpage .settings-details-body .config-row {
  margin-bottom: 10px;
}

.settings-subpage .settings-details-body label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9b7680;
}

.settings-subpage .settings-details-body input {
  font-size: 13px;
}

.settings-subpage .settings-details-body .config-row input,
.settings-subpage .settings-details-body .config-row textarea,
.settings-subpage .settings-details-body .config-row select {
  background: #ffffff;
  border: 1px solid rgba(165, 28, 48, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.settings-subpage .settings-details-body .config-row input:focus,
.settings-subpage .settings-details-body .config-row textarea:focus,
.settings-subpage .settings-details-body .config-row select:focus {
  border-color: rgba(197, 34, 51, 0.56);
  box-shadow: 0 0 0 3px rgba(197, 34, 51, 0.16);
}

.settings-subpage [data-account-profile-section] .settings-details-body {
  padding: 16px 18px 18px;
}

.settings-subpage [data-account-profile-section].is-authenticated {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.settings-subpage [data-account-profile-section].is-authenticated .settings-details-body {
  padding: 0;
  background: transparent;
}

.settings-subpage [data-account-profile-section].is-authenticated .account-auth-hero {
  display: none;
}

.settings-subpage [data-account-profile-section].is-authenticated [data-account-auth-feedback] {
  display: none !important;
}

.settings-subpage [data-account-profile-section].is-authenticated [data-account-auth-logged-in] .settings-group--account-list {
  border-radius: 22px;
  border: 1px solid rgba(165, 28, 48, 0.11);
  background: #ffffff;
  box-shadow: var(--settings-subpage-bubble-shadow);
  overflow: hidden;
}

.settings-subpage [data-account-profile-section].is-authenticated [data-account-auth-logged-in] .settings-row {
  padding: 14px 16px;
}

.settings-subpage [data-account-profile-section].is-authenticated [data-account-auth-logged-in] .settings-row--danger .settings-row-text strong {
  color: #d14b6a;
}

.settings-subpage [data-account-profile-section].is-authenticated [data-account-auth-logged-in] .settings-row--danger .settings-row-text span {
  color: #c27a8b;
}

.settings-subpage [data-account-profile-section].is-authenticated [data-account-auth-logged-in] [data-account-profile-feedback] {
  margin: 12px 0 0;
}

.settings-subpage [data-account-register-section] .settings-details-body {
  padding: 16px 18px 18px;
}

.settings-section-label--inline {
  margin: 14px 0 8px;
  letter-spacing: 0.1em;
}

.beacon-management-inline-label {
  margin-top: 16px;
}

.beacon-management-slot .settings-empty {
  padding-top: 12px;
}

.skills-management-slot {
  display: flex;
  flex-direction: column;
}

.skills-management-slot--detail {
  padding: 8px 12px 12px;
}

.skills-management-detail-head {
  padding: 14px 16px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skills-management-detail-meta {
  margin: 0;
  font-size: 12px;
  color: #6f7789;
  font-weight: 600;
}

.settings-row--skills-management-bot {
  gap: 10px;
}

.skills-management-bot-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(197, 34, 51, 0.16), rgba(165, 28, 48, 0.12));
  color: #a51c30;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.skills-management-app-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skills-management-app-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(224, 231, 245, 0.9);
  background: rgba(255, 255, 255, 0.7);
}

.skills-management-app-row.is-installed {
  cursor: pointer;
}

.skills-management-app-row.is-installed:active {
  transform: translateY(1px);
}

.skills-management-app-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(197, 34, 51, 0.14);
  color: #a51c30;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.skills-management-app-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.skills-management-app-copy strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.skills-management-app-copy span {
  font-size: 11px;
  color: #7a8499;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-auth-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(215, 224, 238, 0.9);
  background: linear-gradient(135deg, rgba(235, 244, 255, 0.9), rgba(255, 250, 238, 0.9));
}

.account-auth-hero-main h4 {
  margin: 2px 0 3px;
  font-size: 18px;
  line-height: 1.2;
  color: #1f2937;
}

.account-auth-hero-main p {
  margin: 0;
  font-size: 12px;
  color: #5b6477;
}

.account-auth-kicker {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: #67748b;
}

.account-auth-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-auth-inline--stack {
  flex-direction: column;
  align-items: stretch;
}

.account-auth-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-auth-inline-actions .pill-btn {
  flex: 1 1 140px;
}

.account-auth-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 10px;
}

.account-auth-social[data-account-auth-logged-in] {
  margin: 10px 0 12px;
}

.account-auth-social .pill-btn {
  flex: 1 1 180px;
}

.account-auth-social .pill-btn i,
.account-auth-social .pill-btn svg {
  width: 14px;
  height: 14px;
}

.config-row textarea {
  resize: vertical;
  min-height: 78px;
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-family: var(--font-display);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #4b5563;
}

.config-row textarea:focus {
  outline: none;
  border-color: rgba(197, 34, 51, 0.56);
  box-shadow: 0 0 0 3px rgba(197, 34, 51, 0.16);
}

.settings-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.settings-row:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.6);
}

.settings-row--details > summary:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.6);
}

.settings-row::after {
  content: "";
  position: absolute;
  left: 64px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(228, 232, 240, 0.58);
}

.settings-empty {
  padding: 14px 16px 16px 64px;
  font-size: 12px;
  color: #9aa2b3;
  font-weight: 600;
}

.settings-subpage .settings-empty {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
}

.settings-row:last-child::after {
  display: none;
}

.settings-group {
  display: block;
}

.settings-group:last-child .settings-row::after {
  display: none;
}

.settings-row[aria-expanded="true"] .lucide-chevron-down {
  transform: rotate(180deg);
}

.settings-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.settings-avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(150deg, #fde7ea, #f7d6dc);
  color: #a51c30;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 14px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.settings-avatar.has-image {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 1.5px rgba(205, 212, 228, 0.8);
  overflow: hidden;
}

.settings-avatar.has-image.is-fallback {
  background: linear-gradient(150deg, #fde7ea, #f7d6dc);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.settings-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.settings-row-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(197, 34, 51, 0.12);
  color: #a51c30;
}

.settings-row-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.settings-row-icon[data-tone="primary"] { background: rgba(197, 34, 51, 0.13); color: #c52233; }
.settings-row-icon[data-tone="secondary"] { background: rgba(165, 28, 48, 0.12); color: #a51c30; }
.settings-row-icon[data-tone="tertiary"] { background: rgba(167, 51, 63, 0.13); color: #74121d; }
.settings-row-icon[data-tone="gray"] { background: rgba(148, 163, 184, 0.13); color: #64748b; }

.settings-row-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.settings-row-text strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.settings-row-text span {
  font-family: var(--font-display);
  font-size: 11px;
  color: #9aa2b3;
  font-weight: 600;
}

.settings-row-meta {
  font-size: 12px;
  font-weight: 700;
  color: #9aa2b3;
}

.settings-row--language-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
}

.settings-row--language-option .settings-row-status {
  justify-self: end;
  white-space: nowrap;
}

.settings-row--language-option[aria-pressed="true"] {
  background: rgba(197, 34, 51, 0.06);
}

.settings-row--language-option[aria-pressed="true"] .settings-row-icon {
  background: rgba(197, 34, 51, 0.16);
  color: #a51c30;
}

@media (max-width: 540px) {
  .settings-row--language-option {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 8px;
  }

  .settings-row--language-option .settings-row-status {
    justify-self: start;
  }
}

.settings-card--base-model-auth .settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 12px;
}

.settings-card--base-model-auth .settings-row-left,
.settings-card--base-model-auth .settings-row-text {
  min-width: 0;
}

.settings-card--base-model-auth .settings-row-text span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 78%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 78%, transparent 100%);
}

.settings-card--base-model-auth .settings-row-meta {
  width: 84px;
  text-align: right;
  justify-self: end;
}

.settings-card--base-model-auth .settings-row > .lucide-chevron-right {
  opacity: 0.72;
  flex-shrink: 0;
}

.settings-row-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #9aa2b3;
}

.settings-row-status[hidden] {
  display: none !important;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #f6c7cf;
  box-shadow: 0 0 0 3px rgba(197, 34, 51, 0.2);
}

.status-dot[data-tone="ok"] {
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.22);
}

.status-dot[data-tone="idle"] {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.22);
}

.settings-row-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(253, 186, 116, 0.3);
  color: #d97706;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.settings-row-pill[data-tone="idle"] {
  background: rgba(197, 34, 51, 0.14);
  color: #a51c30;
  border-color: rgba(165, 28, 48, 0.35);
}

.settings-row-pill[data-tone="ok"] {
  background: rgba(187, 247, 208, 0.45);
  color: #047857;
  border-color: rgba(110, 231, 183, 0.68);
}

.settings-row-pill[data-tone="warn"] {
  background: rgba(254, 240, 138, 0.45);
  color: #b45309;
  border-color: rgba(250, 204, 21, 0.56);
}

.settings-row-pill[data-tone="error"] {
  background: rgba(254, 202, 202, 0.5);
  color: #b91c1c;
  border-color: rgba(248, 113, 113, 0.56);
}

.settings-row-pill--auth {
  display: inline-flex;
  width: fit-content;
  margin-top: 2px;
  padding: 4px 8px;
  font-size: 9px;
}

.settings-row i,
.settings-row svg {
  width: 16px;
  height: 16px;
  color: #c2c7d6;
}

.settings-row--details[open] > summary i,
.settings-row--details[open] > summary svg {
  transform: rotate(90deg);
}

.settings-details-body {
  padding: 12px 16px 16px 72px;
  border-top: 1px solid rgba(226, 231, 240, 0.7);
  background: rgba(248, 250, 255, 0.7);
}

.profile-card {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  margin-bottom: 24px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 6px 16px rgba(88, 12, 31, 0.08);
  backdrop-filter: blur(14px);
}

.profile-card:active {
  background: rgba(255, 255, 255, 0.86);
  transform: scale(0.98);
}

.profile-avatar img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  background: #f1f5f9;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-info h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.profile-info p {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin: 0;
}

.profile-badge {
  flex-shrink: 0;
  opacity: 0.4;
}
.profile-badge svg { width: 18px; height: 18px; }

/* Profile Editor Panel */
.settings-panel {
  background: #ffffff;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(88, 12, 31, 0.08);
  backdrop-filter: blur(16px);
  padding: 16px 18px 20px;
  margin-bottom: 24px;
  animation: fadeIn 0.2s ease;
}

.settings-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.settings-panel-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.pill-btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 10px;
}

.profile-editor-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.profile-editor-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: var(--accent-violet-soft);
  box-shadow: 0 4px 12px rgba(88, 12, 31, 0.16);
}

.settings-field {
  margin-bottom: 14px;
}

.settings-field label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.settings-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  font-size: 14px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.58);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.settings-field input:focus {
  border-color: rgba(197, 34, 51, 0.56);
  box-shadow: 0 0 0 3px rgba(197, 34, 51, 0.16);
}

/* Settings Groups (rounded card container) */
.settings-group {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(88, 12, 31, 0.1);
  backdrop-filter: blur(12px);
  overflow: hidden;
  margin-bottom: 24px;
}

.settings-group .setting-item {
  border-radius: 0;
  border: none;
  box-shadow: none;
  position: relative;
  padding: 16px;
}

.settings-group .setting-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 60px;
  right: 0;
  height: 1px;
  background: var(--border-light);
}

.settings-group .setting-item:last-child::after {
  display: none;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.setting-toggle,
.setting-item {
  background: transparent;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  cursor: pointer;
  transition: background 0.2s;
  min-height: 56px;
  text-align: left;
  width: 100%;
}

.setting-toggle:active,
.setting-item:active {
  transform: none;
  background: rgba(255, 255, 255, 0.5);
}

.setting-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.setting-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.setting-icon svg { width: 20px; height: 20px; }

.setting-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.setting-text strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.setting-text small {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}


.setting-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
}

.setting-right {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-sub);
  flex-shrink: 0;
}

.setting-value {
  font-size: 13px;
  color: var(--text-sub);
}

.chevron {
  width: 16px;
  height: 16px;
  opacity: 0.4;
}

.setting-item > svg.lucide-chevron-right {
  color: var(--text-sub);
  width: 20px;
  height: 20px;
  opacity: 0.5;
  transition: transform 0.2s ease;
}

/* Stepper Buttons */
.setting-stepper {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.74);
  color: var(--text-main);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.setting-stepper:active {
  background: rgba(252, 231, 235, 0.88);
}

/* Toggle Pill */
.toggle-pill {
  width: 44px;
  height: 26px;
  border-radius: 99px;
  background: rgba(226, 232, 240, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 2px rgba(88, 12, 31, 0.16);
  position: relative;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}

.toggle-pill::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 6px rgba(0,0,0,0.14);
  transition: transform 0.25s;
}

.toggle-pill.active {
  background: linear-gradient(140deg, #c52233, #a51c30);
  border-color: rgba(197, 34, 51, 0.62);
}

.toggle-pill.active::after {
  transform: translateX(18px);
}

/* About Card */
.settings-about {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(197, 34, 51, 0.12);
  backdrop-filter: blur(16px);
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 24px;
}

.about-logo {
  font-size: 32px;
  color: var(--accent-violet);
  margin-bottom: 8px;
}

.about-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.about-tagline {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 14px;
}

.about-meta {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.about-pill {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text-sub);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px rgba(88, 12, 31, 0.08);
  font-family: "JetBrains Mono", monospace;
}

/* Floating Nav */
.floating-nav {
  position: absolute;
  bottom: var(--nav-offset);
  left: 14px;
  right: 14px;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(24px);
  border-radius: 40px;
  box-shadow: 0 5px 15px rgba(54, 40, 89, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.92);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 12px;
  z-index: 100;
}

.chat-drawer-open .floating-nav,
.chat-drawer-open .home-indicator,
.skills-store-open .floating-nav,
.skills-store-open .home-indicator {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  transition: transform 0.25s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-icon-box {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--text-muted);
  transition: color 0.35s ease;
}

.nav-icon-box svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.nav-item span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: none;
  color: rgba(95, 102, 123, 0.86);
  opacity: 0.92;
  transform: translateY(0);
  transition: color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.nav-item:hover .nav-icon-box,
.nav-item:hover span {
  color: #a51c30;
  opacity: 1;
}

.nav-item.active .nav-icon-box {
  color: #a51c30;
}

.nav-item.active .nav-icon-box svg {
  stroke-width: 2.4;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 8px rgba(88, 12, 31, 0.16);
}

.nav-item.active span {
  color: #a51c30;
  opacity: 1;
  transform: translateY(-1px);
}

.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 10px;
  z-index: 200;
}

/* Utilities */
.bg-pink-400 { background: var(--accent-pink); }
.bg-blue-400 { background: var(--accent-blue); }
.bg-teal-400 { background: var(--accent-teal); }
.bg-orange-400 { background: var(--accent-orange); }

.bg-blue-100 { background: #fde7ea; }
.text-blue-600 { color: #a51c30; }

.bg-purple-100 { background: #f7d6dc; }
.text-purple-600 { color: #a7333f; }

.bg-emerald-100 { background: #fbe3e6; }
.text-emerald-600 { color: #a51c30; }

.bg-slate-200 { background: #e2e8f0; }
.text-slate-700 { color: #334155; }

.bg-orange-100 { background: #ffedd5; }
.text-orange-600 { color: #ea580c; }

.bg-rose-100 { background: #ffe4e6; }
.text-rose-600 { color: #e11d48; }

.bg-pink-100 { background: #fbe3e6; }
.text-pink-600 { color: #a51c30; }

.bg-teal-100 { background: #f7d6dc; }
.text-teal-600 { color: #74121d; }

.bg-cyan-100 { background: #fde7ea; }
.text-cyan-600 { color: #a7333f; }

.bg-amber-100 { background: #fef3c7; }
.text-amber-600 { color: #d97706; }

.bg-indigo-100 { background: #f7d6dc; }
.text-indigo-600 { color: #c52233; }

.bg-yellow-100 { background: #fef9c3; }
.text-yellow-600 { color: #ca8a04; }

/* Toast & Sheet Overrides for Light Mode */
#toast-container {
  bottom: 120px;
}
.toast {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-main);
  box-shadow: var(--shadow-float);
  border: 1px solid white;
}

.bottom-sheet {
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid white;
  color: var(--text-main);
}
.sheet-handle { background: #cbd5e1; }
.sheet-subtitle { color: var(--text-sub); }
.sheet-body { color: var(--text-sub); }
.sheet-icon-large {
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  box-shadow: none;
}

/* System Status Widgets */
.status-details {
  margin-top: 8px;
}

.status-details > summary {
  list-style: none;
}

.status-details > summary::-webkit-details-marker {
  display: none;
}

.status-summary {
  width: 100%;
}

.status-details-body {
  margin-top: 10px;
}

.status-details[open] .status-summary > svg.lucide-chevron-right {
  transform: rotate(90deg);
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 8px;
}

.status-widget {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(88, 12, 31, 0.1);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: row;
  gap: 12px;
  min-height: 56px;
  justify-content: space-between;
  text-align: left;
  align-items: center;
}

.widget-label {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 700;
  letter-spacing: 0.025em;
  margin: 0;
  text-align: left;
}

.widget-value {
  font-size: 14px;
  font-weight: 700;
  color: #52525b;
  margin: 0;
  letter-spacing: -0.01em;
  text-align: right;
}

/* Toast Notifications */
#toast-container {
  position: absolute;
  bottom: 100px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 100;
  pointer-events: none;
  padding: 0 24px;
}

.toast {
  background: rgba(35, 35, 40, 0.9);
  color: #fff;
  padding: 12px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 560px) {
  :root {
    --safe-top-base: 24px;
    --safe-bottom-base: 20px;
    --nav-height: 80px;
    --nav-offset: 18px;
    --lobsters-header-gutter: clamp(14px, calc((min(100vw, var(--mobile-device-max-width)) - 352px) / 2), 24px);
    --lobsters-shell-gutter: clamp(8px, calc((min(100vw, var(--mobile-device-max-width)) - 372px) / 2), 14px);
  }

  body {
    justify-content: center;
    align-items: stretch;
    min-height: 100vh;
    min-height: 100dvh;
  }

  body::before,
  body::after {
    display: none;
  }

  .device {
    width: min(100vw, var(--mobile-device-max-width));
    max-width: var(--mobile-device-max-width);
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0 auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .tab-view[data-tab-view="lobsters"] > .header-glass {
    padding-left: var(--lobsters-header-gutter);
    padding-right: var(--lobsters-header-gutter);
  }

  .tab-view[data-tab-view="lobsters"] > .header-glass .page-title {
    font-size: 23px;
  }

  .tab-view[data-tab-view="lobsters"] > .header-glass .header-actions {
    gap: 8px;
  }

  .tab-view[data-tab-view="lobsters"] > .header-glass .icon-btn-circle {
    width: 38px;
    height: 38px;
  }

  .tab-view[data-tab-view="lobsters"] .lobsters-shell {
    padding-left: var(--lobsters-shell-gutter);
    padding-right: var(--lobsters-shell-gutter);
  }

  .gateway-list-view .chat-detail-header--list {
    padding: 5px 2px 11px;
  }

  .gateway-list-view .chat-detail-title {
    margin-top: 9px;
    font-size: 10px;
    letter-spacing: 0.16em;
  }

  .gateway-list-view .chat-list {
    margin-top: 10px;
    gap: 12px;
  }

  .gateway-list-view .chat-list-item {
    border-radius: 24px;
    padding: 15px 13px;
    gap: 12px;
  }

  .gateway-list-view .chat-list-avatar {
    width: 42px;
    height: 42px;
    border-radius: 16px;
  }

  .gateway-list-view .chat-list-status {
    font-size: 9px;
  }

  .gateway-list-view .chat-list-controls .icon-btn-circle {
    width: 25px;
    height: 25px;
  }

  .gateway-list-view .chat-list-controls .icon-btn-circle i,
  .gateway-list-view .chat-list-controls .icon-btn-circle svg {
    width: 12px;
    height: 12px;
  }

  .settings-content {
    padding: 0 14px;
    padding-bottom: calc(var(--nav-clearance) + 10px);
  }

  .settings-content .header-glass {
    margin: 0 -14px;
  }

  .settings-subpage .header-glass {
    padding: 10px 14px 8px;
  }

  .settings-subpage[data-settings-subpage-view] .header-glass {
    padding-bottom: 12px;
  }

  .settings-subpage-header {
    margin-top: 6px;
    margin-bottom: 0;
  }

  .settings-subpage-header h3 {
    font-size: 22px;
    top: 0;
  }

  .settings-subpage .settings-section {
    margin: 10px 14px 0;
  }

  .settings-subpage[data-settings-subpage-view] .settings-section {
    margin-top: 16px;
  }

  .settings-subpage .settings-card {
    border-radius: 18px;
  }

  .settings-subpage .settings-row {
    padding: 13px 12px;
    gap: 10px;
  }

  .settings-subpage .settings-row::after {
    left: 58px;
  }

  .settings-subpage .settings-row-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .settings-subpage .settings-details-body {
    padding: 12px 12px 12px 58px;
  }

  .settings-subpage .settings-details-aside {
    left: 14px;
    top: 14px;
  }

  .settings-subpage .settings-sync-btn {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .skills-store-header {
    padding: 0 14px 8px;
    grid-template-columns: auto minmax(0, 1fr);
    transform: translateY(-4px);
  }

  .skills-store-header .skills-search {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  .skills-store-header > .icon-btn-circle,
  .skills-store-header > .skills-store-title-stack,
  .skills-store-header > .skills-search {
    transform: translateY(-6px);
  }

  .skills-store-scroll {
    padding: 12px 14px calc(var(--safe-bottom) + 16px);
    gap: 12px;
  }

  .skills-search--launch {
    width: clamp(132px, 38vw, 156px);
  }

  .skills-search--launch .skills-search-trigger {
    gap: 7px;
    padding: 0 14px;
    letter-spacing: 0.03em;
  }

  .floating-nav {
    bottom: calc(var(--safe-bottom) + var(--nav-offset) + 6px);
  }

  .skills-store-section-head {
    align-items: center;
  }

  .skills-store-section-head span {
    max-width: 52%;
    font-size: 9px;
    letter-spacing: 0.05em;
    text-align: right;
  }

  .skills-store-row {
    padding: 10px 9px;
    gap: 8px;
  }

  .skills-store-rank {
    width: 14px;
    font-size: 10px;
  }

  .skills-store-row-copy p {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
  }

  .skills-store-row-meta {
    gap: 4px;
    font-size: 9px;
  }

  .skills-market-actions--row {
    gap: 6px;
  }

  .skills-library-add-btn--icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
  }

  .skills-store-get {
    font-size: 9px;
    padding: 6px 10px;
  }

  .settings-credential-actions .pill-btn {
    flex: 1 1 100%;
  }
}

/* ── Pod Creation Step Flow ─────────────────────────────────────────────── */
.create-pod-intro .config-actions { padding: 0; }
[data-create-pod-open-btn],
[data-create-pod-set-model-btn] { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
[data-create-pod-open-btn] i,
[data-create-pod-set-model-btn] i { display: inline-flex; align-items: center; }
[data-create-pod-open-btn] svg,
[data-create-pod-set-model-btn] svg { width: 15px; height: 15px; flex-shrink: 0; display: block; }
[data-create-pod-result] > .config-actions { justify-content: center; }

.pod-steps {
  list-style: none;
  padding: 20px 16px 8px;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.pod-steps[hidden] { display: none !important; }
.pod-step { display: flex; gap: 14px; align-items: flex-start; }
.pod-step-track { display: flex; flex-direction: column; align-items: center; width: 22px; flex-shrink: 0; }

/* ── Icon circle ── */
.pod-step-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
  background: transparent;
  border: 2px solid var(--border-subtle, #e2e8f0);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

/* pending: tiny center dot */
.pod-step[data-step-status="pending"] .pod-step-icon::before {
  content: '';
  position: absolute;
  inset: 0; margin: auto;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--border-subtle, #cbd5e1);
}

/* ── Active: arc spinner (border trick) ── */
.pod-step[data-step-status="active"] .pod-step-icon {
  border-color: rgba(124, 58, 237, 0.18);
  border-top-color: var(--accent-violet, #7c3aed);
  animation: pod-arc-spin 0.72s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.pod-step[data-step-status="active"] .pod-step-icon::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.07);
  animation: none;
}

/* ── Spinning (stuck): faster pink arc ── */
.pod-step[data-step-status="spinning"] .pod-step-icon {
  border-color: rgba(219, 39, 119, 0.15);
  border-top-color: var(--accent-pink, #db2777);
  border-right-color: rgba(219, 39, 119, 0.45);
  animation: pod-arc-spin 0.48s linear infinite;
}
.pod-step[data-step-status="spinning"] .pod-step-icon::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: rgba(219, 39, 119, 0.06);
  animation: none;
}

/* ── Done: solid green + CSS checkmark ── */
.pod-step[data-step-status="done"] .pod-step-icon {
  background: #16a34a;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
  animation: pod-step-pop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
/* L-shape rotated 45° = checkmark */
.pod-step[data-step-status="done"] .pod-step-icon::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 4px; height: 7px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  border-radius: 0 1px 1px 0;
  transform: translate(-55%, -62%) rotate(45deg);
}

/* ── Error: solid red + CSS × ── */
.pod-step[data-step-status="error"] .pod-step-icon {
  background: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
  animation: pod-step-pop 0.24s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.pod-step[data-step-status="error"] .pod-step-icon::before,
.pod-step[data-step-status="error"] .pod-step-icon::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 9px; height: 2px;
  background: #fff;
  border-radius: 2px;
  animation: none;
}
.pod-step[data-step-status="error"] .pod-step-icon::before { transform: translate(-50%, -50%) rotate(45deg); }
.pod-step[data-step-status="error"] .pod-step-icon::after  { transform: translate(-50%, -50%) rotate(-45deg); }

/* ── Animations ── */
@keyframes pod-arc-spin { to { transform: rotate(360deg); } }
@keyframes pod-step-pop {
  0%   { transform: scale(0.5);  opacity: 0.3; }
  70%  { transform: scale(1.15); opacity: 1;   }
  100% { transform: scale(1);    opacity: 1;   }
}

/* ── Connector line ── */
.pod-step-line {
  width: 1.5px; flex: 1; min-height: 16px;
  background: var(--border-subtle, #e2e8f0);
  margin: 2px 0; border-radius: 2px;
  transition: background 0.45s ease;
}
.pod-step-line--last { background: transparent !important; }
.pod-step[data-step-status="done"] .pod-step-line {
  background: linear-gradient(to bottom, #16a34a 60%, #4ade80);
}

/* ── Body text ── */
.pod-step-body { padding: 5px 0 24px; display: flex; flex-direction: column; gap: 3px; }
.pod-step-label {
  font-size: 13px; font-weight: 600;
  color: var(--text-muted, #94a3b8);
  line-height: 1.2; transition: color 0.2s;
}
.pod-step[data-step-status="active"] .pod-step-label,
.pod-step[data-step-status="spinning"] .pod-step-label,
.pod-step[data-step-status="done"] .pod-step-label { color: var(--text-main); }
.pod-step[data-step-status="error"] .pod-step-label { color: #ef4444; }
.pod-step-desc { font-size: 11px; color: var(--text-muted, #94a3b8); line-height: 1.4; }

/* ── Confirm Dialog ──────────────────────────────────────────────────────── */
.confirm-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 15, 30, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 400;
  transition: opacity 0.2s;
}
.confirm-dialog-backdrop[hidden] { display: none !important; }
.confirm-dialog {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 401;
}
.confirm-dialog[hidden] { display: none !important; }
.confirm-dialog-card {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 300px;
  padding: 28px 24px 20px;
  box-shadow: 0 12px 36px rgba(88, 12, 31, 0.16);
  text-align: center;
}
.confirm-dialog-icon {
  margin-bottom: 12px;
  font-size: 32px;
  line-height: 1;
}
.confirm-dialog-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 8px;
}
.confirm-dialog-message {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
  margin: 0 0 20px;
}
.confirm-dialog-actions {
  display: flex;
  gap: 10px;
}
.confirm-dialog-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.confirm-dialog-btn:hover { opacity: 0.85; }
.confirm-dialog-btn--cancel {
  background: rgba(15, 23, 42, 0.07);
  color: var(--text-sub);
}
.confirm-dialog-btn--ok {
  background: var(--accent-violet);
  color: #fff;
}

/* ─── Login Modal ──────────────────────────────────────────────────────── */
/* ── Login Modal ─────────────────────────────────────────────────────────── */
.login-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 15, 30, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  z-index: 300;
}
.login-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.login-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 301;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.97);
  transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
}
.login-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.login-modal-card {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  width: 100%;
  max-width: 420px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 16px 40px rgba(88, 12, 31, 0.12), 0 2px 8px rgba(88, 12, 31, 0.06);
}

/* Header: back + title centered */
.login-modal-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 16px 16px 0;
  box-sizing: border-box;
}
.login-modal-back {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(197, 34, 51, 0.08);
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.login-modal-back:hover { background: rgba(197, 34, 51, 0.14); }
.login-modal-back svg { width: 18px; height: 18px; }
.login-modal-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
}
.login-modal-header-spacer {
  width: 34px;
  flex-shrink: 0;
}

/* Logo circle */
.login-modal-logo {
  margin: 24px auto 20px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(197, 34, 51, 0.06);
  border: 3px solid rgba(197, 34, 51, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.login-modal-logo img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

/* Tab bar */
.login-modal-tabs {
  display: flex;
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 8px;
}
.login-modal-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
  z-index: 1;
}
.login-modal-tab.active {
  color: var(--text-main);
}
.login-modal-tab:not(:disabled):hover:not(.active) {
  color: var(--text-sub);
}
.login-modal-tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 2.5px;
  background: var(--accent-violet);
  border-radius: 2px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.login-modal-tabs[data-active-index="1"] .login-modal-tab-indicator {
  transform: translateX(100%);
}

/* Body */
.login-modal-body {
  width: 100%;
  padding: 16px 28px 32px;
  box-sizing: border-box;
}
.login-modal-pane { display: none; flex-direction: column; gap: 0; }
.login-modal-pane.active { display: flex; }

/* Input fields with bottom border */
.login-modal-field {
  border-bottom: 1px solid rgba(197, 34, 51, 0.12);
  padding: 0;
  margin-bottom: 0;
}
.login-modal-field--code {
  display: flex;
  align-items: center;
  gap: 0;
}
.login-modal-input {
  width: 100%;
  padding: 15px 4px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  box-sizing: border-box;
}
.login-modal-input::placeholder { color: var(--text-muted); }

/* Send code inline button */
.login-modal-send-code {
  flex: 0 0 auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--accent-violet);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.login-modal-send-code:hover:not(:disabled) { opacity: 0.75; }
.login-modal-send-code:disabled { opacity: 0.4; cursor: not-allowed; color: var(--text-muted); }

/* Full-width rounded submit button */
.login-modal-submit {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 22px;
  background: var(--accent-violet);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 26px;
  transition: opacity 0.15s, transform 0.1s;
}
.login-modal-submit:hover { opacity: 0.9; }
.login-modal-submit:active { transform: translateY(1px); }
.login-modal-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Feedback */
.login-modal-feedback {
  font-size: 12px;
  border-radius: 8px;
  padding: 8px 11px;
  margin-top: 10px;
  display: none;
}
.login-modal-feedback.visible { display: block; }
.login-modal-feedback[data-tone="error"] { color: #c0392b; background: rgba(192, 57, 43, 0.08); }
.login-modal-feedback[data-tone="ok"]    { color: #16a34a; background: rgba(22, 163, 74, 0.08); }

.login-modal-terms {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin: 20px 0 0;
  line-height: 1.6;
}
.login-modal-terms a {
  color: var(--accent-violet);
  text-decoration: none;
  font-weight: 500;
}
.login-modal-terms a:hover { text-decoration: underline; }

/* ── Redeem Code subpage ─────────────────────────────────────────────────── */
.settings-subpage [data-redeem-code-section] .settings-details-body {
  padding: 16px 18px 18px;
}

.config-feedback {
  font-size: 12px;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 10px;
}
.config-feedback[data-tone="error"] { color: #c0392b; background: rgba(192, 57, 43, 0.08); }
.config-feedback[data-tone="ok"]    { color: #16a34a; background: rgba(22, 163, 74, 0.08); }

.redeem-status-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  margin-bottom: 12px;
}
.redeem-status-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-sub);
}
.redeem-status-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #1a1a2e);
}

.redeem-codes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.redeem-code-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  gap: 8px;
}
.redeem-code-item__code {
  font-family: monospace;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  letter-spacing: 0.05em;
}
.redeem-code-item__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.redeem-code-item__remain {
  font-size: 11px;
  color: var(--text-sub);
}
.redeem-code-item__status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
}
.redeem-code-item__status[data-tone="ok"]      { background: rgba(22,163,74,0.12); color: #16a34a; }
.redeem-code-item__status[data-tone="warn"]    { background: rgba(234,179,8,0.12); color: #a16207; }
.redeem-code-item__status[data-tone="error"]   { background: rgba(192,57,43,0.10); color: #c0392b; }
.redeem-code-item__status[data-tone="idle"]    { background: rgba(15,23,42,0.07);  color: #64748b; }
.redeem-code-item__date {
  font-size: 10px;
  color: var(--text-muted);
}

/* H5 模式下始终隐藏模拟手机外壳元素（浏览器和 PWA 通用） */
.status-bar,
.home-indicator {
  display: none !important;
}

