/* app.css - the simplified signed-in app: menu, phone tab bar, dashboard.
   Loaded after style.css, so it only adds and overrides. */

/* ---- Top menu ------------------------------------------------------------ */
.navlinks a.nav-scan {
  background: var(--mint, #7ff0dc); color: var(--deep, #083f3a);
  font-weight: 700; margin-left: 8px; padding-left: 14px; padding-right: 14px;
}
.navlinks a.nav-scan:hover,
.navlinks a.nav-scan.active { background: #a6f5e7; color: var(--deep, #083f3a); }

/* ---- Phone tab bar --------------------------------------------------------- */
.tabbar { display: none; }

@media (max-width: 700px) {
  .topnav .navlinks { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: #fff; border-top: 1px solid var(--border, #e1e8e6);
    padding: 8px 6px calc(10px + env(safe-area-inset-bottom));
    justify-content: space-around; align-items: flex-end;
    box-shadow: 0 -6px 20px -14px rgba(15, 26, 23, .25);
  }
  .tabbar .tab {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
    width: 64px; font: 600 11.5px var(--font-body); color: var(--ink-muted, #7a8a86);
    text-decoration: none;
  }
  .tabbar .tab.on { color: var(--brand, #0f8177); }
  .tab-ico { font-size: 19px; line-height: 1.2; }
  .tab-dot {
    position: absolute; top: 0; right: 14px; width: 8px; height: 8px;
    border-radius: 50%; background: #f59e0b;
  }
  .tabbar .tab-scan {
    width: 60px; height: 52px; margin-top: -24px; border-radius: 16px;
    display: grid; place-items: center; font-size: 24px; text-decoration: none;
    background: var(--brand, #0f8177); color: #fff;
    box-shadow: 0 8px 20px -8px rgba(15, 129, 119, .7);
  }
  body.has-tabbar .page { padding-bottom: 96px; }
  /* With the links moved to the tab bar, there's room for the name again. */
  .topnav .brand span:not(.brand-mark) { display: inline !important; }
  body.has-tabbar .site-footer { padding-bottom: 96px; }
}

/* ---- Dashboard ------------------------------------------------------------- */
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.home-head h1 { margin: 0; }
.year-pills { display: flex; flex-wrap: wrap; gap: 2px; background: #fff; border: 1px solid var(--border, #e1e8e6); border-radius: 999px; padding: 3px; }
.year-pills a {
  font: 600 13px var(--font-body); padding: 6px 12px; border-radius: 999px;
  color: var(--ink-secondary, #4d5c58); text-decoration: none;
}
.year-pills a.on { background: var(--deep, #083f3a); color: #fff; }

.scan-hero {
  display: flex; align-items: center; gap: 24px; margin-bottom: 14px;
  padding: 26px 28px; border-radius: 16px; color: #fff;
  background: linear-gradient(140deg, var(--brand, #0f8177), var(--deep, #083f3a));
}
.scan-hero h2 { font: 800 22px var(--font-display); margin: 0 0 6px; color: #fff; letter-spacing: -.015em; }
.scan-hero p { margin: 0; color: var(--on-dark, #cfe9e4); font-size: 14.5px; }
.scan-hero p a { color: var(--mint, #7ff0dc); font-weight: 600; }
.scan-hero-go { margin-left: auto; display: flex; gap: 10px; flex-shrink: 0; }
.scan-hero form.scan-hero-go { margin: 0 0 0 auto; }
.scan-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 700 15px var(--font-body); padding: 13px 20px; border-radius: 12px;
  white-space: nowrap; border: 1px solid transparent; text-decoration: none;
  /* These are <label>s (they wrap the file inputs), so undo the form-label look. */
  text-transform: none; letter-spacing: 0; margin: 0; line-height: 1.2;
}
.scan-btn-mint { background: var(--mint, #7ff0dc); color: var(--deep, #083f3a); }
.scan-btn-mint:hover { background: #a6f5e7; }
.scan-btn-ghost { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .28); }
.scan-btn-ghost:hover { background: rgba(255, 255, 255, .18); }
.scan-hero input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.scan-hero.is-busy .scan-hero-go { opacity: .6; pointer-events: none; }
.scan-busy { display: none; margin-top: 10px; font-weight: 600; color: var(--mint, #7ff0dc); }
.scan-hero.is-busy .scan-busy { display: block; }

.status-line {
  display: flex; align-items: center; gap: 10px; border-radius: 12px;
  padding: 11px 16px; font-size: 14px; margin-bottom: 14px; text-decoration: none;
}
.status-ok { background: #eaf7ea; border: 1px solid #cfe9cf; color: #165c16; }
.status-todo { background: #fef6ec; border: 1px solid #f6dcb6; color: #8a4508; }
.status-todo:hover { background: #fdeed9; }
.status-line b { font-weight: 700; }
.status-line .go { margin-left: auto; font-weight: 700; }

.home-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.home-nums.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-nums > .card.home-num { margin: 0; padding: 20px 22px; }
.home-num-lab { font: 600 12px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted, #7a8a86); }
.home-num-val { font: 800 32px var(--font-display); margin: 6px 0 2px; letter-spacing: -.02em; color: var(--ink, #0f1a17); }
.home-num-note { font-size: 13.5px; color: var(--ink-secondary, #4d5c58); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 14px; margin-bottom: 14px; }
.home-grid > .card { margin: 0; min-width: 0; }
.home-card-title { font: 700 16px var(--font-display); margin: 0 0 12px; display: flex; justify-content: space-between; align-items: center; }
.home-card-title a { font: 600 13.5px var(--font-body); color: var(--brand, #0f8177); }

.rcpt { display: flex; align-items: center; gap: 13px; padding: 11px 0; border-top: 1px solid var(--border, #e1e8e6); color: inherit; text-decoration: none; }
.rcpt:first-of-type { border-top: 0; }
.rcpt:hover .rcpt-vendor { color: var(--brand, #0f8177); }
.rcpt-thumb {
  width: 42px; height: 52px; border-radius: 7px; flex-shrink: 0; overflow: hidden;
  border: 1px solid var(--border, #e1e8e6); background: #f6f8f7;
  display: grid; place-items: center; font-size: 18px;
}
.rcpt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rcpt-main { min-width: 0; flex: 1; }
.rcpt-vendor { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcpt-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-secondary, #4d5c58); margin-top: 3px; }
.rcpt-meta .flag { color: #b45309; font-weight: 600; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rcpt-amt { margin-left: auto; font: 700 15px var(--font-display); white-space: nowrap; padding-left: 8px; }

.cat-row { margin-bottom: 12px; }
.cat-row-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.cat-row-top b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-bar { height: 8px; background: var(--viz-track, #e8edeb); border-radius: 99px; overflow: hidden; }
.cat-bar i { display: block; height: 100%; border-radius: 99px; }
.home-explain summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand, #0f8177); margin-top: 4px; }
.home-explain p { font-size: 13px; color: var(--ink-secondary, #4d5c58); margin: 8px 0 0; line-height: 1.55; }

.send-accountant { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.send-accountant-title { font: 700 18px var(--font-display); color: var(--ink, #0f1a17); }
.send-accountant-sub { display: block; font-size: 13.5px; color: var(--ink-secondary, #4d5c58); margin-top: 3px; }

.home-empty { text-align: center; padding: 28px 20px; color: var(--ink-secondary, #4d5c58); }

/* First-run checklist */
.checklist { padding: 20px 22px; margin-bottom: 14px; }
.checklist h2 { font: 700 17px var(--font-display); margin: 0 0 12px; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border, #e1e8e6); color: inherit; text-decoration: none; }
.check-item:first-of-type { border-top: 0; }
.check-box {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  border: 2px solid var(--border-strong, #cbd6d3); font-size: 13px; font-weight: 800; color: #fff;
}
.check-item.done .check-box { background: var(--brand, #0f8177); border-color: var(--brand, #0f8177); }
.check-item.done .check-text { color: var(--ink-muted, #7a8a86); text-decoration: line-through; }
.check-text { font-weight: 600; font-size: 15px; }
.check-item .go { margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--brand, #0f8177); }

@media (max-width: 760px) {
  .scan-hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .scan-hero form.scan-hero-go { margin: 16px 0 0; width: 100%; }
  .scan-hero-go > * { flex: 1; }
  .scan-hero-go .scan-btn { width: 100%; justify-content: center; }
  .home-nums, .home-nums.three { gap: 10px; }
  .home-nums.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-nums > .card.home-num { padding: 16px; }
  .home-num-val { font-size: 26px; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .send-accountant .btn { width: 100%; text-align: center; }
}

/* ---- Settings: owner tools ------------------------------------------------- */
.settings-group-owner .sgroup-title::after {
  content: "Only you"; margin-left: 8px; font: 600 11px var(--font-body); padding: 2px 8px;
  border-radius: 999px; background: var(--brand-tint, #e6f4f2); color: var(--brand-ink, #0a4a45); vertical-align: 2px;
}

/* ---- Scan page -------------------------------------------------------------- */
.scan-panel { padding: 18px; }
.scan-drop { display: grid; gap: 12px; border-radius: 14px; }
.scan-drop.is-dragging { outline: 3px dashed var(--brand, #0f8177); outline-offset: 6px; }
.scan-big {
  position: relative; display: flex; align-items: center; gap: 16px; cursor: pointer;
  padding: 20px 22px; border-radius: 14px; margin: 0;
  text-transform: none; letter-spacing: 0; font: inherit; color: inherit;
}
.scan-big input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.scan-big-photo { background: linear-gradient(140deg, var(--brand, #0f8177), var(--deep, #083f3a)); color: #fff; }
.scan-big-photo:hover { filter: brightness(1.06); }
.scan-big-files { background: #fff; border: 2px dashed var(--border-strong, #cbd6d3); }
.scan-big-files:hover { border-color: var(--brand, #0f8177); background: var(--brand-tint, #e6f4f2); }
.scan-big-ico { font-size: 30px; line-height: 1; }
.scan-big-text { display: flex; flex-direction: column; font: 700 18px var(--font-display); }
.scan-big-text small { font: 400 13.5px var(--font-body); opacity: .8; margin-top: 3px; }
.scan-status { margin: 12px 2px 0; font-weight: 600; color: var(--brand, #0f8177); min-height: 1px; }
.scan-panel.is-busy .scan-drop { opacity: .5; pointer-events: none; }
.scan-panel.is-busy .scan-status::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sb-spin .8s linear infinite;
}
@keyframes sb-spin { to { transform: rotate(360deg); } }
.scan-tips { margin-top: 14px; font-size: 14px; color: var(--ink-secondary, #4d5c58); line-height: 1.6; }
.scan-tips p { margin: 0 0 8px; }
@media (hover: none) { .desk-only { display: none; } }

/* ---- Receipts list ----------------------------------------------------------- */
.rx-search { margin-bottom: 14px; }
.rx-search-row { display: flex; gap: 8px; }
.rx-search-row input { flex: 1; margin: 0; }
.rx-search-row .btn { margin: 0; }
.rx-filters { margin-top: 8px; }
.rx-filters summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--brand, #0f8177); }
.rx-filter-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 12px; margin-top: 10px; }
.rx-filter-actions { display: flex; gap: 8px; }
.rx-list { padding: 4px 18px; }
.rx { border-top: 1px solid var(--border, #e1e8e6); }
.rx:first-child { border-top: 0; }
.rx-main { display: flex; align-items: center; gap: 13px; padding: 12px 0; color: inherit; text-decoration: none; }
.rx-main:hover .rcpt-vendor { color: var(--brand, #0f8177); }
.rx-vat { display: block; font-size: 12.5px; color: var(--ink-muted, #7a8a86); margin-top: 2px; }
.rx-amt { margin-left: auto; text-align: right; font: 700 15.5px var(--font-display); white-space: nowrap; padding-left: 8px; }
.rx-amt small { display: block; font: 400 12px var(--font-body); color: var(--ink-muted, #7a8a86); }
.rx-check-bar {
  display: flex; align-items: center; gap: 12px; margin: -2px 0 12px; padding: 10px 12px;
  border-radius: 10px; background: #fef6ec; border: 1px solid #f6dcb6;
}
.rx-check-text { flex: 1; font-size: 13.5px; color: #7c3a06; line-height: 1.45; }
.rx-check-bar form { margin: 0; flex-shrink: 0; }
.rx-check-bar .btn { margin: 0; }
.rx-note { margin: -4px 0 10px 55px; font-size: 13px; color: var(--ink-secondary, #4d5c58); }
.rx-note summary { cursor: pointer; color: var(--ink-muted, #7a8a86); }
.rx-note p { margin: 6px 0 0; }

/* ---- Just scanned (review) ---------------------------------------------------- */
.rv-list > .card.rv { margin: 0 0 12px; padding: 16px; }
.rv-top { display: flex; gap: 14px; }
.rv-thumb {
  width: 76px; height: 96px; flex-shrink: 0; border-radius: 9px; overflow: hidden; display: grid; place-items: center;
  border: 1px solid var(--border, #e1e8e6); background: #f6f8f7; font-size: 26px; text-decoration: none;
}
.rv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rv-body { flex: 1; min-width: 0; }
.rv-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rv-vendor { font: 700 17px var(--font-display); }
.rv-amt { font: 800 19px var(--font-display); white-space: nowrap; }
.rv-sub { font-size: 13.5px; color: var(--ink-secondary, #4d5c58); margin-top: 3px; }
.rv-cat { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 13.5px; font-weight: 600;
  background: var(--brand-tint, #e6f4f2); color: var(--brand-ink, #0a4a45); padding: 5px 10px; border-radius: 999px; }
.rv-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fef6ec; border: 1px solid #f6dcb6; color: #7c3a06; font-size: 13.5px; line-height: 1.45; }
.rv-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.rv-actions form { margin: 0; }
.rv-actions .btn { margin: 0; }
.rv-ok { font-weight: 700; color: #165c16; margin-right: auto; }
.rv-done { background: #f7fbf7; }
.rv-done .rv-top { opacity: .75; }
.rv-done-bar { margin-top: 6px; }

/* ---- Check receipt (edit) ------------------------------------------------------ */
.edit-scan {
  position: relative; display: block; margin-bottom: 14px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border, #e1e8e6); background: #fff; text-decoration: none; color: var(--brand, #0f8177);
}
.edit-scan img { display: block; width: 100%; max-height: 260px; object-fit: cover; object-position: top; }
.edit-scan > span { display: block; padding: 14px 16px; font-weight: 600; }
.edit-scan .edit-scan-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; font-size: 13px;
  background: linear-gradient(transparent, rgba(8, 63, 58, .75)); color: #fff;
}
.edit-scan-none { display: none; }

@media (max-width: 640px) {
  .rx-filter-grid { grid-template-columns: 1fr; }
  .rx-list { padding: 2px 14px; }
  .rx-check-bar { flex-direction: column; align-items: stretch; }
  .rx-check-bar .btn { width: 100%; }
  .rv-actions > * { flex: 1; }
  .rv-actions .btn { width: 100%; text-align: center; }
}

/* ---- "Before you send this" (exports for an accountant or tax software) ---- */
.handover-dlg {
  border: 0; border-radius: 18px; padding: 26px 26px 22px; width: min(480px, calc(100vw - 32px));
  box-shadow: 0 30px 60px -20px rgba(8, 63, 58, .45); color: var(--ink, #0f1a17);
}
.handover-dlg::backdrop { background: rgba(8, 63, 58, .45); }
.handover-dlg h2 { font: 800 21px var(--font-display); margin: 0 0 12px; }
.handover-dlg p { font-size: 15px; line-height: 1.6; color: var(--ink-secondary, #4d5c58); margin: 0 0 12px; }
.handover-dlg p b { color: var(--ink, #0f1a17); }
.handover-skip {
  display: flex; align-items: center; gap: 8px; margin: 4px 0 18px; font-size: 13.5px;
  text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-secondary, #4d5c58);
}
.handover-skip input { width: auto; margin: 0; }
.handover-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.handover-btns .btn { margin: 0; }
@media (max-width: 480px) { .handover-btns .btn { flex: 1; text-align: center; } }

/* ---- Settings: each section folds away ------------------------------------- */
.sgroup { margin-bottom: 12px; }
.sgroup-head {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--border, #e1e8e6); border-radius: 14px;
  padding: 16px 18px; box-shadow: var(--shadow);
}
.sgroup-head::-webkit-details-marker { display: none; }
.sgroup-head:hover { border-color: var(--border-strong, #cbd6d3); }
.sgroup-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; background: var(--brand-tint, #e6f4f2); flex-shrink: 0; }
.sgroup-text { display: flex; flex-direction: column; min-width: 0; }
.sgroup-title { font: 700 16.5px var(--font-display); color: var(--ink, #0f1a17); }
.sgroup-sub { font-size: 13px; color: var(--ink-muted, #7a8a86); margin-top: 2px; }
.sgroup-chev {
  margin-left: auto; width: 10px; height: 10px; flex-shrink: 0;
  border-right: 2px solid var(--ink-muted, #7a8a86); border-bottom: 2px solid var(--ink-muted, #7a8a86);
  transform: rotate(45deg); transition: transform .2s ease; margin-right: 4px;
}
.sgroup[open] > .sgroup-head .sgroup-chev { transform: rotate(-135deg); }
.sgroup[open] > .sgroup-head { border-radius: 14px 14px 0 0; border-bottom-color: transparent; box-shadow: none; }
.sgroup > .settings-rows { margin-top: -1px; border-top-left-radius: 0; border-top-right-radius: 0; }

/* ---- Receipts / Invoices switch -------------------------------------------- */
.rx-tabs { display: inline-flex; background: #fff; border: 1px solid var(--border, #e1e8e6); border-radius: 999px; padding: 3px; margin: 0 0 16px; }
.rx-tabs a { font: 600 14px var(--font-body); padding: 7px 16px; border-radius: 999px; color: var(--ink-secondary, #4d5c58); text-decoration: none; }
.rx-tabs a.on { background: var(--deep, #083f3a); color: #fff; }

/* Receipts: the running total */
.rx-total {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: -6px 0 16px;
  padding: 16px 20px; border-radius: 14px; color: #fff;
  background: linear-gradient(140deg, var(--brand, #0f8177), var(--deep, #083f3a));
}
.rx-total-amt { font: 800 30px/1.1 var(--font-display); letter-spacing: -.02em; }
.rx-total-lab { font-size: 14.5px; color: var(--on-dark, #cfe9e4); }
.rx-total-lab b { color: #fff; font-weight: 700; }
@media (max-width: 640px) { .rx-total-amt { font-size: 26px; } }

/* ---- Invoice: send / download / paid ---------------------------------------- */
.inv-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 6px; }
.inv-actions form { margin: 0; display: contents; }
.inv-act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 84px; padding: 12px 10px; border-radius: 14px; cursor: pointer; text-decoration: none;
  font: 700 15px var(--font-body); color: var(--ink, #0f1a17); text-align: center;
  background: #fff; border: 1px solid var(--border, #e1e8e6); box-shadow: var(--shadow); margin: 0; width: 100%;
}
.inv-act:hover { border-color: var(--brand, #0f8177); }
.inv-act-ico { font-size: 22px; line-height: 1; }
.inv-act-send { background: linear-gradient(140deg, var(--brand, #0f8177), var(--deep, #083f3a)); color: #fff; border: 0; }
.inv-act-send:hover { filter: brightness(1.06); }
.inv-act-pay { background: #eaf7ea; border-color: #cfe9cf; color: #165c16; }
.inv-act-paid { background: #eaf7ea; border-color: #cfe9cf; color: #165c16; cursor: default; }
.inv-act-paid .inv-act-ico { font-weight: 800; }
.inv-act[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.inv-act-msg { min-height: 1px; margin: 4px 2px 14px; font-size: 14px; font-weight: 600; color: var(--brand, #0f8177); }
.inv-undo { margin: -8px 2px 14px; }
.inv-undo .linklike { font-size: 13px; }
.inv-pill { display: inline-block; font: 700 12px var(--font-body); padding: 2px 9px; border-radius: 999px; vertical-align: 1px; }
.inv-pill-draft { background: #eef2f1; color: #4d5c58; }
.inv-pill-sent { background: #e7efff; color: #2a4fa8; }
.inv-pill-paid { background: #eaf7ea; color: #165c16; }
@media (max-width: 480px) {
  .inv-act { min-height: 76px; font-size: 13.5px; padding: 10px 6px; }
  .inv-act-ico { font-size: 20px; }
}

/* Log out: quiet link in the top menu, a full-width button at the foot of Settings */
.navlinks a.nav-logout { opacity: .75; font-weight: 500; }
.navlinks a.nav-logout:hover { opacity: 1; }
.settings-logout { margin: 6px 0 14px; }

/* Delete straight from a list: quiet red outline, so it isn't the obvious tap */
.btn.btn-delete { background: #fff; color: #b42318; border: 1px solid #f0c5c0; box-shadow: none; }
.btn.btn-delete:hover { background: #fdf2f2; border-color: #d03b3b; }
.rx-check-btns { display: flex; gap: 8px; flex-shrink: 0; }
.rx-check-btns form { margin: 0; }
@media (max-width: 640px) {
  .rx-check-btns { width: 100%; }
  .rx-check-btns form:first-child { flex: 2; }
  .rx-check-btns form:last-child { flex: 1; }
  .rx-check-btns .btn { width: 100%; }
}

/* ---- Check receipt: the scan, front and centre ------------------------------ */
.scan-card {
  background: #fff; border: 1px solid var(--border, #e1e8e6); border-radius: 16px;
  box-shadow: var(--shadow); padding: 12px; margin-bottom: 14px;
}
.scan-card-img {
  display: block; border-radius: 10px; overflow: hidden; background: #eef2f1;
}
.scan-card-img img { display: block; width: 100%; max-height: 460px; object-fit: contain; background: #eef2f1; }
.scan-card-file {
  display: flex; align-items: center; gap: 14px; padding: 18px 16px; border-radius: 10px;
  background: var(--brand-tint, #e6f4f2); color: var(--ink, #0f1a17); text-decoration: none;
}
.scan-card-ico { font-size: 40px; line-height: 1; }
.scan-card-name { display: flex; flex-direction: column; font: 700 16px var(--font-display); word-break: break-word; }
.scan-card-name small { font: 400 13px var(--font-body); color: var(--ink-secondary, #4d5c58); margin-top: 3px; }
.scan-card-btn { display: block; width: 100%; text-align: center; margin: 10px 0 0; }
.scan-card-missing .scan-card-img { display: none; }

/* ---- Home: hello, green card, four shortcuts ------------------------------ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.hm-hello { min-width: 0; }
.hm-hello span { font-size: 14px; color: var(--ink-secondary, #4d5c58); }
.hm-hello h1 { margin: 2px 0 0; font: 800 26px var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.hm-year { position: relative; flex-shrink: 0; margin-top: 4px; }
.hm-year select {
  appearance: none; -webkit-appearance: none; margin: 0; width: auto;
  font: 600 13px var(--font-body); color: var(--ink, #0f1a17);
  background: #fff; border: 1px solid var(--border, #e1e8e6); border-radius: 999px;
  padding: 8px 30px 8px 14px; cursor: pointer;
}
.hm-year::after { content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; pointer-events: none; color: var(--ink-secondary, #4d5c58); }

.hm-card {
  position: relative; overflow: hidden; color: #fff; border-radius: 24px; padding: 22px; margin-bottom: 16px;
  background: radial-gradient(120% 90% at 100% 0%, #14a596 0%, #0d6b62 45%, #073630 100%);
  box-shadow: 0 10px 28px rgba(8, 63, 58, .18);
}
.hm-card::after { content: ""; position: absolute; right: -45px; top: -45px; width: 160px; height: 160px; border-radius: 50%; background: rgba(127, 240, 220, .12); pointer-events: none; }
.hm-chip { display: inline-block; font: 600 12px var(--font-body); background: rgba(255, 255, 255, .14); padding: 5px 11px; border-radius: 999px; }
.hm-lab { font-size: 14px; opacity: .82; margin-top: 14px; }
.hm-big { font: 800 42px var(--font-display); letter-spacing: -.025em; margin: 2px 0 14px; line-height: 1.1; }
.hm-chart { display: flex; align-items: flex-end; gap: 6px; height: 64px; margin-bottom: 4px; }
.hm-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.hm-col i { display: block; width: 100%; max-width: 44px; border-radius: 6px 6px 3px 3px; background: rgba(127, 240, 220, .42); }
.hm-col i.now { background: var(--mint, #7ff0dc); }
.hm-col small { font-size: 10.5px; opacity: .75; }
.hm-pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.hm-pills div { background: rgba(255, 255, 255, .1); border-radius: 14px; padding: 11px 13px; }
.hm-pills small { display: block; font-size: 12px; opacity: .78; }
.hm-pills b { font: 800 20px var(--font-display); }
.hm-welcome h2 { margin: 0 0 6px; font: 800 22px var(--font-display); color: #fff; }
.hm-welcome p { margin: 0; font-size: 14.5px; color: var(--on-dark, #cfe9e4); }

.hm-acts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; margin: 0 0 16px; text-align: center; }
.hm-act { display: flex; flex-direction: column; align-items: center; gap: 6px; font: 600 12.5px var(--font-body); color: var(--ink-secondary, #4d5c58); text-decoration: none; cursor: pointer; margin: 0; }
.hm-act-ico { width: 60px; height: 60px; border-radius: 19px; background: #fff; display: grid; place-items: center; font-size: 24px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); transition: transform .12s; }
.hm-act-main .hm-act-ico { background: var(--mint, #7ff0dc); }
.hm-act:hover .hm-act-ico { transform: translateY(-2px); }
.hm-act input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.hm-busy { grid-column: 1 / -1; grid-row: 2; margin: 0; font-size: 14px; font-weight: 600; color: var(--brand, #0f8177); }
.hm-busy:empty { display: none; }
.hm-acts.is-busy .hm-act { opacity: .5; pointer-events: none; }

@media (max-width: 760px) {
  .hm-hello h1 { font-size: 23px; }
  .hm-card { padding: 20px; }
  .hm-big { font-size: 38px; }
}

/* ---- Credit notes: money back, shown as a minus ---------------------------- */
.cn-tag {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px;
  font: 700 11px var(--font-body); letter-spacing: .02em; color: #0a6b45; background: #e3f6ec; white-space: nowrap;
}
.is-credit { color: #0a7d4f; }

/* ---- Upload progress (a batch being read in the background) ------------- */
.up-card { text-align: center; padding: 40px 28px 32px; margin-top: 24px; }
.up-title { font: 800 22px var(--font-display, sans-serif); margin: 18px 0 6px; letter-spacing: -.01em; }
.up-count { margin: 0 0 18px; color: var(--ink-secondary, #4d5c58); font-size: 15px; }
.up-count span { font-weight: 700; color: var(--ink, #0f1a17); }
.up-bar { height: 10px; border-radius: 999px; background: var(--brand-tint, #e6f4f2); overflow: hidden; max-width: 420px; margin: 0 auto; }
.up-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand, #0f8177); transition: width .5s ease; min-width: 10px; }
.up-note { margin: 20px auto 0; max-width: 420px; font-size: 13.5px; color: var(--ink-muted, #6b7a76); line-height: 1.55; }
.up-spinner {
  width: 42px; height: 42px; margin: 0 auto; border-radius: 50%;
  border: 4px solid var(--brand-tint, #e6f4f2); border-top-color: var(--brand, #0f8177);
  animation: up-spin .9s linear infinite;
}
@keyframes up-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .up-spinner { animation-duration: 3s; } }
