/* Purpose: Keep parent-owned gadget controls consistent with Explore's RTL magazine layout. */
.eg-strip, .eg-bank, .eg-expanded { min-width: 0; max-width: 100%; color: var(--ink, #25231f); font: inherit; overflow-wrap: anywhere; }
.eg-strip *, .eg-bank *, .eg-expanded * { box-sizing: border-box; }
.eg-strip [hidden], .eg-bank [hidden], .eg-expanded [hidden], main > [hidden] { display: none !important; }
[data-eg-suspended] { display: none !important; }
.eg-section-title { margin: 12px 0; font-size: 19px; }
.eg-strip { max-width: 1220px; margin-inline: auto; padding: 10px 28px 20px; }
.eg-strip-list { display: flex; gap: 12px; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 4px 3px 12px; overscroll-behavior-inline: contain; scroll-snap-type: inline proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; touch-action: pan-x pan-y; }
.eg-cube { position: relative; flex: 0 0 174px; width: 174px; min-width: 0; padding: 8px; background: var(--paper, #fcfbf9); border: 1px solid var(--line, #ddd7cd); border-radius: 14px; overflow: hidden; scroll-snap-align: start; }
.eg-cube-title { margin: 10px 2px 4px; font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eg-frame-wrap { position: relative; min-width: 0; width: 100%; }
.eg-frame { display: block; width: 100%; min-width: 0; max-width: 100%; border: 0; background: #fff; border-radius: 8px; color-scheme: light; }
.eg-frame-wrap--compact { height: 142px; overflow: hidden; }
.eg-frame-wrap--compact .eg-frame { height: 142px; pointer-events: none; }
.eg-cube-open.eg-button { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 14px; background: transparent; color: transparent; font-size: 0; cursor: pointer; touch-action: pan-x pan-y; }
.eg-cube-open.eg-button:hover { background: #192d2607; }
.eg-cube-open.eg-button:focus-visible { outline: 3px solid var(--red, #a43c2d); outline-offset: -3px; }
.eg-frame-status { margin: 0; padding: 8px 10px; font-size: 13px; line-height: 1.6; background: #f2eee7; color: #514d46; overflow-wrap: anywhere; }
.eg-frame-wrap--compact .eg-frame-status { position: absolute; inset-inline: 0; bottom: 0; max-height: 100%; overflow: hidden; }
.eg-frame-status.is-error, .eg-row-status.is-error { color: #8b241b; background: #fff0ec; }
.eg-list-status, .eg-row-status { margin: 8px 0; font-size: 14px; line-height: 1.7; }
.eg-list-status:empty, .eg-row-status:empty { display: none; }
.eg-list-status .eg-button { margin-inline-start: 10px; }
.eg-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.eg-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; max-width: 100%; padding: 10px 15px; border: 1px solid var(--line, #d8d2c8); border-radius: 10px; background: var(--paper, #fcfbf9); color: var(--ink, #25231f); font: inherit; font-size: 14px; line-height: 1.4; text-align: center; cursor: pointer; white-space: normal; touch-action: manipulation; }
.eg-button:hover { background: #eee9e1; }
.eg-button:focus-visible { outline: 3px solid var(--red, #a43c2d); outline-offset: 3px; }
.eg-button:disabled { opacity: .6; cursor: wait; }
.eg-button--danger { color: #8b241b; }
.eg-bank { padding-block: 16px 32px; }
.eg-bank-toolbar { margin-bottom: 18px; }
.eg-bank-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 16px; }
.eg-bank-card { min-width: 0; padding: 20px; border: 1px solid var(--line, #ddd7cd); border-radius: 14px; background: var(--paper, #fcfbf9); }
.eg-bank-card h3 { margin: 0 0 8px; font-size: 21px; line-height: 1.4; }
.eg-description { margin: 0 0 12px; line-height: 1.7; }
.eg-visibility, .eg-connections { margin: 7px 0; color: var(--muted, #736b61); font-size: 13px; line-height: 1.6; }
.eg-bank-card > .eg-toolbar { margin-top: 15px; }
.eg-confirm { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding: 12px; border: 1px solid #d8a094; border-radius: 10px; background: #fff4f0; }
.eg-confirm p { flex-basis: 100%; margin: 0 0 4px; line-height: 1.6; }
.eg-expanded { display: flex; flex-direction: column; padding-block: 16px max(28px, env(safe-area-inset-bottom)); min-height: 75vh; }
.eg-expanded-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.eg-expanded-header h2 { margin: 0; min-width: 0; flex: 1 1 220px; font-size: clamp(22px, 4vw, 32px); line-height: 1.4; }
.eg-frame-wrap--expanded { display: flex; flex-direction: column; flex: 1; min-height: 420px; }
.eg-frame-wrap--expanded .eg-frame { flex: 1; height: 72vh; height: 72dvh; min-height: 360px; }
.eg-frame-wrap--expanded .eg-frame-status { flex: 0 0 auto; border-radius: 8px; margin-top: 8px; }
@media (max-width: 600px) {
    .eg-strip { padding-inline: 19px; }
    .eg-cube { flex-basis: 160px; width: 160px; }
    .eg-bank-card { padding: 16px; }
    .eg-expanded-header { align-items: stretch; }
    .eg-expanded-header .eg-toolbar { flex: 1 1 100%; }
    .eg-frame-wrap--expanded { min-height: 320px; }
    .eg-frame-wrap--expanded .eg-frame { min-height: 280px; height: 68vh; height: 68dvh; }
    .eg-expanded { padding-bottom: max(100px, calc(80px + env(safe-area-inset-bottom))); }
}
@media (orientation: landscape) and (max-height: 500px) {
    .eg-frame-wrap--expanded { min-height: 240px; }
    .eg-frame-wrap--expanded .eg-frame { min-height: 220px; height: 65vh; height: 65dvh; }
}
@media (prefers-reduced-motion: reduce) { .eg-strip-list { scroll-behavior: auto; } }

/* Owner-only iOS-like gadget arrangement mode; do not animate for reduced-motion users. */
.eg-strip-heading {display:flex;gap:10px;align-items:center}
.eg-edit-toggle.eg-button {min-width:36px;min-height:36px;padding:6px 9px;font-size:20px}
.eg-strip.is-editing .eg-edit-toggle {background:#efe5ef;border-color:#9985a5}
.eg-strip.is-editing .eg-cube {animation:eg-jiggle .23s ease-in-out infinite alternate;outline:1px dashed #9b8d98}
.eg-strip.is-editing .eg-cube:nth-child(even) {animation-delay:-.11s;animation-direction:alternate-reverse}
@keyframes eg-jiggle {from{transform:rotate(-.65deg)}to{transform:rotate(.65deg)}}
.eg-strip.is-editing .eg-cube-open {pointer-events:none}
.eg-cube .eg-cube-remove.eg-button {position:absolute;z-index:3;top:0;inset-inline-end:0;display:grid;place-items:center;min-height:29px;min-width:29px;padding:0;border-radius:50%;border:1px solid #b9b2ae;background:#ba2430;color:#fff;font-size:23px;line-height:1}
.eg-cube-edit-controls {position:relative;z-index:3;display:flex;align-items:center;justify-content:space-around;gap:3px;padding-top:5px}
.eg-cube-edit-controls .eg-button {min-width:34px;min-height:32px;padding:3px;font-size:18px}
.eg-cube-edit-controls .eg-cube-handle {cursor:grab;touch-action:none;user-select:none;flex:1}
.eg-cube.is-dragging {animation:none!important;opacity:.7;outline:2px solid #b22a35}
.eg-delete-dialog {border:1px solid #ddd1c7;border-radius:16px;padding:22px;max-width:min(92vw,430px);color:#25231f;background:white;box-shadow:0 16px 52px #0003;direction:rtl}
.eg-delete-dialog::backdrop {background:#0008}
.eg-delete-dialog .eg-toolbar {justify-content:flex-start;margin-top:16px}
@media(prefers-reduced-motion:reduce){.eg-strip.is-editing .eg-cube {animation:none}}

.eg-cube [data-eg-edit-control][hidden] {display:none!important}
