:root {
  --bg: #f7f8ff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.10);
  --primary: #7c3aed;
  --primary-2: #06b6d4;
  --accent: #fb7185;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
  --soft-shadow: 0 14px 40px rgba(15, 23, 42, 0.10);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --nav-h: 86px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  --bg: #070913;
  --surface: rgba(15, 23, 42, 0.76);
  --surface-strong: #101827;
  --text: #f8fafc;
  --muted: #a4afc4;
  --line: rgba(255, 255, 255, 0.10);
  --shadow: 0 26px 86px rgba(0, 0, 0, 0.42);
  --soft-shadow: 0 16px 46px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 15% 0%, rgba(124, 58, 237, 0.24), transparent 30%),
    radial-gradient(circle at 96% 16%, rgba(6, 182, 212, 0.22), transparent 26%),
    radial-gradient(circle at 52% 100%, rgba(251, 113, 133, 0.16), transparent 34%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 17px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: rgba(15, 23, 42, 0.9);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(124, 58, 237, 0.58);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

label {
  display: block;
  margin: 12px 0 7px;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text);
}

.hidden {
  display: none !important;
}

.orb {
  position: fixed;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.5;
  z-index: -2;
  pointer-events: none;
  animation: floaty 9s ease-in-out infinite;
}

.orb-one {
  top: 86px;
  left: -86px;
  background: rgba(124, 58, 237, 0.22);
}

.orb-two {
  right: -80px;
  bottom: 120px;
  background: rgba(6, 182, 212, 0.18);
  animation-delay: -4s;
}

@keyframes floaty {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -24px, 0) scale(1.08); }
}

.app-shell {
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 14px calc(var(--nav-h) + var(--safe-bottom) + 22px);
}

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(9, 11, 18, 0.48);
  backdrop-filter: blur(20px);
}

.onboarding-card {
  width: min(420px, 100%);
  padding: 26px;
  border-radius: 34px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  text-align: center;
}

.logo-badge {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 22px;
  font-weight: 950;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 20px 40px rgba(124, 58, 237, 0.28);
}

.onboarding-card h1 {
  margin: 0 0 10px;
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.onboarding-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.55;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 14px;
}

.eyebrow,
.section-kicker,
.session-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar h1 {
  margin: 1px 0 0;
  font-size: 1.62rem;
  letter-spacing: -0.05em;
}

.top-actions,
.hero-actions,
.quick-row,
.action-grid {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--soft-shadow);
  font-size: 1.15rem;
  font-weight: 900;
}

.hero-card,
.setting-card,
.list-card,
.result-card,
.modal-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 34px;
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 999px;
  right: -62px;
  top: -70px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(6, 182, 212, 0.20));
}

.hero-copy,
.hero-actions,
.summary-grid {
  position: relative;
  z-index: 1;
}

.hero-copy h2 {
  margin: 5px 0 4px;
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: -0.055em;
}

.hero-copy p:not(.session-label) {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.hero-actions {
  margin-top: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.summary-grid article {
  min-width: 0;
  padding: 13px 11px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--line);
}

[data-theme="dark"] .summary-grid article {
  background: rgba(15, 23, 42, 0.64);
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(0.95rem, 4vw, 1.2rem);
  letter-spacing: -0.035em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 1px 10px;
  scrollbar-width: none;
}

.stepper::-webkit-scrollbar {
  display: none;
}

.step-pill {
  flex: 0 0 auto;
  padding: 10px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 850;
}

.step-pill.active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 13px 28px rgba(124, 58, 237, 0.20);
}

.panel {
  display: none;
  animation: popIn 0.22s ease both;
}

.panel.active {
  display: block;
}

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

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 13px;
}

.section-head h2 {
  margin: 4px 0 4px;
  font-size: 1.34rem;
  letter-spacing: -0.045em;
}

.section-head p,
.setting-title span,
.card-subtitle,
.muted {
  color: var(--muted);
  line-height: 1.45;
}

.section-head p {
  margin: 0;
  font-size: 0.93rem;
}

.primary-btn,
.soft-btn,
.ghost-btn {
  min-height: 45px;
  padding: 0 16px;
  border-radius: 16px;
  font-weight: 900;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 16px 34px rgba(124, 58, 237, 0.24);
}

.primary-btn.small,
.soft-btn.mini {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 0.85rem;
}

.primary-btn.full,
.soft-btn.full {
  width: 100%;
}

.soft-btn,
.ghost-btn {
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface);
}

.ghost-btn {
  min-height: 38px;
  padding: 0 12px;
}

.danger-soft {
  color: var(--danger);
}

.primary-btn:active,
.soft-btn:active,
.ghost-btn:active,
.icon-btn:active,
.mode-card:active {
  transform: scale(0.98);
}

.card-list,
.result-list,
.mini-list,
.percentage-list {
  display: grid;
  gap: 11px;
  margin-top: 12px;
}

.list-card,
.setting-card,
.result-card {
  border-radius: var(--radius-lg);
  padding: 15px;
}

.setting-card {
  margin-bottom: 12px;
}

.card-top,
.result-top,
.setting-title,
.setting-title.inline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.setting-title {
  margin-bottom: 12px;
}

.setting-title strong {
  display: block;
  font-size: 1rem;
}

.setting-title span {
  display: block;
  margin-top: 2px;
  font-size: 0.84rem;
}

.card-title {
  margin: 0;
  font-weight: 950;
  letter-spacing: -0.025em;
}

.card-subtitle {
  margin: 4px 0 0;
  font-size: 0.86rem;
}

.card-actions,
.result-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.text-btn {
  color: var(--primary);
  background: transparent;
  font-weight: 900;
  padding: 6px 0;
}

.text-btn.danger {
  color: var(--danger);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.76rem;
  font-weight: 850;
  background: rgba(124, 58, 237, 0.10);
  color: var(--primary);
}

.status-pill.paid {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.status-pill.unpaid {
  background: rgba(245, 158, 11, 0.14);
  color: var(--warning);
}

.empty-box {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 150px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.36);
  text-align: center;
  line-height: 1.45;
}

[data-theme="dark"] .empty-box {
  background: rgba(15, 23, 42, 0.48);
}

.mode-grid {
  display: grid;
  gap: 10px;
}

.mode-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 13px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.52);
  text-align: left;
}

[data-theme="dark"] .mode-card {
  background: rgba(15, 23, 42, 0.62);
}

.mode-card span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(124, 58, 237, 0.12);
}

.mode-card strong,
.mode-card small {
  display: block;
}

.mode-card small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

.mode-card.active {
  border-color: rgba(124, 58, 237, 0.42);
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.18), 0 18px 34px rgba(124, 58, 237, 0.12);
}

.form-grid {
  display: grid;
  gap: 0;
}

.input-row {
  display: grid;
  gap: 9px;
}

.input-row.two {
  grid-template-columns: 1fr 0.65fr;
}

.input-row.three {
  grid-template-columns: 1fr 0.58fr 1.35fr;
}

.percentage-item {
  display: grid;
  grid-template-columns: 1fr 110px;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.percentage-total {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.percentage-total strong {
  color: var(--text);
}

.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--line);
}

[data-theme="dark"] .mini-row {
  background: rgba(15, 23, 42, 0.55);
}

.mini-row strong,
.mini-row span {
  display: block;
}

.mini-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.notice {
  padding: 13px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.22);
  line-height: 1.45;
}

.result-card {
  display: grid;
  gap: 12px;
}

.result-total {
  font-size: 1.42rem;
  font-weight: 950;
  letter-spacing: -0.045em;
  color: var(--primary);
  white-space: nowrap;
}

.breakdown {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
}

.breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.breakdown strong {
  color: var(--text);
}

.action-grid {
  margin-top: 12px;
}

.action-grid button {
  flex: 1 1 140px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 7px;
}

.check-card {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.52);
  font-size: 0.88rem;
  font-weight: 800;
}

[data-theme="dark"] .check-card {
  background: rgba(15, 23, 42, 0.58);
}

.check-card input {
  width: auto;
  accent-color: var(--primary);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  background: rgba(3, 7, 18, 0.48);
  backdrop-filter: blur(18px);
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: min(520px, 100%);
  max-height: calc(100dvh - 30px);
  overflow: auto;
  padding: 18px;
  border-radius: 30px;
  animation: slideUp 0.22s ease both;
}

.modal-card.tall {
  max-height: calc(100dvh - 22px);
}

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

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.modal-head h3 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.04em;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  transform: translateX(-50%);
  width: min(560px, 100%);
  height: calc(var(--nav-h) + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 9px 10px calc(9px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px);
  box-shadow: 0 -16px 48px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] .bottom-nav {
  background: rgba(7, 9, 19, 0.82);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 18px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.bottom-nav span {
  font-size: 1.1rem;
}

.bottom-nav small {
  font-size: 0.68rem;
}

.bottom-nav button.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.swal2-popup {
  border-radius: 26px !important;
}

.swal2-confirm,
.swal2-cancel {
  border-radius: 14px !important;
}

@media (min-width: 680px) {
  .app-shell {
    padding-top: 24px;
  }

  .mode-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mode-card {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .setting-card {
    margin-bottom: 0;
  }
}

@media (max-width: 390px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .input-row.two,
  .input-row.three,
  .check-grid,
  .percentage-item {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }
}


.help-content {
  display: grid;
  gap: 14px;
  padding-bottom: 6px;
}

.help-block {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  background: var(--surface-soft);
}

.help-block h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.help-block p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.55;
}

.help-block p:last-child {
  margin-bottom: 0;
}

.help-block ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.help-list {
  display: grid;
  gap: 10px;
}

.help-list article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.help-list span {
  color: var(--muted);
  line-height: 1.45;
  font-size: .9rem;
}


/* Keyboard-safe mobile modal upgrade v2.2
   Form utama dibuat fullscreen pada layar kecil agar tidak tertutup keyboard. */
body.modal-open {
  overflow: hidden;
}

body.input-active .bottom-nav {
  transform: translate(-50%, 130%);
  pointer-events: none;
}

.modal-backdrop.keyboard-safe {
  align-items: center;
}

.modal-card form {
  scroll-margin-bottom: 180px;
}

@media (max-width: 680px) {
  .modal-backdrop.keyboard-safe {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }

  .modal-backdrop.keyboard-safe .modal-card {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    padding: 14px 16px calc(190px + var(--safe-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: modalIn 0.18s ease both;
    box-shadow: none;
  }

  .modal-backdrop.keyboard-safe .modal-card.tall {
    max-height: 100dvh;
  }

  .modal-backdrop.keyboard-safe .modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -14px -16px 12px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px;
    background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
  }

  [data-theme="dark"] .modal-backdrop.keyboard-safe .modal-head {
    background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
  }

  .modal-backdrop.keyboard-safe form,
  .modal-backdrop.keyboard-safe .help-content {
    padding-bottom: calc(120px + var(--safe-bottom));
  }

  .modal-backdrop.keyboard-safe input,
  .modal-backdrop.keyboard-safe select,
  .modal-backdrop.keyboard-safe textarea {
    font-size: 16px;
    scroll-margin-top: 96px;
    scroll-margin-bottom: 220px;
  }

  .modal-backdrop.keyboard-safe .primary-btn.full[type="submit"] {
    margin-top: 18px;
    margin-bottom: 42px;
  }

  .modal-backdrop.keyboard-safe .check-grid {
    grid-template-columns: 1fr;
  }
}

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

/* Upgrade v2.3: compact split mode + OCR receipt scanner */
.head-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.soft-btn.small,
.primary-btn.small {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 16px;
  font-size: 0.86rem;
}

.compact-mode-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.compact-mode-grid .mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 12px 7px;
  border-radius: 22px;
  text-align: center;
}

.compact-mode-grid .mode-card span {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  border-radius: 16px;
  font-size: 1.14rem;
}

.compact-mode-grid .mode-card strong {
  font-size: 0.78rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.compact-mode-grid .mode-card small {
  display: none;
}

.mode-caption {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(124, 58, 237, 0.08);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.modal-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.ocr-box,
.ocr-review,
.raw-ocr-wrap {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.54);
}

[data-theme="dark"] .ocr-box,
[data-theme="dark"] .ocr-review,
[data-theme="dark"] .raw-ocr-wrap {
  background: rgba(15, 23, 42, 0.56);
}

.upload-card {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 140px;
  padding: 18px;
  border: 1px dashed rgba(124, 58, 237, 0.42);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.10), rgba(14, 165, 233, 0.08));
  text-align: center;
  cursor: pointer;
}

.upload-card span {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(124, 58, 237, 0.14);
  font-size: 1.5rem;
}

.upload-card small {
  color: var(--muted);
  line-height: 1.4;
}


.receipt-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  line-height: 1.25;
}

.file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.receipt-preview {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.ocr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.ocr-actions .danger-soft {
  grid-column: 1 / -1;
}

.ocr-progress {
  padding: 11px 12px;
  border-radius: 16px;
  background: rgba(14, 165, 233, 0.10);
  color: var(--primary-strong);
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.4;
}

.ocr-list {
  display: grid;
  gap: 10px;
}

.ocr-item-row {
  display: grid;
  grid-template-columns: 1fr 96px 64px 38px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.ocr-item-row label {
  margin: 0;
  gap: 5px;
  font-size: 0.72rem;
}

.ocr-item-row input {
  min-height: 42px;
  border-radius: 14px;
  padding: 0 10px;
}

.ocr-remove {
  min-height: 42px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.10);
  color: var(--danger);
  font-weight: 900;
}

.ocr-empty {
  min-height: 110px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 16px;
  line-height: 1.45;
}

.ocr-charges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ocr-charge-chip,
.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

[data-theme="dark"] .ocr-charge-chip,
[data-theme="dark"] .mini-check {
  background: rgba(15, 23, 42, 0.64);
}

.mini-check input {
  width: auto;
  accent-color: var(--primary);
}

.raw-ocr-wrap summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--text);
}

.raw-ocr-wrap textarea {
  margin-top: 12px;
  min-height: 170px;
  resize: vertical;
  line-height: 1.5;
}

@media (max-width: 390px) {
  .compact-mode-grid {
    gap: 7px;
  }

  .compact-mode-grid .mode-card {
    min-height: 90px;
    padding: 10px 5px;
  }

  .compact-mode-grid .mode-card span {
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
  }

  .compact-mode-grid .mode-card strong {
    font-size: 0.72rem;
  }

  .ocr-item-row {
    grid-template-columns: 1fr 88px;
  }

  .ocr-item-row label:first-child {
    grid-column: 1 / -1;
  }

  .ocr-remove {
    align-self: end;
  }
}
