@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --ink: #102c25;
  --ink-soft: #526560;
  --forest: #0f372d;
  --mint: #b9f6dd;
  --mint-strong: #4fd8a7;
  --paper: #f3f1e9;
  --white: #fcfcf8;
  --line: #d5d8cf;
  --danger: #b83d34;
  --shadow: 0 28px 70px rgba(15, 55, 45, 0.11);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at 90% 5%, rgba(79, 216, 167, .14), transparent 28rem),
    linear-gradient(90deg, rgba(15,55,45,.028) 1px, transparent 1px),
    linear-gradient(rgba(15,55,45,.028) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 32px 32px, 32px 32px, auto;
}

button, input { font: inherit; }
button { cursor: pointer; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { max-width: 1240px; margin: 0 auto; padding: 0 32px 56px; }

.topbar {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(15,55,45,.18);
}

.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 39px; height: 39px; display: grid; place-items: center;
  background: var(--forest); color: var(--mint); font: 500 18px "DM Mono";
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .06em; }
.brand small { margin-top: 1px; color: var(--ink-soft); font-size: 11px; letter-spacing: .04em; }

.environment { display: flex; align-items: center; gap: 9px; font: 500 12px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.language-select {
  height: 34px;
  padding: 0 24px 0 9px;
  border: 1px solid rgba(15,55,45,.22);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font: 500 11px "DM Mono";
  letter-spacing: .06em;
}
.language-select:focus { outline: 2px solid rgba(79,216,167,.45); outline-offset: 2px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #27c489; box-shadow: 0 0 0 4px rgba(39,196,137,.12); }
.status-dot.muted { background: #91a09b; box-shadow: none; margin-right: 6px; display: inline-block; }
.icon-button { width: 36px; height: 36px; border: 0; background: transparent; color: var(--ink); display: grid; place-items: center; }
.icon-button:hover { background: rgba(15,55,45,.07); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

main { padding-top: 66px; }
.intro { max-width: 790px; margin-bottom: 48px; }
.eyebrow { margin: 0 0 16px; font: 500 11px "DM Mono"; letter-spacing: .16em; color: #36725f; }
.intro h1 { margin: 0; max-width: 720px; font-size: clamp(44px, 6vw, 76px); line-height: .98; letter-spacing: -.055em; font-weight: 600; }
.intro > p:last-child { max-width: 570px; margin: 23px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.65; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, .72fr); box-shadow: var(--shadow); }
.panel { padding: 38px; }
.form-panel { background: var(--white); }
.context-panel { color: #ecf8f3; background: var(--forest); display: flex; flex-direction: column; justify-content: space-between; min-height: 610px; }

.mode-switch { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.mode-button { position: relative; min-width: 108px; padding: 0 14px 15px; border: 0; color: #72817c; background: transparent; font-weight: 600; }
.mode-button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.mode-button.active { color: var(--forest); }
.mode-button.active::after { background: var(--mint-strong); }

.field-group { margin: 0 0 23px; }
.field-group label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 700; letter-spacing: .015em; }
.field-group label span { color: #8a9692; font-weight: 500; }
.field-group label .label-primary { color: inherit; font-weight: 700; }
input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0; outline: none; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus { border-color: #51aa8a; box-shadow: 0 0 0 3px rgba(79,216,167,.16); }
input.invalid { border-color: var(--danger); }

.amount-input { height: 82px; display: flex; align-items: center; border: 1px solid var(--line); background: #fff; padding: 0 19px; transition: border-color .15s, box-shadow .15s; }
.amount-input:focus-within { border-color: #51aa8a; box-shadow: 0 0 0 3px rgba(79,216,167,.16); }
.amount-input > span:first-child { font-size: 20px; color: #75847f; }
.amount-input input { height: auto; min-width: 0; border: 0; box-shadow: none; padding: 0 12px; font: 500 clamp(30px, 4vw, 43px) "DM Mono"; letter-spacing: -.04em; }
.amount-input input:focus { box-shadow: none; }
.token-label { font: 500 11px "DM Mono"; letter-spacing: .08em; background: #e7f7f0; padding: 7px 9px; white-space: nowrap; }
.field-meta { display: flex; justify-content: space-between; min-height: 19px; margin-top: 7px; }
.field-meta small { color: #86928e; }
.error { min-height: 17px; display: block; margin-top: 6px; color: var(--danger) !important; font-size: 11px; }

.review-card { margin: 29px 0 18px; padding: 19px 20px; display: flex; justify-content: space-between; align-items: center; background: #eef8f3; border-left: 3px solid var(--mint-strong); }
.review-card span { display: block; color: var(--ink-soft); font-size: 11px; margin-bottom: 4px; }
.review-card strong { font: 500 16px "DM Mono"; }
.review-rate { text-align: right; color: #72817c; font: 400 9px/1.5 "DM Mono"; letter-spacing: .1em; }
.review-rate strong { color: var(--ink); font-size: 11px; }

.primary-button, .secondary-button { min-height: 52px; padding: 0 19px; border: 1px solid transparent; font-weight: 700; transition: transform .15s, background .15s; }
.primary-button { width: 100%; display: flex; align-items: center; justify-content: space-between; color: #effcf7; background: var(--forest); }
.primary-button:hover { background: #174b3e; }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: .68; }
.primary-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.secondary-button { background: transparent; color: var(--ink); border-color: var(--line); }
.secondary-button:hover { background: #f0f2ed; }

.context-icon { width: 52px; height: 52px; display: grid; place-items: center; color: var(--mint); border: 1px solid rgba(185,246,221,.35); }
.context-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.context-top > p:not(.context-copy) { margin: 27px 0 8px; color: var(--mint); font: 500 10px "DM Mono"; letter-spacing: .11em; text-transform: uppercase; }
.context-top h2 { margin: 0; font-size: 32px; line-height: 1.1; letter-spacing: -.035em; font-weight: 500; }
.context-copy { margin: 18px 0 0; color: #a9beb7; font-size: 13px; line-height: 1.6; }
.details-list { margin: 40px 0 0; }
.details-list div { display: flex; justify-content: space-between; padding: 13px 0; border-top: 1px solid rgba(255,255,255,.13); }
.details-list dt { color: #8fa8a0; font-size: 11px; }
.details-list dd { margin: 0; font: 400 11px "DM Mono"; }

.dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; color: var(--ink); background: var(--white); box-shadow: 0 30px 100px rgba(0,0,0,.24); }
.dialog::backdrop { background: rgba(8,27,22,.68); backdrop-filter: blur(3px); }
.dialog form { padding: 34px; }
.dialog-close { position: absolute; top: 17px; right: 17px; }
.dialog h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.035em; }
.dialog h2 + p { margin: 0 0 26px; color: var(--ink-soft); font-size: 13px; }
.confirmation-list { margin: 0; border-top: 1px solid var(--line); }
.confirmation-list div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.confirmation-list dt { color: var(--ink-soft); font-size: 12px; }
.confirmation-list dd { margin: 0; overflow-wrap: anywhere; font: 500 12px "DM Mono"; }
.dialog-actions { display: flex; gap: 10px; margin-top: 26px; }
.dialog-actions .primary-button { flex: 1; justify-content: center; }
.compact .field-group { margin-bottom: 16px; }

.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(380px, calc(100vw - 48px)); padding: 15px 18px; color: #fff; background: var(--forest); box-shadow: var(--shadow); font-size: 13px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error-toast { background: #742c28; }

@media (max-width: 760px) {
  .app-shell { padding: 0 18px 32px; }
  .topbar { height: 76px; }
  main { padding-top: 42px; }
  .intro { margin-bottom: 34px; }
  .intro h1 { font-size: 46px; }
  .workspace { grid-template-columns: 1fr; }
  .panel { padding: 26px 22px; }
  .context-panel { min-height: 410px; }
  .amount-input { height: 74px; }
}

@media (max-width: 440px) {
  .intro h1 { font-size: 40px; }
  .brand small { display: none; }
  .environment { font-size: 10px; }
  .amount-input { padding: 0 13px; }
  .amount-input input { font-size: 29px; }
  .token-label { padding: 6px; }
  .review-card { align-items: flex-end; padding: 16px; }
  .dialog form { padding: 28px 22px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
