
:root {
  color-scheme: light;
  --bg: #f4f6f7;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #647381;
  --line: #dce3e8;
  --accent: #0f766e;
  --accent-2: #155e75;
  --soft: #e3f3ef;
  --warn: #b45309;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
button, input, select { font: inherit; }
.app { width: min(100%, 980px); margin: 0 auto; min-height: 100vh; padding: 12px 10px 72px; }
.shell-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 246, 247, .96);
  backdrop-filter: blur(10px);
  padding: 8px 0 10px;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-radius: 8px;
  padding: 14px;
}
.brand-title { font-size: 22px; font-weight: 800; letter-spacing: 0; }
.brand-sub { font-size: 13px; opacity: .88; margin-top: 2px; }
.ghost {
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 8px;
  padding: 9px 10px;
}
.login {
  display: grid;
  align-content: center;
  min-height: calc(100vh - 24px);
  gap: 12px;
}
.login-card, .card, .row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.login-card { padding: 18px; }
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 28px; }
h2 { font-size: 20px; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.field { display: grid; gap: 6px; margin-top: 14px; }
.field label { color: var(--muted); font-size: 14px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 13px 12px;
  min-height: 46px;
}
.primary {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  min-height: 48px;
  margin-top: 14px;
}
.error { color: #b42318; min-height: 20px; font-size: 14px; margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.card { padding: 12px; min-height: 74px; }
.card-label { color: var(--muted); font-size: 12px; }
.card-value { font-size: 22px; font-weight: 850; margin-top: 3px; color: var(--ink); }
.toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.list { display: grid; gap: 8px; }
.row { padding: 12px; }
.row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.title { font-weight: 800; overflow-wrap: anywhere; }
.amount { color: var(--accent); font-weight: 850; white-space: nowrap; }
.meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.tag { display: inline-flex; align-items: center; background: var(--soft); color: #0f5f59; border-radius: 999px; padding: 3px 8px; font-size: 12px; margin: 6px 4px 0 0; }
.tag.warn { background: #fff7ed; color: var(--warn); }
.hidden { display: none !important; }
.install { margin-top: 8px; display: none; }
.install.show { display: block; }
.empty { color: var(--muted); text-align: center; padding: 18px; }
.rule { margin-bottom: 8px; }
.rule strong { display: block; margin-bottom: 3px; }
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr; }
  .brand-title { font-size: 20px; }
}
