/* manual-accounts
   Manual accounts / manual transactions / Manage Accounts modals on the
   Cash Flow page and the Manage Accounts page. No Figma frames exist for
   these, so they reuse the Cash Flow modal chrome and fields (`cft-*` in cash-flow-transactions.css,
   `cfo-*` linked-accounts block in cash-flow-onboarding.css) and only add
   what's missing. Selected-state green is mobile's `darkGreen`. */

.ma-pill:disabled {
  opacity: 0.5;
  cursor: default;
}

/* --- Form --- */

.ma-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ma-error {
  margin: 0;
  color: #D1817E;
  font-size: 14px;
  line-height: 20px;
}

.cft-input.ma-invalid,
.ma-money.ma-invalid {
  border-color: #D1817E;
}

.ma-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ma-chip {
  height: 40px;
  padding: 8px 16px;
  border-radius: 40px;
  border: 1px solid var(--navy-border);
  background: var(--navy-card-secondary);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.ma-chip.selected {
  background: var(--green-strong);
  border-color: var(--green-strong);
}

/* $-prefixed amount field, drawn like `.cft-input`. */
.ma-money {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--control-border);
  background: var(--navy-card-secondary);
}

.ma-money:focus-within {
  border-color: var(--light-gray);
}

.ma-money-prefix {
  flex-shrink: 0;
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
}

.ma-money-input {
  flex: 1 0 0;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  font-family: "Geist", sans-serif;
  font-size: 16px;
  outline: none;
  color-scheme: dark;
  -moz-appearance: textfield;
  appearance: textfield;
}

.ma-money-input::-webkit-outer-spin-button,
.ma-money-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ma-money-input::placeholder,
.ma-form .cft-input::placeholder {
  color: var(--light-gray);
}

.ma-delete-link {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ED0000;
  font-size: 16px;
  font-weight: 700;
}

.ma-delete-link:disabled {
  opacity: 0.5;
  cursor: default;
}

/* --- Linked accounts additions (manual account rows) --- */

.ma-row-edit {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 32px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ma-row-edit:disabled {
  opacity: 0.5;
  cursor: default;
}

.ma-add-link {
  color: var(--green-light);
}

/* --- Manage Accounts --- */

.ma-settings-btn {
  position: relative;
}

.ma-settings-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #D62F7A;
}

/* Page (`/manage-accounts`): the onboarding "accounts" card (Figma
   18648:425467) in the app shell, plus mobile's subscription card. */
.ma-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.ma-page p,
.ma-page :is(h1, h2, h3, h4) {
  margin: 0;
}

.ma-back {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  font-family: inherit;
  cursor: pointer;
}

.ma-back-error {
  margin: -24px 0 16px !important;
}

.ma-page .groove-page-title {
  margin-bottom: 40px;
}

.ma-muted {
  color: var(--light-gray);
}

.ma-card {
  gap: 24px;
}

.ma-card .cfo-heading {
  gap: 8px;
}

.ma-card .cfo-title {
  font-weight: 500;
  line-height: 1.2;
}

.ma-guest {
  align-items: flex-start;
}

.ma-sub {
  color: var(--light-gray);
}

.ma-subscription {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 800px;
  max-width: 100%;
}

.ma-plan-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: 12px;
  border: 1px solid var(--navy-border);
  background: var(--navy-card-secondary);
}

.ma-plan-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.ma-plan-value {
  text-align: right;
}

.ma-plan-expires {
  color: var(--light-gray);
  font-size: 14px;
}

.ma-plan-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.ma-plan-stores .cfo-btn {
  flex: 1 0 220px;
}

.ma-reauth-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #C96B67;
  color: var(--white);
  font-weight: 600;
  line-height: 1.4;
}

.ma-reauth-banner img {
  flex-shrink: 0;
}

/* --- Presentation mode (Super Admin only) --- */

.pm-card {
  margin-top: 8px;
}

.pm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
}

.pm-row-label {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.pm-pill {
  padding: 4px 12px;
  border-radius: 16px;
  background: var(--navy-card-secondary);
  border: 1px solid var(--navy-border);
  color: var(--light-gray);
  font-size: 14px;
  font-weight: 600;
}

.pm-pill.on {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.pm-text {
  margin: 0;
  color: var(--light-gray);
  font-size: 16px;
  line-height: 1.4;
}

/* --- Add manual transaction --- */

.ma-type-toggle {
  display: flex;
  gap: 8px;
}

.ma-type {
  flex: 1 0 0;
  min-width: 0;
  height: 40px;
  border-radius: 40px;
  border: 1px solid var(--navy-border);
  background: var(--navy-card-secondary);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
}

.ma-type.selected {
  border: 2px solid var(--green);
}

.ma-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ma-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ma-category-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ma-category-value > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ma-static-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 0 16px;
  color: var(--white);
  font-size: 16px;
}

.ma-static-label {
  color: var(--light-gray);
}

.ma-static-name {
  flex: 1 0 0;
  min-width: 0;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-static-clear {
  width: 32px;
  height: 32px;
}

.ma-empty {
  margin: 0;
  padding: 24px 0;
  color: var(--light-gray);
  font-size: 14px;
  text-align: center;
}

.ma-picker-divider {
  margin: 8px 0;
  flex-shrink: 0;
}

.ma-picker-label {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.ma-radio-text {
  display: flex;
  flex-direction: column;
}

.ma-radio-name {
  font-weight: 600;
}

.ma-radio-sub {
  color: var(--light-gray);
  font-size: 13px;
  line-height: 1.4;
}

.ma-add-account {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .ma-field-row {
    grid-template-columns: 1fr;
  }
}

/* --- Reflow (WCAG 1.4.10 / 1.4.4) --- desktop unchanged. */

@media (max-width: 767.98px) {
  .ma-plan-card {
    padding: 16px;
  }

  .ma-plan-row {
    flex-wrap: wrap;
  }

  .ma-plan-stores .cfo-btn {
    flex-basis: 100%;
    min-width: 0;
  }

  .ma-field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .ma-type {
    height: auto;
    min-height: 40px;
  }
}

/* Loading skeleton: span the column (not shrink-wrap) so the 800px card can
   shrink to fit narrow screens like the real one. */
.ma-page > .groove-skeleton {
  align-self: stretch;
  min-width: 0;
}
