* { box-sizing: border-box; }
body { margin: 0; background: var(--ibv-bg); }
button, input, textarea, select { font: inherit; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--ibv-bg); }
button, input, textarea, select { font: inherit; }
.ibv-header { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--ibv-card) 82%, transparent); border-bottom: 1px solid var(--ibv-border); }
.ibv-wrap { max-width: 1400px; margin: 0 auto; padding: 0 18px; }
.ibv-header-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ibv-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ibv-logo { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(150deg, var(--ibv-accent), var(--ibv-accent-2)); display: grid; place-items: center; box-shadow: 0 5px 16px rgba(200,90,52,.32); color: #fff7ef; font-weight: 900; }
.ibv-brand-title { font-family: var(--ibv-font-serif); color: var(--ibv-ink); font-size: 1.35rem; line-height: 1.05; }
.ibv-brand-cn { color: var(--ibv-text); font-size: .72rem; letter-spacing: .22em; line-height: 1.15; margin-top: 1px; opacity: .82; }
.ibv-brand-sub { color: var(--ibv-muted); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; }
.ibv-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ibv-nav-btn { padding: 8px 12px; }
.ibv-nav-btn[aria-current="page"] { border-color: var(--ibv-accent); background: var(--ibv-accent-soft); color: var(--ibv-accent); }
.ibv-nav-menu { position: relative; }
.ibv-nav-dropdown.ibv-popover { right: 0; top: calc(100% + 8px); width: 220px; display: flex; flex-direction: column; gap: 6px; }
.ibv-nav-dropdown.hidden { display: none; }
.ibv-nav-link { display: block; width: 100%; text-align: left; background: transparent; border: none; padding: 8px 10px; border-radius: 8px; color: var(--ibv-text); cursor: pointer; font: inherit; font-size: .85rem; }
.ibv-nav-link:hover { background: var(--ibv-accent-soft); color: var(--ibv-accent); }
.ibv-nav-link[aria-current="page"] { color: var(--ibv-accent); font-weight: 600; }
.ibv-nav-divider { height: 1px; background: var(--ibv-border); margin: 4px 2px; }
.ibv-nav-status { font-size: .8rem; color: var(--ibv-muted); padding: 2px 2px; }
.ibv-nav-status.is-error { color: var(--ibv-danger); }
.ibv-login-form { display: flex; flex-direction: column; gap: 6px; }
.ibv-login-row { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ibv-muted); }
.ibv-login-label { width: 32px; flex-shrink: 0; }
.ibv-login-form .ibv-input { flex: 1; width: auto; min-width: 0; padding: 6px 10px; font-size: .8rem; box-sizing: border-box; }
.ibv-login-form .ibv-btn { padding: 6px 12px; font-size: .8rem; width: 100%; }
.ibv-main { padding: 22px 18px 42px; max-width: 1400px; margin: 0 auto; }
.ibv-grid { display: grid; grid-template-columns: minmax(320px, 430px) minmax(0, 1fr); gap: 18px; align-items: start; }
.ibv-compose, .ibv-bay-panel, .ibv-gallery, .ibv-admin-panel { padding: 18px; }
.ibv-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ibv-section-title h2 { margin: 0; font-family: var(--ibv-font-sans); color: var(--ibv-ink); font-size: 0.78rem; font-weight: 600; letter-spacing: .01em; }
.ibv-muted { color: var(--ibv-muted); }
.ibv-model-btn { width: 100%; position: relative; text-align: left; padding: 12px 16px; overflow: hidden; }
.ibv-corner { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; background: var(--ibv-accent); clip-path: polygon(100% 0,100% 100%,0 100%); }
.ibv-prompt-shell { position: relative; min-height: 178px; border: 1px solid var(--ibv-border); border-radius: var(--ibv-radius); background: var(--ibv-bg-soft); overflow: hidden; }
.ibv-prompt-render, .ibv-prompt-input { width: 100%; min-height: 178px; padding: 14px 14px 38px; line-height: 1.65; font-size: .95rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.ibv-prompt-render { position: absolute; inset: 0; color: transparent; pointer-events: none; }
.ibv-prompt-render .ibv-chip { color: var(--ibv-accent); }
.ibv-prompt-input { position: relative; z-index: 1; resize: vertical; border: 0; outline: 0; background: transparent; color: color-mix(in srgb, var(--ibv-text) 82%, transparent); caret-color: var(--ibv-accent); }
.ibv-prompt-footer { position: absolute; right: 12px; bottom: 8px; z-index: 2; display: flex; align-items: center; gap: 12px; font-size: .72rem; color: var(--ibv-muted); }
.ibv-ref-dock { margin-top: 12px; min-height: 82px; display: flex; flex-wrap: wrap; gap: 9px; padding: 8px; border: 1.5px dashed var(--ibv-border); border-radius: var(--ibv-radius); background: color-mix(in srgb, var(--ibv-card) 60%, transparent); }
.ibv-ref-tile, .ibv-add-tile { width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--ibv-border); background: var(--ibv-card-elevated); display: grid; place-items: center; color: var(--ibv-accent); cursor: pointer; position: relative; overflow: hidden; }
.ibv-ref-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ibv-ref-dock.active { border-color: var(--ibv-accent); background: var(--ibv-accent-soft); }
.ibv-control-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--ibv-border); margin-top: 16px; padding-top: 16px; }
.ibv-control-row .ibv-btn { height: 42px; min-width: 48px; padding: 0 12px; }
.ibv-control-btn.active { border-color: var(--ibv-accent); background: var(--ibv-accent-soft); color: var(--ibv-accent); }
.ibv-generate { width: 100%; height: 52px; margin-top: 16px; }
.ibv-history { margin-top: 16px; border-top: 1px solid var(--ibv-border); padding-top: 16px; }
.ibv-history-list { display: grid; gap: 10px; max-height: 320px; overflow: auto; }
.ibv-history-card { border: 1px solid var(--ibv-border); border-radius: var(--ibv-radius); padding: 10px; background: var(--ibv-bg-soft); }
/* .ibv-bay-tabs and .ibv-bay-tab are superseded by ibv-tabs.css (Task #19/20 tile layout).
   These original rules are intentionally kept as stubs so no reference to them breaks. */
.ibv-bay-tabs { /* overridden by ibv-tabs.css */ }
.ibv-bay-tab { /* overridden by ibv-tabs.css */ }
.ibv-bay-tab.active { /* overridden by ibv-tabs.css */ }
.ibv-bay-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ibv-task-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 8px; }
.ibv-task-tab { flex: 0 0 auto; max-width: 220px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; }
.ibv-task-tab.active { border-color: var(--ibv-accent); background: var(--ibv-accent-soft); color: var(--ibv-accent); }
.ibv-task-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ibv-muted); }
.ibv-task-tab[data-status="running"] .ibv-task-dot { background: #65d6ff; box-shadow: 0 0 12px rgba(101,214,255,.7); }
.ibv-task-tab[data-status="done"] .ibv-task-dot { background: #77e6a1; }
.ibv-task-tab[data-status="failed"] .ibv-task-dot, .ibv-task-tab[data-status="cancelled"] .ibv-task-dot { background: #ff7a90; }
.ibv-hidden-compat { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(1, 5, 13, .82); backdrop-filter: blur(12px); }
.lightbox.hidden, .hidden { display: none !important; }
.ibv-lightbox-frame { width: min(1180px, 94vw); height: min(760px, 88vh); margin: 6vh auto; display: grid; grid-template-columns: minmax(0, 1fr) 360px; overflow: hidden; }
.ibv-lightbox-image-pane { min-width: 0; display: grid; place-items: center; background: rgba(0,0,0,.34); }
.ibv-lightbox-image-pane img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ibv-lightbox-side { border-left: 1px solid var(--ibv-border); padding: 16px; overflow: auto; background: var(--ibv-card); }
.ibv-lightbox-actions { display: grid; gap: 8px; margin-top: 16px; }
.ibv-lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.ibv-lightbox-nav.prev { left: 20px; }
.ibv-lightbox-nav.next { right: 20px; }
.ibv-bay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; min-height: 214px; }
.ibv-bay-item { aspect-ratio: 1; border: 1px solid var(--ibv-border); border-radius: 14px; background: linear-gradient(135deg, #18283a, #0c1420); position: relative; overflow: hidden; display: grid; place-items: center; color: var(--ibv-muted); }
.ibv-bay-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ibv-bay-empty { min-height: 214px; border: 1.5px dashed var(--ibv-border); border-radius: var(--ibv-radius-lg); display: grid; place-items: center; color: var(--ibv-muted); text-align: center; padding: 28px; }
.ibv-viewer { margin-top: 14px; min-height: 300px; border-radius: var(--ibv-radius-lg); border: 1px solid var(--ibv-border); background: linear-gradient(120deg, var(--ibv-bg-soft), var(--ibv-accent-soft), var(--ibv-bg-soft)); background-size: 200% 100%; animation: ibv-shimmer 2.2s linear infinite; display: grid; place-items: center; color: var(--ibv-muted); }
.ibv-gallery { margin-top: 18px; }
.ibv-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.ibv-gallery-grid .image-card { background: var(--ibv-card); border: 1px solid var(--ibv-border); border-radius: var(--ibv-radius-lg); box-shadow: var(--ibv-shadow-soft); overflow: hidden; }
.ibv-gallery-grid .image-card:hover { border-color: var(--ibv-accent); transform: translateY(-2px); }
.ibv-gallery-grid .image-card[draggable="true"] { cursor: grab; }
.ibv-gallery-grid .image-card[draggable="true"]:active { cursor: grabbing; }
.ibv-gallery-grid .aspect-square { aspect-ratio: 1; }
.ibv-gallery-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ibv-ref-dock.drag-target { border-color: var(--ibv-accent); background: color-mix(in srgb, var(--ibv-accent) 16%, var(--ibv-card)); }
.ibv-page { display: none; }
.ibv-page.active { display: block; }
.ibv-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.ibv-admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ibv-admin-tab { font-size: .76rem; font-weight: 600; padding: 5px 12px; }
.ibv-admin-tab[aria-selected="true"] { border-color: var(--ibv-accent); background: var(--ibv-accent-soft); color: var(--ibv-accent); }
/* Admin Data Console's left-column vertical nav (replaces the old horizontal
   .ibv-admin-tabs strip) — same selected-state look as the sidebar's own
   nav items for visual consistency. */
.ibv-admin-nav-item { display: block; width: 100%; text-align: left; padding: 9px 18px; border: none; border-left: 3px solid transparent; background: transparent; color: var(--ibv-muted); font-family: var(--ibv-font-sans); font-size: .84rem; font-weight: 500; cursor: pointer; transition: background .13s, color .13s, border-color .13s; }
.ibv-admin-nav-item:hover { background: var(--ibv-accent-soft); color: var(--ibv-ink); }
.ibv-admin-nav-item[aria-selected="true"] { background: var(--ibv-accent-soft); color: var(--ibv-accent); border-left-color: var(--ibv-accent); font-weight: 600; }

/* Two-column layouts (Innovo Manage, Admin Data Console) use a fixed-width
   inline-styled side column, which clips/truncates the right column on
   narrow screens — collapse to a vertical stack below this width. The
   inline width/border-right styles need !important since they're inline. */
@media (max-width: 700px) {
    .ibv-two-col { flex-direction: column !important; }
    .ibv-two-col-side { width: 100% !important; border-right: none !important; border-bottom: 1px solid var(--ibv-border); }
}
.ibv-admin-table { width: 100%; border-collapse: collapse; font-size: .82rem; font-weight: 400; }
.ibv-admin-table th, .ibv-admin-table td { text-align: left; border-bottom: 1px solid var(--ibv-border); padding: 8px; vertical-align: top; font-weight: 400; }
.ibv-admin-table th { font-weight: 500; }
.ibv-admin-panel-body { overflow-x: auto; }
.ibv-health-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.ibv-health-dot.is-ok { background: var(--ibv-success); }
.ibv-health-dot.is-warning { background: #d9a23b; }
.ibv-health-dot.is-unavailable { background: var(--ibv-danger); }
.ibv-health-dot.is-unknown { background: var(--ibv-border-strong); }
.ibv-provider-table td { vertical-align: middle; }
.ibv-provider-row td { background: var(--ibv-accent-soft); font-size: .85rem; }
.ibv-model-cell { padding-left: 24px; }
.ibv-provider-table .ibv-btn[aria-pressed="true"] { border-color: var(--ibv-accent); background: var(--ibv-accent-soft); color: var(--ibv-accent); }
.ibv-popover { position: absolute; z-index: 60; width: min(420px, 92vw); border: 1px solid var(--ibv-border); border-radius: var(--ibv-radius-lg); background: var(--ibv-card); box-shadow: var(--ibv-shadow); padding: 14px; animation: ibv-pop .16s ease; }
.ibv-provider-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ibv-model-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.ibv-model-option { text-align: left; padding: 10px 12px; }
.ibv-model-option[aria-selected="true"] { border-color: var(--ibv-accent); background: var(--ibv-accent-soft); color: var(--ibv-accent); }
.ibv-stat { padding: 16px; }
.ibv-stat strong { display: block; font-family: var(--ibv-font-sans); font-size: 0.88rem; font-weight: 650; color: var(--ibv-ink); line-height: 1.3; }
@media (max-width: 980px) { .ibv-grid { grid-template-columns: 1fr; } .ibv-header-inner { align-items: flex-start; flex-direction: column; padding: 12px 0; } .ibv-nav { justify-content: flex-start; } }

/* ─── caps-driven control row (resolution tier / ratio / quality / batch) ──── */
.ibv-contents { display: contents; }
.ibv-relative { position: relative; }
.ibv-choice-group { display: flex; gap: 6px; }
.ibv-control-divider { width: 1px; height: 32px; background: var(--ibv-border); margin: 0 4px; align-self: center; }
.opacity-40 { opacity: .4; }
.cursor-not-allowed { cursor: not-allowed; }

.choice-sq {
    width: 48px; height: 48px; flex-shrink: 0; padding: 0;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--ibv-border); background: var(--ibv-card); border-radius: var(--ibv-radius);
    color: var(--ibv-muted); font-family: var(--ibv-font-serif); font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.choice-sq:hover { border-color: var(--ibv-accent); }
.choice-sq.selected, .choice-sq.active { background: var(--ibv-accent-soft); border-color: var(--ibv-accent); color: var(--ibv-accent); }
.choice-sq svg { display: block; }

.choice-sq-icon { display: flex; align-items: center; justify-content: center; }
.choice-sq-label {
    position: absolute; left: 0; right: 0; bottom: 2px;
    font-size: 8px; line-height: 1; font-weight: 600; text-align: center;
    font-family: var(--ibv-font-serif); letter-spacing: -0.02em;
    color: inherit; opacity: .8; pointer-events: none;
}

.ratio-dropdown {
    position: absolute; z-index: 20; top: calc(100% + 4px); left: 0;
    display: grid; grid-template-columns: repeat(4, 40px); gap: 6px;
    padding: 8px; background: var(--ibv-card); border: 1px solid var(--ibv-border);
    border-radius: var(--ibv-radius); box-shadow: var(--ibv-shadow);
}
.ratio-option-btn {
    width: 40px; height: 40px; padding: 0;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--ibv-border); background: var(--ibv-bg-soft); border-radius: var(--ibv-radius);
    color: var(--ibv-muted); cursor: pointer;
}
.ratio-option-btn:hover { border-color: var(--ibv-accent); }
.ratio-option-btn.selected { background: var(--ibv-accent-soft); border-color: var(--ibv-accent); color: var(--ibv-accent); }
.ratio-option-btn .choice-sq-label { font-size: 7px; bottom: 1px; }

.ibv-custom-size-row { margin-top: 10px; }
.ibv-input {
    width: 100%; border: 1px solid var(--ibv-border); border-radius: var(--ibv-radius);
    background: var(--ibv-bg-soft); color: var(--ibv-text); padding: 8px 12px; font-size: .85rem;
}
.ibv-error-text { color: #ff7a90; font-size: .72rem; margin: 6px 0 0; }

.ibv-generate { display: flex; align-items: center; justify-content: center; gap: 10px; }
