:root {
  --page: #f4efe6;
  --surface: rgba(255, 252, 246, 0.82);
  --surface-strong: #fffaf3;
  --ink: #203129;
  --muted: #6d7b73;
  --accent: #1e7b68;
  --accent-soft: rgba(30, 123, 104, 0.12);
  --line: rgba(32, 49, 41, 0.12);
  --shadow: 0 28px 80px rgba(26, 41, 34, 0.10);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(30, 123, 104, 0.10), transparent 30%),
    radial-gradient(circle at bottom right, rgba(203, 155, 108, 0.18), transparent 28%),
    var(--page);
  color: var(--ink);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  overflow-x: hidden;
}

body.is-landing {
  overflow-x: hidden;
  overflow-y: auto;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.hidden {
  display: none !important;
}

.page-shell {
  min-height: 100svh;
  padding: 0 24px 24px 0;
}

body.is-landing .page-shell {
  min-height: 100svh;
  overflow: visible;
}

body.is-landing .landing-view {
  min-height: 100svh;
}

.topbar-action {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  min-height: 44px;
  padding: 0 18px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.topbar-action:hover {
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(32, 49, 41, 0.2);
  transform: translateY(-1px);
}

.landing-view,
.dashboard-view {
  max-width: 1260px;
}

.landing-view {
  height: 100%;
  margin: 0;
  max-width: none;
  min-height: 0;
}

.dashboard-view {
  margin: 28px auto 0;
}

.landing-view {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  min-height: 0;
}

.receipt-hero {
  align-items: start;
  display: grid;
  gap: 0;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  justify-items: center;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.receipt-hero-image {
  align-self: center;
  filter: drop-shadow(0 30px 52px rgba(26, 41, 34, 0.18));
  height: 100%;
  max-height: calc(100svh - 88px);
  max-width: min(116%, 740px);
  object-fit: contain;
  width: auto;
}

.receipt-hero-brand {
  align-items: baseline;
  color: var(--ink);
  display: flex;
  gap: 8px;
  justify-self: start;
  white-space: nowrap;
}

.receipt-hero-brand span {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2.4rem, 5.7vw, 5.35rem);
  font-weight: 600;
  letter-spacing: 0;
}

.receipt-hero-brand small {
  color: var(--muted);
  font-size: clamp(0.62rem, 0.85vw, 0.78rem);
  letter-spacing: 0;
  text-transform: none;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  margin: 0 0 18px;
  text-transform: uppercase;
}

.dashboard-header h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(3rem, 6vw, 5.8rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.94;
  margin: 0;
}

.dashboard-header h2 {
  font-size: clamp(2.1rem, 4vw, 3.4rem);
}

.dock-subtitle,
.auth-meta,
.panel-intro,
.empty-state {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.auth-dock {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.auth-dock::before,
.auth-dock::after {
  background: var(--page);
  border-radius: 999px;
  content: "";
  height: 32px;
  position: absolute;
  top: 32px;
  width: 32px;
}

.auth-dock::before {
  left: -16px;
}

.auth-dock::after {
  right: -16px;
}

.dock-handle {
  background: linear-gradient(135deg, rgba(30, 123, 104, 0.14), rgba(255, 255, 255, 0.6));
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.25rem;
  padding: 20px 24px;
  text-align: left;
  width: 100%;
}

.dock-panel {
  padding: 24px;
}

.dock-panel-head {
  margin-bottom: 20px;
}

.dock-title {
  font-size: 1.18rem;
  line-height: 1.45;
  margin: 0 0 10px;
}

.dock-subtitle {
  font-size: 0.96rem;
  margin: 0;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.phone-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, 0.58fr) minmax(0, 1fr);
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.88rem;
}

.field input,
.field select {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(32, 49, 41, 0.12);
  border-radius: 14px;
  color: var(--ink);
  min-height: 48px;
  padding: 0 14px;
  width: 100%;
}

.field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(32, 49, 41, 0.58) 50%),
    linear-gradient(135deg, rgba(32, 49, 41, 0.58) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 21px,
    calc(100% - 12px) 21px;
  background-repeat: no-repeat;
  background-size: 6px 6px;
  padding-right: 32px;
}

.field input:focus,
.field select:focus {
  border-color: rgba(30, 123, 104, 0.44);
  box-shadow: 0 0 0 4px rgba(30, 123, 104, 0.08);
  outline: 0;
}

.submit-button {
  background: var(--ink);
  border: 0;
  border-radius: 16px;
  color: #f8f5ee;
  min-height: 50px;
  margin-top: 6px;
  padding: 0 18px;
}

.submit-button:hover {
  background: #17231d;
}

.auth-meta {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
}

.legal-consent {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0;
}

.legal-consent a,
.receipts-legal-links a {
  color: var(--accent);
  font-weight: 700;
}

.alternate-login-button {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(32, 49, 41, 0.14);
  border-radius: 999px;
  color: var(--ink);
  min-height: 46px;
  padding: 0 16px;
  width: 100%;
}

.alternate-login-button:hover {
  background: rgba(255, 255, 255, 0.82);
}

#auth-feedback {
  color: var(--accent);
  min-height: 1.2em;
  margin: 0;
}

.auth-modal-backdrop {
  align-items: center;
  background: rgba(10, 13, 12, 0.58);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 16px;
  position: fixed;
  z-index: 20;
}

.auth-modal {
  background: #1f201f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.42);
  color: #f7f7f5;
  max-height: calc(100dvh - 32px);
  max-width: 500px;
  overflow-y: auto;
  padding: 40px 34px 34px;
  position: relative;
  width: min(100%, 500px);
}

.modal-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.82);
  display: grid;
  font-size: 2.35rem;
  height: 42px;
  justify-items: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 18px;
  top: 14px;
  width: 42px;
}

.auth-modal h2 {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
  text-align: center;
}

.modal-copy {
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(0.98rem, 2.5vw, 1.12rem);
  line-height: 1.45;
  margin: 16px auto 24px;
  max-width: 23rem;
  text-align: center;
}

.modal-provider-list {
  display: grid;
  gap: 12px;
}

.provider-option {
  align-items: center;
  background: #30312f;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: #ffffff;
  display: grid;
  font-size: 1rem;
  font-weight: 600;
  gap: 14px;
  grid-template-columns: 34px 1fr;
  min-height: 58px;
  padding: 0 24px;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.provider-option:hover {
  background: #3b3c3a;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.provider-mark {
  align-items: center;
  color: #f5f5f2;
  display: inline-grid;
  font-size: 0.92rem;
  font-weight: 800;
  height: 34px;
  justify-items: center;
  width: 34px;
}

.provider-google {
  color: #4285f4;
  font-size: 1.3rem;
}

.modal-divider {
  align-items: center;
  color: rgba(255, 255, 255, 0.58);
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr auto 1fr;
  margin: 20px 0;
  text-transform: uppercase;
}

.modal-divider span {
  background: rgba(255, 255, 255, 0.16);
  height: 1px;
}

.modal-divider em {
  font-size: 0.78rem;
  font-style: normal;
  letter-spacing: 0.12em;
}

.email-link-form {
  display: grid;
  gap: 14px;
}

.modal-email-field {
  display: grid;
  gap: 8px;
}

.modal-email-field span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.84rem;
}

.modal-email-field input {
  background: #2f302f;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: #ffffff;
  min-height: 58px;
  padding: 0 24px;
  width: 100%;
}

.modal-email-field input:focus {
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.10);
  outline: 0;
}

.modal-submit {
  background: #f7f7f5;
  border: 0;
  border-radius: 999px;
  color: #151614;
  font-weight: 700;
  min-height: 58px;
  padding: 0 24px;
  width: 100%;
}

.dashboard-header {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 28px;
}

.account-bar {
  align-items: center;
  display: flex;
  gap: 12px;
}

.account-pill {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  gap: 2px;
  padding: 12px 16px;
}

.pill-label {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pill-value {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1rem;
}

.receipts-panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 26px;
}

.receipts-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
  margin: 18px 4px 0;
}

.receipts-legal-links a {
  font-size: 0.86rem;
  text-decoration: none;
}

.panel-intro {
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
  padding-bottom: 18px;
}

.panel-intro p,
.empty-state p {
  margin: 0;
}

.receipt-groups {
  display: grid;
  gap: 22px;
}

.receipt-group {
  display: grid;
  gap: 12px;
}

.receipt-letter {
  color: var(--accent);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.45rem;
  margin: 0;
}

.receipt-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(32, 49, 41, 0.08);
  border-radius: var(--radius-lg);
  color: inherit;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr) auto;
  padding: 16px 18px;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  width: 100%;
}

.receipt-card:hover,
.receipt-card:focus-visible {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(30, 123, 104, 0.24);
  outline: 0;
  transform: translateY(-1px);
}

.receipt-main {
  display: grid;
  gap: 4px;
}

.receipt-shop {
  font-size: 1.05rem;
  font-weight: 600;
}

.receipt-meta,
.receipt-side {
  color: var(--muted);
  font-size: 0.92rem;
}

.receipt-side {
  text-align: right;
}

.receipt-total {
  color: var(--ink);
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
}

.receipt-detail-backdrop {
  align-items: center;
  background: rgba(10, 13, 12, 0.58);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 30;
}

.receipt-detail-dialog {
  background: transparent;
  border: 0;
  max-height: calc(100dvh - 36px);
  max-width: 430px;
  overflow-y: auto;
  padding: 0;
  position: relative;
  width: min(100%, 430px);
}

.receipt-detail-close {
  align-items: center;
  background: rgba(32, 49, 41, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #ffffff;
  display: grid;
  font-size: 1.7rem;
  height: 42px;
  justify-items: center;
  line-height: 1;
  padding: 0 0 2px;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 42px;
  z-index: 1;
}

.receipt-paper {
  background: #fffefa;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
  color: #1e211f;
  display: grid;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  gap: 18px;
  margin: 0 auto;
  padding: 38px 30px 28px;
  position: relative;
}

.receipt-paper::after {
  background:
    linear-gradient(135deg, transparent 75%, #fffefa 75%) 0 0 / 16px 16px,
    linear-gradient(225deg, transparent 75%, #fffefa 75%) 0 0 / 16px 16px;
  bottom: -15px;
  content: "";
  height: 16px;
  left: 0;
  position: absolute;
  right: 0;
}

.receipt-paper-head {
  border-bottom: 1px dashed rgba(30, 33, 31, 0.38);
  display: grid;
  gap: 6px;
  padding: 0 34px 16px;
  text-align: center;
}

.receipt-paper-head p,
.receipt-paper-head h2,
.receipt-paper-head span,
.receipt-paper-foot p {
  margin: 0;
}

.receipt-paper-head p {
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.receipt-paper-head h2 {
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.receipt-paper-head span,
.receipt-paper-foot,
.receipt-paper-line small,
.receipt-paper-line span,
.receipt-paper-meta {
  color: rgba(30, 33, 31, 0.68);
  font-size: 0.78rem;
}

.receipt-paper-meta,
.receipt-paper-totals {
  display: grid;
  gap: 7px;
}

.receipt-paper-meta div,
.receipt-paper-totals div,
.receipt-paper-line {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.receipt-paper-meta dt,
.receipt-paper-meta dd,
.receipt-paper-totals dt,
.receipt-paper-totals dd {
  margin: 0;
}

.receipt-paper-meta dd,
.receipt-paper-totals dd {
  text-align: right;
}

.receipt-paper-lines {
  border-bottom: 1px dashed rgba(30, 33, 31, 0.38);
  border-top: 1px dashed rgba(30, 33, 31, 0.38);
  display: grid;
  gap: 12px;
  padding: 16px 0;
}

.receipt-paper-line strong,
.receipt-paper-line small {
  display: block;
}

.receipt-paper-line strong {
  color: #1e211f;
  font-size: 0.9rem;
  font-weight: 700;
}

.receipt-paper-totals .is-total {
  border-top: 1px solid rgba(30, 33, 31, 0.16);
  font-size: 1.04rem;
  font-weight: 800;
  margin-top: 4px;
  padding-top: 10px;
}

.receipt-paper-foot {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.receipt-square-link {
  color: var(--accent);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
}

.merchant-link {
  color: var(--muted);
  text-decoration: none;
}

@media (max-width: 900px) {
  .landing-view {
    gap: 12px;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
  }

  .receipt-hero {
    min-height: 0;
    padding: 0;
  }

  .receipt-hero-image {
    max-height: calc(52svh - 62px);
    max-width: min(108%, 520px);
  }

  .dashboard-header {
    align-items: start;
    flex-direction: column;
  }

  .account-bar {
    flex-wrap: wrap;
  }

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

  .receipt-side {
    text-align: left;
  }

  .receipt-detail-dialog {
    max-width: 400px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 0 14px 14px 0;
  }

  .dock-panel,
  .receipts-panel {
    padding: 20px;
  }

  .phone-grid {
    grid-template-columns: 1fr;
  }

  .auth-modal {
    border-radius: 22px;
    padding: 38px 20px 24px;
  }

  .provider-option {
    min-height: 54px;
    padding: 0 18px;
  }

  .modal-email-field input,
  .modal-submit {
    min-height: 54px;
    padding: 0 18px;
  }

  .receipt-hero-brand {
    align-items: baseline;
    gap: 6px;
  }

  .receipt-detail-backdrop {
    padding: 12px;
  }

  .receipt-paper {
    padding: 34px 22px 24px;
  }
}
