/* Loft — one stylesheet, no build step. Studio pages override --accent with the studio's color. */
:root {
	--accent: #c2410c;
	--accent-ink: #ffffff;
	--ink: #1c1917;
	--muted: #78716c;
	--bg: #fafaf9;
	--card: #ffffff;
	--line: #e7e5e4;
	--soft: #f5f5f4;
	--radius: 14px;
	--ok: #15803d;
	--ok-bg: #ecfdf5;
	--warn: #b45309;
	--warn-bg: #fffbeb;
	--err: #b91c1c;
	--err-bg: #fef2f2;
	--info: #1d4ed8;
	--info-bg: #eff6ff;
	--font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 4px 14px rgba(28, 25, 23, .05);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* layout classes (grid, flex) must not override the hidden attribute */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1rem; }
code { background: var(--soft); padding: .1rem .35rem; border-radius: 6px; font-size: .9em; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 560px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack > * + * { margin-top: .75rem; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt { margin-top: 1.25rem; }
.mb { margin-bottom: 1.25rem; }

/* ---------------------------------------------------------------- Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--accent); color: var(--accent-ink);
	border: 1px solid var(--accent); border-radius: 999px; padding: .55rem 1.1rem; font: inherit; font-weight: 600; font-size: .95rem;
	cursor: pointer; text-decoration: none; line-height: 1.25; transition: filter .15s, background .15s; white-space: nowrap; }
.btn:hover { filter: brightness(.93); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--soft); filter: none; }
.btn-danger { background: var(--card); color: var(--err); border-color: #fecaca; }
.btn-danger:hover { background: var(--err-bg); filter: none; }
.btn-small { padding: .3rem .75rem; font-size: .85rem; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.link-danger { color: var(--err); }
form.inline { display: inline; }

/* ---------------------------------------------------------------- Cards, badges, alerts */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.card + .card { margin-top: .9rem; }
.card-flush { padding: 0; overflow: hidden; }
.card h2, .card h3 { margin-bottom: .6rem; }
.badge { display: inline-block; font-size: .78rem; font-weight: 600; color: var(--ok); background: var(--ok-bg); padding: .15rem .6rem; border-radius: 999px; white-space: nowrap; }
.badge-low, .badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-full, .badge-err { color: var(--err); background: var(--err-bg); }
.badge-mine, .badge-info { color: var(--info); background: var(--info-bg); }
.badge-muted { color: var(--muted); background: var(--soft); }
.tag { display: inline-block; font-size: .78rem; background: var(--soft); border-radius: 6px; padding: .1rem .5rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.alert { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: #065f46; border-color: #a7f3d0; }
.alert-warning { background: var(--warn-bg); color: #92400e; border-color: #fde68a; }
.alert-error { background: var(--err-bg); color: #991b1b; border-color: #fecaca; }
.alert ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.empty { color: var(--muted); padding: 2rem 1rem; text-align: center; }

/* ---------------------------------------------------------------- Forms */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span, .label { font-size: .9rem; font-weight: 600; }
.field input:not([type=checkbox]):not([type=radio]):not([type=color]), .field select, .field textarea, .input {
	font: inherit; padding: .55rem .7rem; border: 1px solid #d6d3d1; border-radius: 10px; width: 100%; background: #fff; color: var(--ink); }
.field input[type=color] { width: 4rem; height: 2.4rem; padding: .15rem; border: 1px solid #d6d3d1; border-radius: 10px; background: #fff; }
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-size: .83rem; color: var(--muted); font-weight: 400; }
.field .error, .error-text { font-size: .85rem; color: var(--err); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--err); }
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .95rem; }
.check input { margin-top: .28rem; width: 1rem; height: 1rem; accent-color: var(--accent); flex-shrink: 0; }
.check .hint { display: block; font-size: .83rem; color: var(--muted); }
.grid-2, .grid-3 { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 0; background: var(--card); }
.fieldset legend { font-weight: 700; padding: 0 .35rem; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.prefix { display: flex; align-items: center; border: 1px solid #d6d3d1; border-radius: 10px; background: #fff; overflow: hidden; }
.prefix span { padding: .55rem .2rem .55rem .7rem; color: var(--muted); white-space: nowrap; }
.prefix input { border: 0 !important; padding-left: .1rem !important; }
.hp { position: absolute; left: -9999px; }

/* ---------------------------------------------------------------- Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: .65rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--soft); }
.table tr:last-child td { border-bottom: 0; }
.table .actions { justify-content: flex-end; flex-wrap: nowrap; }
.table input.input { width: 5rem; padding: .3rem .5rem; }
.is-cancelled td { color: var(--muted); }
.is-cancelled td:first-child { text-decoration: line-through; }

/* ---------------------------------------------------------------- Site header (platform + studio) */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: .95rem; }
.nav { display: flex; align-items: center; gap: .3rem 1rem; flex-wrap: wrap; }
.nav a, .nav .link { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav .link:hover { color: var(--accent); }
.nav a.active { color: var(--accent); }
.site-main { padding: 2rem 0 3rem; min-height: 60vh; }
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; color: var(--muted); font-size: .88rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .3rem 0 0; color: var(--muted); }

/* ---------------------------------------------------------------- Marketing */
.hero { padding: 3.5rem 0 2.5rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); max-width: 16ch; letter-spacing: -.025em; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin: 1.5rem 0 2.5rem; }
.feature h3 { margin-bottom: .35rem; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: .75rem; }
.steps li { counter-increment: step; display: flex; gap: .8rem; align-items: flex-start; }
.steps li::before { content: counter(step); flex-shrink: 0; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }

/* ---------------------------------------------------------------- Schedule */
.filters { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: 1rem; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: .3rem .85rem; font-size: .9rem; text-decoration: none; }
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.sep { width: 1px; height: 1.4rem; background: var(--line); margin: 0 .3rem; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .5rem 0 1rem; }
.day { font-size: 1.02rem; margin: 1.6rem 0 .7rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line); }
.sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.session { display: flex; flex-direction: column; gap: .4rem; }
.session-time { font-weight: 700; font-size: .95rem; }
.session h3 { margin: 0; font-size: 1.05rem; }
.session h3 a { color: inherit; text-decoration: none; }
.session h3 a:hover { color: var(--accent); }
.session-event { border-color: var(--accent); }
.session-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .5rem; }
.mine { display: flex; flex-wrap: wrap; gap: .3rem; }

/* ---------------------------------------------------------------- Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.plan { display: flex; flex-direction: column; gap: .45rem; }
.plan h3 { margin: 0; }
.plan-kind { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.plan-price { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.plan-detail { color: var(--muted); font-size: .92rem; }
.plan form, .plan .btn { margin-top: auto; }

/* ---------------------------------------------------------------- Account */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tab { padding: .6rem .85rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.list { display: flex; flex-direction: column; gap: .6rem; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.item-actions { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.pick { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.pick:hover { border-color: var(--accent); }
.pick input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; }
.pick.disabled { opacity: .6; cursor: default; }
.pick.disabled:hover { border-color: var(--line); }

/* ---------------------------------------------------------------- Waiver */
.waiver-text { max-height: 360px; overflow: auto; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); font-size: .95rem; }
.waiver-text p:last-child { margin-bottom: 0; }
.sigpad { width: 100%; height: 160px; border: 1px dashed #a8a29e; border-radius: 10px; background: #fff; touch-action: none; display: block; cursor: crosshair; }

/* ---------------------------------------------------------------- Admin shell */
.admin { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #1c1917; color: #e7e5e4; padding: 1.1rem .8rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { color: #fff; padding: 0 .4rem; }
.sidebar nav { display: flex; flex-direction: column; gap: .1rem; }
.sidebar nav a { color: #d6d3d1; text-decoration: none; padding: .5rem .7rem; border-radius: 9px; font-size: .94rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sidebar nav a:hover { background: #292524; color: #fff; }
.sidebar nav a.active { background: #292524; color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar .nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #a8a29e; padding: .6rem .7rem .2rem; }
.sidebar-foot { margin-top: auto; font-size: .85rem; color: #a8a29e; padding: 0 .4rem; }
.sidebar-foot a, .sidebar-foot .link { color: #e7e5e4; }
.admin-main { padding: 1.6rem 2rem 3rem; max-width: 1180px; width: 100%; }
.menu-toggle { display: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 1.7rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .88rem; }
.stat.warn strong { color: var(--err); }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.checklist li { display: flex; align-items: center; gap: .6rem; }
.checklist .dot { width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; display: grid; place-items: center; font-size: .75rem; color: #fff; }
.checklist .done .dot { background: var(--ok); border-color: var(--ok); }
.checklist .done a { color: var(--muted); text-decoration: line-through; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }

/* Check-in */
.session-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.session-tabs a { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: .45rem .8rem; text-decoration: none; color: var(--ink); font-size: .9rem; }
.session-tabs a.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.session-tabs a.cancelled { text-decoration: line-through; color: var(--muted); }
.roster-row.status-attended { border-color: #86efac; background: #f0fdf4; }
.roster-row.status-no_show { opacity: .65; }
.medical { color: var(--warn); font-size: .9rem; }

/* Pagination */
.pagination { display: flex; gap: .3rem; margin-top: 1rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--card); font-size: .9rem; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .disabled { color: var(--muted); }

@media (max-width: 860px) {
	.admin { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
	.sidebar { position: static; height: auto; padding: .8rem 1rem; }
	.sidebar nav, .sidebar-foot { display: none; }
	.sidebar.open nav, .sidebar.open .sidebar-foot { display: flex; }
	.sidebar-head { display: flex; align-items: center; justify-content: space-between; }
	.menu-toggle { display: inline-flex; background: #292524; color: #fff; border: 0; border-radius: 8px; padding: .4rem .75rem; font: inherit; cursor: pointer; }
	.admin-main { padding: 1.2rem 1rem 3rem; }
	.split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.grid-2, .grid-3 { grid-template-columns: 1fr; }
	.item { flex-direction: column; align-items: flex-start; }
	.item-actions { justify-content: flex-start; }
	.site-main { padding-top: 1.25rem; }
	.table th, .table td { padding: .55rem .6rem; }
}
@media print {
	.site-header, .sidebar, .site-footer, .no-print { display: none !important; }
	.admin { display: block; }
}
