:root {
  color-scheme: dark;
  --bg: #061019;
  --panel: rgba(12, 28, 41, 0.86);
  --panel-2: rgba(18, 39, 56, 0.74);
  --line: rgba(143, 184, 211, 0.18);
  --text: #e9f4fb;
  --muted: #8da8ba;
  --cyan: #63d8ff;
  --green: #32dfa0;
  --gold: #ffd166;
  --red: #ff718c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: "Noto Sans KR", "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(36, 155, 194, 0.2), transparent 34rem),
    radial-gradient(circle at 88% 20%, rgba(44, 214, 157, 0.12), transparent 30rem),
    linear-gradient(145deg, #040b12, var(--bg) 55%, #071622);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.16;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

a { color: inherit; text-decoration: none; }

button, input, select {
  font: inherit;
}

button { cursor: pointer; }

.shell {
  position: relative;
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(99, 216, 255, 0.42);
  border-radius: 15px;
  color: var(--cyan);
  background: rgba(99, 216, 255, 0.08);
  box-shadow: inset 0 0 26px rgba(99, 216, 255, 0.1);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.brand-mark img {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.brand strong { display: block; letter-spacing: 0.08em; }
.brand small, .muted { color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

.account-welcome {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(84, 207, 255, 0.18);
  border-radius: 12px;
  background: rgba(8, 29, 43, 0.7);
  color: #c4e5f5;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.credential-renewal-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -10px 0 20px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 209, 102, 0.38);
  border-radius: 14px;
  background: rgba(76, 57, 17, 0.82);
  box-shadow: var(--shadow);
  color: #ffe6a3;
  font-size: 0.82rem;
}

.credential-renewal-banner strong {
  flex: 0 0 auto;
  color: var(--gold);
}

.credential-renewal-banner.critical {
  border-color: rgba(255, 113, 140, 0.48);
  background: rgba(82, 25, 39, 0.86);
  color: #ffd1da;
}

.credential-renewal-banner.critical strong {
  color: #ff91a6;
}

.credential-renewal-banner.is-hidden {
  display: none;
}

.button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(15, 35, 50, 0.78);
  transition: 160ms ease;
}

.button:hover:not(:disabled) {
  border-color: rgba(99, 216, 255, 0.55);
  transform: translateY(-1px);
}

.button:disabled { cursor: not-allowed; opacity: 0.42; }

.button.primary {
  border-color: rgba(50, 223, 160, 0.35);
  color: #02110b;
  background: linear-gradient(135deg, #58edb5, #38c993);
  font-weight: 700;
}

.button.danger {
  border-color: rgba(255, 113, 140, 0.3);
  color: #ffdce3;
  background: rgba(255, 113, 140, 0.1);
}

.button.small { min-height: 34px; padding: 0 12px; font-size: 0.82rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, var(--panel), rgba(7, 19, 29, 0.9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.panel-pad { padding: 24px; }

.eyebrow {
  margin: 0 0 9px;
  color: var(--cyan);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(1.8rem, 4vw, 3.4rem); line-height: 1.05; }
h2 { margin-bottom: 8px; font-size: 1.16rem; }

.lead {
  max-width: 700px;
  margin-bottom: 22px;
  color: #a9c0cf;
  line-height: 1.7;
}

.state-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.78rem;
  font-weight: 700;
}

.state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60788a;
  content: "";
}

.state.ok { color: #9af3ce; border-color: rgba(50, 223, 160, 0.26); }
.state.ok::before { background: var(--green); box-shadow: 0 0 12px var(--green); }
.state.warn { color: #ffe1a0; border-color: rgba(255, 209, 102, 0.3); }
.state.warn::before { background: var(--gold); }
.state.bad { color: #ffb1c0; border-color: rgba(255, 113, 140, 0.3); }
.state.bad::before { background: var(--red); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.metric span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 0.76rem; }
.metric strong { font-family: "Space Grotesk", sans-serif; font-size: 1.12rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.stack { display: grid; gap: 13px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #a7becd; font-size: 0.78rem; font-weight: 700; }

.input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  outline: 0;
  border-radius: 11px;
  color: var(--text);
  background: rgba(2, 10, 16, 0.72);
}

.input:focus { border-color: rgba(99, 216, 255, 0.58); box-shadow: 0 0 0 3px rgba(99, 216, 255, 0.08); }

.note {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.note.error { color: #ff9eb1; }
.note.success { color: #84edc3; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.82rem; }
th { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.06em; }

.asset-list { display: flex; flex-wrap: wrap; gap: 8px; }
.asset-chip { padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.025); font-size: 0.78rem; }
.asset-chip strong { margin-left: 5px; color: #cff4ff; }

.logbox {
  max-height: 280px;
  overflow: auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #9bb3c2;
  background: rgba(1, 7, 11, 0.72);
  font: 0.75rem/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
}

.auth-story {
  padding: 48px;
  background:
    radial-gradient(circle at 20% 20%, rgba(99, 216, 255, 0.15), transparent 22rem),
    rgba(9, 24, 36, 0.85);
}

.auth-form { padding: 40px; background: rgba(5, 15, 23, 0.94); }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 26px; }
.auth-tab.active { border-color: rgba(99, 216, 255, 0.5); color: var(--cyan); }
.hidden { display: none !important; }

.exchange-ready {
  margin-top: 26px;
  padding: 17px;
  border: 1px solid rgba(99, 216, 255, 0.2);
  border-radius: 17px;
  background:
    radial-gradient(circle at 0 0, rgba(99, 216, 255, 0.1), transparent 15rem),
    rgba(3, 13, 21, 0.58);
}

.exchange-ready-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.exchange-ready-head > div {
  min-width: 0;
}

.exchange-ready-head strong,
.exchange-ready-head small {
  display: block;
}

.exchange-ready-head strong {
  color: #e9f7ff;
  font-size: 0.86rem;
}

.exchange-ready-head small {
  margin-top: 3px;
  color: #88a8bb;
  font-size: 0.69rem;
  line-height: 1.5;
}

.exchange-ready-icon {
  display: grid;
  flex: 0 0 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(99, 216, 255, 0.32);
  border-radius: 12px;
  background: rgba(99, 216, 255, 0.1);
  color: var(--cyan);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.exchange-ready-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.exchange-ready-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(143, 184, 211, 0.13);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.exchange-ready-grid article > strong {
  display: block;
  margin-top: 8px;
  color: #dcecf5;
  font-size: 0.73rem;
}

.exchange-ready-grid p {
  margin: 6px 0;
  color: #8faabd;
  font-size: 0.66rem;
  line-height: 1.55;
}

.exchange-ready-grid article > small {
  color: #a9bdc9;
  font-size: 0.62rem;
  line-height: 1.45;
}

.exchange-name {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.exchange-name.binance {
  background: rgba(255, 209, 102, 0.12);
  color: var(--gold);
}

.exchange-name.upbit {
  background: rgba(99, 216, 255, 0.11);
  color: var(--cyan);
}

.exchange-ready-foot {
  margin: 13px 0 0;
  padding-top: 11px;
  border-top: 1px solid rgba(143, 184, 211, 0.12);
  color: #91acbc;
  font-size: 0.65rem;
  line-height: 1.55;
}

.security-list { display: grid; gap: 12px; margin-top: 34px; color: #9bb3c2; font-size: 0.82rem; }
.security-list span::before { margin-right: 9px; color: var(--green); content: "✓"; }

.member-card { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.022); }
.member-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }

@media (max-width: 780px) {
  .hero, .grid, .auth-card { grid-template-columns: 1fr; }
  .auth-story { padding: 32px; }
  .auth-form { padding: 28px; }
  .topline { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 1240px); }
  .form-grid, .metric-grid { grid-template-columns: 1fr; }
  .exchange-ready-grid { grid-template-columns: 1fr; }
  .panel-pad { padding: 18px; }
}
