:root {
  --color-bg: #fdfdfb;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #5b6470;
  --color-border: #d8dde5;
  --color-accent: #1d4ed8;            /* deep blue — avoids red-only emphasis */
  --color-accent-soft: #dbeafe;
  --color-active: #1d4ed8;
  --color-highlight: #0b67d4;
  --color-warn: #b45309;
  --font-jp: "BIZ UDPGothic", "Yu Gothic", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  --shadow-card: 0 1px 3px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  --radius: 8px;
}

html, body { height: 100%; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-jp);
  font-size: clamp(15px, 1.05vw, 18px);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  padding: .8rem 1.4rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.app-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.app-subtitle {
  font-size: .85rem;
  color: var(--color-muted);
}

.app-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1rem 1.4rem;
}

.app-footer {
  flex-shrink: 0;
  padding: .6rem 1.4rem;
  font-size: .85rem;
  color: var(--color-muted);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  text-align: right;
}
.app-footer a {
  color: var(--color-accent);
  text-decoration: underline;
}

.loading {
  margin: 4rem auto;
  color: var(--color-muted);
  font-size: 1rem;
}

.error-banner {
  background: #fff3cd;
  color: var(--color-warn);
  padding: 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
}

/* Common button styling — used by both views */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: .5rem .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  min-height: 2.4rem;
}
.btn:hover { background: var(--color-accent-soft); border-color: var(--color-accent); color: var(--color-accent); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.is-active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.btn.is-active:hover { background: var(--color-accent); color: #fff; }
