.mobile-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 18px 0 4px;
  padding: 4px;
  border-radius: 13px;
  background: #dfe9e7;
}

.mobile-tabs button {
  padding: 10px 7px;
  background: transparent;
  color: #385652;
  font-size: 13px;
}

.mobile-tabs button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 2px 8px #1733311a;
}

.cost-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.cost-toolbar .month-label { width: min(100%, 190px); }
.cost-summary { margin-top: 12px; }
.cost-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cost-actions button:last-child { background: #3d7773; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 24px 2px 10px; }
.section-heading h2 { margin: 0; font-size: 19px; }
.section-heading small { color: #617773; }
.form-hint { padding: 10px 12px; border-radius: 10px; background: #fff3cd; color: #725800; font-size: 13px; }
.receipt-picker > span { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 650; }
.receipt-picker > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.upload-button { display: block; width: 100%; margin: 0; padding: 11px 8px; border-radius: 10px; background: var(--brand); color: #fff; text-align: center; cursor: pointer; }
.upload-button.secondary { background: #e7efed; color: #173331; }
.file-input-hidden { position: fixed; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.receipt-preview { display: grid; grid-template-columns: 58px minmax(0,1fr) auto auto; align-items: center; gap: 10px; margin: 10px 0; padding: 9px; border: 1px solid #dce5e3; border-radius: 12px; }
.receipt-preview img { width: 58px; height: 58px; border-radius: 8px; object-fit: cover; background: #edf1f0; }
.receipt-preview span { overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.receipt-preview button { padding: 8px; font-size: 12px; }
.receipt-action { margin-top: 8px; padding: 8px 11px; background: #e7efed; color: #173331; font-size: 13px; }

@media (max-width: 520px) {
  .cost-toolbar { justify-content: stretch; }
  .cost-toolbar .month-label { width: 100%; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .receipt-picker > div { grid-template-columns: 1fr; }
  .receipt-preview { grid-template-columns: 48px minmax(0,1fr); }
  .receipt-preview img { width: 48px; height: 48px; }
  .receipt-preview button { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 380px) {
  .mobile-tabs button { font-size: 12px; }
  .cost-actions { grid-template-columns: 1fr; gap: 7px; }
}

.receipt-viewer { box-sizing: border-box; width: min(1000px,95vw); height: 90dvh; max-height: 95dvh; padding: 16px; border: 0; border-radius: 12px; }
.receipt-viewer h2 { margin: 0 0 12px; font-size: 18px; overflow-wrap: anywhere; }
.receipt-viewer .entry-actions { margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.receipt-viewer iframe { display: block; width: 100%; height: calc(100% - 110px); border: 0; }
.receipt-viewer > img { display: block; max-width: 100%; height: auto; margin: auto; }
