/* Kenas Materials Library â€” Figma A0 design theme */

.figma-theme {
  --figma-page: #efefef;
  --figma-border: #e0e0e0;
  --figma-border-input: #d8d8d8;
  --figma-text-muted: #6b6b6b;
  --figma-text-faint: #9b9b9b;
  --figma-black: #050505;
  --figma-available-bg: #dcfce7;
  --figma-available-text: #166534;
  --figma-loan-bg: #fef3c7;
  --figma-loan-text: #92400e;
  --figma-unavailable-bg: #fee2e2;
  --figma-unavailable-text: #991b1b;
  --figma-development-bg: #dbeafe;
  --figma-development-text: #1e40af;
  --figma-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --topbar-height: 64px;
  --menu-radius: 8px;
  --menu-item-radius: 6px;
  --menu-padding: 6px;
  --menu-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  --menu-item-hover: #f5f5f5;
  --radius-pill: 999px;
}

.figma-theme.library-body {
  padding: 0;
  background: var(--figma-page);
}

.figma-theme .app-frame {
  max-width: none;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  min-height: 100vh;
  background: var(--figma-page);
  overflow: visible;
}

/* â”€â”€ Header â”€â”€ */

.figma-theme .library-header {
  height: 64px;
  border-bottom: 1px solid var(--figma-border);
  background: #ffffff;
  --header-font: Inter, ui-sans-serif, system-ui, sans-serif;
  --header-mark-size: 36px;
  --header-side-gap: 12px;
  --header-text-gap: 2px;
  --header-primary-font: 600 14px/1.2 var(--header-font);
  --header-secondary-font: 400 12px/1.2 var(--header-font);
  --header-primary-color: var(--figma-black);
  --header-secondary-color: var(--figma-text-muted);
}

.figma-theme .library-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
}

.figma-theme .library-user-menu {
  position: relative;
}

.figma-theme .user-menu {
  right: 0;
  left: auto;
}

.figma-theme .user-menu-item {
  text-align: right;
  justify-content: flex-end;
}

.figma-theme .library-user-trigger {
  gap: var(--header-side-gap);
  padding: 0;
  border-radius: 8px;
}

.figma-theme .library-user-trigger:hover,
.figma-theme .library-user-menu.is-menu-open .library-user-trigger {
  background: #f5f5f5;
}

.figma-theme .library-user-avatar {
  flex-shrink: 0;
  width: var(--header-mark-size);
  height: var(--header-mark-size);
  border-radius: 50%;
  background: #d8d8d8;
  color: #ffffff;
  font: 600 12px/1 var(--header-font);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-transform: uppercase;
  overflow: hidden;
}

.figma-theme .library-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.figma-theme .library-user-info .role {
  text-transform: none;
}

.figma-theme .library-user-chevron {
  flex-shrink: 0;
  align-self: center;
  width: 16px;
  height: 16px;
  color: var(--figma-text-muted);
}

.figma-theme .user-menu,
.figma-theme .color-family-menu,
.figma-theme .filter-pill-menu-panel {
  min-width: 200px;
  padding: var(--menu-padding);
  border: 1px solid var(--figma-border);
  border-radius: var(--menu-radius);
  background: #ffffff;
  box-shadow: var(--menu-shadow);
}

.figma-theme .user-menu {
  min-width: 176px;
  padding: 4px;
}

.figma-theme .user-menu-item,
.figma-theme .color-family-menu-item {
  min-height: 40px;
  padding: 10px 12px;
  font: 400 14px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #000000;
  border-radius: var(--menu-item-radius);
}

.figma-theme .user-menu .user-menu-item {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.2;
}

.figma-theme .user-menu-item[hidden] {
  display: none !important;
}

.figma-theme .user-menu-item--primary {
  background: var(--figma-black);
  color: #ffffff;
  font-weight: 500;
}

.figma-theme .user-menu-item--primary.is-stop-export {
  background: #c40000;
  color: #ffffff;
}

.figma-theme .user-menu-item:hover,
.figma-theme .color-family-menu-item:hover,
.figma-theme .color-family-menu-item.is-selected {
  background: var(--menu-item-hover);
}

.figma-theme .user-menu-item--primary:hover {
  background: #1a1a1a;
}

.figma-theme .user-menu-item--primary.is-stop-export:hover {
  background: #a30000;
}

.figma-theme .color-family-menu-item.is-selected {
  font-weight: 600;
}

.figma-theme .user-menu-divider {
  margin: 2px 8px;
  background: var(--figma-border);
}

.figma-theme .user-menu-item-with-chevron {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.figma-theme .user-menu-item-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.figma-theme .user-menu-item-with-chevron[aria-expanded="true"] .user-menu-item-chevron {
  transform: rotate(225deg);
}

.figma-theme .user-menu-subpanel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 4px;
}

.figma-theme .user-menu-subpanel[hidden] {
  display: none !important;
}

.figma-theme .user-menu .export-excel-btn,
.figma-theme .user-menu .export-ppt-btn,
.figma-theme .user-menu .export-moodboard-btn,
.figma-theme .user-menu .export-qr-labels-btn {
  height: auto;
  min-height: 32px;
  padding: 6px 10px 6px 20px;
  border: none;
  border-radius: var(--menu-item-radius);
  background: transparent;
  color: #000000;
  font-size: 13px;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

.figma-theme .user-menu .export-excel-btn:hover,
.figma-theme .user-menu .export-ppt-btn:hover,
.figma-theme .user-menu .export-moodboard-btn:hover,
.figma-theme .user-menu .export-qr-labels-btn:hover {
  background: var(--menu-item-hover);
  color: #000000;
  border-color: transparent;
}

.figma-theme .user-menu .export-excel-btn.is-exporting,
.figma-theme .user-menu .export-ppt-btn.is-exporting,
.figma-theme .user-menu .export-moodboard-btn.is-exporting,
.figma-theme .user-menu .export-qr-labels-btn.is-exporting,
.figma-theme .user-menu .export-excel-btn.is-exporting:hover,
.figma-theme .user-menu .export-ppt-btn.is-exporting:hover,
.figma-theme .user-menu .export-moodboard-btn.is-exporting:hover,
.figma-theme .user-menu .export-qr-labels-btn.is-exporting:hover {
  background: #ffffff;
  border: 1px solid #c40000;
}

.figma-theme .modal-figma,
.figma-theme .panel.panel-figma {
  --menu-radius: 8px;
  --menu-item-radius: 6px;
  --menu-padding: 6px;
  --menu-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  --menu-item-hover: #f5f5f5;
}

/* â”€â”€ Unified modal window system â”€â”€
   Every modal (Add swatch, Export, Users, Backup, Help, Archive) shares
   the same header, body, footer, and button treatment. Width is controlled
   with .modal-size-sm / .modal-size-lg on the same element as .modal-figma;
   the default (no size class) is the medium 720px width. */

.figma-theme .modal-figma {
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.figma-theme .modal.modal-figma.modal-size-sm {
  width: min(480px, calc(100vw - 32px));
  max-width: min(480px, calc(100vw - 32px));
}

.figma-theme .modal.modal-figma.modal-size-lg {
  width: min(900px, calc(100vw - 32px));
  max-width: min(900px, calc(100vw - 32px));
}

.figma-theme .modal-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.figma-theme .modal-figma-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  padding: 20px;
  background: #ffffff;
}

.figma-theme .modal-figma-body::-webkit-scrollbar {
  display: none;
}

.figma-theme .settings-menu-note,
.figma-theme .role-settings-note,
.figma-theme .help-intro,
.figma-theme .modal-required-note,
.figma-theme .download-database-status {
  margin: 0;
  font: 400 13px/1.45 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
}

.figma-theme .download-database-status {
  min-height: 1.2em;
}

.figma-theme .export-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.figma-theme .settings-menu-btn.export-stop-btn {
  width: 100%;
  border-color: #e10613;
  background: #e10613;
  color: #ffffff;
}

.figma-theme .settings-menu-btn.export-stop-btn:hover:not(:disabled) {
  background: #c10510;
  border-color: #c10510;
  color: #ffffff;
}

.figma-theme .settings-menu-btn.export-stop-btn:disabled {
  border-color: #d4d4d4;
  background: #f0f0f0;
  color: #a3a3a3;
  cursor: not-allowed;
  opacity: 1;
}

.figma-theme .menu-modal .settings-menu-btn.export-stop-btn {
  width: 100%;
  border-color: #e10613;
  background: #e10613;
  color: #ffffff;
}

.figma-theme .menu-modal .settings-menu-btn.export-stop-btn:hover:not(:disabled) {
  background: #c10510;
  border-color: #c10510;
  color: #ffffff;
}

.figma-theme .menu-modal .settings-menu-btn.export-stop-btn:disabled {
  border-color: #d4d4d4;
  background: #f0f0f0;
  color: #a3a3a3;
}

.figma-theme .modal-figma-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-top: 1px solid var(--figma-border);
  background: #ffffff;
}

.figma-theme .modal-figma-footer .save-message,
.figma-theme .modal-figma-footer .modal-required-note {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  text-align: left;
}

.figma-theme .settings-menu-btn,
.figma-theme .modal-submit-btn,
.figma-theme .download-database-stop-btn {
  box-sizing: border-box;
  width: auto;
  min-width: 10rem;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--figma-black);
  border-radius: 6px;
  background: #ffffff;
  font: 500 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.figma-theme .settings-menu-btn:hover,
.figma-theme .download-database-stop-btn:hover:not(.is-stop-download) {
  background: var(--menu-item-hover);
  color: var(--figma-black);
}

.figma-theme .modal-submit-btn,
.figma-theme .settings-menu-btn--primary {
  background: var(--figma-black);
  color: #ffffff;
}

.figma-theme .modal-submit-btn:hover:not(:disabled),
.figma-theme .settings-menu-btn--primary:hover:not(:disabled) {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff;
}

.figma-theme .modal-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.figma-theme .modal-submit-btn.export-excel-btn {
  background: #ffffff;
  border-color: var(--figma-black);
  color: var(--figma-black);
}

.figma-theme .modal-submit-btn.export-excel-btn:hover:not(:disabled) {
  background: var(--menu-item-hover);
  border-color: var(--figma-black);
  color: var(--figma-black);
}

.figma-theme .modal-submit-btn.export-excel-btn.is-exporting,
.figma-theme .modal-submit-btn.export-excel-btn.is-exporting:hover {
  background: #ffffff;
  border-color: #c40000;
  color: var(--figma-black);
}

.figma-theme .download-database-modal .modal-submit-btn.export-excel-btn:not(.is-exporting) {
  background: var(--figma-black);
  border-color: var(--figma-black);
  color: #ffffff;
}

.figma-theme .download-database-modal .modal-submit-btn.export-excel-btn:not(.is-exporting):hover:not(:disabled) {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff;
}

.figma-theme .download-database-modal .download-database-stop-btn.is-stop-download {
  border-color: #c40000;
  background: #c40000;
  color: #ffffff;
}

.figma-theme .download-database-modal .download-database-stop-btn.is-stop-download:hover,
.figma-theme .download-database-modal .download-database-stop-btn:not([hidden]):hover:not(:disabled) {
  background: #a30000;
  border-color: #a30000;
  color: #ffffff;
}

.figma-theme .menu-modal .help-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--mm-border, #d9d9d4);
}

.figma-theme .menu-modal .help-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.figma-theme .menu-modal .modal-section-card {
  border-color: var(--mm-border, #d9d9d4);
}

.figma-theme .download-database-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.figma-theme .role-settings-body .role-settings-category {
  overflow: visible;
  flex-shrink: 0;
}

.figma-theme .role-settings-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.figma-theme .role-settings-category-panel .role-settings-table-scroll {
  border: none;
  border-radius: 0;
}

.figma-theme .help-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.figma-theme .help-section-title {
  margin: 0;
  font: 600 14px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
}

.figma-theme .help-section p {
  margin: 0;
  font: 400 14px/1.5 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
}

.figma-theme .help-link {
  color: var(--figma-black);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.figma-theme .help-link:hover {
  color: var(--figma-text-muted);
}

.figma-theme .library-brand {
  position: static;
  transform: none;
  display: flex;
  align-items: center;
  gap: var(--header-side-gap);
  flex-shrink: 0;
  pointer-events: auto;
  text-decoration: none;
  color: inherit;
}

.figma-theme .library-brand-mark {
  flex-shrink: 0;
  display: block;
  line-height: 0;
}

.figma-theme .library-brand-mark img {
  display: block;
  height: var(--header-mark-size);
  width: auto;
  object-fit: contain;
}

.figma-theme .library-brand-text {
  min-width: 0;
}

.figma-theme .library-brand-name,
.figma-theme .library-brand-subtitle {
  display: block;
}

.figma-theme .library-logo {
  display: none;
}

.figma-theme .sign-out-btn {
  position: static;
  font: 400 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
  text-decoration: none;
}

.figma-theme .sign-out-btn:hover {
  color: var(--figma-black);
}

.figma-theme .header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.figma-theme .settings-btn {
  font: 400 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.figma-theme .settings-btn:hover {
  color: var(--figma-black);
}

.figma-theme .settings-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  text-decoration: none;
}

.figma-theme .settings-btn[hidden],
.figma-theme .settings-btn-icon[hidden] {
  display: none !important;
}

.figma-theme .settings-btn-icon:hover {
  background: #f5f5f5;
}

.figma-theme .role-settings-category {
  padding: 0;
  border: 1px solid var(--figma-border);
  border-radius: 8px;
  background: #ffffff;
}

.figma-theme .role-settings-category-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.figma-theme .role-settings-category-summary::-webkit-details-marker {
  display: none;
}

.figma-theme .role-settings-category-summary::marker {
  content: "";
}

.figma-theme .role-settings-category[open] > .role-settings-category-summary {
  border-bottom: 1px solid var(--figma-border);
}

.figma-theme .role-settings-category-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.figma-theme .role-settings-category-title {
  margin: 0;
  font: 600 14px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
}

.figma-theme .role-settings-category-intro {
  margin: 0;
  font: 400 12px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
}

.figma-theme .role-settings-category-chevron {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-right: 1.25px solid var(--figma-text-muted);
  border-bottom: 1.25px solid var(--figma-text-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.figma-theme .role-settings-category[open] .role-settings-category-chevron {
  transform: rotate(45deg);
}

.figma-theme .role-settings-category-panel {
  padding: 10px 14px 12px;
}

.figma-theme .role-settings-category-empty {
  margin: 0;
  font: 400 13px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
}

.figma-theme .role-settings-table-wrap,
.figma-theme .role-settings-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--figma-border);
  border-radius: 8px;
}

.figma-theme .role-settings-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.figma-theme .role-settings-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: 0 1px 0 var(--figma-border);
  font: 600 12px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
  padding: 8px 10px;
}

.figma-theme .role-settings-table .role-settings-feature-col,
.figma-theme .role-settings-table .role-settings-feature-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
  box-shadow: 1px 0 0 var(--figma-border);
}

.figma-theme .role-settings-table thead .role-settings-feature-col {
  z-index: 3;
}

.figma-theme .role-settings-table th,
.figma-theme .role-settings-table td {
  border-bottom: 1px solid var(--figma-border);
  padding: 7px 10px;
  text-align: left;
  vertical-align: middle;
}

.figma-theme .role-settings-feature-cell {
  width: 58%;
}

.figma-theme .role-settings-feature-col {
  width: 58%;
}

.figma-theme .role-settings-feature-label {
  display: block;
  font: 500 13px/1.25 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
}

.figma-theme .role-settings-feature-hint {
  display: block;
  margin-top: 2px;
  font: 400 11px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
}

.figma-theme .role-settings-role-col {
  width: 14%;
  text-align: center;
  white-space: nowrap;
}

.figma-theme .role-settings-table thead .role-settings-role-col,
.figma-theme .role-settings-table th.role-settings-role-col {
  text-align: center;
}

.figma-theme .role-settings-check-cell {
  width: 14%;
  text-align: center;
}

.figma-theme .role-settings-table td.role-settings-check-cell {
  text-align: center;
}

.figma-theme .role-settings-table td.role-settings-check-cell .role-settings-check,
.figma-theme .role-settings-table td.role-settings-check-cell .role-settings-admin-only {
  display: inline-flex;
  margin-inline: auto;
}

.figma-theme .role-settings-admin-only {
  display: inline-block;
  font: 500 10px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--figma-text-muted);
}

.figma-theme .role-settings-admin-only-row .role-settings-feature-label {
  color: var(--figma-text-muted);
}

.figma-theme .role-settings-action-row .role-settings-feature-label {
  color: var(--figma-text, #1a1a1a);
}

.figma-theme .role-settings-action-row.is-active .role-settings-feature-label,
.figma-theme .role-settings-action-row.is-active .role-settings-feature-hint {
  color: #c40000;
}

.figma-theme .role-settings-check.is-disabled {
  cursor: default;
  opacity: 0.38;
  pointer-events: none;
}

.figma-theme .role-settings-check.is-disabled input,
.figma-theme .role-settings-check.is-disabled input[type="checkbox"] {
  border-color: #bdbdb7;
  background-color: #f0f0ec;
  cursor: default;
}

.figma-theme .role-settings-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.figma-theme .role-settings-check input,
.figma-theme .role-settings-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
  display: block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  max-width: 16px;
  min-height: 16px;
  max-height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid #111111;
  border-radius: 50%;
  background: #ffffff;
  accent-color: #111111;
  cursor: pointer;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  box-shadow: none;
}

.figma-theme .role-settings-check input:checked,
.figma-theme .role-settings-check input[type="checkbox"]:checked {
  border-color: #111111;
  border-radius: 50%;
  background-color: #111111;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: none;
}

.figma-theme .role-settings-check input:focus,
.figma-theme .role-settings-check input[type="checkbox"]:focus {
  border-color: #111111;
  box-shadow: none;
}

.figma-theme .role-settings-check input:focus-visible,
.figma-theme .role-settings-check input[type="checkbox"]:focus-visible {
  outline: 2px solid #111111;
  outline-offset: 2px;
  border-radius: 50%;
}

.figma-theme .role-settings-check--danger input,
.figma-theme .role-settings-check--danger input[type="checkbox"] {
  border-color: #111111;
  accent-color: #c40000;
}

.figma-theme .role-settings-check--danger input:checked,
.figma-theme .role-settings-check--danger input[type="checkbox"]:checked {
  border-color: #c40000;
  background-color: #c40000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.figma-theme .role-settings-check--danger input:focus-visible,
.figma-theme .role-settings-check--danger input[type="checkbox"]:focus-visible {
  outline-color: #c40000;
}

.figma-theme .role-settings-check--danger input:checked:focus-visible,
.figma-theme .role-settings-check--danger input[type="checkbox"]:checked:focus-visible {
  border-color: #c40000;
  outline: 2px solid rgba(196, 0, 0, 0.35);
  outline-offset: 2px;
}

.figma-theme .role-settings-users-table {
  width: 100%;
  border-collapse: collapse;
}

.figma-theme .role-settings-users-table th,
.figma-theme .role-settings-users-table td {
  border-bottom: 1px solid var(--figma-border);
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
  font: 400 12px/1.35 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .role-settings-users-table th {
  font-weight: 600;
  color: var(--figma-black);
  background: #ffffff;
}

.figma-theme .role-settings-users-role {
  text-transform: capitalize;
  white-space: nowrap;
}

.figma-theme .confirm-dialog {
  --cu-surface: #ffffff;
  --cu-text: #222222;
  --cu-text-secondary: #6b6b6b;
  --cu-border: #d9d9d4;
  --cu-control-dark: #050505;
  --cu-hover: #f7f7f5;
  --cu-radius: 10px;
  --cu-radius-sm: 6px;
  --cu-control-h: 28px;
  width: min(100%, 22rem);
  padding: 14px 16px 12px;
  border: 1px solid var(--cu-border);
  border-radius: var(--cu-radius);
  background: var(--cu-surface);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.figma-theme .confirm-title {
  margin: 0 0 6px;
  font: 600 16px/1.25 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text);
}

.figma-theme .confirm-message {
  margin: 0 0 14px;
  font: 400 12px/1.45 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text-secondary);
}

.figma-theme .confirm-actions {
  gap: 6px;
}

.figma-theme .confirm-cancel-btn,
.figma-theme .confirm-submit-btn {
  min-height: var(--cu-control-h);
  height: var(--cu-control-h);
  padding: 0 12px;
  border-radius: var(--cu-radius-sm);
  font: 500 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .confirm-cancel-btn {
  border: 1px solid var(--cu-border);
  background: var(--cu-surface);
  color: var(--cu-text);
}

.figma-theme .confirm-cancel-btn:hover {
  background: var(--cu-hover);
}

.figma-theme .confirm-submit-btn {
  border: 1px solid var(--cu-control-dark);
  background: var(--cu-control-dark);
  color: #ffffff;
}

.figma-theme .confirm-submit-btn:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

.figma-theme .confirm-submit-btn.is-danger {
  border-color: #b42318;
  background: #b42318;
}

.figma-theme .confirm-submit-btn.is-danger:hover {
  background: #912018;
  border-color: #912018;
}

/* Shared menu-modal chrome (Users, Archive, Export, …) */
.figma-theme .modal.modal-figma.menu-modal {
  --mm-surface: #ffffff;
  --mm-text: #222222;
  --mm-text-secondary: #6b6b6b;
  --mm-text-faint: #9b9b9b;
  --mm-border: #d9d9d4;
  --mm-control-dark: #050505;
  --mm-hover: #f7f7f5;
  --mm-radius: 8px;
  --mm-radius-sm: 6px;
  --mm-control-h: 28px;
  --mm-modal-width: min(780px, calc(100vw - 28px));
  width: var(--mm-modal-width);
  max-width: var(--mm-modal-width);
  min-width: 0;
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.figma-theme .menu-modal .menu-modal-header,
.figma-theme .menu-modal .modal-figma-header {
  height: auto;
  min-height: 0;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 10px;
  background: var(--mm-surface);
  border-bottom: 1px solid var(--mm-border);
}

.figma-theme .menu-modal-header-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.figma-theme .menu-modal .menu-modal-header h2,
.figma-theme .menu-modal .modal-figma-header h2 {
  margin: 0;
  flex: 0 1 auto;
  font: 600 16px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--mm-text);
}

.figma-theme .menu-modal-subtitle {
  margin: 0;
  max-width: 40rem;
  font: 400 11px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--mm-text-secondary);
}

.figma-theme .menu-modal-wip {
  font-weight: 500;
  color: var(--mm-text-secondary, #6b6b6b);
}

.figma-theme .menu-modal .modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--mm-control-h);
  min-width: var(--mm-control-h);
  min-height: var(--mm-control-h);
  height: var(--mm-control-h);
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--figma-black, #050505);
  color: #ffffff;
  box-shadow: none;
  cursor: pointer;
  line-height: 0;
}

.figma-theme .menu-modal .modal-close-btn[hidden],
.figma-theme .modal-figma-header .modal-close-btn[hidden] {
  display: none !important;
}

.figma-theme .menu-modal .modal-close-btn:hover {
  background: #1a1a1a;
  border: none;
  color: #ffffff;
}

.figma-theme .modal-close-icon {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.figma-theme .menu-modal .menu-modal-body,
.figma-theme .menu-modal .modal-figma-body {
  gap: 0;
  padding: 10px 14px;
  background: var(--mm-surface);
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.figma-theme .menu-modal .menu-modal-footer,
.figma-theme .menu-modal .modal-figma-footer {
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--mm-surface);
  border-top: 1px solid var(--mm-border);
  flex-shrink: 0;
}

.figma-theme .menu-modal .settings-menu-btn,
.figma-theme .menu-modal .menu-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: var(--mm-control-h);
  height: var(--mm-control-h);
  padding: 0 10px;
  border-radius: var(--mm-radius-sm);
  font: 500 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  color: var(--mm-text);
  box-shadow: none;
}

.figma-theme .menu-modal .settings-menu-btn:hover,
.figma-theme .menu-modal .menu-modal-btn:hover {
  background: var(--mm-hover);
  color: var(--mm-text);
  border-color: var(--mm-border);
}

.figma-theme .menu-modal .settings-menu-btn--primary {
  border-color: var(--mm-control-dark);
  background: var(--mm-control-dark);
  color: #ffffff;
}

.figma-theme .menu-modal .settings-menu-btn--primary:hover:not(:disabled) {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff;
}

.figma-theme .menu-modal.current-users-modal .current-users-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.figma-theme .modal.modal-figma.menu-modal.export-actions-modal {
  --mm-modal-width: min(390px, calc(100vw - 28px));
  width: var(--mm-modal-width);
  max-width: var(--mm-modal-width);
  min-width: 0;
}

.figma-theme .modal.modal-figma.menu-modal.download-database-modal {
  --mm-modal-width: min(390px, calc(100vw - 28px));
  width: var(--mm-modal-width);
  max-width: var(--mm-modal-width);
  min-width: 0;
}

.figma-theme .modal.modal-figma.menu-modal.change-password-modal {
  --mm-modal-width: min(390px, calc(100vw - 28px));
  width: var(--mm-modal-width);
  max-width: var(--mm-modal-width);
  min-width: 0;
}

.figma-theme .modal.modal-figma.menu-modal.chat-modal {
  --mm-modal-width: min(380px, calc(100vw - 28px));
  top: auto;
  left: auto;
  right: 20px;
  bottom: 20px;
  transform: none;
  width: var(--mm-modal-width);
  max-width: var(--mm-modal-width);
  min-width: 0;
  height: min(560px, calc(100vh - 40px));
  max-height: min(560px, calc(100vh - 40px));
  border: 1px solid var(--mm-border, #d9d9d4);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  z-index: 95;
}

.figma-theme .modal-backdrop.chat-dock-backdrop {
  background: transparent;
  pointer-events: none;
}

@media (max-width: 640px) {
  .figma-theme .modal.modal-figma.menu-modal.chat-modal {
    right: 12px;
    bottom: 12px;
    --mm-modal-width: min(100vw - 24px, 380px);
    height: min(70vh, calc(100vh - 24px));
    max-height: min(70vh, calc(100vh - 24px));
  }
}

.figma-theme .chat-modal .chat-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 12px;
  padding-bottom: 12px;
  overflow: hidden;
}

.figma-theme .chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 2px 2px 4px;
}

.figma-theme .chat-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font: 400 12px/1.45 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--mm-text, #1a1a1a);
}

.figma-theme .chat-bubble p {
  margin: 0;
}

.figma-theme .chat-bubble p + p,
.figma-theme .chat-bubble p + ul,
.figma-theme .chat-bubble ul + p {
  margin-top: 8px;
}

.figma-theme .chat-bubble--assistant {
  align-self: flex-start;
  background: #f3f3f0;
  border: 1px solid var(--mm-border, #d9d9d4);
  border-bottom-left-radius: 4px;
}

.figma-theme .chat-bubble--user {
  align-self: flex-end;
  background: var(--figma-black, #050505);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.figma-theme .chat-result-list {
  margin: 0;
  padding: 0 0 0 1.1em;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.figma-theme .chat-bubble-note {
  font-size: 11px;
  color: var(--mm-text-secondary, #6b6b6b);
}

.figma-theme .chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.figma-theme .chat-suggestion {
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--mm-border, #d9d9d4);
  border-radius: 999px;
  background: #ffffff;
  color: var(--mm-text-secondary, #6b6b6b);
  font: 500 11px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  cursor: default;
  opacity: 0.85;
}

.figma-theme .chat-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.figma-theme .chat-composer {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.figma-theme .chat-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: var(--mm-control-h, 36px);
  padding: 0 12px;
  border: 1px solid var(--mm-border, #d9d9d4);
  border-radius: 999px;
  background: #ffffff;
  color: var(--mm-text, #1a1a1a);
  font: 400 12px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .chat-input:disabled {
  background: #f7f7f5;
  color: var(--mm-text-secondary, #6b6b6b);
  cursor: not-allowed;
}

.figma-theme .chat-send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.figma-theme .chat-result-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.figma-theme .chat-result-link:hover,
.figma-theme .chat-result-link:focus-visible {
  color: var(--figma-black, #050505);
}

.figma-theme .chat-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.figma-theme .chat-inline-action {
  margin: 0;
  padding: 5px 10px;
  border: 1px solid var(--mm-border, #d9d9d4);
  border-radius: 999px;
  background: #ffffff;
  color: var(--mm-text, #1a1a1a);
  font: 500 11px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.figma-theme .chat-inline-action:hover,
.figma-theme .chat-inline-action:focus-visible {
  border-color: var(--figma-black, #050505);
}

.figma-theme .chat-inline-action--primary {
  border-color: var(--figma-black, #050505);
  background: var(--figma-black, #050505);
  color: #ffffff;
}

.figma-theme .chat-inline-action--primary:hover,
.figma-theme .chat-inline-action--primary:focus-visible {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

.figma-theme .library-chat-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--figma-black, #050505);
  border-radius: 999px;
  background: var(--figma-black, #050505);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.figma-theme .library-chat-fab:hover,
.figma-theme .library-chat-fab:focus-visible {
  background: #1a1a1a;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  outline: none;
}

.figma-theme .library-chat-fab:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.figma-theme .library-chat-fab.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.figma-theme .library-chat-fab-icon {
  display: block;
  flex-shrink: 0;
  shape-rendering: geometricPrecision;
}

@media (max-width: 640px) {
  .figma-theme .library-chat-fab {
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
  }
}

.figma-theme .change-password-modal .modal-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.figma-theme .change-password-modal .detail-field {
  gap: 6px;
}

.figma-theme .change-password-modal .detail-field > label {
  font: 500 11px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--mm-text-secondary, #6b6b6b);
}

.figma-theme .change-password-modal .password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--figma-border-input, #d9d9d4);
  border-radius: 999px;
  background: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.figma-theme .change-password-modal .password-input-wrap:focus-within {
  border-color: var(--figma-black, #050505);
  box-shadow: 0 0 0 1px var(--figma-black, #050505);
}

.figma-theme .change-password-modal .modal-fields .detail-input,
.figma-theme .change-password-modal .modal-fields input.detail-input,
.figma-theme .change-password-modal .password-input-wrap input.detail-input {
  height: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0 44px 0 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  font: 400 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black, #050505);
}

.figma-theme .change-password-modal .modal-fields .detail-input:focus,
.figma-theme .change-password-modal .modal-fields input.detail-input:focus,
.figma-theme .change-password-modal .password-input-wrap input.detail-input:focus {
  border: none;
  box-shadow: none;
  outline: none;
}

.figma-theme .change-password-modal .password-toggle {
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
}

.figma-theme .change-password-modal .password-toggle:hover {
  background: #f5f5f5;
}

.figma-theme .change-password-modal .change-password-footer {
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.figma-theme .change-password-modal .change-password-footer .save-message {
  flex: 1 1 100%;
  width: 100%;
  margin: 0;
  text-align: center;
}

.figma-theme .change-password-modal .change-password-footer .modal-submit-btn,
.figma-theme .change-password-modal .change-password-footer .settings-menu-btn {
  min-width: 12rem;
  width: 100%;
  max-width: 16rem;
  height: 36px;
  min-height: 36px;
  border-radius: 999px;
}

.figma-theme .download-database-modal .download-database-footer {
  justify-content: center;
  gap: 8px;
}

.figma-theme .download-database-modal .download-database-footer .modal-submit-btn,
.figma-theme .download-database-modal .download-database-footer .download-database-stop-btn {
  min-width: 12rem;
  width: 100%;
  max-width: 16rem;
}

.figma-theme .download-database-modal .download-database-stop-btn:not([hidden]) {
  border-color: #c40000;
  background: #c40000;
  color: #ffffff;
}

.figma-theme .download-database-modal .download-database-stop-btn:not([hidden]):hover:not(:disabled) {
  background: #a30000;
  border-color: #a30000;
  color: #ffffff;
}

.figma-theme .menu-modal.export-actions-modal .export-actions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.figma-theme .menu-modal.export-actions-modal .settings-menu-note {
  margin: 0 0 10px;
  font: 400 12px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--mm-text-secondary);
}

.figma-theme .current-users-modal {
  --cu-surface: var(--mm-surface, #ffffff);
  --cu-text: var(--mm-text, #222222);
  --cu-text-secondary: var(--mm-text-secondary, #6b6b6b);
  --cu-text-faint: var(--mm-text-faint, #9b9b9b);
  --cu-border: var(--mm-border, #d9d9d4);
  --cu-control-dark: var(--mm-control-dark, #050505);
  --cu-hover: var(--mm-hover, #f7f7f5);
  --cu-selected: #f0f0ec;
  --cu-accent: #e10613;
  --cu-disabled: #bdbdb7;
  --cu-radius: var(--mm-radius, 8px);
  --cu-radius-sm: var(--mm-radius-sm, 6px);
  --cu-control-h: var(--mm-control-h, 28px);
  --cu-modal-height: min(680px, calc(100vh - 1.5rem));
  --mm-modal-width: min(720px, calc(100vw - 28px));
  --cu-modal-width: var(--mm-modal-width);
  width: var(--cu-modal-width);
  max-width: var(--cu-modal-width);
  min-width: var(--cu-modal-width);
  height: var(--cu-modal-height);
  max-height: var(--cu-modal-height);
  min-height: var(--cu-modal-height);
  background: var(--cu-surface);
  border: 1px solid var(--cu-border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.figma-theme .current-users-header {
  height: auto;
  min-height: 0;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 10px;
  background: var(--cu-surface);
  border-bottom: 1px solid var(--cu-border);
}

.figma-theme .current-users-header-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.figma-theme .current-users-header h2 {
  margin: 0;
  font: 600 16px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text);
}

.figma-theme .current-users-subtitle {
  margin: 0;
  max-width: 40rem;
  font: 400 11px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text-secondary);
}

.figma-theme .cu-legend-word {
  font-weight: 700;
}

.figma-theme .cu-legend-word--black {
  color: #111111;
}

.figma-theme .cu-legend-word--grey {
  color: #9b9b9b;
}

.figma-theme .cu-legend-word--green {
  color: #1b8a4a;
}

.figma-theme .cu-legend-word--red {
  color: #c40000;
}

.figma-theme .current-users-header .modal-close-btn,
.figma-theme .modal-figma-header.current-users-header .modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--figma-black, #050505);
  color: #ffffff;
  box-shadow: none;
  cursor: pointer;
  line-height: 0;
}

.figma-theme .current-users-header .modal-close-btn:hover,
.figma-theme .modal-figma-header.current-users-header .modal-close-btn:hover {
  background: #1a1a1a;
  border: none;
  color: #ffffff;
}

.figma-theme .current-users-icon {
  display: block;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.figma-theme .current-users-icon--check {
  width: 10px;
  height: 10px;
}

.figma-theme .current-users-icon--chevron {
  width: 11px;
  height: 11px;
  color: var(--cu-text-faint);
}

.figma-theme .current-users-body {
  gap: 0;
  padding: 10px 14px;
  background: var(--cu-surface);
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.figma-theme .current-users-autosave-status {
  margin: 0;
  min-height: 0;
  font: 400 11px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text-secondary);
}

.figma-theme .current-users-autosave-status:not([hidden]) {
  margin-bottom: 6px;
}

.figma-theme .current-users-workspace {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.figma-theme .current-users-loading,
.figma-theme .current-users-error,
.figma-theme .current-users-empty,
.figma-theme .current-users-empty-inline,
.figma-theme .current-users-detail-empty {
  margin: 0;
  padding: 14px;
  font: 400 12px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text-secondary);
}

.figma-theme .current-users-loading,
.figma-theme .current-users-error {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.figma-theme .current-users-sidebar-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px;
  border-bottom: 1px solid var(--cu-border);
  background: var(--cu-surface);
}

.figma-theme .current-users-sidebar-tools .current-users-search,
.figma-theme .current-users-sidebar-tools .current-users-filters {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.figma-theme .current-users-sidebar-tools .current-users-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  flex-wrap: unset;
}

.figma-theme .current-users-sidebar-tools .current-users-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex-shrink: 1;
  justify-self: stretch;
  padding: 0 2px;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.figma-theme .current-users-search {
  position: relative;
  display: block;
  width: 100%;
}

.figma-theme .current-users-search-icon {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  color: var(--cu-text-faint);
  pointer-events: none;
}

.figma-theme .current-users-search input {
  width: 100%;
  min-height: var(--cu-control-h);
  height: var(--cu-control-h);
  padding: 0 10px 0 30px;
  border: 1px solid var(--cu-border);
  border-radius: var(--cu-radius-sm);
  background: var(--cu-surface);
  font: 400 12px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text);
  outline: none;
  box-sizing: border-box;
}

.figma-theme .current-users-search input::placeholder {
  color: var(--cu-text-faint);
}

.figma-theme .current-users-search input:focus {
  border-color: #b8b8b2;
  background: var(--cu-surface);
}

.figma-theme .current-users-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.figma-theme .current-users-filters::-webkit-scrollbar {
  display: none;
}

.figma-theme .current-users-filter-chip {
  flex-shrink: 0;
  min-height: 24px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--cu-border);
  border-radius: 999px;
  background: var(--cu-surface);
  font: 500 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text-secondary);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.figma-theme .current-users-filter-chip:hover {
  background: var(--cu-hover);
  color: var(--cu-text);
}

.figma-theme .current-users-filter-chip.is-active {
  border-color: var(--cu-control-dark);
  background: var(--cu-control-dark);
  color: #ffffff;
}

.figma-theme .current-users-panes {
  display: grid;
  grid-template-columns: minmax(170px, 200px) minmax(0, 1fr);
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.figma-theme .current-users-sidebar,
.figma-theme .current-users-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--cu-border);
  border-radius: var(--cu-radius);
  background: var(--cu-surface);
  overflow: hidden;
  box-shadow: none;
}

.figma-theme .current-users-sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--cu-border);
  background: var(--cu-surface);
}

.figma-theme .current-users-count {
  display: block;
  padding: 0 2px;
  font: 600 10px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.figma-theme .current-users-mode-select {
  min-height: 26px;
  height: 26px;
  padding: 0 22px 0 8px;
  border: 1px solid var(--cu-border);
  border-radius: var(--cu-radius-sm);
  background: var(--cu-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%23666666' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center;
  appearance: none;
  font: 500 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text);
  cursor: pointer;
}

.figma-theme .current-users-sidebar-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d5d5d0 transparent;
  flex: 1;
  min-height: 0;
}

.figma-theme .current-users-list {
  list-style: none;
  margin: 0;
  padding: 5px;
}

.figma-theme .current-users-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin: 0 0 2px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--cu-radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  box-sizing: border-box;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.figma-theme .current-users-row:hover {
  background: var(--cu-hover);
}

.figma-theme .current-users-row.is-selected {
  background: var(--cu-selected);
  border-color: var(--cu-border);
  box-shadow: inset 3px 0 0 var(--cu-control-dark);
}

.figma-theme .current-users-row.is-selected .current-users-name {
  color: var(--cu-control-dark);
}

.figma-theme .current-users-row.is-selected.current-users-row--external .current-users-name,
.figma-theme .current-users-row.is-selected.current-users-row--external .current-users-email {
  color: #1b8a4a;
}

.figma-theme .current-users-row.is-selected.current-users-row--pending .current-users-name,
.figma-theme .current-users-row.is-selected.current-users-row--pending .current-users-email,
.figma-theme .current-users-row.is-selected.current-users-row--external.current-users-row--pending .current-users-name,
.figma-theme .current-users-row.is-selected.current-users-row--external.current-users-row--pending .current-users-email {
  color: #c40000;
}

.figma-theme .current-users-row.is-selected .current-users-row-chevron {
  color: var(--cu-control-dark);
}

.figma-theme .current-users-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #d8d8d8;
  font: 600 9px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #ffffff;
  text-transform: uppercase;
}

.figma-theme .current-users-avatar--lg {
  width: 34px;
  height: 34px;
  font-size: 12px;
  background: #d8d8d8;
  color: #ffffff;
}

.figma-theme .current-users-identity {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.figma-theme .current-users-name,
.figma-theme .current-users-detail-name {
  margin: 0;
  font: 600 12px/1.25 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.figma-theme .current-users-email,
.figma-theme .current-users-detail-email,
.figma-theme .current-users-detail-meta {
  margin: 0;
  font: 400 11px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.figma-theme .current-users-detail-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: normal;
}

.figma-theme .current-users-detail-meta-icon {
  display: inline-flex;
  color: var(--cu-text-secondary);
}

.figma-theme .current-users-detail-meta-icon .current-users-icon {
  width: 11px;
  height: 11px;
}

.figma-theme .current-users-row--external .current-users-name,
.figma-theme .current-users-row--external .current-users-email {
  color: #1b8a4a;
}

.figma-theme .current-users-row--pending .current-users-name,
.figma-theme .current-users-row--pending .current-users-email,
.figma-theme .current-users-row--external.current-users-row--pending .current-users-name,
.figma-theme .current-users-row--external.current-users-row--pending .current-users-email {
  color: #c40000;
}

.figma-theme .current-users-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 16px;
  padding: 0 6px;
  border: 1px solid var(--cu-border);
  border-radius: 999px;
  font: 600 8px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--cu-surface);
  color: #555555;
}

.figma-theme .current-users-role-badge--client {
  border-color: #cfd8de;
  color: #4a5d6a;
}

.figma-theme .current-users-role-badge--designer {
  border-color: #d5cfe0;
  color: #5b4a6a;
}

.figma-theme .current-users-role-badge--sales {
  border-color: #ddd4bc;
  color: #6a5a3a;
}

.figma-theme .current-users-role-badge--kenas {
  border-color: #c9d6c9;
  color: #3f5a3f;
}

.figma-theme .current-users-role-badge--administrator {
  border-color: var(--cu-control-dark);
  background: var(--cu-control-dark);
  color: #ffffff;
}

.figma-theme .current-users-row-chevron {
  display: inline-flex;
  color: var(--cu-text-faint);
}

.figma-theme .current-users-detail-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  gap: 8px;
  padding: 10px;
  background: var(--cu-surface);
  max-width: 100%;
  box-sizing: border-box;
}

.figma-theme .current-users-detail-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.figma-theme .current-users-detail-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.figma-theme .current-users-detail-name {
  font-size: 14px;
  white-space: normal;
}

.figma-theme .current-users-detail-email {
  white-space: normal;
}

.figma-theme .current-users-more {
  position: relative;
}

.figma-theme .current-users-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--cu-radius-sm);
  background: transparent;
  color: var(--cu-text-secondary);
  cursor: pointer;
}

.figma-theme .current-users-more-btn:hover {
  background: var(--cu-hover);
  border-color: var(--cu-border);
  color: var(--cu-text);
}

.figma-theme .current-users-more-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  min-width: 140px;
  padding: 4px;
  border: 1px solid var(--cu-border);
  border-radius: var(--cu-radius);
  background: var(--cu-surface);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.figma-theme .current-users-more-item {
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: none;
  border-radius: var(--cu-radius-sm);
  background: transparent;
  text-align: left;
  font: 500 12px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text);
  cursor: pointer;
}

.figma-theme .current-users-more-item:hover {
  background: var(--cu-hover);
}

.figma-theme .current-users-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--cu-border);
  border-radius: var(--cu-radius);
  background: var(--cu-surface);
  box-shadow: none;
  max-width: 100%;
  box-sizing: border-box;
}

.figma-theme .current-users-section--account {
  flex-shrink: 0;
}

.figma-theme .current-users-role-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.figma-theme .current-users-role-select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: var(--cu-control-h);
  height: var(--cu-control-h);
  padding: 0 28px 0 10px;
  border: 1px solid var(--cu-border);
  border-radius: var(--cu-radius-sm);
  background: var(--cu-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%23666666' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 9px center;
  appearance: none;
  font: 500 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text);
  cursor: pointer;
  box-sizing: border-box;
}

.figma-theme .current-users-section--access {
  flex: 1 1 0;
  min-height: 120px;
  overflow: hidden;
}

.figma-theme .current-users-access-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.figma-theme .current-users-access-block .current-users-section-heading {
  flex-shrink: 0;
}

.figma-theme .current-users-access-block .current-users-scope {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.figma-theme .current-users-access-block .current-users-chip-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d5d5d0 transparent;
  align-content: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.figma-theme .current-users-section-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.figma-theme .current-users-section-heading {
  min-width: 0;
  flex: 1;
  padding: 0;
  border: none;
  margin: 0;
}

.figma-theme .current-users-section-heading h4 {
  margin: 0 0 2px;
  font: 600 11px/1.25 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.figma-theme .current-users-section-heading p {
  margin: 0;
  font: 400 11px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text-secondary);
}

.figma-theme .current-users-section-heading:not(:has(p)) {
  padding-bottom: 0;
  margin-bottom: 0;
}

.figma-theme .current-users-more-item--danger {
  color: #b42318;
}

.figma-theme .current-users-more-item--danger:hover {
  background: #fef3f2;
}

.figma-theme .current-users-more-item--danger:disabled {
  color: var(--cu-disabled);
  cursor: default;
  background: transparent;
}

.figma-theme .current-users-mode-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.figma-theme .current-users-mode-select {
  min-width: 140px;
  max-width: 168px;
}

.figma-theme .current-users-mode-hint {
  display: inline-flex;
  color: var(--cu-text-secondary);
}

.figma-theme .current-users-scope {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.figma-theme .current-users-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.figma-theme .current-users-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  min-height: 24px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--cu-border);
  border-radius: 999px;
  outline: none;
  box-shadow: none;
  background: var(--cu-surface);
  font: 500 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text-secondary);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.figma-theme .current-users-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  border: 0;
  cursor: pointer;
}

.figma-theme .current-users-chip-check {
  display: none;
}

.figma-theme .current-users-chip:hover {
  background: var(--cu-hover);
  color: var(--cu-text);
}

.figma-theme .current-users-chip.is-checked,
.figma-theme .current-users-chip:has(input:checked) {
  border-color: var(--cu-control-dark);
  background: var(--cu-control-dark);
  color: #ffffff;
}

.figma-theme .current-users-chip.is-checked .current-users-chip-check,
.figma-theme .current-users-chip:has(input:checked) .current-users-chip-check {
  display: inline-flex;
}

.figma-theme .current-users-access-banner {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--cu-border);
  border-radius: var(--cu-radius-sm);
  background: var(--cu-hover);
  font: 400 11px/1.35 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text-secondary);
}

.figma-theme .current-users-access-banner-icon {
  display: inline-flex;
  margin-top: 1px;
  color: #6b7c8c;
}

.figma-theme .current-users-section--activity {
  flex: 1.4 1 0;
  min-height: 150px;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.figma-theme .current-users-section--activity .current-users-section-heading {
  width: 100%;
  padding-inline: 0;
}

.figma-theme .current-users-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d5d5d0 transparent;
}

.figma-theme .current-users-activity-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  pointer-events: none;
  cursor: default;
  user-select: none;
}

.figma-theme .current-users-activity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--cu-border);
  border-radius: 50%;
  background: var(--cu-surface);
  color: var(--cu-text-secondary);
}

.figma-theme .current-users-activity-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  width: 100%;
  max-width: none;
}

.figma-theme .current-users-activity-copy strong {
  font: 600 12px/1.25 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text);
  white-space: normal;
  overflow-wrap: anywhere;
}

.figma-theme .current-users-activity-detail {
  display: block;
  width: 100%;
  font: 400 11px/1.35 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text-secondary);
  white-space: normal;
  overflow-wrap: anywhere;
}

.figma-theme .current-users-footer {
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--cu-surface);
  border-top: 1px solid var(--cu-border);
  flex-shrink: 0;
}

.figma-theme .current-users-footer-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  max-width: 18rem;
  font: 400 11px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--cu-text-faint);
}

.figma-theme .current-users-footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.figma-theme .current-users-delete-btn,
.figma-theme .current-users-add-btn,
.figma-theme .current-users-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--cu-radius-sm);
  font: 500 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  background: var(--cu-surface);
  border: 1px solid var(--cu-border);
  color: var(--cu-text);
  box-shadow: none;
}

.figma-theme .current-users-add-btn {
  border-color: var(--cu-control-dark);
  background: var(--cu-control-dark);
  color: #ffffff;
}

.figma-theme .current-users-add-btn:hover,
.figma-theme .current-users-refresh-btn:hover {
  background: var(--cu-hover);
  color: var(--cu-text);
  border-color: var(--cu-border);
}

.figma-theme .current-users-add-btn:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff;
}

.figma-theme .current-users-delete-btn {
  border-color: #e10613;
  background: #fff5f5;
  color: #e10613;
}

.figma-theme .current-users-delete-btn:hover:not(:disabled) {
  background: #e10613;
  border-color: #e10613;
  color: #ffffff;
}

.figma-theme .current-users-delete-btn:disabled {
  opacity: 0.4;
  cursor: default;
  border-color: #e10613;
  background: #fff5f5;
  color: #e10613;
}

.current-users-add-dialog {
  width: min(100%, 26rem);
}

.current-users-add-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.current-users-add-header .confirm-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 4px;
}

.current-users-add-header .modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #050505;
  color: #ffffff;
  box-shadow: none;
  cursor: pointer;
  line-height: 0;
}

.current-users-add-header .modal-close-btn:hover {
  background: #1a1a1a;
  color: #ffffff;
}

.current-users-add-actions {
  justify-content: center;
}

.current-users-add-actions .confirm-submit-btn {
  min-width: 10rem;
  width: 100%;
  max-width: 14rem;
}

.current-users-add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.current-users-add-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: 500 12px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #222222;
}

.current-users-add-field input,
.current-users-add-field select {
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d9d9d4;
  border-radius: 6px;
  background: #ffffff;
  font: 400 13px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #222222;
}

.current-users-add-field input:focus,
.current-users-add-field select:focus {
  outline: none;
  border-color: #b8b8b2;
}

.current-users-add-error {
  margin: 0;
  font: 400 12px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #b42318;
}

@media (max-width: 760px) {
  .figma-theme .current-users-modal {
    --cu-modal-height: min(760px, calc(100vh - 12px));
    --mm-modal-width: min(100vw - 12px, 720px);
    --cu-modal-width: var(--mm-modal-width);
  }

  .figma-theme .modal.modal-figma.current-users-modal {
    width: var(--cu-modal-width);
    max-width: var(--cu-modal-width);
    min-width: var(--cu-modal-width);
    height: var(--cu-modal-height);
    max-height: var(--cu-modal-height);
    min-height: var(--cu-modal-height);
  }

  .figma-theme .current-users-workspace {
    height: 100%;
  }

  .figma-theme .current-users-panes {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(160px, 34%) minmax(0, 1fr);
  }

  .figma-theme .current-users-section-top {
    flex-direction: column;
    align-items: stretch;
  }

  .figma-theme .current-users-mode-select {
    max-width: none;
    width: 100%;
  }

  .figma-theme .current-users-header,
  .figma-theme .current-users-body,
  .figma-theme .current-users-footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  .figma-theme .current-users-detail-header {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }
}

/* â”€â”€ Toolbar â”€â”€ */

.figma-theme .library-toolbar {
  gap: 20px;
  padding: 0;
  border-bottom: none;
  background: #ffffff;
  position: relative;
  z-index: 20;
  overflow: visible;
  --menu-radius: 8px;
  --menu-item-radius: 6px;
  --menu-padding: 6px;
  --menu-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  --menu-item-hover: #f5f5f5;
}

.figma-theme .toolbar-actions-row {
  display: flex;
  width: 100%;
  padding: 20px 24px 0;
  box-sizing: border-box;
}

.figma-theme .toolbar-filter-stack {
  display: grid;
  grid-template-columns: max-content;
  justify-content: center;
  justify-items: stretch;
  align-self: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  gap: 10px;
  padding: 12px 24px 14px;
}

.figma-theme .toolbar-filter-stack .toolbar-search-row {
  gap: 16px;
  padding: 0;
  align-items: center;
  width: auto;
  min-width: 0;
  max-width: 100%;
}

.figma-theme .toolbar-filter-stack .toolbar-primary {
  width: 100%;
  min-width: 0;
}

.figma-theme .toolbar-filter-stack .toolbar-filters-row {
  width: max-content;
  max-width: 100%;
  justify-self: center;
  padding: 0;
}

.figma-theme .toolbar-search-row {
  gap: 16px;
  padding: 12px 24px 0;
  align-items: center;
}

.figma-theme .toolbar-primary {
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.figma-theme .search-field {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.figma-theme .search-field input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 14px 0 34px;
  border: 1px solid var(--figma-border-input);
  border-radius: 999px;
  background: #ffffff;
  font: 400 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
  box-sizing: border-box;
}

.figma-theme .search-field input[type="search"]::placeholder {
  color: var(--figma-text-muted);
}

.figma-theme .search-field input[type="search"]:focus {
  border: 1px solid var(--figma-black);
  box-shadow: 0 0 0 1px var(--figma-black);
  outline: none;
}

.figma-theme .search-icon {
  left: 12px;
  width: 14px;
  height: 14px;
  color: var(--figma-text-muted);
}

.figma-theme .toolbar-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  flex-shrink: 0;
  width: 100%;
}

.figma-theme .toolbar-actions .export-excel-btn,
.figma-theme .toolbar-actions .export-ppt-btn,
.figma-theme .toolbar-actions .export-moodboard-btn,
.figma-theme .toolbar-actions .export-qr-labels-btn,
.figma-theme .toolbar-actions .upload-finish-btn,
.figma-theme .toolbar-actions .archive-btn {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  text-align: center;
  white-space: nowrap;
}

.figma-theme .export-excel-btn,
.figma-theme .export-ppt-btn,
.figma-theme .export-moodboard-btn,
.figma-theme .export-qr-labels-btn,
.figma-theme .upload-finish-btn,
.figma-theme .archive-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-pill, 999px);
  font: 500 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .export-excel-btn,
.figma-theme .export-ppt-btn,
.figma-theme .export-moodboard-btn,
.figma-theme .export-qr-labels-btn,
.figma-theme .archive-btn {
  position: relative;
  border: 1px solid var(--figma-black);
  background: #ffffff;
  color: var(--figma-black);
  overflow: hidden;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.figma-theme .export-excel-btn:hover,
.figma-theme .export-ppt-btn:hover,
.figma-theme .export-moodboard-btn:hover,
.figma-theme .export-qr-labels-btn:hover,
.figma-theme .archive-btn:hover {
  background: var(--menu-item-hover);
  color: var(--figma-black);
  border-color: var(--figma-black);
}

@property --export-progress {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.figma-theme .export-excel-btn.is-exporting,
.figma-theme .export-ppt-btn.is-exporting,
.figma-theme .export-moodboard-btn.is-exporting,
.figma-theme .export-qr-labels-btn.is-exporting {
  pointer-events: none;
  cursor: wait;
  overflow: hidden;
  --export-progress: 0;
  transition: --export-progress 0.35s ease-out;
}

.figma-theme .export-excel-btn.is-exporting,
.figma-theme .export-excel-btn.is-exporting:hover,
.figma-theme .export-ppt-btn.is-exporting,
.figma-theme .export-ppt-btn.is-exporting:hover,
.figma-theme .export-moodboard-btn.is-exporting,
.figma-theme .export-moodboard-btn.is-exporting:hover,
.figma-theme .export-qr-labels-btn.is-exporting,
.figma-theme .export-qr-labels-btn.is-exporting:hover {
  background: #ffffff;
  border-color: #c40000;
}

.figma-theme .export-excel-btn.is-exporting::before,
.figma-theme .export-ppt-btn.is-exporting::before,
.figma-theme .export-moodboard-btn.is-exporting::before,
.figma-theme .export-qr-labels-btn.is-exporting::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #c40000;
  transform: scaleX(var(--export-progress, 0));
  transform-origin: left center;
}

.figma-theme .export-excel-btn.is-exporting .export-btn-label,
.figma-theme .export-ppt-btn.is-exporting .export-btn-label,
.figma-theme .export-moodboard-btn.is-exporting .export-btn-label,
.figma-theme .export-qr-labels-btn.is-exporting .export-btn-label {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: transparent;
  background: linear-gradient(
    to right,
    #ffffff 0,
    #ffffff calc(var(--export-progress, 0) * 100%),
    var(--figma-black) calc(var(--export-progress, 0) * 100%),
    var(--figma-black) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
}

.figma-theme .export-excel-btn.is-exporting.is-exporting-done::before,
.figma-theme .export-ppt-btn.is-exporting.is-exporting-done::before,
.figma-theme .export-moodboard-btn.is-exporting.is-exporting-done::before,
.figma-theme .export-qr-labels-btn.is-exporting.is-exporting-done::before {
  transform: scaleX(1);
  transition: transform 0.2s ease-out;
}

.figma-theme .upload-finish-btn {
  border: none;
  background: var(--figma-black);
  color: #ffffff;
}

.figma-theme .upload-finish-btn:hover {
  background: #1a1a1a;
}

.figma-theme .upload-finish-btn.is-stop-export {
  background: #c40000;
  color: #ffffff;
}

.figma-theme .upload-finish-btn.is-stop-export:hover {
  background: #a30000;
}

.figma-theme .toolbar-filters-row {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px 24px 14px;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  box-sizing: border-box;
  margin-inline: auto;
  --filter-pill-height: 22px;
  --filter-pill-font-size: 10px;
  --filter-pill-side-padding: 8px;
  --filter-pill-chevron-space: 18px;
  --filter-pill-font: 500 var(--filter-pill-font-size) / 1 Inter, ui-sans-serif, system-ui, sans-serif;
  --filter-pill-radius: var(--radius-pill);
}

.figma-theme .toolbar-filters-cluster,
.figma-theme .toolbar-selection-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  flex: 0 0 auto;
}

.figma-theme .toolbar-selection-cluster {
  margin-left: 0;
  margin-top: 6px;
}

.figma-theme .toolbar-selection-cluster[hidden] {
  display: none !important;
}

.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-toggle,
.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-toggle:not(.filter-pill-active),
.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-action,
.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-action:not(.filter-pill-active) {
  background: #ffffff;
  border-color: var(--figma-border-input, #d9d9d4);
  color: var(--figma-black, #050505);
  box-shadow: none;
}

.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-toggle .filter-pill-label,
.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-toggle:not(.filter-pill-active) .filter-pill-label,
.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-action .filter-pill-label,
.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-action:not(.filter-pill-active) .filter-pill-label {
  color: var(--figma-black, #050505);
  font-weight: 500;
}

.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-toggle:hover,
.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-action:hover,
.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-action:not(.filter-pill-active):hover {
  background: #f7f7f5;
  border-color: #c8c8c2;
  color: var(--figma-black, #050505);
}

.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-toggle:hover .filter-pill-label,
.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-action:hover .filter-pill-label,
.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-action:not(.filter-pill-active):hover .filter-pill-label {
  color: var(--figma-black, #050505);
}

.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-toggle.filter-pill-active {
  background: #ffffff;
  border-color: var(--figma-black, #050505);
  color: var(--figma-black, #050505);
}

.figma-theme .toolbar-selection-cluster.is-selection-only .filter-pill-toggle.filter-pill-active .filter-pill-label {
  color: var(--figma-black, #050505);
  font-weight: 600;
}

.figma-theme .toolbar-filters-cluster[hidden] {
  display: none !important;
}

.figma-theme .toolbar-control-gap {
  display: block;
  flex: 0 0 auto;
  align-self: center;
  width: 1px;
  height: 18px;
  margin-inline: 10px 6px;
  background: #e4e4e4;
}

.figma-theme .toolbar-control-gap[hidden] {
  display: none !important;
}

.figma-theme .filter-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  height: var(--filter-pill-height);
  min-height: var(--filter-pill-height);
  padding: 0 var(--filter-pill-side-padding);
  border: 1px solid var(--figma-border-input);
  border-radius: var(--filter-pill-radius);
  background: #ffffff;
  white-space: nowrap;
  line-height: var(--filter-pill-height);
}

.figma-theme .filter-pill:has(.filter-pill-trigger),
.figma-theme .filter-pill.filter-pill-color-family {
  padding: 0;
}

.figma-theme .filter-pill[hidden] {
  display: none !important;
}

.figma-theme .filter-pill:focus-within {
  z-index: 30;
}

.figma-theme .filter-pill:hover,
.figma-theme .filter-pill:has(.filter-pill-trigger:hover),
.figma-theme .filter-pill-toggle:hover {
  background: var(--menu-item-hover);
}

.figma-theme .filter-pill .filter-pill-trigger:hover,
.figma-theme .filter-pill-color-family .filter-pill-trigger:hover {
  background: transparent;
}

.figma-theme .filter-pill:focus-within:not(.filter-pill-toggle),
.figma-theme .filter-pill.filter-pill-active,
.figma-theme .filter-pill.is-menu-open,
.figma-theme .filter-pill-color-family.is-menu-open,
.figma-theme .filter-pill-color-family:focus-within {
  border-color: var(--figma-black);
  box-shadow: 0 0 0 1px var(--figma-black);
}

.figma-theme .filter-pill-toggle:not(.filter-pill-active) {
  background: #ffffff;
  border-color: var(--figma-border-input);
  box-shadow: none;
}

.figma-theme .filter-pill-toggle:focus-visible {
  outline: 2px solid var(--figma-black);
  outline-offset: 2px;
}

.figma-theme .filter-pill-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: var(--filter-pill-height);
  min-height: var(--filter-pill-height);
  padding: 0 var(--filter-pill-side-padding);
  border-radius: var(--filter-pill-radius);
  cursor: pointer;
  font: var(--filter-pill-font);
  line-height: var(--filter-pill-height);
  color: inherit;
}

.figma-theme .filter-pill-toggle .filter-pill-label {
  display: inline;
  line-height: inherit;
}

.figma-theme .filter-toolbar-divider {
  display: block;
  flex: 0 0 auto;
  align-self: center;
  width: min(220px, 55%);
  height: 1px;
  margin: 4px 0 2px;
  background: #e4e4e4;
  opacity: 1;
  border: none;
}

.figma-theme .filter-toolbar-divider[hidden] {
  display: none !important;
}

.figma-theme .filter-pill:focus-within .filter-pill-label,
.figma-theme .filter-pill.filter-pill-active .filter-pill-label {
  font-weight: 600;
}

.figma-theme .filter-pill-label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  text-align: center;
  font: var(--filter-pill-font);
  line-height: var(--filter-pill-height);
  color: var(--figma-black);
}

.figma-theme .filter-pill-chevron {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 6px;
  height: 6px;
  margin: 0;
  border-right: 1.25px solid var(--figma-text-muted);
  border-bottom: 1.25px solid var(--figma-text-muted);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.figma-theme .filter-pill-color-family .filter-pill-trigger .filter-pill-label,
.figma-theme .filter-pill .filter-pill-trigger .filter-pill-label {
  padding-right: 2px;
}

.figma-theme .filter-pill-color-family .filter-pill-trigger,
.figma-theme .filter-pill .filter-pill-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--filter-pill-height);
  min-height: var(--filter-pill-height);
  margin: 0;
  padding: 0 var(--filter-pill-chevron-space) 0 var(--filter-pill-side-padding);
  border: none;
  border-radius: var(--filter-pill-radius);
  background: transparent;
  font: var(--filter-pill-font);
  line-height: var(--filter-pill-height);
  color: var(--figma-black);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}

.figma-theme .filter-pill-color-family .filter-pill-trigger {
  gap: 4px;
}

.figma-theme .filter-pill.is-menu-open,
.figma-theme .filter-pill-color-family.is-menu-open {
  z-index: 40;
}

.figma-theme .filter-pill .filter-pill-menu-panel,
.figma-theme .filter-pill-color-family .color-family-menu {
  min-width: 100%;
}

.figma-theme .toolbar-filters-row .color-family-menu {
  padding: 4px;
}

.figma-theme .toolbar-filters-row .color-family-menu-item {
  min-height: 30px;
  padding: 6px 10px;
  font: 400 12px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .color-family-menu-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.figma-theme .reset-filters-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  height: var(--filter-pill-height);
  min-height: var(--filter-pill-height);
  padding: 0 var(--filter-pill-side-padding);
  border: 1px solid var(--figma-black);
  border-radius: var(--filter-pill-radius);
  background: var(--figma-black);
  color: #ffffff;
  font: var(--filter-pill-font);
  line-height: var(--filter-pill-height);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.figma-theme .reset-filters-btn[hidden] {
  display: none !important;
}

.figma-theme .reset-filters-btn:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff;
}

.figma-theme .filter-pill-action,
.figma-theme .filter-pill-action:not(.filter-pill-active) {
  border-color: var(--figma-black);
  background: var(--figma-black);
  color: #ffffff;
  box-shadow: none;
}

.figma-theme .filter-pill-action .filter-pill-label,
.figma-theme .filter-pill-action:not(.filter-pill-active) .filter-pill-label {
  color: #ffffff;
  font-weight: 500;
}

.figma-theme .filter-pill-action:hover,
.figma-theme .filter-pill-action:not(.filter-pill-active):hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff;
}

.figma-theme .filter-pill-action:hover .filter-pill-label,
.figma-theme .filter-pill-action:not(.filter-pill-active):hover .filter-pill-label {
  color: #ffffff;
}

.figma-theme .toolbar-meta-row {
  padding: 0 24px 16px;
}

.figma-theme .result-count {
  font: 400 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
}

/* â”€â”€ Grid & cards â”€â”€ */

.figma-theme .library-content {
  padding: 24px;
  background: var(--figma-page);
}

.figma-theme .swatch-grid {
  gap: 20px;
}

@media (min-width: 900px) {
  .figma-theme .swatch-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .figma-theme .swatch-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.figma-theme .swatch-card {
  border: 1px solid var(--figma-border);
  border-radius: 8px;
  box-shadow: var(--figma-card-shadow);
  background: #ffffff;
}

.figma-theme .swatch-card:hover {
  border-color: #cfcfcf;
  background: #ffffff;
}

.figma-theme .swatch-card.is-selected {
  border-color: #000000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.figma-theme .swatch-image-wrap {
  aspect-ratio: auto;
  height: 180px;
  background: #f5f5f5;
}

.figma-theme .swatch-fallback {
  flex-direction: column;
  gap: 8px;
  font: 400 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  color: var(--figma-text-faint);
}

.figma-theme .swatch-fallback::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239b9b9b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E") center / contain no-repeat;
}

.figma-theme .swatch-card-flag {
  top: 12px;
  right: 12px;
  bottom: auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--figma-text-muted);
}

.figma-theme .swatch-card-flag svg {
  width: 14px;
  height: 14px;
  filter: none;
}

.figma-theme .swatch-card-flag.is-favorited {
  background: var(--figma-black);
  color: #fff;
}

.figma-theme .swatch-card-flag:hover {
  background: var(--menu-item-hover);
  color: var(--figma-black);
}

.figma-theme .swatch-card-flag.is-favorited:hover {
  background: var(--figma-black);
  color: #fff;
}

.figma-theme .swatch-card-flag[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 5;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--figma-black);
  color: #fff;
  font: 500 11px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.figma-theme .swatch-card-flag[data-tooltip]:hover::after,
.figma-theme .swatch-card-flag[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.figma-theme .swatch-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

.figma-theme .swatch-top {
  font: 700 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
}

.figma-theme .swatch-year {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--figma-page);
  font: 400 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  color: var(--figma-text-muted);
}

.figma-theme .swatch-name {
  margin: 0;
  font: 500 14px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
  -webkit-line-clamp: 1;
}

.figma-theme .badge {
  height: auto;
  padding: 2px 8px;
  font: 600 11px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .badge-available {
  background: var(--figma-available-bg);
  color: var(--figma-available-text);
}

.figma-theme .badge-loan {
  background: var(--figma-loan-bg);
  color: var(--figma-loan-text);
}

.figma-theme .badge-unavailable {
  background: var(--figma-unavailable-bg);
  color: var(--figma-unavailable-text);
}

.figma-theme .badge-active-development {
  background: var(--figma-development-bg);
  color: var(--figma-development-text);
}

/* â”€â”€ Pagination footer â”€â”€ */

.figma-theme .library-footer {
  margin-top: auto;
  background: #ffffff;
  border-top: 1px solid var(--figma-border);
}

.figma-theme .pagination {
  position: relative;
  margin: 0;
  padding: 0 24px;
  height: 56px;
  border-top: none;
  gap: 24px;
  justify-content: center;
}

.figma-theme .pagination-summary {
  position: absolute;
  left: 24px;
  margin: 0;
  font: 400 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
}

.figma-theme .pagination-controls {
  gap: 24px;
  justify-content: center;
}

.figma-theme .pagination-pages {
  display: flex;
  align-items: center;
  gap: 16px;
}

.figma-theme .page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill, 999px);
  background: transparent;
  font: 400 14px/28px Inter, ui-sans-serif, system-ui, sans-serif;
  color: #000000;
}

.figma-theme .page-btn.page-nav {
  width: auto;
  min-width: 0;
  height: auto;
  line-height: 1;
  font-size: 14px;
}

.figma-theme .page-btn.page-nav:disabled {
  color: var(--figma-text-faint);
  opacity: 1;
}

.figma-theme .page-btn.page-next:not(:disabled) {
  font-weight: 600;
}

.figma-theme .page-btn:hover:not(:disabled):not(.active) {
  background: var(--menu-item-hover);
}

.figma-theme .page-btn.active {
  background: var(--figma-black);
  color: #ffffff;
}

.figma-theme .page-ellipsis {
  min-width: 0;
  font: 400 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #000000;
}

/* â”€â”€ Inputs & Fields (Figma design system) â”€â”€ */

.figma-theme .panel-fields .detail-field,
.figma-theme .modal-fields .detail-field,
.figma-theme .modal-section-card > .detail-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.figma-theme .panel-fields .detail-field > label,
.figma-theme .modal-fields .detail-field > label,
.figma-theme .modal-section-card .detail-field > label,
.figma-theme .field label {
  margin: 0;
  font: 600 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--figma-text-faint);
}

.figma-theme .pick-or-new-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.figma-theme .pick-or-new-group {
  min-width: 0;
}

.figma-theme .pick-or-new-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}

.figma-theme .pick-or-new-select-col,
.figma-theme .pick-or-new-input-col {
  min-width: 0;
}

.figma-theme .loan-tracking-fields[hidden] {
  display: none !important;
}

.figma-theme .loan-tracking-fields .detail-grid {
  gap: 12px;
}

.figma-theme .panel-fields .detail-input,
.figma-theme .panel-fields input.detail-input,
.figma-theme .panel-fields select.detail-input,
.figma-theme .panel-fields textarea.detail-input,
.figma-theme .modal-fields .detail-input,
.figma-theme .modal-fields input.detail-input,
.figma-theme .modal-fields select.detail-input,
.figma-theme .modal-fields textarea.detail-input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--figma-border-input);
  border-radius: 6px;
  background: #ffffff;
  font: 400 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
  box-shadow: none;
}

.figma-theme .panel-fields textarea.detail-input,
.figma-theme .modal-fields textarea.detail-input {
  height: auto;
  min-height: 72px;
  padding: 10px 12px;
  line-height: 1.4;
  resize: vertical;
}

.figma-theme .panel-fields select.detail-input,
.figma-theme .modal-fields select.detail-input {
  appearance: none;
  padding-right: 32px;
  border-radius: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236b6b6b' d='M1.5 3.5 5 7l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.figma-theme .panel-fields select.detail-input:focus,
.figma-theme .modal-fields select.detail-input:focus {
  border-radius: 6px;
}

.figma-theme .panel-fields .detail-input:focus,
.figma-theme .modal-fields .detail-input:focus,
.figma-theme .field input:focus,
.figma-theme .field select:focus,
.figma-theme .field textarea:focus {
  border: 2px solid var(--figma-black);
  outline: none;
  box-shadow: none;
}

.figma-theme .panel-fields .detail-input:disabled,
.figma-theme .panel-fields .detail-input[readonly],
.figma-theme .modal-fields .detail-input:disabled,
.figma-theme .modal-fields .detail-input[readonly] {
  background: #f5f5f5;
  border-color: var(--figma-border-input);
  color: var(--figma-text-muted);
  opacity: 1;
  cursor: default;
}

.figma-theme .panel-fields .detail-grid,
.figma-theme .modal-section-card > .detail-grid {
  gap: 16px;
}

.figma-theme .panel-fields .detail-grid {
  gap: 12px;
}

.figma-theme .dominant-color-value {
  font: 400 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
}

.figma-theme .dominant-color-swatch {
  width: 28px;
  height: 28px;
  border: 1px solid var(--figma-border-input);
  border-radius: 6px;
}

.figma-theme .color-family-field-trigger {
  height: 36px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--figma-border-input);
  border-radius: 6px;
  background: #ffffff;
  font: 400 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
}

.figma-theme .color-family-field-trigger:focus {
  border: 2px solid var(--figma-black);
  box-shadow: none;
}

.figma-theme .color-family-field-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.figma-theme .color-family-field-trigger .filter-pill-chevron {
  right: 12px;
}

.figma-theme .modal-fields .detail-input::placeholder {
  color: var(--figma-text-muted);
}

/* â”€â”€ Upload modal (Figma) â”€â”€ */

.figma-theme .modal-backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.figma-theme .modal.modal-figma {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: calc(100% - 2rem);
  max-width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 2rem);
  border: none;
  border-radius: 8px;
  box-shadow: 0 12px 12px rgba(0, 0, 0, 0.2);
}

.figma-theme .modal.modal-figma.current-users-modal,
.figma-theme .modal.modal-figma.menu-modal.current-users-modal {
  width: var(--cu-modal-width);
  max-width: var(--cu-modal-width);
  min-width: var(--cu-modal-width);
  height: var(--cu-modal-height);
  max-height: var(--cu-modal-height);
  min-height: var(--cu-modal-height);
}

.figma-theme .modal.modal-figma.menu-modal.export-actions-modal {
  --mm-modal-width: min(390px, calc(100vw - 28px));
  width: var(--mm-modal-width);
  max-width: var(--mm-modal-width);
  min-width: 0;
}

.figma-theme .modal.modal-figma.menu-modal.download-database-modal {
  --mm-modal-width: min(390px, calc(100vw - 28px));
  width: var(--mm-modal-width);
  max-width: var(--mm-modal-width);
  min-width: 0;
}

.figma-theme .modal.modal-figma.menu-modal.change-password-modal {
  --mm-modal-width: min(390px, calc(100vw - 28px));
  width: var(--mm-modal-width);
  max-width: var(--mm-modal-width);
  min-width: 0;
}

.figma-theme .modal.modal-figma.menu-modal.chat-modal {
  --mm-modal-width: min(380px, calc(100vw - 28px));
  top: auto;
  left: auto;
  right: 20px;
  bottom: 20px;
  transform: none;
  width: var(--mm-modal-width);
  max-width: var(--mm-modal-width);
  min-width: 0;
  height: min(560px, calc(100vh - 40px));
  max-height: min(560px, calc(100vh - 40px));
  border: 1px solid var(--mm-border, #d9d9d4);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  z-index: 95;
}

.figma-theme .modal-figma-header {
  flex-shrink: 0;
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--figma-border);
  background: #ffffff;
  justify-content: flex-end;
}

.figma-theme .modal-figma-header h2 {
  flex: 1;
  margin: 0;
  font: 600 16px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #000000;
}

.figma-theme .modal-figma-header .modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--figma-black);
  color: #ffffff;
  cursor: pointer;
  line-height: 0;
}

.figma-theme .modal-figma-header .modal-close-btn[hidden] {
  display: none !important;
}

.figma-theme .modal-figma-header .modal-close-btn:hover {
  background: #1a1a1a;
  color: #ffffff;
}

.figma-theme .modal-figma-header.current-users-header {
  height: auto;
  min-height: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 10px;
  background: #ffffff;
  border-bottom: 1px solid #d9d9d4;
  flex-shrink: 0;
}

.figma-theme .modal-figma-header.current-users-header h2 {
  flex: 0 1 auto;
  font: 600 16px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #222222;
}

.figma-theme .modal-header-link {
  min-width: 40px;
  padding: 0;
  border: none;
  background: transparent;
  font: 400 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
  cursor: pointer;
  text-align: left;
}

.figma-theme .modal-header-link:hover {
  color: var(--figma-black);
}

.figma-theme .modal-figma-header .modal-header-spacer {
  width: 40px;
  min-width: 40px;
}

.figma-theme .modal-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.figma-theme .modal-section-title {
  margin: 0;
  font: 600 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--figma-text-faint);
}

.figma-theme .modal-section-photo {
  width: 100%;
}

.figma-theme .modal-section-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--figma-border);
  border-radius: 8px;
  background: #ffffff;
}

.figma-theme .modal-section-card .detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.figma-theme .modal-section-card .detail-grid.detail-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.figma-theme .image-upload-trigger {
  display: block;
  cursor: pointer;
}

.figma-theme .image-upload-preview {
  height: 160px;
  aspect-ratio: auto;
  border: 1px dashed var(--figma-border-input);
  border-radius: 8px;
  background: #ffffff;
}

.figma-theme .image-upload-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 500 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  color: var(--figma-black);
}

.figma-theme .image-upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font: 400 24px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
}

.figma-theme .image-upload-title {
  font: 500 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
}

.figma-theme .image-upload-hint {
  font: 400 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
}

.figma-theme .modal-form .save-message {
  margin: 0;
  font: 400 13px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .modal-form .save-message.error {
  color: #9b3a33;
}

@media (max-width: 560px) {
  .figma-theme .modal.modal-figma {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: calc(100% - 1.5rem);
    max-width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 1.5rem);
    border-radius: 8px;
  }

  .figma-theme .modal-section-card .detail-grid {
    grid-template-columns: 1fr;
  }

  .figma-theme .modal-section-card .detail-grid.detail-grid--3 {
    grid-template-columns: 1fr;
  }
}

/* â”€â”€ Detail panel (Figma) â”€â”€ */

.figma-theme .panel-backdrop {
  background: rgba(0, 0, 0, 0.32);
}

.figma-theme .panel.panel-figma {
  --figma-panel-gutter: 16px;
  width: calc(100% - 2rem);
  max-width: 620px;
  max-height: calc(100vh - 2rem);
  border: none;
  border-radius: 8px;
  box-shadow: 0 12px 12px rgba(0, 0, 0, 0.15);
  background: #ffffff;
}

.figma-theme .panel-form {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.figma-theme .panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.figma-theme .panel-top {
  position: relative;
}

.figma-theme .panel-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--figma-black);
  color: #ffffff;
  cursor: pointer;
  box-shadow: none;
  line-height: 0;
}

.figma-theme .panel-close-btn:hover {
  color: #ffffff;
  background: #1a1a1a;
}

.figma-theme .panel-image-wrap {
  aspect-ratio: auto;
  height: 380px;
  background: #f5f5f5;
  border-bottom: none;
}

.figma-theme .panel-media-below {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px var(--figma-panel-gutter) 0;
}

.figma-theme .panel-image-thumbs {
  display: flex;
  gap: 8px;
  padding: 0;
  overflow-x: auto;
  border: none;
  background: transparent;
}

.figma-theme .panel-image-thumb-item {
  flex-shrink: 0;
  width: 96px;
  height: 72px;
  border: 2px solid transparent;
  border-radius: 4px;
  box-sizing: border-box;
  overflow: hidden;
}

.figma-theme .panel-image-thumb {
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: #f5f5f5;
}

.figma-theme .panel-image-thumb-item.is-active {
  border: 2px solid var(--figma-black);
  border-radius: 4px;
}

.figma-theme .panel-image-thumb-item.is-active .panel-image-thumb {
  border: none;
}

.figma-theme .panel-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figma-theme .panel-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: none;
}

.figma-theme .panel-image-actions .panel-download-btn,
.figma-theme .panel-image-actions .panel-upload-btn {
  flex: 1 1 0;
  box-sizing: border-box;
  min-width: 0;
  height: auto;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--figma-black);
  border-radius: var(--radius-pill, 999px);
  background: #ffffff;
  color: var(--figma-black);
  font: 500 14px/1.25 Inter, ui-sans-serif, system-ui, sans-serif;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.figma-theme .panel-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.figma-theme .panel-upload-btn #upload-swatch-image-text {
  display: block;
  line-height: 1.25;
  text-align: center;
}

.figma-theme .panel-download-btn:hover:not(:disabled),
.figma-theme .panel-upload-btn:hover:not(.is-uploading) {
  background: var(--menu-item-hover);
}

.figma-theme .panel-download-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.figma-theme .panel-header {
  padding: 24px var(--figma-panel-gutter) 20px;
  border: none;
}

.figma-theme .panel-kicker {
  margin: 0 0 4px;
  font: 600 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--figma-text-faint);
}

.figma-theme .panel-header h2 {
  margin: 0;
  font: 800 24px/1.1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
}

.figma-theme .panel-sub {
  margin: 4px 0 0;
  font: 400 16px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #4b4b4b;
}

.figma-theme .panel-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 var(--figma-panel-gutter) 100px;
}

.figma-theme .panel-fields.panel-form-sections {
  gap: 24px;
  padding: 0 var(--figma-panel-gutter) 100px;
}

.figma-theme .panel-fields.panel-form-sections .modal-section-card .detail-textarea-sm {
  min-height: 64px;
}

.figma-theme .panel-fields .detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.figma-theme .panel-fields .detail-grid.detail-grid--3,
.figma-theme .modal-section-card .detail-grid.detail-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.figma-theme .panel-fields .detail-textarea-sm {
  min-height: 64px;
  height: auto;
  padding: 8px 12px;
  line-height: 1.4;
}

.figma-theme .date-input-field {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  height: 36px;
  padding: 0 4px 0 12px;
  border: 1px solid var(--figma-border-input);
  border-radius: 6px;
  background: #ffffff;
}

.figma-theme .date-input-field.is-readonly {
  padding: 0 12px;
  background: #f5f5f5;
}

.figma-theme .date-input-field:focus-within {
  border: 2px solid var(--figma-black);
}

.figma-theme .date-input-field .date-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: 400 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
  appearance: none;
  -webkit-appearance: none;
}

.figma-theme .date-input-field .date-input:focus {
  border: none;
  outline: none;
  box-shadow: none;
}

.figma-theme .date-input-field .date-input:disabled {
  background: transparent;
  color: var(--figma-text-muted);
  opacity: 1;
  cursor: default;
}

.figma-theme .date-input-field .date-input::-webkit-calendar-picker-indicator {
  display: none;
}

.figma-theme .date-input-field .date-input::-webkit-datetime-edit,
.figma-theme .date-input-field .date-input::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

.figma-theme .date-input-calendar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--figma-black);
  color: #ffffff;
  cursor: pointer;
}

.figma-theme .date-input-calendar-btn:hover {
  background: #1a1a1a;
}

.figma-theme .panel-figma-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--figma-panel-gutter);
  border-top: 1px solid var(--figma-border);
  background: #ffffff;
}

.figma-theme .panel-sync-note {
  margin: 0;
  font: 400 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
}

.figma-theme .panel-figma-footer .save-message {
  margin: 0;
}

.figma-theme .panel-figma-footer .save-message.error {
  color: #dc2626;
}

.figma-theme .panel-action-buttons {
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 12px;
  width: 100%;
}

.figma-theme .panel-action-buttons .panel-delete-btn,
.figma-theme .panel-action-buttons .panel-save-btn,
.figma-theme .panel-action-buttons #save-btn {
  flex: 1;
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-pill, 999px);
  font: 500 14px/36px Inter, ui-sans-serif, system-ui, sans-serif;
  text-align: center;
  cursor: pointer;
}

.figma-theme .panel-delete-btn,
.figma-theme .panel-save-btn {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-pill, 999px);
  font: 500 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.figma-theme .panel-delete-btn {
  background: #dc2626;
  color: #ffffff;
}

.figma-theme .panel-delete-btn:hover:not(:disabled) {
  background: #b91c1c;
}

.figma-theme .panel-save-btn {
  background: var(--figma-black);
  color: #ffffff;
}

.figma-theme .panel-save-btn:hover:not(:disabled) {
  background: #1a1a1a;
}

.figma-theme .panel-save-btn:disabled,
.figma-theme .panel-delete-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* â”€â”€ Mobile layout (Figma mobile-view) â”€â”€ */

.figma-theme .pagination-summary-compact,
.figma-theme .page-nav-short {
  display: none;
}

@media (max-width: 768px) {
  .library-header,
  .figma-theme .library-header {
    --header-mark-size: 32px;
    --header-primary-font: 600 13px/1.2 var(--header-font);
    --header-secondary-font: 400 11px/1.2 var(--header-font);
  }

  .library-brand-mark img,
  .figma-theme .library-brand-mark img {
    height: var(--header-mark-size);
  }

  .library-brand-name,
  .figma-theme .library-brand-name {
    font: var(--header-primary-font);
  }

  .library-brand-subtitle,
  .figma-theme .library-brand-subtitle {
    font: var(--header-secondary-font);
  }

  .figma-theme .library-user-info {
    display: none;
  }

  .figma-theme .library-user-avatar {
    width: var(--header-mark-size);
    height: var(--header-mark-size);
    font-size: 11px;
  }

  .figma-theme .library-toolbar {
    padding: 16px;
    gap: 16px;
  }

  .figma-theme .toolbar-actions-row {
    padding: 0;
  }

  .figma-theme .toolbar-filter-stack {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    padding: 0;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr);
  }

  .figma-theme .toolbar-filter-stack .toolbar-search-row,
  .figma-theme .toolbar-filter-stack .toolbar-filters-row {
    width: 100%;
    max-width: 100%;
  }

  .figma-theme .toolbar-search-row {
    padding: 0;
    align-items: stretch;
  }

  .figma-theme .toolbar-primary {
    width: 100%;
    min-width: 0;
  }

  .figma-theme .toolbar-actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: nowrap;
  }

  .figma-theme .toolbar-filters-row {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0;
    overflow: visible;
    justify-content: center;
    align-items: center;
    margin-inline: auto;
  }

  .figma-theme .toolbar-selection-cluster {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .figma-theme .filter-pill,
  .figma-theme .reset-filters-btn {
    height: var(--filter-pill-height);
    min-height: var(--filter-pill-height);
  }

  .figma-theme .filter-pill:has(.filter-pill-trigger),
  .figma-theme .filter-pill.filter-pill-color-family {
    padding: 0;
  }

  .figma-theme .filter-pill-toggle {
    padding: 0 var(--filter-pill-side-padding);
  }

  .figma-theme .filter-pill .filter-pill-trigger,
  .figma-theme .filter-pill-color-family .filter-pill-trigger {
    padding: 0 var(--filter-pill-chevron-space) 0 var(--filter-pill-side-padding);
  }

  .figma-theme .filter-pill-label {
    font-size: var(--filter-pill-font-size);
    line-height: var(--filter-pill-height);
  }

  .figma-theme .filter-pill-chevron {
    right: 6px;
    width: 5px;
    height: 5px;
  }

  .figma-theme .reset-filters-btn {
    font-size: var(--filter-pill-font-size);
  }

  .figma-theme .toolbar-meta-row {
    display: none;
  }

  .figma-theme .library-content {
    padding: 16px;
  }

  .figma-theme .swatch-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .figma-theme .pagination-summary-full,
  .figma-theme .page-nav-long,
  .figma-theme .pagination-pages {
    display: none;
  }

  .figma-theme .pagination-summary-compact,
  .figma-theme .page-nav-short {
    display: inline;
  }

  .figma-theme .pagination {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 0;
    padding: 16px;
  }

  .figma-theme .pagination-summary {
    position: static;
    left: auto;
  }

  .figma-theme .pagination-controls {
    gap: 12px;
    flex: 1 1 auto;
    justify-content: center;
  }

  .figma-theme .panel.panel-figma {
    width: calc(100% - 1rem);
    max-width: none;
    max-height: calc(100vh - 1rem);
  }

  .figma-theme .panel-image-actions {
    gap: 8px;
  }

  .figma-theme .panel-image-actions .panel-download-btn,
  .figma-theme .panel-image-actions .panel-upload-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: calc(50% - 4px);
    font-size: 12px;
    line-height: 1.25;
    padding: 10px 8px;
  }

  .figma-theme .panel-fields .detail-grid {
    grid-template-columns: 1fr;
  }

  .figma-theme .panel-fields .detail-grid.detail-grid--3 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .figma-theme .swatch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .figma-theme .toolbar-filters-row {
    gap: 6px;
  }

  .figma-theme .panel.panel-figma {
    width: min(720px, calc(100% - 2rem));
  }
}

@media (max-width: 960px) {
  .figma-theme .toolbar-actions-row {
    width: 100%;
  }

  .figma-theme .toolbar-actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: nowrap;
    align-self: stretch;
  }

  .figma-theme .toolbar-actions .export-excel-btn,
  .figma-theme .toolbar-actions .export-ppt-btn,
  .figma-theme .toolbar-actions .upload-finish-btn,
  .figma-theme .toolbar-actions .archive-btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  .figma-theme .toolbar-primary {
    width: 100%;
  }

  .figma-theme .toolbar-filters-row {
    flex-wrap: wrap;
    row-gap: 6px;
    overflow: visible;
  }
}

@media (max-width: 768px) {
  .figma-theme .toolbar-actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: nowrap;
  }

  .figma-theme .toolbar-actions .export-excel-btn,
  .figma-theme .toolbar-actions .export-ppt-btn,
  .figma-theme .toolbar-actions .export-moodboard-btn {
    display: none;
  }

  .figma-theme .toolbar-actions .upload-finish-btn,
  .figma-theme .toolbar-actions .archive-btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .figma-theme .library-header-inner {
    padding: 0 16px;
  }
}

/* â”€â”€ Login / auth (Figma card 14:7) â”€â”€ */

.figma-theme.auth-body {
  background: var(--figma-page);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .auth-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.figma-theme .auth-card {
  width: 100%;
  max-width: 440px;
  padding: 32px 48px 48px;
  background: #ffffff;
  border: 1px solid var(--figma-border);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.figma-theme .auth-logo-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  margin-top: -4px;
}

.figma-theme .auth-logo-block picture {
  align-self: center;
}

.figma-theme .auth-logo {
  display: block;
  width: 100%;
  max-width: 120px;
  height: auto;
  margin: 0;
}

.figma-theme .auth-logo-caption {
  margin: 0;
  padding: 10px 0 14px;
  width: 100%;
  font: 700 32px/1.15 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
  text-transform: none;
  text-align: center;
  color: var(--figma-black);
}

.figma-theme .auth-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.figma-theme .auth-header h1 {
  margin: 0;
  font: 600 24px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
  text-align: left;
}

.figma-theme .auth-header p {
  margin: 0;
  font: 400 14px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
}

.figma-theme .auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.figma-theme .auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.figma-theme .auth-field label {
  margin: 0;
  font: 600 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--figma-text-faint);
}

.figma-theme .auth-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--figma-border-input);
  border-radius: 6px;
  background: #ffffff;
  font: 400 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
  box-shadow: none;
}

.figma-theme .auth-field input::placeholder {
  color: var(--figma-text-muted);
}

.figma-theme .auth-field input:focus {
  border: 2px solid var(--figma-black);
  outline: none;
  box-shadow: none;
}

.figma-theme .auth-password-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.figma-theme .password-input-wrap {
  position: relative;
}

.figma-theme .password-input-wrap input {
  padding-right: 44px;
}

.figma-theme .password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--figma-text-muted);
  cursor: pointer;
}

.figma-theme .password-toggle:hover {
  color: var(--figma-black);
  background: #f5f5f5;
}

.figma-theme .auth-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  font: 400 13px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #b91c1c;
}

.figma-theme .auth-submit-btn {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  background: var(--figma-black);
  font: 600 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #ffffff;
  cursor: pointer;
}

.figma-theme .auth-gate-status {
  margin: 0;
}

.figma-theme .auth-gate-status p {
  margin: 0;
  font: 400 14px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
}

.figma-theme .auth-submit-link {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-decoration: none;
}

.figma-theme .auth-submit-btn:hover:not(:disabled) {
  background: #222222;
}

.figma-theme .auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.figma-theme .auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--figma-text-faint);
  font: 400 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .auth-divider::before,
.figma-theme .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--figma-border);
}

.figma-theme .auth-outlined-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--figma-border-input);
  border-radius: 6px;
  background: #ffffff;
  font: 500 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.figma-theme .auth-outlined-btn:hover {
  background: #fafafa;
  border-color: var(--figma-black);
}

.figma-theme .auth-footer {
  margin: 0;
  text-align: center;
  font: 400 13px/1.5 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-faint);
}

.figma-theme .auth-footer a {
  color: var(--figma-text-muted);
  text-decoration: underline;
}

.figma-theme .auth-footer a:hover {
  color: var(--figma-black);
}

.figma-theme .auth-logo-block--compact {
  gap: 12px;
}

.figma-theme .auth-logo--compact {
  max-width: 100px;
}

.figma-theme .auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 400 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
  text-decoration: none;
}

.figma-theme .auth-back-link:hover {
  color: var(--figma-black);
}

.figma-theme .auth-header h1.auth-heading-forgot {
  font-size: 22px;
}

.figma-theme .auth-field .auth-field-label-plain {
  margin: 0;
  font: 500 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
  text-transform: none;
  letter-spacing: normal;
}

.figma-theme .auth-form--forgot {
  gap: 24px;
}

.figma-theme .auth-success {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  font: 400 13px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #047857;
}

.figma-theme .auth-hint {
  margin: 0;
  text-align: center;
  font: 400 12px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-faint);
}

.figma-theme .auth-form--request {
  gap: 16px;
}

.figma-theme .auth-field textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--figma-border-input);
  border-radius: 6px;
  background: #ffffff;
  font: 400 14px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
  box-shadow: none;
  resize: vertical;
}

.figma-theme .auth-field textarea::placeholder {
  color: var(--figma-text-muted);
}

.figma-theme .auth-field textarea:focus {
  border: 2px solid var(--figma-black);
  outline: none;
  box-shadow: none;
}

.figma-theme .auth-form-footer-link {
  margin: 0;
  text-align: center;
  font: 400 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .auth-form-footer-link a {
  color: var(--figma-black);
  text-decoration: none;
}

.figma-theme .auth-form-footer-link a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .figma-theme .auth-card {
    padding: 32px 24px;
    gap: 20px;
  }

  .figma-theme .auth-logo {
    max-width: 100px;
  }

  .figma-theme .auth-logo-caption {
    font-size: 28px;
    padding: 8px 0 12px;
  }

  .figma-theme .auth-logo--compact {
    max-width: 80px;
  }

  .figma-theme .auth-header h1 {
    font-size: 22px;
  }
}

/* â”€â”€ Toast notifications â”€â”€ */

.toast-root {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: auto;
  transform: none;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  width: min(280px, calc(100% - 2rem));
}

.toast {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: #111111;
  color: #ffffff;
  font: 500 12px/1.35 Inter, ui-sans-serif, system-ui, sans-serif;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-error,
.toast-success {
  background: #111111;
  color: #ffffff;
  border: none;
}

.toast-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.toast-action {
  flex-shrink: 0;
  border: 1px solid #ffffff;
  border-radius: 4px;
  background: #ffffff;
  color: #111111;
  font: 500 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  padding: 4px 8px;
}

.toast-action:hover {
  background: #f5f5f5;
  opacity: 1;
}

.figma-theme .archive-body {
  padding-top: 0;
}

.figma-theme .archive-search-field {
  margin: 0 0 12px;
}

.figma-theme .archive-intro {
  margin: 0 0 12px;
  color: var(--mm-text-secondary, var(--figma-text-muted, #666));
  font: 400 12px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .archive-status {
  margin: 0;
  color: var(--mm-text-secondary, var(--figma-text-muted, #666));
  font: 400 12px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.figma-theme .archive-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--mm-border, #d9d9d4);
  border-radius: 8px;
  background: #fff;
}

.figma-theme .archive-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f3f3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.figma-theme .archive-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figma-theme .archive-thumb-fallback {
  font: 600 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #666;
  text-transform: uppercase;
}

.figma-theme .archive-code {
  margin: 0;
  font: 600 14px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .archive-name {
  font-weight: 500;
  color: var(--mm-text-secondary, var(--figma-text-muted, #666));
}

.figma-theme .archive-name::before {
  content: " · ";
}

.figma-theme .archive-meta {
  margin: 4px 0 0;
  color: var(--mm-text-faint, #9b9b9b);
  font: 400 12px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .archive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.figma-theme .archive-restore-btn,
.figma-theme .archive-delete-btn {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font: 500 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.figma-theme .archive-restore-btn {
  border: 1px solid var(--mm-border, #d9d9d4);
  background: #fff;
  color: var(--mm-text, #222);
}

.figma-theme .archive-restore-btn:hover {
  background: var(--mm-hover, #f7f7f5);
}

.figma-theme .archive-delete-btn {
  border: 1px solid #e10613;
  background: #fff5f5;
  color: #e10613;
}

.figma-theme .archive-delete-btn:hover {
  background: #e10613;
  color: #fff;
}

@media (max-width: 640px) {
  .figma-theme .archive-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .figma-theme .archive-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .figma-theme .archive-restore-btn,
  .figma-theme .archive-delete-btn {
    flex: 1 1 0;
  }
}

body.overlay-open {
  overflow: hidden;
}

body.overlay-open.chat-dock-open {
  overflow: auto;
}

/* â”€â”€ Loading skeleton â”€â”€ */

.swatch-card-skeleton {
  pointer-events: none;
  cursor: default;
}

.figma-theme .swatch-card-skeleton:hover {
  transform: none;
  box-shadow: none;
}

.swatch-skeleton-image {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(90deg, #eceae6 25%, #f5f4f2 50%, #eceae6 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.swatch-skeleton-lines {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.swatch-skeleton-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #eceae6 25%, #f5f4f2 50%, #eceae6 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.swatch-skeleton-line-short {
  width: 40%;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.role-settings-note {
  margin: 0 0 16px;
  color: var(--text-secondary, #6b6b6b);
  font-size: 0.875rem;
  line-height: 1.45;
}

.archive-pagination {
  margin-top: 16px;
  justify-content: center;
}

/* â”€â”€ Image editor â”€â”€ */

.image-editor-root {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.image-editor-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.image-editor-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 32rem);
  max-height: calc(100vh - 2rem);
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--figma-border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.image-editor-header {
  padding: 16px 16px 8px;
}

.image-editor-title {
  margin: 0;
  font: 600 16px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
}

.image-editor-hint {
  margin: 6px 0 0;
  font: 400 12px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted);
}

.image-editor-viewport {
  position: relative;
  height: min(52vw, 20rem);
  min-height: 14rem;
  margin: 0 16px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f4f4f4;
  background-image: repeating-linear-gradient(
    135deg,
    #e0e0e0 0 1px,
    transparent 1px 8px
  );
  touch-action: none;
  cursor: grab;
}

.image-editor-viewport.is-dragging {
  cursor: grabbing;
}

.image-editor-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.image-editor-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 0;
}

.image-editor-zoom-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font: 500 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
}

.image-editor-zoom {
  width: 100%;
  accent-color: var(--figma-black);
}

.image-editor-reset-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid var(--figma-border-input);
  border-radius: 8px;
  background: #ffffff;
  font: 500 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
  cursor: pointer;
}

.image-editor-reset-btn:hover {
  background: #f5f5f5;
}

.image-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--figma-border);
  margin-top: 12px;
}

.image-editor-cancel-btn,
.image-editor-apply-btn {
  padding: 10px 16px;
  border-radius: 8px;
  font: 500 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.image-editor-cancel-btn {
  border: 1px solid var(--figma-border-input);
  background: #ffffff;
  color: var(--figma-black);
}

.image-editor-cancel-btn:hover {
  background: #f5f5f5;
}

.image-editor-apply-btn {
  border: none;
  background: var(--figma-black);
  color: #ffffff;
}

.image-editor-apply-btn:hover:not(:disabled) {
  background: #1a1a1a;
}

.image-editor-apply-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* â”€â”€ Public QR swatch page â”€â”€ */

.figma-theme.public-swatch-body {
  margin: 0;
  min-height: 100vh;
  background: var(--figma-page);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black);
}

.figma-theme .public-swatch-header {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 8px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--figma-border);
  /* Same brand tokens as .library-header â€” without these the logo grows to full PNG size. */
  --header-font: Inter, ui-sans-serif, system-ui, sans-serif;
  --header-mark-size: 32px;
  --header-side-gap: 10px;
  --header-text-gap: 2px;
  --header-primary-font: 600 14px/1.2 var(--header-font);
  --header-secondary-font: 400 12px/1.2 var(--header-font);
  --header-primary-color: var(--figma-black);
  --header-secondary-color: var(--figma-text-muted);
}

.figma-theme .public-swatch-header .library-brand-mark img {
  height: var(--header-mark-size);
  width: auto;
  max-height: 32px;
}

.figma-theme .public-swatch-header .library-brand-name {
  font: var(--header-primary-font);
}

.figma-theme .public-swatch-header .library-brand-subtitle {
  font: var(--header-secondary-font);
}

.figma-theme .public-swatch-main {
  width: min(920px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.figma-theme .public-swatch-status {
  margin: 48px 0;
  text-align: center;
  color: var(--figma-text-muted);
  font: 500 15px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .public-swatch-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--figma-border);
  border-radius: 8px;
  box-shadow: var(--figma-card-shadow);
}

.figma-theme .public-swatch-error {
  display: block;
  padding: 40px 28px;
  text-align: center;
}

.figma-theme .public-swatch-error h1 {
  margin: 0 0 8px;
  font: 600 22px/1.25 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .public-swatch-error p {
  margin: 0 0 20px;
  color: var(--figma-text-muted);
  font: 400 14px/1.45 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .public-swatch-link,
.figma-theme .public-swatch-footnote a {
  color: var(--figma-black);
  font-weight: 600;
}

.figma-theme .public-swatch-media {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: #f7f7f7;
  border-right: 1px solid var(--figma-border);
  border-top: 4px solid var(--swatch-accent, #d8d8d8);
}

.figma-theme .public-swatch-image,
.figma-theme .public-swatch-image-fallback {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: #f3f3f3;
  border: 1px solid var(--figma-border);
}

.figma-theme .public-swatch-image-fallback {
  display: grid;
  place-items: center;
  color: var(--figma-text-faint);
  font: 500 14px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .public-swatch-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.figma-theme .public-swatch-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
}

.figma-theme .public-swatch-thumb.is-active,
.figma-theme .public-swatch-thumb:focus-visible {
  border-color: var(--figma-black);
  outline: none;
}

.figma-theme .public-swatch-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.figma-theme .public-swatch-body {
  padding: 28px 28px 32px;
}

.figma-theme .public-swatch-kicker {
  margin: 0 0 6px;
  color: var(--figma-text-muted);
  font: 500 12px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.figma-theme .public-swatch-title {
  margin: 0;
  font: 700 32px/1.15 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.figma-theme .public-swatch-subtitle {
  margin: 6px 0 0;
  color: var(--figma-text-muted);
  font: 500 16px/1.35 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .public-swatch-fields {
  margin: 24px 0 0;
  display: grid;
  gap: 0;
}

.figma-theme .public-swatch-field {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--figma-border);
}

.figma-theme .public-swatch-field dt {
  margin: 0;
  color: var(--figma-text-muted);
  font: 500 13px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .public-swatch-field dd {
  margin: 0;
  font: 600 14px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  word-break: break-word;
}

.figma-theme .public-swatch-footnote {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--figma-border);
  color: var(--figma-text-faint);
  font: 400 12px/1.45 Inter, ui-sans-serif, system-ui, sans-serif;
}

@media (max-width: 760px) {
  .figma-theme .public-swatch-header {
    min-height: 48px;
    padding: 6px 12px;
    --header-mark-size: 28px;
    --header-primary-font: 600 13px/1.2 var(--header-font);
    --header-secondary-font: 400 11px/1.2 var(--header-font);
  }

  .figma-theme .public-swatch-header .library-brand-mark img {
    max-height: 28px;
  }

  .figma-theme .public-swatch-main {
    width: min(100% - 16px, 920px);
    margin: 10px auto 20px;
  }

  .figma-theme .public-swatch-card {
    grid-template-columns: 1fr;
  }

  .figma-theme .public-swatch-media {
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid var(--figma-border);
  }

  .figma-theme .public-swatch-image,
  .figma-theme .public-swatch-image-fallback {
    /* Keep the photo visible without filling the whole phone screen. */
    max-height: min(42vh, 280px);
    aspect-ratio: auto;
    height: min(42vh, 280px);
    width: 100%;
    object-fit: contain;
    background: #ffffff;
  }

  .figma-theme .public-swatch-thumbs {
    gap: 6px;
  }

  .figma-theme .public-swatch-thumb {
    width: 44px;
    height: 44px;
  }

  .figma-theme .public-swatch-body {
    padding: 16px 16px 22px;
  }

  .figma-theme .public-swatch-title {
    font-size: 24px;
  }

  .figma-theme .public-swatch-subtitle {
    font-size: 14px;
  }

  .figma-theme .public-swatch-fields {
    margin-top: 16px;
  }

  .figma-theme .public-swatch-field {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 0;
  }

  .figma-theme .public-swatch-footnote {
    margin-top: 16px;
    padding-top: 12px;
  }
}

/* Manage customers admin modal */
.figma-theme .modal.modal-figma.menu-modal.manage-customers-modal {
  --mm-modal-width: min(440px, calc(100vw - 28px));
  width: var(--mm-modal-width);
  max-width: var(--mm-modal-width);
  min-width: 0;
  max-height: min(720px, calc(100vh - 48px));
}

.figma-theme .manage-customers-modal .manage-customers-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.figma-theme .manage-customers-modal .manage-customers-fields > .manage-customers-section-title {
  margin: 0;
}

.figma-theme .manage-customers-modal .manage-customers-fields > .detail-input {
  width: 100%;
  background: color-mix(in srgb, var(--surface, #fff) 92%, #000 8%);
  border-color: transparent;
}

.figma-theme .manage-customers-modal .manage-customers-fields > .detail-input:focus {
  background: #ffffff;
  border-color: var(--figma-border-input, #d8d8d8);
}

.figma-theme .manage-customers-modal .manage-customers-grant-roles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.figma-theme .manage-customers-modal .manage-customers-grant-roles-label {
  margin: 0;
  text-align: center;
  font: 600 11px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--figma-text-muted, #6b7280);
}

.figma-theme .manage-customers-modal .manage-customers-grant-roles-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  gap: 8px;
  align-items: start;
  justify-items: center;
}

.figma-theme .manage-customers-modal .manage-customers-grant-role {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  margin: 0;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}

.figma-theme .manage-customers-modal .manage-customers-grant-role-label {
  text-align: center;
  font: 500 12px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-black, #111);
}

.figma-theme .manage-customers-modal .manage-customers-admin-note {
  margin: 0;
  text-align: center;
  font: 400 12px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--figma-text-muted, #6b7280);
}

.figma-theme .manage-customers-modal .manage-customers-error {
  margin: 0;
  text-align: center;
  color: #b42318;
  font: 400 0.875rem/1.35 Inter, ui-sans-serif, system-ui, sans-serif;
}

.figma-theme .manage-customers-modal .manage-customers-section-title {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
}

.figma-theme .manage-customers-modal .manage-customers-empty {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--text-muted, #6b7280);
}

.figma-theme .manage-customers-modal .manage-customers-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(320px, 40vh);
  overflow: auto;
}

.figma-theme .manage-customers-modal .manage-customers-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface, #fff) 92%, #000 8%);
}

.figma-theme .manage-customers-modal .manage-customers-name {
  font-size: 0.9375rem;
  line-height: 1.3;
  min-width: 0;
  word-break: break-word;
}

.figma-theme .manage-customers-modal .manage-customers-remove {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  font: 500 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  color: #b42318;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}

.figma-theme .manage-customers-modal .manage-customers-remove:hover {
  background: color-mix(in srgb, #b42318 10%, transparent);
}

.figma-theme .manage-customers-modal .manage-customers-remove:disabled {
  opacity: 0.55;
  cursor: default;
}

.figma-theme .manage-customers-modal .settings-menu-footer {
  justify-content: flex-end;
}
