/* Banking-style wallet — shared by portal + driver-portal */

.wallet-shell {
  display: grid;
  gap: 14px;
  max-width: 560px;
  margin-inline: auto;
}

.wallet-account-card {
  position: relative;
  padding: 1.25rem 1.2rem 1.1rem;
  border-radius: 20px;
  background:
    linear-gradient(145deg, #241c18 0%, #352b23 48%, #46372c 100%);
  color: var(--tumicha-text-light, #f2ead8);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(42, 33, 24, 0.24);
  min-height: 11.5rem;
  display: grid;
  align-content: space-between;
  gap: 0.35rem;
}

.wallet-account-card::before {
  content: '';
  position: absolute;
  inset: auto -20% -45% auto;
  width: 70%;
  height: 90%;
  background: radial-gradient(circle, rgba(201, 146, 63, 0.22), transparent 68%);
  pointer-events: none;
}

.wallet-account-card-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.wallet-account-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tumicha-cream-muted, #c9b899);
}

.wallet-account-name {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.wallet-account-chip {
  width: 2.4rem;
  height: 1.7rem;
  border-radius: 0.4rem;
  background:
    linear-gradient(135deg, rgba(219, 176, 106, 0.95), rgba(201, 146, 63, 0.55));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.wallet-account-label {
  position: relative;
  margin: 1.1rem 0 0;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tumicha-cream-muted, #c9b899);
}

.wallet-hero-amount {
  position: relative;
  margin: 0.15rem 0 0;
  font-size: clamp(1.95rem, 6vw, 2.45rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #fff;
}

.wallet-account-footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(242, 234, 216, 0.78);
  font-variant-numeric: tabular-nums;
}

.wallet-quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wallet-stat {
  padding: 12px 10px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(166, 116, 47, 0.14);
  text-align: left;
  box-shadow: 0 1px 2px rgba(43, 26, 13, 0.04);
}

.wallet-stat span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tumicha-muted, #7a6550);
}

.wallet-stat strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--tumicha-ink, #2b1a0d);
}

.wallet-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 8px;
}

.wallet-action-btn {
  appearance: none;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(166, 116, 47, 0.14);
  background: #fff;
  color: var(--tumicha-ink, #2b1a0d);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.wallet-action-btn:hover {
  border-color: rgba(201, 146, 63, 0.45);
}

.wallet-action-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f4efe7;
  color: var(--tumicha-brown, #2e2420);
}

.wallet-action-icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.wallet-panel {
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(166, 116, 47, 0.14);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(43, 26, 13, 0.03);
}

.wallet-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.55rem;
}

.wallet-panel-head h3 {
  margin: 0;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.wallet-panel-meta {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--tumicha-muted, #7a6550);
}

.wallet-tx-scroll {
  display: grid;
  padding: 0 0.35rem 0.55rem;
}

.wallet-tx-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  padding: 0.75rem 0.65rem;
  border-radius: 12px;
  cursor: pointer;
  border: 0;
  background: transparent;
}

.wallet-tx-row:hover,
.wallet-tx-row.is-open {
  background: #faf7f2;
}

.wallet-tx-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.wallet-tx-avatar.is-in {
  background: rgba(47, 133, 90, 0.12);
  color: #1f6b43;
}

.wallet-tx-avatar.is-out {
  background: rgba(166, 84, 47, 0.12);
  color: #8a3f1f;
}

.wallet-tx-copy {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.wallet-tx-topline {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.wallet-tx-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-tx-amount {
  font-size: 0.92rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wallet-tx-amount.is-in {
  color: #1f6b43;
}

.wallet-tx-amount.is-out {
  color: #8a3f1f;
}

.wallet-tx-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
}

.wallet-tx-date {
  font-size: 0.75rem;
  color: var(--tumicha-muted, #7a6550);
}

.wallet-tx-status {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tumicha-muted, #7a6550);
  background: #f3eee6;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.wallet-tx-reference {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--tumicha-ink, #2b1a0d);
  word-break: break-all;
}

.wallet-tx-reference.is-masked {
  letter-spacing: 0.08em;
  color: var(--tumicha-muted, #7a6550);
}

.wallet-tx-reference.is-revealed {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.wallet-tx-reveal-hint {
  font-size: 0.68rem;
  color: var(--tumicha-muted, #7a6550);
}

@media (max-width: 720px) {
  .wallet-tx-title {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
  }

  .wallet-tx-topline {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

.wallet-tx-empty {
  margin: 0;
  padding: 1.4rem 1rem 1.6rem;
  text-align: center;
  color: var(--tumicha-muted, #7a6550);
  font-size: 0.9rem;
}

.wallet-bank-toggle {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.wallet-bank-toggle h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.wallet-bank-toggle span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--tumicha-muted, #7a6550);
}

.wallet-bank-chevron {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  color: var(--tumicha-muted, #7a6550);
  transition: transform 0.15s ease;
}

.wallet-panel.is-open .wallet-bank-chevron {
  transform: rotate(180deg);
}

.wallet-bank-body {
  display: none;
  padding: 0 1rem 1rem;
}

.wallet-panel.is-open .wallet-bank-body {
  display: grid;
  gap: 0.75rem;
}

.wallet-bank-intro {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--tumicha-muted, #7a6550);
}

.wallet-form-grid {
  display: grid;
  gap: 0.75rem;
}

.wallet-form-grid label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--tumicha-muted, #7a6550);
}

.wallet-form-grid input {
  min-height: 2.45rem;
  border-radius: 10px;
  border: 1px solid rgba(166, 116, 47, 0.18);
  background: #fff;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--tumicha-ink, #2b1a0d);
}

.wallet-form-grid input:focus {
  outline: 2px solid rgba(201, 146, 63, 0.35);
  outline-offset: 1px;
}

.wallet-type-field {
  display: grid;
  gap: 0.4rem;
}

.wallet-type-field > span {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--tumicha-muted, #7a6550);
}

.wallet-type-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.wallet-type-pill {
  appearance: none;
  min-height: 2.3rem;
  border-radius: 10px;
  border: 1px solid rgba(166, 116, 47, 0.16);
  background: #faf7f2;
  color: var(--tumicha-muted, #7a6550);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.wallet-type-pill.is-active {
  background: var(--tumicha-brown, #2e2420);
  border-color: var(--tumicha-brown, #2e2420);
  color: #fff;
}

.wallet-form-actions {
  display: grid;
}

.wallet-form-status {
  margin: 0;
  font-size: 0.84rem;
}

.wallet-form-status.is-error {
  color: #9b2c2c;
}

.wallet-form-status.is-success {
  color: #1f6b43;
}

.wallet-form-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--tumicha-muted, #7a6550);
}

.wallet-export-body {
  gap: 0.75rem;
}

.wallet-export-fields {
  grid-template-columns: 1fr;
}

.wallet-export-fields label {
  display: grid;
}

.wallet-export-fields input[type='datetime-local'] {
  width: 100%;
}

.wallet-export-btn {
  width: 100%;
}

/* Premium segmented controls — keep the card only inside Wallet forms. */
.wallet-shell .account-type-tabs,
.wallet-panel .account-type-tabs,
.wallet-form .account-type-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: var(--mist, #f6f4f1);
  border: 1px solid var(--border, rgba(166, 116, 47, 0.14));
}

.account-type-btn {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted, #7a6550);
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.2;
  padding: 8px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.account-type-btn.active {
  background: var(--panel, #fff);
  color: var(--ink, #121212);
  border-color: rgba(166, 116, 47, 0.16);
  box-shadow: 0 1px 3px rgba(42, 41, 39, 0.08);
}

.account-type-hint {
  margin: 10px 0 14px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted, #7a6550);
}

@media (max-width: 520px) {
  .wallet-quick-stats,
  .wallet-quick-actions,
  .wallet-type-pills {
    grid-template-columns: 1fr;
  }

  .account-type-tabs .account-type-btn {
    font-size: 0.78rem;
    padding: 8px 6px;
  }
}
