/*
 * St Marina Parish Portal - servant-facing app shell.
 * Colours and type follow the parish theme: navy, gold, parchment,
 * Playfair Display for headings and DM Sans for text.
 */

@font-face {
	font-family: "DM Sans";
	src: url("fonts/dm-sans.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
}

@font-face {
	font-family: "Playfair Display";
	src: url("fonts/playfair-display.woff2") format("woff2");
	font-weight: 400 900;
	font-display: swap;
}

:root {
	--navy: #001b52;
	--navy-2: #0d2b6b;
	--gold: #cc9433;
	--gold-soft: #f6ead3;
	--parchment: #efebe7;
	--card: #fbfaf8;
	--ink: #001b52;
	--muted: #4b5a7a;
	--line: #d6dae3;
	--ok: #1f7a4d;
	--ok-soft: #e3f3ea;
	--warn: #8a5a00;
	--warn-soft: #fff3d6;
	--danger: #b3261e;
	--danger-soft: #fbe7e6;
	--radius: 12px;
	--shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 12px rgb(0 27 82 / 0.06);
	--font-body: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-display: "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	min-height: 100vh;
	background: var(--parchment);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.5;
	display: flex;
	flex-direction: column;
}

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

/* ---- Top bar -------------------------------------------------------- */

.smp-bar {
	background: var(--navy);
	color: #fff;
	padding-top: env(safe-area-inset-top);
	position: sticky;
	top: 0;
	z-index: 10;
	box-shadow: 0 2px 8px rgb(0 0 0 / 0.15);
}

.smp-bar__inner {
	max-width: 640px;
	margin: 0 auto;
	padding: 10px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.smp-bar__logo { border-radius: 8px; flex: none; }

.smp-bar__text { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }

.smp-bar__church { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }

.smp-bar__title { font-family: var(--font-display); font-size: 19px; font-weight: 700; }

.smp-bar__out { margin: 0; }

/* ---- Layout --------------------------------------------------------- */

.smp-main {
	flex: 1;
	width: 100%;
	max-width: 640px;
	margin: 0 auto;
	padding: 20px 16px 32px;
}

.smp-foot {
	text-align: center;
	font-size: 13px;
	color: var(--muted);
	padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}

.smp-foot p { margin: 0; }

.smp-hello {
	margin: 0 0 4px;
	color: var(--muted);
	font-size: 15px;
}

.smp-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.smp-h1 {
	font-family: var(--font-display);
	font-size: 28px;
	line-height: 1.2;
	margin: 0 0 12px;
}

.smp-head .smp-h1 { margin: 0; }

.smp-day {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 24px 0 8px;
}

.smp-list { display: grid; gap: 12px; }

.smp-muted { color: var(--muted); font-size: 15px; }

/* ---- Cards ---------------------------------------------------------- */

.smp-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 18px;
}

.smp-card--narrow { max-width: 460px; margin: 16px auto 0; }

.smp-empty { text-align: center; padding: 28px 18px; }

.smp-duty { border-left: 5px solid var(--gold); }

.smp-duty.is-confirmed { border-left-color: var(--ok); }

.smp-duty.is-declined { border-left-color: var(--danger); }

.smp-duty.is-cancelled { opacity: 0.7; border-left-color: var(--muted); }

.smp-duty.is-cancelled .smp-duty__title { text-decoration: line-through; }

.smp-duty__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.smp-duty__time { margin: 0; font-weight: 700; font-size: 20px; }

.smp-duty__title { font-family: var(--font-display); font-size: 21px; margin: 4px 0 2px; }

.smp-duty__role {
	display: inline-block;
	margin: 4px 0 6px;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--gold-soft);
	color: #6b4700;
	font-weight: 700;
	font-size: 15px;
}

.smp-duty__meta, .smp-duty__team { margin: 4px 0; color: var(--muted); font-size: 15px; }

.smp-duty__team span { font-weight: 700; }

.smp-duty__note {
	margin: 8px 0;
	padding: 8px 12px;
	background: var(--parchment);
	border-radius: 8px;
	font-size: 15px;
}

.smp-duty__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 14px;
	align-items: flex-start;
}

.smp-duty__actions form { margin: 0; }

/* ---- Badges --------------------------------------------------------- */

.smp-badge {
	flex: none;
	font-size: 13px;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--warn-soft);
	color: var(--warn);
}

.smp-badge--confirmed { background: var(--ok-soft); color: var(--ok); }

.smp-badge--declined, .smp-badge--danger { background: var(--danger-soft); color: var(--danger); }

/* ---- Forms and buttons ---------------------------------------------- */

.smp-form { display: grid; gap: 10px; margin-top: 8px; }

.smp-label { font-weight: 700; font-size: 15px; }

.smp-input {
	width: 100%;
	font: inherit;
	font-size: 17px; /* 16px+ stops iOS zooming on focus */
	padding: 12px 14px;
	border: 1px solid #b9c1d1;
	border-radius: 10px;
	background: #fff;
	color: var(--ink);
}

.smp-input:focus-visible,
.smp-btn:focus-visible,
.smp-link:focus-visible,
summary:focus-visible {
	outline: 3px solid var(--gold);
	outline-offset: 2px;
}

.smp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 10px 18px;
	border-radius: 10px;
	border: 1px solid transparent;
	font: inherit;
	font-weight: 700;
	font-size: 16px;
	text-decoration: none;
	cursor: pointer;
	background: #fff;
	color: var(--navy);
}

.smp-btn--primary { background: var(--navy); color: #fff; }

.smp-btn--primary:hover { background: var(--navy-2); }

.smp-btn--gold { background: var(--gold); color: var(--navy); }

.smp-btn--ghost { border-color: #b9c1d1; background: transparent; }

.smp-btn--danger { background: var(--danger); color: #fff; }

.smp-btn--block { width: 100%; }

.smp-btn--choice { width: 100%; justify-content: flex-start; border-color: var(--line); }

.smp-btn--choice.is-current { border-color: var(--gold); box-shadow: inset 4px 0 0 var(--gold); }

.smp-choices { display: grid; gap: 10px; }

.smp-link {
	background: none;
	border: 0;
	padding: 6px 0;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	color: var(--navy);
	text-decoration: underline;
	cursor: pointer;
}

.smp-link--light { color: #fff; }

.smp-decline { flex: 1 1 200px; }

.smp-decline summary { list-style: none; }

.smp-decline summary::-webkit-details-marker { display: none; }

.smp-decline[open] summary { margin-bottom: 4px; }

/* Honeypot: off-screen, not display:none, so naive bots still fill it. */
.smp-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Flash and install prompt --------------------------------------- */

.smp-flash {
	margin: 0 0 12px;
	padding: 12px 14px;
	border-radius: 10px;
	background: var(--gold-soft);
	font-weight: 700;
}

.smp-flash--ok { background: var(--ok-soft); color: var(--ok); }

.smp-flash--warn { background: var(--danger-soft); color: var(--danger); }

.smp-install {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 12px;
	padding: 14px;
	border-radius: var(--radius);
	background: var(--navy);
	color: #fff;
}

.smp-install[hidden], .smp-install [hidden] { display: none; }

.smp-install__text { margin: 0; flex: 1 1 220px; }

.smp-install__text span { display: block; font-size: 15px; opacity: 0.9; }

.smp-install .smp-link { color: #fff; }

@media (prefers-reduced-motion: no-preference) {
	.smp-btn { transition: background-color 0.15s ease; }
}

/* ---- Parish app: home, tiles and modules (1.1.0) --------------------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

.smp-icon { display: block; }

.smp-bar__back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px; height: 40px;
	margin-left: -8px;
	border-radius: 50%;
	color: #fff;
}

.smp-bar__back:focus-visible { outline: 3px solid var(--gold); }

.smp-welcome { text-align: center; margin: 8px 0 4px; }

.smp-welcome__logo { border-radius: 24px; box-shadow: var(--shadow); }

.smp-welcome .smp-h1 { margin-top: 12px; }

.smp-welcome p { color: var(--muted); margin: 0 auto; max-width: 30em; }

.smp-next {
	display: grid;
	gap: 2px;
	margin: 8px 0 16px;
	text-decoration: none;
	color: inherit;
	border-left: 5px solid var(--gold);
	background: var(--navy);
	color: #fff;
}

.smp-next__label { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); font-weight: 700; }

.smp-next__title { font-family: var(--font-display); font-size: 22px; font-weight: 700; }

.smp-next__meta { opacity: 0.9; font-size: 15px; }

.smp-next .smp-badge { justify-self: start; margin-top: 6px; }

.smp-tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 8px 0 8px;
}

@media (min-width: 560px) {
	.smp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.smp-tile {
	display: grid;
	gap: 4px;
	align-content: start;
	min-height: 118px;
	padding: 16px;
	border-radius: var(--radius);
	background: var(--card);
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
	color: var(--navy);
	text-decoration: none;
}

.smp-tile:hover { border-color: var(--gold); }

.smp-tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.smp-tile__icon {
	display: inline-flex;
	width: 44px; height: 44px;
	align-items: center; justify-content: center;
	border-radius: 12px;
	background: var(--gold-soft);
	color: #6b4700;
	margin-bottom: 6px;
}

.smp-tile__label { font-weight: 700; font-size: 17px; }

.smp-tile__hint { font-size: 13px; color: var(--muted); line-height: 1.3; }

.smp-tile--roster .smp-tile__icon,
.smp-tile--tasks .smp-tile__icon { background: var(--navy); color: #fff; }

.smp-tile--churchops { background: var(--parchment); border-style: dashed; }

.smp-actions { margin: 0 0 8px; }

.smp-svc__time { margin: 0; font-weight: 700; font-size: 18px; }

.smp-svc.is-cancelled .smp-duty__title { text-decoration: line-through; }

.smp-svc { border-left: 5px solid var(--navy); }

.smp-row.is-overdue { border-left: 5px solid var(--danger); }

.smp-kind { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.smp-search { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }

@media (min-width: 560px) {
	.smp-search { grid-template-columns: 1fr 200px auto; }
}

.smp-items {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.smp-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-top: 1px solid var(--line);
}

.smp-item:first-child { border-top: 0; }

.smp-item__main { display: grid; gap: 2px; min-width: 0; color: inherit; text-decoration: none; flex: 1; }

a.smp-item__main .smp-item__name { text-decoration: underline; text-underline-offset: 3px; }

.smp-item__name { font-weight: 700; }

.smp-item__meta { font-size: 14px; color: var(--muted); }

.smp-item__qty { flex: none; font-weight: 700; font-size: 15px; }

.smp-item.is-out .smp-item__qty { color: var(--danger); font-weight: 400; }

/* Printable newsletter body from Church Comms. */
.smp-edition { line-height: 1.55; }

.smcc-print-parish { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0; }

.smcc-print-sheet h1, .smcc-print-sheet h2 { font-family: var(--font-display); }

.smcc-print-range { font-weight: 700; margin: 4px 0 12px; }

.smcc-print-intro, .smcc-print-notices { margin: 12px 0; padding: 12px 14px; background: var(--parchment); border-radius: 8px; }

.smcc-print-day { font-weight: 700; margin: 16px 0 4px; color: var(--navy); }

.smcc-print-time { font-weight: 700; }

.smcc-print-loc, .smcc-print-flag { color: var(--muted); font-size: 15px; }

.smcc-print-sheet .is-cancelled { text-decoration: line-through; opacity: 0.7; }

.smp-flash--info { background: var(--gold-soft); }

/* ---- 2.0: account button, sections, chips, stats -------------------- */

.smp-bar__account {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px; height: 42px;
	margin-right: -6px;
	border-radius: 50%;
	color: #fff;
	flex: none;
}

.smp-bar__account:focus-visible { outline: 3px solid var(--gold); }

.smp-section {
	margin: 22px 0 6px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--muted);
}

.smp-h2 { font-family: var(--font-display); font-size: 22px; margin: 0 0 2px; }

.smp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }

.smp-chip {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--navy);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.smp-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 10px;
	margin: 8px 0 4px;
}

.smp-stat {
	display: grid;
	gap: 0;
	padding: 12px 14px;
	border-radius: var(--radius);
	background: var(--card);
	border: 1px solid var(--line);
	color: var(--navy);
	text-decoration: none;
}

.smp-stat__n { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.1; }

.smp-stat__label { font-size: 13px; color: var(--muted); }

.smp-stat.is-hot { border-color: var(--danger); background: var(--danger-soft); }

.smp-stat.is-hot .smp-stat__n { color: var(--danger); }

.smp-tile--in-council .smp-tile__icon { background: var(--navy); color: var(--gold); }

.smp-tile--in-comms .smp-tile__icon { background: var(--ok-soft); color: var(--ok); }

/* ---- 2.0: sign-in forms -------------------------------------------- */

.smp-split { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 12px 0 0; }

.smp-pw { position: relative; }

.smp-pw .smp-input { width: 100%; padding-right: 72px; }

.smp-pw__toggle {
	position: absolute;
	right: 6px; top: 50%;
	transform: translateY(-50%);
	border: 0;
	background: transparent;
	color: var(--navy);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	padding: 8px 10px;
	cursor: pointer;
}

.smp-input--code {
	font-size: 28px;
	letter-spacing: 0.35em;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.smp-rules { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 4px; font-size: 15px; }

.smp-rules li { padding-left: 26px; position: relative; color: var(--muted); }

.smp-rules li::before {
	content: "";
	position: absolute;
	left: 4px; top: 6px;
	width: 12px; height: 12px;
	border-radius: 50%;
	border: 2px solid var(--line);
}

.smp-rules li.is-ok { color: var(--ok); font-weight: 700; }

.smp-rules li.is-ok::before { background: var(--ok); border-color: var(--ok); }

.smp-flash ul { margin: 4px 0 0; padding-left: 20px; }

.smp-flash p { margin: 0; }

details > summary { list-style: none; cursor: pointer; }

details > summary::-webkit-details-marker { display: none; }

/* ---- 2.0: rosters, tasks, stock, meetings --------------------------- */

.smp-search--inline { grid-template-columns: 1fr auto; }

@media (min-width: 560px) {
	.smp-search--inline { grid-template-columns: 1fr auto; }
}

.smp-roster { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }

.smp-roster li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	padding: 8px 10px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 8px;
}

.smp-roster__who { flex: 1 1 160px; min-width: 0; }

.smp-roster__who .smp-muted { display: block; font-size: 14px; }

.smp-roster__x { margin: 0; }

.smp-row.is-urgent:not(.is-overdue) { border-left: 5px solid var(--gold); }

.smp-item__tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: none; }

.smp-item--stock { display: block; }

.smp-item__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.smp-item.is-low .smp-item__qty { color: var(--warn); }

.smp-move { margin-top: 6px; }

.smp-move summary { font-size: 15px; }

.smp-form--row { grid-template-columns: 1fr; }

@media (min-width: 560px) {
	.smp-form--row { grid-template-columns: 1.2fr 0.8fr 1.4fr auto; align-items: center; }
}

.smp-agenda { margin: 0 0 12px; padding: 12px 12px 12px 34px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

.smp-agenda li { margin: 6px 0 10px; }

.smp-agenda__text { font-size: 15px; }

.smp-agenda__text p { margin: 4px 0; }

.smp-contact { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }

.smp-contact .smp-btn { padding: 8px 14px; min-height: 0; font-size: 15px; }

/* ---- 2.2: access screen --------------------------------------------- */

.smp-form--inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }

.smp-form--inline .smp-input { flex: 1 1 200px; width: auto; }

.smp-levels { margin: 14px 0 0; padding-left: 18px; font-size: 14px; }

.smp-levels li { margin: 4px 0; }

/* ---- 2.3: add forms ---------------------------------------------------- */

.smp-add-card { margin: 0 0 14px; }

.smp-add-card[open] > summary { margin-bottom: 10px; }

.smp-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; }

.smp-checks label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }

.smp-checks input { width: 20px; height: 20px; }

.smp-multi { min-height: 140px; }

textarea.smp-input { min-height: 80px; font: inherit; }

/* ------------------------------------------------------------------ */
/* 3.0 - families, confession, permission forms                        */
/* ------------------------------------------------------------------ */

.smp-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.smp-radio,
.smp-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: #fff;
	cursor: pointer;
	min-height: 48px;
}

.smp-radio input,
.smp-check input { width: 22px; height: 22px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--navy); }

.smp-radio:has(input:checked) { border-color: var(--gold); box-shadow: inset 4px 0 0 var(--gold); }

.smp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.smp-pair > div { min-width: 0; display: grid; gap: 10px; align-content: start; }

.smp-pair + .smp-label,
.smp-pair + .smp-check,
.smp-fieldset + .smp-label { margin-top: 6px; }

@media (max-width: 380px) {
	.smp-pair { grid-template-columns: 1fr; }
}

.smp-child {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 8px 14px;
	background: #fff;
	margin-bottom: 8px;
}

.smp-child > summary { cursor: pointer; padding: 6px 0; }

.smp-family-only { margin-top: 8px; }

/* Show spouse and children only for "My family" (no script needed). */
.smp-form:has(input[name="kind"][value="individual"]:checked) .smp-family-only { display: none; }

/*
 * "+ Add partner" / "+ Add a child": a tick box drawn as a button, so the
 * extra details open without any script (strict CSP). The server only reads
 * a person whose box is ticked, so "Remove" really removes them.
 */
.smp-adder { position: relative; display: flex; flex-direction: column; margin-bottom: 10px; }

.smp-adder__box { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

.smp-adder__btn { width: 100%; justify-content: center; border-style: dashed; color: var(--navy); font-weight: 600; }

.smp-adder__box:focus-visible + .smp-adder__btn { outline: 3px solid var(--gold); outline-offset: 2px; }

.smp-adder__remove,
.smp-adder__body { display: none; }

/* Once open, "Remove ..." sits under the details it removes. */
.smp-adder__box:checked + .smp-adder__btn { order: 2; margin-top: 8px; border-style: solid; color: var(--muted); font-weight: 400; min-height: 44px; }

.smp-adder__box:checked + .smp-adder__btn .smp-adder__add { display: none; }

.smp-adder__box:checked + .smp-adder__btn .smp-adder__remove { display: inline; }

.smp-adder__box:checked ~ .smp-adder__body { display: block; }

.smp-adder__body > * + * { margin-top: 10px; }

.smp-adder__body > .smp-pair + .smp-label { margin-top: 10px; }

@supports selector(:has(*)) {
	/* One child at a time: the next "+ Add another child" appears once this one is open. */
	.smp-kid + .smp-kid { display: none; }
	.smp-kid:has(> .smp-adder__box:checked) + .smp-kid { display: flex; }
	/* Only the last child shows "Remove", so removing never hides a later child. */
	.smp-kid:has(> .smp-adder__box:checked):has(+ .smp-kid > .smp-adder__box:checked) > .smp-adder__btn { display: none; }
	/* The guardian tick only matters once a child is added. */
	.smp-form:not(:has(.smp-kid > .smp-adder__box:checked)) .smp-guardian { display: none; }
	.smp-form:has(input[name="kind"][value="individual"]:checked) .smp-guardian { display: none; }
}

.smp-chip--on { background: var(--gold); color: var(--navy); }

a.smp-chip { text-decoration: none; }

.smp-chips a.smp-chip:not(.smp-chip--on) { background: #fff; color: var(--navy); border: 1px solid var(--line); }

.smp-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

.smp-time { margin: 0; }

.smp-time .smp-btn--choice { flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; background: #fff; }

.smp-time .smp-btn--choice strong { font-size: 19px; }

.smp-time .smp-btn--choice span { font-size: 14px; color: var(--muted); font-weight: 400; }

.smp-checks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }

.smp-checks li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* 3.1 roster self sign-up ------------------------------------------------ */

.smp-signup { margin: 0 0 8px; }

.smp-signup__head {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 44px;
}

.smp-signup__head::-webkit-details-marker { display: none; }

.smp-signup__head::after { content: "+"; font-size: 22px; color: var(--gold); }

.smp-signup[open] > .smp-signup__head::after { content: "\2212"; }

.smp-open { border-left: 5px solid var(--navy); }

.smp-open__slot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 12px;
	padding-top: 10px;
	margin-top: 10px;
	border-top: 1px solid var(--line);
}

.smp-open__role { margin: 0; display: flex; flex-direction: column; gap: 2px; }

.smp-input--short { max-width: 120px; }

/* ---- 4.0: authenticator and Manage ----------------------------------- */

.smp-mfa-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0 0 16px;
	padding: 12px 14px;
	border-radius: var(--radius);
	background: var(--gold-soft);
	color: var(--ink);
	font-size: 15px;
}

.smp-mfa-bar span { flex: 1 1 220px; }

.smp-btn--small { min-height: 44px; padding: 8px 14px; font-size: 15px; }

.smp-tile--locked { background: var(--parchment); border-style: dashed; }

.smp-tile--locked .smp-tile__icon { background: var(--line); color: var(--muted); }

.smp-steps { margin: 12px 0 16px; padding-left: 22px; }

.smp-steps li { margin: 0 0 8px; }

.smp-qr {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 260px;
	min-height: 120px;
	margin: 12px auto;
	padding: 12px;
	border-radius: var(--radius);
	background: #fff;
	border: 1px solid var(--line);
}

.smp-qr svg { display: block; width: 100%; height: auto; }

.smp-key {
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 18px;
	letter-spacing: 0.06em;
	word-break: break-all;
	padding: 10px 12px;
	border-radius: 8px;
	background: var(--parchment);
}

.smp-details { margin: 14px 0 0; }

.smp-details summary {
	cursor: pointer;
	min-height: 44px;
	display: flex;
	align-items: center;
	color: var(--navy-2);
	font-weight: 600;
	text-decoration: underline;
}

.smp-codes {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 16px;
	margin: 14px 0;
	padding-left: 22px;
}

.smp-codes code {
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 17px;
	letter-spacing: 0.04em;
}

.smp-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
}

.smp-tab {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 6px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--ink);
	text-decoration: none;
	background: var(--card);
	font-size: 15px;
}

.smp-tab.is-current { border-color: var(--gold); background: var(--gold-soft); font-weight: 700; }

.smp-tab:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.smp-trow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

.smp-row__main { flex: 1 1 200px; min-width: 0; }

.smp-row__title { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

.smp-row__main .smp-muted { margin: 2px 0 0; }

.smp-row__extra { margin-top: 10px; }

@media print {
	.smp-bar, .smp-foot, .smp-btn, .smp-mfa-bar { display: none !important; }
}

/* ---- 4.1 Messages inbox ---------------------------------------------- */

.smp-tabs--small .smp-tab { min-height: 40px; font-size: 14px; }

.smp-msg {
	display: block;
	color: var(--ink);
	text-decoration: none;
	border-left: 5px solid var(--line);
}

.smp-msg.is-new { border-left-color: var(--gold); }

.smp-msg:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.smp-msg__title {
	display: block;
	font-family: var(--font-display);
	font-size: 19px;
	margin: 4px 0 2px;
}

.smp-msg .smp-duty__meta { display: block; }

.smp-msg__flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.smp-badge--plain { background: var(--line); color: var(--ink); }

.smp-facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 6px 14px;
	margin: 12px 0;
}

.smp-facts dt { font-weight: 700; color: var(--muted); }

.smp-facts dd { margin: 0; overflow-wrap: anywhere; }

.smp-msg__body,
.smp-msg__notes {
	background: var(--parchment);
	border-radius: 10px;
	padding: 10px 14px;
	margin: 6px 0 12px;
	overflow-wrap: anywhere;
	font-size: 17px;
	line-height: 1.55;
}

.smp-msg__notes { font-size: 15px; }

.smp-msg__body p,
.smp-msg__notes p { margin: 0 0 10px; }

@media (max-width: 420px) {
	.smp-facts { grid-template-columns: 1fr; gap: 2px; }
	.smp-facts dd { margin-bottom: 8px; }
}

/* ---- 4.2 Conversations ------------------------------------------------ */

.smp-thread { display: grid; gap: 10px; margin-bottom: 12px; }

.smp-thread__item { border-left: 5px solid var(--line); }

.smp-thread__item.is-out { border-left-color: var(--navy); }

.smp-thread__item.is-in { border-left-color: var(--gold); }

.smp-thread__who { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }

.smp-thread__who .smp-muted { font-size: 14px; overflow-wrap: anywhere; }

/* 4.3: group schedule and conversations */
a.smp-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); text-decoration: none; min-height: 56px; }

a.smp-row:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

a.smp-row .smp-icon { vertical-align: middle; }

.smp-badge--gold { background: var(--gold-soft); color: var(--ink); font-weight: 700; }

.smp-lesson { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--gold-soft); }

.smp-lesson__title { margin: 0 0 6px; overflow-wrap: anywhere; }

.smp-lesson__title .smp-label { display: block; margin: 0 0 2px; }

.smp-small { font-size: 14px; margin: 6px 0 0; }

.smp-inline { display: inline-block; margin: 8px 16px 0 0; }

.smp-thread__item.is-gone { opacity: 0.75; border-left-style: dashed; }

/* 4.3: meeting editing */
.smp-fold > .smp-fold__head { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; }

.smp-fold > .smp-fold__head::-webkit-details-marker { display: none; }

.smp-fold > .smp-fold__head::after { content: "+"; flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--gold-soft); font-size: 22px; line-height: 1; }

.smp-fold[open] > .smp-fold__head::after { content: "\2212"; }

.smp-fold[open] > .smp-fold__head { margin-bottom: 10px; }

.smp-fold__head:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.smp-card__title { margin: 0 0 6px; font-size: 18px; }

.smp-btnrow { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 4px 0; }

.smp-votes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; align-items: end; }

.smp-input--tall { min-height: 320px; line-height: 1.5; }

/* 4.4: Teams meetings */
.smp-picklist { display: grid; gap: 2px; max-height: 420px; overflow-y: auto; padding: 4px 2px; margin-top: 8px; border-top: 1px solid var(--line); }

.smp-picklist .smp-check { margin: 0; min-height: 44px; align-items: center; }

.smp-picklist .smp-check[hidden] { display: none; }

.smp-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.smp-plain li { display: flex; justify-content: space-between; align-items: center; gap: 10px; overflow-wrap: anywhere; }

.smp-badge--ok { background: var(--ok-soft); color: var(--ok); }

.smp-badge--warn { background: var(--danger-soft); color: var(--danger); }

.smp-tile--teams .smp-tile__icon { color: var(--navy); }

.smp-plain + .smp-small { margin-top: 14px; }

/* 4.5: inventory photos and tools */
@media (min-width: 560px) {
	.smp-form--row.smp-form--pair { grid-template-columns: 1fr auto; }
}
.smp-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.smp-photo { margin: 0; }
.smp-photo--main { grid-column: 1 / -1; }
.smp-photo img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: var(--radius); background: var(--gold-soft); }
.smp-photo:not(.smp-photo--main) img { aspect-ratio: 1 / 1; object-fit: cover; }
.smp-photo form { margin-top: 6px; }
.smp-photo-preview { display: block; max-width: 100%; max-height: 240px; margin-top: 8px; border-radius: var(--radius); }
