:root {
  color-scheme: light;
  --bg: #eef5f6;
  --surface: #fbfcfc;
  --ink: #17201b;
  --muted: #5d685f;
  --line: #cbd7d9;
  --accent: #007c89;
  --accent-dark: #005f69;
  --accent-soft: #d9f0ef;
  --shadow: 0 24px 70px rgba(30, 35, 31, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #eef5f6 0%, #f7f1e7 100%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: center;
}

.workspace,
.result-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.workspace {
  padding: 32px;
}

.result-panel {
  padding: 28px;
}

.intro {
  max-width: 660px;
  margin-bottom: 28px;
}

.brand-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.wl-logo {
  width: min(360px, 64%);
  height: auto;
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
}

.paypal-logo {
  flex: 0 0 auto;
  color: #003087;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.paypal-logo span:last-child {
  color: #009cde;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  font-size: 3.25rem;
}

h2 {
  font-size: 3.5rem;
}

.intro p:last-child,
.note {
  color: var(--muted);
  line-height: 1.6;
}

.calculator {
  display: grid;
  gap: 24px;
}

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

label,
legend {
  color: var(--ink);
  font-weight: 700;
}

.money-input {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.money-input span {
  color: var(--muted);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.money-input input {
  border: 0;
  border-radius: 0;
  padding: 10px 0;
  font-size: 2rem;
  font-weight: 700;
}

.money-input:focus-within,
input:focus,
textarea:focus {
  outline: 3px solid rgba(0, 124, 137, 0.22);
  border-color: var(--accent);
}

input {
  padding: 11px 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

.field-error {
  min-height: 1.3em;
  margin: 0;
  color: #9a2d20;
  font-weight: 700;
}

.region-group {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.option-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: #ffffff;
}

.option-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.option-card span {
  display: grid;
  gap: 3px;
}

.option-card small {
  color: var(--muted);
}

.advanced {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.toggle-button,
.primary-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.toggle-button {
  padding: 10px 0;
  background: transparent;
  color: var(--accent-dark);
}

.primary-button {
  width: 100%;
  margin-top: 10px;
  padding: 13px 16px;
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.fee-editor {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.compact label {
  font-size: 0.9rem;
}

.result-header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.breakdown {
  margin: 22px 0;
  display: grid;
  gap: 12px;
}

.breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.breakdown dt {
  color: var(--muted);
}

.breakdown dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.copy-box {
  display: grid;
  gap: 8px;
}

.copy-status {
  min-height: 1.3em;
  margin: 0;
  color: var(--accent-dark);
  font-weight: 700;
}

.note {
  margin: 18px 0 0;
  font-size: 0.92rem;
}

@media (max-width: 840px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 24px 0;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
  }

  .workspace,
  .result-panel {
    padding: 20px;
  }

  .brand-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .wl-logo {
    width: 100%;
    max-height: none;
  }

  .paypal-logo {
    font-size: 1.65rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 2.15rem;
  }

  .fee-editor {
    grid-template-columns: 1fr;
  }

  .money-input input {
    font-size: 1.55rem;
  }

  .breakdown div {
    display: grid;
    gap: 4px;
  }

  .breakdown dd {
    text-align: left;
  }
}
