:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface2: #1e293b;
  --border: rgba(148, 163, 184, 0.16);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #06b6d4;
  --accent-soft: rgba(6, 182, 212, 0.14);
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #f43f5e;
  --violet: #a855f7;
}
html.light {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface2: #e2e8f0;
  --border: rgba(15, 23, 42, 0.10);
  --text: #0f172a;
  --muted: #475569;
  --accent: #0891b2;
  --accent-soft: rgba(8, 145, 178, 0.12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100dvh; padding-bottom: 84px;
}
.hidden { display: none !important; }
.container { max-width: 600px; margin: 0 auto; padding: 14px 14px 24px; }
header.topbar {
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar-in {
  max-width: 600px; margin: 0 auto; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand-dot {
  width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft);
  border: 1.5px solid var(--accent); display: grid; place-items: center; color: var(--accent); font-size: 14px; font-weight: 900;
}
.icon-btn {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 10px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn {
  background: var(--accent); color: #041016; border: none; border-radius: 12px;
  padding: 10px 15px; font-size: 14px; font-weight: 700; cursor: pointer; transition: transform .1s;
}
.btn:active { transform: scale(0.97); }
.btn-sec { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(244, 63, 94, 0.14); color: var(--danger); border: 1px solid rgba(244, 63, 94, 0.3); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 8px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; margin-bottom: 12px;
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; }
.stat-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-val { font-size: 16px; font-weight: 800; margin-top: 3px; word-break: break-word; }
.pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  white-space: nowrap; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border); cursor: pointer;
}
.pill.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
}
.b-ok { background: rgba(16, 185, 129, 0.14); color: var(--ok); }
.b-warn { background: rgba(245, 158, 11, 0.16); color: var(--warn); }
.b-danger { background: rgba(244, 63, 94, 0.16); color: var(--danger); }
.b-accent { background: var(--accent-soft); color: var(--accent); }
.b-violet { background: rgba(168, 85, 247, 0.16); color: var(--violet); }
.b-muted { background: var(--surface2); color: var(--muted); }
.asset-card { cursor: pointer; transition: border-color .15s; }
.asset-card:hover { border-color: var(--accent); }
.asset-title { font-size: 16px; font-weight: 700; }
.muted { color: var(--muted); font-size: 12px; }
.fab {
  position: fixed; right: 16px; bottom: 78px; z-index: 25;
  width: 52px; height: 52px; border-radius: 16px; border: none; background: var(--accent);
  color: #041016; font-size: 26px; font-weight: 800; box-shadow: 0 8px 24px rgba(6, 182, 212, 0.35); cursor: pointer;
}
nav.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar-in { width: 100%; max-width: 600px; display: grid; grid-template-columns: repeat(4, 1fr); }
.tab-btn {
  background: none; border: none; color: var(--muted); padding: 10px 4px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.tab-btn span.ico { font-size: 18px; }
.tab-btn.active { color: var(--accent); }
.modal-bg {
  position: fixed; inset: 0; z-index: 50; background: rgba(2, 6, 23, 0.72);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
@media (min-width: 640px) { .modal-bg { align-items: center; padding: 16px; } }
.modal {
  width: 100%; max-width: 540px; max-height: 92dvh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px 20px 0 0; padding: 18px 16px 26px;
}
@media (min-width: 640px) { .modal { border-radius: 20px; } }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea, .compact-in {
  width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; font-family: inherit;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.auth-wrap { max-width: 390px; margin: 54px auto 0; padding: 0 16px; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); font-size: 14px; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 80;
  background: #0f172a; color: #f8fafc; border: 1px solid var(--accent);
  padding: 9px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; max-width: 90vw; text-align: center;
}
.tco-bar {
  display: flex; height: 7px; border-radius: 999px; overflow: hidden;
  background: var(--surface2); margin: 8px 0 6px; gap: 2px;
}
.tco-seg { height: 100%; min-width: 4px; border-radius: 2px; }
.tco-legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--muted); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
html, body { overflow-x: clip; }
.search-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.search-bar input { grid-column: 1 / -1; min-width: 0; width: 100%; }
.search-bar select { min-width: 0; width: 100%; }
.search-bar input, .search-bar select { padding: 8px 10px; font-size: 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.inline-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-top: 8px; }
.inline-add input { padding: 7px 9px; font-size: 13px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.sub-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.preset-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.preset-chip {
  padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; cursor: pointer;
  background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.hint-box {
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 11px; padding: 8px 11px; font-size: 12px; margin-bottom: 10px; color: var(--text);
}
.warn-strip {
  background: rgba(245, 158, 11, 0.10); border: 1px solid rgba(245, 158, 11, 0.30);
  border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px;
}
.plan-strip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px 12px; margin-bottom: 10px; font-size: 12px; display: flex; justify-content: space-between; align-items: center;
}
