:root {
  color-scheme: light dark;
  --fg: #1a1a1a;
  --bg: #ffffff;
  --muted: #6b7280;
  --accent: #2563eb;
  --border: #e5e7eb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #f2f2f2;
    --bg: #14161a;
    --muted: #9aa1ac;
    --border: #2a2d33;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 64px; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
h1 { font-size: 1.4rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 32px 0 8px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.9rem; }
button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  cursor: pointer;
}
.link-btn { background: none; color: var(--muted); text-decoration: underline; padding: 0; }
textarea, input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.95rem;
  background: transparent;
  color: var(--fg);
  margin: 8px 0;
}
#submit-form { display: flex; flex-direction: column; gap: 4px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 0.9rem; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; }
#submit-status { margin: 8px 0; font-size: 0.9rem; }

tr.date-group td {
  padding-top: 16px;
  padding-bottom: 4px;
  border-bottom: none;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.label-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  margin-left: 4px;
}
.amount-neg { color: #dc2626; white-space: nowrap; }
.amount-pos { color: #16a34a; white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  .amount-neg { color: #f87171; }
  .amount-pos { color: #4ade80; }
}

#app-view {
  position: relative;
  transition: transform 0.2s ease;
}
#app-view.ptr-dragging { transition: none; }
.ptr-indicator {
  position: absolute;
  top: -44px;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.ptr-indicator.ptr-visible { opacity: 1; }
.ptr-indicator.ptr-ready { color: var(--accent); font-weight: 600; }
