/* Buttons under every palette */
.lopt-actions { display: flex; gap: 10px; width: 100%; margin: 14px 0 6px; direction: rtl; }
.lopt-actions button,
.lopt-dialog button {
	font-family: Rubik, sans-serif; line-height: 1.2; min-height: 44px; margin: 0;
	border-radius: 999px; cursor: pointer; text-transform: none; letter-spacing: 0; box-shadow: none;
}
.lopt-actions button { font-size: 15px; font-weight: 500; padding: 0 18px; border: 2px solid #a63c28; }
.lopt-actions .lopt-use { flex: 1; }
.lopt-actions .lopt-use, .lopt-dialog .lopt-main { background: #a63c28; color: #fff; }
.lopt-actions .lopt-share, .lopt-dialog .lopt-second { background: #fff; color: #a63c28; }
.lopt-actions button:hover, .lopt-dialog .lopt-main:hover { background: #87301f; color: #fff; border-color: #87301f; }
.lopt-actions button:focus-visible, .lopt-dialog button:focus-visible { outline: 3px solid #352b43; outline-offset: 2px; }
.share-link.lopt-replaced { display: none !important; }

/* Window: bottom sheet on phones, centered on larger screens */
html.lopt-lock { overflow: hidden; }
.lopt-dialog {
	box-sizing: border-box; position: fixed; inset: auto 0 0 0; margin: 0 auto; padding: 0; border: 0;
	width: 100%; max-width: 100%; max-height: 92vh; max-height: 92dvh; overflow: hidden;
	border-radius: 22px 22px 0 0; background: #fff; color: #2c171d;
	font-family: Rubik, sans-serif; font-size: 14px; text-align: right;
}
.lopt-dialog::backdrop { background: rgba(30, 18, 22, .55); }
@media (min-width: 600px) {
	.lopt-dialog { inset: 0; margin: auto; width: 440px; height: fit-content; border-radius: 22px; }
}
.lopt-panel { display: flex; flex-direction: column; max-height: 92vh; max-height: 92dvh; padding: 20px 20px max(16px, env(safe-area-inset-bottom)); box-sizing: border-box; gap: 12px; }
.lopt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lopt-dialog .lopt-title { font-family: Rubik, sans-serif; font-size: 21px; line-height: 1.3; margin: 0; color: #2c171d; }
.lopt-sub { margin: 2px 0 0; color: #6b555b; }
.lopt-dialog .lopt-close { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #f3eced; color: #2c171d; font-size: 18px; }
.lopt-body { overflow-y: auto; min-height: 0; flex: 0 1 auto; display: flex; flex-direction: column; gap: 10px; }
.lopt-body:empty { display: none; }
.lopt-body > * { flex: none; }
.lopt-demo { border: 1px solid #e8dedb; border-radius: 14px; padding: 12px; text-align: center; }
.lopt-demo-title { margin: 0 0 8px; font-weight: 700; font-size: 16px; }
.lopt-samples { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.lopt-sample { padding: 6px 20px; border-radius: 999px; font-weight: 500; }
.lopt-sample.is-frame { border-radius: 8px; }
.lopt-dialog ul.lopt-list { list-style: none; margin: 0; padding: 0; }
.lopt-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; margin: 0; border-bottom: 1px solid #f0e8e9; }
.lopt-row:last-child { border-bottom: 0; }
.lopt-chip { flex: none; width: 46px; height: 46px; border-radius: 10px; border: 1px solid rgba(0, 0, 0, .15); box-sizing: border-box; }
.lopt-info { flex: 1; display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.lopt-name { color: #6b555b; }
.lopt-dialog .lopt-copy { flex: none; min-width: 92px; padding: 0 14px; border: 2px solid #e5d9dc; background: #fff; color: #2c171d; font-size: 14px; font-weight: 500; }
.lopt-foot { display: flex; flex-direction: column; gap: 8px; flex: none; }
.lopt-dialog .lopt-main, .lopt-dialog .lopt-second { min-height: 50px; width: 100%; border: 2px solid #a63c28; font-size: 16px; font-weight: 700; }
.lopt-dialog .lopt-main:hover { border-color: #87301f; }
.lopt-dialog .lopt-second:hover { background: #fbeae7; color: #a63c28; }
.lopt-dialog .lopt-link { border: 0; background: transparent; color: #a63c28; font-size: 14px; text-decoration: underline; padding: 0 12px; }
.lopt-dialog .lopt-link:hover { background: transparent; color: #87301f; }
.lopt-dialog button.is-done, .lopt-dialog button.is-done:hover { background: #1f7a4d; border-color: #1f7a4d; color: #fff; text-decoration: none; }
.lopt-ai { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; }
.lopt-ai button { min-width: 110px; }
.lopt-note { margin: 0; text-align: center; color: #1f7a4d; }
.lopt-note:empty { display: none; }
.lopt-url { margin: 0; padding: 12px; background: #f6f3f4; border-radius: 12px; word-break: break-all; text-align: left; user-select: all; }
.lopt-steps { margin: 0; padding: 0 20px 0 0; line-height: 1.7; }
.lopt-hint { margin: 0; color: #6b555b; }
.lopt-manual textarea { width: 100%; box-sizing: border-box; text-align: left; }
.lopt-offscreen { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Line the buttons up with the color strip inside the grid cards */
.e-loop-item .lopt-actions { box-sizing: border-box; padding-inline: 10px; }

/*
 * iPhone fix: the loop card of a palette carries the post type class "color-palette", so the
 * strip's stylesheet (elementor-color-palette) turned the whole card into an auto-fit grid.
 * WebKit then gave the strips zero width and no colors showed. Keep the card a plain column.
 */
.e-loop-item.type-color-palette { display: flex; flex-direction: column; }
.e-loop-item.type-color-palette > .elementor-element { flex: 1 0 auto; width: 100%; }

/* Same title height (two lines) on every card, so strips and buttons line up */
.e-loop-item.type-color-palette .elementor-widget-theme-post-title .elementor-heading-title { line-height: 1.35; min-height: 2.7em; }
.pgx-card h3 { line-height: 1.35 !important; min-height: 2.7em; }
