/*
 * The members' site (views/templates/portal-index.php): the public mitzvos
 * pages, sign in, My account, paying, bidding. Plain CSS, no build step.
 *
 * The look is the admin sign-in page's (admins/styles.css, ".login-page"):
 * white cards with a 12px radius and one soft shadow on a pale grey page,
 * generous spacing, one blue button per screen for the thing to do next.
 *
 * Rules for anything added here:
 *
 *  - Phone first. Many members are older and on a phone: body text is 16px
 *    or more, anything tappable is at least 44px tall, and a form field is
 *    16px+ so iOS does not zoom into it.
 *  - Logical properties only (margin-inline, padding-inline, inset-inline,
 *    text-align: start/end), so the one stylesheet lays out English left to
 *    right and Hebrew right to left. No left/right.
 *  - The class names js/portal/mitzvos.js reads stay: .mitzvah-card--{state}
 *    on a card or the mitzvah page, .is-closing-soon, and the data-live
 *    attributes in the views.
 */

:root {
	--portal-ink: #1f2733;
	--portal-text: #3b4250;
	--portal-muted: #667085;
	--portal-line: #e6e8ee;
	--portal-field: #cfd4dc;
	--portal-bg: #f3f5f9;
	--portal-card: #ffffff;
	--portal-brand: #2f6fcf;
	--portal-brand-dark: #2659ad;
	--portal-brand-soft: #eaf2fc;
	--portal-brand-ink: #ffffff;
	--portal-due: #9a3b12;
	--portal-due-bg: #fff4ec;
	--portal-due-line: #f2cfb6;
	--portal-ok: #17613a;
	--portal-ok-bg: #e8f5ed;
	--portal-ok-line: #bfe3cd;
	--portal-warn: #7a5800;
	--portal-warn-bg: #fff1cc;
	--portal-error: #b3261e;
	--portal-error-bg: #fdecea;
	--portal-radius: 12px;
	--portal-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 32px rgba(16, 24, 40, .08);
	--portal-shadow-soft: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .05);
}

[x-cloak] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

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

body.portal {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--portal-bg);
	color: var(--portal-text);
	font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

html[dir="rtl"] body.portal {
	font-family: system-ui, "Segoe UI", Arial, "Noto Sans Hebrew", sans-serif;
}

.portal a { color: var(--portal-brand); }
.portal a:hover { color: var(--portal-brand-dark); }
.portal :focus-visible { outline: 3px solid rgba(47, 111, 207, .4); outline-offset: 2px; border-radius: 4px; }

.portal h1 { font-size: 26px; line-height: 1.25; font-weight: 650; margin: 0 0 8px; color: var(--portal-ink); letter-spacing: -.01em; }
.portal h2 { font-size: 18px; line-height: 1.3; font-weight: 650; margin: 0 0 14px; color: var(--portal-ink); }
.portal p { margin: 0 0 12px; }

.portal-muted { color: var(--portal-muted); }
.portal-small { font-size: 14px; }
.portal-hebrew { margin: 0; color: var(--portal-muted); font-size: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- header ------------------------------------------------------------ */

.portal-header {
	background: var(--portal-card);
	border-bottom: 1px solid var(--portal-line);
	position: sticky;
	top: 0;
	z-index: 20;
}

.portal-header__inner {
	max-width: 1080px;
	margin: 0 auto;
	padding: 10px 16px;
	display: flex;
	align-items: center;
	gap: 8px 20px;
	flex-wrap: wrap;
}

.portal-brand { display: flex; align-items: center; margin-inline-end: auto; }
.portal-brand img { height: 40px; width: auto; display: block; }

.portal-nav { display: flex; align-items: center; gap: 4px; order: 3; flex: 1 1 100%; margin: 0 -8px -10px; border-top: 1px solid var(--portal-line); padding-top: 2px; }
.portal-nav--single { display: none; }
.portal-nav a {
	display: inline-flex; align-items: center;
	min-height: 44px; padding: 0 12px;
	color: var(--portal-muted); font-weight: 600; text-decoration: none;
	border-bottom: 3px solid transparent;
}
.portal-nav a:hover { color: var(--portal-ink); }
.portal-nav a[aria-current="page"] { color: var(--portal-brand-dark); border-bottom-color: var(--portal-brand); }

.portal-tools { display: flex; align-items: center; gap: 8px; }
.portal-tools form { margin: 0; }
.portal-tool {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 40px; padding: 0 14px;
	border: 1px solid var(--portal-field); border-radius: 999px;
	background: #fff; color: var(--portal-text) !important;
	font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.portal-tool:hover { background: var(--portal-bg); border-color: #b9c0cb; }
.portal-tool--primary { background: var(--portal-brand); border-color: var(--portal-brand); color: #fff !important; }
.portal-tool--primary:hover { background: var(--portal-brand-dark); border-color: var(--portal-brand-dark); }

/* ---- layout ------------------------------------------------------------ */

.portal-main {
	width: 100%;
	max-width: 1080px;
	margin: 0 auto;
	padding: 24px 16px 56px;
	flex: 1 0 auto;
}

.portal-footer { border-top: 1px solid var(--portal-line); padding: 18px 16px 28px; text-align: center; font-size: 14px; color: var(--portal-muted); }
.portal-footer p { margin: 0; }

.portal-card {
	background: var(--portal-card);
	border-radius: var(--portal-radius);
	box-shadow: var(--portal-shadow-soft);
	padding: 22px 20px;
	margin-bottom: 18px;
}

/* One calm centred card: sign in, sign up, choose an account, pay. */
.portal-card--narrow {
	max-width: 440px;
	margin: 16px auto;
	padding: 28px 22px;
	box-shadow: var(--portal-shadow);
}
.portal-card--narrow > form > h1, .portal-card--narrow > h1 { text-align: center; font-size: 24px; }
.portal-card--narrow > form > h1 + .portal-muted, .portal-card--narrow > h1 + .portal-muted { text-align: center; margin-bottom: 4px; }
.portal-card--wide { max-width: 560px; }

.portal-back { margin: 0 0 14px; font-size: 15px; }
.portal-back a { text-decoration: none; font-weight: 600; }
.portal-back a::before { content: "\2190\00a0"; }
html[dir="rtl"] .portal-back a::before { content: "\2192\00a0"; }

/* ---- forms ------------------------------------------------------------- */

.portal-field { display: block; margin: 18px 0 14px; }
.portal-field > span { display: block; font-weight: 600; font-size: 15px; color: var(--portal-ink); margin-bottom: 6px; }

.portal-field input, .portal-year select, .mitzvos-filters input, .mitzvos-filters select {
	width: 100%;
	min-height: 48px;
	font: inherit;
	font-size: 17px; /* 16px+ stops iOS zooming into the field */
	padding: 10px 14px;
	border: 1px solid var(--portal-field);
	border-radius: 8px;
	background: #fff;
	color: var(--portal-ink);
	-webkit-appearance: none;
	appearance: none;
}
.portal-field input:focus, .portal-year select:focus, .mitzvos-filters input:focus, .mitzvos-filters select:focus {
	outline: 3px solid rgba(47, 111, 207, .25);
	outline-offset: 0;
	border-color: var(--portal-brand);
}
.portal select {
	padding-inline-end: 38px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
}
html[dir="rtl"] .portal select { background-position: left 14px center; }

.portal-code {
	letter-spacing: .35em;
	text-align: center;
	font-size: 24px !important;
	font-variant-numeric: tabular-nums;
}

.portal-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 18px;
	font-size: 15px;
	line-height: 1.45;
}
.portal-check input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--portal-brand); }

.portal-button {
	display: block;
	width: 100%;
	min-height: 48px;
	padding: 12px 20px;
	border: 0;
	border-radius: 8px;
	background: var(--portal-brand);
	color: var(--portal-brand-ink) !important;
	font: inherit;
	font-weight: 600;
	font-size: 17px;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease-in-out;
}
.portal-button:hover { background: var(--portal-brand-dark); }
.portal-button:disabled { opacity: .55; cursor: default; background: var(--portal-brand); }
.portal-button--small { display: inline-block; width: auto; min-height: 40px; padding: 8px 14px; font-size: 15px; }
.portal-button--inline { display: inline-block; width: auto; padding-inline: 28px; }

.portal-links {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	margin: 16px 0 6px;
}

.portal-link {
	min-height: 40px;
	background: none;
	border: 0;
	padding: 0 6px;
	font: inherit;
	font-size: 15px;
	color: var(--portal-brand);
	text-decoration: none;
	cursor: pointer;
}
.portal-link:hover { text-decoration: underline; }
.portal-link:disabled { opacity: .6; }

.portal-foot { margin: 20px 0 0; text-align: center; font-size: 15px; color: var(--portal-muted); }

.portal-error, .portal-notice {
	border-radius: 8px;
	padding: 10px 14px;
	margin: 0 0 14px;
	font-size: 15px;
	line-height: 1.45;
}
.portal-error { color: var(--portal-error); background: var(--portal-error-bg); }
.portal-notice { color: var(--portal-ok); background: var(--portal-ok-bg); }
.portal-notice--page { margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--portal-ok-line); font-weight: 600; }

/* ---- choose an account ------------------------------------------------- */

.portal-choices { display: grid; gap: 10px; margin-top: 20px; }

.portal-choice {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	width: 100%;
	min-height: 56px;
	padding: 14px 16px;
	text-align: start;
	font: inherit;
	color: inherit;
	background: #fff;
	border: 1px solid var(--portal-field);
	border-radius: 10px;
	cursor: pointer;
	transition: border-color .15s ease-in-out, background-color .15s ease-in-out;
}
.portal-choice:hover, .portal-choice:focus { border-color: var(--portal-brand); background: var(--portal-brand-soft); }
.portal-choice__name { font-weight: 600; color: var(--portal-ink); }
.portal-choice__hebrew { color: var(--portal-muted); }

.portal-badge {
	margin-top: 4px;
	font-size: 12px;
	font-weight: 600;
	padding: 1px 9px;
	border-radius: 999px;
	background: var(--portal-ok-bg);
	color: var(--portal-ok);
}

/* ---- my account -------------------------------------------------------- */

.portal-account__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}
.portal-account__head h1 { margin-bottom: 2px; }

.portal-year label { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.portal-year select { width: auto; min-height: 44px; font-size: 16px; }
.portal-year-label { margin: 0; color: var(--portal-muted); font-weight: 600; }

.portal-balance {
	border-radius: var(--portal-radius);
	padding: 22px 20px;
	margin-bottom: 18px;
	background: var(--portal-card);
	box-shadow: var(--portal-shadow-soft);
	border-inline-start: 6px solid var(--portal-line);
}
.portal-balance--due { border-inline-start-color: #e08a4f; }
.portal-balance--paid, .portal-balance--credit { border-inline-start-color: #49a873; }

.portal-balance__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.portal-balance__main { display: flex; flex-direction: column; gap: 2px; }
.portal-balance__label { font-weight: 600; color: var(--portal-ink); }
.portal-balance__amount {
	font-size: 40px;
	font-weight: 650;
	line-height: 1.15;
	letter-spacing: -.02em;
	font-variant-numeric: tabular-nums;
	color: var(--portal-ink);
}
.portal-balance--due .portal-balance__amount { color: var(--portal-due); }
.portal-balance--paid .portal-balance__amount,
.portal-balance--credit .portal-balance__amount { color: var(--portal-ok); }
.portal-balance__note { color: var(--portal-muted); font-size: 15px; }
.portal-balance__top .portal-button { flex: 1 1 200px; max-width: 320px; }

.portal-balance__figures {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 32px;
	margin: 18px 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--portal-line);
}
.portal-balance__figures dt { font-size: 13px; color: var(--portal-muted); }
.portal-balance__figures dd { margin: 0; font-weight: 600; color: var(--portal-ink); font-variant-numeric: tabular-nums; }
.portal-balance__previous { margin: 14px 0 0; font-size: 15px; color: var(--portal-muted); }

.portal-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.portal-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
}
.portal-table th, .portal-table td {
	padding: 11px 8px;
	border-bottom: 1px solid var(--portal-line);
	text-align: start;
	vertical-align: top;
}
.portal-table th:first-child, .portal-table td:first-child { padding-inline-start: 0; }
.portal-table th:last-child, .portal-table td:last-child { padding-inline-end: 0; }
.portal-table th { font-size: 13px; color: var(--portal-muted); font-weight: 600; white-space: nowrap; }
.portal-table tr:last-child td { border-bottom: 0; }
.portal-table td .portal-small { display: block; }
.portal-num { text-align: end !important; white-space: nowrap; font-variant-numeric: tabular-nums; }

.portal-details { margin: 0 0 14px; display: grid; gap: 10px; }
.portal-details div { display: flex; gap: 12px; flex-wrap: wrap; }
.portal-details dt { min-width: 80px; color: var(--portal-muted); }
.portal-details dd { margin: 0; color: var(--portal-ink); }

.portal-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #eef0f4; color: #4b5563; white-space: nowrap; }
.portal-status--approved, .portal-status--won { background: var(--portal-ok-bg); color: var(--portal-ok); }
.portal-status--pending { background: var(--portal-warn-bg); color: var(--portal-warn); }

/* ---- pay ---------------------------------------------------------------- */

.portal-due {
	display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
	margin: 18px 0 4px; padding: 14px 16px;
	border-radius: 10px; background: var(--portal-bg);
}
.portal-due strong { font-size: 24px; font-weight: 650; color: var(--portal-ink); font-variant-numeric: tabular-nums; }

.portal-amounts { border: 0; padding: 0; margin: 20px 0 6px; min-width: 0; }
.portal-amounts legend { font-weight: 600; font-size: 15px; color: var(--portal-ink); padding: 0; margin-bottom: 8px; }
.portal-radio {
	display: flex; align-items: center; gap: 12px;
	min-height: 52px; margin: 0 0 8px; padding: 10px 14px;
	border: 1px solid var(--portal-field); border-radius: 10px; background: #fff; cursor: pointer;
}
.portal-radio:has(input:checked) { border-color: var(--portal-brand); background: var(--portal-brand-soft); box-shadow: inset 0 0 0 1px var(--portal-brand); }
.portal-radio input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--portal-brand); }
.portal-amounts .portal-field { margin-top: 12px; }

.portal-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.portal-row .portal-field { margin-top: 4px; }
.portal-row .portal-field > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.portal-secure { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; font-size: 14px; color: var(--portal-muted); }
.portal-secure::before {
	content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23667085'%3E%3Cpath d='M10 1a4.5 4.5 0 0 0-4.5 4.5V8H5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2h-.5V5.5A4.5 4.5 0 0 0 10 1zm2.5 7h-5V5.5a2.5 2.5 0 0 1 5 0V8z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---- mitzvos (public) ---------------------------------------------------- */

.mitzvos-head { text-align: center; padding: 12px 0 4px; }
.mitzvos-head h1 { font-size: 30px; margin-bottom: 8px; }
.mitzvos-head > p { max-width: 56ch; margin-inline: auto; }

.mitzvos-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 22px 0 24px;
	text-align: start;
}
.mitzvos-filters label { display: block; flex: 1 1 150px; }
.mitzvos-filters__search { flex: 1 1 100% !important; position: relative; }
.mitzvos-filters__search input {
	min-height: 54px; padding-inline-start: 46px; border-radius: 12px;
	box-shadow: var(--portal-shadow-soft); border-color: transparent;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='M14 14l4 4'/%3E%3C/svg%3E") no-repeat left 16px center / 18px;
}
html[dir="rtl"] .mitzvos-filters__search input { background-position: right 16px center; }
.mitzvos-filters select { min-height: 46px; font-size: 16px; }

.portal-empty { text-align: center; color: var(--portal-muted); padding: 56px 0; }

.mitzvos-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
	gap: 18px;
}
.mitzvah-card a {
	display: flex; flex-direction: column; height: 100%;
	color: inherit; text-decoration: none;
	background: var(--portal-card); border-radius: var(--portal-radius); overflow: hidden;
	box-shadow: var(--portal-shadow-soft);
	transition: box-shadow .15s ease-in-out, transform .15s ease-in-out;
}
.mitzvah-card a:hover, .mitzvah-card a:focus-visible { color: inherit; box-shadow: var(--portal-shadow); transform: translateY(-2px); }
.mitzvah-card__image { position: relative; aspect-ratio: 3 / 2; background: #e6eaf2; }
.mitzvah-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mitzvah-card__placeholder {
	display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
	background: linear-gradient(135deg, #e3ebf8, #f1f4f9);
	color: #b3c2dc; font-size: 34px; font-weight: 700; letter-spacing: .1em;
}
.mitzvah-card__placeholder--large { aspect-ratio: 3 / 2; border-radius: var(--portal-radius); font-size: 56px; }

.mitzvah-badge {
	position: absolute; top: 12px; inset-inline-start: 12px;
	padding: 3px 11px; border-radius: 999px;
	font-size: 13px; font-weight: 600; line-height: 1.5;
	background: var(--portal-ok-bg); color: var(--portal-ok);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
}
.mitzvah-card--closed .mitzvah-badge { background: var(--portal-warn-bg); color: var(--portal-warn); }
.mitzvah-card--awarded .mitzvah-badge { background: #e3eaff; color: #24408e; }
.is-closing-soon .mitzvah-badge { background: #fde8e4; color: var(--portal-due); }

.mitzvah-card__body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 16px 18px 18px; }
.mitzvah-card__body h2 { font-size: 19px; margin: 0; }
.mitzvah-card__alt { margin: 2px 0 0; color: var(--portal-muted); font-size: 15px; }
.mitzvah-card__amount { margin: auto 0 0; padding-top: 14px; display: flex; flex-direction: column; gap: 0; }
.mitzvah-card__amount span { color: var(--portal-muted); font-size: 13px; }
.mitzvah-card__amount strong { font-size: 24px; font-weight: 650; color: var(--portal-ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.mitzvah-card__winner { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: #24408e; }
.mitzvah-card__time { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--portal-line); font-size: 14px; color: var(--portal-muted); min-height: calc(1.55em + 10px); }
.is-closing-soon [data-live="countdown"] { color: var(--portal-due); font-weight: 600; }

/* ---- one mitzvah --------------------------------------------------------- */

.mitzvah-page { display: grid; gap: 20px; }
.mitzvah-page__gallery img { width: 100%; border-radius: var(--portal-radius); display: block; }
.mitzvah-page__thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mitzvah-page__thumbs button { padding: 0; border: 3px solid transparent; border-radius: 10px; background: none; cursor: pointer; }
.mitzvah-page__thumbs button.is-active { border-color: var(--portal-brand); }
.mitzvah-page__thumbs img { width: 76px; height: 54px; object-fit: cover; border-radius: 7px; }

.mitzvah-page__info { background: var(--portal-card); border-radius: var(--portal-radius); box-shadow: var(--portal-shadow); padding: 24px 20px; }
.mitzvah-page__info .mitzvah-badge { position: static; display: inline-block; margin-bottom: 10px; box-shadow: none; }
.mitzvah-page__info h1 { margin: 0; font-size: 28px; }
.mitzvah-page__occasion { margin: 6px 0 0; font-size: 15px; color: var(--portal-muted); }
.mitzvah-page__price { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--portal-line); }
.mitzvah-page__price span { display: block; color: var(--portal-muted); font-size: 15px; }
.mitzvah-page__price strong { display: block; font-size: 40px; font-weight: 650; line-height: 1.15; letter-spacing: -.02em; color: var(--portal-ink); font-variant-numeric: tabular-nums; }
.mitzvah-page__time { font-weight: 600; margin: 8px 0 0; color: var(--portal-ink); }
.mitzvah-page__time:empty { display: none; }
.mitzvah-page__bid { margin: 0; }
.mitzvah-page__bid:not(:empty) { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--portal-line); }
.mitzvah-page__minimum { color: var(--portal-muted); }
.mitzvah-page__description { line-height: 1.65; }
.mitzvah-page__description h2 { margin-bottom: 8px; }

.mitzvah-how { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14px; color: var(--portal-muted); }
.mitzvah-how li { display: flex; gap: 10px; }
.mitzvah-how li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: .6em; border-radius: 50%; background: #9db8e3; }

/* ---- bid form -------------------------------------------------------------- */

.bid-form { margin: 0; }
.bid-form .portal-field:first-child { margin-top: 0; }
.bid-steps { display: flex; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; font-size: 13px; font-weight: 600; color: #9aa0ad; }
.bid-steps li { flex: 1 1 0; padding-top: 8px; border-top: 4px solid var(--portal-line); }
.bid-steps li.is-now { border-top-color: var(--portal-brand); color: var(--portal-ink); }
.bid-steps li.is-done { border-top-color: #9fd3b4; color: #3f7d59; }
.bid-hold { margin: -4px 0 14px; font-size: 14px; color: var(--portal-muted); }
.bid-confirm__line { font-size: 22px; font-weight: 650; color: var(--portal-ink); margin: 0 0 8px; }
.bid-confirm .portal-check { margin-top: 16px; padding: 14px; border: 1px solid var(--portal-field); border-radius: 10px; background: var(--portal-bg); font-weight: 600; color: var(--portal-ink); }
.bid-form .portal-link { display: block; margin: 10px auto 0; }

/* ---- wider screens ---------------------------------------------------------- */

@media (min-width: 640px) {
	.portal-header__inner { flex-wrap: nowrap; padding-block: 0; min-height: 64px; }
	.portal-brand { margin-inline-end: 12px; }
	.portal-nav { order: 0; flex: 1 1 auto; margin: 0; border-top: 0; padding-top: 0; align-self: stretch; }
	.portal-nav--single { display: flex; }
	.portal-nav a { min-height: 64px; }
	.portal-main { padding-top: 36px; }
	.portal h1 { font-size: 30px; }
	.mitzvos-head h1 { font-size: 36px; }
	.portal-card { padding: 26px 28px; }
	.portal-card--narrow { margin-top: 32px; padding: 36px 36px 32px; }
	.portal-balance { padding: 26px 28px; }
	.mitzvos-filters__search { flex: 2 1 320px !important; }
	.mitzvos-filters select { min-height: 54px; border-radius: 12px; border-color: transparent; box-shadow: var(--portal-shadow-soft); }
	.mitzvah-page__info { padding: 30px 30px 28px; }
}

@media (min-width: 860px) {
	.mitzvah-page { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: start; }
	.mitzvah-page__info { position: sticky; top: 88px; grid-column: 2; grid-row: 1 / span 2; }
	.mitzvah-page__gallery, .mitzvah-page__description { grid-column: 1; }
}

/* ---- narrow screens: a table becomes a list of labelled rows ---------------- */

@media (max-width: 559px) {
	.portal-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.portal-table--stack, .portal-table--stack tbody, .portal-table--stack tr, .portal-table--stack td { display: block; width: 100%; }
	.portal-table--stack tr { padding: 12px 0; border-bottom: 1px solid var(--portal-line); }
	.portal-table--stack tr:last-child { border-bottom: 0; padding-bottom: 0; }
	.portal-table--stack tr:first-child { padding-top: 0; }
	.portal-table--stack td { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; border: 0; text-align: end; }
	.portal-table--stack td::before { content: attr(data-label); flex: none; color: var(--portal-muted); font-size: 14px; text-align: start; }
	.portal-table--stack td .portal-small { display: block; }
	.portal-table--stack td > span:only-child, .portal-table--stack td > div { text-align: end; }
}

@media (prefers-reduced-motion: reduce) {
	.mitzvah-card a, .portal-button { transition: none; }
	.mitzvah-card a:hover { transform: none; }
}
