:root {
  --ink: #161616;
  --muted: #5c584f;
  --gold: #9a7420;
  --line: #e4dcc8;
  --paper: #f7f4ee;
  --side: #141414;
  --card: #fff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.45;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
h1 {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  line-height: 1.15;
  margin: 0 0 0.4rem;
}
h2 { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.25rem); margin: 0 0 0.6rem; }
p { margin: 0 0 0.8rem; }
.testbar {
  background: #9a7420;
  color: #fff;
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
}
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.shell { display: flex; min-height: 100vh; }
.side {
  width: clamp(220px, 22vw, 280px);
  background: var(--side);
  color: #f4f0e6;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0.9rem 1rem;
  flex: 0 0 auto;
}
.brand { display: flex; gap: 0.7rem; align-items: center; padding: 0.2rem 0.5rem 1.1rem; }
.brand strong, .brand small { display: block; }
.brand small { color: #c8b48a; letter-spacing: 0.08em; }
.mark {
  width: 44px; height: 44px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--gold); color: #fff; font-weight: 700; flex: 0 0 auto;
}
.side nav { display: flex; flex-direction: column; gap: 0.25rem; }
.side nav a {
  text-decoration: none;
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  color: #f4f0e6;
  min-height: 44px;
}
.side nav a.on, .side nav a:hover { background: #2a2418; color: #f0d48a; }
.logout { margin-top: auto; padding: 0.8rem 0.5rem 0; }
.who { color: #c8b48a; margin-bottom: 0.4rem; overflow-wrap: anywhere; }
button, .logout button, .nav-open, .nav-close {
  background: var(--gold); color: #fff; border: 0;
  border-radius: 8px; padding: 0.7rem 0.95rem; font: inherit;
  min-height: 44px; cursor: pointer;
}
.content { flex: 1; min-width: 0; }
.bar, .nav-open, .nav-close { display: none; }
main {
  padding: clamp(1rem, 2vw, 1.8rem);
  max-width: 70rem;
}
.solo {
  width: min(28rem, calc(100% - 2rem));
  margin: clamp(1.5rem, 8vh, 5rem) auto;
}
.kicker {
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 0.3rem;
}
.lead, .meta { color: var(--muted); overflow-wrap: anywhere; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(0.85rem, 2vw, 1.15rem);
  margin: 1rem 0;
}
.flash {
  background: #fff6df;
  border: 1px solid #e4d09a;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
}
form label { display: block; margin: 0.7rem 0; color: var(--muted); }
input, select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  min-height: 44px;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0.7rem 0 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.2rem 0.6rem;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  min-height: 44px;
}
.check input { width: 1.15rem; height: 1.15rem; margin: 0; min-height: 0; }
.tiles {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.tiles a {
  display: block;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.95rem 1rem;
  min-height: 44px;
}
.tiles strong { display: block; margin-bottom: 0.25rem; }
.tiles span { color: var(--muted); }
em { color: var(--gold); font-style: normal; font-size: 0.85rem; }
button.ghost { background: transparent; color: var(--ink); margin-top: 0.4rem; }

.content:has(> main.program) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}
main.program {
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.cc-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #f8f9fa;
}

@media (max-width: 860px) {
  .shell { display: block; }
  .side {
    display: none;
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(86vw, 20rem);
    height: 100%;
    overflow: auto;
  }
  .nav-toggle:checked ~ .shell .side { display: flex; }
  .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0;
  }
  .nav-open, .nav-close { display: inline-flex; align-items: center; }
  .nav-close { margin-left: auto; }
}
