/* ===== BOTANICA v1.0.1 — phone.css ===== */

/* Auth screen */
.auth-container {
    padding: 40px 24px;
    padding-top: calc(60px + var(--safe-top));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.auth-logo {
    text-align: center;
    margin-bottom: 40px;
}
.auth-logo-icon {
    font-size: 72px;
    margin-bottom: 12px;
}
.auth-logo-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--green);
    letter-spacing: 2px;
}
.auth-logo-sub {
    font-size: 14px;
    color: var(--gray-text);
    margin-top: 6px;
}
.auth-tabs {
    display: flex;
    background: var(--gray-bg);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 28px;
}
.auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-text);
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-tab.active {
    background: #fff;
    color: var(--green);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.auth-btn {
    width: 100%;
    display: block;
    margin-top: 8px;
    padding: 16px;
    font-size: 16px;
}
.auth-error {
    color: var(--red);
    font-size: 13px;
    min-height: 20px;
    padding: 4px 0;
}
.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--gray-text);
}
.auth-switch span {
    color: var(--green);
    font-weight: 600;
    cursor: pointer;
}
#screen-auth {
    padding-bottom: 0;
}
#screen-auth .form-input {
    font-size: 16px;
}
.auth-forgot {
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
}
.auth-forgot span {
    color: var(--green);
    cursor: pointer;
    font-weight: 500;
}
.auth-version {
    font-size: 12px;
    color: var(--gray-text);
    margin-top: 8px;
}

/* ===== Location cards ===== */

.location-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    margin: 8px 12px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    position: relative;
}
.location-card:active {
    transform: scale(0.98);
    opacity: 0.85;
}
.location-edit-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--green-light);
    color: var(--green);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.location-edit-btn:active {
    transform: scale(0.9);
}
.location-card-photo {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: var(--green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}
.location-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.location-card-body {
    flex: 1;
    min-width: 0;
}
.location-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.location-card-address {
    font-size: 13px;
    color: var(--gray-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.location-card-stats {
    font-size: 13px;
    color: var(--gray-text);
    display: flex;
    gap: 12px;
    margin-top: 2px;
}

/* ===== Group cards ===== */

.group-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    margin: 8px 12px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    position: relative;
}
.group-card:active {
    transform: scale(0.98);
    opacity: 0.85;
}
.group-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: #EDE7F6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}
.group-card-body {
    flex: 1;
    min-width: 0;
}
.group-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.group-card-stats {
    font-size: 13px;
    color: var(--gray-text);
    display: flex;
    gap: 12px;
    margin-top: 2px;
}

/* ===== Plant cards ===== */

.plant-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    margin: 8px 12px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    position: relative;
}
.plant-card:active {
    transform: scale(0.98);
    opacity: 0.85;
}
.plant-card-photo {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: var(--green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    overflow: hidden;
}
.plant-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.plant-card-body {
    flex: 1;
    min-width: 0;
}
.plant-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.plant-card-latin {
    font-size: 12px;
    color: var(--gray-text);
    font-style: italic;
    margin-top: 2px;
}
.plant-card-category {
    font-size: 13px;
    color: var(--gray-text);
    margin-top: 2px;
}

/* ===== Section titles & grids ===== */

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-text);
    padding: 12px 16px 4px;
}
.locations-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 8px;
    padding-bottom: 20px;
}
.groups-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding-bottom: 8px;
}
.plants-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding-bottom: 20px;
}

/* ===== Grid mode (2 columns) ===== */

.locations-grid.grid-mode {
    grid-template-columns: 1fr 1fr;
}
.locations-grid.grid-mode .location-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    margin: 6px;
    overflow: hidden;
}
.locations-grid.grid-mode .location-card-photo {
    width: 100%;
    height: 110px;
    border-radius: 12px 12px 0 0;
}
.locations-grid.grid-mode .location-card-body {
    padding: 8px 10px 10px;
    width: 100%;
    box-sizing: border-box;
}
.locations-grid.grid-mode .location-card-name {
    font-size: 14px;
}
.locations-grid.grid-mode .location-edit-btn {
    bottom: auto;
    top: 8px;
    right: 8px;
}

.plants-grid.grid-mode {
    grid-template-columns: 1fr 1fr;
}
.plants-grid.grid-mode .plant-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    margin: 6px;
    overflow: hidden;
}
.plants-grid.grid-mode .plant-card-photo {
    width: 100%;
    height: 110px;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}
.plants-grid.grid-mode .plant-card-body {
    padding: 8px 10px 10px;
    width: 100%;
    box-sizing: border-box;
}
.plants-grid.grid-mode .plant-card-name {
    font-size: 14px;
}

/* ===== Empty state ===== */

.empty-state {
    text-align: center;
    padding: 60px 30px;
}
.empty-state-icon {
    font-size: 72px;
    margin-bottom: 16px;
}
.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}
.empty-state-text {
    color: var(--gray-text);
    font-size: 14px;
}

/* ===== Screen: Locations ===== */

#locations-list {
    padding-top: 8px;
    padding-bottom: 20px;
}

/* ===== Screen: Plants (inside location or group) ===== */

#plants-list {
    padding-top: 8px;
    padding-bottom: 20px;
}

/* ===== Screen: Detail ===== */

.detail-carousel {
    position: relative;
    width: 100%;
    height: 300px;
    background: var(--green-light);
    overflow: hidden;
}
.detail-carousel-track {
    width: 100%;
    height: 100%;
    position: relative;
}
.detail-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
}
.detail-carousel-slide.active {
    opacity: 1;
}
.detail-carousel-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
}
.detail-carousel-prev,
.detail-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.detail-carousel-prev { left: 12px; }
.detail-carousel-next { right: 12px; }
.detail-carousel-prev:active,
.detail-carousel-next:active {
    background: rgba(0,0,0,0.7);
    transform: translateY(-50%) scale(0.95);
}
.detail-carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.detail-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.2s;
}
.detail-carousel-dot.active {
    background: white;
}
.detail-content { padding: 20px; }
.detail-name { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.detail-section { margin-top: 24px; }
.detail-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.detail-section p { font-size: 15px; line-height: 1.6; }
.detail-note {
    background: #FFF8E1;
    padding: 14px;
    border-radius: 12px;
    border-left: 4px solid var(--yellow);
}
.detail-desc {
    background: var(--green-light);
    padding: 14px;
    border-radius: 12px;
    border-left: 4px solid var(--green);
}
.detail-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #fafafa;
    border-radius: 12px;
    margin: 0 12px;
}
.detail-gallery-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #ddd;
    flex-shrink: 0;
}
.detail-gallery-item.is-main {
    border-color: var(--green);
}
.detail-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}
.detail-gallery-star {
    position: absolute;
    top: 2px;
    left: 2px;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.detail-gallery-star.active {
    background: rgba(255,193,7,0.9);
}
.detail-gallery-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220,53,69,0.8);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.detail-gallery-add {
    width: 72px;
    height: 72px;
    border: 2px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 28px;
    color: #999;
    flex-shrink: 0;
}
.detail-gallery-add:active {
    background: #f0f0f0;
    transform: scale(0.95);
}
.detail-action-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 16px;
    padding-bottom: calc(12px + var(--safe-bottom));
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 100;
}
.detail-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.15s, transform 0.15s;
}
.detail-action-btn:active {
    background: var(--green-light);
    transform: scale(0.95);
}
.detail-action-btn-icon {
    font-size: 24px;
}
.detail-action-btn-label {
    font-size: 11px;
    color: var(--gray-text);
    font-weight: 500;
}

/* Photo fullscreen */
.photo-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-fullscreen-wrap {
    position: relative;
    max-width: 95%;
    max-height: 90%;
}
.photo-fullscreen-wrap img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}
.photo-fullscreen-close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: rgba(255,255,255,0.9);
    border: none;
    color: #333;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-fullscreen-close:active {
    background: white;
    transform: scale(0.95);
}

/* ===== Catalog ===== */
.catalog-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    cursor: pointer;
}
.catalog-card:active { opacity: 0.7; }
.catalog-card-name { font-size: 16px; font-weight: 600; color: var(--dark); margin-bottom: 2px; }
.catalog-card-latin { font-size: 13px; color: var(--gray-text); font-style: italic; margin-bottom: 4px; }
.catalog-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.catalog-card-life { font-size: 12px; color: var(--gray-text); padding: 2px 8px; background: var(--gray-bg); border-radius: 10px; }
.catalog-card-desc { font-size: 13px; color: var(--gray-text); line-height: 1.4; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Wiki plant card (новый дизайн) ── */
.wpc-header {
    background: var(--green);
    padding: 18px 16px 14px;
    margin: -16px -16px 0;
}
.wpc-family {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,.5);
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.wpc-name-ru {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -.2px;
}
.wpc-cultivar {
    font-size: 13px;
    color: rgba(255,255,255,.65);
    margin-top: 2px;
    font-style: italic;
}
.wpc-name-lat {
    font-size: 12px;
    color: rgba(255,255,255,.4);
    margin-top: 5px;
}
.wpc-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.wpc-tag {
    background: rgba(255,255,255,.15);
    color: rgba(255,255,255,.9);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
}

.wpc-quickfacts {
    display: grid;
    gap: 0;
    background: #f5fbf6;
    border-bottom: 1px solid #e8f0e9;
    margin: 0 -16px;
}
.wpc-quickfacts.cols-2 { grid-template-columns: 1fr 1fr; }
.wpc-quickfacts.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.wpc-quickfacts.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.wpc-fact {
    padding: 12px 8px;
    text-align: center;
    border-right: 1px solid #e8f0e9;
}
.wpc-fact:last-child { border-right: none; }
.wpc-fact-icon { font-size: 17px; margin-bottom: 2px; }
.wpc-fact-val { font-size: 12px; font-weight: 700; color: var(--green-dark); line-height: 1.2; }
.wpc-fact-label { font-size: 10px; color: var(--gray-text); margin-top: 1px; }

.wpc-desc {
    padding: 14px 0 12px;
    font-size: 14px;
    line-height: 1.65;
    color: #444;
    border-bottom: 1px solid #f0f0f0;
}

.wpc-section {
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.wpc-section:last-child { border-bottom: none; }
.wpc-section-head {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
}
.wpc-section-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.wpc-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--green-dark);
}

.wpc-params {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.wpc-param {
    background: var(--gray-bg);
    border-radius: 10px;
    padding: 8px 11px;
}
.wpc-param-label { font-size: 10px; color: var(--gray-text); margin-bottom: 2px; }
.wpc-param-val { font-size: 13px; font-weight: 600; color: var(--dark); }

.wpc-months {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 3px;
}
.wpc-month { text-align: center; }
.wpc-month-lbl { font-size: 8px; color: #bbb; margin-bottom: 3px; }
.wpc-month-bar {
    height: 28px;
    border-radius: 4px;
    background: #eeeeee;
}
.wpc-month-bar.bud     { background: #a5d6a7; }
.wpc-month-bar.bloom   { background: var(--yellow); }
.wpc-month-bar.fruit   { background: #ef9a9a; }
.wpc-month-bar.dormant { background: #eeeeee; }
.wpc-cal-legend {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.wpc-cal-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--gray-text);
}
.wpc-cal-dot {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    flex-shrink: 0;
}

.wpc-care-text {
    font-size: 13px;
    line-height: 1.65;
    color: #444;
}

.wpc-nb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.wpc-nb-box {
    border-radius: 10px;
    padding: 10px 11px;
}
.wpc-nb-box.good { background: var(--green-light); }
.wpc-nb-box.bad  { background: #ffeaea; }
.wpc-nb-title { font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.wpc-nb-title.good { color: #2d7a3d; }
.wpc-nb-title.bad  { color: #c0392b; }
.wpc-nb-item { font-size: 12px; color: var(--dark); padding: 2px 0; }

/* Note editor */
.note-btn {
    font-size: 24px;
    background: none;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    opacity: 0.5;
    min-width: 56px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.note-btn:active {
    transform: scale(0.95);
}
.note-editor-textarea {
    width: 100%;
    min-height: 200px;
    padding: 14px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.note-editor-textarea:focus {
    outline: none;
    border-color: var(--green);
}

/* Location picker label */
.location-picker-label {
    font-size: 14px;
    color: var(--gray-text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Recognition detail */
.recognition-detail {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.recognition-detail-photo {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--gray-bg);
}
.recognition-detail-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.recognition-detail-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}
.recognition-detail-latin {
    font-size: 14px;
    color: var(--gray-text);
    font-style: italic;
}
.recognition-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.recognition-detail-score {
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    background: var(--green-light);
    padding: 4px 10px;
    border-radius: 20px;
}
.recognition-detail-score.low {
    color: var(--yellow);
    background: #FFF8E1;
}
.recognition-detail-family {
    font-size: 13px;
    color: var(--gray-text);
    background: var(--gray-bg);
    padding: 4px 10px;
    border-radius: 20px;
}
.recognition-detail-desc {
    font-size: 14px;
    color: var(--dark);
    line-height: 1.6;
    background: var(--green-light);
    padding: 12px;
    border-radius: 10px;
    max-height: 180px;
    overflow-y: auto;
}
.recognition-detail-buttons {
    margin-top: 6px;
}

.photo-fullscreen-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
}
.photo-fullscreen-actions {
    display: flex;
    gap: 24px;
    flex: 1;
    justify-content: center;
}
.photo-fullscreen-action {
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-fullscreen-action:active { background: #e0e0e0; transform: scale(0.92); }
.photo-fullscreen-action-delete { background: #fff; }
.photo-fullscreen-action-delete:active { background: #e0e0e0; }
.photo-fullscreen-nav {
    background: rgba(255,255,255,0.7);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 28px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.photo-fullscreen-nav:active { background: #fff; transform: scale(0.92); }
.photo-fullscreen-close-bottom {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.85);
    border: none;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 32px;
    border-radius: 12px;
    cursor: pointer;
    min-height: 44px;
}
.photo-fullscreen-close-bottom:active { background: #fff; transform: translateX(-50%) scale(0.95); }
.photo-fullscreen-counter {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    background: rgba(0,0,0,0.4);
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ===== Modal: Plant Edit ===== */
.plant-edit-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: 8px;
}
.plant-edit-qty-group {
    width: 25%;
    flex-shrink: 0;
}
.plant-edit-actions {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
    align-items: flex-end;
}
.plant-edit-action-btn {
    font-size: 24px;
    background: none;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    opacity: 0.5;
    min-width: 52px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, transform 0.15s;
}
.plant-edit-action-btn:active {
    transform: scale(0.95);
}
.plant-edit-action-btn.active {
    opacity: 1;
    border-color: var(--green);
}

/* Sticky breadcrumbs */
#breadcrumbsBar {
    position: sticky;
    top: 60px; /* Высота header */
    background: #fff;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    gap: 12px;
}

.breadcrumbs-text {
    flex: 1;
    font-size: 13px;
    color: var(--gray-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.breadcrumbs-text span {
    cursor: pointer;
    color: var(--green);
}

.breadcrumbs-text span:last-child {
    color: var(--dark);
    cursor: default;
}

.view-toggle-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.view-toggle-btn:active {
    background: var(--green-light);
    border-color: var(--green);
    transform: scale(0.95);
}

/* ===== Burger Menu ===== */
.burger-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 199; display: none; }
.burger-overlay.active { display: block; }
.burger-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    z-index: 200;
    transition: right 0.3s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 40px;
}
.burger-menu.active { right: 0; }
.burger-header { background: var(--green); color: white; padding: 20px; }
.burger-header h2 { font-size: 18px; font-weight: 700; margin: 0 0 4px 0; }
.burger-header p { font-size: 12px; opacity: 0.85; margin: 0; }
.burger-content { padding: 8px 0; }
.burger-item { padding: 14px 20px; border-bottom: 1px solid #f0f0f0; cursor: pointer; display: flex; align-items: center; gap: 14px; }
.burger-item:active { background: #f5f5f5; }
.burger-item-icon { font-size: 22px; width: 28px; text-align: center; flex-shrink: 0; }
.burger-item-text { flex: 1; }
.burger-item-title { font-weight: 500; font-size: 15px; color: var(--dark); }
.burger-sep { border: none; border-top: 2px solid #eee; margin: 4px 0; }

/* ===== FAB Menu ===== */
.fab-menu {
    position: fixed;
    bottom: calc(100px + var(--safe-bottom));
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 91;
}
.fab-menu-item {
    background: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s;
}
.fab-menu-item:active {
    transform: scale(0.95);
}

/* ===== Detail Action Bar ===== */

.detail-action-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 16px;
    padding-bottom: calc(12px + var(--safe-bottom));
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 100;
}
.detail-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.15s, transform 0.15s;
}
.detail-action-btn:active {
    background: var(--green-light);
    transform: scale(0.95);
}
.detail-action-btn-icon {
    font-size: 24px;
}
.detail-action-btn-label {
    font-size: 11px;
    color: var(--gray-text);
    font-weight: 500;
}

/* ===== Photo Fullscreen ===== */

.photo-fullscreen-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-fullscreen-wrap {
    position: relative;
    max-width: 95%;
    max-height: 90%;
}
.photo-fullscreen-wrap img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}
.photo-fullscreen-close {
    position: absolute;
    top: -12px; right: -12px;
    background: rgba(255,255,255,0.9);
    border: none; color: #333;
    font-size: 20px;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.photo-fullscreen-close:active {
    background: white;
    transform: scale(0.95);
}
.photo-fullscreen-close-bottom {
    position: absolute;
    bottom: -50px; left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 10px 30px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}
.photo-fullscreen-controls {
    position: absolute;
    bottom: 20px; left: 0; right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.photo-fullscreen-nav {
    background: rgba(255,255,255,0.2);
    border: none; color: white;
    width: 44px; height: 44px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.photo-fullscreen-nav:active {
    background: rgba(255,255,255,0.4);
}
.photo-fullscreen-counter {
    position: absolute;
    bottom: -30px; left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 12px;
}
.photo-fullscreen-top-actions {
    position: absolute;
    top: 10px; left: 10px;
    display: flex; gap: 8px;
}
.photo-fullscreen-action {
    background: rgba(0,0,0,0.5);
    border: none; color: white;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.photo-fullscreen-action-delete {
    background: rgba(220,53,69,0.8);
}
.photo-fullscreen-actions {
    flex: 1;
}

/* ===== Cadastre map modal ===== */

.modal-cadastre-fullscreen.active {
    align-items: stretch;
    padding: 0;
}
.cadastre-modal-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    background: #fff;
    overflow: hidden;
    padding-top: env(safe-area-inset-top);
    box-sizing: border-box;
}
.cadastre-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px 8px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    min-height: 48px;
}
.cadastre-modal-header .modal-title {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
}
#cadastre-map-container { flex: 1; min-height: 0; z-index: 1; }
/* ── Layer tabs ── */
.plot-layer-tabs {
    display: flex;
    gap: 5px;
    padding: 6px 10px;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.plot-layer-tabs::-webkit-scrollbar { display: none; }
.plot-layer-tab {
    flex-shrink: 0;
    padding: 5px 13px;
    border-radius: 14px;
    border: 1px solid #bbb;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    color: #333;
}
.plot-layer-tab.active {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
    font-weight: 600;
}
.plot-layer-add {
    flex-shrink: 0;
    padding: 5px 11px;
    border-radius: 14px;
    border: 1px dashed #888;
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    color: #555;
    white-space: nowrap;
}
/* ── Plot Map ── */
.plot-canvas-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #d8d8d8;
    min-height: 0;
}
.plot-map-div {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}
#plot-canvas {
    display: block;
    touch-action: none;
    position: absolute;
    top: 0; left: 0;
    z-index: 2;
}
.plot-empty-hint {
    position: absolute;
    top: 50%; left: 50%;
    z-index: 3;
    transform: translate(-50%, -50%);
    color: #888; font-size: 14px;
    text-align: center; line-height: 1.6;
    pointer-events: none;
}
.plot-toolbar {
    display: flex;
    gap: 5px;
    padding: 7px 10px;
    padding-bottom: max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}
.plot-tool-btn {
    flex: 1;
    height: 42px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #f5f5f5;
    font-size: 18px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    padding: 0;
}
.plot-tool-btn.active { border-color: var(--green); background: var(--green-light); }
.plot-save-btn { background: var(--green); border-color: var(--green); }
.plot-undo-btn {
    flex: 1;
    height: 42px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #f5f5f5;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
}
.plot-undo-btn:active { background: #e0e0e0; }
.plot-tool-panel {
    flex-shrink: 0;
    padding: 7px 12px 8px;
    background: #fafafa;
    border-top: 1px solid #eee;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 26vh;
}
.plot-hint { font-size: 13px; color: #666; line-height: 1.4; }
.plot-types {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
    margin-bottom: 6px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
}
.plot-type-btn {
    flex-shrink: 0;
    padding: 4px 11px;
    border-radius: 14px;
    border: 2px solid var(--oc, #888);
    background: transparent;
    font-size: 12px; color: var(--oc, #888);
    cursor: pointer; white-space: nowrap;
}
.plot-type-btn.active { background: var(--oc, #888); color: #fff; }
.plot-finish-btn { margin-top: 4px; }
.plot-obj-list { display: flex; flex-direction: column; gap: 3px; }
.plot-obj-row {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; padding: 2px 0;
}
.plot-obj-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.plot-obj-name { flex: 1; }
.plot-obj-area { color: var(--gray-text); font-size: 12px; white-space: nowrap; }
.plot-del-btn {
    background: none; border: none;
    color: #e53935; font-size: 18px;
    cursor: pointer; padding: 0 2px;
    line-height: 1; flex-shrink: 0;
}
.plot-anchor-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; align-items: center; }
.plot-anchor-chip {
    background: var(--green-light); border: 1px solid var(--green);
    border-radius: 6px; padding: 2px 8px; font-size: 12px;
    font-weight: 600; color: var(--dark);
}
.plot-total { font-size: 13px; font-weight: 600; margin-top: 5px; color: #2E7D32; }
.calib-wrap { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-height: 130px; overflow-y: auto; }
.calib-row { display: flex; align-items: center; gap: 8px; }
.calib-row.calib-derived { opacity: 0.65; }
.calib-lbl { font-size: 13px; min-width: 44px; font-weight: 600; }
.calib-derived-val { font-size: 13px; color: #2E7D32; font-style: italic; }
.calib-inp { width: 80px; padding: 4px 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }

/* ── Plan Work (workplan) ─────────────────────────────────────────────────── */
.wp-strip {
    display: flex; align-items: center; gap: 10px;
    background: var(--green-light); border: 1px solid var(--green);
    border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
    cursor: pointer; user-select: none;
}
.wp-strip:active { opacity: 0.75; }
.wp-strip-icon { font-size: 20px; }
.wp-strip-label { flex: 1; font-weight: 600; font-size: 15px; color: var(--dark); }
.wp-strip-arrow { color: var(--green); font-size: 18px; font-weight: 700; }

.wp-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0 8px; margin-bottom: 4px;
}
.wp-month-title { font-size: 17px; font-weight: 700; color: var(--dark); }
.wp-month-btn {
    background: none; border: 1px solid #ddd; border-radius: 8px;
    font-size: 20px; padding: 2px 12px; cursor: pointer; color: var(--dark);
}
.wp-month-btn:active { background: #f0f0f0; }

.wp-loading, .wp-empty { text-align: center; padding: 40px 20px; color: var(--gray-text); }
.wp-empty-icon { font-size: 40px; margin-bottom: 12px; }
.wp-empty-text { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--dark); }
.wp-empty-hint { font-size: 13px; color: var(--gray-text); margin-bottom: 20px; }

.wp-section-title {
    font-size: 13px; font-weight: 700; color: var(--gray-text);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin: 14px 0 6px;
}
.wp-section-done    { color: #388E3C; }
.wp-section-skipped { color: #999; }

.wp-item {
    display: flex; align-items: flex-start; gap: 10px;
    background: #fff; border: 1px solid #e8e8e8; border-radius: 10px;
    padding: 12px; margin-bottom: 8px;
}
.wp-item-done    { opacity: 0.6; }
.wp-item-skipped { opacity: 0.45; }
.wp-item-check { font-size: 22px; cursor: pointer; flex-shrink: 0; line-height: 1; margin-top: 1px; }
.wp-item-body { flex: 1; min-width: 0; }
.wp-item-title { font-size: 15px; font-weight: 600; color: var(--dark); margin-bottom: 2px; }
.wp-item-plant { font-size: 12px; color: var(--green); margin-bottom: 3px; }
.wp-item-meta  { font-size: 12px; color: var(--gray-text); margin-bottom: 3px; }
.wp-item-desc  { font-size: 13px; color: #555; margin-top: 4px; }
.wp-item-del {
    background: none; border: none; color: #bbb;
    font-size: 16px; cursor: pointer; flex-shrink: 0; padding: 0 2px;
}
.wp-item-del:active { color: #e53935; }

.wp-add-btn {
    display: block; width: 100%; margin-top: 16px;
    padding: 12px; border: 2px dashed #ccc; border-radius: 10px;
    background: none; color: var(--gray-text); font-size: 15px; cursor: pointer;
}
.wp-add-btn:active { background: #f5f5f5; }
.wp-add-btn-bottom { margin-top: 20px; }

/* ── Wiki: ваши экземпляры ── */
.wiki-my-instances {
    margin: 14px 0 4px;
    background: var(--green-light);
    border-radius: 12px;
    padding: 12px 14px;
}
.wiki-my-instances-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 8px;
}
.wiki-my-instance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(74,124,89,.12);
    gap: 8px;
}
.wiki-my-instance-row:last-child { border-bottom: none; }
.wiki-my-instance-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
}
.wiki-my-instance-loc {
    font-size: 12px;
    color: var(--green-dark);
    flex-shrink: 0;
}
