/* Abhilash Toolkit: the optional photo on the submit form, and its crop box.
   Colours come from the theme's tokens, with fallbacks for other themes. */
.abp-photo { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.2rem; }
.abp-photo-preview {
	flex: none; width: 5.75rem; height: 5.75rem; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
	background: var(--color-leaf-50, #f1f8f3) center / cover no-repeat; color: var(--color-leaf-600, #0f6b43);
	border: 1.5px dashed var(--color-leaf-300, #8fc2a4);
}
.abp-photo-preview.has-photo { border-style: solid; border-color: var(--color-line, #d6d5c3); box-shadow: 0 8px 22px -12px rgba(5, 50, 31, .45); }
.abp-photo-preview.has-photo svg { display: none; }
.abp-photo-controls { display: grid; gap: .55rem; min-width: 0; }
/* With scripting, our own buttons replace the browser's plain file field (it stays in the form). */
.abp-photo.is-js .abp-photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; clip-path: inset(50%); }
.abp-photo-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; }
.abp-btn.abp-btn--sm { padding: .5rem 1.05rem; font-size: .88rem; min-height: 0; }
.abp-photo-remove { background: none; border: 0; padding: .3rem .35rem; font: inherit; font-size: .88rem; color: var(--color-ruby-700, #9c1923); text-decoration: underline; cursor: pointer; }
.abp-photo-status { margin: 0; font-size: .88rem; color: var(--color-ink-mute, #6c776f); }
.abp-photo-status:empty { display: none; }
.abp-photo-status.is-error { color: var(--color-ruby-700, #9c1923); }

/* The crop box */
dialog.abp-crop {
	margin: auto; border: 0; padding: 0; border-radius: 1.5rem; width: 100%; max-width: min(40rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem);
	background: var(--color-surface, #faf9f3); color: var(--color-ink, #1d2420); box-shadow: 0 30px 80px -20px rgba(5, 50, 31, .55);
}
dialog.abp-crop::backdrop { background: rgba(5, 50, 31, .55); backdrop-filter: blur(4px); }
.abp-crop-panel { display: grid; gap: 1rem; padding: 1.4rem 1.4rem 1.2rem; font-family: var(--font-sans, system-ui, sans-serif); }
.abp-crop-title { margin: 0; font-family: var(--font-display, Georgia, serif); font-size: 1.55rem; font-weight: 400; line-height: 1.3; }
.abp-crop-help { margin: 0; font-size: .92rem; line-height: 1.55; color: var(--color-ink-soft, #414c45); }
.abp-crop-stagewrap { display: grid; place-items: center; padding: .6rem; border-radius: 1rem; background: var(--color-paper-2, #e6e5d6); }
.abp-crop-stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; overflow: hidden; overflow: clip; border-radius: .5rem; touch-action: none; user-select: none; -webkit-user-select: none; }
.abp-crop-stage img { display: block; max-width: 100%; max-height: min(50vh, 26rem); width: auto; height: auto; pointer-events: none; }
.abp-crop-box {
	position: absolute; border: 2px solid #fff; cursor: move; touch-action: none; outline: none;
	box-shadow: 0 0 0 9999px rgba(10, 24, 16, .58);
	background-image:
		linear-gradient(to right, transparent calc(33.333% - .5px), rgba(255, 255, 255, .4) calc(33.333% - .5px), rgba(255, 255, 255, .4) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), rgba(255, 255, 255, .4) calc(66.666% - .5px), rgba(255, 255, 255, .4) calc(66.666% + .5px), transparent calc(66.666% + .5px)),
		linear-gradient(to bottom, transparent calc(33.333% - .5px), rgba(255, 255, 255, .4) calc(33.333% - .5px), rgba(255, 255, 255, .4) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), rgba(255, 255, 255, .4) calc(66.666% - .5px), rgba(255, 255, 255, .4) calc(66.666% + .5px), transparent calc(66.666% + .5px));
}
.abp-crop-box::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, .85); pointer-events: none; }
.abp-crop-box:focus-visible { box-shadow: 0 0 0 9999px rgba(10, 24, 16, .58), 0 0 0 3px var(--color-leaf-300, #8fc2a4); }
.abp-crop-box i { position: absolute; width: 2.2rem; height: 2.2rem; touch-action: none; }
.abp-crop-box i::after { content: ""; position: absolute; left: 50%; top: 50%; width: .8rem; height: .8rem; margin: -.4rem 0 0 -.4rem; border-radius: 3px; background: #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .45); }
.abp-crop-box i[data-h="nw"] { left: -1.1rem; top: -1.1rem; cursor: nwse-resize; }
.abp-crop-box i[data-h="ne"] { right: -1.1rem; top: -1.1rem; cursor: nesw-resize; }
.abp-crop-box i[data-h="sw"] { left: -1.1rem; bottom: -1.1rem; cursor: nesw-resize; }
.abp-crop-box i[data-h="se"] { right: -1.1rem; bottom: -1.1rem; cursor: nwse-resize; }
.abp-crop-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.abp-crop-slider { flex: 1 1 12rem; display: grid; gap: .35rem; font-size: .88rem; font-weight: 600; }
.abp-crop-slider input { width: 100%; accent-color: var(--color-leaf-700, #085a36); }
.abp-crop-prev { display: grid; justify-items: center; gap: .3rem; font-size: .76rem; color: var(--color-ink-mute, #6c776f); }
.abp-crop-prev canvas { width: 4.75rem; height: 4.75rem; border-radius: 50%; border: 1px solid var(--color-line, #d6d5c3); background: #fff; }
.abp-crop-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; }
@media (prefers-reduced-motion: reduce) { dialog.abp-crop::backdrop { backdrop-filter: none; } }

/* Outlined buttons, whatever the theme's ghost style leaves out. */
.abp-photo .abp-btn--ghost, dialog.abp-crop .abp-btn--ghost { border: 1.5px solid var(--color-leaf-300, #8fc2a4); background: transparent; }
.abp-photo .abp-btn--ghost:hover, dialog.abp-crop .abp-btn--ghost:hover { background: var(--color-leaf-50, #f1f8f3); }
