/* general.css
 * Theme-independent, global styles only.
 * Loaded on every page via _MasterLayout.cshtml regardless of guild/theme.
 * Themes must remain fully self-contained; nothing here should become a
 * dependency of theme markup. All admin-bar related classes are prefixed
 * with "qw-admin-" to guarantee no collisions with theme CSS.
 */

/* ---- Minimal global utilities (theme-independent) ---- */
.display-block {
    display: block;
}

.display-none {
    display: none;
}

/* ---- Admin bar (fixed overlay, theme-independent) ---- */
.qw-admin-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2147483000; /* stay above arbitrary theme z-index values */
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px;
    background-color: #1f2937;
    color: #f9fafb;
    font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.qw-admin-bar-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qw-admin-bar a,
.qw-admin-bar button {
  
    background: transparent;
    /* border: 1px solid rgba(249, 250, 251, 0.35); color: #f9fafb; */
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.qw-admin-bar a:hover,
.qw-admin-bar button:hover {
    background-color: rgba(249, 250, 251, 0.15);
}

.qw-admin-bar-context {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qw-admin-bar-editmode-on {
    background-color: #b45309;
    border-color: #b45309;
}

/* ===== Admin bar (universal, outside themes) ===== */
.qw-admin-wrap { position: fixed; top: 0; right: 0; z-index: 9000; }

.qw-admin-bar {
    display: flex; align-items: center; gap: 12px;
    height: 40px; box-sizing: border-box;
    background: #1f2530; color: #fff; padding: 0 12px;
    font: 13px/1.4 sans-serif; box-shadow: 0 1px 6px rgba(0,0,0,.3);
    transform-origin: top right;
    transition: transform .25s ease, opacity .2s ease;
}
.qw-admin-bar-crumbs { margin-right: auto; }
.qw-admin-bar-links { display: inline-flex; align-items: center; gap: 8px; }
.qw-admin-bar a { color: #fff; text-decoration: none; }
.qw-admin-bar a:hover { text-decoration: underline; }
.qw-admin-bar-links a {
    border: 1px solid #fff; border-radius: 3px; padding: 2px 8px; line-height: 1;
}
.qw-admin-bar-editmode-on { color: #f5b06a !important; border-color: #f5b06a !important; font-weight: bold; }
.qw-admin-bar-crumbs .sep { color: #9aa7bd; margin: 0 2px; }
.qw-admin-collapse {
    cursor: pointer; background: none; border: 1px solid #faa; color: #faa;
    border-radius: 3px; font-size: 14px; padding: 2px 8px; line-height: 1;
}

/* Collapsed: hide the bar, show a 40x40 tab */
.qw-admin-tab {
    display: none; width: 40px; height: 40px; cursor: pointer;
    background: #1f2530; color: #fff; border: none; font-size: 18px;
    box-shadow: 0 1px 6px rgba(0,0,0,.3);
}
.qw-admin-wrap.collapsed .qw-admin-bar { transform: scale(0); opacity: 0; pointer-events: none; }
.qw-admin-wrap.collapsed .qw-admin-tab { display: block; }

/* ===== Edit-mode (draft) indicators ===== */
.qw-draft-frame {
    position: fixed; inset: 0; z-index: 8000;
    border: 4px dashed #e8811a;
    pointer-events: none;
}
.qw-draft-badge {
    position: fixed; left: 12px; bottom: 12px; z-index: 8001;
    background: #e8811a; color: #fff; font: bold 12px/1 sans-serif;
    padding: 8px 12px; border-radius: 4px; box-shadow: 0 1px 6px rgba(0,0,0,.3);
    pointer-events: none;
}

/* ===== Publish button + dialog ===== */
.qw-admin-publish { border: 1px solid #7CFC9A !important; color: #7CFC9A !important; font-weight: bold; }

.qw-publish-dialog {
    position: relative;
    border: none; border-radius: 6px; padding: 20px 22px; width: 380px; max-width: 90vw;
    box-shadow: 0 8px 30px rgba(0,0,0,.35); font: 14px/1.5 sans-serif;
}
.qw-publish-dialog::backdrop { background: rgba(0,0,0,.4); }
.qw-publish-dialog h2 { margin: 0 0 8px; font-size: 18px; }
.qw-publish-dialog p { margin: 0 0 14px; color: #555; }
.qw-publish-dialog input[type=text] { width: 100%; padding: 6px 8px; box-sizing: border-box; margin-top: 4px; }
.qw-publish-x { position: absolute; top: 8px; right: 10px; background: none; border: none; font-size: 16px; cursor: pointer; color: #888; }
.qw-publish-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.qw-publish-go { background: #1f8a4c; color: #fff; border: none; border-radius: 4px; padding: 8px 16px; cursor: pointer; font-weight: bold; }
.qw-publish-actions button { padding: 8px 16px; cursor: pointer; }

/* ===== Success toast ===== */
.qw-toast {
    position: fixed; top: 52px; left: 50%; transform: translateX(-50%);
    z-index: 9500; background: #1f8a4c; color: #fff;
    font: bold 14px/1 sans-serif; padding: 12px 20px; border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    opacity: 1; transition: opacity .4s ease, top .4s ease;
}
.qw-toast-hide { opacity: 0; top: 44px; }
.qw-toast-edit { background: #e8811a; }

/* ===== Admin UI styles ===== */
.qw-admin-input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.qw-admin-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.qw-admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background-color: #2563eb;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.qw-admin-btn:hover {
    background-color: #1d4ed8;
}

.qw-admin-btn:active {
    transform: translateY(1px);
}

.qw-admin-btn-secondary {
    background-color: #6b7280;
}

.qw-admin-btn-secondary:hover {
    background-color: #4b5563;
}

.qw-admin-form-row {
    margin-bottom: 12px;
}

.qw-admin-form-row label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.qw-admin-form-row input[type="text"] {
    width: 100%;
    max-width: 400px;
}

.qw-admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.qw-admin-table thead {
    background-color: #f9fafb;
}

.qw-admin-table th,
.qw-admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.qw-admin-table th {
    font-weight: 600;
    color: #374151;
    font-size: 13px;
}

.qw-admin-table tbody tr:hover {
    background-color: #f9fafb;
}

.qw-admin-table tbody tr:last-child td {
    border-bottom: none;
}

.qw-admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.qw-admin-badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

.qw-admin-badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.qw-admin-badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ===== Editable sections (edit mode only) ===== */
body.qw_edit_mode section[data-section] {
    position: relative;
    outline: 1px dashed #e8811a;
    outline-offset: 2px;
    min-height: 32px;               /* empty sections stay clickable */
    transition: outline-width .1s ease;
}
body.qw_edit_mode section[data-section]:hover {
    outline: 3px dashed #e8811a;
    background: rgba(232,129,26,.05);
}
/* placeholder for empty editable sections */
body.qw_edit_mode section[data-section]:empty::before {
    content: "\270E Click Edit to add content";
    color: #b06a1a; font: italic 13px/1.6 sans-serif;
}
/* floating edit button (injected by JS) */
body.qw_edit_mode .qw-section-edit {
    position: absolute; top: 4px; right: 4px; z-index: 50;
    display: none;
    background: #e8811a; color: #fff; text-decoration: none;
    font: bold 12px/1 sans-serif; padding: 5px 9px; border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
body.qw_edit_mode section[data-section]:hover .qw-section-edit { display: inline-block; }

/* ===== Multi-section nested edit affordances (edit mode only) =====
 * A multi_section parent renders each child as its OWN section[data-section] (see
 * Components/Sections/MultiSection.cshtml), so the edit overlay attaches an Edit button to the
 * parent AND to each child. The parent's button (top-right) would collide with the first child's
 * button, so when a section contains the multi-section wrapper we move the parent's own Edit button
 * to the top-LEFT and label it so the two never overlap and their purpose is clear.
 * Children keep the standard top-right button. The parent's "empty" placeholder is also suppressed
 * (it is never truly empty - it holds its children). */
body.qw_edit_mode section[data-section]:has(> .qw-multisection) > .qw-section-edit {
    right: auto;
    left: 4px;
}
body.qw_edit_mode section[data-section]:has(> .qw-multisection) > .qw-section-edit::after {
    content: " Items";
}
body.qw_edit_mode section[data-section]:has(> .qw-multisection)::before {
    content: none;
}
/* Keep each child's hover affordance independent of the parent's hover state: show a child's Edit
 * button when the child itself is hovered (not merely when the parent is). */
body.qw_edit_mode .qw-multisection-item:hover > .qw-section-edit { display: inline-block; }
body.qw_edit_mode section[data-section]:has(> .qw-multisection):hover > .qw-multisection-item:not(:hover) > .qw-section-edit {
    display: none;
}

/* ===== Generic form/card utilities (theme-independent, structural) =====
 * These are reusable building blocks for any site/theme. They carry only neutral,
 * structural defaults. All look-and-feel that a theme may want to own is read from
 * --qw-* custom properties with sane fallbacks, so a theme can restyle by setting
 * those variables (or overriding the classes) in its css_code - without editing this file.
 */

.qw-card {
    background: var(--qw-card-bg, #ffffff);
    border: 1px solid var(--qw-card-border, #e5e7eb);
    border-radius: var(--qw-radius-lg, 14px);
    box-shadow: var(--qw-card-shadow, 0 6px 24px rgba(0, 0, 0, 0.08));
    padding: var(--qw-card-pad, 28px);
    box-sizing: border-box;
}

.qw-field { display: flex; flex-direction: column; }

.qw-label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--qw-label-color, #374151);
}

.qw-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    font-size: 15px;
    color: var(--qw-input-color, #111827);
    background: var(--qw-input-bg, #ffffff);
    border: 1px solid var(--qw-input-border, #d1d5db);
    border-radius: var(--qw-radius, 10px);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.qw-input::placeholder { color: var(--qw-placeholder-color, #9ca3af); }

.qw-input:focus {
    outline: none;
    border-color: var(--qw-focus-color, #2563eb);
    box-shadow: 0 0 0 3px var(--qw-focus-ring, rgba(37, 99, 235, 0.15));
}

.qw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    color: var(--qw-btn-color, #ffffff);
    background: var(--qw-btn-bg, #2563eb);
    border: none;
    border-radius: var(--qw-radius, 10px);
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
}

.qw-btn:hover { background: var(--qw-btn-bg-hover, #1d4ed8); }
.qw-btn:active { transform: translateY(1px); }
.qw-btn-block { width: 100%; }

.qw-alert {
    padding: 11px 14px;
    border-radius: var(--qw-radius, 10px);
    font-size: 14px;
    margin-bottom: 14px;
}

.qw-alert-error {
    color: var(--qw-alert-error-color, #991b1b);
    background: var(--qw-alert-error-bg, #fef2f2);
    border: 1px solid var(--qw-alert-error-border, #fecaca);
}

.qw-alert-success {
    color: var(--qw-alert-success-color, #065f46);
    background: var(--qw-alert-success-bg, #ecfdf5);
    border: 1px solid var(--qw-alert-success-border, #a7f3d0);
}

/* ===== Password input (used by the <password-input> tag helper) =====
 * Bootstrap-agnostic: icons sit inside the input using absolute positioning,
 * so the input box, lock icon, and eye icon read as one seamless control
 * without relying on Bootstrap's input-group markup.
 */
.qw-input-wrap { position: relative; }

.qw-input-wrap .qw-input-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    pointer-events: none;
}

.qw-input-has-icon { padding-left: 40px; }
.qw-input-has-icon-end { padding-right: 40px; }

.qw-input-icon-end {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    /* Sit above the input so the icon actually receives mouse/touch events.
       Without this the input can capture pointer events over the icon and the
       press-and-hold reveal never fires. */
    z-index: 2;
}
/* The eye icon itself is the click target; make sure its inner sprite divs
   don't swallow the event target in a way that breaks closest() lookups. */
.qw-input-icon-end .icon20 { pointer-events: none; }

/* Password validity state coloring, applied to the lock icon / border. */
.pw-neutral { filter: none; }
.pw-red { filter: hue-rotate(-45deg) saturate(4); }
.pw-green { filter: hue-rotate(75deg) saturate(2.5); }


/* ===== Fixed "Edit Page" button (edit mode only) =====
 * Injected by _MasterLayout for SiteAdmins in edit mode. Mirrors the section-edit button look,
 * pinned to the lower-right of every content page. Uses its own class (qw-page-edit-fab) so it
 * never collides with the in-list "Edit" links on the /admin/pages screen (.qw-page-edit).
 */
.qw-page-edit-fab {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 8002; /* above the draft frame/badge */
    background: #e8811a;
    color: #fff;
    text-decoration: none;
    font: bold 13px/1 sans-serif;
    padding: 10px 14px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.qw-page-edit-fab:hover { background: #d4740f; }

/* ===== Quilt Calculators plugin (quilt_calc) =====
 * Visitor-side calculator hub. The gallery auto-wraps into a grid; each tile shows a 64x64 sprite
 * icon + title. Clicking a tile swaps the gallery for the calculator panel (handled by quilt-calc.ts).
 * Icons come from the single sprite sheet /img/icons/calculator.webp (64px tiles, selected by
 * background-position = index * -64px via the --qc-icon custom property). */
.qw-qc { max-width: 820px; margin: 0 auto; }

.qw-qc-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    padding: 8px 0;
}
.qw-qc-tile {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 16px 12px; border: 1px solid #e2e2e2; border-radius: 10px; background: #fff;
    cursor: pointer; text-align: center; transition: border-color .15s, box-shadow .15s;
    font: inherit; color: #1a1a1a;
}
.qw-qc-tile:hover { border-color: #9aa7bd; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.qw-qc-tile:focus-visible { outline: 2px solid #2b6cb0; outline-offset: 2px; }

/* 64x64 sprite icon. One row of 64px tiles; --qc-icon is the zero-based tile index. */
.qw-qc-icon {
    width: 64px; height: 64px; flex: 0 0 64px; display: block;
    background-image: url('/img/icons/calculator.webp');
    background-repeat: no-repeat;
    background-size: auto 64px;
    background-position: calc(var(--qc-icon, 0) * -64px) 0;
}
.qw-qc-tile-title { font-size: 14px; font-weight: 600; line-height: 1.25; }

/* Calculator panel (shown in place of the gallery). */
.qw-qc-panel { padding: 8px 0; }
.qw-qc-back {
    display: inline-block; margin-bottom: 12px; color: #2b6cb0; text-decoration: none; font-size: 14px;
}
.qw-qc-back:hover { text-decoration: underline; }
.qw-qc-panel-title { margin: 0 0 10px; font-size: 20px; }
.qw-qc-intro {
    margin: 0 0 18px; max-width: 560px; font-size: 14px; line-height: 1.5; color: #555;
    padding: 12px 14px; background: #f7f8fa; border-left: 3px solid #9aa7bd; border-radius: 4px;
}
.qw-qc-inputs { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.qw-qc-field { display: flex; flex-direction: column; gap: 4px; }
.qw-qc-field label { font-size: 13px; font-weight: 600; color: #333; }
.qw-qc-field input, .qw-qc-field select {
    padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; font-family: inherit;
}
.qw-qc-field input:focus, .qw-qc-field select:focus { outline: 2px solid #2b6cb0; outline-offset: 1px; }
.qw-qc-field-hint { font-size: 12px; color: #888; }
.qw-qc-actions { margin: 16px 0; }
.qw-qc-calc-btn {
    padding: 10px 22px; border: none; border-radius: 6px; background: #2b6cb0; color: #fff;
    font-weight: 700; font-size: 14px; cursor: pointer;
}
.qw-qc-calc-btn:hover { background: #255d99; }
.qw-qc-results { margin-top: 8px; }
.qw-qc-result-card {
    border: 1px solid #d7e3f0; background: #f3f8fd; border-radius: 8px; padding: 14px 16px; max-width: 420px;
}
.qw-qc-result-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; }
.qw-qc-result-row .qw-qc-result-label { color: #555; }
.qw-qc-result-row .qw-qc-result-value { font-weight: 700; color: #1a1a1a; }
.qw-qc-result-note { font-size: 12px; color: #777; margin-top: 8px; }
.qw-qc-error { color: #b3261e; font-size: 14px; margin-top: 8px; }

/* ===== Shared full-screen image modal (image_gallery + image_carousel) =====
 * One overlay element (built by image-modal.ts, QuiltImageModal) reused by both components so the
 * enlarge experience looks identical. Fixed backdrop, centered image, caption, close button. */
.qw-img-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: none; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    padding: 24px;
}
.qw-img-modal-dialog {
    position: relative;
    max-width: 92vw; max-height: 92vh;
    display: flex; flex-direction: column; align-items: center;
}
.qw-img-modal-img {
    max-width: 92vw; max-height: 82vh;
    object-fit: contain;
    border-radius: 4px; background: #fff;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.qw-img-modal-caption {
    margin-top: 12px; color: #fff; font-size: 15px; text-align: center;
    max-width: 92vw;
}
.qw-img-modal-close {
    position: absolute; top: -14px; right: -14px;
    width: 40px; height: 40px; border-radius: 50%;
    border: none; cursor: pointer;
    background: #fff; color: #1a1a1a;
    font-size: 26px; line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.qw-img-modal-close:hover { background: #f0f0f0; }

/* ===== Image Gallery plugin (image_gallery) =====
 * Visitor-side responsive thumbnail grid; clicking a thumb opens the shared modal (image-gallery.ts).
 * data-columns (when set) overrides the responsive auto-fit via an inline grid-template-columns. */
.qw-gallery { width: 100%; }
.qw-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}
.qw-gallery-cell {
    position: relative;
    display: block; padding: 0; margin: 0;
    border: none; background: none; cursor: pointer;
    overflow: hidden; border-radius: 4px;
    aspect-ratio: 1 / 1;
}
.qw-gallery-thumb {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.2s ease;
}
.qw-gallery-cell:hover .qw-gallery-thumb { transform: scale(1.05); }
.qw-gallery-cell:focus-visible { outline: 2px solid #e07c0f; outline-offset: 2px; }
.qw-gallery-caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    color: #fff; font-size: 13px; text-align: left;
    opacity: 0; transition: opacity 0.2s ease;
}
.qw-gallery-cell:hover .qw-gallery-caption,
.qw-gallery-cell:focus-visible .qw-gallery-caption { opacity: 1; }

/* ===== Image Carousel plugin (image_carousel) =====
 * Visitor-side slideshow: one slide visible at a time, cross-fade between slides, auto-rotate with
 * pause-on-hover, and prev/next/play-pause controls revealed on hover (image-carousel.ts). */
.qw-carousel {
    position: relative; overflow: hidden;
    border-radius: 4px; background: #000;
    aspect-ratio: 16 / 9;
}
.qw-carousel:focus-visible { outline: 2px solid #e07c0f; outline-offset: 2px; }
.qw-carousel-track { position: absolute; inset: 0; }
.qw-carousel-slide {
    position: absolute; inset: 0; margin: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.5s ease;
    pointer-events: none;
}
.qw-carousel-slide.is-active { opacity: 1; pointer-events: auto; }
.qw-carousel-img {
    max-width: 100%; max-height: 100%;
    object-fit: contain; display: block; cursor: zoom-in;
}
.qw-carousel-caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 10px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #fff; font-size: 14px; text-align: center;
}
.qw-carousel-controls {
    position: absolute; inset: 0;
    pointer-events: none;
    opacity: 0; transition: opacity 0.2s ease;
}
.qw-carousel:hover .qw-carousel-controls,
.qw-carousel:focus-within .qw-carousel-controls { opacity: 1; }
.qw-carousel-btn {
    position: absolute;
    pointer-events: auto; cursor: pointer;
    border: none; color: #fff;
    background: rgba(0, 0, 0, 0.45);
    width: 44px; height: 44px; border-radius: 50%;
    font-size: 18px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.qw-carousel-btn:hover { background: rgba(0, 0, 0, 0.7); }
.qw-carousel-prev { top: 50%; left: 10px; transform: translateY(-50%); }
.qw-carousel-next { top: 50%; right: 10px; transform: translateY(-50%); }
.qw-carousel-play { top: 10px; right: 10px; width: 38px; height: 38px; font-size: 14px; }

/* ===== Image Gallery / Carousel editors (admin, section editor Edit tab) ===== */
.qw-imged-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; max-width: 220px; }
.qw-imged-field-label { font-size: 13px; color: #555; }
.qw-imged-field input { padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; }
.qw-imged-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.qw-imged-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px; border: 1px solid #ddd; border-radius: 6px; background: #fff;
}
.qw-imged-row.is-dragging { opacity: 0.5; }
.qw-imged-handle { cursor: grab; color: #999; user-select: none; }
.qw-imged-thumb {
    flex: 0 0 auto; width: 56px; height: 56px;
    object-fit: cover; border-radius: 4px; background: #f0f0f0;
}
.qw-imged-choose, .qw-imged-upload {
    flex: 0 0 auto; cursor: pointer;
    border: 1px solid #ccc; background: #fff; border-radius: 4px;
    padding: 6px 10px; font-size: 13px; color: #333;
}
.qw-imged-choose:hover, .qw-imged-upload:hover { background: #f0f0f0; }
.qw-imged-cap { flex: 1 1 0; min-width: 0; padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; }
.qw-imged-remove {
    flex: 0 0 auto; border: none; background: none; cursor: pointer;
    color: #b3261e; font-size: 20px; line-height: 1; padding: 2px 6px;
}
.qw-imged-remove:hover { color: #7a1a14; }
.qw-imged-add {
    border: 1px dashed #bbb; background: #fafafa; border-radius: 6px;
    padding: 8px 12px; cursor: pointer; font-size: 14px; color: #333;
}
.qw-imged-add:hover { background: #f0f0f0; }

/* Loading overlay (QuiltLoadingOverlay) - full-window tint + spinner shown during slow requests. */
.qw-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none; /* toggled to flex by QuiltLoadingOverlay */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background-color: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(1px);
}

.qw-loading-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: qw-loading-spin 0.8s linear infinite;
}

.qw-loading-label {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

@keyframes qw-loading-spin {
    to { transform: rotate(360deg); }
}

/* Payment method picker (QuiltPaymentMethod) - tabs + card entry + saved-card list. */
.qw-pay {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    max-width: 520px;
}

.qw-pay-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.qw-pay-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
}

.qw-pay-tab:hover {
    color: #111827;
}

.qw-pay-tab-active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
}

.qw-pay-panel {
    display: none;
}

.qw-pay-panel-active {
    display: block;
}

.qw-pay-row-split {
    display: flex;
    gap: 12px;
}

.qw-pay-row-split .qw-admin-form-row {
    flex: 1;
}

.qw-pay-error {
    color: #b91c1c;
    font-size: 14px;
    margin-top: 8px;
}

.qw-pay-card-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.qw-pay-card {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
}

.qw-pay-card label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Small muted helper/legal text under admin forms. */
.qw-admin-help {
    color: #6b7280;
    font-size: 13px;
    max-width: 520px;
    margin-top: 12px;
}

/* "Domains being set up" box on the Site admin screen. */
.qw-provisioning {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
}
