:root {
  --ink: #1E2A32;
  --paper: #EFE7D8;
  --paper-raised: #F7F2E6;
  --rust: #B3542B;
  --muted: #5C6670;
  --line: #C9BFA8;
  --ledger-green: #4B6B4F;

  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* App shell fills the viewport; header, content, and nav are fixed bands
   so it reads as an installed app rather than a scrolling web page. */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 480px;
  margin: 0 auto;
}

/* Header styled like a drawer label holder: dark plate, a small brass-ish
   pull tab, and the app name set in the display serif. */
.app-header {
  background: var(--ink);
  color: var(--paper);
  padding: 1.1rem 1.25rem 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-shrink: 0;
}

.app-header h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  margin: 0;
}

.app-header .tagline {
  font-size: 0.75rem;
  color: var(--line);
  margin-top: 0.15rem;
}

/* Update banner: a stamped-notice strip, hidden until JS reveals it. */
.update-banner {
  background: var(--rust);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
}

.update-banner.is-visible { display: flex; }

.update-banner p {
  margin: 0;
  font-size: 0.9rem;
}

.update-banner .actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.btn-ghost-on-rust {
  background: transparent;
  border: 1px solid var(--paper);
  color: var(--paper);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-ghost-on-rust.primary {
  background: var(--paper);
  color: var(--rust);
}

/* Main content area reads like an index card: raised paper, a single
   top rule instead of a shadowed "card" box. */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.25rem 1rem;
}

.screen { display: none; }
.screen.is-active { display: block; }

.screen h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  border-top: 2px solid var(--ink);
  padding-top: 0.6rem;
  margin: 0 0 0.9rem;
}

.screen p {
  color: var(--muted);
  margin: 0 0 1rem;
  max-width: 34ch;
}

.status-line {
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.2em;
}

.empty-state {
  border: 1px solid var(--line);
  padding: 1.25rem;
  text-align: left;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-primary:active { background: var(--rust); }

/* Bottom nav styled as three ledger tabs divided by hairlines, the active
   one marked with a rust top-border rather than a filled pill. */
.app-nav {
  display: flex;
  border-top: 1px solid var(--line);
  background: var(--paper-raised);
  flex-shrink: 0;
}

.app-nav button {
  flex: 1;
  background: none;
  border: none;
  border-top: 2px solid transparent;
  padding: 0.7rem 0.25rem 0.6rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
}

.app-nav button.is-active {
  color: var(--ink);
  border-top-color: var(--rust);
}

@media (prefers-reduced-motion: no-preference) {
  .update-banner.is-visible { animation: slide-down 180ms ease-out; }
}

@keyframes slide-down {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}
