/* CS16 Panel v8 — Eggs Core */

:root {
    --v8-bg: #070a0f;
    --v8-panel: #0d131d;
    --v8-panel-2: #111925;
    --v8-panel-3: #080e16;
    --v8-line: #202c3d;
    --v8-line-soft: #182231;
    --v8-text: #edf2f8;
    --v8-muted: #8190a5;
    --v8-dim: #5e6d82;
    --v8-red: #e52943;
    --v8-red-dark: #bf1530;
    --v8-red-soft: rgba(229, 41, 67, .12);
    --v8-green: #39d98a;
    --v8-green-soft: rgba(57, 217, 138, .11);
    --v8-yellow: #f4c95d;
    --v8-yellow-soft: rgba(244, 201, 93, .11);
    --v8-blue: #5d9cff;
    --v8-blue-soft: rgba(93, 156, 255, .11);
    --v8-radius: 12px;
}

body.v8-modal-open {
    overflow: hidden;
}

#eggsCorePage {
    min-height: calc(100vh - 82px);
}

.v8-page-head,
.v8-modal-head,
.v8-section-head,
.v8-code-toolbar,
.v8-list-head,
.v8-variable-head,
.v8-modal-footer,
.v8-editor-head-actions,
.v8-footer-left,
.v8-footer-right,
.v8-head-actions,
.v8-row-title-line,
.v8-switch-row,
.v8-validation-summary {
    display: flex;
    align-items: center;
}

.v8-page-head,
.v8-modal-head,
.v8-section-head,
.v8-code-toolbar,
.v8-list-head,
.v8-variable-head,
.v8-modal-footer,
.v8-validation-summary {
    justify-content: space-between;
}

.v8-page-head {
    gap: 20px;
    margin-bottom: 18px;
}

.v8-page-head h2,
.v8-modal-head h2,
.v8-editor-title h2 {
    margin: 0;
    color: var(--v8-text);
    font-size: 22px;
    line-height: 1.25;
}

.v8-page-head p,
.v8-modal-head p,
.v8-editor-title p {
    margin: 5px 0 0;
    color: var(--v8-muted);
    font-size: 12px;
    line-height: 1.55;
}

.v8-kicker {
    display: block;
    margin-bottom: 7px;
    color: #ff6c80;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .95px;
    text-transform: uppercase;
}

.v8-head-actions,
.v8-editor-head-actions,
.v8-footer-left,
.v8-footer-right,
.v8-row-actions,
.v8-import-options,
.v8-variable-flags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.v8-button,
.v8-mini-button,
.v8-icon-button,
.v8-action {
    border: 1px solid #2a384d;
    background: #121a26;
    color: #cbd5e1;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease, transform .15s ease, opacity .15s ease;
}

.v8-button {
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 8px;
    font-size: 11px;
    letter-spacing: .2px;
}

.v8-mini-button {
    min-height: 30px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 9px;
    letter-spacing: .35px;
}

.v8-icon-button {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    border-radius: 9px;
    font-size: 24px;
    line-height: 1;
}

.v8-button:hover:not(:disabled),
.v8-mini-button:hover:not(:disabled),
.v8-icon-button:hover:not(:disabled),
.v8-action:hover:not(:disabled) {
    border-color: #4a607d;
    color: #fff;
    transform: translateY(-1px);
}

.v8-button:disabled,
.v8-mini-button:disabled,
.v8-icon-button:disabled,
.v8-action:disabled,
.v8-field input:disabled,
.v8-field textarea:disabled,
.v8-field select:disabled,
.v8-codearea:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.v8-button.primary {
    border-color: #ef4058;
    background: linear-gradient(180deg, #ed2e49, #c81734);
    color: #fff;
    box-shadow: 0 10px 26px rgba(229, 41, 67, .18);
}

.v8-button.danger,
.v8-mini-button.danger {
    border-color: rgba(229, 41, 67, .45);
    background: var(--v8-red-soft);
    color: #ff8293;
}

.v8-mini-button.warning,
.v8-button.warning {
    border-color: rgba(244, 201, 93, .38);
    background: var(--v8-yellow-soft);
    color: var(--v8-yellow);
}

.v8-mini-button.success,
.v8-button.success {
    border-color: rgba(57, 217, 138, .36);
    background: var(--v8-green-soft);
    color: var(--v8-green);
}

.v8-alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(57, 217, 138, .34);
    border-radius: 9px;
    background: var(--v8-green-soft);
    color: #8ff0be;
    font-size: 12px;
    line-height: 1.5;
}

.v8-alert.error {
    border-color: rgba(229, 41, 67, .42);
    background: var(--v8-red-soft);
    color: #ff9aaa;
}

.v8-alert.warning {
    border-color: rgba(244, 201, 93, .4);
    background: var(--v8-yellow-soft);
    color: #ffe092;
}

.v8-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.v8-stat-card {
    position: relative;
    overflow: hidden;
    min-height: 116px;
    padding: 16px;
    border: 1px solid var(--v8-line);
    border-radius: var(--v8-radius);
    background: linear-gradient(145deg, #101824, #0b111a);
}

.v8-stat-card::after {
    content: '';
    position: absolute;
    right: -26px;
    bottom: -36px;
    width: 100px;
    height: 100px;
    border: 18px solid rgba(255, 255, 255, .025);
    border-radius: 50%;
}

.v8-stat-card.active {
    border-color: rgba(57, 217, 138, .25);
}

.v8-stat-card.muted {
    border-color: rgba(129, 144, 165, .22);
}

.v8-stat-card.used {
    border-color: rgba(93, 156, 255, .27);
}

.v8-stat-card > span {
    display: block;
    color: var(--v8-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .62px;
    text-transform: uppercase;
}

.v8-stat-card strong {
    position: relative;
    z-index: 1;
    display: block;
    margin: 9px 0 4px;
    color: #fff;
    font-size: 27px;
    line-height: 1;
}

.v8-stat-card small {
    position: relative;
    z-index: 1;
    color: var(--v8-dim);
    font-size: 10px;
}

.v8-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 170px 190px;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--v8-line);
    border-radius: var(--v8-radius);
    background: var(--v8-panel);
}

.v8-search {
    position: relative;
    display: block;
    margin: 0;
}

.v8-search > span {
    position: absolute;
    left: 13px;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%);
    color: var(--v8-dim);
    font-size: 18px;
    pointer-events: none;
}

.v8-search input,
.v8-select,
.v8-field input,
.v8-field textarea,
.v8-field select,
.v8-codearea {
    width: 100%;
    border: 1px solid #26354a;
    border-radius: 8px;
    outline: none;
    background: var(--v8-panel-3);
    color: #f8fafc;
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.v8-search input,
.v8-select,
.v8-field input,
.v8-field select {
    min-height: 40px;
    padding: 10px 12px;
}

.v8-search input {
    padding-left: 39px;
}

.v8-select {
    cursor: pointer;
}

.v8-search input:focus,
.v8-select:focus,
.v8-field input:focus,
.v8-field textarea:focus,
.v8-field select:focus,
.v8-codearea:focus {
    border-color: var(--v8-red);
    box-shadow: 0 0 0 3px rgba(229, 41, 67, .1);
}

.v8-search input::placeholder,
.v8-field input::placeholder,
.v8-field textarea::placeholder,
.v8-codearea::placeholder {
    color: #4f5e72;
}

.v8-list-card,
.v8-panel,
.v8-variable,
.v8-validation-box,
.v8-editor-validation {
    border: 1px solid var(--v8-line);
    border-radius: var(--v8-radius);
    background: var(--v8-panel);
}

.v8-list-card {
    overflow: hidden;
}

.v8-list-head {
    min-height: 55px;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--v8-line);
    background: #0a1018;
}

.v8-list-head > div {
    min-width: 0;
}

.v8-list-head strong,
.v8-section-head strong,
.v8-code-toolbar strong {
    display: block;
    color: var(--v8-text);
    font-size: 11px;
    letter-spacing: .25px;
}

.v8-list-head span:not(.v8-live-dot),
.v8-section-head span,
.v8-code-toolbar span {
    display: block;
    margin-top: 3px;
    color: var(--v8-dim);
    font-size: 10px;
}

.v8-live-dot {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--v8-green);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .5px;
}

.v8-live-dot::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(57, 217, 138, .08);
}

.v8-egg-list {
    min-height: 140px;
}

.v8-egg-row {
    display: grid;
    grid-template-columns: minmax(320px, 1.65fr) minmax(265px, .9fr) minmax(150px, .55fr) auto;
    align-items: center;
    gap: 14px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--v8-line-soft);
    transition: background .15s ease, opacity .15s ease;
}

.v8-egg-row:last-child {
    border-bottom: 0;
}

.v8-egg-row:hover {
    background: #111a27;
}

.v8-egg-row.inactive {
    opacity: .72;
}

.v8-egg-row.inactive:hover {
    opacity: .92;
}

.v8-row-main {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.v8-egg-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    border: 1px solid rgba(229, 41, 67, .4);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(229, 41, 67, .2), rgba(229, 41, 67, .05));
    color: #ff8a9a;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: -.4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.v8-row-identity {
    display: block;
    min-width: 0;
}

.v8-row-title-line {
    min-width: 0;
    flex-wrap: wrap;
    gap: 7px;
}

.v8-row-title-line > strong {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v8-version,
.v8-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.v8-version {
    padding: 4px 6px;
    border: 1px solid #2b3a50;
    color: #91a1b6;
    background: #121b27;
}

.v8-status {
    gap: 5px;
    padding: 5px 7px;
    color: #9aa8ba;
    background: #17202c;
}

.v8-status::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.v8-status.active {
    color: var(--v8-green);
    background: var(--v8-green-soft);
}

.v8-status.inactive {
    color: #9aa8ba;
    background: rgba(129, 144, 165, .1);
}

.v8-row-description,
.v8-image-line {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v8-row-description {
    margin-top: 5px;
    color: #7d8da2;
    font-size: 11px;
}

.v8-image-line {
    margin-top: 5px;
    color: #596a80;
    font-family: Consolas, "Liberation Mono", monospace;
    font-size: 9px;
}

.v8-row-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.v8-row-metrics > span {
    display: block;
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid #1f2b3c;
    border-radius: 7px;
    background: #0a1018;
    color: #64758b;
    font-size: 9px;
    white-space: nowrap;
}

.v8-row-metrics b {
    margin-right: 3px;
    color: #c9d4e3;
    font-size: 10px;
}

.v8-row-meta {
    min-width: 0;
}

.v8-row-meta span,
.v8-row-meta small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v8-row-meta span {
    color: #b5c0cf;
    font-size: 10px;
}

.v8-row-meta small {
    margin-top: 5px;
    color: #5c6c80;
    font-size: 9px;
}

.v8-row-actions {
    justify-content: flex-end;
    max-width: 225px;
}

.v8-empty {
    display: flex;
    min-height: 130px;
    padding: 28px 18px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--v8-muted);
    text-align: center;
}

.v8-empty.compact {
    min-height: 74px;
    padding: 18px;
}

.v8-empty.error {
    color: #ff8798;
}

.v8-empty strong {
    color: #c5d0df;
    font-size: 12px;
}

.v8-empty span {
    color: var(--v8-dim);
    font-size: 10px;
}

.v8-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 5, 9, .83);
    backdrop-filter: blur(7px);
}

.v8-modal-card {
    width: min(100%, 760px);
    max-height: 94vh;
    overflow: hidden;
    border: 1px solid #2b3b52;
    border-radius: 15px;
    background: #0d141f;
    box-shadow: 0 34px 120px rgba(0, 0, 0, .72);
}

.v8-editor-card {
    width: min(100%, 1180px);
    display: flex;
    flex-direction: column;
}

.v8-import-card {
    width: min(100%, 760px);
    max-height: 92vh;
    overflow-y: auto;
    padding: 22px;
}

.v8-modal-head {
    gap: 16px;
    margin-bottom: 16px;
}

.v8-editor-card > .v8-modal-head {
    flex: 0 0 auto;
    min-height: 82px;
    margin: 0;
    padding: 15px 18px;
    border-bottom: 1px solid var(--v8-line);
    background: #0a1018;
}

.v8-editor-title {
    min-width: 0;
}

.v8-editor-title h2,
.v8-editor-title p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v8-editor-tabs {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
    padding: 8px 12px 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--v8-line);
    background: #0b111a;
    scrollbar-width: thin;
}

.v8-tab {
    min-height: 38px;
    padding: 8px 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #718198;
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
    cursor: pointer;
}

.v8-tab:hover,
.v8-tab.active {
    color: #fff;
}

.v8-tab.active {
    border-bottom-color: var(--v8-red);
}

.v8-editor-body {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px;
    background: #0c121b;
}

.v8-tab-panel {
    min-height: 290px;
}

.v8-panel {
    padding: 16px;
}

.v8-panel + .v8-panel {
    margin-top: 12px;
}

.v8-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.v8-form-grid.variable-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.v8-field {
    display: block;
    min-width: 0;
    margin: 0;
}

.v8-field.full {
    grid-column: 1 / -1;
}

.v8-field > span,
.v8-field.status-field > span {
    display: block;
    margin-bottom: 7px;
    color: #9eacbd;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .22px;
}

.v8-field > small {
    display: block;
    margin-top: 6px;
    color: #5f7187;
    font-size: 9px;
    line-height: 1.45;
}

.v8-field textarea {
    min-height: 92px;
    padding: 11px 12px;
    resize: vertical;
    line-height: 1.55;
}

.v8-mono,
.v8-codearea,
.v8-notice code {
    font-family: Consolas, "Liberation Mono", Menlo, monospace !important;
}

.v8-switch-row {
    min-height: 62px;
    gap: 11px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #26354a;
    border-radius: 8px;
    background: var(--v8-panel-3);
    cursor: pointer;
}

.v8-switch-row > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.v8-switch {
    position: relative;
    width: 42px;
    height: 23px;
    flex: 0 0 42px;
    border: 1px solid #34445a;
    border-radius: 999px;
    background: #182231;
    transition: .18s ease;
}

.v8-switch::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #77879b;
    transition: .18s ease;
}

.v8-switch-row > input:checked + .v8-switch {
    border-color: rgba(57, 217, 138, .5);
    background: rgba(57, 217, 138, .18);
}

.v8-switch-row > input:checked + .v8-switch::after {
    left: 22px;
    background: var(--v8-green);
}

.v8-switch-row > span:last-child {
    min-width: 0;
}

.v8-switch-row strong,
.v8-switch-row small {
    display: block;
}

.v8-switch-row strong {
    color: #dce5ef;
    font-size: 10px;
}

.v8-switch-row small {
    margin-top: 3px;
    color: var(--v8-dim);
    font-size: 9px;
}

.v8-notice {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 13px;
    padding: 11px 12px;
    border: 1px solid rgba(93, 156, 255, .25);
    border-radius: 8px;
    background: var(--v8-blue-soft);
    color: #a8c8ff;
    font-size: 10px;
    line-height: 1.5;
}

.v8-notice.warning {
    border-color: rgba(244, 201, 93, .34);
    background: var(--v8-yellow-soft);
    color: #f9dc8a;
}

.v8-notice strong {
    flex: 0 0 auto;
    color: inherit;
}

.v8-code-toolbar,
.v8-section-head {
    gap: 14px;
    margin-bottom: 10px;
}

.v8-codearea {
    display: block;
    min-height: 180px;
    padding: 13px 14px;
    resize: vertical;
    font-size: 11px;
    line-height: 1.58;
    tab-size: 4;
    white-space: pre;
}

.v8-codearea.medium {
    min-height: 150px;
}

.v8-codearea.script {
    min-height: 430px;
    max-height: 56vh;
}

.v8-codearea.json {
    min-height: 470px;
    max-height: 60vh;
}

.v8-codearea.import {
    min-height: 280px;
    max-height: 48vh;
}

.v8-variable-list {
    display: grid;
    gap: 11px;
}

.v8-variable {
    padding: 13px;
    background: #0b111a;
}

.v8-variable-head {
    gap: 10px;
    margin-bottom: 12px;
}

.v8-variable-head strong {
    color: #8f9fb3;
    font-size: 9px;
    letter-spacing: .6px;
}

.v8-variable-flags {
    align-self: end;
    min-height: 40px;
}

.v8-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #99a8ba;
    font-size: 10px;
    cursor: pointer;
}

.v8-check input {
    width: 15px;
    height: 15px;
    min-height: 0;
    padding: 0;
    accent-color: var(--v8-red);
}

.v8-relation-list,
.v8-activity-list {
    overflow: hidden;
    border: 1px solid var(--v8-line);
    border-radius: var(--v8-radius);
    background: var(--v8-panel);
}

.v8-relation-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) minmax(160px, .85fr) minmax(150px, .75fr) auto;
    align-items: center;
    gap: 14px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--v8-line-soft);
}

.v8-relation-row:last-child,
.v8-activity-row:last-child {
    border-bottom: 0;
}

.v8-relation-row > div {
    min-width: 0;
}

.v8-relation-row strong,
.v8-relation-row span:not(.v8-status),
.v8-activity-row strong,
.v8-activity-row span,
.v8-activity-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v8-relation-row strong {
    color: #dce5ef;
    font-size: 11px;
}

.v8-relation-row span:not(.v8-status) {
    margin-top: 4px;
    color: var(--v8-dim);
    font-size: 9px;
}

.v8-activity-row {
    display: grid;
    grid-template-columns: 13px minmax(0, 1fr) auto;
    align-items: start;
    gap: 11px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--v8-line-soft);
}

.v8-activity-dot {
    width: 8px;
    height: 8px;
    margin-top: 3px;
    border-radius: 50%;
    background: var(--v8-red);
    box-shadow: 0 0 0 4px rgba(229, 41, 67, .09);
}

.v8-activity-row strong {
    color: #dce5ef;
    font-size: 10px;
    text-transform: capitalize;
}

.v8-activity-row span {
    margin-top: 4px;
    color: #718198;
    font-size: 9px;
}

.v8-activity-row small {
    color: #5e6e82;
    font-size: 9px;
    text-align: right;
}

.v8-editor-validation,
.v8-validation-box {
    margin: 0 18px 14px;
    padding: 12px;
    background: #0a1018;
}

.v8-validation-box {
    margin: 12px 0 0;
}

.v8-validation-summary {
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid rgba(57, 217, 138, .3);
    border-radius: 8px;
    background: var(--v8-green-soft);
}

.v8-validation-summary.invalid {
    border-color: rgba(229, 41, 67, .4);
    background: var(--v8-red-soft);
}

.v8-validation-summary strong,
.v8-validation-summary span {
    display: block;
}

.v8-validation-summary strong {
    color: #b3f5d2;
    font-size: 10px;
}

.v8-validation-summary.invalid strong {
    color: #ff9aaa;
}

.v8-validation-summary div > span {
    margin-top: 3px;
    color: var(--v8-muted);
    font-size: 9px;
}

.v8-validation-mark {
    width: 28px;
    height: 28px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(57, 217, 138, .16);
    color: var(--v8-green) !important;
    font-size: 15px !important;
    font-weight: 950;
}

.v8-validation-summary.invalid .v8-validation-mark {
    background: rgba(229, 41, 67, .17);
    color: #ff7589 !important;
}

.v8-validation-list {
    display: grid;
    gap: 5px;
    margin-top: 8px;
    padding: 10px 11px;
    border-radius: 7px;
    font-size: 10px;
    line-height: 1.45;
}

.v8-validation-list.errors {
    border: 1px solid rgba(229, 41, 67, .3);
    background: rgba(229, 41, 67, .075);
    color: #ff9aaa;
}

.v8-validation-list.warnings {
    border: 1px solid rgba(244, 201, 93, .3);
    background: rgba(244, 201, 93, .075);
    color: #f9dc8a;
}

.v8-modal-footer {
    gap: 12px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid var(--v8-line);
}

.v8-editor-card > .v8-modal-footer {
    flex: 0 0 auto;
    min-height: 66px;
    margin: 0;
    padding: 12px 18px;
    background: #0a1018;
}

.v8-file-drop {
    display: flex;
    min-height: 82px;
    margin: 0 0 13px;
    padding: 14px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px dashed #3a4c65;
    border-radius: 10px;
    background: #0a1018;
    color: #b5c3d4;
    text-align: center;
    cursor: pointer;
    transition: .15s ease;
}

.v8-file-drop:hover {
    border-color: var(--v8-red);
    background: rgba(229, 41, 67, .05);
}

.v8-file-drop strong {
    color: #e2e8f0;
    font-size: 11px;
}

.v8-file-drop span {
    color: var(--v8-dim);
    font-size: 10px;
}

.v8-file-drop input {
    display: none;
}

.v8-import-options {
    margin-top: 11px;
    padding: 10px 12px;
    border: 1px solid var(--v8-line-soft);
    border-radius: 8px;
    background: #0a1018;
}

@media (max-width: 1320px) {
    .v8-egg-row {
        grid-template-columns: minmax(320px, 1.55fr) minmax(240px, .8fr) auto;
    }

    .v8-row-meta {
        display: none;
    }
}

@media (max-width: 1100px) {
    .v8-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v8-egg-row {
        grid-template-columns: minmax(300px, 1fr) minmax(230px, .75fr);
    }

    .v8-row-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        max-width: none;
        padding-left: 60px;
    }

    .v8-relation-row {
        grid-template-columns: minmax(220px, 1.2fr) minmax(160px, .8fr) auto;
    }

    .v8-relation-row > div:nth-child(3) {
        display: none;
    }
}

@media (max-width: 850px) {
    .v8-page-head,
    .v8-modal-head,
    .v8-section-head,
    .v8-code-toolbar,
    .v8-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .v8-head-actions,
    .v8-footer-left,
    .v8-footer-right,
    .v8-editor-head-actions {
        width: 100%;
    }

    .v8-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .v8-search {
        grid-column: 1 / -1;
    }

    .v8-egg-row {
        grid-template-columns: 1fr;
    }

    .v8-row-metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .v8-row-actions {
        grid-column: auto;
        padding-left: 0;
    }

    .v8-form-grid,
    .v8-form-grid.variable-grid {
        grid-template-columns: 1fr;
    }

    .v8-field.full {
        grid-column: auto;
    }

    .v8-editor-card > .v8-modal-head {
        align-items: center;
        flex-direction: row;
    }

    .v8-editor-card > .v8-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .v8-relation-row {
        grid-template-columns: 1fr auto;
    }

    .v8-relation-row > div:nth-child(2),
    .v8-relation-row > div:nth-child(3) {
        display: none;
    }
}

@media (max-width: 620px) {
    #eggsCorePage.page {
        padding: 17px 13px;
    }

    .v8-page-head h2,
    .v8-modal-head h2,
    .v8-editor-title h2 {
        font-size: 18px;
    }

    .v8-stats,
    .v8-toolbar {
        grid-template-columns: 1fr;
    }

    .v8-search {
        grid-column: auto;
    }

    .v8-stat-card {
        min-height: 100px;
    }

    .v8-list-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .v8-live-dot {
        margin-top: 4px;
    }

    .v8-egg-row {
        padding: 13px;
    }

    .v8-row-main {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .v8-egg-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .v8-row-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v8-row-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v8-mini-button {
        width: 100%;
    }

    .v8-modal {
        align-items: stretch;
        padding: 0;
    }

    .v8-modal-card,
    .v8-editor-card,
    .v8-import-card {
        width: 100%;
        max-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    .v8-import-card {
        padding: 16px;
    }

    .v8-editor-card > .v8-modal-head {
        min-height: 72px;
        padding: 12px 13px;
    }

    .v8-editor-title p,
    .v8-editor-head-actions .v8-button:not(.primary) {
        display: none;
    }

    .v8-editor-head-actions {
        width: auto;
        flex-wrap: nowrap;
    }

    .v8-editor-tabs {
        padding-left: 7px;
        padding-right: 7px;
    }

    .v8-tab {
        padding: 8px 10px;
        font-size: 9px;
    }

    .v8-editor-body {
        padding: 13px;
    }

    .v8-codearea.script,
    .v8-codearea.json {
        min-height: 360px;
    }

    .v8-editor-validation {
        margin: 0 13px 10px;
    }

    .v8-editor-card > .v8-modal-footer {
        padding: 10px 13px;
    }

    .v8-footer-left,
    .v8-footer-right,
    .v8-head-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v8-footer-right .v8-button,
    .v8-footer-left .v8-button,
    .v8-head-actions .v8-button {
        width: 100%;
    }

    .v8-footer-right .v8-button.primary:last-child {
        grid-column: 1 / -1;
    }

    .v8-relation-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .v8-relation-row > .v8-status {
        justify-self: start;
    }

    .v8-activity-row {
        grid-template-columns: 13px minmax(0, 1fr);
    }

    .v8-activity-row > small {
        grid-column: 2;
        text-align: left;
    }

    .v8-notice {
        display: block;
    }

    .v8-notice strong {
        display: block;
        margin-bottom: 4px;
    }
}

/* Final editor alignment safeguards */
.v8-editor-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

#v8EditorAlert .v8-alert {
    margin: 12px 18px 0;
}

.v8-activity-row time {
    display: block;
    color: #5e6e82;
    font-size: 9px;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 620px) {
    #v8EditorAlert .v8-alert {
        margin: 10px 13px 0;
    }

    .v8-activity-row > time {
        grid-column: 2;
        text-align: left;
    }
}
