  *, *::before, *::after { box-sizing: border-box; }
  html, body {
    margin: 0;
    padding: 0;
    background: #F2F4F6;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    color: #191F28;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
  }
  input, button { font-family: inherit; }
  input[type="number"]::-webkit-inner-spin-button,
  input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  input[type="number"] { -moz-appearance: textfield; }

  .app {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    min-height: 100vh;
  }

  .header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 12px;
  }
  .header .label {
    font-size: 13px;
    color: #4E5968;
    margin: 0 0 6px;
    font-weight: 500;
  }
  .header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
  }

  .card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
  }

  .card label {
    display: block;
    font-size: 13px;
    color: #4E5968;
    margin-bottom: 8px;
    font-weight: 500;
  }

  .amount-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
  }
  .amount-input {
    flex: 1;
    font-size: 26px;
    font-weight: 700;
    border: none;
    background: transparent;
    padding: 0;
    outline: none;
    min-width: 0;
    color: #191F28;
    letter-spacing: -0.5px;
  }
  .amount-input::placeholder { color: #4E5968; }
  .amount-unit {
    font-size: 16px;
    color: #4E5968;
    font-weight: 500;
  }
  .amount-kr {
    font-size: 13px;
    color: #4E5968;
    margin: 4px 0 14px;
  }

  .preset-row {
    display: flex;
    gap: 6px;
  }
  .preset-btn {
    flex: 1;
    padding: 9px 0;
    font-size: 13px;
    font-weight: 500;
    background: #F2F4F6;
    border: none;
    border-radius: 10px;
    color: #4E5968;
    cursor: pointer;
    transition: all 0.15s;
  }
  .preset-btn:active { transform: scale(0.96); background: #134972; color: #FFFFFF; }

  .return-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  }
  .return-row .label-text { font-size: 13px; color: #4E5968; font-weight: 500; }
  .return-row .value {
    font-size: 17px;
    font-weight: 700;
    color: #191F28;
    letter-spacing: -0.3px;
  }
  .return-row .value.positive { color: #E8493B; }
  .return-row .value.negative { color: #134972; }

  input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #F2F4F6;
    border-radius: 3px;
    outline: none;
    margin: 6px 0 0;
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #134972;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #FFFFFF;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  }
  input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: #134972;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #FFFFFF;
  }
  .range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #4E5968;
    margin-top: 6px;
  }

  .section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 24px 4px 12px;
  }
  .section-header h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
  }
  .section-header .hint {
    font-size: 11px;
    color: #4E5968;
  }

  .broker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .broker-more-btn {
    width: 100%;
    padding: 14px;
    font-size: 13px;
    font-weight: 700;
    color: #4E5968;
    background: #FFFFFF;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
  }
  .broker-more-btn:active { transform: scale(0.98); background: #F2F4F6; }
  .broker-more-btn .chevron-sm {
    width: 14px;
    height: 14px;
    color: #4E5968;
    transition: transform 0.2s;
  }
  .broker-more-btn.open .chevron-sm { transform: rotate(180deg); }

  .broker-hidden { display: none; }
  .broker-hidden.show { display: block; }

  .broker-card {
    background: #FFFFFF;
    border-radius: 14px;
    padding: 16px 18px;
    transition: all 0.2s;
  }
  .broker-card.best {
    border: 2px solid #134972;
    padding: 15px 17px;
  }

  .broker-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
  }
  .broker-info { flex: 1; min-width: 0; }
  .broker-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
  }
  .broker-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
  }
  .badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    line-height: 1.4;
  }
  .badge-best {
    background: #134972;
    color: #FFFFFF;
  }
  .badge-event {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
  }

  .fee-display { text-align: right; flex-shrink: 0; }
  .fee-original {
    font-size: 11px;
    color: #4E5968;
    margin: 0;
    text-decoration: line-through;
  }
  .fee-final {
    font-size: 17px;
    font-weight: 700;
    margin: 2px 0 0;
    letter-spacing: -0.3px;
    color: #E8493B;
  }
  .fee-final.discount { color: #E8493B; }
  .fee-rate {
    font-size: 11px;
    color: #4E5968;
    margin: 2px 0 0;
  }

  .cta-btn {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: -0.2px;
  }
  .cta-btn:active { transform: scale(0.98); }

  .summary-card {
    background: #134972;
    color: #FFFFFF;
    border-radius: 16px;
    padding: 18px 20px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .summary-card .label-small {
    font-size: 12px;
    color: #F2F4F6;
    margin: 0 0 4px;
    font-weight: 500;
  }
  .summary-card .value-big {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
  }
  .summary-card .right { text-align: right; }
  .summary-card .label-tiny {
    font-size: 11px;
    color: #F2F4F6;
    margin: 0;
  }
  .summary-card .detail {
    font-size: 12px;
    color: #FFFFFF;
    margin: 3px 0 0;
    font-weight: 500;
  }

  .fee-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, margin 0.25s ease, padding 0.25s ease;
    margin-top: 0;
  }
  .fee-detail.open {
    max-height: 400px;
    margin-top: 12px;
  }
  .fee-detail-inner {
    background: #F2F4F6;
    border-radius: 10px;
    padding: 14px 16px;
  }
  .fee-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #191F28;
    margin: 0 0 8px;
  }
  .fee-section-title:not(:first-child) {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 0.5px solid #E8E4DC;
  }
  .fee-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
  }
  .fee-line-label {
    font-size: 12px;
    color: #4E5968;
  }
  .fee-line-value {
    font-size: 12px;
    font-weight: 500;
    color: #191F28;
  }
  .fee-line.subtotal {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 0.5px dashed #D5D0C6;
  }
  .fee-line.subtotal .fee-line-label {
    font-weight: 700;
    color: #191F28;
  }
  .fee-line.subtotal .fee-line-value {
    font-weight: 700;
  }
  .broker-card { cursor: pointer; }
  .chevron-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    color: #4E5968;
    transition: transform 0.2s;
    flex-shrink: 0;
  }
  .broker-card .chevron-icon.open { transform: rotate(180deg); }

  .market-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
  }
  .market-btn {
    flex: 1;
    padding: 8px;
    font-size: 12px;
    font-weight: 500;
    background: #FFFFFF;
    border: 0.5px solid #E0DCD3;
    border-radius: 10px;
    color: #4E5968;
    cursor: pointer;
    transition: all 0.15s;
  }
  .market-btn.active {
    background: #134972;
    color: #FFFFFF;
    border-color: #134972;
    font-weight: 700;
  }
  .market-btn:active { transform: scale(0.96); }

  .disclosure {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 16px;
    font-size: 13px;
    color: #4E5968;
    line-height: 1.6;
  }
  .disclosure strong { color: #191F28; font-weight: 700; }

  .footer {
    text-align: center;
    margin-top: 24px;
    padding: 16px 0;
    font-size: 11px;
    color: #4E5968;
  }

  .main-tab-row {
    display: flex;
    background: #134972;
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 20px;
  }
  .main-tab-btn {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #F2F4F6;
    cursor: pointer;
    transition: all 0.15s;
  }
  .main-tab-btn.active {
    background: #FFFFFF;
    color: #191F28;
    font-weight: 700;
  }
  .main-tab-btn:active { transform: scale(0.97); }

  .toggle-row {
    display: flex;
    background: #F2F4F6;
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 12px;
  }
  .toggle-btn {
    flex: 1;
    padding: 8px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #4E5968;
    cursor: pointer;
    transition: all 0.15s;
  }
  .toggle-btn.active {
    background: #FFFFFF;
    color: #191F28;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  }

  @media (max-width: 360px) {
    .amount-input { font-size: 22px; }
    .header h1 { font-size: 20px; }
  }

  .my-fee-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 0;
    margin-top: 12px;
    border-top: 0.5px solid #F2F4F6;
    cursor: pointer;
  }
  .my-fee-toggle span {
    font-size: 13px;
    font-weight: 500;
    color: #4E5968;
  }
  .my-fee-toggle .chevron-sm {
    width: 14px;
    height: 14px;
    color: #4E5968;
    transition: transform 0.2s;
  }
  .my-fee-toggle.open .chevron-sm { transform: rotate(180deg); }

  .my-fee-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .my-fee-panel.open {
    max-height: 300px;
  }
  .my-fee-fields {
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .my-fee-field label {
    display: block;
    font-size: 12px;
    color: #4E5968;
    margin-bottom: 4px;
    font-weight: 500;
  }
  .my-fee-input-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
  }
  .my-fee-input {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-bottom: 1.5px solid #E0DCD3;
    background: transparent;
    padding: 4px 0;
    outline: none;
    min-width: 0;
    color: #191F28;
    letter-spacing: -0.3px;
    transition: border-color 0.15s;
  }
  .my-fee-input:focus { border-bottom-color: #134972; }
  .my-fee-summary {
    margin-top: 14px;
    padding: 10px 14px;
    background: #134972;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .my-fee-summary .label {
    font-size: 13px;
    color: #F2F4F6;
    font-weight: 500;
    margin: 0;
  }
  .my-fee-summary .value {
    font-size: 17px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.3px;
  }
  .my-fee-unit {
    font-size: 13px;
    color: #4E5968;
    font-weight: 500;
    flex-shrink: 0;
  }

  .broker-card.my-card {
    background: #134972;
    color: #FFFFFF;
  }
  .broker-card.my-card .broker-name { color: #FFFFFF; }
  .broker-card.my-card .fee-final { color: #FFFFFF; }
  .broker-card.my-card .fee-rate { color: #F2F4F6; }
  .broker-card.my-card .badge-my {
    background: #FFFFFF;
    color: #134972;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
  }
  .broker-card.my-card .chevron-icon { color: #F2F4F6; }
  .broker-card.my-card .fee-detail-inner {
    background: #FFFFFF;
  }
  .broker-card.my-card .fee-section-title { color: #191F28; }
  .broker-card.my-card .fee-line-label { color: #4E5968; }
  .broker-card.my-card .fee-line-value { color: #191F28; }
  .broker-card.my-card .fee-line.subtotal .fee-line-label { color: #191F28; }
  .broker-card.my-card .fee-line.subtotal { border-top-color: #444; }
