:root {
  color-scheme: light dark;
  --bg: light-dark(#fff, #212121);
  --fg: light-dark(#0d0d0d, #ececec);
  --muted: light-dark(#5d5d5d, #a3a3a3);
  --border: light-dark(#e5e5e5, #3d3d3d);
  --input: light-dark(#fff, #2a2a2a);
  --hover: light-dark(#f4f4f4, #2f2f2f);
  --primary: light-dark(#0d0d0d, #ececec);
  --primary-fg: light-dark(#fff, #0d0d0d);
  --ring: light-dark(#0d0d0d26, #ececec33);
  --danger: light-dark(#dc2626, #f87171);
  --radius: 8px;
  --warn-bg: light-dark(#fff7ed, #2b1d12);
  --warn-border: light-dark(#fdba74, #7c3a12);
}
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  color: var(--fg);
  font:
    14px / 1.5 ui-sans-serif,
    -apple-system,
    system-ui,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  margin: 0;
}
main {
  max-width: 22rem;
  margin: clamp(2rem, 14vh, 8rem) auto 4rem;
  padding: 0 1.25rem;
}
h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 0.5rem;
  overflow-wrap: anywhere;
}
p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
p strong {
  color: var(--fg);
  font-weight: 500;
}
form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}
fieldset {
  display: grid;
  gap: inherit;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.field {
  display: grid;
  gap: 0.4rem;
}
label {
  font-size: 13px;
  font-weight: 500;
}
input:not([type="checkbox"]):not([type="file"]),
select,
textarea {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem;
  font: inherit;
  color: var(--fg);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px #0000000d;
  outline: 0;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
textarea {
  height: auto;
  min-height: 60px;
  padding: 0.5rem 0.75rem;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--muted);
  box-shadow: 0 0 0 3px var(--ring);
}
[aria-invalid="true"] {
  border-color: var(--danger) !important;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.hint.error {
  color: var(--danger);
}
.hint:empty {
  display: none;
}
input[type="file"] {
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  width: 100%;
  padding: 0.25rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
input[type="file"]::file-selector-button {
  height: 28px;
  margin-right: 0.75rem;
  padding: 0 0.75rem;
  font: inherit;
  font-weight: 500;
  color: var(--fg);
  background: var(--hover);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 400;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}
button {
  height: 36px;
  padding: 0 1rem;
  font: inherit;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s,
    opacity 0.15s;
}
button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--ring);
}
button:disabled,
input:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: default;
}
.primary {
  background: var(--primary);
  color: var(--primary-fg);
  width: 100%;
}
.primary:hover:not(:disabled) {
  opacity: 0.88;
}
.ghost {
  background: transparent;
  color: var(--muted);
  width: 100%;
  margin-top: -0.5rem;
}
.ghost:hover {
  background: var(--hover);
  color: var(--fg);
}
.outline {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}
.outline:hover {
  background: var(--hover);
}
.wide {
  width: 100%;
}
.footnote {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 12px;
  opacity: 0.7;
}
progress {
  width: 100%;
  height: 4px;
  appearance: none;
  border: 0;
  border-radius: 99px;
  background: var(--hover);
  overflow: hidden;
}
progress::-webkit-progress-bar {
  background: var(--hover);
}
progress::-webkit-progress-value {
  background: var(--primary);
  border-radius: 99px;
}
progress::-moz-progress-bar {
  background: var(--primary);
}
dl {
  margin: 1.25rem 0 0;
  border-top: 1px solid var(--border);
}
dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.ok {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-weight: 500;
  color: var(--fg);
}
.ok svg {
  flex: none;
}
[hidden] {
  display: none !important;
}
@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
  main {
    max-width: 28rem;
  }
  h1 {
    font-size: 26px;
  }
  label {
    font-size: 14px;
  }
  input:not([type="checkbox"]):not([type="file"]),
  select,
  button {
    height: 42px;
  }
  textarea {
    min-height: 72px;
  }
  .ok {
    font-size: 18px;
  }
  .ok svg {
    width: 20px;
    height: 20px;
  }
}
#heading:has(strong) {
  font-weight: 400;
}
#heading strong {
  font-weight: 600;
}
.about {
  margin: 0.35rem 0 0;
  font-size: 13px;
  color: var(--muted);
}
code {
  font:
    13px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  background: var(--hover);
  color: var(--fg);
}
.group {
  display: grid;
  gap: 1rem;
}
form.plain {
  display: block;
  margin: 0;
}
.hint a {
  color: var(--fg);
  text-underline-offset: 2px;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--fg);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 1.25rem 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.comdirect .check {
  font-weight: 500;
  position: relative;
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  cursor: pointer;
}
.comdirect .check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.comdirect .check .box {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 0.15rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--muted);
  border-radius: 4px;
  background: var(--input);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.comdirect .check .box::after {
  content: "";
  display: none;
  width: 4px;
  height: 8px;
  margin-top: -2px;
  border: solid var(--primary-fg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.comdirect .check input:checked + .box {
  background: var(--primary);
  border-color: var(--primary);
}
.comdirect .check input:checked + .box::after {
  display: block;
}
.comdirect .check input:focus-visible + .box {
  box-shadow: 0 0 0 3px var(--ring);
}
.comdirect .check.warn {
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  background: var(--warn-bg);
}
.switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.switch-title {
  display: block;
}
.switch .hint {
  display: block;
  font-weight: 400;
}
.track {
  flex: none;
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: light-dark(#d4d4d4, #4a4a4a);
  transition: background 0.15s;
}
.track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: light-dark(#fff, #ececec);
  box-shadow: 0 1px 2px #00000033;
  transition:
    transform 0.15s,
    background 0.15s;
}
.switch input:checked + .track {
  background: var(--primary);
}
.switch input:checked + .track::after {
  transform: translateX(16px);
  background: var(--primary-fg);
}
.switch input:focus-visible + .track {
  box-shadow: 0 0 0 3px var(--ring);
}
summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-top: -3px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform 0.15s;
}
details[open] summary::after {
  margin-top: 2px;
  transform: rotate(-135deg);
}
summary:hover {
  color: var(--fg);
}
summary:focus-visible {
  outline: 0;
  border-radius: 4px;
  box-shadow: 0 0 0 3px var(--ring);
}
details[open] > .group {
  margin-top: 0.75rem;
}
.comdirect .primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
main.prose {
  max-width: 38rem;
}
.prose h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.5rem;
}
.prose p {
  color: var(--fg);
}
.prose p.muted,
.muted {
  color: var(--muted);
}
.muted {
  font-size: 13px;
}
a {
  color: var(--fg);
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
}
a:hover {
  text-decoration-color: currentColor;
}
@media (min-width: 768px) {
  .prose h2 {
    font-size: 18px;
  }
}
main.setup-guide {
  max-width: 40rem;
}
main.setup-guide h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.25rem;
}
.step {
  margin-top: 1rem;
}
.step-hint {
  margin: 0.4rem 0 0;
}
.or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0 -0.75rem;
  font-size: 12px;
  color: var(--muted);
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}
.recommended {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.45rem;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  vertical-align: middle;
}
.step-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.copyable {
  position: relative;
}
.copyable pre,
.copyable code {
  display: block;
  margin: 0;
  padding: 0.7rem 5.5rem 0.7rem 0.8rem;
  font:
    12.5px / 1.55 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  color: var(--fg);
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.copyable pre {
  max-height: 17rem;
  overflow: auto;
}
.copyable .copy {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  height: 30px;
  padding: 0 0.75rem;
  font-size: 13px;
  background: var(--bg);
}
.actions {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
#resultTitle {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}
#resultTitle svg {
  flex: none;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0.75rem 0 0;
  color: var(--fg);
}
.card-head {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.side {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}
.side.buy {
  background: light-dark(#dcfce7, #14341f);
  color: light-dark(#166534, #86efac);
}
.side.sell {
  background: light-dark(#fee2e2, #3a1414);
  color: light-dark(#991b1b, #fca5a5);
}
.card-title {
  font-weight: 600;
  font-size: 15px;
  margin-top: 0.2rem;
  overflow-wrap: anywhere;
}
.card-sub {
  font-size: 12px;
  color: var(--muted);
}
.card dl {
  margin: 0;
  padding: 0.4rem 0.9rem 0.5rem;
}
.card dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
}
.card dt {
  color: var(--muted);
}
.card dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.card .total {
  border-top: 1px solid var(--border);
  margin-top: 0.3rem;
  padding-top: 0.55rem;
  font-weight: 600;
}
.card .total dt {
  color: var(--fg);
}
.order-confirm .card dl {
  border-top: 0;
}
.order-confirm .card dl div {
  border-bottom: 0;
}

@media (min-width: 1024px) {
  html {
    font-size: 16px;
    line-height: 1.6;
  }
  main {
    max-width: 560px;
    margin: 64px auto;
  }
  h1 {
    font-size: 30px;
  }
  input:not([type="checkbox"]):not([type="file"]),
  select,
  button {
    height: 44px;
  }
  main.prose {
    max-width: 840px;
    font-size: 18px;
    line-height: 1.65;
  }
  .prose h2 {
    font-size: 22px;
  }
  .prose .muted {
    font-size: 14px;
  }
  main.setup-guide {
    max-width: 840px;
  }
  main.setup-guide h2 {
    font-size: 20px;
  }
  .step-title {
    font-size: 15px;
  }
  .copyable pre,
  .copyable code {
    font-size: 14px;
  }
}
