/* 3imara plus — front-end components for forms, dashboard and profile cards.
   Uses CSS custom properties so any theme can restyle it. Logical properties = RTL ready. */
.imara-auth, .imara-form, .imara-dash, .profile-grid, .imara-gate {
	--if-ink: var(--ink, #111110);
	--if-bg: var(--paper, #fffcf7);
	--if-card: var(--card, #fff);
	--if-line: var(--line, #e7e2d9);
	--if-muted: var(--muted, #6b6862);
	--if-accent: var(--accent, #2fb9ef);
	--if-grad: var(--grad, linear-gradient(120deg, #1fd8e8, #40b4f5));
	--if-radius: 0;
	--if-err: #b42318;
	--if-ok: #067647;
}

/* Auth split layout */
.imara-auth { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); border: 1px solid var(--if-line); border-radius: 0; overflow: hidden; background: var(--if-card); }
.imara-auth__aside { position: relative; padding: clamp(28px, 4vw, 56px); background: var(--if-ink); color: #f4f1ea; display: flex; flex-direction: column; justify-content: flex-end; min-height: 420px; isolation: isolate; }
.imara-auth__aside::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 80% at 100% 0%, rgba(31, 216, 232, .32), transparent 60%), radial-gradient(90% 60% at 0% 100%, rgba(64, 180, 245, .25), transparent 60%); }
.imara-auth__kicker { margin: 0 0 auto; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: #a9e9f3; }
.imara-auth__quote { font-family: var(--font-display, Georgia, serif); font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1.15; margin: 40px 0 24px; }
.imara-auth__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: #cfccc4; }
.imara-auth__list li { display: flex; gap: 10px; align-items: baseline; }
.imara-auth__list li::before { content: ""; flex: none; width: 14px; height: 2px; background: var(--if-grad); transform: translateY(-4px); }
.imara-auth__main { padding: clamp(24px, 4vw, 56px); }
.imara-auth__title { margin: 0 0 6px; font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
.imara-auth__lead { margin: 0 0 24px; color: var(--if-muted); }
@media (max-width: 820px) { .imara-auth { grid-template-columns: minmax(0, 1fr); } .imara-auth__aside { min-height: 0; } .imara-auth__quote { margin-top: 18px; } }

/* Fields */
.imara-form { display: grid; gap: 18px; }
.imara-field { display: grid; gap: 6px; min-width: 0; }
.imara-field__label { font-weight: 600; font-size: .92rem; color: var(--if-ink); }
.imara-field__help { font-size: .82rem; color: var(--if-muted); line-height: 1.45; }
.imara-req { color: var(--if-accent); }
.imara-opt { font-weight: 400; color: var(--if-muted); font-size: .85em; }
.imara-input, .imara-form select, .imara-form textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--if-line); border-radius: 0; background: var(--if-card); color: var(--if-ink); font: inherit; font-size: 1rem; transition: border-color .15s, box-shadow .15s; }
.imara-form textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.imara-input:focus, .imara-form select:focus, .imara-form textarea:focus { outline: none; border-color: var(--if-accent); box-shadow: 0 0 0 3px rgba(47, 185, 239, .2); }
.imara-input:user-invalid, .imara-form textarea:user-invalid { border-color: var(--if-err); }
.imara-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 600px) { .imara-row { grid-template-columns: minmax(0, 1fr); } }
.imara-password { position: relative; }
.imara-password .imara-input { padding-inline-end: 76px; }
.imara-password__toggle { position: absolute; inset-inline-end: 6px; top: 6px; bottom: 6px; padding: 0 12px; border: 0; border-radius: 0; background: transparent; color: var(--if-muted); font: inherit; font-size: .85rem; cursor: pointer; }
.imara-password__toggle:hover, .imara-password__toggle:focus-visible { background: rgba(0, 0, 0, .05); color: var(--if-ink); }
.imara-check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.5; color: var(--if-ink); }
.imara-check input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--if-ink); }
.imara-hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.imara-form__alt { margin: 4px 0 0; color: var(--if-muted); font-size: .92rem; }
.imara-form__alt a { color: var(--if-ink); font-weight: 600; }

/* Buttons */
.imara-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 1px solid var(--if-ink); border-radius: 0; background: var(--if-ink); color: var(--on-ink, #fff); font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.imara-btn:hover, .imara-btn:focus-visible { color: var(--on-ink, #fff); box-shadow: 0 8px 22px rgba(17, 17, 16, .18); transform: translateY(-1px); }
.imara-btn--block { width: 100%; }
.imara-btn--lg { min-height: 56px; padding: 0 30px; font-size: 1.02rem; }
.imara-btn--ghost { background: transparent; color: var(--if-ink); }
.imara-btn--ghost:hover, .imara-btn--ghost:focus-visible { color: var(--if-ink); }
.imara-btn--danger { background: transparent; color: var(--if-err); border-color: var(--if-err); }
.imara-btn--danger:hover, .imara-btn--danger:focus-visible { background: var(--if-err); color: #fff; }
.imara-btn[disabled], .imara-btn.is-loading { opacity: .6; pointer-events: none; }

/* Notices */
.imara-notice { padding: 14px 16px; border-radius: 0; font-size: .95rem; line-height: 1.5; }
.imara-notice--error { background: #fef3f2; color: var(--if-err); border: 1px solid #fecdca; }
.imara-notice--success { background: #ecfdf3; color: var(--if-ok); border: 1px solid #abefc6; }
.imara-notice ul { margin: 6px 0 0; padding-inline-start: 18px; }

/* Account type choices */
.imara-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border: 0; margin: 0; padding: 0; }
.imara-choice { position: relative; display: grid; gap: 4px; padding: 16px; border: 1px solid var(--if-line); border-radius: 0; cursor: pointer; background: var(--if-card); transition: border-color .15s, box-shadow .15s; }
.imara-choice input { position: absolute; opacity: 0; }
.imara-choice:has(input:checked) { border-color: var(--if-ink); box-shadow: inset 0 0 0 1px var(--if-ink); }
.imara-choice:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(47, 185, 239, .35); }
.imara-choice__title { font-weight: 700; }
.imara-choice__text { font-size: .85rem; color: var(--if-muted); }

/* Pills (typology checkboxes) */
.imara-pills { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; }
.imara-pill { position: relative; }
.imara-pill input { position: absolute; opacity: 0; }
.imara-pill span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--if-line); border-radius: 0; background: var(--if-card); font-size: .9rem; cursor: pointer; transition: background .15s, color .15s; }
.imara-pill input:checked + span { background: var(--if-ink); border-color: var(--if-ink); color: var(--on-ink, #fff); }
.imara-pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(47, 185, 239, .35); }

/* Submission steps */
.imara-form--submit { gap: 22px; }
.imara-step { display: grid; gap: 18px; padding: clamp(18px, 3vw, 32px); border: 1px solid var(--if-line); border-radius: 0; background: var(--if-card); }
.imara-step__title { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 1.15rem; }
.imara-step__title span { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 0; background: var(--if-grad); color: #04161f; font-size: .9rem; font-weight: 700; }
.imara-details { border-top: 1px dashed var(--if-line); padding-top: 14px; }
.imara-details summary { cursor: pointer; font-weight: 600; color: var(--if-ink); }
.imara-details[open] summary { margin-bottom: 14px; }
.imara-details[open] { display: grid; gap: 16px; }
.imara-drop { position: relative; display: grid; place-items: center; gap: 6px; min-height: 170px; padding: 24px; border: 1.5px dashed #c9c3b8; border-radius: 0; background: var(--if-bg); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.imara-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.imara-drop:hover, .imara-drop.is-over, .imara-drop:focus-within { border-color: var(--if-accent); background: #f2fbfe; }
.imara-drop__title { font-weight: 700; font-size: 1.05rem; }
.imara-drop__title::before { content: ""; display: block; width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 0; background: var(--if-grad); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 13v6H5v-6H3v6a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-6zM11 5.8V16h2V5.8l3.6 3.6L18 8l-6-6-6 6 1.4 1.4z'/%3E%3C/svg%3E") center / 26px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 13v6H5v-6H3v6a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-6zM11 5.8V16h2V5.8l3.6 3.6L18 8l-6-6-6 6 1.4 1.4z'/%3E%3C/svg%3E") center / 26px no-repeat; }
.imara-drop__help { font-size: .82rem; color: var(--if-muted); }
.imara-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); gap: 10px; }
.imara-previews:empty { display: none; }
.imara-preview { position: relative; padding: 0; border: 0; border-radius: 0; overflow: hidden; aspect-ratio: 4 / 3; background: #eee; cursor: pointer; box-shadow: 0 0 0 1px var(--if-line); }
.imara-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imara-preview__tag { position: absolute; inset-inline-start: 6px; bottom: 6px; padding: 2px 8px; border-radius: 0; background: rgba(255, 255, 255, .9); color: var(--if-ink); font-size: .72rem; font-weight: 600; opacity: 0; transition: opacity .15s; }
.imara-preview:hover .imara-preview__tag, .imara-preview:focus-visible .imara-preview__tag, .imara-preview.is-cover .imara-preview__tag { opacity: 1; }
.imara-preview.is-cover { box-shadow: 0 0 0 3px var(--if-accent); }
.imara-preview.is-cover .imara-preview__tag { background: var(--if-ink); color: var(--on-ink, #fff); }
.imara-form__submit { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; }
.imara-form__submit .imara-field__help { flex: 1; min-width: 220px; margin: 0; }

/* Gate (not logged in) */
.imara-gate { padding: clamp(24px, 4vw, 48px); border: 1px solid var(--if-line); border-radius: 0; background: var(--if-card); text-align: center; }
.imara-gate__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* Reply invitation — dark, exclusive panel with message icon */
.imara-gate--reply {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 22px 32px;
	margin-top: 28px;
	padding: clamp(28px, 4vw, 40px) clamp(24px, 3.5vw, 40px);
	min-height: 15rem;
	position: relative;
	isolation: isolate;
	overflow: hidden;
	text-align: start;
	color: #f3f5f7;
	border: 1px solid transparent;
	background:
		linear-gradient(#10141a, #10141a) padding-box,
		var(--if-grad) border-box;
}
.imara-gate--reply::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(90% 80% at 100% 0%, rgba(31, 216, 232, .18), transparent 55%),
		radial-gradient(70% 60% at 0% 100%, rgba(64, 180, 245, .12), transparent 50%);
}
.imara-gate--reply .imara-gate__icon {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	color: #7ee8f5;
	border: 1px solid rgba(126, 232, 245, .35);
	background: rgba(31, 216, 232, .08);
}
.imara-gate--reply .imara-gate__icon svg { display: block; }
.imara-gate--reply .imara-gate__kicker {
	margin: 0 0 8px;
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: #8eebf6;
}
:lang(ar) .imara-gate--reply .imara-gate__kicker {
	letter-spacing: .06em;
	text-transform: none;
}
.imara-gate--reply h2 {
	margin: 0 0 8px;
	font-family: var(--font-display, inherit);
	font-size: clamp(1.45rem, 2.8vw, 2rem);
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.15;
	color: #fff;
}
:lang(ar) .imara-gate--reply h2 {
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: 0;
}
.imara-gate--reply .imara-gate__body > p:not(.imara-gate__kicker) {
	margin: 0;
	max-width: 42em;
	color: #b8c0c8;
	font-size: 1.02rem;
	line-height: 1.65;
}
.imara-gate--reply .imara-gate__actions {
	margin: 0;
	justify-content: flex-end;
	flex-direction: column;
	align-items: stretch;
	min-width: 200px;
}
.imara-gate--reply .imara-btn {
	background: var(--if-grad);
	border-color: transparent;
	color: #04161f;
	box-shadow: 0 8px 22px rgba(31, 216, 232, .22);
}
.imara-gate--reply .imara-btn:hover,
.imara-gate--reply .imara-btn:focus-visible {
	color: #04161f;
	box-shadow: 0 12px 28px rgba(31, 216, 232, .34);
}
.imara-gate--reply .imara-btn--ghost {
	background: transparent;
	border-color: rgba(243, 245, 247, .32);
	color: #f3f5f7;
	box-shadow: none;
}
.imara-gate--reply .imara-btn--ghost:hover,
.imara-gate--reply .imara-btn--ghost:focus-visible {
	color: #fff;
	border-color: #fff;
	background: rgba(255, 255, 255, .06);
	box-shadow: none;
	transform: translateY(-1px);
}
.comment-respond:has(.imara-gate--reply) { margin-top: 8px; }
.comment-respond:has(.imara-gate--reply) .comment-reply-title { display: none; }
@media (max-width: 820px) {
	.imara-gate--reply { grid-template-columns: auto minmax(0, 1fr); }
	.imara-gate--reply .imara-gate__actions {
		grid-column: 1 / -1;
		flex-direction: row;
		justify-content: flex-start;
		min-width: 0;
		margin-top: 4px;
	}
}
@media (max-width: 480px) {
	.imara-gate--reply { grid-template-columns: minmax(0, 1fr); }
	.imara-gate--reply .imara-gate__actions { flex-direction: column; }
	.imara-gate--reply .imara-btn { width: 100%; }
}

/* Dashboard */
.imara-dash { display: grid; gap: 28px; }
.imara-dash__head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 22px; border: 1px solid var(--if-line); border-radius: 0; background: var(--if-card); }
.imara-dash__avatar { width: 72px; height: 72px; flex: none; border-radius: 0; overflow: hidden; display: grid; place-items: center; background: var(--if-grad); color: #04161f; font-weight: 700; font-size: 1.4rem; }
.imara-dash__avatar img { width: 100%; height: 100%; object-fit: cover; }
.imara-dash__type { display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--if-muted); }
.imara-dash__name { margin: 2px 0 4px; font-size: 1.5rem; }
.imara-dash__links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; }
.imara-dash__links a { color: var(--if-ink); }
.imara-dash__cta { margin-inline-start: auto; }
.imara-dash__section h3 { margin: 0 0 14px; font-size: 1.2rem; }
.imara-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.imara-tabs a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 0; border: 1px solid var(--if-line); color: var(--if-ink); text-decoration: none; font-size: .9rem; }
.imara-tabs a[aria-current], .imara-tabs a:hover { background: var(--if-ink); border-color: var(--if-ink); color: var(--on-ink, #fff); }
.imara-subs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.imara-sub { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px; border: 1px solid var(--if-line); border-radius: 0; background: var(--if-card); }
.imara-sub__thumb { width: 96px; aspect-ratio: 4 / 3; border-radius: 0; overflow: hidden; background: #eee; }
.imara-sub__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imara-sub__title { margin: 0 0 4px; font-size: 1rem; }
.imara-sub__title a { color: var(--if-ink); text-decoration: none; }
.imara-sub__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; color: var(--if-muted); }
.imara-sub__note { margin: 8px 0 0; padding: 8px 10px; border-radius: 0; background: #fef3f2; color: var(--if-err); font-size: .85rem; }
.imara-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 0; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.imara-badge::before { content: ""; width: 6px; height: 6px; border-radius: 0; background: currentColor; }
.imara-badge--ok { background: #ecfdf3; color: var(--if-ok); }
.imara-badge--wait { background: #fff7e6; color: #9a5b00; }
.imara-badge--no { background: #fef3f2; color: var(--if-err); }
.imara-empty { padding: 28px; border: 1px dashed var(--if-line); border-radius: 0; text-align: center; color: var(--if-muted); }
/* Edit profile: a readable column and a button sized to its label. */
.imara-dash #profile .imara-form { max-width: 820px; }
.imara-dash .imara-form > .imara-btn { justify-self: start; min-width: 200px; }

/* File inputs: the native button matches the other controls. */
.imara-input[type="file"] { padding: 6px; padding-inline-end: 14px; color: var(--if-muted); font-size: .92rem; cursor: pointer; }
.imara-input[type="file"]::file-selector-button { min-height: 34px; margin-inline-end: 12px; padding: 0 16px; border: 1px solid var(--if-line); border-radius: 0; background: var(--tint, #f2f3f3); color: var(--if-ink); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; transition: border-color .15s, background-color .15s; }
.imara-input[type="file"]:hover::file-selector-button { border-color: var(--if-ink); }

/* Profile cards */
.profile-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 18px; }
.profile-card__link { display: grid; justify-items: center; gap: 4px; height: 100%; padding: 26px 18px 22px; border: 1px solid var(--if-line); border-radius: 0; background: var(--if-card); color: var(--if-ink); text-align: center; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.profile-card__link:hover, .profile-card__link:focus-visible { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(17, 17, 16, .09); }
.profile-card__avatar { width: 92px; height: 92px; margin-bottom: 10px; border-radius: 0; overflow: hidden; display: grid; place-items: center; background: var(--if-grad); color: #04161f; }
.profile-card--firm .profile-card__avatar { border-radius: 0; }
.profile-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-card__initials { font-weight: 700; font-size: 1.6rem; letter-spacing: .02em; }
.profile-card__type { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--if-muted); }
.profile-card__name { font-weight: 700; font-size: 1.08rem; line-height: 1.25; }
.profile-card__org { font-size: .88rem; color: var(--if-muted); }
.profile-card__meta { margin-top: 6px; font-size: .8rem; color: var(--if-muted); }

/* Account types: member (instant) + firm/author (owner approval). */
.imara-choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .imara-choices--3 { grid-template-columns: minmax(0, 1fr); } }
.imara-choice__tag { display: inline-flex; justify-self: start; margin-block: 2px 4px; padding: 1px 7px; border: 1px solid var(--if-line); font-size: .7rem; font-weight: 600; color: var(--if-muted); }
.imara-apply { display: grid; gap: 16px; padding: 18px; border: 1px solid var(--if-line); background: var(--if-card); }
.imara-apply__title { margin: 0; font-weight: 700; }
.imara-form:has(input[name="account_type"][value="member"]:checked) .imara-apply--hideable { display: none; }
.imara-notice--wait { background: #fff7e6; color: #7a4800; border: 1px solid #fedf89; }
.imara-form--narrow { max-width: 520px; }
.imara-forgot { font-size: .9rem; color: var(--if-ink); }

/* Dashboard: application state, following, saved */
.imara-appstate { display: grid; gap: 8px; padding: 20px 22px; border: 1px solid var(--if-line); border-inline-start: 3px solid var(--if-accent); background: var(--if-card); }
.imara-appstate p { margin: 0; }
.imara-appstate__title { font-weight: 700; font-size: 1.05rem; }
.imara-appstate--wait { border-inline-start-color: #dc8a00; }
.imara-appstate--no { border-inline-start-color: var(--if-err); }
.imara-appstate__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px !important; }
.imara-empty--cta { display: grid; justify-items: center; gap: 14px; }
.imara-empty--cta p { margin: 0; max-width: 52ch; }
.imara-follows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.imara-follow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--if-line); background: var(--if-card); }
.imara-follow__link { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 180px; color: var(--if-ink); text-decoration: none; }
.imara-follow__link:hover .imara-follow__name, .imara-follow__link:focus-visible .imara-follow__name { text-decoration: underline; }
.imara-follow__avatar { width: 48px; height: 48px; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--if-grad); color: #04161f; font-weight: 700; }
.imara-follow__avatar img { width: 100%; height: 100%; object-fit: cover; }
.imara-follow__text { display: grid; min-width: 0; }
.imara-follow__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imara-follow__type { font-size: .82rem; color: var(--if-muted); }

/* Arabic */
:lang(ar) .imara-auth__kicker, :lang(ar) .profile-card__type, :lang(ar) .imara-dash__type { letter-spacing: 0; }

/* Grouped choices (fieldset). */
fieldset.imara-field { margin: 0; padding: 0; border: 0; }
fieldset.imara-field > legend { margin: 0 0 6px; padding: 0; }

/* ---------- Dark theme (theme sets data-theme="dark" on <html>) ---------- */
[data-theme="dark"] .imara-auth__aside { background: var(--dark-2, #15181d); border: 1px solid var(--line, #22262c); }
[data-theme="dark"] .imara-password__toggle:hover, [data-theme="dark"] .imara-password__toggle:focus-visible { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .imara-btn:hover, [data-theme="dark"] .imara-btn:focus-visible { box-shadow: 0 8px 22px rgba(0, 0, 0, .5); }
[data-theme="dark"] .imara-notice--error, [data-theme="dark"] .imara-sub__note, [data-theme="dark"] .imara-badge--no { background: rgba(240, 68, 56, .12); color: #fda29b; border-color: rgba(240, 68, 56, .35); }
[data-theme="dark"] .imara-notice--success, [data-theme="dark"] .imara-badge--ok { background: rgba(18, 183, 106, .12); color: #75e0a7; border-color: rgba(18, 183, 106, .35); }
[data-theme="dark"] .imara-badge--wait, [data-theme="dark"] .imara-notice--wait { background: rgba(247, 144, 9, .12); color: #fec84b; border-color: rgba(247, 144, 9, .35); }
[data-theme="dark"] .imara-drop { border-color: var(--line-2, #30353d); }
[data-theme="dark"] .imara-drop:hover, [data-theme="dark"] .imara-drop.is-over, [data-theme="dark"] .imara-drop:focus-within { background: rgba(63, 208, 242, .06); }
[data-theme="dark"] .imara-preview, [data-theme="dark"] .imara-sub__thumb { background: var(--tint, #1a1e23); }
[data-theme="dark"] .imara-preview__tag { background: rgba(11, 13, 16, .85); }
[data-theme="dark"] .profile-card__link:hover, [data-theme="dark"] .profile-card__link:focus-visible { box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }

/* ---------- Selects: custom chevron (LTR/RTL), dark native list ---------- */
.imara-form select, select.imara-input { -webkit-appearance: none; appearance: none; background-image: var(--chev, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a6e74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")); background-repeat: no-repeat; background-size: 16px; background-position: right 14px center; padding-right: 40px; cursor: pointer; }
[dir="rtl"] .imara-form select, [dir="rtl"] select.imara-input { background-position: left 14px center; padding-right: 14px; padding-left: 40px; }
.imara-form select option { background-color: var(--if-card); color: var(--if-ink); }
[data-theme="dark"] .imara-form select, [data-theme="dark"] select.imara-input { color-scheme: dark; }

/* Arabic forms use the theme's Arabic text font (Cairo) for every control. */
:lang(ar) :is(.imara-form, .imara-auth) :is(input, select, textarea, button, label) { font-family: var(--font-ui, "Cairo", Tahoma, sans-serif); }
:lang(ar) .imara-auth__quote, :lang(ar) .imara-auth__title { font-family: var(--font-display, "Readex Pro", Tahoma, sans-serif); line-height: 1.4; }

/* ---------- Official submission guidelines (project / media / drawings) ---------- */
.imara-guide { --g-line: var(--if-line); display: grid; gap: 12px; min-width: 0; padding: clamp(16px, 2.6vw, 24px); border: 1px solid var(--g-line); border-inline-start: 3px solid var(--if-accent); border-radius: 0; background: var(--tint, #f4f7f8); color: var(--if-ink); overflow-wrap: anywhere; }
.imara-guide__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; }
.imara-guide__heading { min-width: 0; flex: 1 1 220px; }
.imara-guide__kicker { margin: 0 0 4px; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink, #086f9f); }
.imara-guide__title { margin: 0; font-family: var(--font-display, inherit); font-size: clamp(1.25rem, 2.2vw, 1.55rem); line-height: 1.2; }
.imara-guide__download { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 0; background: var(--if-grad); color: #04161f; font-weight: 700; font-size: .9rem; text-decoration: none; white-space: nowrap; flex: none; transition: box-shadow .15s, transform .15s; }
.imara-guide__download:hover, .imara-guide__download:focus-visible { color: #04161f; box-shadow: 0 8px 22px rgba(31, 216, 232, .28); transform: translateY(-1px); outline: none; }
.imara-guide__download:focus-visible { outline: 2px solid var(--if-ink); outline-offset: 2px; }
.imara-guide__intro { margin: 0; line-height: 1.6; }
.imara-guide__more { display: grid; gap: 12px; border-top: 1px solid var(--g-line); padding-top: 12px; }
.imara-guide__more > summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--accent-ink, #086f9f); min-height: 32px; display: flex; align-items: center; }
.imara-guide__blocks { display: grid; gap: 14px; margin: 0; padding: 0; }
.imara-guide__blocks--numbered { list-style: none; counter-reset: imara-guide; }
.imara-guide__blocks--numbered > li { counter-increment: imara-guide; position: relative; padding-inline-start: 40px; }
.imara-guide__blocks--numbered > li::before { content: counter(imara-guide); position: absolute; inset-inline-start: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; background: var(--if-grad); color: #04161f; font-weight: 700; font-size: .85rem; }
.imara-guide__block { min-width: 0; }
.imara-guide__block p { margin: 0; line-height: 1.6; font-size: .94rem; }
.imara-guide__subtitle { margin: 0 0 6px; font-family: var(--font-display, inherit); font-size: 1.05rem; line-height: 1.3; }
.imara-guide__items, .imara-guide__checks, .imara-guide__tags { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .94rem; line-height: 1.55; }
.imara-guide__items li { position: relative; padding-inline-start: 18px; }
.imara-guide__items li::before { content: ""; position: absolute; inset-inline-start: 0; top: .7em; width: 8px; height: 2px; background: var(--if-accent); }
.imara-guide__checks { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.imara-guide__checks li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid; border-radius: 0; font-weight: 600; }
.imara-guide__checks .is-do { border-color: rgba(6, 118, 71, .35); background: rgba(18, 183, 106, .08); color: #067647; }
.imara-guide__checks .is-dont { border-color: rgba(194, 65, 12, .35); background: rgba(247, 144, 9, .08); color: #b54708; }
.imara-guide__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.imara-guide__tags li { padding: 5px 10px; border: 1px solid var(--g-line); background: var(--if-card); font-size: .86rem; }
.imara-guide__tags li:nth-child(2) { border-color: var(--if-accent); font-weight: 600; }
.imara-guide__source { margin: 0; font-size: .78rem; color: var(--if-muted); }
.imara-guide-note { margin: 0; padding: 8px 12px; border-inline-start: 3px solid #f79009; background: rgba(247, 144, 9, .08); font-size: .86rem; line-height: 1.5; }
.imara-guide-note[hidden] { display: none; }
:lang(ar) .imara-guide__kicker { letter-spacing: 0; font-size: .82rem; }
:lang(ar) .imara-guide__title, :lang(ar) .imara-guide__subtitle { font-family: var(--font-display, "Readex Pro", Tahoma, sans-serif); line-height: 1.5; }
:lang(ar) .imara-guide__intro, :lang(ar) .imara-guide__block p, :lang(ar) .imara-guide__items, :lang(ar) .imara-guide__checks { line-height: 1.8; }
[data-theme="dark"] .imara-guide { background: var(--dark-2, #15181d); --g-line: var(--line, #2a2f36); }
[data-theme="dark"] .imara-guide__kicker, [data-theme="dark"] .imara-guide__more > summary { color: #7fe3f4; }
[data-theme="dark"] .imara-guide__checks .is-do { color: #75e0a7; background: rgba(18, 183, 106, .1); border-color: rgba(18, 183, 106, .35); }
[data-theme="dark"] .imara-guide__checks .is-dont { color: #fec84b; background: rgba(247, 144, 9, .1); border-color: rgba(247, 144, 9, .35); }
[data-theme="dark"] .imara-guide__tags li { background: var(--tint, #1a1e23); }
[data-theme="dark"] .imara-guide-note { color: #fec84b; background: rgba(247, 144, 9, .1); }
@media (max-width: 420px) { .imara-guide__download { width: 100%; } .imara-guide__blocks--numbered > li { padding-inline-start: 34px; } }

/* ---------- Newsletter page (confirm / unsubscribe / subscribe) ---------- */
.imara-nl { display: grid; gap: 20px; max-width: 640px; min-width: 0; overflow-wrap: anywhere; }
.imara-nl-result { padding: clamp(18px, 3vw, 28px); border: 1px solid var(--if-line); border-inline-start: 3px solid var(--if-accent); border-radius: 0; background: var(--if-card); }
.imara-nl-result__title { margin: 0 0 8px; font-family: var(--font-display, inherit); font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.2; }
.imara-nl-result p { margin: 0; line-height: 1.6; }
.imara-nl-result--invalid, .imara-nl-result--expired, .imara-nl-result--rate { border-inline-start-color: #f79009; }
.imara-nl-result--unsubscribed { border-inline-start-color: var(--if-muted); }
.imara-nl-form { display: grid; gap: 8px; }
.imara-nl-form__row { display: flex; gap: 8px; min-width: 0; }
.imara-nl-form__row .imara-input { flex: 1; min-width: 0; }
.imara-nl-form__row .imara-btn { flex: none; background: var(--if-grad); color: #04161f; border-color: transparent; }
.imara-check--newsletter { margin-top: 4px; }
:lang(ar) .imara-nl-result__title { line-height: 1.5; }
[data-theme="dark"] .imara-nl-result { background: var(--dark-2, #15181d); }
@media (max-width: 480px) { .imara-nl-form__row { flex-direction: column; } .imara-nl-form__row .imara-btn { width: 100%; } }

/* Contact page */
.imara-contact__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.imara-contact__privacy { margin: 2px 0 0; padding: 10px 12px; border-inline-start: 2px solid var(--if-accent); background: color-mix(in srgb, var(--if-accent) 7%, transparent); color: var(--if-muted); font-size: .82rem; line-height: 1.5; border-radius: 0; }
.imara-contact__hint { margin: -8px 0 20px; }
.imara-contact__hint a { color: var(--if-ink); font-weight: 600; }
.imara-contact .imara-notice ul { margin: 0; padding-inline-start: 18px; }
@media (max-width: 560px) { .imara-contact__row { grid-template-columns: minmax(0, 1fr); } }

/* Compact legal mentions and privacy actions */
.imara-check a { color: var(--if-accent); text-underline-offset: 2px; }
.imara-legal-note { margin: 8px 0 0; font-size: .78rem; line-height: 1.45; color: var(--if-muted); overflow-wrap: anywhere; }
.imara-legal-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.imara-legal-note a:hover, .imara-legal-note a:focus-visible { color: var(--if-accent); }
.imara-privacy-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 8px; }
.imara-nl-form .imara-legal-note, .imara-nl-form .imara-check { margin-top: 10px; }
