:root {
  --ink: #1f2a2e;
  --paper: #f6f5f2;
  --line: #d8d2c6;
  --accent: #2f6f5e;
  --error: #a4243b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
  background: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 10;
}

a { color: var(--accent); }

main {
  max-width: 420px;
  margin: 0 auto;
  padding: 48px 20px;
}

.wide {
  max-width: 720px;
}

h1 { font-size: 1.5rem; margin: 0 0 8px; }
p.lead { color: #4b4b4b; margin: 0 0 28px; }

form { display: flex; flex-direction: column; gap: 16px; }

label { font-weight: 600; font-size: 0.95rem; }

input[type="email"],
input[type="password"],
input[type="text"] {
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 44px; /* tap target */
}

input:focus,
button:focus,
a:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

button {
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 18px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:disabled { opacity: 0.6; cursor: not-allowed; }
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.error {
  color: var(--error);
  font-size: 0.9rem;
  min-height: 1.2em;
}
.error[role="alert"]:empty { display: none; }

.field-hint { color: #666; font-size: 0.85rem; }

nav#nav-account {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  font-size: 0.9rem;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
}

/* App shell: bottom tab bar on phone, left sidebar on desktop (spec §1a) */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app-main {
  flex: 1;
  padding: 20px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 90px;
}
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 5;
}
.tabbar a {
  flex: 1;
  text-align: center;
  padding: 10px 4px 14px;
  font-size: 0.75rem;
  color: #666;
  text-decoration: none;
}
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }

@media (min-width: 720px) {
  .app { flex-direction: row; }
  .tabbar {
    position: static;
    flex-direction: column;
    width: 180px;
    border-top: none;
    border-right: 1px solid var(--line);
  }
  .tabbar a { text-align: left; padding: 14px 20px; font-size: 0.9rem; }
  .app-main { padding-bottom: 20px; }
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.next-step-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.pill {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f0;
  color: var(--ink);
}
.pill.yes { background: #e1f0e6; color: #1f6b3f; }
.pill.no { background: #f6e2e5; color: var(--error); }
.pill.pending { background: #f1efe8; color: #7a6f57; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tabs button {
  background: none;
  border: none;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 0;
  font-weight: 600;
  min-height: auto;
}
.tabs button[aria-selected="true"] {
  border-bottom: 3px solid var(--accent);
  color: var(--accent);
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }

textarea {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 120px;
}

.progress-dots { display: flex; gap: 6px; margin-bottom: 20px; }
.progress-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.progress-dots span.done { background: var(--accent); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
