.mvp-button-effects {
  --mvp-button-effect-strength: 1;
  --mvp-button-click-shrink: 0.93;
  --mvp-button-click-pop: 1.09;
  --mvp-button-click-settle: 0.975;
}

html.mvp-button-effects button:not(:disabled):not(.is-mvp-click-pop):hover,
html.mvp-button-effects [role="button"]:not([aria-disabled="true"]):not(.is-mvp-click-pop):hover {
  animation: mvp-button-hover-wobble 520ms cubic-bezier(0.2, 0.85, 0.18, 1.12) both;
  transform-origin: center;
  will-change: transform;
}

html.mvp-button-effects .mvp-settings-tabs button:not(:disabled):not(.is-mvp-click-pop):hover,
html.mvp-button-effects .mvp-settings-nav__footer button:not(:disabled):not(.is-mvp-click-pop):hover,
html.mvp-button-effects .stage-preview-button:not(:disabled):not(.is-mvp-click-pop):hover,
html.mvp-button-effects .history-thumb:not(:disabled):not(.is-mvp-click-pop):hover {
  animation: none;
  transform: none;
  will-change: auto;
}

html.mvp-button-effects button.is-mvp-click-pop,
html.mvp-button-effects [role="button"].is-mvp-click-pop {
  animation: mvp-button-click-pop 380ms linear both;
  transform-origin: center;
  will-change: transform;
}

html.mvp-button-effects .stage-preview-button.is-mvp-click-pop,
html.mvp-button-effects .history-thumb.is-mvp-click-pop {
  animation: none;
  transform: none;
  will-change: auto;
}

@keyframes mvp-button-hover-wobble {
  0%,
  100% {
    transform: translateX(0) rotate(0deg) scale(1);
  }
  18% {
    transform: translateX(calc(-1.6px * var(--mvp-button-effect-strength))) rotate(calc(-1.15deg * var(--mvp-button-effect-strength))) scale(1.015);
  }
  38% {
    transform: translateX(calc(1.7px * var(--mvp-button-effect-strength))) rotate(calc(1.2deg * var(--mvp-button-effect-strength))) scale(1.025);
  }
  62% {
    transform: translateX(calc(-0.9px * var(--mvp-button-effect-strength))) rotate(calc(-0.75deg * var(--mvp-button-effect-strength))) scale(1.012);
  }
  82% {
    transform: translateX(calc(0.45px * var(--mvp-button-effect-strength))) rotate(calc(0.4deg * var(--mvp-button-effect-strength))) scale(1.006);
  }
}

@keyframes mvp-button-click-pop {
  0% {
    transform: scale(1);
  }
  28% {
    transform: scale(var(--mvp-button-click-shrink));
  }
  58% {
    transform: scale(var(--mvp-button-click-pop));
  }
  78% {
    transform: scale(var(--mvp-button-click-settle));
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.mvp-button-effects button:not(:disabled):hover,
  html.mvp-button-effects [role="button"]:not([aria-disabled="true"]):hover,
  html.mvp-button-effects button.is-mvp-click-pop,
  html.mvp-button-effects [role="button"].is-mvp-click-pop {
    animation: none;
  }
}

.mvp-top-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-right: 8px;
  flex: 0 0 auto;
}

.mvp-sidebar-token-bar {
  width: 100%;
  margin-right: 0;
  flex-wrap: wrap;
}

.mvp-sidebar-token-bar .mvp-token-chip {
  min-width: 0;
  flex: 1 1 auto;
}

.mvp-settings-trigger,
.mvp-token-buy,
.mvp-google-login-btn,
.mvp-settings-action,
.mvp-settings-tab,
.mvp-settings-close,
.mvp-settings-logout {
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text, #f7f6ed);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.mvp-settings-trigger {
  display: grid;
  place-items: center;
  width: 26px;
  height: 24px;
  border-color: transparent;
  border-radius: 0;
  color: rgba(229, 235, 255, 0.78);
  background: transparent;
  font-weight: 800;
}

.mvp-token-buy {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-color: rgba(149, 158, 211, 0.2);
  border-radius: 0;
  background: #202442;
  color: rgba(246, 247, 255, 0.9);
  font-size: 1rem;
  font-weight: 800;
}

.mvp-settings-trigger:hover,
.mvp-token-buy:hover,
.mvp-settings-action:hover,
.mvp-settings-close:hover,
.mvp-settings-tab:hover {
  border-color: rgba(243, 239, 200, 0.45);
  background: rgba(243, 239, 200, 0.12);
}

.mvp-token-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 58px;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid rgba(149, 158, 211, 0.2);
  border-radius: 0;
  color: rgba(246, 247, 255, 0.9);
  background: #202442;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.mvp-token-chip strong {
  color: var(--primary, #f3efc8);
}

.mvp-auth-divider {
  display: grid;
  place-items: center;
  min-height: 20px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.86rem;
  font-weight: 800;
}

.mvp-google-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border-color: rgba(86, 96, 150, 0.58);
  border-radius: 0;
  background: #070b21;
  color: var(--text, #f7f6ed);
  font-size: 0.85rem;
  font-weight: 800;
}

.mvp-google-login-btn span {
  color: #4285f4;
  font-weight: 900;
}

.field-shell input.is-readonly {
  color: var(--text, #f7f6ed);
  cursor: default;
}

.secret-input {
  -webkit-text-security: disc;
  text-security: disc;
}

.mvp-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(4, 6, 18, 0.84);
  backdrop-filter: none;
}

.mvp-settings-overlay[hidden] {
  display: none;
}

.mvp-settings-modal {
  display: grid;
  grid-template-columns: minmax(184px, 210px) minmax(0, 1fr);
  width: min(1248px, calc(100vw - 28px));
  height: min(774px, calc(100vh - 28px));
  overflow: hidden;
  border: 1px solid rgba(86, 96, 150, 0.5);
  border-radius: 0;
  background: #171a33;
  box-shadow: 0 22px 72px rgba(0, 0, 0, 0.48);
}

.mvp-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 30px;
  min-height: 0;
  padding: 24px 20px 18px;
  border-right: 1px solid rgba(86, 96, 150, 0.34);
  background: #10142b;
}

.mvp-settings-nav__title {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(86, 96, 150, 0.24);
}

.mvp-settings-nav__icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 0;
  color: var(--primary, #f3efc8);
  background: transparent;
  font-weight: 900;
}

.mvp-settings-nav__title .mvp-settings-note {
  display: none;
}

.mvp-settings-nav h2,
.mvp-settings-content > .mvp-settings-panel > h3 {
  margin: 0;
  font-size: 1rem;
}

.mvp-settings-tabs,
.mvp-settings-nav__footer,
.mvp-settings-panel,
.mvp-settings-account-grid,
.mvp-settings-box {
  display: grid;
  gap: 12px;
}

.mvp-settings-tabs {
  align-content: start;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  gap: 0;
}

.mvp-settings-nav__footer {
  margin-top: auto;
}

.mvp-settings-tab,
.mvp-settings-logout {
  min-height: 50px;
  padding: 0 10px;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.mvp-settings-tab.is-active {
  color: var(--primary, #f3efc8);
  background: #1d213d;
}

.mvp-settings-logout:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.mvp-settings-content {
  position: relative;
  min-height: 0;
  overflow: auto;
  padding: 26px 38px 28px 20px;
  background: #171a33;
}

.mvp-settings-content.is-admin-panel {
  padding: 14px;
}

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

.mvp-settings-close {
  position: sticky;
  top: 0;
  float: right;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.8rem;
  line-height: 1;
}

.mvp-settings-close:hover {
  border-color: transparent;
  background: transparent;
  color: var(--primary, #f3efc8);
}

.mvp-settings-account-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 20px;
}

.mvp-settings-box {
  padding: 20px;
  border: 1px solid rgba(86, 96, 150, 0.42);
  border-radius: 0;
  background: #171a33;
}

.mvp-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(86, 96, 150, 0.25);
}

.mvp-settings-row:last-child {
  border-bottom: 0;
}

.mvp-settings-row span,
.mvp-settings-note {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
}

.mvp-settings-row strong {
  display: block;
  color: var(--text, #f7f6ed);
  font-size: 0.86rem;
}

.mvp-settings-slider-head {
  margin-top: 10px;
}

.mvp-settings-action {
  min-height: 42px;
  padding: 6px 14px;
  border-color: rgba(86, 96, 150, 0.58);
  border-radius: 0;
  background: #202442;
  font-size: 0.76rem;
  font-weight: 800;
}

.mvp-settings-action.danger {
  color: #ffd8d8;
  border-color: rgba(255, 120, 120, 0.28);
}

.mvp-auth-actions,
.mvp-plan-grid,
.mvp-key-redeem-row,
.mvp-admin-form-grid,
.mvp-theme-row {
  display: grid;
  gap: 8px;
}

.mvp-auth-actions,
.mvp-plan-grid,
.mvp-key-redeem-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mvp-auth-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mvp-plan-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mvp-wallet-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.mvp-wallet-summary > div:not(.meter) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.mvp-wallet-summary span {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
}

.mvp-wallet-summary strong {
  color: var(--primary, #f3efc8);
  font-size: 1.05rem;
}

.mvp-wallet-summary .meter {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08);
}

.mvp-wallet-summary .meter span {
  display: block;
  height: 100%;
  background: var(--primary, #f3efc8);
}

.mvp-plan-pill,
.mvp-theme-swatch {
  min-height: 28px;
  border: 1px solid rgba(86, 96, 150, 0.58);
  border-radius: 0;
  color: var(--text, #f7f6ed);
  background: transparent;
  font-weight: 800;
}

.mvp-plan-pill.is-active,
.mvp-theme-swatch.is-active {
  color: var(--primary, #f3efc8);
  border-color: rgba(243, 239, 200, 0.8);
  background: transparent;
}

.mvp-admin-form-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.mvp-admin-form-grid__wide {
  grid-column: span 2;
}

.mvp-admin-table-wrap {
  overflow: auto;
  border: 1px solid rgba(86, 96, 150, 0.42);
  border-radius: 0;
}

.mvp-settings-box--dense {
  gap: 10px;
  padding: 14px;
}

.mvp-admin-table-wrap--dense {
  max-height: min(58vh, 620px);
}

.mvp-admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.74rem;
}

.mvp-admin-table th,
.mvp-admin-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  vertical-align: top;
}

.mvp-admin-table th {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.mvp-admin-table input,
.mvp-admin-table select {
  width: 100%;
  min-width: 76px;
  border: 1px solid rgba(86, 96, 150, 0.42);
  border-radius: 0;
  color: var(--text, #f7f6ed);
  background: #090c22;
}

.mvp-admin-table--accounts {
  min-width: 980px;
  table-layout: fixed;
  font-size: 0.68rem;
}

.mvp-admin-table--token-costs {
  min-width: 640px;
  table-layout: fixed;
  font-size: 0.72rem;
}

.mvp-admin-table--workflow-names {
  min-width: 1120px;
  table-layout: fixed;
  font-size: 0.68rem;
}

.mvp-admin-table--accounts th,
.mvp-admin-table--accounts td,
.mvp-admin-table--token-costs th,
.mvp-admin-table--token-costs td,
.mvp-admin-table--workflow-names th,
.mvp-admin-table--workflow-names td {
  padding: 5px 6px;
  vertical-align: middle;
}

.mvp-admin-table--accounts th:nth-child(1),
.mvp-admin-table--accounts td:nth-child(1) {
  width: 150px;
}

.mvp-admin-table--accounts th:nth-child(2),
.mvp-admin-table--accounts th:nth-child(3),
.mvp-admin-table--accounts th:nth-child(4) {
  width: 70px;
}

.mvp-admin-table--accounts th:nth-child(5),
.mvp-admin-table--accounts th:nth-child(7),
.mvp-admin-table--accounts th:nth-child(8),
.mvp-admin-table--accounts th:nth-child(9) {
  width: 86px;
}

.mvp-admin-table--accounts th:nth-child(6) {
  width: 116px;
}

.mvp-admin-table--accounts th:nth-child(10) {
  width: 58px;
}

.mvp-admin-table--accounts input,
.mvp-admin-table--accounts select,
.mvp-admin-table--token-costs input,
.mvp-admin-table--workflow-names input {
  min-width: 0;
  height: 30px;
  min-height: 30px;
  padding: 0 6px;
  font-size: 0.68rem;
  line-height: 30px;
}

.mvp-admin-table--accounts .mvp-settings-action,
.mvp-admin-table--token-costs .mvp-settings-action,
.mvp-admin-table--workflow-names .mvp-settings-action {
  width: 100%;
  min-height: 32px;
  padding: 4px 6px;
  font-size: 0.68rem;
}

.mvp-admin-table--workflow-names th:nth-child(1) {
  width: 170px;
}

.mvp-admin-table--workflow-names th:nth-child(7) {
  width: 62px;
}

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

.mvp-account-cell {
  overflow: hidden;
}

.mvp-workflow-name-key,
.mvp-account-cell span,
.mvp-account-cell small {
  overflow: hidden;
}

.mvp-workflow-name-key span,
.mvp-workflow-name-key small,
.mvp-account-cell span,
.mvp-account-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mvp-workflow-name-key span,
.mvp-account-cell span {
  color: var(--text, #f7f6ed);
  font-weight: 800;
}

.mvp-workflow-name-key small,
.mvp-account-cell small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.62rem;
}

.mvp-key-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
}

.mvp-key-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mvp-settings-modal .field-shell {
  gap: 7px;
  margin-top: 0;
}

.mvp-settings-modal .field-shell span,
.mvp-settings-modal .card-hint {
  color: rgba(255, 255, 255, 0.58);
}

.mvp-settings-modal .field-shell input,
.mvp-settings-modal .field-shell select {
  min-height: 48px;
  padding: 0 12px;
  border-color: rgba(86, 96, 150, 0.36);
  border-radius: 0;
  background: #090c22;
}

.mvp-settings-modal .field-shell input:focus,
.mvp-settings-modal .field-shell select:focus {
  border-color: rgba(243, 239, 200, 0.36);
  background: #090c22;
}

.mvp-settings-modal .utility-btn {
  min-height: 50px;
  border-color: rgba(86, 96, 150, 0.5);
  border-radius: 0;
  background: #202442;
  font-weight: 800;
}

.mvp-settings-modal .utility-btn:hover,
.mvp-settings-action:hover,
.mvp-plan-pill:hover,
.mvp-theme-swatch:hover {
  border-color: rgba(243, 239, 200, 0.48);
  background: rgba(243, 239, 200, 0.08);
}

.mvp-hidden {
  display: none !important;
}

body.mvp-settings-open {
  overflow: hidden;
}

body[data-mvp-theme="contrast"] {
  --primary: #c7d2ff;
  --text: #ffffff;
  --line: rgba(199, 210, 255, 0.24);
}

body[data-mvp-theme="studio"] {
  --primary: #f6d98f;
  --text: #fff8e8;
  --line: rgba(246, 217, 143, 0.22);
}

@media (max-width: 900px) {
  .mvp-settings-modal {
    grid-template-columns: 1fr;
  }

  .mvp-settings-nav {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mvp-settings-tabs,
  .mvp-settings-nav__footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mvp-settings-account-grid,
  .mvp-auth-actions,
  .mvp-plan-grid,
  .mvp-key-redeem-row,
  .mvp-wallet-summary,
  .mvp-admin-form-grid {
    grid-template-columns: 1fr;
  }

  .mvp-admin-form-grid__wide {
    grid-column: auto;
  }
}
