:root {
  --app-bg: #f6f4ec;
  --app-ink: #133b3a;
  --app-muted: #415554;
  --app-line: rgba(19, 59, 58, 0.14);
  --app-card: rgba(255, 255, 255, 0.72);
  --app-accent: #228e8c;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--app-bg); color: var(--app-ink); }
body { margin: 0; font-family: Halyard Text, Tahoma, sans-serif; font-size: 16px; line-height: 1.5; color: var(--app-ink); background: var(--app-bg); }
a { color: inherit; text-underline-offset: .18em; }
::selection { background: var(--app-ink); color: var(--app-bg); }
input, textarea { caret-color: var(--app-ink); }
:focus-visible { outline: 3px solid var(--app-accent); outline-offset: 4px; }
.app-main-shell, .app-content, .grid > *, .page-head > * { min-width: 0; }
.app-content { overflow-wrap: anywhere; }
h1 { font-family: Ivy Presto, Georgia, serif; font-size: clamp(32px, 4vw, 48px); line-height: 1.1; }
button, input, textarea, select { font: inherit; }
.skip-link { position: absolute; left: 12px; top: 12px; transform: translateY(-140%); padding: 10px 12px; background: #fff; z-index: 20; }
.skip-link:focus { transform: none; }
.app-frame { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }
.app-frame--auth { display: block; }
.app-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 26px; padding: 26px; border-right: 1px solid var(--app-line); background: rgba(255,255,255,0.46); }
.app-brand { display: grid; gap: 10px; text-decoration: none; }
.app-brand img { display: block; max-width: 176px; height: auto; }
.app-brand span, .eyebrow, .member-chip span, .stat span, .lesson-meta, .table-head { font-family: Halyard Micro, Tahoma, sans-serif; font-size: 12px; line-height: 1.2; letter-spacing: 0.08em; text-transform: uppercase; }
.app-nav { display: grid; gap: 8px; }
.app-nav a, .app-topbar nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 6px; color: var(--app-muted); text-decoration: none; }
.app-nav a:hover, .app-nav a.active, .app-topbar nav a:hover, .app-topbar nav a.active { background: rgba(19, 59, 58, 0.08); color: var(--app-ink); }
.app-sidebar-footer { margin-top: auto; display: grid; gap: 14px; }
.member-chip { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--app-line); border-radius: 8px; background: var(--app-card); }
.member-chip strong { overflow-wrap: anywhere; font-size: 15px; }
.app-topbar { display: none; align-items: center; justify-content: space-between; gap: 16px; min-height: 70px; padding: 16px 20px; border-bottom: 1px solid var(--app-line); background: rgba(255,255,255,0.62); }
.app-topbar nav { display: flex; gap: 4px; overflow-x: auto; }
.app-topbar-brand { display: inline-flex; gap: 8px; align-items: center; font-family: Halyard Display, Tahoma, sans-serif; font-weight: 600; text-decoration: none; }
.brand-dot { width: 14px; height: 14px; border-radius: 999px; background: var(--app-accent); }
.app-content { width: min(100%, 1180px); margin: 0 auto; padding: clamp(28px, 4vw, 54px); }
.app-content.wide { width: min(100%, 1440px); }
.page-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 28px; }
.page-head h1 { max-width: 760px; margin: 0; }
.page-head p { max-width: 680px; margin: 16px 0 0; font-size: 18px; line-height: 1.5; color: var(--app-muted); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.button { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; border: 1px solid var(--app-ink); border-radius: 6px; background: var(--app-ink); color: #fff; cursor: pointer; text-decoration: none; }
.button.secondary { background: transparent; color: var(--app-ink); }
.button:not(:disabled):hover { background: var(--app-muted); }
.button.secondary:not(:disabled):hover { background: var(--app-line); }
.button:disabled { opacity: 0.5; cursor: default; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card, .panel { border: 1px solid var(--app-line); border-radius: 8px; padding: 22px; background: var(--app-card); }
.card h2, .panel h2 { margin: 8px 0 10px; font-family: Halyard Display, Tahoma, sans-serif; font-size: 24px; line-height: 1.1; }
.card p, .panel p { color: var(--app-muted); line-height: 1.5; }
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--app-line); border-radius: 8px; background: rgba(255,255,255,0.62); }
.stat strong { font-family: Ivy Presto, Georgia, serif; font-size: 42px; line-height: 1; }
.lesson-list { display: grid; gap: 12px; }
.lesson-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px; border: 1px solid var(--app-line); border-radius: 8px; background: rgba(255,255,255,0.6); text-decoration: none; }
.lesson-row img { width: 112px; aspect-ratio: 16 / 10; border-radius: 6px; object-fit: cover; background: #eee; }
.lesson-title { margin: 5px 0 0; font-size: 18px; line-height: 1.18; }
.empty-state { padding: 24px; border: 1px dashed var(--app-line); border-radius: 8px; color: var(--app-muted); text-align: center; }
.form-panel { width: min(100%, 520px); margin: clamp(12px, 6vh, 64px) auto; }
.form-stack:not([hidden]) { display: grid; gap: 14px; }
.form-stack > .button { justify-self: start; }
.form-stack > p { margin-block: 0; max-width: 70ch; }
.form-stack label { display: grid; gap: 8px; color: var(--app-muted); }
.form-stack input:not([type="checkbox"]):not([type="hidden"]), .form-stack textarea, .form-stack select { min-height: 48px; width: 100%; border: 1px solid var(--app-line); border-radius: 6px; padding: 12px 14px; min-width: 0; max-width: 100%; color: var(--app-ink); background: #fff; }
.form-stack textarea { resize: vertical; }
input[type="checkbox"] { width: 18px; height: 18px; }
details.panel { margin-block: 18px; }
summary { cursor: pointer; font-weight: 600; padding-block: 8px; }
.eva-report-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; }
.eva-report-section { max-width: 72ch; margin-block: 30px; }
.eva-report-section:first-of-type { margin-top: 22px; }
.status-badge { display: inline-block; padding: 6px 10px; border: 1px solid var(--app-line); border-radius: 6px; }
.notice { margin: 0 0 18px; padding: 14px 16px; border: 1px solid rgba(34, 142, 140, 0.26); border-radius: 8px; background: rgba(34, 142, 140, 0.08); color: var(--app-ink); }
.error { border-color: rgba(148, 47, 47, 0.28); background: rgba(148, 47, 47, 0.08); }
.data-table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 8px; }
.data-table th, .data-table td { padding: 12px; border-bottom: 1px solid var(--app-line); text-align: left; vertical-align: top; }
.data-table td { color: var(--app-muted); }
@media (max-width: 900px) {
  .app-frame { display: block; }
  .app-sidebar { display: none; }
  .app-topbar { display: flex; flex-wrap: wrap; }
  .app-topbar nav { flex-wrap: wrap; overflow: visible; }
  .page-head { display: grid; }
  .grid.two, .grid.three, .stat-strip { grid-template-columns: 1fr; }
  .lesson-row { grid-template-columns: 84px minmax(0, 1fr); }
  .lesson-row .button { grid-column: 1 / -1; }
}


.member-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: start; padding-block: 14px; border-top: 1px solid var(--app-line); }
.member-row > div { min-width: 0; max-width: 100%; }
.panel + .panel, .panel + form { margin-top: 18px; }
.form-stack + .form-stack { margin-top: 24px; }
.business-details { display: grid; gap: 16px; margin-block: 20px 28px; }
.business-details > div { display: grid; grid-template-columns: minmax(100px, 140px) minmax(0, 1fr); gap: 12px; }
.business-details dt { color: var(--app-muted); }
.business-details dd { margin: 0; overflow-wrap: anywhere; }
.notice p { margin-bottom: 0; }
.notice a { font-weight: 600; }
.inline-details { margin-block: 20px; }
.inline-details > summary { width: fit-content; text-decoration: underline; text-underline-offset: .18em; }
.inline-details > form { margin-top: 16px; max-width: 520px; }
.team-invite { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--app-line); }
.team-invite .form-stack { max-width: 520px; }
.report-sections { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--app-line); }
.report-sections a { display: inline-flex; align-items: center; min-height: 44px; }
.report-meta { color: var(--app-muted); font-size: 14px; }
@media (max-width: 480px) {
  .business-details > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
