main.main {
    width: min(1180px, calc(100% - 112px));
    padding: 96px 0 40px calc(var(--left-width, 70px) + 0px);
    margin: 0 auto;
}

.cameras-page {
    display: grid;
    gap: 22px;
}

.cameras-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
}

.cameras-header span,
.camera-modal-header span,
.camera-step-title span {
    color: var(--brand);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cameras-header h1 {
    margin-top: 6px;
    color: #252525;
}

.cameras-header p,
.camera-step-title p,
.camera-empty p,
.camera-setup-notice p,
.camera-agent-empty p,
.camera-scan-box p {
    margin: 8px 0 0;
    color: #6b6861;
    font-size: 14px;
    line-height: 1.55;
}

.camera-primary-button,
.camera-secondary-button,
.camera-danger-button {
    min-height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.camera-primary-button {
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #ffffff;
    padding: 0 16px;
    box-shadow: 0 8px 16px rgba(229, 57, 53, 0.18);
}

.camera-primary-button:hover {
    background: #d92929;
    border-color: #d92929;
}

.camera-primary-button:disabled {
    border-color: #e7aaa8;
    background: #e7aaa8;
    box-shadow: none;
    cursor: not-allowed;
}

.camera-secondary-button {
    border: 1px solid #d2cec5;
    background: #ffffff;
    color: #343434;
    padding: 0 14px;
}

.camera-secondary-button:disabled {
    color: #aaa49b;
    cursor: not-allowed;
}

.camera-danger-button {
    border: 1px solid rgba(229, 57, 52, 0.22);
    background: rgba(229, 57, 52, 0.08);
    color: #9b1c18;
    padding: 0 13px;
}

.camera-danger-button:hover {
    border-color: rgba(229, 57, 52, 0.38);
    background: rgba(229, 57, 52, 0.13);
}

.camera-alert,
.camera-setup-notice {
    margin: 0;
    padding: 13px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.camera-alert-success {
    border: 1px solid rgba(85, 183, 121, 0.35);
    background: rgba(85, 183, 121, 0.11);
    color: #267145;
}

.camera-alert-error,
.camera-setup-notice {
    border: 1px solid rgba(229, 57, 52, 0.24);
    background: rgba(229, 57, 52, 0.08);
    color: #9b1c18;
}

.camera-setup-notice strong {
    display: block;
    font-size: 13px;
}

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

.camera-stats article {
    min-height: 86px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8f7f4;
}

.camera-stats span {
    color: #6b6861;
    font-size: 12px;
    font-weight: 600;
}

.camera-stats strong {
    display: block;
    margin-top: 8px;
    color: #252525;
    font-size: 28px;
    line-height: 1;
}

.camera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.camera-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8f7f4;
}

.camera-preview {
    position: relative;
    aspect-ratio: 1.2 / 1;
    background: #1f1f1f;
}

.camera-preview-button {
    width: 100%;
    display: block;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: inherit;
    text-align: inherit;
}

.camera-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #1f1f1f;
}

.camera-preview small {
    position: absolute;
    right: 10px;
    bottom: 10px;
    min-height: 24px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #252525;
    font-size: 11px;
    font-weight: 700;
}

.camera-preview-empty {
    height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    color: #ffffff;
}

.camera-preview-empty span,
.camera-empty > span {
    width: 46px;
    height: 30px;
    border: 2px solid currentColor;
    border-radius: 8px;
    position: relative;
}

.camera-preview-empty span::after,
.camera-empty > span::after {
    content: "";
    position: absolute;
    right: -12px;
    top: 8px;
    border: 7px solid transparent;
    border-left-color: currentColor;
}

.camera-preview-empty strong {
    font-size: 12px;
    font-weight: 700;
}

.camera-preview-action {
    position: absolute;
    left: 10px;
    bottom: 10px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(229, 57, 52, 0.94);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 160ms, transform 160ms;
}

.camera-preview-button:hover .camera-preview-action,
.camera-preview-button:focus-visible .camera-preview-action {
    opacity: 1;
    transform: translateY(0);
}

.camera-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px;
}

.camera-card-body header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.camera-card-body h2 {
    margin: 0;
    color: #252525;
    font-size: 15px;
    line-height: 1.2;
}

.camera-card-body p {
    margin: 5px 0 0;
    color: #6b6861;
    font-size: 12px;
}

.camera-card-body header > span {
    align-self: flex-start;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    background: #efebe7;
    color: #5c5750;
    font-size: 11px;
    font-weight: 700;
}

.camera-card[data-status="online"] .camera-card-body header > span {
    background: rgba(85, 183, 121, 0.14);
    color: #267145;
}

.camera-card[data-status="error"] .camera-card-body header > span {
    background: rgba(229, 57, 52, 0.12);
    color: #9b1c18;
}

.camera-card-body dl,
.camera-review {
    display: grid;
    gap: 10px;
    margin: 14px 0 0;
}

.camera-card-body dl div,
.camera-review div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid #e2ded7;
}

.camera-card-body dt,
.camera-review dt {
    color: #827d75;
    font-size: 11px;
    font-weight: 700;
}

.camera-card-body dd,
.camera-review dd {
    margin: 0;
    color: #343434;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
}

.camera-card-actions {
    position: relative;
    display: grid;
    gap: 9px;
    margin-top: auto;
    padding-top: 26px;
}

.camera-card-actions::before {
    position: absolute;
    top: 13px;
    right: 0;
    left: 0;
    height: 1px;
    background: #e2ded7;
    content: "";
}

.camera-card-actions > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: #827d75;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.camera-card-actions > span::before {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #aaa49b;
    content: "";
}

.camera-card[data-status="online"] .camera-card-actions > span::before {
    background: #55b779;
}

.camera-card[data-status="error"] .camera-card-actions > span::before {
    background: #e53934;
}

.camera-link-danger {
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #9b1c18;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.camera-link-danger:hover,
.camera-link-danger:focus-visible {
    border-color: rgba(229, 57, 52, 0.22);
    background: rgba(229, 57, 52, 0.07);
}

.camera-card-actions form {
    margin: 0;
}

.camera-card-actions > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.camera-card-actions .camera-link-open {
    flex: 1 0 auto;
}

.camera-card-actions .camera-link-rtmp {
    flex-basis: 100%;
}

.camera-link-open {
    min-height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #d7d2ca;
    border-radius: 7px;
    background: #ffffff;
    color: #343434;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.camera-link-open::after {
    color: #827d75;
    content: "↗";
    font-size: 13px;
}

.camera-link-open:hover,
.camera-link-open:focus-visible {
    border-color: #bdb7ae;
    background: #fdfcf9;
}

.camera-credential-alert {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(229, 57, 52, 0.26);
    border-radius: 8px;
    background: rgba(229, 57, 52, 0.08);
}

.camera-credential-alert div { display: grid; gap: 3px; }
.camera-credential-alert strong { color: #8f1d19; font-size: 12px; }
.camera-credential-alert span { color: #76514f; font-size: 11px; line-height: 1.4; }
.camera-credential-alert button {
    min-height: 34px;
    border: 1px solid #b82b26;
    border-radius: 7px;
    background: #fff;
    color: #9b1c18;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}
.camera-status-error { padding: 10px; border-radius: 7px; background: #efebe7; overflow-wrap: anywhere; }

.camera-empty {
    min-height: 320px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    padding: 42px;
    border: 1px dashed #cbc6bd;
    border-radius: 8px;
    background: #f8f7f4;
    color: #9f9890;
    text-align: center;
}

.camera-empty h2 {
    margin: 0;
    color: #252525;
    font-size: 20px;
}

.camera-empty p {
    max-width: 560px;
    margin: 0;
}

.camera-modal[hidden],
.camera-stream-modal[hidden] {
    display: none;
}

.camera-modal,
.camera-stream-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px;
}

.camera-credentials-panel { width: min(620px, 100%); }
.camera-credentials-panel .camera-step { min-height: auto; }

.camera-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(25, 25, 25, 0.62);
}

.camera-stream-panel {
    position: relative;
    width: min(1040px, 100%);
    max-height: min(820px, calc(100vh - 48px));
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8f7f4;
    box-shadow: 0 24px 70px rgba(21, 21, 21, 0.28);
}

.camera-stream-body {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.8fr);
    gap: 18px;
    padding: 20px;
}

.camera-stream-stage {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    min-height: 0;
    max-height: calc(100vh - 250px);
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #1f1f1f;
    color: #ffffff;
}

.camera-stream-stage img,
.camera-stream-stage video {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.camera-stream-stage .camera-person-detections {
    position: absolute;
    z-index: 3;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.camera-stream-info {
    align-self: stretch;
    padding: 16px;
    border: 1px solid #d8d5ce;
    border-radius: 8px;
    background: #ffffff;
}

.camera-stream-info > strong {
    display: block;
    color: #252525;
    font-size: 15px;
}

.camera-stream-info dl {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}

.camera-stream-info dl div {
    display: grid;
    gap: 5px;
    padding-top: 10px;
    border-top: 1px solid #e2ded7;
}

.camera-stream-info dt {
    color: #827d75;
    font-size: 11px;
    font-weight: 700;
}

.camera-stream-info dd {
    margin: 0;
    color: #343434;
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.camera-stream-info p {
    margin: 0;
    color: #6b6861;
    font-size: 13px;
    line-height: 1.55;
}

.camera-modal-panel {
    position: relative;
    width: min(860px, 100%);
    max-height: min(820px, calc(100vh - 48px));
    max-height: min(820px, calc(100dvh - 48px));
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8f7f4;
    box-shadow: 0 24px 70px rgba(21, 21, 21, 0.28);
}

.camera-modal-header {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #d8d5ce;
}

.camera-modal-header h2 {
    margin: 5px 0 0;
    color: #252525;
    font-size: 22px;
}

.camera-modal-header button {
    width: 34px;
    height: 34px;
    border: 1px solid #d2cec5;
    border-radius: 8px;
    background: #ffffff;
    color: #343434;
    cursor: pointer;
    font-size: 20px;
}

.camera-steps {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 8px;
    margin: 0;
    padding: 18px 24px;
    border-bottom: 1px solid #e2ded7;
    list-style: none;
}

.camera-steps li {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8d5ce;
    border-radius: 999px;
    background: #ffffff;
    color: #6b6861;
    font-size: 11px;
    font-weight: 700;
}

.camera-steps li[data-active] {
    border-color: var(--brand);
    background: var(--brand);
    color: #ffffff;
}

.camera-step {
    min-height: 420px;
    padding: 24px;
}

.camera-step-title {
    margin-bottom: 20px;
}

.camera-step-title h3 {
    margin: 6px 0 0;
    color: #252525;
    font-size: 24px;
}

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

.camera-choice {
    min-height: 118px;
    padding: 16px;
    border: 1px solid #d8d5ce;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
}

.camera-choice input {
    accent-color: var(--brand);
}

.camera-choice strong,
.camera-agent-empty strong {
    display: block;
    margin-top: 8px;
    color: #252525;
    font-size: 15px;
}

.camera-choice span {
    display: block;
    margin-top: 7px;
    color: #6b6861;
    font-size: 13px;
    line-height: 1.45;
}

.camera-method-options {
    display: grid;
    gap: 12px;
}

.camera-method-options .camera-choice {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 5px 12px;
    align-content: center;
    min-width: 0;
    min-height: 92px;
}

.camera-method-options .camera-choice input {
    grid-row: 1 / span 2;
    align-self: start;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
}

.camera-method-options .camera-choice strong,
.camera-method-options .camera-choice span {
    grid-column: 2;
    margin: 0;
}

.camera-method-options .camera-choice:has(input:checked) {
    border-color: var(--brand);
    background: #fff6f5;
}

.camera-method-options .camera-choice:has(input:focus-visible) {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.camera-method-hint {
    margin: 14px 0 0;
    color: #6b6861;
    font-size: 13px;
    line-height: 1.5;
}

.camera-method-hint[hidden] { display: none; }

.camera-scan-box,
.camera-agent-empty {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #d8d5ce;
    border-radius: 8px;
    background: #ffffff;
}

.camera-scan-box[hidden],
.camera-agent-empty[hidden],
.camera-scan-fallback[hidden],
.camera-scan-results[hidden],
.camera-scan-actions [hidden] {
    display: none;
}

.camera-scan-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.camera-scan-actions > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #6b6861;
    font-size: 12px;
    font-weight: 700;
}

.camera-scan-actions > span::before {
    width: 10px;
    height: 10px;
    border: 2px solid #d8d5ce;
    border-top-color: var(--brand);
    border-radius: 50%;
    content: '';
    animation: camera-scan-spin 0.8s linear infinite;
}

.camera-scan-box > p {
    margin: 12px 0 0;
}

.camera-scan-results {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.camera-cart-selection-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.camera-cart-selection-actions[hidden] {
    display: none;
}

.camera-cart-selection-actions strong {
    margin-left: auto;
    color: #4b4944;
    font-size: 12px;
}

.camera-discovery-result {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid #d8d5ce;
    border-radius: 6px;
    background: #faf9f7;
    color: #252525;
    text-align: left;
    cursor: pointer;
}

.camera-discovery-result:hover {
    border-color: #aaa69d;
    background: #ffffff;
}

.camera-discovery-result[data-already-added] {
    cursor: not-allowed;
    opacity: 0.72;
    background: #f1f0ed;
}

.camera-discovery-result[data-already-added]:hover {
    border-color: #d8d5ce;
    background: #f1f0ed;
}

.camera-discovery-result[data-already-added] .camera-discovery-confidence {
    background: #e4e3df;
    color: #5f5c56;
}

.camera-discovery-result[data-selected] {
    border-color: var(--brand);
    box-shadow: inset 3px 0 0 var(--brand);
    background: rgba(229, 57, 52, 0.04);
}

.camera-discovery-result > span:first-child {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.camera-discovery-result strong,
.camera-discovery-result small {
    overflow-wrap: anywhere;
}

.camera-discovery-result strong {
    font-size: 13px;
}

.camera-discovery-result small {
    color: #6b6861;
    font-size: 11px;
}

.camera-discovery-confidence {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 999px;
    background: #e9f4ec;
    color: #26703c;
    font-size: 10px;
    font-weight: 800;
}

.camera-scan-fallback {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(229, 57, 52, 0.22);
    border-radius: 8px;
    background: rgba(229, 57, 52, 0.06);
}

.camera-scan-fallback strong {
    color: #252525;
    font-size: 14px;
}

.camera-scan-fallback p {
    margin: 0;
    font-size: 13px;
}

.camera-scan-fallback .camera-secondary-button {
    justify-self: start;
    margin-top: 2px;
}

@keyframes camera-scan-spin {
    to {
        transform: rotate(360deg);
    }
}

.camera-agent-empty div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.camera-agent-empty a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border: 1px solid #d2cec5;
    border-radius: 8px;
    background: #f8f7f4;
    color: #343434;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.camera-agent-skip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: #4b4944;
    font-size: 13px;
    font-weight: 700;
}

.camera-agent-skip input {
    accent-color: var(--brand);
}

.camera-step-feedback {
    min-height: 18px;
    margin: 14px 0 0;
    color: #9b1c18;
    font-size: 12px;
    font-weight: 700;
}

.camera-step-feedback[hidden] {
    display: none;
}

.camera-agent-list {
    display: grid;
    gap: 10px;
}

.camera-agent-list label {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid #d8d5ce;
    border-radius: 8px;
    background: #ffffff;
}

.camera-agent-list input {
    accent-color: var(--brand);
}

.camera-agent-list strong,
.camera-agent-list small {
    display: block;
}

.camera-agent-list strong {
    color: #252525;
    font-size: 14px;
}

.camera-agent-list small {
    margin-top: 4px;
    color: #6b6861;
    font-size: 12px;
}

.camera-form-grid label {
    display: grid;
    gap: 8px;
    color: #4b4944;
    font-size: 13px;
    font-weight: 700;
}

.camera-form-grid input,
.camera-form-grid select {
    width: 100%;
    height: 44px;
    border: 1px solid #d2cec5;
    border-radius: 8px;
    outline: 0;
    padding: 0 12px;
    background: #ffffff;
    color: #252525;
    font-size: 14px;
}

.camera-form-grid small {
    color: #827d75;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.camera-form-grid input:focus,
.camera-form-grid select:focus {
    border-color: #252525;
}

.camera-form-wide {
    grid-column: 1 / -1;
}

.camera-form-grid [data-single-camera-field][hidden] {
    display: none;
}

.camera-batch-access-note {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #d8d5ce;
    border-radius: 8px;
    background: #f8f7f4;
    color: #4b4944;
    font-size: 13px;
    line-height: 1.45;
}

.camera-batch-access-note[hidden] {
    display: none;
}

.camera-advanced { padding: 12px 14px; border: 1px solid #d8d5ce; border-radius: 8px; background: #f8f7f4; }
.camera-advanced summary { color: #4b4944; cursor: pointer; font-size: 13px; font-weight: 800; }
.camera-advanced > p { margin: 7px 0 14px; color: #827d75; font-size: 12px; }
.camera-advanced > .camera-form-grid { margin-top: 12px; }

.camera-recording-fields {
    margin-top: 22px;
}

.camera-payment-note {
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
    padding: 15px;
    border: 1px solid #d8d5ce;
    border-radius: 8px;
    background: #ffffff;
}

.camera-payment-note strong {
    color: #252525;
    font-size: 14px;
}

.camera-payment-note p {
    margin: 0;
    color: #6b6861;
    font-size: 13px;
    line-height: 1.45;
}

.camera-cart {
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid #d8d5ce;
    border-radius: 8px;
    background: #ffffff;
}

.camera-cart[hidden] {
    display: none;
}

.camera-cart > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #e2ded7;
    background: #f8f7f4;
}

.camera-cart > header div {
    display: grid;
    gap: 3px;
}

.camera-cart > header span {
    color: #827d75;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.camera-cart > header strong {
    color: #252525;
    font-size: 14px;
}

.camera-cart > div {
    display: grid;
}

.camera-cart article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid #eeece8;
}

.camera-cart article div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.camera-cart article strong,
.camera-cart article small {
    overflow-wrap: anywhere;
}

.camera-cart article strong {
    color: #252525;
    font-size: 13px;
}

.camera-cart article small,
.camera-cart article span {
    color: #6b6861;
    font-size: 11px;
}

.camera-cart article button {
    border: 0;
    background: transparent;
    color: #9b1c18;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.camera-cart > p {
    margin: 0;
    padding: 12px 16px;
    background: rgba(229, 57, 52, 0.04);
    color: #4b4944;
    font-size: 12px;
    line-height: 1.45;
}

.camera-connection-test {
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
    padding: 15px;
    border: 1px solid #d8d5ce;
    border-radius: 8px;
    background: #ffffff;
}

.camera-connection-test strong {
    color: #252525;
    font-size: 14px;
}

.camera-connection-test p {
    margin: 0;
    color: #6b6861;
    font-size: 13px;
    line-height: 1.45;
}

.camera-connection-test[data-state="testing"] {
    border-color: rgba(229, 57, 52, 0.3);
}

.camera-connection-test[data-state="pending"] {
    border-color: rgba(229, 57, 52, 0.28);
    background: rgba(229, 57, 52, 0.06);
}

.camera-connection-test[data-state="ready"] {
    border-color: rgba(85, 183, 121, 0.35);
    background: rgba(85, 183, 121, 0.08);
}

.camera-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 24px;
    border-top: 1px solid #d8d5ce;
    background: #f3f2ef;
}

@media (max-width: 900px) {
    .main {
        width: calc(100% - 28px);
        padding-left: 70px;
    }

    .cameras-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .camera-stats,
    .camera-choice-grid,
    .camera-form-grid,
    .camera-stream-body {
        grid-template-columns: 1fr;
    }

    .camera-stream-stage {
        min-height: 0;
        max-height: none;
    }

    .camera-stream-stage img,
    .camera-stream-stage video {
        min-height: 0;
    }

    .camera-form-wide {
        grid-column: auto;
    }
}

@media (max-width: 600px) {
    .camera-modal { padding: 12px; }
    .camera-modal-panel { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
    .camera-modal-header,
    .camera-modal-footer { padding: 16px; }
    .camera-step { padding: 20px 16px; min-height: 0; }
    .camera-step-title h3 { font-size: 21px; }
    .camera-steps { padding: 14px 16px; gap: 4px; }
    .camera-steps li { font-size: 10px; }
    .camera-method-options .camera-choice { padding: 14px; }
}

@media (max-width: 360px) {
    .camera-steps { padding-inline: 8px; gap: 3px; }
}

/* Direct RTMP setup uses the same camera form language. */
.camera-rtmp-page { max-width: 1000px; margin-inline: auto; }
.camera-rtmp-page .camera-step { margin-bottom: 20px; border-radius: 16px; }
.camera-rtmp-page input[readonly] { font-family: ui-monospace, monospace; }
.camera-rtmp-page ol { padding-left: 24px; line-height: 1.9; }
.camera-rtmp-page .camera-secondary-button { margin-top: 8px; width: fit-content; }
[data-rtsp-field][hidden], .camera-steps [hidden] { display: none !important; }

.camera-rtmp-test { margin-bottom: 24px; padding: 20px; border: 1px solid #e1ddd7; border-radius: 12px; background: #fff; min-width: 0; }
.camera-rtmp-test h3 { margin: 0 0 8px; }
.camera-rtmp-test p { line-height: 1.55; }
.camera-rtmp-test .rtmp-address-row input, .camera-rtmp-test .rtmp-split-row input { min-width: 0; width: 100%; padding: 10px; border: 1px solid #d9d4cc; border-radius: 7px; }
.camera-rtmp-test .rtmp-brand-help, .camera-rtmp-test .rtmp-option-body { min-width: 0; overflow-wrap: anywhere; }
.camera-rtmp-test [hidden] { display: none !important; }
.camera-rtmp-test-status { padding: 12px; background: #f5f3ef; border-radius: 8px; }
.camera-rtmp-test[data-state="ready"] .camera-rtmp-test-status { background: #eef8f1; color: #176137; }
.camera-rtmp-test-preview { margin: 12px 0; }
.camera-rtmp-test-preview img { display: block; max-height: 300px; width: 100%; object-fit: contain; background: #111; border-radius: 8px; }
.camera-rtmp-test-preview figcaption { margin-top: 6px; font-size: 12px; color: #65605a; }
.camera-rtmp-test-confirm { display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; margin: 16px 0; }
.camera-rtmp-test-confirm input { flex: 0 0 auto; margin-top: 4px; }
.camera-rtmp-test-quality { background: #fff5db; padding: 12px; border-radius: 8px; }
.camera-rtmp-test select { max-width: 100%; padding: 8px; }
.camera-rtmp-test .rtmp-mobile-transfer > div { min-width: 0; }
.camera-rtmp-test .rtmp-text-button { white-space: normal; }
@media (max-width: 600px) { .camera-rtmp-test { padding: 14px; } .camera-rtmp-test .rtmp-mobile-transfer { flex-direction: column; align-items: flex-start; } }

[data-camera-connection-test][hidden] { display: none !important; }

.camera-rtmp-test [data-rtmp-test-renew-qr] { display: block; margin-top: 6px; }
