:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --card: #ffffff;
  --ink: #101725;
  --muted: #8c94a3;
  --line: #eef1f6;
  --blue: #184eb8;
  --blue-strong: #0d3f9e;
  --shadow: 0 18px 42px rgba(34, 48, 76, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 24px max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 11px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(145deg, #1f74e8 0%, #164eb8 72%, #123f9c 100%);
  color: white;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(23, 101, 220, 0.28);
}

.brand-icon svg {
  width: 33px;
  height: 33px;
  overflow: visible;
}

.brand-icon text {
  fill: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-icon .icon-curve,
.brand-icon .icon-head {
  fill: none;
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.brand-icon .icon-curve {
  stroke-width: 2.2;
}

.brand-icon .icon-head {
  stroke-width: 2;
}

.brand-icon .icon-won {
  font-size: 14.5px;
}

.brand-icon .icon-rm {
  font-size: 8.8px;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
}

.market-card {
  background: #ffffff;
  border: 1px solid #e8ecf3;
  border-radius: 22px;
  padding: 12px 16px 10px;
  box-shadow: 0 12px 28px rgba(34, 48, 76, 0.09);
}

.market-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.market-title,
.market-rate {
  margin: 0;
}

.market-title {
  color: #101725;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0;
}

.market-status {
  min-width: 54px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef5ff;
  color: #1765dc;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-align: center;
  text-transform: uppercase;
}

.chart-wrap {
  position: relative;
  margin-top: 4px;
}

.market-chart {
  display: block;
  width: calc(100% - 34px);
  height: 64px;
}

.grid-line {
  fill: none;
  stroke: #e1e7f0;
  stroke-dasharray: 4 6;
  stroke-linecap: round;
  stroke-width: 1.6;
}

.today-line {
  fill: none;
  stroke: #d0d8e5;
  stroke-width: 1.4;
}

.chart-line {
  fill: none;
  stroke: #1765dc;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4.2;
}

.chart-dot-glow {
  fill: rgba(23, 101, 220, 0.14);
}

.chart-dot {
  fill: #1765dc;
  stroke: #ffffff;
  stroke-width: 3;
}

.axis-labels {
  position: absolute;
  top: 5px;
  right: 0;
  height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #8e96a5;
  font-size: 12px;
  font-weight: 650;
  text-align: right;
}

.date-row {
  display: flex;
  justify-content: space-between;
  padding-right: 34px;
  color: #6d7585;
  margin-top: -4px;
  font-size: 13px;
  font-weight: 650;
}

.market-rate {
  margin-top: 6px;
  color: #101725;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0;
}

.rate-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.rate-mode {
  min-height: 58px;
  border: 1px solid #e1e7f0;
  border-radius: 16px;
  padding: 10px 12px;
  background: #ffffff;
  color: #6d7585;
  text-align: left;
  box-shadow: 0 8px 18px rgba(34, 48, 76, 0.07);
  cursor: pointer;
}

.rate-mode span,
.rate-mode strong {
  display: block;
}

.rate-mode span {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.rate-mode strong {
  color: #101725;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.rate-mode.active {
  border-color: #1765dc;
  background: #eef5ff;
  color: #1765dc;
  box-shadow: 0 10px 22px rgba(23, 101, 220, 0.14);
}

.rate-mode.active strong {
  color: #0d3f9e;
}

.converter {
  background: var(--card);
  border: 1px solid #e8ecf3;
  border-radius: 24px;
  padding: 26px 26px 22px;
  box-shadow: var(--shadow);
}

.currency-row {
  position: relative;
  display: block;
  min-height: 98px;
  border-radius: 16px;
  cursor: text;
  touch-action: manipulation;
}

.currency-row:active {
  background: #fafbfe;
}

.currency-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6d7585;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.code {
  position: absolute;
  top: 0;
  right: 0;
  color: #8e96a5;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.amount-field {
  display: block;
  width: 100%;
  margin-top: 20px;
}

.amount-field {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.currency-prefix,
.money-input {
  color: var(--blue-strong);
  font-size: clamp(32px, 8.3vw, 46px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
}

.currency-prefix {
  flex: 0 0 auto;
}

.money-input {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  outline: 0;
  color: #9aa2af;
  caret-color: var(--blue);
  -webkit-appearance: none;
  appearance: none;
}

.amount-field.compact .currency-prefix,
.amount-field.compact .money-input {
  font-size: clamp(27px, 6.9vw, 38px);
}

.amount-field.dense .currency-prefix,
.amount-field.dense .money-input {
  font-size: clamp(22px, 5.6vw, 31px);
}

.amount-field.tiny .currency-prefix,
.amount-field.tiny .money-input {
  font-size: clamp(18px, 4.8vw, 26px);
}

.money-input:focus {
  color: #808998;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
  margin: 12px 0 18px;
}

.divider span {
  height: 1px;
  background: var(--line);
}

.divider-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #e6eaf1;
  border-radius: 999px;
  background: #f7f9fd;
  color: #9aa2af;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(20, 31, 55, 0.06) inset;
}

.fee-trigger {
  width: 34px;
  height: 34px;
  align-self: center;
  border: 1px solid #dfe7f2;
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 30%, #ffffff 0 18%, transparent 19%),
    #eef5ff;
  box-shadow: 0 8px 18px rgba(34, 48, 76, 0.08);
  cursor: pointer;
}

.fee-trigger:active {
  transform: scale(0.96);
}

.fee-panel {
  display: grid;
  gap: 6px;
  border: 1px solid #dfe7f2;
  border-radius: 18px;
  padding: 10px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(34, 48, 76, 0.08);
}

.fee-panel[hidden] {
  display: none;
}

.fee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  padding: 8px 10px;
  background: #f5f8fc;
}

.fee-panel span,
.fee-panel strong {
  display: inline-block;
}

.fee-panel span {
  color: #7d8796;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.fee-panel strong {
  color: #8f98a7;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.fee-row span {
  color: #7d8796;
}

.fee-row:nth-child(2) span {
  font-size: 17px;
  line-height: 1;
}

.fee-total {
  margin-top: 2px;
  background: #eef5ff;
}

.fee-total span {
  color: #1765dc;
}

.fee-total strong {
  color: #0d3f9e;
  font-size: 20px;
}

.signature {
  margin: 4px 0 0;
  text-align: center;
  color: #98a0ad;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  opacity: 0.82;
}

.account-link {
  align-self: center;
  border: 1px solid #dce5f2;
  border-radius: 999px;
  padding: 8px 14px;
  background: #ffffff;
  color: #1765dc;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(34, 48, 76, 0.08);
}

.accounts-shell {
  width: min(100%, 500px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
}

.accounts-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.accounts-header h1 {
  font-size: 28px;
}

.accounts-eyebrow {
  margin: 0 0 4px;
  color: #8e96a5;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.back-link {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #dde5f0;
  border-radius: 999px;
  background: #ffffff;
  color: #1765dc;
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(34, 48, 76, 0.08);
}

.account-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #e8ecf3;
  border-radius: 22px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(34, 48, 76, 0.1);
}

.account-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: #1765dc;
}

.account-card-red::before {
  background: #b90012;
}

.account-card-blue::before {
  background: #1765dc;
}

.bank-topline {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.bank-wordmark {
  display: block;
  width: 100%;
  max-width: 286px;
  height: auto;
}

.cimb-main {
  fill: #9b0010;
  font-size: 31px;
  font-weight: 950;
  letter-spacing: 1px;
}

.cimb-bank {
  fill: #9b0010;
  font-size: 31px;
  font-weight: 500;
  letter-spacing: 1px;
}

.woori-ko {
  fill: #0054a8;
  font-size: 25px;
  font-weight: 950;
  letter-spacing: -1px;
}

.woori-en {
  fill: #0054a8;
  font-size: 23px;
  font-style: italic;
  font-weight: 950;
  letter-spacing: -0.5px;
}

.bank-country,
.bank-topline h2 {
  margin: 0;
}

.bank-country {
  color: #8e96a5;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.bank-topline h2 {
  margin-top: 3px;
  color: #101725;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

.account-detail {
  display: grid;
  gap: 7px;
  padding: 12px 0;
  border-top: 1px solid #eef1f6;
}

.account-detail span {
  color: #7d8796;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.account-detail strong,
.copy-value {
  color: #14213a;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
  text-align: left;
}

.copy-value {
  width: fit-content;
  border: 0;
  border-radius: 12px;
  padding: 0;
  background: transparent;
  color: #0d3f9e;
  cursor: pointer;
}

.account-note {
  margin: 6px 0 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f5f8fc;
  color: #5f6978;
  font-size: 13px;
  font-weight: 800;
}

.qr-preview {
  width: 100%;
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid #f2c9d8;
  border-radius: 16px;
  padding: 10px;
  background: #fff7fa;
  color: #b90046;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.qr-preview img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  object-position: center;
}

.qr-dialog {
  width: min(calc(100% - 28px), 420px);
  border: 0;
  border-radius: 24px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(11, 18, 32, 0.28);
}

.qr-dialog.is-open {
  display: block;
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
}

body.qr-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(16, 23, 37, 0.45);
  backdrop-filter: blur(2px);
}

.qr-dialog::backdrop {
  background: rgba(16, 23, 37, 0.45);
  backdrop-filter: blur(2px);
}

.qr-dialog img {
  display: block;
  width: 100%;
  border-radius: 18px;
}

.qr-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 23, 37, 0.72);
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.trust-row div {
  border: 1px solid #e5ebf4;
  border-radius: 14px;
  padding: 10px 8px;
  background: #ffffff;
  color: #5f6978;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.verify-note {
  margin: 2px 0 0;
  color: #8e96a5;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.preset-row button:active,
.dialog-actions button:active {
  transform: translateY(1px);
}

.rate-dialog {
  width: min(calc(100% - 36px), 380px);
  border: 0;
  border-radius: 22px;
  padding: 0;
  box-shadow: 0 24px 60px rgba(11, 18, 32, 0.28);
}

.rate-dialog::backdrop {
  background: rgba(16, 23, 37, 0.34);
  backdrop-filter: blur(2px);
}

.rate-panel {
  padding: 24px;
}

.rate-panel h2 {
  margin: 0 0 18px;
  font-size: 22px;
  letter-spacing: 0;
}

.rate-panel label {
  display: block;
  margin-bottom: 8px;
  color: #667085;
  font-size: 14px;
  font-weight: 800;
}

.rate-panel .second-rate-label {
  margin-top: 18px;
}

.rate-panel input {
  width: 100%;
  height: 54px;
  border: 1px solid #d7dde8;
  border-radius: 12px;
  padding: 0 14px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  outline: 0;
}

.rate-panel input:focus {
  border-color: #1765dc;
  box-shadow: 0 0 0 4px rgba(23, 101, 220, 0.12);
}

.preset-row,
.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.preset-row button,
.dialog-actions button {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid #dce2ec;
  background: #f8fafc;
  color: #233047;
  font-weight: 800;
  cursor: pointer;
}

.preset-row button {
  flex: 1;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

.dialog-actions button {
  padding: 0 18px;
}

.dialog-actions .primary {
  border-color: #1765dc;
  background: #1765dc;
  color: white;
}

.dialog-actions .secondary {
  background: white;
}

@media (max-width: 380px) {
  .app-shell {
    padding-left: 16px;
    padding-right: 16px;
    gap: 10px;
  }

  .converter {
    padding: 22px 18px 18px;
    border-radius: 20px;
  }

  .market-card {
    padding: 11px 13px 9px;
  }

  .market-chart {
    height: 58px;
  }

  .market-title,
  .market-rate {
    font-size: 17px;
  }

  .axis-labels {
    height: 44px;
    font-size: 12px;
  }

  .date-row {
    font-size: 12px;
  }

  .currency-row {
    min-height: 88px;
  }

  .currency-label,
  .code {
    font-size: 13px;
  }
}
