/* "Porchlight Navy" scheme (design/logo/README.md): deep navy carries the
   official-record tone; clay is a warm brand highlight, used sparingly. */
:root {
  --ink: #20242C;
  --muted: #667085;
  --accent: #24405A;
  --accent-warm: #B45335;
  --rule: #D8D9D4;
  --bg: #F7F6F2;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
main { max-width: 900px; margin: 1.5rem auto 4rem; padding: 0 1rem; }
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.25rem; background: #fff; border-bottom: 1px solid var(--rule);
}
.site-header .brand { display: inline-flex; align-items: center; text-decoration: none; }
.site-header .brand svg { display: block; }
.site-header nav { display: flex; gap: 1rem; align-items: center; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--accent); }
.inline-form { display: inline; }
.linklike {
  background: none; border: none; padding: 0; color: var(--muted);
  font: inherit; cursor: pointer;
}
.linklike:hover { color: var(--accent); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; margin-top: 2rem; }
a { color: var(--accent); }
.card {
  background: #fff; border: 1px solid var(--rule); border-radius: 8px;
  padding: 1.25rem; margin-bottom: 1rem;
}
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--rule); }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
td.num, th.num { text-align: right; }
.checklist { list-style: none; padding: 0; margin: 0.5rem 0 1rem; }
.checklist li { padding: 0.3rem 0; }
.checklist li.done { color: var(--muted); }
.checklist .check { display: inline-block; width: 1.3rem; font-weight: 700; }
.checklist li.done .check { color: #15803d; }
.checklist li:not(.done) .check { color: var(--accent-warm); }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover, .sort-active { color: var(--accent); }
.sort-arrow { font-size: 0.65em; margin-left: 0.3em; vertical-align: 0.1em; }
.summary-row td { font-weight: 600; background: var(--bg); }
form p { margin: 0.6rem 0; }
form label { display: block; font-size: 0.85rem; color: var(--muted); }
input, select, textarea {
  font: inherit; padding: 0.4rem 0.5rem; border: 1px solid var(--rule);
  border-radius: 6px; width: 100%; max-width: 26rem; background: #fff;
}
.inline-add input, .inline-add select { width: auto; }
button, .btn {
  font: inherit; padding: 0.45rem 0.9rem; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  text-decoration: none; display: inline-block;
}
.btn-secondary { background: #fff; color: var(--accent); }
.btn-danger { background: #fff; color: #b91c1c; border-color: #b91c1c; }
.btn-sm { padding: 0.15rem 0.5rem; font-size: 0.8rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; padding: 0;
  border-radius: 50%; border: 1px solid var(--accent);
  background: #fff; color: var(--accent);
  cursor: pointer; text-decoration: none; vertical-align: middle;
}
.icon-btn svg { width: 0.85rem; height: 0.85rem; display: block; }
.icon-btn:hover { background: var(--accent); color: #fff; }
.icon-btn-danger { border-color: #b91c1c; color: #b91c1c; }
.icon-btn-danger:hover { background: #b91c1c; color: #fff; }

/* Hover text for icon buttons — like a title tooltip, but appearing after
   0.2s instead of the browser's fixed ~1s delay. */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; z-index: 10; bottom: calc(100% + 0.4rem);
  left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  font-size: 0.75rem; font-weight: 400; line-height: 1.3;
  padding: 0.2rem 0.55rem; border-radius: 4px; white-space: nowrap;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s;
}
[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1; visibility: visible; transition-delay: 0.2s;
}
.flash { padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash-success { background: #ecfdf5; color: #065f46; }
.flash-error { background: #fef2f2; color: #991b1b; }
.muted { color: var(--muted); }
.errorlist { color: #b91c1c; margin: 0.2rem 0; padding-left: 1.1rem; font-size: 0.85rem; }
.year-block { margin-bottom: 1.5rem; }
.year-head { display: flex; justify-content: space-between; align-items: baseline; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.tabs {
  display: flex; gap: 0.25rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--rule); margin: 0 0 1.25rem;
}
.tabs a {
  padding: 0.45rem 0.9rem; color: var(--muted); text-decoration: none;
  border: 1px solid transparent; border-bottom: none;
  border-radius: 6px 6px 0 0; margin-bottom: -1px;
}
.tabs a:hover { color: var(--accent); }
.tabs a.active {
  background: #fff; border-color: var(--rule); color: var(--ink);
  font-weight: 600;
}
.in-progress { color: var(--muted); font-style: italic; }
/* Small screens: shrink the header, let wide tables scroll in place, and
   stack the inline course forms instead of wrapping mid-field. */
@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; gap: 0.35rem 0.75rem; padding: 0.6rem 0.75rem; }
  .site-header .brand svg { width: 157px; height: 24px; }
  .site-header nav { gap: 0.7rem; flex-wrap: wrap; }
  main { margin-top: 1rem; }
  table { display: block; overflow-x: auto; }
  .inline-add { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
  .inline-add input[name="title"] { flex: 1 1 100%; max-width: none; }
  .inline-add input, .inline-add select { max-width: 100%; }
  .year-head { flex-wrap: wrap; gap: 0.2rem; }
  .tabs a { padding: 0.4rem 0.55rem; }
  .card { padding: 0.9rem; }
}

.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.65rem;
  width: 100%; padding: 0.6rem 1rem; border-radius: 6px;
  font-size: 0.95rem; font-weight: 500; text-decoration: none;
}
.sso-btn svg { width: 1.15rem; height: 1.15rem; flex: none; }
.sso-google { background: #fff; color: #3c4043; border: 1px solid #dadce0; }
.sso-google:hover { background: #f8f9fa; }
.sso-apple { background: #000; color: #fff; border: 1px solid #000; }
.sso-apple:hover { background: #1a1a1a; }

.nowrap { white-space: nowrap; }
