.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 14px;
}
.breadcrumb__item {
    font-size: 14px;
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s;
    overflow-wrap: break-word;
}
.breadcrumb__item:hover { color: #374151; }
.breadcrumb__item--last { color: #64748b; }
.breadcrumb__item--last:hover { color: #1f2933; }
.breadcrumb__sep { font-size: 14px; color: #94a3b8; line-height: 1; }
.breadcrumb__current { font-size: 14px; color: #1f2933; }

/* ── Hide native controls replaced by custom UI ── */
#id_boat_type, #id_engine_type, #id_hull_material, #id_brand, #id_ex { display: none !important; }

/* ── Subtitle ── */
.boat-add-subtitle {
    color: #9ca3af;
    font-size: 15px;
    margin: 0 0 20px;
}

/* ── Blocks ── */
.boat-add-block {
    margin-bottom: 20px;
}

.boat-add-block__title {
    font-size: 17px;
    font-weight: 700;
    color: #1f2933;
    margin: 0 0 20px;
}

.boat-add-block__section-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 16px;
}

.boat-add-block__hint {
    color: #9ca3af;
    font-size: 13px;
    margin: -14px 0 16px;
}

/* ── Two-column layout ── */
.boat-add-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.boat-add-row {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.boat-add-row .form-field {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    justify-content: flex-start;
}

/* Force all controls to exactly the same height */
.boat-add-row .boat-add-fb-btn,
.boat-add-row .autocomplete-input,
.boat-add-row input[type="text"],
.boat-add-row input[type="number"],
.boat-add-row .date-display {
    height: 40px;
    box-sizing: border-box;
}

/* ── Checkbox row ── */
.boat-add-row--checkbox {
    margin-top: 8px;
}

.boat-add-checkbox-cell {
    display: flex;
    align-items: center;
}

.boat-add-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
    color: #1f2933;
    cursor: pointer;
    user-select: none;
}

.boat-add-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0B1F33;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Custom fb-panel selects ── */
.boat-add-fb-item {
    width: 100%;
}

.boat-add-fb-btn {
    width: 100%;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 8px;
    border-color: #d1d5db;
    font-size: 14px;
    font-weight: 400;
    color: #9ca3af;
    line-height: 1.4;
}

.boat-add-fb-btn.fb-btn--active {
    color: #1f2933;
    font-weight: 400;
}

.boat-add-fb-btn:hover {
    border-color: #9ca3af;
}

.boat-add-fb-panel {
    min-width: 100%;
}

/* ── Submit button ── */
.boat-add-submit {
    font-size: 13px;
    font-weight: 600;
    min-width: 140px;
    text-align: center;
    margin-top: 4px;
}

/* ── Field height alignment ── */
.boat-add-grid .autocomplete-input,
.boat-add-grid input[type="text"] { line-height: 1.4; }

/* ── Quill ── */
.ql-container { min-height: 200px; font-size: 15px; border-radius: 0 0 8px 8px; }
.ql-toolbar { border-radius: 8px 8px 0 0; background: #f9fafb; }
.ql-editor { min-height: 180px; line-height: 1.7; }
.ql-editor.ql-blank::before { color: #9ca3af; font-style: normal; font-weight: 400; font-size: 14px; font-family: inherit; }

/* ── Quill link tooltip ── */
.ql-snow .ql-tooltip {
    left: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
    z-index: 100;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 4px 8px !important;
}
/* View mode labels */
.ql-snow .ql-tooltip::before { content: "Ссылка: " !important; }
.ql-snow .ql-tooltip:not(.ql-editing) a.ql-action::after { content: "Изменить" !important; }
.ql-snow .ql-tooltip a.ql-remove::before { content: "Удалить" !important; }

/* Edit mode: hide label, Russian save button — all screens */
.ql-snow .ql-tooltip[data-mode=link]::before { display: none !important; }
.ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: "Сохранить" !important; }
.ql-snow .ql-tooltip input[type=text] { border-radius: 6px !important; outline: none !important; padding-left: 10px !important; }

/* Edit mode mobile: vertical layout */
@media (max-width: 600px) {
    .ql-snow .ql-tooltip.ql-editing:not(.ql-hidden) {
        display: flex !important;
        flex-direction: column;
        gap: 6px;
        white-space: normal;
        padding: 10px 12px;
    }
    .ql-snow .ql-tooltip.ql-editing input[type=text] {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
        margin: 0 !important;
    }
    .ql-snow .ql-tooltip.ql-editing a.ql-action {
        display: inline-block !important;
        margin-left: 0 !important;
    }
}

/* ── Autocomplete "other" option ── */
.autocomplete-suggestion--other { color: #6b7280; font-style: italic; border-bottom: 1px solid #f3f4f6; }
.autocomplete-suggestion--other:hover { background: #f0f9ff; color: #0B1F33; font-style: normal; }
.raw-back-btn {
    margin-top: 6px; background: none; border: none; cursor: pointer;
    font-size: 12px; color: #6b7280; padding: 0; text-decoration: underline;
}
.raw-back-btn:hover { color: #0B1F33; }
#id_brand_raw, #id_model_raw { width: 100%; }

/* ── Brand hint ── */
.boat-add-field-hint {
    color: #9ca3af;
    font-size: 13px;
    margin: 6px 0 0;
    line-height: 1.5;
}
.boat-add-hint-link {
    color: #9ca3af;
    text-decoration: underline;
    cursor: pointer;
}
.boat-add-hint-link:hover { color: #6b7280; }

/* ── Dropdown arrow on Brand / Model autocomplete inputs ── */
#brand_search,
#model_search {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
    padding-right: 30px;
}

/* ── Guest boat-add flow: step 2 "Сохранение" ── */
.guest-save-choice {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.guest-save-choice .reg-submit {
    flex: 1;
    max-width: 240px;
    text-align: center;
}

.guest-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #9ca3af;
    text-decoration: none;
}
.guest-back-link:hover { color: #374151; }
/* Step 1 has no real back link (there's nowhere to go back to from there),
   but reserves the same space so the title/subtitle sit at the same height
   as step 2 instead of jumping up when there's no link above them. */
.guest-back-link--placeholder { visibility: hidden; }

/* Same field layout as the header's login/registration modal forms */
#guest-login-form,
#guest-register-form {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

/* Outline variant of the shared modal .reg-submit button (same box model) */
.reg-submit--outline {
    background: #fff;
    color: #1f2933;
    border: 1.5px solid #d1d5db;
}
.reg-submit--outline:hover {
    background: #f9fafb;
}

/* .reg-terms-label / .reg-mf-field--terms live in templates/base.html's own
   <style> block, which the embedded (iframe) guest-flow page never loads —
   duplicated here so the terms checkbox looks identical in both contexts. */
.reg-mf-field--terms {
    margin-top: 20px;
    margin-bottom: 4px;
}
.reg-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.reg-terms-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 0;
    flex-shrink: 0;
    margin-top: 3px;
    cursor: pointer;
    accent-color: #0b4f7a;
}
.reg-terms-label input[type="checkbox"]:focus {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}
.reg-terms-label input[type="checkbox"]:focus-visible {
    outline: 2px solid #0b4f7a;
    outline-offset: 2px;
    box-shadow: none;
}
.reg-terms-label span {
    font-size: 13px;
    line-height: 1.55;
    color: #6b7280;
}
.reg-terms-label span a {
    color: #374151;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: #d1d5db;
    transition: text-decoration-color 0.15s, color 0.15s;
}
.reg-terms-label span a:hover {
    color: #111827;
    text-decoration-color: #9ca3af;
}

/* ── Mobile: keep dropdowns anchored below their button ── */
@media (max-width: 768px) {
    .boat-add-fb-panel,
    .apm-boat-dd-panel {
        position: absolute !important;
        top: calc(100% + 4px) !important;
        left: 0 !important;
        right: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-height: 50vh;
        overflow-y: auto;
    }
}
