:root {
    --qp-brand: #173b45;
    --qp-brand-dark: #0f2a30;
    --qp-brand-light: rgba(23, 59, 69, 0.08);
    --qp-bg: #eef1f5;
    --qp-surface: #ffffff;
    --qp-text: #1a2332;
    --qp-text-muted: #64748b;
    --qp-border: rgba(15, 23, 42, 0.08);
    --qp-radius: 16px;
    --qp-radius-sm: 12px;
    --qp-app-bar-h: 56px;
    --qp-footer-h: 76px;
    --qp-safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

.quick-property-standalone-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--qp-bg);
    color: var(--qp-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

/* ── App shell ── */
.qp-app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    background: var(--qp-bg);
    position: relative;
}

@media (min-width: 768px) {
    .qp-app {
        max-width: 560px;
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
        min-height: calc(100vh - 3rem);
        border-radius: 24px;
        overflow: hidden;
        box-shadow: 0 8px 40px rgba(15, 23, 42, 0.12);
    }
}

/* ── Top app bar ── */
.qp-app-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 0.25rem;
    height: var(--qp-app-bar-h);
    padding: 0 0.5rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--qp-border);
}

.qp-app-bar__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--qp-brand);
    text-decoration: none;
    font-size: 1.25rem;
    transition: background 0.15s;
}

.qp-app-bar__back:active {
    background: var(--qp-brand-light);
}

.qp-app-bar__center {
    min-width: 0;
    text-align: center;
}

.qp-app-bar__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--qp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qp-app-bar__action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 40px;
    height: 40px;
}

.qp-app-bar__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--qp-brand);
    text-decoration: none;
    font-size: 1.15rem;
    transition: background 0.15s;
}

.qp-app-bar__action-btn:active {
    background: var(--qp-brand-light);
}

/* ── Scrollable main ── */
.qp-app-main {
    flex: 1;
    padding: 0.75rem 1rem calc(var(--qp-footer-h) + var(--qp-safe-bottom) + 1rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
}

.qp-form {
    min-width: 0;
    max-width: 100%;
}

/* ── Info banner ── */
.qp-banner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: var(--qp-radius-sm);
    background: #e8f4fd;
    border: 1px solid #b6dff8;
}

.qp-banner__text {
    font-size: 0.85rem;
    line-height: 1.45;
    color: #0c4a6e;
}

.qp-banner__btn {
    align-self: flex-start;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: #fff;
    color: var(--qp-brand);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(23, 59, 69, 0.2);
}

/* ── Sections ── */
.qp-section {
    background: var(--qp-surface);
    border-radius: var(--qp-radius-sm);
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.qp-section--prop-type {
    overflow: hidden;
    min-width: 0;
}

.qp-section--prop-type .qp-section__body--scroll-x {
    border-radius: var(--qp-radius-sm);
    background: var(--qp-surface);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    padding-left: 0;
    padding-right: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 0.875rem;
    scrollbar-width: none;
    touch-action: pan-x;
    max-width: 100%;
    min-width: 0;
}

.qp-section--prop-type .qp-section__body--scroll-x::-webkit-scrollbar {
    display: none;
}

.qp-section--last {
    margin-bottom: 0;
}

.qp-section__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem 0.375rem;
    border-bottom: 1px solid var(--qp-border);
}

.qp-section__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--qp-brand-light);
    color: var(--qp-brand);
    font-size: 0.85rem;
}

.qp-section__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--qp-text);
}

.qp-section__body {
    padding: 0.625rem 0.875rem 0.875rem;
    min-width: 0;
}

.qp-section__body--scroll-x {
    padding-left: 0;
    padding-right: 0;
    min-width: 0;
}

/* ── Property type selector ── */
.prop-type-selector {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.35rem;
    width: max-content;
    min-width: 100%;
    padding: 0.125rem 0.875rem 0.25rem;
    box-sizing: border-box;
}

.cat-item {
    display: none;
}

.cat-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
    background: #f8fafc;
    border: 1.5px solid var(--qp-border);
    border-radius: 999px;
    color: var(--qp-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex: 0 0 auto;
    scroll-snap-align: start;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.cat-label .bi {
    font-size: 0.85em;
    line-height: 1;
}

.cat-label:active {
    transform: scale(0.98);
}

.cat-item:checked + .cat-label {
    background: var(--qp-brand);
    border-color: var(--qp-brand);
    color: #fff;
    box-shadow: 0 2px 8px rgba(23, 59, 69, 0.25);
}

/* ── Form fields ── */
.qp-field {
    margin-bottom: 0.875rem;
}

.qp-field:last-child {
    margin-bottom: 0;
}

.qp-field-row {
    display: flex;
    gap: 0.75rem;
}

.qp-field--half {
    flex: 1;
    min-width: 0;
}

.qp-field__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--qp-text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.qp-required {
    color: #dc3545;
}

.qp-optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #94a3b8;
}

.qp-input {
    width: 100%;
    height: 48px;
    padding: 0 0.875rem;
    border: 1.5px solid var(--qp-border);
    border-radius: var(--qp-radius-sm);
    background: #f8fafc;
    font-size: 1rem;
    color: var(--qp-text);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

.qp-input:focus {
    outline: none;
    border-color: var(--qp-brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(23, 59, 69, 0.1);
}

.qp-input-wrap {
    position: relative;
}

.qp-input-prefix {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: var(--qp-brand);
    font-size: 1rem;
    pointer-events: none;
}

.qp-input--with-prefix {
    padding-left: 2rem;
    font-weight: 600;
}

.qp-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

/* ── Image upload grid ── */
.quick-property-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
}

@media (min-width: 768px) {
    .quick-property-upload-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 767.98px) {
    .quick-property-upload-grid:not(.show-extra) .quick-property-upload-tile--extra {
        display: none;
    }
}

.quick-property-upload-tile {
    position: relative;
    aspect-ratio: 1;
    border: 2px dashed #cbd5e1;
    border-radius: var(--qp-radius-sm);
    background: #f8fafc;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s;
}

.quick-property-upload-tile:active {
    transform: scale(0.98);
}

.quick-property-upload-tile.has-image {
    border-style: solid;
    border-color: var(--qp-brand);
}

.quick-property-upload-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    color: var(--qp-text-muted);
    padding: 0.5rem;
    text-align: center;
}

.quick-property-upload-placeholder i {
    font-size: 1.5rem;
    color: var(--qp-brand);
    opacity: 0.7;
}

.quick-property-upload-placeholder span {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

.quick-property-upload-preview {
    position: absolute;
    inset: 0;
}

.quick-property-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quick-property-upload-remove {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    z-index: 2;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
}

.quick-property-add-more-wrap {
    margin-top: 0.625rem;
}

.quick-property-add-more-wrap.is-hidden {
    display: none;
}

@media (min-width: 768px) {
    .quick-property-add-more-wrap {
        display: none !important;
    }
}

.qp-add-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.65rem;
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--qp-radius-sm);
    background: transparent;
    color: var(--qp-brand);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.qp-add-more-btn:active {
    background: var(--qp-brand-light);
    border-color: var(--qp-brand);
}

/* ── Fixed bottom submit ── */
.qp-app-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 100;
    padding: 0.75rem 1rem calc(0.75rem + var(--qp-safe-bottom));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--qp-border);
}

.qp-form-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin: 0.625rem 0 0;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--qp-border);
    border-left: 2px solid var(--qp-brand);
}

.qp-form-notice__icon {
    flex-shrink: 0;
    margin-top: 0.05rem;
    font-size: 0.8rem;
    line-height: 1.2;
    color: var(--qp-brand);
}

.qp-form-notice__text {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: var(--qp-text-muted);
}

.qp-form-notice__text strong {
    font-weight: 600;
    color: var(--qp-text);
}

@media (min-width: 768px) {
    .qp-app-footer {
        max-width: 560px;
    }
}

.qp-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--qp-brand) 0%, var(--qp-brand-dark) 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(23, 59, 69, 0.3);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.qp-submit-btn:active:not(:disabled) {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(23, 59, 69, 0.25);
}

.qp-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.qp-submit-btn i {
    font-size: 1.2rem;
}

/* ── Toast ── */
#quickToastContainer {
    bottom: calc(var(--qp-footer-h) + var(--qp-safe-bottom) + 0.5rem) !important;
    z-index: 200;
}

.qp-toast {
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ── Quill editor ── */
.description-editor-block {
    width: 100%;
}

.description-editor-wrapper {
    width: 100%;
    min-height: 140px;
    background: #f8fafc;
    border-radius: var(--qp-radius-sm);
    border: 1.5px solid var(--qp-border);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.description-editor-wrapper:focus-within {
    border-color: var(--qp-brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(23, 59, 69, 0.1);
}

.description-editor-wrapper .ql-toolbar {
    border: none;
    border-bottom: 1px solid var(--qp-border);
    background: #fff;
    padding: 0.35rem 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
}

.description-editor-wrapper .ql-toolbar .ql-formats {
    margin-right: 0.35rem;
}

.description-editor-wrapper .ql-toolbar .ql-picker,
.description-editor-wrapper .ql-toolbar button {
    padding: 0.3rem 0.45rem;
}

.description-editor-wrapper .ql-container {
    border: none;
    font-size: 0.95rem;
    min-height: 120px;
    font-family: inherit;
}

.description-editor-wrapper .ql-editor {
    min-height: 120px;
    padding: 0.65rem 0.85rem;
    line-height: 1.55;
    color: var(--qp-text);
}

.description-editor-wrapper .ql-editor.ql-blank::before {
    color: #94a3b8;
    font-style: normal;
}

@media (max-width: 768px) {
    .description-editor-wrapper .ql-toolbar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .description-editor-wrapper .ql-toolbar::-webkit-scrollbar {
        display: none;
    }

    .description-editor-wrapper .ql-editor {
        font-size: 16px;
    }
}

/* ── Shared badge styles (used elsewhere) ── */
.property-card__badge--quick {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #ffc107;
    color: #212529;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.property-card__thumbnail {
    position: relative;
}

.property-show-quick-banner {
    border-left: 4px solid #ffc107;
}

.property-show-owner-upgrade {
    border-left: 4px solid var(--qp-brand);
}

.all-properties-page__badge--quick {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}
