:root {
  color-scheme: light;
  --page: #f4f8f9;
  --paper: rgba(255, 255, 255, 0.88);
  --text: #17352f;
  --copy: #273a58;
  --muted: #667289;
  --line: #d8e1ea;
  --line-strong: #bfcce0;
  --primary: #4758df;
  --primary-dark: #25366f;
  --teal: #4ba49a;
  --teal-dark: #27756b;
  --success-bg: #e9f8ef;
  --success: #30795b;
  --warning: #a9691e;
  --danger: #bb3328;
  --card-shadow: 0 26px 70px rgba(48, 71, 92, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 74% 14%, rgba(219, 233, 240, 0.86), rgba(219, 233, 240, 0) 24rem),
    radial-gradient(circle at 9% 23%, rgba(213, 238, 228, 0.9), rgba(213, 238, 228, 0) 28rem),
    linear-gradient(180deg, #f7fafb 0%, var(--page) 100%);
}

button,
input,
textarea {
  font: inherit;
}

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

button {
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.page-shell {
  width: min(1040px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 32px 0 34px;
}

.hero {
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-pill,
.language-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid rgba(200, 213, 224, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 44px rgba(52, 74, 90, 0.13);
}

.brand-pill {
  gap: 12px;
  padding: 0 18px 0 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
}

.brand-moon {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 36%, rgba(255, 248, 167, 0.9) 0 12%, transparent 13%),
    radial-gradient(circle at 67% 42%, rgba(161, 115, 28, 0.18) 0 11%, transparent 12%),
    radial-gradient(circle at 52% 70%, rgba(132, 94, 21, 0.22) 0 10%, transparent 11%),
    linear-gradient(135deg, #ffe989, #d5a22d 64%, #b77b19);
  box-shadow: inset -4px -4px 8px rgba(100, 65, 8, 0.18), 0 3px 8px rgba(152, 109, 24, 0.26);
}

.language-pill {
  height: 38px;
  min-height: 38px;
  padding: 0 18px;
  color: var(--copy);
  font-size: 14px;
  font-weight: 800;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: center;
  min-height: 172px;
  margin-top: 24px;
}

.hero-copy h1 {
  margin: 0;
  font-size: 50px;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 14px 0 0;
  color: var(--copy);
  font-size: 16px;
}

.hero-moon {
  justify-self: center;
  width: 122px;
  height: 122px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 230, 0.9) 0 13%, transparent 14%),
    radial-gradient(circle at 67% 38%, rgba(167, 143, 79, 0.17) 0 13%, transparent 14%),
    radial-gradient(circle at 49% 66%, rgba(157, 126, 60, 0.14) 0 15%, transparent 16%),
    linear-gradient(145deg, #fbf4c8, #e8d993 58%, #d5c573);
  box-shadow: 0 0 52px rgba(232, 216, 151, 0.62), inset -12px -16px 24px rgba(131, 112, 51, 0.12);
}

.exchange-card {
  margin-top: 2px;
  padding: 46px 43px 50px;
  border-radius: 30px;
  border: 1px solid rgba(225, 232, 238, 0.8);
  background: var(--paper);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(14px);
}

.back-link {
  display: inline-flex;
  margin: 0 0 18px 5px;
  color: var(--teal);
  font-size: 16px;
  font-weight: 900;
  text-decoration: none;
}

.inventory-box,
.product-strip,
.result-head {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
}

.inventory-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 80px;
  padding: 17px 20px;
}

.inventory-box span,
.product-strip span,
.result-head span,
.guide-card p,
.mode-card span,
.mode-card small {
  color: var(--muted);
}

.inventory-box strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.2;
}

.inventory-box p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  text-align: right;
}

.product-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 11px 16px;
}

.product-strip strong {
  font-size: 17px;
}

.product-strip em {
  color: var(--copy);
  font-style: normal;
  font-weight: 900;
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 22px 0 24px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 14px;
}

.step.active {
  border-color: #aebcff;
  background: #eef2ff;
  color: var(--primary);
}

.step.done {
  border-color: #bfe4d0;
  background: #f3fbf6;
  color: var(--success);
}

.step-index {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: #e2e7ef;
  color: var(--muted);
  font-weight: 900;
}

.step.active .step-index {
  background: var(--primary);
  color: #fff;
}

.step.done .step-index {
  background: #5dbc89;
  color: #fff;
}

.notice {
  margin: -2px 0 18px;
  padding: 14px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 800;
}

.notice.success {
  background: var(--success-bg);
  color: var(--success);
}

.step-pane {
  animation: paneIn 0.18s ease-out;
}

@keyframes paneIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--copy);
  font-size: 16px;
  font-weight: 900;
}

.cdk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 102px;
  gap: 12px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--copy);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input {
  height: 49px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 700;
}

input::placeholder,
textarea::placeholder {
  color: #7d8491;
}

textarea {
  min-height: 112px;
  resize: vertical;
  padding: 13px 14px;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(71, 88, 223, 0.12);
}

.primary-button,
.soft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  border-radius: 9px;
  font-weight: 900;
  text-decoration: none;
}

.primary-button {
  padding: 0 20px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  box-shadow: 0 18px 30px rgba(66, 80, 214, 0.28);
}

.primary-button.compact {
  min-height: 40px;
  padding: 0 18px;
}

.soft-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--copy);
}

.soft-button.filled {
  border-color: transparent;
  background: linear-gradient(135deg, #61b7ae, #2f7794);
  color: #fff;
}

.helper-text {
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-card {
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid #e1bf49;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.74);
  text-align: left;
}

.mode-card.active {
  border-color: #75bfb6;
  border-left-color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(75, 164, 154, 0.1);
}

.mode-card span,
.mode-card small {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.mode-card strong {
  display: block;
  margin: 3px 0 3px;
  color: var(--text);
  font-size: 18px;
}

.guide-card {
  margin-top: 8px;
  padding: 13px 15px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.75);
}

.guide-card h2 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 16px;
}

.guide-card p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
}

.guide-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.session-form textarea {
  min-height: 100px;
  margin-bottom: 12px;
}

.result-pane {
  margin-top: 6px;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
}

.result-head strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
}

.status-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.status-label.success {
  background: #def7ea;
  color: var(--success);
}

.status-label.failed {
  background: #ffe5e1;
  color: var(--danger);
}

.status-label.pending,
.status-label.processing {
  background: #fff1d9;
  color: var(--warning);
}

.status-label.muted {
  background: #e9eef4;
  color: var(--muted);
}

.result-list {
  display: grid;
  gap: 0;
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}

.result-list div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--line);
}

.result-list div:last-child {
  border-bottom: 0;
}

dt {
  color: var(--muted);
  font-weight: 900;
}

dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--copy);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 29px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 13px 16px;
  border-radius: 9px;
  background: #1d2c42;
  color: #fff;
  box-shadow: 0 18px 46px rgba(37, 54, 111, 0.22);
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: var(--teal-dark);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 22px, 560px);
    padding-top: 18px;
  }

  .topbar,
  .footer {
    align-items: flex-start;
  }

  .brand-pill {
    min-height: 40px;
    font-size: 14px;
  }

  .language-pill {
    height: 34px;
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .hero-grid {
    grid-template-columns: 1fr auto;
    min-height: 116px;
    margin-top: 22px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .hero-copy p {
    font-size: 14px;
  }

  .hero-moon {
    width: 78px;
    height: 78px;
  }

  .exchange-card {
    padding: 28px 20px 30px;
    border-radius: 22px;
  }

  .inventory-box,
  .result-head,
  .footer {
    display: grid;
  }

  .inventory-box p {
    text-align: left;
    font-size: 14px;
  }

  .steps,
  .mode-grid,
  .cdk-row {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .soft-button {
    width: 100%;
  }

  .result-list div {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
