@font-face {
  font-family: "Twemoji Country Flags";
  src: url("./fonts/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF;
  font-display: swap;
}

@font-face {
  font-family: "Inter Variable";
  src: url("./fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Scales the whole app on short desktop viewports. See the height
     media queries near the end of this file. */
  --app-zoom: 1;
  --app-zoom-tweak: 1;
  --navy-950: #06172f;
  --navy-900: #092247;
  --navy-800: #103362;
  --blue-600: #0868f7;
  --blue-500: #1478ff;
  --blue-100: #eaf3ff;
  --green-700: #087747;
  --green-600: #079457;
  --green-100: #e7f8ef;
  --amber-700: #9a5b00;
  --amber-100: #fff4d9;
  --red-600: #ce2d3f;
  --ink: #0b1d3b;
  --muted: #65738c;
  --muted-2: #8994a8;
  --line: #dce5f1;
  --surface: #ffffff;
  --canvas: #f3f6fb;
  --shadow: 0 20px 55px rgba(9, 34, 71, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #e8eef7;
  scroll-behavior: smooth;
  zoom: var(--app-zoom);
}

body {
  margin: 0;
  min-width: 320px;
  height: 100vh;
  height: calc(100dvh / var(--app-zoom));
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 4%, rgba(20, 120, 255, 0.14), transparent calc(26rem / var(--app-zoom))),
    radial-gradient(circle at 88% 88%, rgba(7, 148, 87, 0.1), transparent calc(24rem / var(--app-zoom))),
    #e8eef7;
  font-family: "Twemoji Country Flags", "Inter Variable", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.setup-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

/* Options are rendered in the browser's own popup and do not reliably inherit,
   so the flag font is named on them directly. */
select,
option {
  font-family: "Twemoji Country Flags", "Inter Variable", Inter, ui-sans-serif, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(20, 120, 255, 0.32);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  /* Cancels the desktop --app-zoom so the backdrop stays full size. */
  zoom: calc(1 / var(--app-zoom));
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
}

.ambient-one {
  top: -10rem;
  left: -8rem;
  background: #58a2ff;
}

.ambient-two {
  right: -10rem;
  bottom: -9rem;
  background: #6ed9aa;
}

.app-shell {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 620px;
  height: 100vh;
  height: calc(100dvh / var(--app-zoom));
  margin: 0 auto;
  flex-direction: column;
  overflow: hidden;
  background: var(--canvas);
  box-shadow: var(--shadow);
}

.topbar {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding: max(16px, env(safe-area-inset-top)) 20px 16px;
  color: #fff;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.04), transparent 40%),
    var(--navy-900);
  box-shadow: 0 8px 26px rgba(6, 23, 47, 0.2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.top-new-sale {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  cursor: pointer;
  white-space: nowrap;
}

.top-new-sale span {
  display: grid;
  place-items: center;
}

.top-new-sale strong {
  font-size: 13px;
  font-weight: 850;
}

.top-new-sale:hover {
  background: rgba(255, 255, 255, 0.17);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px 13px 17px 17px;
  color: #fff;
  background: linear-gradient(145deg, #22b1ff, #1767ff 64%, #6fb6ff);
  box-shadow: 0 9px 22px rgba(8, 104, 247, 0.35);
  font-size: 22px;
  font-weight: 900;
  transform: skewY(-3deg);
}

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 20px;
  letter-spacing: -0.03em;
}

.brand-copy small {
  margin-top: 5px;
  color: #c9d8ef;
  font-size: 14px;
}

.profile-button {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: var(--navy-900);
  background: #f5f8fd;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.country-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  place-items: center;
  overflow-y: auto;
  background:
    radial-gradient(circle at 12% 4%, rgba(41, 143, 255, 0.27), transparent calc(24rem / var(--app-zoom))),
    radial-gradient(circle at 91% 90%, rgba(38, 198, 119, 0.2), transparent calc(22rem / var(--app-zoom))),
    rgba(6, 23, 47, 0.94);
  backdrop-filter: blur(18px);
}

.country-card {
  width: min(100%, 500px);
  padding: 27px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

.setup-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 29px;
}

.setup-brand > span:last-child {
  display: grid;
  line-height: 1.05;
}

.setup-brand strong {
  font-size: 19px;
  letter-spacing: -0.03em;
}

.setup-brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.country-card h1 {
  max-width: 390px;
  font-size: clamp(34px, 10vw, 47px);
}

.country-intro {
  margin: 14px 0 25px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.country-card form {
  display: grid;
  gap: 13px;
}

.setup-label {
  margin-top: 5px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.country-select {
  width: 100%;
  min-height: 57px;
  padding: 0 43px 0 14px;
  border: 1px solid #b9c9de;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
}

.currency-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 55px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #53647e;
  background: var(--blue-100);
  font-size: 14px;
}

.currency-preview strong {
  color: var(--blue-600);
  font-size: 14px;
  text-align: right;
}

.setup-rate-input {
  grid-template-columns: minmax(58px, auto) minmax(0, 1fr) !important;
}

.setup-rate-input > span {
  padding: 0 11px;
}

.setup-help {
  margin: -4px 3px 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

main {
  flex: 1 1 auto;
  min-height: 0;
  padding: 25px 18px 160px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.view {
  animation: view-in 220ms ease-out;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 2px 2px 20px;
}

.compact-heading {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue-600);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 9vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.text-button {
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  color: var(--blue-600);
  background: var(--blue-100);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.creator-card,
.document-card,
.settings-card,
.summary-card,
.empty-preview,
.record-card,
.storage-note {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(9, 34, 71, 0.055);
}

.creator-card {
  padding: 21px;
  border-radius: 24px;
}

.field-label,
.settings-card label > span {
  display: block;
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.amount-control {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 96px;
  overflow: hidden;
  border: 2px solid #bacde9;
  border-radius: 18px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.amount-control:focus-within {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 5px rgba(20, 120, 255, 0.11);
}

.amount-control.has-error {
  border-color: var(--red-600);
  box-shadow: 0 0 0 5px rgba(206, 45, 63, 0.08);
}

.currency-symbol {
  display: grid;
  place-items: center;
  color: #60718e;
  background: #f0f4f9;
  font-size: 40px;
  font-weight: 750;
}

.amount-control input {
  min-width: 0;
  width: 100%;
  padding: 0 18px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: clamp(42px, 12vw, 58px);
  font-weight: 820;
  letter-spacing: -0.045em;
}

.field-error {
  min-height: 20px;
  margin: 7px 2px 0;
  color: var(--red-600);
  font-size: 14px;
  font-weight: 650;
}

.rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 7px 2px 20px;
  color: var(--muted);
  font-size: 15px;
}

.rate-row strong {
  color: #50617e;
  font-weight: 800;
}

.primary-button,
.complete-button {
  width: 100%;
  min-height: 58px;
  padding: 13px 18px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.015em;
  box-shadow: 0 12px 24px rgba(8, 104, 247, 0.2);
  transition: transform 150ms ease, filter 150ms ease;
}

.primary-button {
  background: var(--blue-600);
}

.complete-button {
  background: var(--green-600);
  box-shadow: 0 12px 24px rgba(7, 148, 87, 0.2);
}

.primary-button:active,
.complete-button:active {
  transform: scale(0.987);
}

.primary-button:hover,
.complete-button:hover {
  filter: brightness(0.97);
}

.primary-button:disabled,
.complete-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.25);
  opacity: 0.55;
  box-shadow: none;
}

.input-hint {
  margin: 14px 5px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.empty-preview {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.empty-mark {
  display: grid;
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 14px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 23px;
  font-weight: 900;
}

.empty-preview h2 {
  font-size: 16px;
}

.empty-preview p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.quote-area {
  margin-top: 4px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin: 0 0 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.status-pill {
  padding: 8px 13px;
}

.status-pill.is-pending {
  color: var(--green-700);
  background: var(--green-100);
}

.status-pill.is-completed {
  color: var(--green-700);
  background: var(--green-100);
}

.status-pill.is-expired {
  color: var(--amber-700);
  background: var(--amber-100);
}

.document-card {
  position: relative;
  overflow: hidden;
  padding: 24px 20px 20px;
  border-radius: 24px;
}

.document-accent {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  background: var(--blue-600);
}

.document-card.is-completed .document-accent {
  background: var(--green-600);
}

.document-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.document-merchant {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.document-number {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.document-badge {
  padding: 7px 9px;
  border-radius: 9px;
  color: var(--blue-600);
  background: var(--blue-100);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.document-card.is-completed .document-badge {
  color: var(--green-700);
  background: var(--green-100);
}

.document-details {
  margin: 0;
  padding: 10px 0 2px;
}

.document-details div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 15px;
  min-height: 50px;
  padding: 13px 0 10px;
  border-bottom: 1px solid var(--line);
}

.document-details dt {
  min-width: 0;
  color: var(--muted);
  font-size: 15px;
}

.document-details dd {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.document-note {
  margin: 20px 0;
  color: #52627c;
  font-size: 15px;
  line-height: 1.55;
}

.document-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.document-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 48px;
  padding: 8px 7px;
  border: 0;
  border-radius: 13px;
  color: var(--blue-600);
  background: var(--blue-100);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.document-actions button span {
  font-size: 18px;
  line-height: 1;
}

.completion-actions {
  margin-top: 14px;
}

.completion-actions p {
  margin: 10px 6px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.another-button {
  margin-top: 14px;
}

.bottom-nav {
  position: relative;
  z-index: 30;
  display: grid;
  flex: 0 0 auto;
  width: 100%;
  min-height: 76px;
  padding: 7px 10px max(8px, env(safe-area-inset-bottom));
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(190, 204, 224, 0.72);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -12px 36px rgba(9, 34, 71, 0.08);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  display: grid;
  min-width: 0;
  min-height: 57px;
  padding: 4px;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 13px;
  color: #718099;
  background: transparent;
  cursor: pointer;
}

.bottom-nav button.is-active {
  color: var(--blue-600);
  background: #f2f7ff;
}

.bottom-nav button > span {
  display: grid;
  min-width: 29px;
  height: 27px;
  place-items: center;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
}

.bottom-nav small {
  font-size: 12px;
  font-weight: 750;
}

.sales-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.summary-card {
  display: grid;
  gap: 4px;
  min-height: 115px;
  padding: 17px;
  align-content: center;
  border-radius: 19px;
}

.summary-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.summary-card strong {
  color: var(--ink);
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.summary-card small {
  color: var(--muted);
  font-size: 12px;
}

.summary-primary {
  grid-column: 1 / -1;
  min-height: 140px;
  color: #fff;
  border: 0;
  background: var(--navy-900);
  box-shadow: 0 17px 35px rgba(9, 34, 71, 0.18);
}

.summary-primary span,
.summary-primary small {
  color: #c9d8ed;
}

.summary-primary strong {
  color: #fff;
  font-size: 38px;
}

.list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 3px 12px;
}

.list-heading h2 {
  font-size: 19px;
}

.list-heading span {
  color: var(--muted);
  font-size: 13px;
}

.record-list {
  display: grid;
  gap: 11px;
}

.history-panel {
  margin-top: 4px;
}

.history-heading {
  margin-bottom: 10px;
}

.history-heading .text-button {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 13px;
}

.record-card {
  overflow: hidden;
  border-radius: 18px;
  transition: box-shadow 160ms ease;
}

.record-card.is-expanded {
  box-shadow: 0 12px 30px rgba(9, 34, 71, 0.1);
}

.record-summary {
  display: grid;
  width: 100%;
  padding: 16px;
  gap: 13px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

.record-card-main {
  display: block;
  min-width: 0;
}

.record-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.record-chevron {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(16, 51, 98, 0.06);
  transition: transform 200ms ease, background 160ms ease;
}

.icon {
  display: block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bottom-nav .icon {
  width: 21px;
  height: 21px;
}

.document-actions .icon {
  width: 17px;
  height: 17px;
}

.top-new-sale .icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.6;
}

.new-sale-fab-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.6;
}

.record-chevron .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}

.record-card.is-expanded .record-chevron {
  color: var(--blue-600);
  background: var(--blue-100);
  transform: rotate(180deg);
}

.record-detail {
  padding: 0 16px 16px;
  animation: record-detail-in 200ms ease-out;
}

@keyframes record-detail-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.record-detail-list {
  display: grid;
  margin: 0 0 13px;
  padding-top: 13px;
  gap: 9px;
  border-top: 1px solid var(--line);
}

.record-detail-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.record-detail-list dt {
  color: var(--muted);
  font-size: 13px;
}

.record-detail-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}

.record-reference {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.record-status {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  text-transform: capitalize;
}

.record-status.pending {
  color: #1d5fae;
  background: var(--blue-100);
}

.record-status.completed {
  color: var(--green-700);
  background: var(--green-100);
}

.record-status.expired {
  color: var(--amber-700);
  background: var(--amber-100);
}

.record-meta {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.record-value {
  align-self: center;
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
  text-align: right;
}

.record-open {
  width: 100%;
  min-height: 43px;
  border: 1px solid #cfe0f7;
  border-radius: 12px;
  color: var(--blue-600);
  background: #f5f9ff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.empty-list {
  padding: 42px 24px;
  border: 1px dashed #c8d6e8;
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  text-align: center;
}

.empty-list strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 17px;
}

.empty-list p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.settings-card {
  display: grid;
  gap: 19px;
  padding: 21px;
  border-radius: 23px;
}

.settings-card label {
  display: block;
}

.settings-card input,
.settings-card select,
.settings-rate-input {
  width: 100%;
  min-height: 54px;
  border: 1px solid #bdcce0;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
}

.settings-card > label > input,
.settings-card select {
  padding: 0 14px;
}

.settings-currency-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  margin-top: -7px;
  padding: 11px 13px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--blue-100);
  font-size: 13px;
}

.settings-currency-note strong {
  color: var(--blue-600);
  text-align: right;
}

.settings-rate-input {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  overflow: hidden;
}

.settings-rate-input span {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f1f5fa;
  font-weight: 850;
}

.settings-rate-input input {
  min-width: 0;
  min-height: 52px;
  padding: 0 13px;
  border: 0;
  border-radius: 0;
  outline: 0;
}

.storage-note {
  margin-top: 14px;
  padding: 18px;
  border-radius: 18px;
  color: #40516d;
  background: #eef5ff;
  box-shadow: none;
}

.storage-note strong {
  color: var(--ink);
  font-size: 15px;
}

.storage-note p {
  margin: 7px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.toast {
  position: absolute;
  z-index: 60;
  right: 18px;
  bottom: calc(230px + env(safe-area-inset-bottom));
  left: 18px;
  max-width: 500px;
  margin: 0 auto;
  padding: 13px 16px;
  transform: translateY(20px);
  border-radius: 14px;
  color: #fff;
  background: var(--navy-950);
  box-shadow: 0 18px 35px rgba(6, 23, 47, 0.25);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.new-sale-fab {
  position: absolute;
  z-index: 56;
  right: 18px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 56px;
  padding: 0 20px 0 17px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(140deg, #1e86ff, #0868f7 62%, #0b4fd0);
  box-shadow: 0 14px 30px rgba(8, 104, 247, 0.38);
  cursor: pointer;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 800;
  transition: transform 150ms ease, filter 150ms ease;
}

.new-sale-fab:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.new-sale-fab:active {
  transform: scale(0.97);
}



.whatsapp-fab {
  position: absolute;
  z-index: 55;
  right: 18px;
  bottom: calc(160px + env(safe-area-inset-bottom));
  display: grid;
  width: 58px;
  height: 58px;
  padding: 0;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  color: #fff;
  background: #20b75a;
  box-shadow: 0 13px 28px rgba(8, 98, 50, 0.32);
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease;
}

.whatsapp-fab:hover {
  filter: brightness(0.96);
  transform: translateY(-2px);
}

.whatsapp-fab:active {
  transform: scale(0.96);
}

.whatsapp-fab svg {
  width: 31px;
  height: 31px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.whatsapp-fab svg path:last-child {
  fill: currentColor;
  stroke: none;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 370px) {
  .topbar {
    padding-right: 13px;
    padding-left: 13px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .brand-copy small {
    font-size: 12px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .top-new-sale {
    padding: 0 9px;
  }

  .top-new-sale strong {
    font-size: 12px;
  }

  .profile-button {
    width: 42px;
    height: 42px;
  }

  .country-gate {
    padding: 0;
    place-items: stretch;
  }

  .country-card {
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(23px, env(safe-area-inset-top)) 19px max(23px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
  }

  main {
    padding-right: 14px;
    padding-left: 14px;
  }

  .creator-card,
  .document-card {
    padding-right: 16px;
    padding-left: 16px;
  }

  .amount-control {
    grid-template-columns: 62px minmax(0, 1fr);
    min-height: 88px;
  }

  .amount-control input {
    padding-right: 12px;
    padding-left: 12px;
  }

  .status-pill {
    max-width: 218px;
    font-size: 12px;
  }

  .document-actions button {
    font-size: 13px;
  }
}

@media (min-width: 700px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    height: calc(100vh - 48px);
    height: calc((100dvh - 48px) / var(--app-zoom));
    border: 1px solid rgba(195, 207, 225, 0.8);
    border-radius: 30px;
  }

  .topbar {
    border-radius: 29px 29px 0 0;
  }

  .bottom-nav {
    overflow: hidden;
    border-radius: 0 0 29px 29px;
  }

  .new-sale-fab {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .whatsapp-fab {
    bottom: calc(164px + env(safe-area-inset-bottom));
  }

  .toast {
    bottom: calc(234px + env(safe-area-inset-bottom));
  }
}

/* Once the shell is narrower than the window, pin the WhatsApp button to the
   shell's right edge rather than the window's. */
/* Desktop scaling.
   The layout is phone-sized and sized in fixed px. On a desktop window those
   px render far larger than they do on a phone, so the app is scaled down to
   sit comfortably. Windows machines at 125% or 150% display scaling report a
   shorter CSS viewport than a Mac does, which is why the same page looked
   bigger there -- the height steps below absorb that difference.

   ONE KNOB: --app-zoom-tweak below. Lower it to shrink the whole app further
   (0.9 = another 10% smaller), raise it to grow it (1.1 = 10% bigger).
   Nothing here affects phones; it all starts at 700px wide. */
@media (min-width: 700px) {
  :root {
    --app-zoom: calc(0.88 * var(--app-zoom-tweak));
  }
}

@media (min-width: 700px) and (max-height: 860px) {
  :root {
    --app-zoom: calc(0.84 * var(--app-zoom-tweak));
  }
}

@media (min-width: 700px) and (max-height: 780px) {
  :root {
    --app-zoom: calc(0.8 * var(--app-zoom-tweak));
  }
}

@media (min-width: 700px) and (max-height: 720px) {
  :root {
    --app-zoom: calc(0.76 * var(--app-zoom-tweak));
  }
}

@media (min-width: 700px) and (max-height: 660px) {
  :root {
    --app-zoom: calc(0.72 * var(--app-zoom-tweak));
  }
}

@media (min-width: 700px) and (max-height: 600px) {
  :root {
    --app-zoom: calc(0.68 * var(--app-zoom-tweak));
  }
}

@media (min-width: 700px) and (max-height: 540px) {
  :root {
    --app-zoom: calc(0.64 * var(--app-zoom-tweak));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    size: A5;
    margin: 12mm;
  }

  body {
    background: #fff;
  }

  body * {
    visibility: hidden !important;
  }

  .document-card,
  .document-card * {
    visibility: visible !important;
  }

  .document-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border: 1px solid #d7dee9;
    box-shadow: none;
  }

  .document-actions,
  .completion-actions,
  .another-button,
  .whatsapp-fab,
  .country-gate {
    display: none !important;
  }
}
