:root { color-scheme: light; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f5f7;
  color: #1a1a1a;
  min-height: 100vh;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px 48px; }
header { text-align: center; margin-bottom: 18px; }
h1 { font-size: 22px; margin: 6px 0 4px; }
h2 { font-size: 18px; margin: 20px 0 6px; }
.subtitle { color: #666; font-size: 14px; margin: 0; }
.hint { color: #666; font-size: 13px; margin: 4px 0 12px; }
.or-line { text-align: center; margin: 16px 0 10px; }
.hidden { display: none !important; }

/* Buttons */
.big-btn {
  width: 100%;
  padding: 18px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: #2563eb;
  border: none;
  border-radius: 12px;
  margin-top: 12px;
  cursor: pointer;
}
.big-btn:active { transform: translateY(1px); }
.big-btn.camera { background: #059669; font-size: 20px; }
.big-btn.library { background: #6b7280; }
.big-btn.file { background: #2563eb; margin-top: 18px; }
.big-btn:disabled { opacity: 0.5; cursor: default; }

/* Status banners */
.status { padding: 0; margin-top: 12px; font-size: 15px; }
.status.show { padding: 12px 14px; border-radius: 10px; }
.status.info { background: #e0edff; color: #1e40af; }
.status.ok   { background: #d1fae5; color: #065f46; }
.status.warn { background: #fef3c7; color: #7a5b00; }
.status.err  { background: #fee2e2; color: #991b1b; }

/* Inputs */
label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 5px; }
input[type=text], input[type=number], input[type=date], select {
  width: 100%; padding: 13px; font-size: 17px; border: 1px solid #ccc;
  border-radius: 10px; background: #fff; font-family: inherit;
}
.two-col { display: flex; gap: 10px; }
.two-col > div { flex: 1; }

.link-btn {
  background: none; border: none; color: #2563eb; font-size: 14px;
  cursor: pointer; padding: 6px; font-family: inherit;
}

/* Trip setup — existing trip chips */
#trip-list { display: flex; flex-direction: column; gap: 8px; }
.trip-chip {
  display: flex; flex-direction: column; align-items: flex-start;
  width: 100%; text-align: left; padding: 12px 14px;
  background: #fff; border: 1px solid #d7dbe0; border-radius: 12px;
  cursor: pointer; font-family: inherit;
}
.trip-chip:active { background: #f0f4ff; }
.trip-chip-name { font-weight: 700; font-size: 16px; color: #1a1a1a; }
.trip-chip-sub { font-size: 13px; color: #666; margin-top: 2px; }

/* Current-trip banner */
.trip-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; background: #1f4e78; color: #fff;
  border-radius: 12px; padding: 12px 16px; margin-bottom: 16px;
}
.trip-banner-name { font-weight: 700; font-size: 17px; }
.trip-banner-sub { font-size: 13px; opacity: 0.85; margin-top: 2px; }
.trip-banner .link-btn { color: #cfe0ff; flex: none; }
.trip-banner-actions {
  display: flex; flex-direction: column; align-items: flex-end; flex: none;
}
.trip-banner-actions .link-btn { padding: 3px 0; text-align: right; }
#rebuildBtn { font-size: 13px; opacity: 0.85; }
#rebuildBtn:disabled { opacity: 0.4; cursor: default; }

/* Passcode page (cloud copy only) */
.login-box { display: flex; flex-direction: column; gap: 12px; }
.login-input {
  width: 100%; padding: 14px; font-size: 17px; border: 1px solid #c8ccd2;
  border-radius: 10px; background: #fff; font-family: inherit;
  text-align: center; letter-spacing: 2px;
}

/* Receipt review cards */
.card {
  background: #fff;
  border: 1px solid #e2e4e8;
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card.filed { opacity: 0.55; }
.card-top { display: flex; align-items: center; gap: 12px; }
.card-top-main { flex: 1; }
.card-thumb {
  width: 76px; height: 76px; object-fit: cover; border-radius: 10px;
  border: 1px solid #ddd; background: #fafafa; flex: none;
}
.card-thumb-doc {
  width: 76px; height: 76px; border-radius: 10px; border: 1px solid #ddd;
  background: #fafafa; display: flex; align-items: center; justify-content: center;
  font-size: 34px; flex: none;
}
.card-top-actions { margin-left: auto; }

/* Itemized entry lines */
.entries { display: flex; flex-direction: column; gap: 12px; }
.entry { display: flex; flex-direction: column; gap: 5px; }
.entry-row {
  display: grid;
  grid-template-columns: 1.15fr 1.4fr 0.9fr auto;
  gap: 6px; align-items: center;
}
.entry-row select, .entry-row input { padding: 10px; font-size: 15px; }

/* Currency row (per receipt) */
.currency-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.currency-row .rcpt-currency { width: 80px; text-transform: uppercase; text-align: center; }
.currency-row .rcpt-rate { width: 110px; }
.currency-x, .currency-eq { color: #666; font-size: 14px; white-space: nowrap; }
.rate-note { margin: 6px 0 0; }

/* Per-entry USD conversion line */
.entry-usd {
  margin-top: 6px; font-size: 13px; color: #1e3a5f;
  background: #eef4fb; border: 1px solid #cfe0f2; border-radius: 8px; padding: 7px 10px;
}
.entry-usd strong { color: #065f46; }

/* Alcohol exclusion block — only shown on Meal lines */
.entry-alcohol {
  background: #fdf2f2; border: 1px solid #f3c6c6; border-radius: 10px;
  padding: 10px 12px; font-size: 13px;
}
.alcohol-head { color: #991b1b; margin-bottom: 8px; }
.alcohol-items { display: flex; flex-direction: column; gap: 6px; }
.alcohol-item {
  display: grid; grid-template-columns: 1fr 0.5fr auto; gap: 6px; align-items: center;
}
.alcohol-item input { padding: 8px; font-size: 15px; border: 1px solid #e0b4b4; border-radius: 8px; background: #fff; }
.alcohol-remove {
  background: #fff; border: 1px solid #e0b4b4; border-radius: 8px;
  color: #991b1b; font-size: 14px; padding: 8px 10px; cursor: pointer;
}
.add-alcohol { color: #991b1b; margin-top: 6px; display: inline-block; }
.alcohol-math { margin-top: 8px; color: #333; }
.alcohol-math strong { color: #065f46; }

/* "# people" split control — only shown on Meal lines */
.entry-split {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 2px 2px 2px; font-size: 13px; color: #555;
}
.split-label { white-space: nowrap; }
.people-btns { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.people-btn {
  min-width: 40px; padding: 8px 11px; font-size: 15px; font-family: inherit;
  border: 1px solid #ccc; border-radius: 9px; background: #fff; color: #1a1a1a;
  cursor: pointer;
}
.people-btn:active { transform: translateY(1px); }
.people-btn.active { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 700; }
.entry-people-other {
  width: 66px; padding: 8px; font-size: 15px; text-align: center;
  border: 1px solid #ccc; border-radius: 9px;
}
.split-share { color: #065f46; font-weight: 600; white-space: nowrap; }
.entry-remove {
  background: #f3f4f6; border: 1px solid #e2e4e8; border-radius: 8px;
  color: #991b1b; font-size: 15px; padding: 8px 10px; cursor: pointer;
}
.add-entry { margin-top: 8px; display: inline-block; }

.card-status { margin-top: 10px; font-size: 14px; }
.card-status.show { padding: 10px 12px; border-radius: 8px; }

.filed-log { background: #fff; border: 1px solid #e2e4e8; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.filed-log ul { margin: 8px 0 0; padding-left: 20px; font-size: 14px; }
.filed-log li { margin: 3px 0; }
