:root {
  color-scheme: light;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #182230;
  font-size: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 720px; margin: 0 auto; min-height: 100vh; padding: 0 16px calc(92px + env(safe-area-inset-bottom)); }
.topbar { padding: calc(18px + env(safe-area-inset-top)) 2px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eyebrow { color: #667085; font-size: .75rem; font-weight: 800; letter-spacing: .08em; margin: 0 0 3px; }
h1 { margin: 0; font-size: 1.45rem; letter-spacing: -.035em; }
h2 { font-size: 1.05rem; margin: 0; letter-spacing: -.02em; }
h3 { font-size: .92rem; margin: 0; }
p { margin: 0; }
.muted { color: #667085; font-size: .83rem; }
.screen { display: grid; gap: 14px; }
.panel, .trade-card, .login-card { background: #fff; border: 1px solid #e6e9ef; border-radius: 18px; box-shadow: 0 3px 12px rgba(16, 24, 40, .035); }
.panel { padding: 16px; }
.panel-head, .row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head { margin-bottom: 12px; }
.stack { display: grid; gap: 10px; }
.stack-lg { display: grid; gap: 16px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: grid; gap: 5px; color: #475467; font-size: .78rem; font-weight: 700; }
input, select { width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid #d0d5dd; border-radius: 10px; color: #182230; background: #fff; }
input:focus, select:focus { outline: 3px solid #dbeafe; border-color: #3b82f6; }
input[type="color"] { padding: 3px; }
.button { border: 0; min-height: 40px; border-radius: 10px; padding: 9px 13px; font-weight: 800; background: #e9eef8; color: #344054; }
.button.primary { background: #3157d5; color: #fff; }
.button.danger { background: #fef0f0; color: #b42318; }
.button.ghost { background: transparent; border: 1px solid #d0d5dd; }
.button.small { min-height: 32px; padding: 6px 9px; font-size: .78rem; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.icon-button { border: 0; width: 34px; height: 34px; border-radius: 10px; background: #f2f4f7; color: #344054; font-weight: 900; }
.nav { position: fixed; z-index: 2; bottom: 0; left: 0; right: 0; margin: 0 auto; max-width: 720px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); border-top: 1px solid #e4e7ec; display: grid; grid-template-columns: repeat(4, 1fr); backdrop-filter: blur(12px); }
.nav button { border: 0; background: transparent; color: #667085; border-radius: 10px; padding: 7px 3px; font-size: .71rem; font-weight: 800; }
.nav button.active { color: #2649c0; background: #edf2ff; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { background: #f8faff; border-radius: 13px; padding: 11px 10px; }
.metric strong { display: block; color: #1d3da5; font-size: 1.2rem; }
.metric span { font-size: .73rem; color: #667085; }
.section-label { color: #475467; font-size: .8rem; font-weight: 900; margin: 4px 1px -4px; }
.trade-list, .data-list { display: grid; gap: 10px; }
.trade-card { padding: 14px; border-left: 4px solid #7c3aed; }
.trade-card.special { border-left-color: #2563eb; }
.trade-card.lucky { border-left-color: #d97706; }
.badge { display: inline-flex; align-items: center; min-height: 23px; border-radius: 999px; padding: 3px 8px; background: #eef2ff; color: #3949ab; font-size: .72rem; font-weight: 900; }
.badge.lucky { background: #fff4d6; color: #a15c00; }
.badge.done { background: #e8f7ed; color: #087443; }
.exchange { display: grid; grid-template-columns: 1fr 22px 1fr; gap: 6px; align-items: center; margin: 12px 0; }
.exchange-item { background: #f8fafc; border-radius: 11px; padding: 9px; min-width: 0; }
.exchange-item strong, .account-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arrow { color: #667085; text-align: center; font-weight: 900; }
.trade-meta { display: flex; justify-content: space-between; color: #667085; font-size: .76rem; margin-bottom: 11px; }
.empty { color: #667085; background: #f8fafc; border-radius: 12px; padding: 14px; text-align: center; font-size: .86rem; }
.account-tabs { overflow: auto; display: flex; gap: 7px; padding: 1px 0 3px; }
.account-tab { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; border: 1px solid #d0d5dd; border-radius: 999px; background: #fff; padding: 7px 10px; color: #475467; font-weight: 800; font-size: .78rem; }
.account-tab.active { border-color: #3157d5; color: #2649c0; background: #edf2ff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.inventory-row { display: grid; grid-template-columns: minmax(88px, 1fr) 118px 118px; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #eef0f4; }
.inventory-row:last-child { border-bottom: 0; }
.inventory-controls { display: grid; grid-template-columns: 30px minmax(32px, 1fr) 30px; align-items: center; gap: 3px; }
.inventory-controls input { min-height: 32px; padding: 3px; text-align: center; }
.inventory-controls button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: #eef2ff; color: #2444b5; font-weight: 900; }
.variant-label { display: block; color: #667085; font-size: .67rem; font-weight: 800; margin-bottom: 3px; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef0f4; }
.list-item:last-child { border-bottom: 0; }
.catalog-order-item { position: relative; transition: opacity .12s ease, background .12s ease; }
.catalog-order-item.dragging { opacity: .45; }
.catalog-order-item.drop-before::before, .catalog-order-item.drop-after::after { content: ''; position: absolute; left: 0; right: 0; height: 3px; border-radius: 999px; background: #3157d5; }
.catalog-order-item.drop-before::before { top: -2px; }
.catalog-order-item.drop-after::after { bottom: -2px; }
.catalog-order-name { display: inline-flex; align-items: center; gap: 9px; min-width: 0; font-weight: 800; }
.catalog-order-name small { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 8px; background: #f2f4f7; color: #667085; font-size: .7rem; }
.drag-handle { display: grid; place-items: center; width: 28px; height: 32px; flex: 0 0 28px; border-radius: 8px; color: #667085; cursor: grab; font-size: 1.1rem; line-height: 1; touch-action: none; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.order-actions { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.order-actions .button { min-width: 32px; padding-inline: 6px; }
.grade { color: #344054; font-size: .8rem; font-weight: 800; }
.grade.satisfied { color: #087443; }
.notice { padding: 10px 12px; border-radius: 10px; background: #edf7ff; color: #175c8b; font-size: .82rem; }
.error { padding: 10px 12px; border-radius: 10px; background: #fef0f0; color: #b42318; font-size: .82rem; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 380px); padding: 24px; display: grid; gap: 18px; }
.login-mark { width: 48px; height: 48px; border-radius: 15px; background: linear-gradient(135deg, #3157d5, #744cc6); display: grid; place-items: center; color: white; font-size: 1.4rem; }
.check-label { display: inline-flex; align-items: center; justify-self: start; gap: 8px; color: #475467; font-size: .84rem; font-weight: 700; cursor: pointer; }
.check-label input[type="checkbox"] { appearance: auto; width: 16px; min-width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; accent-color: #3157d5; }
.loading { min-height: 45vh; display: grid; place-items: center; gap: 10px; color: #667085; }
.spinner { width: 26px; height: 26px; border: 3px solid #dbe3f5; border-top-color: #3157d5; border-radius: 50%; animation: spin .75s linear infinite; }
.toast { position: fixed; z-index: 10; bottom: calc(86px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 12px; color: #fff; background: #182230; box-shadow: 0 8px 22px rgba(16,24,40,.23); font-size: .84rem; }
.toast.error { color: #fff; background: #b42318; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 440px) { .app-shell { padding-inline: 12px; } .inventory-row { grid-template-columns: minmax(67px, 1fr) 108px 108px; gap: 4px; } .split { grid-template-columns: 1fr; } }
