:host {
  display: block;
}

.oe {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #eef2f7;
  color: #0f172a;
  // Leave room for the sticky submit bar + the phone's home-indicator inset.
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

.oe__inner {
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.oe__head {
  margin: 0 -1rem;
  padding: calc(1.25rem + env(safe-area-inset-top)) 1.25rem 1.25rem;
  text-align: center;
  color: #f8fafc;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-radius: 0 0 1.5rem 1.5rem;
  box-shadow: 0 10px 24px -14px rgba(37, 99, 235, 0.7);
}

.oe__eyebrow {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.85);
}

.oe__title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.4rem, 6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.15;

  span {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.9);
    margin-top: 0.2rem;
  }
}

.oe__date {
  margin-top: 0.6rem;
  font-size: 1rem;
  font-weight: 600;
}

.oe__status {
  margin-top: 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.8);

  &.is-on { color: #bbf7d0; }
}

.oe__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #94a3b8;

  .is-on & {
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25);
  }
}

/* ── Today tally ────────────────────────────────────────────────────────── */
.oe__tally {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 6px 18px -14px rgba(15, 23, 42, 0.5);
}

.oe__tally-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

/* The Total item is tappable — open the totals dialog. Reset button chrome so it
   looks identical to the static tally item beside it, just with a pointer + hint. */
.oe__tally-item--btn {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;

  &:active {
    transform: scale(0.97);
  }
}

.oe__tally-hint {
  color: #94a3b8;
  font-weight: 700;
}

/* Proof slot: an icon where the other items show a number. Neutral by default,
   green once a proof PDF is attached so the volunteer can see it's on file. */
.oe__tally-icon {
  color: #64748b;
}

.oe__tally-item--proof.is-attached .oe__tally-icon,
.oe__tally-item--proof.is-attached .oe__tally-label {
  color: #15803d;
}

.oe__tally-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1d4ed8;
  line-height: 1;
}

.oe__tally-label {
  font-size: 0.72rem;
  color: #64748b;
}

.oe__tally-divider {
  width: 1px;
  align-self: stretch;
  background: #e2e8f0;
}

/* ── Form card ──────────────────────────────────────────────────────────── */
.oe__card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1.1rem 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.1rem;
  box-shadow: 0 6px 18px -14px rgba(15, 23, 42, 0.5);
}

.oe__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.oe__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

/* Make every Kendo control fill the row for big, thumb-friendly targets. */
.oe__control {
  width: 100%;
}

.oe__anon {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.oe__anon-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4338ca;
  background: #e0e7ff;
}

.oe__giver-actions {
  margin-top: 0.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Quick-add dialog body: stacked fields, scrollable on short screens. */
.oe__qa {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.25rem 0.1rem;
}

/* ── Totals dialog ──────────────────────────────────────────────────────── */
.oe__totals-loading {
  margin: 0;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.95rem;
  color: #64748b;
}

.oe__totals-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.oe__totals-heading {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.oe__totals-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.oe__totals-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: #0f172a;
}

.oe__totals-name {
  color: #334155;
}

.oe__totals-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.oe__totals-empty {
  font-size: 0.9rem;
  color: #94a3b8;
}

/* Check subtotal: a hairline above to separate it from the per-check rows. */
.oe__totals-row--subtotal {
  margin-top: 0.15rem;
  padding-top: 0.4rem;
  border-top: 1px solid #e2e8f0;
  font-weight: 600;
}

/* Grand total: heavier divider + larger amount, the dialog's bottom line. */
.oe__totals-row--grand {
  margin-top: 0.25rem;
  padding-top: 0.6rem;
  border-top: 2px solid #cbd5e1;
  font-size: 1.05rem;

  .oe__totals-amount {
    color: #1d4ed8;
    font-size: 1.2rem;
  }
}

/* ── Paper proof ────────────────────────────────────────────────────────── */
.oe__proof-hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #475569;
}

/* Two capture entry points side by side (camera + library). */
.oe__proof-actions {
  display: flex;
  gap: 0.6rem;

  button {
    flex: 1;
  }
}

.oe__proof-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.oe__proof-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem;
  background: #f1f4f8;
  border: 1px solid #dbe2ea;
  border-radius: 0.5rem;
  font-size: 0.85rem;
}

.oe__proof-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oe__proof-merge {
  margin: 0;
  font-size: 0.8rem;
  color: #b45309;
}

/* ── Sticky submit bar ──────────────────────────────────────────────────── */
.oe__submit {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(238, 242, 247, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid #dbe2ea;
}

.oe__submit-btn {
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
  display: block;
  min-height: 3.25rem;
  font-size: 1.05rem;
  font-weight: 700;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.oe__toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(5.25rem + env(safe-area-inset-bottom));
  z-index: 30;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f0fdf4;
  background: #16a34a;
  box-shadow: 0 12px 30px -12px rgba(22, 163, 74, 0.7);
  animation: oe-toast-in 0.18s ease-out;
}

@keyframes oe-toast-in {
  from { opacity: 0; transform: translate(-50%, 0.5rem); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
