:root {
  color-scheme: dark;
  font-family:
    Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", Inter, system-ui, sans-serif;
  background: #07111f;
  color: #ecf5f3;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(31, 194, 168, 0.13), transparent 32rem),
    linear-gradient(155deg, #07111f 0%, #091825 48%, #07131d 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.shell {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 42px) 40px;
}

.login-layout {
  min-height: calc(100vh - 62px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid #1b3542;
  border-radius: 24px;
  background: rgba(9, 24, 36, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid #2e7f78;
  border-radius: 16px;
  background: linear-gradient(145deg, #153b41, #0a202c);
  color: #42d6bf;
  font-size: 25px;
  font-weight: 800;
}

.brand-mark-small {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 21px;
}

.eyebrow {
  margin: 18px 0 4px;
  color: #41d0bc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: 19px;
  letter-spacing: -0.03em;
}

.login-copy {
  margin-bottom: 28px;
  color: #8da5ae;
  line-height: 1.65;
}

form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 6px;
  color: #b8c9cf;
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid #29414c;
  border-radius: 12px;
  outline: none;
  background: #07151f;
  color: #f3faf8;
}

input:focus {
  border-color: #2ebda8;
  box-shadow: 0 0 0 3px rgba(46, 189, 168, 0.12);
}

.primary-button,
.secondary-button,
.text-button {
  border: 0;
  border-radius: 11px;
  font-weight: 800;
}

.primary-button {
  min-height: 50px;
  margin-top: 6px;
  background: #28bda7;
  color: #031915;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.secondary-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #2b4a54;
  background: #102632;
  color: #d5e6e6;
}

.text-button {
  min-height: 38px;
  padding: 0 8px;
  background: transparent;
  color: #8fa7af;
}

.form-error,
.dashboard-error {
  min-height: 20px;
  margin: 0;
  color: #ff8e9d;
  font-size: 13px;
}

.paper-notice {
  display: grid;
  gap: 4px;
  margin-top: 24px;
  padding: 15px;
  border: 1px solid rgba(249, 166, 66, 0.25);
  border-radius: 12px;
  background: rgba(249, 166, 66, 0.07);
}

.paper-notice strong {
  color: #ffc374;
  font-size: 13px;
}

.paper-notice span {
  color: #9fb0b5;
  font-size: 12px;
  line-height: 1.5;
}

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

.brand-row,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-row .eyebrow {
  margin: 0 0 3px;
}

.brand-row h1 {
  margin: 0;
  font-size: 25px;
}

.status-chip,
.mode-chip,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip {
  min-height: 34px;
  padding: 0 12px;
}

.status-ok {
  border: 1px solid rgba(50, 213, 169, 0.35);
  background: rgba(50, 213, 169, 0.1);
  color: #56dfbd;
}

.status-warn {
  border: 1px solid rgba(249, 166, 66, 0.35);
  background: rgba(249, 166, 66, 0.1);
  color: #ffc374;
}

.safety-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 17px 19px;
  border: 1px solid rgba(255, 104, 128, 0.3);
  border-radius: 16px;
  background: linear-gradient(110deg, rgba(91, 25, 45, 0.42), rgba(25, 31, 46, 0.68));
}

.safety-banner strong {
  color: #ff9cad;
}

.safety-banner p {
  margin: 5px 0 0;
  color: #b8aab1;
  font-size: 13px;
}

.mode-chip {
  min-height: 34px;
  padding: 0 13px;
  background: #2ac4ad;
  color: #041d18;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-card,
.panel {
  border: 1px solid #18323f;
  background: rgba(9, 25, 37, 0.84);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14);
}

.summary-card {
  min-height: 124px;
  padding: 18px;
  border-radius: 15px;
}

.summary-card-primary {
  border-color: #24655f;
  background: linear-gradient(145deg, rgba(24, 66, 66, 0.78), rgba(9, 25, 37, 0.92));
}

.summary-card span {
  display: block;
  margin-bottom: 14px;
  color: #8fa6ae;
  font-size: 12px;
  font-weight: 700;
}

.summary-card strong {
  display: block;
  overflow: hidden;
  color: #f0f8f7;
  font-size: clamp(19px, 2.3vw, 27px);
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-card small {
  display: block;
  margin-top: 8px;
  color: #718b95;
  font-size: 11px;
}

.positive {
  color: #45d7b5 !important;
}

.negative {
  color: #ff7890 !important;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 20px;
  border-radius: 16px;
}

.panel-wide {
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-header .eyebrow {
  margin: 0 0 4px;
}

.count-badge {
  min-width: 45px;
  min-height: 28px;
  padding: 0 9px;
  background: #112b36;
  color: #73cfc2;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #142c37;
  text-align: right;
}

th {
  color: #718b94;
  font-size: 11px;
  font-weight: 700;
}

th:first-child,
td:first-child {
  padding-left: 0;
  text-align: left;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

td {
  color: #c8d6da;
}

.market-name {
  color: #eef7f5;
  font-weight: 800;
}

.empty-state {
  margin: 18px 0 4px;
  color: #6d8791;
  font-size: 13px;
  text-align: center;
}

.status-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.status-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid #142c37;
}

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

.status-list dt {
  color: #78919a;
  font-size: 12px;
}

.status-list dd {
  margin: 0;
  color: #d7e4e5;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.wallet-list {
  display: grid;
  gap: 10px;
}

.wallet-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: #0b202b;
}

.wallet-symbol {
  color: #54d7c1;
  font-size: 13px;
  font-weight: 900;
}

.wallet-values {
  min-width: 0;
  text-align: right;
}

.wallet-values strong,
.wallet-values small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-values strong {
  color: #dbe8e8;
  font-size: 13px;
}

.wallet-values small {
  margin-top: 4px;
  color: #6f8992;
  font-size: 11px;
}

.dashboard-error {
  margin: 14px 0 0;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 2px 0;
  color: #5f7983;
  font-size: 11px;
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .shell {
    padding: 14px 12px 28px;
  }

  .login-card {
    padding: 26px 20px;
    border-radius: 20px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
  }

  .status-chip {
    width: auto;
  }

  .safety-banner {
    align-items: flex-start;
  }

  .safety-banner p {
    line-height: 1.5;
  }

  .summary-grid {
    gap: 9px;
  }

  .summary-card {
    min-height: 112px;
    padding: 15px;
  }

  .summary-card strong {
    font-size: 19px;
  }

  .panel {
    padding: 17px 14px;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 390px) {
  .brand-row h1 {
    font-size: 20px;
    white-space: nowrap;
  }

  .brand-mark-small {
    width: 40px;
    height: 40px;
  }

  .summary-card span {
    margin-bottom: 11px;
  }

  .summary-card strong {
    font-size: 17px;
  }
}
