/**
 * Sermon Exchange styles.
 *
 * Family identity (visual identity guidelines): navy #1F3864, gold
 * #c9a227 used sparingly, gray #404040, light gray #F2F2F2, Helvetica.
 * Title rules stay navy; gold appears only on the short header rule.
 * All selectors are scoped under .se- classes so theme styles for
 * other content are untouched.
 */

.se-wrap {
	--se-navy: #1f3864;
	--se-gold: #c9a227;
	--se-gray: #404040;
	--se-light-gray: #f2f2f2;
	--se-grid-gray: #bfbfbf;
	--se-white: #ffffff;
	font-family: Helvetica, Arial, sans-serif;
	color: var(--se-gray);
	max-width: 1120px;
	margin: 0 auto;
	padding: 2rem 1rem 3rem;
}

.se-wrap a {
	color: var(--se-navy);
}

.se-wrap a:focus-visible,
.se-wrap button:focus-visible,
.se-wrap input:focus-visible,
.se-wrap select:focus-visible {
	outline: 2px solid var(--se-navy);
	outline-offset: 2px;
}

/* .se-main and .se-library on the templates are intentional
   page-level styling hooks; layout comes from .se-wrap. */

.se-main {
	display: block;
}

/* White page background on sermon pages only. The gray page
   background comes from the theme body background, not from this
   stylesheet, so the white is scoped under the se-sermon-page body
   class added by template-loader.php (sermon pages only). This
   stylesheet itself loads only on sermon pages. */

body.se-sermon-page {
	background-color: #ffffff;
}

/* Hide the theme's sticky header on sermon pages only. The theme
   header is <header class="header"> wrapping the fixed navbar, so
   hiding it removes the nav entirely from sermon pages. The selector
   cannot match our own <header class="se-library-header"> or
   <header class="se-sermon-header"> (different class tokens), cannot
   affect the footer (get_footer still renders, untouched), and
   cannot affect any non-sermon page: the se-sermon-page body class
   is added only on sermon pages (template-loader.php), and this
   stylesheet loads only there. */

body.se-sermon-page header.header {
	display: none;
}

body.se-sermon-page .se-main {
	background-color: #ffffff;
	/* Modest top breathing room now that the fixed header is gone
	   (v0.1.3 needed 6.25rem to clear it). No separate admin-bar
	   rule: WordPress core adds margin-top to the <html> element
	   (32px, 46px on narrow screens) when the toolbar shows, which
	   pushes all page content below the fixed toolbar, so no extra
	   .se-main padding is needed and logged-in views get no
	   excessive gap. */
	padding-top: 1.5rem;
}

/* Headings keep the family font even where the theme sets its own. */

.se-wrap h1,
.se-wrap h2,
.se-wrap h3 {
	font-family: Helvetica, Arial, sans-serif;
	font-weight: 700;
}

/* Library header: title, italic gray subtitle, navy rule, short gold rule. */

/* Library top row (0.8.1): the title block and the member avatar
   (or join chip) share one line, the avatar at the right in line
   with the header, at Tom's direction. */

.se-library-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.75rem;
}

.se-library-top .se-library-header {
	margin-bottom: 0;
	flex: 1 1 auto;
	min-width: 0;
}

.se-library-top .se-member-bar {
	margin: 0;
	flex: none;
}

.se-library-header {
	margin-bottom: 1.75rem;
}

.se-library-title {
	font-family: Helvetica, Arial, sans-serif;
	font-weight: 700;
	font-size: 2rem;
	line-height: 1.2;
	color: var(--se-navy);
	margin: 0 0 0.25rem;
}

.se-library-subtitle {
	font-style: italic;
	color: var(--se-gray);
	margin: 0;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--se-navy);
	position: relative;
}

.se-library-subtitle::after {
	content: "";
	display: block;
	width: 4rem;
	border-bottom: 3px solid var(--se-gold);
	position: absolute;
	left: 0;
	bottom: -2px;
}

/* Filter form. */

.se-filters {
	display: flex;
	flex-wrap: wrap;
	/* Row gap is 0 (0.8.2) so the Sort/Filter menu sits directly
	   under the search box with no space between them; the column
	   gap still separates side-by-side fields. */
	gap: 0 0.6rem;
	align-items: flex-end;
	background: var(--se-light-gray);
	padding: 0.75rem;
	/* About two extra lines of space before the results (0.8.1,
	   Tom's direction): the root font size on this site is 10px,
	   so the added 5.35rem is roughly 54px, about two lines of
	   body text. */
	margin-bottom: 6.6rem;
}

.se-filter-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.se-filter-field label {
	font-weight: 700;
	font-size: 0.875rem;
	color: var(--se-navy);
}

.se-filter-search {
	flex: 2 1 20rem;
}

.se-filter-tag,
.se-filter-sort,
.se-filter-book {
	flex: 1 1 10rem;
}

.se-filter-field input,
.se-filter-field select {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 1rem;
	color: var(--se-gray);
	background: var(--se-white);
	border: 1px solid var(--se-grid-gray);
	padding: 0.5rem 0.6rem;
	border-radius: 0;
	max-width: 100%;
	width: 100%;
	box-sizing: border-box;
}

/* Search is the dominant control: a standard text-entry box, taller
   and larger than the selects, with a clearly visible border. The
   body-qualified attribute-selector form (specificity 0,4,2) beats
   the theme's underline-only input styling, which otherwise wins on
   narrow viewports and leaves a bare underline; background-image and
   box-shadow are cleared explicitly so no theme underline gradient
   or shadow survives. No important-flag is used: specificity alone is
   expected to win, and the live mobile check must confirm it. This
   rule sits outside the 40rem media query, so the box look survives
   the stacked mobile layout, and the declarations match the previous
   desktop rendering (white fill, 1px #767676 border, square corners,
   same size and padding). The :focus selector keeps the box look
   when the field is tapped or focused on mobile. */

body.se-sermon-page .se-filters .se-filter-search input[type="search"],
body.se-sermon-page .se-filters .se-filter-search input[type="search"]:focus {
	font-size: 1.0625rem;
	padding: 0.75rem;
	background-color: #fff;
	background-image: none;
	border: 1px solid #767676;
	border-radius: 0;
	box-shadow: none;
}

/* Sort/Filter menu (0.8.0): the Bible book, Topic, and Sort by
   fields live inside one details menu under a single Sort/Filter
   summary, at Tom's direction. The menu starts open whenever any
   filter is active, so the current choices stay visible. */

.se-filter-menu {
	flex: 1 1 100%;
	margin-top: 0;
}

.se-filter-menu-summary {
	list-style: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-weight: 700;
	color: var(--se-navy);
	padding: 0 0 0.3rem;
	/* A tight line height (0.8.2) so the label's own line box adds
	   no hidden space above the words: the visible gap under the
	   search box is then only the padding, as Tom asked. The
	   inherited theme line height was leaving a tall empty band
	   above the text that margins could not remove. */
	line-height: 1.2;
}

.se-filter-menu-summary::-webkit-details-marker {
	display: none;
}

.se-filter-menu-summary::after {
	content: "";
	border-left: 0.32rem solid transparent;
	border-right: 0.32rem solid transparent;
	border-top: 0.42rem solid var(--se-navy);
	transition: transform 0.15s ease-in-out;
}

.se-filter-menu[open ] .se-filter-menu-summary::after {
	transform: rotate(180deg);
}

.se-filter-menu-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: flex-end;
	margin: 0.6rem 0;
}

.se-filter-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.se-filter-submit {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: var(--se-white);
	background: var(--se-navy);
	border: 1px solid var(--se-navy);
	padding: 0.5rem 1.25rem;
	cursor: pointer;
	border-radius: 0;
}

.se-filter-clear {
	font-size: 0.9rem;
	white-space: nowrap;
}

.se-results-line {
	font-size: 0.95rem;
	/* The space above this line and the filter form's bottom
	   margin together give the roughly two extra lines of space
	   before the results that Tom asked for (0.8.2); sibling
	   margins collapse to the larger of the two. */
	margin: 5.4rem 0 1.25rem;
}

/* Cards grid. */

.se-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 1.25rem;
	margin-bottom: 2rem;
}

.se-card {
	border: 1px solid var(--se-grid-gray);
	background: var(--se-white);
	padding: 1rem 1.1rem;
}

.se-card:hover {
	border-color: var(--se-navy);
}

.se-card-title {
	font-size: 1.15rem;
	line-height: 1.35;
	margin: 0 0 0.4rem;
}

.se-card-title a {
	color: var(--se-navy);
	text-decoration: none;
}

.se-card-title a:hover {
	text-decoration: underline;
}

.se-card-passage {
	font-style: italic;
	margin: 0 0 0.6rem;
}

.se-card-length {
	font-size: 0.9rem;
	margin: 0 0 0.6rem;
}

/* Member avatar menu (0.7.0): the signed-in member's photo is the
   menu button, with no text on the button. The panel drops from
   the photo and lists the whole navigation set. Replaces the
   0.6.0 header nav bar at Tom's direction. */

.se-member-menu {
	position: relative;
}

.se-member-menu-button {
	list-style: none;
	cursor: pointer;
	display: inline-flex;
	border-radius: 50%;
}

.se-member-menu-button::-webkit-details-marker {
	display: none;
}

.se-member-menu-button:focus-visible {
	outline: 2px solid var(--se-navy);
	outline-offset: 2px;
}

.se-member-menu-avatar {
	border-radius: 50%;
	border: 1px solid var(--se-grid-gray);
	display: block;
}

.se-member-menu-panel {
	position: absolute;
	right: 0;
	top: calc(100% + 0.5rem);
	background: var(--se-white);
	border: 1px solid var(--se-grid-gray);
	box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
	min-width: 13rem;
	z-index: 60;
	display: flex;
	flex-direction: column;
	padding: 0.4rem 0;
}

.se-member-menu-panel a {
	padding: 0.55rem 1.1rem;
	text-decoration: none;
	white-space: nowrap;
}

.se-member-menu-panel a:hover {
	background: var(--se-light-gray);
}

/* Collapsed worship package on the sermon page (0.6.0): the sermon
   outline renders first; the package follows under one heading. */

.se-worship {
	border: 1px solid var(--se-grid-gray);
	background: var(--se-white);
	padding: 0.8rem 1.1rem;
	margin: 1.75rem 0 0;
}

.se-worship summary {
	cursor: pointer;
	font-weight: bold;
	color: var(--se-navy);
}

.se-worship[open ] summary {
	margin-bottom: 0.5rem;
}

/* Tag pills. */

.se-tag-list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
}

.se-tag {
	margin: 0;
}

.se-tag a {
	display: inline-block;
	font-size: 0.8rem;
	line-height: 1.4;
	font-weight: 700;
	color: var(--se-navy);
	background: var(--se-gold);
	border: 1px solid var(--se-gold);
	border-radius: 999px;
	padding: 0.15rem 0.65rem;
	text-decoration: none;
}

.se-tag a:visited {
	color: var(--se-navy);
}

.se-tag a:hover {
	color: var(--se-white);
	background: var(--se-navy);
	border-color: var(--se-navy);
	text-decoration: none;
}

/* Empty state. */

.se-empty {
	border: 1px solid var(--se-grid-gray);
	background: var(--se-light-gray);
	padding: 1.5rem;
	text-align: center;
}

.se-empty p {
	margin: 0 0 0.5rem;
}

.se-empty p:last-child {
	margin-bottom: 0;
}

/* Pagination. */

.se-pagination {
	margin: 0 0 1rem;
}

.se-pagination ul.page-numbers {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
}

.se-pagination ul.page-numbers li {
	margin: 0;
}

.se-pagination .page-numbers a,
.se-pagination .page-numbers span {
	display: inline-block;
	padding: 0.35rem 0.7rem;
	border: 1px solid var(--se-grid-gray);
	text-decoration: none;
	line-height: 1.4;
}

.se-pagination .page-numbers a:hover {
	border-color: var(--se-navy);
}

.se-pagination .page-numbers.current {
	color: var(--se-white);
	background: var(--se-navy);
	border-color: var(--se-navy);
}

.se-pagination .page-numbers.dots {
	border-color: transparent;
}

/* Detail view: narrow reading column. */

.se-detail {
	max-width: 68ch;
	font-size: 17px;
	line-height: 1.6;
}

/* Back and Home navigation buttons (SE_Navigation::nav_buttons()).
   Back is navy-filled; Home is gold-filled with navy text. Rules are
   scoped under .se-nav-buttons so button colors beat the .se-wrap a
   color rule. */

.se-nav-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 0 0 1.25rem;
}

.se-nav-buttons--bottom {
	margin: 2rem 0 0;
}

.se-nav-buttons .se-btn {
	display: inline-block;
	font-family: Helvetica, Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.4;
	font-weight: 700;
	text-decoration: none;
	padding: 0.55rem 1.25rem;
	border: 1px solid var(--se-navy);
	border-radius: 0;
}

.se-nav-buttons .se-btn-back,
.se-nav-buttons .se-btn-back:visited {
	color: var(--se-white);
	background: var(--se-navy);
}

.se-nav-buttons .se-btn-home,
.se-nav-buttons .se-btn-home:visited {
	color: var(--se-navy);
	background: var(--se-gold);
	border-color: var(--se-gold);
}

.se-nav-buttons .se-btn:hover {
	opacity: 0.88;
	text-decoration: none;
}

/* Gap after the tags row: the tag list itself has no bottom margin
   and the first section heading has no top margin, so this bottom
   margin IS the gap. Measured 1.5rem; 1.5rem x 2.5 = 3.75rem. */

.se-sermon-header {
	margin-bottom: 3.75rem;
}

/* Detail heading hierarchy: title (2rem) > section heading (1.3em) >
   subhead (1.15em) > body (17px on .se-detail). These classes render
   only on the detail view; card titles (.se-card-title) are untouched. */

.se-sermon-title {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--se-navy);
	margin: 0 0 0.35rem;
}

.se-passage {
	font-size: 0.85em;
	font-style: italic;
	margin: 0 0 0.75rem;
}

/* Gift note under the title/passage on detail pages only: gray, plain.
   #767676 is the mid gray already used in this stylesheet (search
   border), clearly lighter than the #404040 body text. Sizes swapped
   with .se-passage at Tom's direction (0.6.2): the gift note now
   carries the passage's former 1.1rem, and the passage carries the
   note's former 0.85em. */

.se-sermon-header .se-gift-note {
	font-size: 1.1rem;
	font-weight: 400;
	font-style: normal;
	color: #767676;
	margin: 0 0 0.75rem;
}

.se-sermon p {
	margin: 0 0 1em;
}

/* Section headings with light dividers; subheads. Per-section
   modifiers (se-section--theme, --thought, --prelude, --scripture,
   --story, --outline, --extra) are intentional styling hooks for
   future per-section tweaks; no per-section rules ship in Stage 1. */

.se-section {
	margin-bottom: 2rem;
}

.se-section-heading {
	font-size: 1.3em;
	line-height: 1.3;
	font-weight: 700;
	color: var(--se-navy);
	margin: 0 0 0.75rem;
	padding-bottom: 0.4rem;
	border-bottom: 1px solid var(--se-grid-gray);
}

.se-subhead {
	font-size: 1.15em;
	line-height: 1.4;
	font-weight: 700;
	color: var(--se-navy);
	margin: 1.25rem 0 0.5rem;
}

/* Outline indentation. Markers stay visible in the text. */

.se-sermon .outline-l1 {
	margin-left: 1.5em;
}

.se-sermon .outline-l2 {
	margin-left: 3em;
}

.se-sermon .outline-l3 {
	margin-left: 4.5em;
}

/* Scripture section. */

.se-scripture-lead {
	font-size: 1.05rem;
	margin-bottom: 0.5rem;
}

.se-hymn-list,
.se-scripture-list {
	margin: 0 0 1em 1.25em;
	padding: 0;
}

.se-hymn-list li,
.se-scripture-list li {
	margin-bottom: 0.3em;
}

/* Locked view. */

.se-locked {
	background: var(--se-light-gray);
	border-left: 4px solid var(--se-navy);
	padding: 1.25rem 1.5rem;
}

.se-locked-heading {
	font-size: 1.3rem;
	color: var(--se-navy);
	margin: 0 0 0.6rem;
}

.se-locked p {
	margin: 0 0 0.8em;
}

.se-locked-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-bottom: 0;
}

.se-button {
	display: inline-block;
	font-size: 1rem;
	font-weight: 700;
	text-decoration: none;
	padding: 0.55rem 1.25rem;
	border: 1px solid var(--se-navy);
	background: var(--se-white);
}

.se-button:hover {
	text-decoration: none;
}

/* Button text colors use two-class selectors (plus :visited) so they
   beat the .se-wrap a rule, which would otherwise paint every link
   navy and leave the primary button's label invisible on its navy
   fill. Same pattern as the Back/Home buttons. */

.se-locked-actions .se-button,
.se-locked-actions .se-button:visited {
	color: var(--se-navy);
}

.se-locked-actions .se-button-primary,
.se-locked-actions .se-button-primary:visited {
	color: var(--se-white);
	background: var(--se-navy);
}

.se-locked-fallback {
	font-style: italic;
}

/* Narrow screens. */

@media (max-width: 40rem) {
	.se-wrap {
		padding: 1.25rem 1rem 2rem;
	}

	.se-filters {
		flex-direction: column;
		align-items: stretch;
	}

	.se-filter-search,
	.se-filter-tag,
	.se-filter-sort,
	.se-filter-book {
		flex: 1 1 auto;
	}

	.se-filter-actions {
		flex-wrap: wrap;
	}

	.se-grid {
		grid-template-columns: 1fr;
	}

	.se-sermon .outline-l1 {
		margin-left: 1em;
	}

	.se-sermon .outline-l2 {
		margin-left: 2em;
	}

	.se-sermon .outline-l3 {
		margin-left: 3em;
	}
}

/* -------------------------------------------------------------------------
   Stage 2: submission routes, standard page, form, and review styles.

   Every selector below is scoped under .se- classes or
   body.se-sermon-page, so these rules touch Exchange pages only.
   Family identity: navy #1F3864, gold #c9a227 used sparingly, gray
   #404040, light gray #F2F2F2, Helvetica. The one color outside the
   family palette is the dark error red #b3261e, used only for form
   errors and error notices, where a distinct error color is a
   usability need, not decoration. No !important flag is used
   anywhere in this section: the body-qualified input rule below
   follows the same specificity pattern as the search-box rule
   above, and the live check must confirm it beats the theme the
   same way. Form and review markup comes from the form worker's
   template and the review worker's partial; the class names styled
   here are the agreed contract, and any structural assumption
   (required marker placement, button elements) is noted at the
   rule. The 40rem mobile breakpoint matches the existing pattern.
   ------------------------------------------------------------------------- */

/* Standard page: narrow reading column, same measure and type size
   as the sermon detail view. Headings, lists, and the attestation
   blockquote are styled as descendants; the template uses no other
   classes. */

.se-standard {
	max-width: 68ch;
	font-size: 17px;
	line-height: 1.6;
}

.se-standard h1 {
	font-size: 2rem;
	line-height: 1.25;
	color: var(--se-navy);
	margin: 0 0 1rem;
}

.se-standard h2 {
	font-size: 1.6rem;
	line-height: 1.3;
	color: var(--se-navy);
	margin: 2rem 0 0.75rem;
	padding-bottom: 0.4rem;
	border-bottom: 1px solid var(--se-grid-gray);
}

.se-standard p {
	margin: 0 0 1em;
}

.se-standard ul {
	margin: 0 0 1em 1.25em;
	padding: 0;
}

.se-standard ul li {
	margin-bottom: 0.5em;
}

/* Attestation quote: italic, indented, navy left rule, matching the
   document's indented italic quote and the locked view's left rule. */

.se-standard blockquote {
	font-style: italic;
	margin: 0 0 1em;
	padding: 0 0 0 1.25rem;
	border-left: 4px solid var(--se-navy);
}

.se-standard blockquote p {
	margin: 0;
}

/* Required-fields table: navy header row, grid-gray borders, shaded
   row headers. */

.se-standard-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.5rem;
}

.se-standard-table th,
.se-standard-table td {
	text-align: left;
	vertical-align: top;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--se-grid-gray);
}

.se-standard-table thead th {
	color: var(--se-white);
	background: var(--se-navy);
	font-weight: 700;
}

.se-standard-table tbody th {
	color: var(--se-navy);
	background: var(--se-light-gray);
	font-weight: 700;
}

/* Submission form: same reading measure as the standard page.
   Unclassed headings in the form template get the family sizes. */

.se-form {
	max-width: 68ch;
	font-size: 17px;
	line-height: 1.6;
}

.se-form h1 {
	font-size: 2rem;
	line-height: 1.25;
	color: var(--se-navy);
	margin: 0 0 1rem;
}

.se-form h2 {
	font-size: 1.3rem;
	line-height: 1.3;
	color: var(--se-navy);
	margin: 2rem 0 0.75rem;
}

.se-form-intro {
	margin: 0 0 1.5rem;
}

.se-field {
	margin: 0 0 1.25rem;
}

.se-field-label {
	display: block;
	font-weight: 700;
	font-size: 1rem;
	color: var(--se-navy);
	margin: 0 0 0.35rem;
}

/* Required marker: an asterisk after the label. Covered for both
   placements of the modifier: on the field wrapper (label inside)
   and on the label itself. */

.se-field--required .se-field-label::after,
.se-field-label.se-field--required::after {
	content: " *";
	font-weight: 700;
	color: var(--se-navy);
}

.se-field-hint {
	font-size: 0.875rem;
	color: #595959;
	margin: 0.35rem 0;
}

.se-field-error {
	font-size: 0.9rem;
	font-weight: 700;
	color: #b3261e;
	margin: 0.35rem 0 0;
}

.se-field-error-summary {
	background: var(--se-light-gray);
	border: 1px solid var(--se-grid-gray);
	border-left: 4px solid #b3261e;
	padding: 1rem 1.25rem;
	margin: 0 0 1.5rem;
}

.se-field-error-summary p {
	margin: 0 0 0.5em;
}

.se-field-error-summary ul {
	margin: 0 0 0 1.25em;
	padding: 0;
}

.se-field-error-summary li {
	margin-bottom: 0.3em;
}

.se-field-error-summary a {
	color: #b3261e;
}

/* Text inputs and textareas: standard text-entry boxes, matching the
   search-box rule pattern above (white fill, full 1px #767676
   border, 17px, square corners, no theme underline gradient or
   shadow). The body-qualified form beats the theme's underline-only
   input styling without an !important flag; the :focus selectors
   keep the box look when a field is tapped or focused. Literal
   colors are used here, as in the search rule, so the box look does
   not depend on the .se-wrap variables. The :focus-visible outline
   from the .se-wrap rule above is untouched. */

body.se-sermon-page .se-input,
body.se-sermon-page .se-textarea,
body.se-sermon-page .se-input:focus,
body.se-sermon-page .se-textarea:focus {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 17px;
	line-height: 1.5;
	color: #404040;
	padding: 0.75rem;
	background-color: #fff;
	background-image: none;
	border: 1px solid #767676;
	border-radius: 0;
	box-shadow: none;
}

.se-input,
.se-textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.se-textarea {
	min-height: 8rem;
	resize: vertical;
}

/* Outline point blocks: one bordered block per main point. */

.se-point-block {
	border: 1px solid var(--se-grid-gray);
	background: var(--se-white);
	padding: 1rem;
	margin: 0 0 1rem;
}

.se-point-heading {
	font-size: 1.1rem;
	line-height: 1.4;
	font-weight: 700;
	color: var(--se-navy);
	margin: 0 0 0.75rem;
}

.se-point-remove {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--se-navy);
	background: var(--se-white);
	border: 1px solid var(--se-navy);
	padding: 0.35rem 0.75rem;
	border-radius: 0;
	cursor: pointer;
}

.se-point-remove:hover {
	background: var(--se-light-gray);
}

.se-point-add {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: var(--se-white);
	background: var(--se-navy);
	border: 1px solid var(--se-navy);
	padding: 0.55rem 1.25rem;
	border-radius: 0;
	cursor: pointer;
}

.se-point-add:hover {
	opacity: 0.88;
}

.se-word-count {
	display: block;
	font-size: 0.85rem;
	color: #767676;
	text-align: right;
	margin: 0.35rem 0 0;
}

/* Checkbox rows and the tag checkbox grid. The grid collapses to one
   column under 40rem (see the media query below). */

.se-checkbox-row {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	margin: 0 0 0.6rem;
}

.se-checkbox-row input[type="checkbox"] {
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	margin: 0.2rem 0 0;
	accent-color: #1f3864;
}

.se-tag-checkboxes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
	gap: 0.5rem 1rem;
	margin: 0 0 1.25rem;
}

.se-tag-checkboxes .se-checkbox-row {
	margin-bottom: 0;
	display: flex;
	align-items: flex-start;
	gap: 0.45rem;
	line-height: 1.35;
	min-width: 0;
}

/* The tag name sits in its own span (0.6.1) so a long name wraps
   inside its grid cell instead of overflowing into the next one. */

.se-tag-checkboxes .se-checkbox-text {
	min-width: 0;
	overflow-wrap: break-word;
}

/* Dashboard profile-photo controls (0.6.0): stack the label, file
   input, and buttons with even spacing instead of the browser
   defaults, and keep the remove form close under the upload form. */

.se-avatar-form {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.55rem;
	margin: 0.75rem 0 0;
}

.se-avatar-form input[type="file"] {
	max-width: 100%;
	font-family: Helvetica, Arial, sans-serif;
}

.se-avatar-remove-form {
	margin: 0.55rem 0 0;
}

/* Form actions: navy primary buttons, matching the filter submit
   and nav button styles. Assumes submit controls are button or
   submit-input elements inside .se-form-actions. */

.se-form-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
	margin: 1.75rem 0 0;
}

.se-form-actions button,
.se-form-actions input[type="submit"] {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: var(--se-white);
	background: var(--se-navy);
	border: 1px solid var(--se-navy);
	padding: 0.55rem 1.25rem;
	border-radius: 0;
	cursor: pointer;
}

.se-form-actions button:hover,
.se-form-actions input[type="submit"]:hover {
	opacity: 0.88;
}

/* Submitted-sermon list: one bordered row per entry. */

.se-submit-list {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
}

.se-submit-list li {
	border: 1px solid var(--se-grid-gray);
	background: var(--se-white);
	padding: 0.75rem 1rem;
	margin: 0 0 0.6rem;
}

.se-submit-list li:last-child {
	margin-bottom: 0;
}

/* Notices: the locked-view box pattern. Success takes the gold left
   rule (gold used sparingly); error takes the error-red left rule. */

.se-notice {
	background: var(--se-light-gray);
	border: 1px solid var(--se-grid-gray);
	border-left: 4px solid var(--se-navy);
	padding: 1rem 1.25rem;
	margin: 0 0 1.5rem;
}

.se-notice p {
	margin: 0 0 0.5em;
}

.se-notice p:last-child {
	margin-bottom: 0;
}

.se-notice--success {
	border-left-color: var(--se-gold);
}

.se-notice--error {
	border-left-color: #b3261e;
}

/* Review bar and actions (review worker's partial): status line with
   navy primary action buttons. Assumes action controls are button
   or submit-input elements inside .se-review-actions. */

.se-review-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	background: var(--se-light-gray);
	border: 1px solid var(--se-grid-gray);
	padding: 0.75rem 1rem;
	margin: 0 0 1.5rem;
}

.se-review-bar > p {
	margin: 0;
}

.se-review-actions p {
	margin: 0 0 0.6rem;
}

.se-review-actions p:last-child {
	margin-bottom: 0;
}

.se-review-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.se-review-actions button,
.se-review-actions input[type="submit"] {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: var(--se-white);
	background: var(--se-navy);
	border: 1px solid var(--se-navy);
	padding: 0.55rem 1.25rem;
	border-radius: 0;
	cursor: pointer;
}

.se-review-actions button:hover,
.se-review-actions input[type="submit"]:hover {
	opacity: 0.88;
}

/* The two review forms share the actions row; a flex basis keeps the
   return form (label, feedback box, hint, button) wide enough for
   its textarea instead of collapsing to the textarea's intrinsic
   width. */

.se-review-actions form {
	flex: 1 1 18rem;
}

/* Feedback controls in the return form: the textarea and label carry
   no classes in the review partial, so they are styled as
   descendants of the review bar, with the same box treatment as
   .se-textarea and the same label treatment as .se-field-label. */

.se-review-bar label {
	display: block;
	font-weight: 700;
	font-size: 1rem;
	color: var(--se-navy);
}

body.se-sermon-page .se-review-bar textarea,
body.se-sermon-page .se-review-bar textarea:focus {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 17px;
	line-height: 1.5;
	color: #404040;
	padding: 0.75rem;
	background-color: #fff;
	background-image: none;
	border: 1px solid #767676;
	border-radius: 0;
	box-shadow: none;
}

.se-review-bar textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	resize: vertical;
}

.se-owner-notice {
	background: var(--se-light-gray);
	border-left: 4px solid var(--se-navy);
	padding: 1rem 1.25rem;
	margin: 0 0 1.5rem;
}

.se-owner-notice p {
	margin: 0 0 0.5em;
}

.se-owner-notice p:last-child {
	margin-bottom: 0;
}

.se-contributor {
	font-size: 0.9rem;
	color: #767676;
	margin: 0 0 1em;
}

/* Narrow screens: stack fields and action rows full-width, single
   column tag grid, tighter table and point-block spacing. Inputs
   are already full-width above; the table keeps its two-column
   layout with wrapping text rather than horizontal scrolling. */

@media (max-width: 40rem) {
	.se-tag-checkboxes {
		grid-template-columns: 1fr;
	}

	.se-form-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.se-review-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.se-review-actions {
		flex-direction: column;
	}

	.se-point-block {
		padding: 0.75rem;
	}

	.se-standard-table th,
	.se-standard-table td {
		padding: 0.5rem;
		font-size: 0.95rem;
	}

	.se-word-count {
		text-align: left;
	}
}

/* ---------------------------------------------------------------------
   Stage 3: member dashboard (templates/dashboard.php) and the
   dashboard link on the submission page. Appended only; no Stage 1
   or Stage 2 rule above is changed.
   --------------------------------------------------------------------- */

.se-dash-panel {
	border: 1px solid #BFBFBF;
	background: #fff;
	padding: 1rem 1.25rem;
	margin: 0 0 1.25rem;
}

.se-dash-panel h2 {
	margin-top: 0;
}

.se-dash-notice {
	border-left: 4px solid #c9a227;
	background: #F2F2F2;
}

.se-dash-counts {
	list-style: none;
	margin: 0 0 0.75rem;
	padding: 0;
}

.se-dash-counts li {
	margin: 0.25rem 0;
}

.se-dash-history {
	margin: 0;
	padding-left: 1.25rem;
}

.se-dash-history li {
	margin: 0 0 0.9rem;
}

.se-dash-feedback {
	background: #F2F2F2;
	border-left: 4px solid #1F3864;
	padding: 0.75rem 1rem;
	margin: 0.5rem 0;
}

.se-dash-feedback p {
	margin: 0.25rem 0;
}

.se-dash-feedback .se-dash-feedback-heading {
	font-weight: bold;
	margin-top: 0;
}

.se-dash-tools ul {
	margin: 0;
	padding-left: 1.25rem;
}

.se-dash-tools li {
	margin: 0.25rem 0;
}

.se-dash-link {
	margin: 0 0 0.75rem;
}

/* === Stage 3 polish (0.4.0): dashboard presentation, profile
   photos, progress bar, stat tiles, library member chip ========
   Scoped to Exchange pages like the rest of this stylesheet. The
   dashboard-only rules hang off the se-dashboard-page body class
   that SE_Routes adds on the dashboard route alone, so the library
   and sermon pages keep the white background Tom chose for them;
   only the dashboard goes light gray, with its panels staying
   white. */

body.se-sermon-page.se-dashboard-page,
body.se-sermon-page.se-dashboard-page .se-main {
	background-color: var(--se-light-gray);
}

.se-dashboard .se-dash-panel {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Avatars: round everywhere they appear. */

.se-avatar {
	border-radius: 50%;
	object-fit: cover;
	vertical-align: middle;
}

.se-avatar-lg {
	border: 2px solid var(--se-grid-gray);
	flex: none;
}

/* Profile panel: photo beside the name and the upload controls. */

.se-dash-profile-row {
	display: flex;
	gap: 1.25rem;
	align-items: flex-start;
	flex-wrap: wrap;
}

.se-dash-profile-name {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--se-navy);
	margin: 0 0 0.5rem;
}

.se-dash-notice-text {
	color: var(--se-gray);
	margin: 0 0 0.75rem;
}

.se-avatar-form label {
	display: block;
	font-weight: 700;
	margin-bottom: 0.35rem;
}

.se-avatar-form input[type="file"] {
	display: block;
	margin-bottom: 0.6rem;
}

.se-avatar-form button,
.se-avatar-remove-form button {
	font: inherit;
	cursor: pointer;
	border-radius: 4px;
	padding: 0.45rem 0.9rem;
}

.se-avatar-form button {
	background-color: var(--se-navy);
	border: 1px solid var(--se-navy);
	color: #ffffff;
}

.se-avatar-remove-form {
	margin-top: 0.6rem;
}

.se-avatar-remove {
	background-color: #ffffff;
	border: 1px solid var(--se-grid-gray);
	color: var(--se-gray);
}

/* Access progress bar: the fill animates from empty to its set
   width on page load (the keyframes name only the start, so the
   animation lands on the inline width). Gold fill on a light
   track, matching the brand. */

.se-dash-progress {
	background-color: var(--se-light-gray);
	border: 1px solid var(--se-grid-gray);
	border-radius: 999px;
	height: 0.9rem;
	margin-top: 1rem;
	overflow: hidden;
}

.se-dash-progress-fill {
	background-color: var(--se-gold);
	height: 100%;
	border-radius: 999px;
	animation: se-dash-grow 0.9s ease-out;
}

@keyframes se-dash-grow {
	from {
		width: 0;
	}
}

.se-dash-progress-caption {
	color: var(--se-gray);
	font-size: 0.9em;
	margin-top: 0.4rem;
}

/* Contribution stat tiles: big navy numbers over small labels. */

.se-dash-tiles {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 1rem;
}

.se-dash-tile {
	flex: 1 1 8rem;
	border: 1px solid var(--se-grid-gray);
	border-top: 3px solid var(--se-gold);
	border-radius: 6px;
	padding: 0.75rem 0.9rem;
	text-align: center;
}

.se-dash-tile-num {
	display: block;
	font-size: 1.8rem;
	font-weight: 700;
	line-height: 1.15;
	color: var(--se-navy);
}

.se-dash-tile-label {
	display: block;
	color: var(--se-gray);
	font-size: 0.9em;
}

/* Blog panel list. */

.se-dash-blog-list {
	margin: 0 0 0 1.25em;
	padding: 0;
}

/* Library member chip: the signed-in member's photo and a My
   Dashboard link at the top of the library front page. */

.se-member-bar {
	display: flex;
	justify-content: flex-end;
	margin: 0 0 1rem;
}

.se-member-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background-color: #ffffff;
	border: 1px solid var(--se-grid-gray);
	border-radius: 999px;
	padding: 0.3rem 0.9rem 0.3rem 0.35rem;
	font-weight: 700;
	text-decoration: none;
}

.se-member-avatar {
	border: 1px solid var(--se-grid-gray);
}

/* === Member-bar join chip (0.4.1) ==============================
   Logged-out visitors get the same chip position with a generic
   placeholder avatar (an inline SVG silhouette) and Sign up free /
   Sign in links, so the way in is visible from the library front
   page. */

.se-member-chip-join a {
	text-decoration: none;
}

.se-member-chip-sep {
	color: var(--se-grid-gray);
}

.se-avatar-placeholder {
	background-color: #ffffff;
	flex: none;
}

/* === Community signals (0.5.0) ================================
   The helpful vote and flag panel at the foot of a published
   sermon, and the reviewer's appeals queue on the dashboard. */

.se-signals {
	background-color: #ffffff;
	border: 1px solid var(--se-grid-gray);
	border-radius: 8px;
	margin-top: 2rem;
	padding: 1.25rem 1.5rem;
}

.se-signals h2 {
	font-size: 1.25rem;
	margin-top: 0;
}

.se-signals-vote {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0.75rem 0;
}

.se-signals-vote form,
.se-dash-appeals-list form {
	margin: 0;
}

.se-signals-flag textarea {
	max-width: 32rem;
	width: 100%;
}

.se-dash-appeals-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.se-dash-appeals-list li {
	border-top: 1px solid var(--se-grid-gray);
	padding: 1rem 0;
}

.se-dash-appeals-list li:first-child {
	border-top: none;
	padding-top: 0;
}

.se-dash-appeals-list form {
	display: inline-block;
	margin-right: 0.5rem;
}
