/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Thin scrollbar — applied globally so chat, sidebar, modals, lists all match.
   Monaco renders its own scrollbars and is unaffected. */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, 0.2) transparent;
}
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background-color: rgba(15, 23, 42, 0.18);
    border-radius: 3px;
}
*::-webkit-scrollbar-thumb:hover {
    background-color: rgba(15, 23, 42, 0.32);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Account for fixed header */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: #FFFAFA;
    color: #333333;
    line-height: 1.6;
}

/* iOS Safari auto-zooms when a focused input/textarea has font-size
   below 16px and doesn't zoom back out, making the page feel broken
   after the keyboard closes. 16px is the minimum that suppresses it.
   !important is needed to beat narrower mobile overrides like
   `.chat-input { font-size: 0.9rem }`. Mobile-only — desktop unaffected. */
@media (max-width: 768px) {
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Platform-specific light theme styles matching main site */
.platform-page {
  background: #FFFAFA !important;
  color: #333333 !important;
}

.platform-page body {
  background: #FFFAFA !important;
  color: #333333 !important;
}

.platform-page header {
  padding: 8px 20px;
  border-bottom: 1px solid rgba(63, 140, 255, 0.2);
  background: linear-gradient(135deg, #fff 0%, #f3f3f3 100%);
  color: #333333;
}

.header-guest {
  display: block;
}

.header-user {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header-user-left {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.header-user-left .user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5A9FFF 0%, #3F8CFF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  color: white;
  text-transform: uppercase;
  border: 2px solid rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.header-user-left .user-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.user-name-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-user-left .user-info h2 {
  margin: 0;
  font-size: 18px;
  color: #323130 !important;
}

.verified-badge {
  font-size: 12px;
  color: #51cf66;
  font-weight: 500;
}

.header-user-right {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
}

.impersonation-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.impersonation-input {
  min-width: 200px;
  max-width: 260px;
  width: 200px;
  padding: 6px 10px;
  font-size: 12px;
  flex: 0 1 auto;
}

.impersonation-status {
  font-size: 12px;
  color: #6b6b6b;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.impersonation-user {
  font-weight: 600;
  color: #3F8CFF;
}

.impersonation-controls .btn-secondary {
  white-space: nowrap;
}

/* Mobile header styles */
@media (max-width: 768px) {
  .header-user {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-user-left {
    width: 100%;
  }

  .header-user-left .user-info h2 {
    font-size: 16px;
  }

  .header-user-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .impersonation-controls {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-end;
  }

  .impersonation-input {
    min-width: 140px;
    width: 100%;
    max-width: none;
    order: -1;
  }

  .impersonation-status {
    width: 100%;
    justify-content: flex-end;
    order: -2;
  }
}

@media (max-width: 480px) {
  .header-user-left .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .header-user-left .user-info h2 {
    font-size: 14px;
  }

  .user-name-row {
    flex-wrap: wrap;
    gap: 6px;
  }
}

.admin-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-card h2 {
  margin: 0 0 6px 0;
}

.admin-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 8px;
}

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

.admin-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 160px 120px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e1dfdd;
  border-radius: 10px;
  background: #fffdfa;
}

.admin-header-row {
  font-size: 12px;
  font-weight: 600;
  color: #6b6b6b;
  background: transparent;
  border: none;
  padding: 0 12px;
}

.admin-email {
  font-weight: 600;
  color: #323130;
  word-break: break-word;
}

.uuid-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  min-width: 0;
}

.uuid-details code {
  background: #f0efed;
  border-radius: 4px;
  padding: 3px 5px;
  overflow-wrap: anywhere;
  user-select: all;
}

.uuid-details .uuid-usage { color: #286cce; }
#adminPage .uuid-usage,
#adminPage .uuid-usage:hover { text-decoration: none; }
.team-member-info > .uuid-details { flex-basis: 100%; }
.directory-pagination { margin-top: 12px; }
.admin-team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 3px 12px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #e1dfdd;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.admin-team-row > strong { grid-area: 1 / 1; }
.admin-team-owner { grid-area: 1 / 2; font-size: 12px; }
.admin-team-members { grid-area: 1 / 3; font-size: 12px; }
.admin-team-row > .uuid-details { grid-area: 2 / 1 / 3 / -1; }
#adminPage .admin-list { gap: 4px; }
#adminPage .admin-controls { margin: 6px 0; }
#adminPage #adminSearch,
#adminPage #adminTeamsSearch { flex: 1; width: auto; min-width: 0; }
#adminPage .admin-row { padding: 6px 10px; gap: 8px; border-radius: 6px; }
#adminPage .uuid-details { margin-top: 2px; gap: 4px 8px; }
#adminPage .uuid-details code { padding: 1px 4px; }

@media (max-width: 720px) {
  .admin-team-row { grid-template-columns: minmax(0, 1fr) auto; }
  .admin-team-owner { grid-area: 2 / 1 / 3 / -1; }
  .admin-team-members { grid-area: 1 / 2; }
  .admin-team-row > .uuid-details { grid-area: 3 / 1 / 4 / -1; }
}

.admin-status {
  min-height: 18px;
  font-size: 12px;
  color: #6b6b6b;
  margin-top: 4px;
}

.admin-status[data-kind='error'] {
  color: #fa5252;
}

.admin-status[data-kind='success'] {
  color: #2b8a3e;
}

/* Errors and confirmations as a visible box, like the page's other alerts. */
.admin-status[data-kind='error']:not(:empty),
.admin-status[data-kind='success']:not(:empty) {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.45;
  margin: 10px 0;
}
.admin-status[data-kind='error']:not(:empty) {
  background: #fff5f5;
  border: 1px solid #ffc9c9;
  border-left: 4px solid #e03131;
  color: #c92a2a;
}
.admin-status[data-kind='success']:not(:empty) {
  background: #ebfbee;
  border: 1px solid #b2f2bb;
  border-left: 4px solid #2f9e44;
  color: #2b8a3e;
}

.admin-empty {
  padding: 12px;
  text-align: center;
  color: #6b6b6b;
}

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

  .admin-header-row {
    display: none;
  }
}

/* Legacy horizontal nav (deprecated — now using sidebar.css) */

.platform-page h1 {
  color: #3F8CFF !important;
}

.platform-page h2 {
  color: #323130 !important;
}

.platform-page p {
  color: #605e5c !important;
}

.platform-page main {
  padding: 20px;
  max-width: none;
  margin: 0;
}

/* Legacy mobile nav rules removed — using sidebar.css */

/* Override for editor/chat pages - allow full width */
.platform-page main:has(.editor-layout),
.platform-page main:has(.chat-page-layout) {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.platform-page .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.platform-page .card {
  background: #ffffff;
  border: 1px solid rgba(63, 140, 255, 0.1);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(63, 140, 255, 0.1);
}

.platform-page label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
  color: #323130;
}

.platform-page input {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #e1dfdd;
  background: #ffffff;
  color: #323130;
}

.platform-page input:focus {
  outline: none;
  border-color: #3F8CFF;
  box-shadow: 0 0 0 2px rgba(63, 140, 255, 0.1);
}

/* Legal acknowledgement rows must override the platform form defaults above:
   labels normally stack in a column and inputs receive text-field padding.
   Grid gives the checkbox a fixed column while the copy wraps from the same
   top line at every viewport width. */
.platform-page label.legal-acceptance-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  margin: 12px 0;
  line-height: 1.45;
  cursor: pointer;
}

.platform-page label.legal-acceptance-row > input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: auto;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.platform-page label.legal-acceptance-row > .legal-acceptance-copy {
  display: block;
  min-width: 0;
  color: #323130;
  font-size: 14px;
  font-weight: 400;
}

.platform-page button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(63, 140, 255, 0.3);
  background: #ffffff;
  color: #323130;
  cursor: pointer;
  transition: all 0.3s ease;
}

.platform-page button:hover {
  border-color: rgba(63, 140, 255, 0.5);
}

.platform-page .row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.platform-page pre.out {
  background: #f8f7f5;
  border: 1px solid #e1dfdd;
  border-radius: 10px;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 40px;
  color: #323130;
}

.platform-page code {
  background: #f8f7f5;
  border: 1px solid #e1dfdd;
  border-radius: 6px;
  padding: 2px 6px;
  color: #323130;
}

.platform-page pre {
  background: #1e1e1e;
  border: 1px solid #e1dfdd;
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  margin: 12px 0;
}

.platform-page pre code {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  color: #d4d4d4;
  font-family: 'Courier New', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  display: block;
}

.platform-page .hint {
  opacity: .8;
  font-size: 12px;
  color: #605e5c !important;
}

.platform-page footer {
  padding: 20px;
  color: #605e5c;
  text-align: center;
}

/* Material-inspired components for platform page */
.platform-page .loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 20px;
}

.platform-page .loading-container p {
  color: #605e5c !important;
}

.platform-page .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(63, 140, 255, 0.2);
  border-top: 4px solid #3F8CFF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.platform-page .auth-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.platform-page .auth-container.auth-container--login {
  max-width: 420px;
  margin: 40px auto 0;
  padding: 0 20px;
}

.auth-login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-login-logo .sidebar-logo-icon {
  width: 64px;
  height: 36px;
}

.platform-page .auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 4px;
  border: 1px solid rgba(63, 140, 255, 0.1);
}

.platform-page .tab-button {
  flex: 1;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: #8a8886;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.platform-page .tab-button.active {
  background: #3F8CFF;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(63, 140, 255, 0.3);
}

.platform-page .auth-form {
  display: none;
}

.platform-page .auth-form.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.platform-page .btn-primary {
  width: 100%;
  padding: 12px 24px;
  background: #3F8CFF;
  border: none;
  color: white;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 20px;
}

.platform-page .btn-primary:hover {
  border-color: rgba(63, 140, 255, 0.7);
}

/* "or" divider between password login and Google login */
.platform-page .auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 4px;
  color: #8a94a6;
  font-size: 0.85rem;
}
.platform-page .auth-divider::before,
.platform-page .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(138, 148, 166, 0.3);
}

/* "Continue with Google" button */
.platform-page .btn-google {
  width: 100%;
  display: flex;
  margin-bottom: 10px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 24px;
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.platform-page .btn-google:hover {
  background: #f7f8fa;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15);
}
.platform-page .btn-google:disabled {
  opacity: 0.6;
  cursor: default;
}
.platform-page .btn-google .google-icon {
  flex: 0 0 auto;
}

.platform-page .btn-secondary {
  padding: 10px 20px;
  background: #ffffff;
  border: 1px solid rgba(63, 140, 255, 0.3);
  color: #3F8CFF;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.platform-page .btn-secondary:hover {
  border-color: rgba(63, 140, 255, 0.5);
}

.platform-page .btn-danger {
  padding: 10px 20px;
  background: #3F8CFF;
  border: none;
  color: white;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.platform-page .btn-danger:hover {
  border-color: rgba(220, 53, 69, 0.5);
}

.platform-page .error-message {
  color: #ff6b6b;
  font-size: 14px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 6px;
  display: none;
}

.platform-page .error-message:not(:empty) {
  display: block;
}

.platform-page .success-message {
  color: #51cf66;
  font-size: 14px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(81, 207, 102, 0.1);
  border-radius: 6px;
  display: none;
}

.platform-page .success-message:not(:empty) {
  display: block;
}

.platform-page .user-container {
  max-width: none;
  margin: 0;
  padding: 0 20px 20px;
}

/* Override for editor/chat pages - allow full width */
.platform-page .user-container:has(.editor-layout),
.platform-page .user-container:has(.chat-page-layout) {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Mobile: remove padding for chat layout */
@media (max-width: 768px) {
  .platform-page .user-container:has(.chat-page-layout) {
    padding: 0;
  }

  .platform-page main:has(.chat-page-layout) {
    padding: 0;
  }
}

.platform-page .tier-badge {
  padding: 4px 12px;
  background: #3F8CFF;
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.platform-page .tier-badge.clickable {
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.platform-page .tier-badge.clickable:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.platform-page .tier-badge.clickable:active {
  transform: translateY(0);
}

/* Direct children only: the label's text container stacks above the input, but
   spans NESTED inside it (the i18n text wrapper + the required asterisk) must
   stay inline — else "Name" / "*" / input render on three separate lines. */
.platform-page label > span {
  display: block;
  color: #605e5c;
  font-size: 14px;
  font-weight: 500;
}
.platform-page label > span span {
  display: inline;
}

.platform-page input::placeholder {
  color: #a19f9d;
}

/* API Keys Management */
.platform-page .api-keys-card {
  margin-bottom: 30px;
}

.platform-page .api-keys-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #e1dfdd;
}

.platform-page .api-keys-header h2 {
  margin: 0;
  color: #323130 !important;
}

.platform-page .btn-small {
  padding: 8px 16px;
  font-size: 14px;
  width: auto;
  margin: 0;
}

.platform-page .api-keys-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: #605e5c;
}

.platform-page .spinner-small {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(63, 140, 255, 0.2);
  border-top: 2px solid #3F8CFF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.platform-page .api-keys-list {
  padding: 0;
}

.platform-page .api-key-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #e1dfdd;
  transition: background-color 0.2s ease;
}

.platform-page .api-key-item:hover {
  background-color: #f8f7f5;
}

.platform-page .api-key-item:last-child {
  border-bottom: none;
}

.platform-page .api-key-info {
  flex: 1;
}

.platform-page .api-key-name {
  font-weight: 600;
  color: #323130;
  margin-bottom: 4px;
}

.platform-page .api-key-details {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: #8a8886;
}

.platform-page .api-key-prefix {
  font-family: 'Monaco', 'Courier New', monospace;
  background: #f8f7f5;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e1dfdd;
}

.platform-page .api-key-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.platform-page .status-dot.active {
  background-color: #51cf66;
}

.platform-page .status-dot.inactive {
  background-color: #ff6b6b;
}

.platform-page .api-key-actions {
  display: flex;
  gap: 8px;
  margin-left: 16px;
}

.platform-page .btn-icon {
  padding: 8px;
  border: 1px solid rgba(63, 140, 255, 0.3);
  background: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #605e5c;
}

.platform-page .btn-icon:hover {
  border-color: rgba(63, 140, 255, 0.5);
  color: #3F8CFF;
}

.platform-page .btn-icon.danger {
  border-color: rgba(220, 53, 69, 0.3);
  color: #dc3545;
}

.platform-page .btn-icon.danger:hover {
  border-color: rgba(220, 53, 69, 0.5);
}

.api-key-actions .btn-icon,
.platform-page .api-key-actions .btn-icon,
.telegram-bot-actions .btn-icon,
.platform-page .telegram-bot-actions .btn-icon,
.team-member-actions .btn-icon,
.platform-page .team-member-actions .btn-icon,
.team-invite-item .btn-icon,
.platform-page .team-invite-item .btn-icon {
  border: none !important;
  background: none !important;
  box-shadow: none;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a8886;
}

.api-key-actions .btn-icon:hover,
.platform-page .api-key-actions .btn-icon:hover,
.telegram-bot-actions .btn-icon:hover,
.platform-page .telegram-bot-actions .btn-icon:hover,
.team-member-actions .btn-icon:hover,
.platform-page .team-member-actions .btn-icon:hover,
.team-invite-item .btn-icon:hover,
.platform-page .team-invite-item .btn-icon:hover {
  color: #3F8CFF;
}

.api-key-actions .btn-icon.danger,
.platform-page .api-key-actions .btn-icon.danger,
.telegram-bot-actions .btn-icon.danger,
.platform-page .telegram-bot-actions .btn-icon.danger,
.team-member-actions .btn-icon.danger,
.platform-page .team-member-actions .btn-icon.danger,
.team-invite-item .btn-icon.danger,
.platform-page .team-invite-item .btn-icon.danger {
  color: #8a8886;
}

.api-key-actions .btn-icon.danger:hover,
.platform-page .api-key-actions .btn-icon.danger:hover,
.telegram-bot-actions .btn-icon.danger:hover,
.platform-page .telegram-bot-actions .btn-icon.danger:hover,
.team-member-actions .btn-icon.danger:hover,
.platform-page .team-member-actions .btn-icon.danger:hover,
.team-invite-item .btn-icon.danger:hover,
.platform-page .team-invite-item .btn-icon.danger:hover {
  color: #d13438;
}

.platform-page .no-api-keys {
  padding: 60px 30px;
  text-align: center;
}

.platform-page .empty-state p {
  color: #8a8886 !important;
  margin: 8px 0;
}

.platform-page .empty-subtitle {
  font-size: 14px;
  opacity: 0.8;
}

.platform-page .api-key-meta {
  display: flex;
  gap: 4px;
  align-items: center;
}

.platform-page .api-key-scope {
  background: rgba(63, 140, 255, 0.1);
  color: #3F8CFF;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.platform-page .api-key-usage {
  font-size: 12px;
  color: #8a8886;
}

.platform-page .form-help {
  font-size: 13px;
  color: #8a8886;
  margin-top: 6px;
}

.platform-page .link-button {
  background: none;
  border: none;
  color: #3F8CFF;
  padding: 0;
  margin: 6px 0 0;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

.platform-page .forgot-password-form {
  margin: 12px 0 6px;
}

@media (max-width: 768px) {
  .platform-page .api-key-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
  }

  .platform-page .api-key-details {
    flex-wrap: wrap;
    gap: 8px;
  }

  .platform-page .api-key-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}

/* Telegram Bots Management */
.platform-page .telegram-bots-card {
  margin-bottom: 30px;
}

.platform-page .telegram-bots-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #e1dfdd;
}

.platform-page .telegram-bots-header h2 {
  margin: 0;
  color: #323130 !important;
}

.platform-page .telegram-bots-body {
  padding: 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.platform-page .telegram-bots-intro {
  margin: 0;
  color: #605e5c;
  font-size: 14px;
}

.platform-page .telegram-bots-list {
  display: flex;
  flex-direction: column;
  border: 1px solid #e1dfdd;
  border-radius: 12px;
  overflow: hidden;
}

.platform-page .telegram-bot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e1dfdd;
  background: white;
  transition: background-color 0.2s ease;
}

.platform-page .telegram-bot-item:last-child {
  border-bottom: none;
}

.platform-page .telegram-bot-item:hover {
  background-color: #f8f7f5;
}

.platform-page .telegram-bot-info {
  flex: 1;
  min-width: 0;
}

.platform-page .telegram-bot-name {
  font-weight: 600;
  color: #323130;
  margin-bottom: 6px;
}

.platform-page .telegram-bot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: #605e5c;
}

.platform-page .telegram-bot-meta span {
  background: rgba(96, 94, 92, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
}

.platform-page .telegram-bot-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #605e5c;
  margin-left: 16px;
  white-space: nowrap;
}

.platform-page .telegram-bot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}

.platform-page .telegram-bot-actions .btn-icon {
  font-size: 16px;
}

/* Keep team ERP actions together, including long translations. */
.platform-page #teamErpList .team-member-item {
  flex-wrap: wrap;
  gap: 12px;
}

.platform-page #teamErpList .team-member-info {
  flex: 1 1 160px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.platform-page #teamErpList .team-member-actions {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  margin-left: auto;
}

.platform-page #teamErpList .erp-move-btn {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.platform-page #teamErpList .btn-icon {
  flex: 0 0 32px;
}

.platform-page .telegram-bots-empty {
  padding: 40px 16px;
  text-align: center;
}

.platform-page .empty-state.error p {
  color: #dc3545 !important;
}

/* Header and Navigation */
.header {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    z-index: 1000;
    width: auto;
    max-width: calc(100vw - 2rem);
    animation: slideDownNavbar 0.8s ease-out 0.3s forwards;
}

@keyframes slideDownNavbar {
    from {
        transform: translateX(-50%) translateY(-120px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .header {
        left: 1rem;
        right: 1rem;
        width: calc(100% - 2rem);
        max-width: none;
        transform: translateX(0) translateY(-120px);
        animation: slideDownNavbarMobile 0.8s ease-out 0.3s forwards;
    }
    
    @keyframes slideDownNavbarMobile {
        from {
            transform: translateX(0) translateY(-120px);
            opacity: 0;
        }
        to {
            transform: translateX(0) translateY(0);
            opacity: 1;
        }
    }
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(15px);
    border-radius: 50px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(63, 140, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.6);
    gap: 3rem;
    width: 100%;
    box-sizing: border-box;
}

/* Mobile responsive navigation */
@media (max-width: 768px) {
    .nav-bar {
        gap: 1.5rem;
        padding: 0.6rem 1rem;
        border-radius: 25px;
    }
    
    .nav-menu {
        gap: 1rem;
        flex-wrap: nowrap;
    }
    
    .nav-menu a {
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .language-switcher {
        margin-left: 0.5rem;
    }
    
    .language-switcher select {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #3F8CFF;
    display: flex;
    align-items: center;
    gap: 0;
}

.logo-image {
    height: 1.5rem;
    width: auto;
    vertical-align: middle;
    margin: 0 2px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu a {
    color: #323130;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    display: inline-block;
}

.nav-menu a::after {
    content: attr(data-text);
    font-weight: bold;
    height: 0;
    visibility: hidden;
    overflow: hidden;
    user-select: none;
    pointer-events: none;
    display: block;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #3F8CFF;
    text-shadow: 0 0 0.5px currentColor;
}

.nav-menu a.active {
    position: relative;
}

.nav-menu a.active::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3F8CFF;
    border-radius: 1px;
}

/* Language switcher */
.language-switcher {
    margin-left: 1rem;
}

.language-switcher select {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(63, 140, 255, 0.3);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #323130;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-switcher select:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: #3F8CFF;
}

.language-switcher select:focus {
    outline: none;
    border-color: #3F8CFF;
    box-shadow: 0 0 0 2px rgba(63, 140, 255, 0.2);
}

/* Main content */
main {
    padding-top: 60px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Fixed Background Video */
.bg-video-black {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: -1;
    pointer-events: none;
    opacity: 1;
}

.bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -3;
}

/* Dark overlay over video */
.bg-video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    z-index: -2;
    pointer-events: none;
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 4rem 0 6rem 0;
    text-align: center;
    min-height: 100vh;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Hero Content */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 0 2rem;
}

.hero-title {
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    margin: 0;
    white-space: nowrap;
    line-height: 1;
    animation: fadeInUp 1s ease-out 0.5s both;
}

.hero-large {
    font-size: 5rem;
    font-weight: 600;
}

.hero-small {
    font-size: 3.1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.hero-subtitle {
    font-size: 1.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.1em;
    margin: 1rem 0 0 0;
    animation: fadeInUp 1s ease-out 0.8s both;
}

@media (max-width: 1024px) {
    .hero-title {
        white-space: normal;
    }
    .hero-large {
        font-size: 4rem;
    }
    .hero-small {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-large {
        font-size: 3rem;
    }
    .hero-small {
        font-size: 2rem;
    }
    .hero-subtitle {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero-large {
        font-size: 2.2rem;
    }
    .hero-small {
        font-size: 1.4rem;
    }
    .hero-subtitle {
        font-size: 0.9rem;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    animation: fadeIn 1s ease-out 1.5s both;
}

.scroll-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid rgba(255, 255, 255, 0.8);
    border-bottom: 2px solid rgba(255, 255, 255, 0.8);
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: rotate(45deg) translateY(0);
        opacity: 1;
    }
    50% {
        transform: rotate(45deg) translateY(8px);
        opacity: 0.6;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


.hero-animation {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.animated-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: visible;
}

.lambda-explosion-container {
    transform-origin: center center;
}

.lambda-logo {
    transform-origin: center center;
    filter: blur(0.1px);
}

.lambda-logo-1 {
    animation: explodeLogo1 5s ease-in-out infinite;
}

.lambda-logo-2 {
    animation: explodeLogo2 5s ease-in-out infinite;
}

.lambda-logo-3 {
    animation: explodeLogo3 5s ease-in-out infinite;
}

.lambda-logo-4 {
    animation: explodeLogo4 5s ease-in-out infinite;
}

.lambda-logo-5 {
    animation: explodeLogo5 5s ease-in-out infinite;
}

.lambda-logo-6 {
    animation: explodeLogo6 5s ease-in-out infinite;
}

.lambda-logo-7 {
    animation: explodeLogo7 5s ease-in-out infinite;
}

.lambda-logo-8 {
    animation: explodeLogo8 5s ease-in-out infinite;
}

/* Logo 1 - Top */
@keyframes explodeLogo1 {
    0%, 100% { 
        transform: translate(600px, 200px) scale(1.5) rotate(0deg);
        opacity: 0.9;
    }
    50% { 
        transform: translate(600px, 80px) scale(1.2) rotate(-10deg);
        opacity: 0.7;
    }
}

/* Logo 2 - Top Right */
@keyframes explodeLogo2 {
    0%, 100% { 
        transform: translate(600px, 200px) scale(1.5) rotate(0deg);
        opacity: 0.9;
    }
    50% { 
        transform: translate(1100px, 90px) scale(1.2) rotate(15deg);
        opacity: 0.7;
    }
}

/* Logo 3 - Right */
@keyframes explodeLogo3 {
    0%, 100% { 
        transform: translate(600px, 200px) scale(1.5) rotate(0deg);
        opacity: 0.9;
    }
    50% { 
        transform: translate(1120px, 200px) scale(1.2) rotate(20deg);
        opacity: 0.7;
    }
}

/* Logo 4 - Bottom Right */
@keyframes explodeLogo4 {
    0%, 100% { 
        transform: translate(600px, 200px) scale(1.5) rotate(0deg);
        opacity: 0.9;
    }
    50% { 
        transform: translate(1100px, 310px) scale(1.2) rotate(25deg);
        opacity: 0.7;
    }
}

/* Logo 5 - Bottom */
@keyframes explodeLogo5 {
    0%, 100% { 
        transform: translate(600px, 200px) scale(1.5) rotate(0deg);
        opacity: 0.9;
    }
    50% { 
        transform: translate(600px, 320px) scale(1.2) rotate(0deg);
        opacity: 0.7;
    }
}

/* Logo 6 - Bottom Left */
@keyframes explodeLogo6 {
    0%, 100% { 
        transform: translate(600px, 200px) scale(1.5) rotate(0deg);
        opacity: 0.9;
    }
    50% { 
        transform: translate(100px, 310px) scale(1.2) rotate(-25deg);
        opacity: 0.7;
    }
}

/* Logo 7 - Left */
@keyframes explodeLogo7 {
    0%, 100% { 
        transform: translate(600px, 200px) scale(1.5) rotate(0deg);
        opacity: 0.9;
    }
    50% { 
        transform: translate(80px, 200px) scale(1.2) rotate(-20deg);
        opacity: 0.7;
    }
}

/* Logo 8 - Top Left */
@keyframes explodeLogo8 {
    0%, 100% { 
        transform: translate(600px, 200px) scale(1.5) rotate(0deg);
        opacity: 0.9;
    }
    50% { 
        transform: translate(100px, 90px) scale(1.2) rotate(-15deg);
        opacity: 0.7;
    }
}

/* Content Sections */
.content-section, .products-section, .team-section, .news-section, .downloads-section {
    padding: 4rem 0;
    background: #FFFAFA;
    color: #323130;
}

.content-section h2, .products-section h2, .team-section h2, .news-section h2, .downloads-section h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    text-align: center;
    color: #3F8CFF;
}

.content-section p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    line-height: 1.8;
}

/* Products Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.product-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(63, 140, 255, 0.1);
    border: 1px solid rgba(63, 140, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(63, 140, 255, 0.15);
}

.product-card h3 {
    color: #3F8CFF;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.product-card p {
    color: #605e5c;
    font-size: 1rem;
    text-align: left;
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.team-member {
    text-align: center;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(63, 140, 255, 0.1);
    transition: transform 0.3s ease;
    text-decoration: none;
    display: block;
    cursor: pointer;
}

.team-member:hover {
    transform: translateY(-4px);
    text-decoration: none;
}

.team-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5A9FFF, #3F8CFF);
    margin: 0 auto 1rem auto;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 12px rgba(63, 140, 255, 0.2);
}

.team-member h4 {
    color: #3F8CFF;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.team-member p {
    color: #605e5c;
    font-size: 0.9rem;
    text-align: center;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.news-item {
    background: #ffffff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(63, 140, 255, 0.1);
    border-left: 4px solid #3F8CFF;
}

.news-item h4 {
    color: #3F8CFF;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.news-item p {
    color: #605e5c;
    margin-bottom: 1rem;
    text-align: left;
}

.news-date {
    color: #8a8886;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Downloads Section */
.download-grid {
    display: grid;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.download-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.download-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.download-item h3 {
    color: #3F8CFF;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.download-item p {
    color: #605e5c;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.download-button {
    display: inline-block;
    background: #3F8CFF;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: border-color 0.2s ease;
}

.download-button:hover {
    border-color: rgba(63, 140, 255, 0.7);
}

.download-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.download-info {
    flex: 1;
    min-width: 200px;
}

.download-info h3 {
    color: #3F8CFF;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.download-info p {
    color: #605e5c;
    line-height: 1.5;
    margin: 0;
}

.download-hashes {
    flex: 0 0 auto;
    min-width: 200px;
}

.hash-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.hash-row:last-child {
    margin-bottom: 0;
}

.hash-label {
    color: #605e5c;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

.hash-value {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.7rem;
    color: #323130;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    word-break: break-all;
    user-select: all;
    max-width: 280px;
}

.download-action {
    flex: 0 0 auto;
}

@media (max-width: 768px) {
    .download-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .download-hashes {
        width: 100%;
    }

    .hash-value {
        max-width: 100%;
    }
}

.downloads-card > h2 {
    margin-bottom: 1.5rem;
}

/* Downloads Header with Branch Switcher */
.downloads-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.downloads-header h2 {
    margin-bottom: 0;
}

.branch-switcher {
    display: flex;
    background: none;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.branch-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #605e5c;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.branch-btn:hover {
    color: #323130;
    border-color: rgba(63, 140, 255, 0.3);
}

.branch-btn.active {
    background: #e8f2fd;
    color: #3F8CFF;
    box-shadow: none;
    font-weight: 500;
}

.branch-btn.active[data-branch="develop"] {
    background: #e8f4fd;
    color: #66ACE1;
}

/* Download Platform Sections */
.download-info .download-signing-warning {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid #a15c00;
    border-radius: 4px;
    background: #fff4ce;
    color: #704000;
}

.download-platform-section {
    padding: 1.5rem;
    border: 1px solid rgba(63, 140, 255, 0.15);
    border-radius: 10px;
    margin-bottom: 1.25rem;
    background: rgba(63, 140, 255, 0.03);
}

.download-platform-section:last-child {
    margin-bottom: 0;
}

.platform-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 1.15rem;
    color: #323130;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Build version shown inline, to the right of the "Windows" heading — small and
   muted since it's metadata. Windows-only (the build-info is the Windows build). */
.platform-version {
    font-size: 0.72rem;
    font-weight: 400;
    color: #8a94a6;
    margin-left: auto;        /* push to the far right of the heading row */
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.platform-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.download-button-windows,
.download-button-macos,
.download-button-ios,
.download-button-android {
    background: #0078D4;
    font-size: 1rem;
    padding: 0.9rem 0;
    width: 260px;
    text-align: center;
    box-sizing: border-box;
}

.download-button-windows:hover,
.download-button-macos:hover,
.download-button-ios:hover,
.download-button-android:hover {
    border-color: rgba(63, 140, 255, 0.7);
}

.download-button-disabled {
    display: inline-block;
    background: #a0a0a0;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 500;
    cursor: default;
    opacity: 0.7;
}

.download-platform-coming-soon {
    opacity: 0.6;
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

.download-platform-coming-soon .platform-heading {
    color: #605e5c;
}

.download-platform-section .download-info h4 {
    color: #3F8CFF;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Usage Costs Section */
.usage-costs-card {
    margin: 0;
}

.usage-costs-card + .usage-costs-card {
    margin-top: 1rem;
}

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

.period-selector {
    padding: 0.5rem 1rem;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.period-selector:hover,
.period-selector:focus {
    border-color: #3F8CFF;
    outline: none;
}

.costs-filters {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.costs-filters .btn-icon {
    padding: 0.4rem 0.6rem;
    min-width: auto;
    width: auto;
    height: auto;
    border-radius: 8px;
    border: none;
    background: none;
    font-size: 1.4rem;
}

.tag-filter {
    padding: 0.5rem 1rem;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    min-width: 200px;
    transition: border-color 0.3s ease;
}

/* Checkbox and "Kundenansicht" on one line. The page-wide form rules
   (.platform-page label: a column; .platform-page input: text-field padding)
   would otherwise put the box above the text, so this is more specific. */
.platform-page label.cost-customer-view {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}

.platform-page label.cost-customer-view > input[type="checkbox"] {
    margin: 0;
    padding: 0;
    width: auto;
    flex-shrink: 0;
}

.tag-filter:hover,
.tag-filter:focus {
    border-color: #3F8CFF;
    outline: none;
}

.costs-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #605e5c;
}

.costs-summary {
    background: #f8f8f8;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.costs-summary-row {
    display: flex;
    gap: 2rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.cost-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.costs-summary-row .cost-total {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    margin-bottom: 0;
}

.cost-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #323130;
}

.cost-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3F8CFF;
}

.cost-period {
    margin-top: 0.5rem;
}

.period-text {
    font-size: 0.9rem;
    color: #605e5c;
}

.costs-breakdown {
    margin-top: 1.5rem;
}

.breakdown-heading {
    font-size: 0.95rem;
    font-weight: 600;
    color: #605e5c;
    margin: 1.25rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.api-cost-section {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.api-cost-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.api-name {
    font-weight: 600;
    color: #323130;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.api-total {
    font-weight: 600;
    color: #3F8CFF;
}

.former-member-tag {
    margin-left: 0.5rem;
    font-weight: 500;
    color: #a0a0a0;
    text-transform: none;
    font-size: 0.8rem;
    font-style: italic;
}

.api-cost-details {
    font-size: 0.85rem;
    color: #605e5c;
    margin-bottom: 0.5rem;
}

.model-costs {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.model-cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.85rem;
}

.model-cost-item.model-header {
    font-weight: 600;
    padding: 0.5rem 0 0.25rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.model-cost-item.tag-item {
    padding-left: 1rem;
    font-size: 0.8rem;
    color: #8a8886;
}

.model-name {
    color: #605e5c;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.model-header .model-name {
    color: #323130;
    font-weight: 600;
}

.model-cost {
    color: #323130;
}

.tag-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(63, 140, 255, 0.1);
    color: #3F8CFF;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0 0.5rem;
}

.no-costs {
    text-align: center;
    color: #605e5c;
    padding: 2rem;
    font-style: italic;
}

/* Keep team costs hidden before auth and for every tier below admin,
   even when tab/owner visibility code changes inline display styles. */
body:not(.cost-admin) .team-cost-admin-only {
    display: none !important;
}

/* Team / Organization */
.team-card {
    margin-bottom: 0;
}

.team-tab-section > .team-card + .team-card {
    margin-top: 1rem;
}

.team-usage-secondary {
    margin-top: 1rem;
}

.team-create-form,
.team-invite-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.75rem;
}

.platform-page .team-create-form .form-input,
.platform-page .team-invite-form .form-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 200px;
    max-width: 400px;
}

.platform-page .team-create-form .btn-primary,
.platform-page .team-create-form .btn-secondary,
.platform-page .team-invite-form .btn-primary,
.platform-page .team-invite-form .btn-secondary {
    width: auto;
    margin-top: 0;
    flex-shrink: 0;
}

.team-org-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.team-org-name-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.team-member-item,
.team-invite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: white;
}

.team-member-info,
.team-invite-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.team-member-email,
.team-invite-email {
    font-weight: 500;
}

.team-member-tier {
    font-size: 0.85rem;
    color: #605e5c;
}

.team-invite-expires {
    font-size: 0.85rem;
    color: #605e5c;
}

/* Share-with-organization toggle button (team > Shared > clients list).
   Unshared: blue outline "Share". Shared: solid blue "Shared" that turns red
   with a "Stop sharing" label on hover (label swap is pure CSS). */
.share-toggle-btn {
    border: 1px solid #3F8CFF;
    border-radius: 6px;
    background: transparent;
    color: #3F8CFF;
    font-weight: 600;
    cursor: pointer;
    min-width: 120px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.share-toggle-btn:hover {
    background: rgba(63, 140, 255, 0.08);
}
.share-toggle-btn.shared {
    background: #3F8CFF;
    border-color: #3F8CFF;
    color: #fff;
}
.share-toggle-btn.shared:hover {
    background: #fa5252;
    border-color: #fa5252;
}
.share-toggle-btn .share-label-hover {
    display: none;
}
.share-toggle-btn.shared:hover .share-label-default {
    display: none;
}
.share-toggle-btn.shared:hover .share-label-hover {
    display: inline;
}
.share-toggle-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.team-role-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.team-role-badge.owner {
    background: #e8f0fe;
    color: #1a56db;
}

.team-role-badge.member {
    background: #f0f0f0;
    color: #605e5c;
}

.team-role-badge.editor {
    background: #e6f4ea;
    color: #137333;
}

.team-invite-role {
    font-size: 0.85rem;
    color: #605e5c;
}

.platform-page .team-role-select,
.platform-page .team-invite-form .form-input.team-role-select {
    width: auto;
    min-width: 0;
    max-width: none;
    flex: 0 0 auto;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    margin-top: 0;
}

.team-invite-status {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.team-invite-status.success {
    background: #e6f4ea;
    color: #1e7e34;
}

.team-invite-status.error {
    background: #fce8e6;
    color: #c5221f;
}

.btn-danger {
    background: #c5221f;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-danger:hover {
    background: #a31b19;
}

.org-invite-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.org-invite-modal {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem 2.25rem;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    position: relative;
    font-size: 1.05rem;
    line-height: 1.5;
}

.org-invite-modal.error {
    border-top: 4px solid #d93025;
}

/* button.<class> so these tie the `.platform-page button` base rule's
   specificity and win by source order — a bare .org-invite-close loses the
   border/background/padding fight and renders as a blue-bordered pill. */
button.org-invite-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: transparent;
    border: 0;
    font-size: 1.75rem;
    line-height: 1;
    color: #5f6368;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

button.org-invite-close:hover {
    color: #202124;
}

button.org-invite-close:focus,
button.org-invite-close:focus-visible {
    outline: none;
    box-shadow: none;
}

.org-invite-message {
    margin-bottom: 1.25rem;
}

.org-invite-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.org-invite-accept-btn {
    white-space: nowrap;
}

.smallinvoice-scope-list {
    display: flex;
    flex-direction: column;
    margin-top: 6px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    padding: 6px 10px;
}

/* Scoped under .smallinvoice-scope-list so these win over the global
   .platform-page label (flex-direction:column) and .platform-page input
   (padded box) rules, which otherwise stack the checkbox above the label. */
.smallinvoice-scope-list .scope-check {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0;
    padding: 2px 0;
    font-size: 13px;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
}

.smallinvoice-scope-list .scope-check span {
    display: inline;
    color: #323130;
    font-size: 13px;
    font-weight: 400;
}

.smallinvoice-scope-list .scope-check input[type="checkbox"] {
    appearance: auto;
    -webkit-appearance: auto;
    width: 15px;
    height: 15px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    flex: 0 0 auto;
    cursor: pointer;
}

/* Footer */
.footer {
    background: #323130;
    color: #ffffff;
    text-align: center;
    height: 500px;
    padding-top: 2rem;
}

.footer p {
    margin: 0;
    opacity: 0.9;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        top: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
        transform: none;
        width: auto;
    }
    
    .nav-bar {
        padding: 0.8rem 1rem;
        flex-direction: column;
        gap: 1rem;
        border-radius: 20px;
    }
    
    .nav-menu {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary, .btn-secondary {
        width: 200px;
        text-align: center;
    }
    
    .content-section h2, .products-section h2, .team-section h2, .news-section h2, .downloads-section h2 {
        font-size: 2rem;
    }
    
    .product-grid, .team-grid, .news-grid {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Animation for page load */
.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Editor Layout */
.editor-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 20px);
    margin: 0;
    width: 100%;
    min-width: 0;
    flex: 1;
}

@media (max-width: 1550px) {
    .editor-layout {
        max-width: 100%;
    }
}

@media (max-width: 1200px) {
    .editor-layout {
        max-width: 100%;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .editor-layout {
        max-width: 100%;
        margin: 0;
    }
}

/* File Sidebar */
.file-sidebar {
    width: 200px;
    background: #f8f9fa;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.file-sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    min-height: 60px;
    box-sizing: border-box;
}

.file-sidebar-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #323130;
}

.file-sidebar-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    color: #605e5c;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.editor-icon-btn,
.platform-page .editor-icon-btn {
    background: none !important;
    border: none !important;
    box-shadow: none;
    width: auto;
    height: auto;
    padding: 4px;
    color: #8a8886;
    transition: color 0.15s;
}

.editor-icon-btn:hover,
.platform-page .editor-icon-btn:hover {
    color: #3F8CFF;
    background: none !important;
    border: none !important;
}

.btn-icon:hover {
    border-color: rgba(63, 140, 255, 0.3);
}

.file-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.file-list-loading {
    padding: 16px;
    text-align: center;
    color: #605e5c;
    font-size: 13px;
}

.file-list-empty {
    padding: 16px;
    text-align: center;
    color: #a19f9d;
    font-size: 13px;
}

.file-item {
    padding: 10px 12px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.file-item:hover {
    background: #f3f2f1;
}

.file-item.active {
    background: rgba(63, 140, 255, 0.08);
    border-left-color: #3F8CFF;
}

.file-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.file-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #323130;
    word-break: break-word;
}

.file-item-meta {
    font-size: 11px;
    color: #a19f9d;
}

.file-item-delete {
    background: none;
    border: none;
    font-size: 16px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    color: #a19f9d;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.file-item.active .file-item-delete {
    display: flex;
}

.file-item-delete:hover {
    background: rgba(63, 140, 255, 0.1);
    color: #5A9FFF;
}

/* Editor Area */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    min-width: 0;
}

.editor-main {
    display: flex;
    flex: 1;
    min-height: 0;
    position: relative;
}

/* Editor on the LEFT, chat pane on the RIGHT. Uses flex order so the markup and
   the resizer JS stay put (only the drag math is mirrored). */
.editor-main > .editor-pane { order: 1; }
.editor-main > .pane-resizer { order: 2; }
.editor-main > .chat-pane { order: 3; }

.editor-pane {
    flex: 0 0 460px;
    width: 460px;
    display: flex;
    flex-direction: column;
    min-width: 320px;
    border-right: 1px solid #e5e7eb;
    background: #fff;
}

.pane-resizer {
    width: 12px;
    min-width: 12px;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    position: relative;
    transition: background 0.2s ease;
}

.pane-resizer::after {
    content: "";
    width: 2px;
    height: 60%;
    border-radius: 3px;
    background: #d1d5db;
}

.pane-resizer:hover,
.editor-main.resizing .pane-resizer {
    background: linear-gradient(180deg, #e5e7eb 0%, #d1d5db 100%);
}

.pane-resizer:hover::after,
.editor-main.resizing .pane-resizer::after {
    background: #9ca3af;
}

.resizer-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) rotate(-90deg);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    pointer-events: none;
    white-space: nowrap;
}

.editor-main.resizing {
    user-select: none;
}

.editor-main.resizing .editor-pane,
.editor-main.resizing .chat-pane {
    pointer-events: none;
}

.editor-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 16px;
    padding-right: 48px; /* space for floating impersonation widget */
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    min-height: 56px; /* match the sidebar-logo header height */
    box-sizing: border-box;
}

.current-filename {
    font-size: 14px;
    font-weight: 600;
    color: #323130;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    position: relative;
    padding-right: 24px; /* Make space for the pencil icon */
}

.current-filename::after {
    content: '✏️';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.current-filename:hover::after {
    opacity: 0.6;
}

.chat-pane {
    flex: 1 1 auto;
    min-width: 320px;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    transition: flex 0.2s ease;
    position: relative;
}

.chat-pane.collapsed {
    width: 0;
    min-width: 0;
    flex: 0 0 0;
    box-sizing: border-box;
    border-right: none;
}

.chat-pane.collapsed .chat-pane-body,
.chat-pane.collapsed .chat-pane-info {
    display: none;
}

/* Editor top-right toolbar: switch-user (admin), clear-chat, collapse-chat, in
   one flex row so the controls never overlap. The collapse toggle stays here
   full-height at the top-right in both states. Chat controls stay hidden until
   the editor initializes post-auth (.chat-ready), and clear-chat hides while
   the chat pane is collapsed. */
.editor-top-toolbar {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Inside the editor toolbar the impersonation widget is a flex child, not a
   page-floating widget (it stays absolute/top-right on its standalone pages).
   position:relative keeps its .imp-popover anchored to the trigger. */
.editor-top-toolbar .impersonation-widget {
    position: relative;
    top: auto;
    right: auto;
    z-index: auto;
}

.editor-top-toolbar:not(.chat-ready) #chatDeleteBtn,
.editor-top-toolbar:not(.chat-ready) #chatPaneToggle {
    display: none;
}

.editor-top-toolbar.chat-collapsed #chatDeleteBtn {
    display: none;
}

.chat-pane.collapsed ~ .pane-resizer {
    display: none;
}

.chat-pane.collapsed ~ .editor-pane {
    flex: 1 1 auto;
    width: auto;
    min-width: 320px;
    border-left: none;
}

.chat-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    column-gap: 12px;
}

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

.chat-pane-header h4 {
    font-size: 14px;
    margin: 0;
    color: #111827;
}

.chat-label {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7280;
    display: block;
}

.chat-subtitle {
    font-size: 13px;
    margin: 4px 0 0;
    color: #1f2937;
}

.chat-active-file {
    margin: 4px 0 0;
    font-size: 12px;
    color: #4b5563;
}

.chat-pane-body {
    flex: 1;
    position: relative;
    min-height: 0;
}

.chat-pane-body iframe {
    border: none;
    width: 100%;
    height: 100%;
    display: block;
    background: #fff;
}

.chat-pane-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #6b7280;
    pointer-events: none;
    text-align: center;
    padding: 0 16px;
}

.chat-pane-note {
    font-size: 12px;
    margin-top: 8px;
}

.tiles-header-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.tiles-header-text h2 {
    margin-bottom: 6px;
}

.tiles-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    min-width: 0;
}

.platform-page .tiles-search {
    flex: 1 1 320px;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f8fafc;
    color: #6b7280;
    margin: 0;
}

.platform-page .tiles-search input {
    border: none;
    background: transparent;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    outline: none;
    color: #111827;
    padding: 4px 0;
}

.tiles-search-icon {
    display: flex;
    align-items: center;
    font-size: 16px;
    flex-shrink: 0;
}

.feature-list {
    list-style: none;
    margin: 16px 0 0;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-list li {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    color: #1f2937;
    display: flex;
    flex-direction: column;
    transition: background 0.2s, border-color 0.2s;
}

.feature-list li:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.feature-list li a {
    display: block;
    padding: 12px 16px;
    color: inherit;
    text-decoration: none;
}

.feature-list strong {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.card-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 20px 0;
}

/* Intro card styling */
.intro-card h2 {
    margin-bottom: 16px;
}

.intro-card h3 {
    margin-top: 24px;
}

.intro-card .highlight {
    color: #3F8CFF;
}

.intro-card .inline-link {
    color: #3F8CFF;
    text-decoration: none;
    font-weight: 500;
}

.intro-card .inline-link:hover {
    text-decoration: underline;
}

.getting-started-list {
    margin: 16px 0;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.getting-started-list li {
    font-size: 14px;
    color: #1f2937;
    padding: 4px 0;
}

.getting-started-list a {
    color: #3F8CFF;
    text-decoration: none;
    font-weight: 500;
}

.getting-started-list a:hover {
    text-decoration: underline;
}

.tile-scope-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: transparent;
}

.tile-scope-btn {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tile-scope-btn.active {
    background: #111827;
    color: #fff;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.25);
}

.tiles-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 140px;
}

.tiles-empty {
    margin-top: 20px;
}

.tiles-grid-wrapper {
    margin-top: 20px;
}

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

.tile-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.tile-image {
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    padding: 8px;
}

.tile-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    object-fit: contain;
    background: #fff;
}

.tile-image-placeholder {
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
    padding: 30px 12px;
}

.tile-body {
    padding: 16px 18px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tile-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.tile-title-row h3 {
    font-size: 16px;
    margin: 0;
    color: #111827;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tile-name-text {
    display: inline-block;
}

.tile-rename-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.tile-title-row h3:hover .tile-rename-btn,
.tile-rename-btn:focus-visible {
    opacity: 1;
}

.tile-rename-btn:hover {
    color: #111827;
}

.tile-visibility {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #4b5563;
}

.tile-visibility.public {
    background: #ecfdf5;
    color: #0f766e;
}

.tile-visibility.private {
    background: #fef3c7;
    color: #b45309;
}

.tile-meta {
    font-size: 12px;
    color: #6b7280;
    margin: 8px 0 12px;
}

.tile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tile-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #4b5563;
}

.tile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px 16px;
    margin-top: auto;
    font-size: 12px;
    color: #6b7280;
}

.tile-details div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.tile-details span:last-child {
    color: #111827;
    font-weight: 500;
    text-align: right;
}

.tile-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 18px 18px;
}

.tile-action {
    flex: 1;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #111827;
}

.tile-action:hover {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.tile-action.tile-delete {
    border-color: #ffc9c9;
    color: #c92a2a;
}

.tile-action.tile-delete:hover {
    background: #f03e3e;
    border-color: #f03e3e;
    color: #fff;
}

.tile-action.copied {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

@media (max-width: 640px) {
    .tiles-controls {
        flex-direction: column;
        align-items: stretch;
    }

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

.status-dot {
    font-size: 11px;
    opacity: 0.6;
    color: #605e5c;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: 4px;
    padding-left: 8px;
    border-left: 1px solid #e1dfdd;
}

.status-dot.agent-working {
    color: #fff;
    opacity: 1;
    padding: 2px 10px;
    border-radius: 8px;
    animation: generating-bg 3s ease-in-out infinite;
}

.status-dot.modified {
    color: #f59e0b;
    opacity: 1;
}

@keyframes generating-bg {
    0%   { background-color: #4f46e5; }
    25%  { background-color: #7c3aed; }
    50%  { background-color: #3F8CFF; }
    75%  { background-color: #06b6d4; }
    100% { background-color: #4f46e5; }
}

/* Agent Edit Notification */
.agent-edit-notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-bottom: 1px solid #c7d2fe;
    gap: 12px;
}

.agent-edit-notification .notification-text {
    font-size: 13px;
    color: #3730a3;
    font-weight: 500;
}

.agent-edit-notification .notification-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.agent-edit-notification .btn-small {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    border: none;
}

.agent-edit-notification .btn-primary {
    background: #4f46e5;
    color: white;
}

.agent-edit-notification .btn-primary:hover {
    border-color: rgba(63, 140, 255, 0.7);
}

.agent-edit-notification .btn-secondary {
    background: white;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}

.agent-edit-notification .btn-secondary:hover {
    background: #f5f3ff;
}

/* Agent edit line decorations */
.agent-edit-added-line {
    background: rgba(40, 167, 69, 0.15) !important;
    border-left: 3px solid #28a745 !important;
}

.agent-edit-modified-line {
    background: rgba(255, 193, 7, 0.15) !important;
    border-left: 3px solid #ffc107 !important;
}

.agent-edit-added-glyph {
    background: #28a745;
    width: 4px !important;
    margin-left: 3px;
}

.agent-edit-modified-glyph {
    background: #ffc107;
    width: 4px !important;
    margin-left: 3px;
}

/* Ensure Monaco glyph margin is visible for decorations */
.monaco-editor .margin-view-overlays .agent-edit-added-glyph,
.monaco-editor .margin-view-overlays .agent-edit-modified-glyph {
    width: 4px !important;
    left: 0 !important;
}

.editor-container {
    flex: 1;
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .file-sidebar {
        width: 180px;
    }

    .editor-layout {
        height: calc(100vh - 50px);
    }
}

/* Permissions Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideIn 0.2s ease-out;
}

.modal-content.large {
  width: 80vw;
  max-width: 800px;
  height: 80vh;
  max-height: 80vh;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.modal-close,
.platform-page .modal-close {
  background: none !important;
  border: none !important;
  box-shadow: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #868e96;
  transition: color 0.2s;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover,
.platform-page .modal-close:hover {
  color: #495057;
  background: none !important;
  border: none !important;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-content.large .modal-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.permission-info {
  margin-bottom: 24px;
}

.permission-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.permission-label {
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

.user-id-text {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #495057;
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 4px;
  user-select: all; /* Allow easy selection/copying */
}

.tier-badge-large {
  padding: 6px 16px;
  background: #3F8CFF;
  color: white;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  text-transform: capitalize;
}

.permissions-list-container h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.permissions-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.permission-category {
  font-size: 11px;
  font-weight: 700;
  color: #868e96;
  letter-spacing: 0.5px;
  margin-top: 16px;
  margin-bottom: 8px;
  padding-left: 4px;
}

.permission-category:first-child {
  margin-top: 0;
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 14px;
  color: #495057;
  transition: background 0.2s;
}

.permission-item:hover {
  background: #e9ecef;
}

.permission-item.wildcard {
  background: linear-gradient(135deg, #9775fa 0%, #845ef7 100%);
  color: white;
  font-weight: 600;
}

.permission-item.wildcard .permission-icon {
  color: white;
}

.permission-icon {
  color: #51cf66;
  font-weight: bold;
  font-size: 16px;
  flex-shrink: 0;
}

.no-permissions {
  padding: 20px;
  text-align: center;
  color: #868e96;
  font-style: italic;
  background: #f8f9fa;
  border-radius: 8px;
  list-style: none;
}

/* User Settings Card */
.user-settings-card {
  margin-bottom: 24px;
}

.user-settings-card h2 {
  margin-bottom: 20px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
}

.settings-row-danger {
  background: #fff7f7;
  border: 1px solid #ffd6d6;
}

.settings-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-label {
  font-weight: 600;
  color: #333;
  font-size: 15px;
}

.settings-description {
  font-size: 13px;
  color: #868e96;
}

/* User Permissions Card */
.user-permissions-card h2 {
  margin-bottom: 20px;
}

/* Form Styles for Modals */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-label .required {
  color: #fa5252;
  display: inline;
  margin-left: 2px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #228be6;
  box-shadow: 0 0 0 3px rgba(34, 139, 230, 0.1);
}

.form-input::placeholder {
  color: #adb5bd;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

/* Modal form buttons - more specific to override platform styles */
.modal .form-actions .btn-primary,
.modal .form-actions .btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: auto; /* Override any width: 100% from platform styles */
  margin-top: 0; /* Override platform margin-top: 20px */
  transform: none; /* Remove any transform from platform styles */
}

.modal .form-actions .btn-primary {
  background: #228be6;
  color: white;
}

.modal .form-actions .btn-primary:hover:not(:disabled) {
  background: #1c7ed6;
  transform: none; /* Keep no transform on hover */
  box-shadow: none; /* Remove platform box-shadow */
}

.modal .form-actions .btn-primary:disabled {
  background: #adb5bd;
  cursor: not-allowed;
}

.modal .form-actions .btn-secondary {
  background: #f1f3f5;
  color: #495057;
}

.modal .form-actions .btn-secondary:hover {
  background: #e9ecef;
  transform: none; /* Keep no transform on hover */
  box-shadow: none; /* Remove any box-shadow */
}

.modal-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  margin-top: 0;
}

.modal-content.large .modal-actions button {
  width: 100px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.version-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}

.version-history-empty {
  padding: 14px;
  border: 1px dashed #ced4da;
  border-radius: 8px;
  color: #6c757d;
  background: #f8f9fa;
}

.version-history-item {
  width: 100%;
  text-align: left;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #f8f9fa;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.version-history-item:hover {
  background: #eef4ff;
  border-color: #3f8cff;
}

.version-history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.version-history-item-meta {
  font-size: 13px;
  color: #5c6770;
}

.version-history-item-edge {
  font-size: 13px;
  font-weight: 700;
  color: #333;
}

/* The live "Current" entry is informational, not a restore target: no pointer,
   no hover affordance, and a distinct tint so it reads as "you are here" rather
   than another clickable snapshot. */
.version-history-item-current,
.version-history-item-current:hover {
  cursor: default;
  background: #f0f7ff;
  border-color: #cfe0ff;
}

/* Alert styles */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-warning {
  background: #fff3bf;
  border: 1px solid #ffd43b;
  color: #862e00;
}

.alert strong {
  font-weight: 700;
}

/* API Key Display */
.api-key-display {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.api-key-value {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: #f8f9fa;
}

.btn-copy {
  padding: 10px 16px;
  background: #228be6;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-copy:hover {
  background: #1c7ed6;
}

.btn-copy.copied {
  background: rgba(81, 207, 102, 0.15);
  color: #2f9e44;
}

/* Form hints */
.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #868e96;
  font-style: italic;
}

/* Booking Section (Calendly) */
.booking-section {
    padding: 4rem 0;
    background: #FFFAFA;
    color: #323130;
}

.booking-section h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    text-align: center;
    color: #3F8CFF;
}

.booking-section > .container > p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    text-align: center;
    color: #605e5c;
}

.booking-section .calendly-inline-widget {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(63, 140, 255, 0.1);
}

/* Footer link - preserves text appearance but adds pointer cursor */
.footer-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.footer-link:hover {
    color: inherit;
    text-decoration: none;
}

/* App Storage Management */
.platform-page .app-storage-card {
  margin-bottom: 30px;
}

.platform-page .app-storage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #e1dfdd;
  gap: 20px;
}

.platform-page .app-storage-header h2 {
  margin: 0;
  color: #323130 !important;
  flex-shrink: 0;
}

.platform-page .app-storage-filter {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 400px;
}

.platform-page .app-storage-filter .form-input {
  flex: 1;
  min-width: 0;
  margin: 0;
}

/* Notes page header: drop the divider bars that sandwiched the subtitle and let
   it read as a quiet caption under the title instead of a squished boxed strip. */
.platform-page .notes-card .app-storage-header {
  border-bottom: none;
  padding-bottom: 6px;
}

.platform-page .notes-card .section-subtitle {
  margin: 0;
  padding: 0 30px 20px;
  color: #605e5c;
  font-size: 13px;
  line-height: 1.5;
  max-width: 68ch;
}

/* Notes page: tight table-like rows. There will be MANY notes — small text,
   one line per note, clear separators; detail lives in the view modal. */
.notes-table-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid #e6e4e1;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.45;
}
.notes-table-row:first-child { border-top: 1px solid #e6e4e1; }
.notes-table-row:hover { background: #f3f7ff; }
.notes-row-title {
  flex: 0 1 auto;
  max-width: 34%;
  font-weight: 600;
  color: #323130;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notes-row-badge {
  flex-shrink: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 7px;
  border-radius: 8px;
  background: #eef1f4;
  color: #5c6770;
}
.notes-row-badge.org { background: #e8f1ff; color: #2b5fa3; }
.notes-row-badge.global { background: #fdf0e7; color: #a3562b; }
.notes-row-tags { flex-shrink: 0; color: #8a8886; font-size: 11px; }
.notes-row-snippet {
  flex: 1 1 auto;
  min-width: 0;
  color: #6b6966;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notes-row-snippet b { color: #323130; }
.notes-row-date {
  flex-shrink: 0;
  color: #a19f9d;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.notes-load-more { padding: 12px; text-align: center; }

.platform-page .app-storage-filter .btn-small {
  flex-shrink: 0;
  white-space: nowrap;
}

.platform-page .app-storage-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: #605e5c;
}

.platform-page .app-storage-list {
  padding: 0;
}

.platform-page .app-storage-group {
  border-bottom: 1px solid #e1dfdd;
}

.platform-page .app-storage-group:last-child {
  border-bottom: none;
}

.platform-page .app-storage-group-header {
  background: #f8f7f5;
  padding: 12px 30px;
  font-weight: 600;
  color: #323130;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  border-bottom: 1px solid #e1dfdd;
}

.platform-page .app-storage-group-entries {
  padding: 0;
}

.platform-page .app-storage-entry {
  display: grid;
  grid-template-columns: 200px 1fr 150px auto;
  gap: 16px;
  align-items: center;
  padding: 16px 30px;
  border-bottom: 1px solid #f0efed;
  transition: background-color 0.2s ease;
}

.platform-page .app-storage-entry:hover {
  background-color: #faf9f8;
}

.platform-page .app-storage-entry:last-child {
  border-bottom: none;
}

.platform-page .app-storage-entry-key {
  font-weight: 500;
  color: #323130;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  word-break: break-word;
}

.platform-page .app-storage-entry-value {
  color: #605e5c;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-page .app-storage-entry-date {
  color: #8a8886;
  font-size: 12px;
  text-align: right;
}

.platform-page .app-storage-entry-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.platform-page .no-app-storage {
  padding: 60px 30px;
  text-align: center;
}

.platform-page .app-storage-error {
  padding: 20px 30px;
  color: #dc3545;
  text-align: center;
}

.platform-page .app-storage-value-textarea {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  resize: vertical;
  min-height: 200px;
}

.platform-page .modal-content-wide {
  max-width: 700px;
}

.platform-page .delete-entry-details {
  background: #f8f7f5;
  padding: 12px 16px;
  border-radius: 6px;
  margin: 16px 0;
  font-size: 14px;
}

.platform-page .delete-entry-details p {
  margin: 4px 0;
  word-break: break-all;
}

@media (max-width: 768px) {
  .platform-page .app-storage-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .platform-page .app-storage-filter {
    max-width: none;
  }

  .platform-page .app-storage-entry {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .platform-page .app-storage-entry-date {
    text-align: left;
  }

  .platform-page .app-storage-entry-actions {
    justify-content: flex-start;
  }
}

/* =============================================================================
   Chat Page - Screenshot Display
   ============================================================================= */

.screenshot-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

.screenshot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #323130;
}

.screenshot-header strong {
  color: #3F8CFF;
}

.screenshot-dimensions {
  font-size: 12px;
  color: #8a8886;
  padding: 2px 8px;
  background: #f8f7f5;
  border-radius: 4px;
}

.screenshot-image {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e1dfdd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.screenshot-image:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Chat message styles for chat.html */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #8a8886;
  text-align: center;
  padding: 40px;
}

.chat-empty h3 {
  color: #605e5c;
  margin-bottom: 8px;
}

.chat-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #8a8886;
  text-align: center;
  padding: 40px;
}

.load-more-container {
  display: flex;
  justify-content: center;
  padding: 12px;
  margin-bottom: 8px;
}

.load-more-btn {
  background: #f8f7f5;
  border: 1px solid #e1dfdd;
  border-radius: 16px;
  padding: 8px 16px;
  font-size: 13px;
  color: #605e5c;
  cursor: pointer;
  transition: all 0.2s ease;
}

.load-more-btn:hover {
  background: #e9ecef;
  border-color: #c8c6c4;
}

.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Scheduled runs page (phase 2) --- */
.scheduled-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.3fr) minmax(110px, 1fr) 120px 140px minmax(110px, 1fr) 210px;
  gap: 12px;
  align-items: center;
  /* The list is display:block, so bordered row-cards would otherwise touch —
     add vertical breathing room between consecutive scheduled runs. */
  margin-bottom: 10px;
}
.scheduled-row code { font-size: 12px; }
/* Last-run summary in the row is clickable (opens the full result) — keep the
   plain section-subtitle look, just add the pointer + a subtle hover. */
.scheduled-lastrun-link { cursor: pointer; }
.scheduled-lastrun-link:hover { color: #201f1e; }
/* Full result inside the detail modal: normal body text like the prompt field
   (NOT the dark .platform-page pre code block) — wrap + scroll. */
.scheduled-run-summary {
  white-space: pre-wrap; word-break: break-word;
  max-height: 55vh; overflow-y: auto;
  padding: 10px 12px; margin: 0 0 16px;
  border: 1px solid #dee2e6; border-radius: 6px;
  background: #fff; color: #201f1e;
  font-size: 14px; line-height: 1.5;
}
.scheduled-title { font-weight: 600; }
.scheduled-disabled { opacity: 0.6; }
/* Keep Chat / Edit / Delete on one line; the Chat button is an <a> so kill the underline. */
.scheduled-actions { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.scheduled-actions .btn-small { white-space: nowrap; padding: 4px 8px; }
.scheduled-actions a { text-decoration: none; }
.run-status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.run-status-ok { background: #1f7a3d33; color: #2ecc71; }
.run-status-partial { background: #b8860b33; color: #e0a800; }
.run-status-failed { background: #a32c2c33; color: #e05656; }
.run-status-missed { background: #55555533; color: #999; }
.run-status-aborted { background: #b8860b33; color: #e08600; }
.run-status-running { background: #1f5f9f33; color: #4aa3ff; }
.scheduled-run-picker { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.scheduled-run-picker select { flex: 1; min-width: 0; }
.scheduled-run-outcome {
  white-space: pre-wrap; word-break: break-word;
  padding: 8px 12px; margin: 0 0 12px;
  border-left: 3px solid #e0a800; border-radius: 4px;
  background: #b8860b1a; font-size: 13px; line-height: 1.5;
}
@media (max-width: 900px) {
  .scheduled-row { grid-template-columns: 1fr; gap: 4px; }
  .scheduled-row.admin-header-row { display: none; }
  .scheduled-actions { justify-content: flex-start; }
}
.app-storage-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.app-storage-pager-info { font-size: 13px; opacity: 0.8; }
.app-storage-admin-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.app-storage-admin-bar .form-input { max-width: 280px; }
.app-storage-inspect-banner { font-size: 13px; font-weight: 600; color: #e0a800; }

/* Info icon (inline SVG "i in circle") with a hover/focus tooltip. Reusable. */
.info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 5px; cursor: help; opacity: 0.5;
  position: relative; vertical-align: middle; user-select: none;
}
.info-btn svg { width: 15px; height: 15px; display: block; }
.info-btn:hover, .info-btn:focus { opacity: 0.95; outline: none; }
.scheduled-schedule-head { display: inline-flex; align-items: center; }
.info-btn::after {
  content: attr(data-tip); white-space: pre-line;
  position: absolute; left: 22px; top: -6px; z-index: 60;
  min-width: 240px; max-width: 300px;
  background: #1f2933; color: #fff; padding: 9px 11px; border-radius: 6px;
  font: 400 12px/1.45 -apple-system, sans-serif; font-style: normal;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  opacity: 0; visibility: hidden; transition: opacity 0.12s; pointer-events: none;
}
.info-btn:hover::after, .info-btn:focus::after { opacity: 1; visibility: visible; }

/* --- Lambda Workbench (/workbench, Team overview card, Admin) --- */
.workbench-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
}
.workbench-head,
.team-workbench-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
}
.workbench-head h2,
.team-workbench-line h2,
.workbench-card h3 { margin: 0; }
.workbench-card h3 { font-size: 1.05rem; color: #323130; margin-top: 12px; }
.workbench-about h3 { margin: 0 0 6px; }
.workbench-scope {
  margin: 4px 0 0;
  color: #605e5c;
  font-size: 0.9rem;
}
.workbench-lead {
  color: #323130;
  line-height: 1.55;
  margin: 8px 0;
}
.workbench-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: #f0f0f0;
  color: #605e5c;
}
.workbench-status--enabled,
.workbench-status--provisioning { background: #e8f0fe; color: #1a56db; }
.workbench-status--ready { background: #e6f4ea; color: #137333; }
.workbench-status--failed { background: #fce8e6; color: #c5221f; }
.workbench-status--archiving,
.workbench-status--archived { background: #fff4e5; color: #9a5b00; }
.workbench-status--deleted { background: #eceff1; color: #546e7a; }

/* Destructive actions: red, also on platform pages (where .btn-danger is blue). */
.platform-page .btn-danger.btn-destructive,
.btn-danger.btn-destructive {
  background: #c5221f;
  color: #fff;
  border: none;
}
.platform-page .btn-danger.btn-destructive:hover:not(:disabled),
.btn-danger.btn-destructive:hover:not(:disabled) { background: #a31b19; }
.btn-danger.btn-destructive:disabled { opacity: 0.5; cursor: not-allowed; }

.wb-delete-dialog { max-width: 520px; }
.wb-delete-dialog .modal-body p { margin: 0 0 12px; line-height: 1.5; }
.wb-delete-dialog .form-input { width: 100%; margin-top: 4px; }
.wb-delete-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.admin-subheading { margin: 28px 0 4px; font-size: 16px; }
.admin-hint { margin: 0 0 12px; color: #666; font-size: 13px; }
.admin-workbench-row--deleted { opacity: 0.9; }
.wb-archive-items { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.wb-archive-items code { word-break: break-all; }
.workbench-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  margin-top: 16px;
}
.platform-page .workbench-actions .btn-primary,
.platform-page .workbench-actions .btn-secondary,
.platform-page .workbench-actions .btn-danger {
  width: auto;
  margin-top: 0;
}
.platform-page .workbench-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 160px;
  text-decoration: none;
  font-size: 1rem;
}
.workbench-open { margin-top: 12px; }
.workbench-manage { margin-top: 12px; }
.workbench-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 16px;
  margin: 18px 0 0;
}
.workbench-facts dt { font-size: 0.8rem; color: #605e5c; }
.workbench-facts dd { margin: 2px 0 0; font-weight: 600; color: #323130; overflow-wrap: anywhere; }
.workbench-progress {
  position: relative;
  height: 6px;
  margin: 14px 0 6px;
  border-radius: 3px;
  background: #e8f0fe;
  overflow: hidden;
}
.workbench-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 35%;
  border-radius: 3px;
  background: #3F8CFF;
  animation: workbench-progress 1.8s ease-in-out infinite;
}
@keyframes workbench-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(290%); }
}
@media (prefers-reduced-motion: reduce) {
  .workbench-progress-bar { animation: none; width: 100%; opacity: 0.5; }
}
.workbench-confirm {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(63, 140, 255, 0.3);
  border-radius: 10px;
  background: #f5f9ff;
}
.workbench-confirm p { margin: 0; color: #323130; }
.workbench-confirm .workbench-actions { margin-top: 10px; }
.platform-page .workbench-error {
  margin: 10px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border: 1px solid #f3c5c2;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fce8e6;
  color: #a31b19;
  font-size: 0.85rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 240px;
  overflow: auto;
}
.workbench-admin-hint { margin-top: 12px; }
.workbench-page a.inline-link,
.team-workbench-card a.inline-link { color: #3F8CFF; text-decoration: underline; }
.team-workbench-card .section-subtitle { margin: 8px 0 0; }

/* Admin: Workbenches card */
.admin-workbench-grant {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 12px;
  align-items: start;
  margin: 6px 0;
}
.admin-workbench-grant-owner { grid-column: span 2; }
/* One baseline for every field: labels the same height, controls the same height. */
.platform-page .admin-workbench-grant label { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; margin: 0 0 8px; }
.platform-page .admin-workbench-grant .form-label { display: inline-flex; align-items: center; min-height: 20px; margin: 0; }
.platform-page .admin-workbench-grant .form-input { height: 38px; margin: 0; box-sizing: border-box; padding: 0 10px; line-height: 36px; }
.admin-workbench-grant { align-items: end; }
.platform-page .admin-workbench-grant .admin-workbench-name { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 6px; align-items: stretch; }
.platform-page .admin-workbench-grant .admin-workbench-name .form-input { flex: 1 1 auto; width: auto; min-width: 0; }
.platform-page .admin-workbench-grant .admin-workbench-dice { flex: 0 0 38px; height: 38px; width: 38px; margin: 0; padding: 0; font-size: 16px; line-height: 1; }
.platform-page .admin-workbench-grant .form-input.is-invalid,
.platform-page .admin-workbench-grant .wb-types-summary.is-invalid { border-color: #c4314b; box-shadow: 0 0 0 2px rgba(196, 49, 75, .15); }
.admin-workbench-grant-types { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; margin: 0 0 8px; min-width: 0; }
.wb-types { position: relative; min-width: 0; }
.platform-page .wb-types-summary { list-style: none; cursor: pointer; display: flex; align-items: center; height: 38px;
  margin: 0; padding: 0 28px 0 10px; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.wb-types-summary::-webkit-details-marker { display: none; }
.wb-types-summary::after { content: "▾"; position: absolute; right: 10px; color: #605e5c; }
.wb-types-panel { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; width: max(100%, 320px); max-width: 90vw;
  max-height: 340px; overflow-y: auto; background: #fff; border: 1px solid #e1dfdd; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 8px; box-sizing: border-box; }
.wb-types-note { font-size: 12px; color: #605e5c; margin: 2px 4px 8px; }
.platform-page .wb-types .wb-types-option { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 8px;
  padding: 6px 6px; margin: 0; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 400; }
.platform-page .wb-types .wb-types-option:hover { background: #f3f2f1; }
.platform-page .wb-types .wb-types-option input { width: 16px; height: 16px; margin: 2px 0 0; padding: 0; }
.platform-page .wb-types .wb-types-option > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.platform-page .wb-types .wb-types-name { color: #323130; }
.platform-page .wb-types .wb-types-option code { font-size: 11px; color: #605e5c; background: none; padding: 0; border: 0; overflow-wrap: anywhere; }
.wb-types-field { display: flex; flex-direction: column; gap: 2px; min-width: 200px; flex: 1 1 200px; }
.platform-page .wb-types-field .form-label,
.platform-page .admin-workbench-grant-types .form-label { font-weight: 400; white-space: nowrap; }
.platform-page .wb-types-field .form-label { font-size: 12px; }
.platform-page .admin-workbench-edit .wb-types-summary { height: 32px; font-size: 13px; }
/* Tooltips open below the icon, towards the right, so the first column stays on screen. */
.admin-workbench-grant .info-btn::after { left: -8px; right: auto; top: 22px; }
.admin-workbench-grant-submit { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.admin-workbench-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #e1dfdd;
  border-radius: 6px;
  background: #fffdfa;
}
.admin-workbench-row > .workbench-confirm { grid-column: 1 / -1; margin-top: 4px; }
.admin-workbench-row > .admin-workbench-failure { grid-column: 1 / -1; min-width: 0; }
.admin-workbench-failure-title { font-size: 12px; font-weight: 600; color: #a31b19; margin-top: 2px; }
.platform-page .admin-workbench-failure .workbench-error { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-workbench-main { min-width: 0; overflow-wrap: anywhere; }
.admin-workbench-meta { font-size: 12px; color: #605e5c; margin-top: 2px; }
.admin-workbench-edit { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.platform-page .admin-workbench-edit label { margin: 0; gap: 2px; font-size: 12px; }
.platform-page .admin-workbench-edit .form-input { margin: 0; padding: 0 8px; height: 32px; box-sizing: border-box; }
.platform-page .admin-workbench-edit input.form-input { width: 110px; }
.admin-workbench-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-self: end; }
/* Same line and height as the row's Save button. */
.platform-page .admin-workbench-row .admin-workbench-actions .btn-small,
.platform-page .admin-workbench-row .admin-workbench-edit > .btn-small { height: 32px; box-sizing: border-box; margin: 0;
  padding: 0 12px; display: inline-flex; align-items: center; font-size: 13px; }
.platform-page .admin-workbench-actions .btn-danger,
.platform-page .admin-workbench-row .btn-danger.btn-small { padding: 6px 12px; font-size: 13px; }
/* Admin: Organizations card (reuses the Workbenches grant/row styles) */
#adminPage #adminOrgsSearch { flex: 1; width: auto; min-width: 0; }
.admin-org-row { grid-template-columns: minmax(0, 1fr) auto; }
.admin-org-transfer { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.platform-page .admin-org-transfer label { margin: 0; gap: 2px; font-size: 12px; display: flex; flex-direction: column; }
.platform-page .admin-org-transfer .form-input { margin: 0; padding: 0 8px; height: 32px; box-sizing: border-box; }
.admin-org-add { width: 100%; margin-top: 8px; }
.platform-page .admin-org-add label.admin-org-add-check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; height: 32px; }
.admin-org-add-buttons { display: flex; gap: 8px; }
.admin-org-add-tasks { display: flex; flex-direction: column; width: 100%; }
.platform-page .admin-org-transfer input.form-input { width: 240px; max-width: 100%; }
.platform-page .admin-org-transfer .btn-small { height: 32px; box-sizing: border-box; margin: 0; padding: 0 12px;
  display: inline-flex; align-items: center; font-size: 13px; }
.admin-org-row > .admin-org-transfer,
.admin-org-row > .workbench-confirm { grid-column: 1 / -1; }
.admin-org-row > .workbench-confirm { margin-top: 4px; }
/* Users: tier Update plus the reset-email action */
#adminPage .admin-user-row { grid-template-columns: minmax(180px, 1fr) 160px minmax(120px, auto); }
.admin-user-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.admin-user-row > .workbench-confirm { grid-column: 1 / -1; margin-top: 4px; }
@media (max-width: 720px) {
  .admin-workbench-grant-owner { grid-column: auto; }
  .admin-workbench-row { grid-template-columns: minmax(0, 1fr); }
  #adminPage .admin-user-row { grid-template-columns: 1fr; }
  .admin-workbench-actions { justify-content: flex-start; }
  .platform-page .workbench-link { flex: 1 1 100%; }
}

/* /admin sections (initAdminSubmenu): cards of other sections stay out of view. */
.admin-section-hidden { display: none !important; }

/* Links styled as buttons in the admin rows (Open). */
.admin-workbench-actions a.btn-small { text-decoration: none; }

/* ==== Calmer, more businesslike app pages (2026-11-25) ====================
   Earlier rules above gave cards a 14px radius and a blue glow, buttons and
   inputs 10px, the page a warm pink tint, and card headers (API keys,
   Telegram, storage, notes) 30px more indentation than the text below them.
   Overridden here in one block, so it is easy to adjust or revert. Applies to
   the app pages only (.platform-page); the landing pages are unchanged. More
   specific rules keep their own shape (the impersonation pill, badges). */
.platform-page,
.platform-page body {
  background: #f6f7f9 !important;
}

.platform-page .card {
  border: 1px solid #e4e6eb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.platform-page button,
.platform-page .btn-primary,
.platform-page .btn-google,
.platform-page input,
.platform-page pre,
.platform-page pre.out {
  border-radius: 6px;
}

.platform-page .modal-content,
.platform-page .costs-summary,
.platform-page .telegram-bots-list {
  border-radius: 8px;
}

/* Card headers start where the card's text starts. */
.platform-page .api-keys-header,
.platform-page .telegram-bots-header,
.platform-page .app-storage-header {
  padding: 4px 0 12px;
  margin-bottom: 12px;
}

/* Explanations stay readable: about 75 characters per line. */
.platform-page .section-subtitle {
  max-width: 75ch;
}


/* Audit (public/audit.html + js/audit.js) */
.audit-filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 4px 0 12px; }
.audit-filters label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12px; color: #605e5c; }
/* One height for every control, so the Apply button lines up with the fields
   (btn-small is 32 px, inputs 40 px; selects otherwise render grey). */
.audit-filters .form-input { min-width: 140px; height: 40px; box-sizing: border-box; margin: 0; background-color: #fff; }
.audit-filters button[type="submit"] { height: 40px; margin: 0; padding: 0 18px; align-self: flex-end; }
.audit-table-wrap { overflow-x: auto; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit-table th { text-align: left; font-weight: 600; color: #605e5c; padding: 8px 10px; border-bottom: 1px solid #e1dfdd; white-space: nowrap; }
.audit-table td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.audit-time { white-space: nowrap; color: #605e5c; font-variant-numeric: tabular-nums; }
.audit-sub { display: block; font-size: 12px; color: #8a8886; }
.audit-muted { color: #8a8886; }
.audit-outcome { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.audit-outcome-ok { background: #e7f3ea; color: #2f6b3a; }
.audit-outcome-denied { background: #fdecea; color: #9c2f2f; }
.audit-outcome-failed { background: #fff4e5; color: #8a5300; }
#auditMoreBtn { margin-top: 12px; }
@media (max-width: 640px) {
  .audit-filters .form-input { min-width: 0; width: 100%; }
  .audit-filters label { flex: 1 1 45%; }
}

/* Busy button: an action that takes a while (e.g. sending an email). Not
   clickable, with a spinner before the label. Toggled by js/busy.js setBusy()
   (standalone scripts toggle the class themselves). Also in portal.css. */
.btn-busy { cursor: progress !important; pointer-events: none; opacity: 0.85; }
.btn-busy::before {
  content: ""; display: inline-block; width: 0.85em; height: 0.85em; margin-right: 0.5em;
  vertical-align: -0.12em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: btn-busy-spin 0.7s linear infinite; box-sizing: border-box;
}
@keyframes btn-busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-busy::before { animation-duration: 2s; } }
