:root {
    --bg: #f2f3f1;
    --paper: #fff;
    --ink: #25302b;
    --muted: #68736d;
    --line: #c9cfca;
    --green: #315b45;
    --green-dark: #284b38;
    --green-light: #e8eee8;
    --edit-bg: #f8eeee;
    --edit-line: #d9bdbd;
    --red: #9c4444;
    --amber: #756348;
    --shadow: 2px 2px 0 var(--green-dark);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 17px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 3px solid #78927f;
    outline-offset: 2px;
}

a { color: var(--green); text-decoration: none; font-weight: 650; }
a:hover { text-decoration: underline; }
code {
    background: var(--green-light);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid var(--line);
}

/* ===== Topbar ===== */
.topbar {
    height: 70px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-inner {
    max-width: 1100px;
    height: 100%;
    margin: auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.brand {
    font-weight: 850;
    font-size: 30px;
    letter-spacing: -1.2px;
    color: var(--ink);
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 4px 11px 4px 5px;
    background: white;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
}
.avatar-mini {
    width: 38px;
    height: 38px;
    border: 1px solid #435248;
    border-radius: 8px;
    background: var(--green-light);
    object-fit: cover;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--green);
    font-size: 16px;
    flex-shrink: 0;
}
.badge {
    padding: 2px 8px;
    border: 1px solid var(--green);
    border-radius: 6px;
    background: var(--green-light);
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ===== Container ===== */
.container {
    max-width: 1100px;
    margin: auto;
    padding: 22px 20px 80px;
}

h1 { font-size: 34px; line-height: 1.12; letter-spacing: -.8px; margin: 0 0 14px; }
h2 { font-size: 23px; letter-spacing: -.3px; margin: 0 0 14px; }
h3 { font-size: 20px; margin: 0 0 14px; }
.muted { color: var(--muted); font-size: 15px; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 46px;
    padding: 6px 15px;
    border: 2px solid var(--green-dark);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
    box-shadow: var(--shadow);
    transition: transform .05s, box-shadow .05s;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--green-dark); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--green-dark); }

.btn-primary { background: var(--green); color: white; border-color: var(--green-dark); }
.btn-primary:hover { background: #284b38; }

.btn-secondary { background: white; border-color: var(--green-dark); color: var(--ink); }

.btn-ghost {
    background: transparent;
    border: 1px solid #aeb8b0;
    box-shadow: none;
    font-weight: 700;
}
.btn-ghost:hover { box-shadow: none; background: var(--green-light); }

.btn-danger {
    background: white;
    border-color: var(--red);
    color: var(--red);
    box-shadow: 2px 2px 0 #6e2f2f;
}
.btn-danger:hover { box-shadow: 1px 1px 0 #6e2f2f; }
.btn-danger:active { box-shadow: 0 0 0 #6e2f2f; }

.btn.disabled { opacity: 0.5; pointer-events: none; }

/* ===== Back button ===== */
.back {
    display: inline-block;
    min-height: 49px;
    padding: 6px 15px;
    border: 2px solid #343f38;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
    box-shadow: 2px 2px 0 #343f38;
    margin-bottom: 0px;
    text-decoration: none;
    transition: transform .05s, box-shadow .05s;
}
.back:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #343f38; text-decoration: none; }
.back:active { transform: translate(2px, 2px); box-shadow: 0 0 0 #343f38; }

/* ===== Panels ===== */
.panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 22px;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}
.panel-header h2 { margin: 0; }

/* ===== Stats ===== */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
}
.stat-value {
    font-size: 40px;
    font-weight: 850;
    letter-spacing: -1px;
    color: var(--green);
    line-height: 1;
    margin-bottom: 8px;
}
.stat-label { color: var(--muted); font-size: 15px; font-weight: 650; }

/* ===== Table ===== */
.table-wrap {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.table th {
    background: var(--green-light);
    font-weight: 750;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--green);
    letter-spacing: 0.3px;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f7f9f6; }
.actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Forms ===== */
.form {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 26px;
}
.form label {
    display: block;
    margin-bottom: 18px;
    color: var(--green);
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 750;
    letter-spacing: 0.3px;
}
.form input[type="text"],
.form input[type="password"],
.form select,
.form input[type="file"] {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 11px 13px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
}
.form input:focus, .form select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(49, 91, 69, 0.15);
}
.form-wide { max-width: 760px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.checkbox {
    display: flex !important;
    align-items: center;
    gap: 10px;
    text-transform: none !important;
    font-size: 15px !important;
    color: var(--ink) !important;
    font-weight: 650 !important;
    padding: 10px 0;
}
.checkbox input { margin: 0; width: 20px; height: 20px; accent-color: var(--green); }

/* ===== Login ===== */
.login-card {
    max-width: 420px;
    margin: 80px auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: 3px 3px 0 var(--green-dark);
}
.login-card h1 { font-size: 32px; letter-spacing: -1.2px; margin: 0 0 8px; }
.login-card .muted { margin-bottom: 28px; }
.login-card .btn-primary { width: 100%; min-height: 52px; font-size: 16px; margin-top: 6px; }

/* ===== Flash ===== */
.flash-list { margin-bottom: 18px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 10px; font-weight: 650; border: 1px solid; }
.flash-error { background: #f8eeee; border-color: var(--edit-line); color: var(--red); }
.flash-success { background: var(--green-light); border-color: #b7c4ba; color: var(--green); }

/* ===== Status ===== */
.status-on {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #b7c4ba;
    border-radius: 6px;
    background: var(--green-light);
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
}
.status-off {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #d1c7b8;
    border-radius: 6px;
    background: #f2eee7;
    color: var(--amber);
    font-size: 12px;
    font-weight: 700;
}

/* ===== Stages list ===== */
.stages-list { list-style: none; padding: 0; margin: 0; }
.stages-list li {
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}
.stages-list li:last-child { margin-bottom: 0; }
.stage-num {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid #b7c4ba;
    border-radius: 9px;
    background: var(--green-light);
    color: var(--green);
    font-weight: 800;
    font-size: 15px;
}

/* ===== Stage chips ===== */
.stage-chip {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px 4px 2px 0;
    border: 1px solid #b7c4ba;
    border-radius: 6px;
    background: var(--green-light);
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
}

/* ===== Checkboxes stages ===== */
.stages-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.checkbox-card { display: block; cursor: pointer; }
.checkbox-card input[type="checkbox"] { display: none; }
.checkbox-card-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: all .15s;
}
.checkbox-card:hover .checkbox-card-body { border-color: var(--green); background: var(--green-light); }
.checkbox-card input:checked + .checkbox-card-body {
    border-color: var(--green);
    background: var(--green-light);
    box-shadow: 0 0 0 2px rgba(49, 91, 69, 0.15);
}
.checkbox-card-num {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid #b7c4ba;
    border-radius: 8px;
    background: white;
    color: var(--green);
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.checkbox-card input:checked + .checkbox-card-body .checkbox-card-num {
    background: var(--green);
    color: white;
    border-color: var(--green);
}
.checkbox-card-text { min-width: 0; flex: 1; }
.checkbox-card-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.checkbox-card-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Avatar preview ===== */
.avatar-preview { margin-top: 10px; }
.avatar-preview img {
    width: 80px;
    height: 80px;
    border: 1px solid #435248;
    border-radius: 8px;
    object-fit: cover;
}

/* ===== Error box ===== */
.error-box {
    text-align: center;
    padding: 60px 24px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.error-box h2 { font-size: 30px; margin-bottom: 10px; }

/* ===== Empty ===== */
.empty {
    padding: 22px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}

/* ===== Products grid ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.product-card {
    display: block;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--ink);
    transition: transform .1s, box-shadow .1s;
}
.product-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0 var(--green-dark);
    text-decoration: none;
}
.product-thumb {
    width: 100%;
    height: 160px;
    background: var(--green-light);
    display: grid;
    place-items: center;
    overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: contain; }
.no-photo { color: var(--muted); font-size: 14px; }
.product-info { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.product-info strong { font-size: 16px; font-weight: 700; }

/* ===== Tech card view ===== */
.article-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin: 8px 0 20px;
    flex-wrap: wrap;
}
.article-head .label { margin: 0; color: var(--muted); font-size: 15px; }
.article-head h1 { font-size: 40px; margin: 0; }
.last-editor {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
    min-height: 40px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 12px;
}
.last-editor strong { color: #37453b; }

.gallery {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    min-height: 220px;
    margin: 2px 0 18px;
    padding: 12px;
    background: #e9eee8;
    border: 1px solid #c3cbc4;
    border-radius: 14px;
}
.gallery figure {
    flex: 1;
    min-width: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.gallery.single figure { flex: 0 1 75%; }
.gallery img { width: 100%; height: 183px; object-fit: contain; }
.gallery figcaption { font-size: 13px; color: #68756d; margin-top: 4px; }

.tabs {
    display: flex;
    overflow-x: auto;
    gap: 0;
    border-bottom: 1px solid #aeb8b0;
    margin: 8px 0 22px;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 1 0 auto;
    min-height: 47px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    background: #e9ede9;
    color: #68766c;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid;
}
.tab:hover { background: #dde3dc; text-decoration: none; }
.tab.locked { opacity: 0.6; cursor: not-allowed; }
.tab.locked::after { content: ' 🔒'; font-size: 12px; }

.stage-section { margin-bottom: 24px; }
.stage-section h3 { color: var(--green); margin-bottom: 12px; }
.step {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    margin: 0 0 12px;
    padding: 15px 13px;
    background: #fff;
    border: 1px solid #c8ceca;
    border-radius: 12px;
}
.step .num {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border: 1px solid #b7c4ba;
    border-radius: 9px;
    background: #eaf0eb;
    color: #315b45;
    font-size: 16px;
    font-weight: 750;
}
.step-text { flex: 1; min-width: 0; white-space: wrap; overflow-wrap: anywhere; padding-top: 3px; }
.notes-block {
    margin-top: 12px;
    padding: 12px;
    background: #f2eee7;
    border-radius: 8px;
    font-size: 14px;
}

/* ===== Edit mode ===== */
.screen-edit {
    background-color: transparent;
    padding: 20px;
    border-radius: 12px;
}
.edit-heading { font-size: 31px; margin-bottom: 8px; color: var(--ink); }
.notice {
    padding: 11px 13px;
    border: 1px solid #e2ceb0;
    border-radius: 10px;
    background: #fff2de;
    font-size: 14px;
    margin: 13px 0 17px;
}
.subhead { font-size: 20px; margin: 18px 0 7px; color: var(--ink); }
.edit-box {
    padding: 13px;
    background: #white;
    border: 1px solid lightgray;
    border-radius: 12px;
    margin: 12px 0;
}
.edit-row { display: flex; align-items: center; gap: 7px; }
.edit-row .num { width: 32px; height: 32px; flex-basis: 32px; }
.edit-row b { flex: 1; }
.icon-btn {
    min-width: 39px;
    min-height: 39px;
    border: 1px solid #c4b0b0;
    border-radius: 8px;
    background: #fff;
    font-size: 18px;
    cursor: pointer;
}
.icon-btn.red { color: #9c4444; }
.icon-btn:hover { background: #f8eeee; }
.textarea {
    width: 100%;
    min-height: 100px;
    margin-top: 10px;
    padding: 12px;
    border: 2px solid #aa9999;
    border-radius: 9px;
    resize: vertical;
    font-size: 17px;
    line-height: 1.5;
    background: #fff;
    outline: none;
    font-family: inherit;
}
.textarea:focus { border-color: #925e5e; box-shadow: 0 0 0 3px rgba(146, 94, 94, 0.1); }

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-content {
    background: white;
    border-radius: 14px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.history-list { max-height: 500px; overflow-y: auto; }
.history-entry {
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9f7;
    border-radius: 8px;
    border-left: 3px solid var(--green);
}
.history-entry header { font-weight: 700; margin-bottom: 4px; }
.history-entry small { color: var(--muted); font-size: 12px; }
.history-entry p { margin-top: 6px; font-size: 14px; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .brand { font-size: 22px; }
    .form-row { grid-template-columns: 1fr; }
    .user-chip span:not(.avatar-mini):not(.badge) { display: none; }
}

/* ===== Главная — список тех-карт ===== */
.search {
    display: flex;
    align-items: center;
    min-height: 64px;
    border: 2px solid #46544b;
    border-radius: 13px;
    background: #fff;
    padding-left: 13px;
    margin: 12px 0 15px;
}
.search .magnify { font-size: 25px; }
.search input {
    flex: 1;
    min-width: 0;
    padding: 13px 10px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 22px;
    font-weight: 650;
}
.search input::placeholder { color: #7e8881; }
.search button { min-width: 48px; font-size: 27px; font-weight: 600; }

.filters { display: flex; gap: 9px; margin-bottom: 22px; }
.filter {
    min-height: 46px;
    padding: 6px 15px;
    border: 1px solid #aeb8b0;
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.filter:hover { background: var(--green-light); text-decoration: none; }
.filter.active { background: var(--green); color: white; border-color: var(--green); }

/* ===== Значок тревоги (проблемный артикул) ===== */
.alarm-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 21px;
    line-height: 1;
    color: #b23b3b;
    vertical-align: middle;
    filter: drop-shadow(0 0 3px rgba(178, 59, 59, .35));
}
.filter-problem { color: #8c3333; border-color: #d9b6b6; }
.filter-problem:hover { background: #f7ecec; }
.filter-problem.active {
    background: #b23b3b;
    border-color: #8c3333;
    color: white;
}
.filter-count {
    display: inline-block;
    min-width: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 10px;
    background: #b23b3b;
    color: white;
    font-size: 12px;
    font-weight: 750;
    line-height: 20px;
    text-align: center;
}
.filter-problem.active .filter-count { background: rgba(255, 255, 255, .25); }
.status.chat-status { color: var(--muted); }
.badge.chat-badge-mod {
    border-color: #b23b3b;
    background: #f7ecec;
    color: #8c3333;
}

.count { color: var(--muted); font-size: 15px; margin-bottom: 9px; }

.item {
    width: 100%;
    min-height: 100px;
    margin: 0 0 14px;
    padding: 9px;
    display: flex;
    align-items: center;
    gap: 13px;
    text-align: left;
    background: #fff;
    border: 1px solid #c5cbc6;
    border-radius: 14px;
    text-decoration: none;
    color: var(--ink);
    transition: transform .05s, box-shadow .05s;
}
.item:hover {
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 var(--green-dark);
    text-decoration: none;
}
.thumb {
    width: 80px;
    height: 80px;
    flex: 0 0 80px;
    background: #f0f2ee;
    border: 1px solid #c8cec9;
    border-radius: 10px;
    overflow: hidden;
    display: grid;
    place-items: center;
}
.item-info { min-width: 0; flex: 1; }
.item strong { font-size: 23px; letter-spacing: .2px; display: block; margin-bottom: 4px; display: flex;
    align-items: center;}
.status {
    display: table;
    margin-top: 5px;
    padding: 2px 8px;
    border: 1px solid #b8c6ba;
    border-radius: 6px;
    background: #eef3ed;
    color: #43594a;
    font-size: 12px;
    font-weight: 650;
    
}
.status.empty { background: #f2eee7; border-color: #d1c7b8; color: #756348; }
.arrow { font-size: 27px; font-weight: 700; padding: 0 4px; color: var(--muted); }

/* ===== Dock (нижняя панель) ===== */
.dock {
    position: fixed;
    z-index: 8;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 11px 18px calc(11px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #c8ceca;
}
.dock > div {
    max-width: 720px;
    margin: auto;
    display: flex;
    gap: 10px;
}
.primary, .secondary {
    min-height: 55px;
    padding: 10px 16px;
    border: 1px solid #284b38;
    border-radius: 11px;
    font-size: 17px;
    font-weight: 750;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: inherit;
}
.primary {
    flex: 1;
    background: var(--green);
    color: #fff;
    box-shadow: 2px 2px 0 var(--green-dark);
}
.primary:hover { background: #284b38; text-decoration: none; }
.secondary {
    background: #fff;
    color: var(--ink);
    border-color: #aeb8b0;
}
.secondary:hover { background: var(--green-light); text-decoration: none; }

/* ===== History button ===== */
.history-btn {
    min-height: 44px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #9eafa3;
    border-radius: 10px;
    color: var(--green);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.history-btn:hover { background: var(--green-light); text-decoration: none; }

/* ===== Edit mode — режим редактирования ===== */
.screen-edit {
    background-color: transparent;
    padding: 22px;
    border-radius: 14px;
    margin-bottom: 90px;
}
.edit-heading {
    font-size: 31px;
    margin-bottom: 8px;
    color: var(--ink);
}
.stage-edit-block {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #d9bdbd;
}
.stage-edit-block:last-child { border-bottom: 0; }
.stage-edit-block.locked { opacity: 0.7; }

.step-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    background: white;
}
.step-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(49, 91, 69, 0.15);
}

.add-step {
    width: 100%;
    min-height: 50px;
    border: 1px dashed #d9d1bd;
    border-radius: 10px;
    background: #fff2de;
    color: #624747;
    font-weight: 700;
    font-size: 15px;
    margin: 5px 0 20px;
    cursor: pointer;
}
.add-step:hover { background: #ffedd3; }

/* ===== Responsive ===== */
@media (max-width: 500px) {
    .search { min-height: 61px; }
    .search input { font-size: 20px; }
    .filters { gap: 7px; }
    .filter { flex: 1; min-height: 44px; padding: 5px 6px; font-size: 13px; white-space: nowrap; }
    .item { min-height: 101px; }
    .thumb { width: 79px; height: 79px; flex-basis: 79px; }
    .item strong { font-size: 22px; }
    .gallery { min-height: 190px; padding: 8px; gap: 8px; }
    .gallery img { height: 158px; }
    .primary { font-size: 16px; }
}


.step .step-photo-preview {
    display: block;
    max-width: 100%;
    max-height: 240px;
    margin: 12px 0 0;
    border: 1px solid #c9cfca;
    border-radius: 9px;
}

/* ===== Табы ===== */
.tab {
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: 0;
    background: #e9ede9;
    color: #68766c;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    min-height: 47px;
    padding: 8px 12px;
    border-radius: 9px 9px 0 0;
    transition: all 0.15s;
}

.tab:hover:not(.locked) {
    background: #dde3dc;
}

/* АКТИВНЫЙ ТАБ - ЯРКАЯ ПОДСВЕТКА */
.tab.active {
    background: #dde3dc;
    border: 1px solid #aeb8b0 ;
    border-bottom: 1px solid #ffffff ; /* Сливаем с белым фоном контента */
    color: var(--green) ;
    font-weight: 800 ;
    position: relative;
    top: 1px; /* Перекрывает линию границы контейнера */
    z-index: 2;
}

.tab.locked {
    opacity: 0.5;
    cursor: not-allowed;
}
.tab.locked::after {
    content: ' 🔒';
    font-size: 12px;
}

.edit-row .num {
        display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    background: #eaf0eb;
    border-radius: 5px;
    color: #315b45;
    border: 1px solid #b7c4ba;
}

/* .stage-edit-section.active {
    background: #fffbf4;
    padding-top: 20px;
    padding: 20px;
    border: 1px solid lightgray;
}
.tabs {
    border-bottom: none;
    margin: 8px 0 0px;
}
.tab.active {
    background: #fffbf4;
    border: 1px solid #aeb8b0 !important;
    border-bottom: 1px solid #ffffff !important;
    color: black;
    font-weight: 800 !important;
    position: relative;
    top: 1px;
    z-index: 2;
} */



/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */

/* Планшеты и большие мобильные (до 768px) */
@media (max-width: 768px) {
    .container {
        padding: 16px 12px 80px;
    }
    
    .topbar {
        height: 60px;
    }
    
    .topbar-inner {
        padding: 0 12px;
    }
    
    .brand {
        font-size: 22px;
    }
    
    .user-chip {
        gap: 6px;
        padding: 4px 8px 4px 4px;
        font-size: 13px;
    }
    
    .avatar-mini {
        width: 32px;
        height: 32px;
    }
    
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    /* Карточки товаров — крупнее */
    .item {
        padding: 12px;
        gap: 12px;
        min-height: 110px;
    }
    
    .thumb {
        width: 90px;
        height: 90px;
        flex: 0 0 90px;
    }
    
    .item strong {
        font-size: 20px;
    }
    
    .status {
        font-size: 13px;
    }
    
    /* Поиск */
    .search {
        min-height: 56px;
        padding-left: 10px;
    }
    
    .search input {
        font-size: 18px;
        padding: 10px 8px;
    }
    
    .search .magnify {
        font-size: 22px;
    }
    
    /* Фильтры */
    .filters {
        gap: 6px;
        margin-bottom: 16px;
    }
    
    .filter {
        min-height: 44px;
        padding: 6px 12px;
        font-size: 14px;
        justify-content: center;
    }
    
    /* Табы */
    .tabs {
        margin: 8px 0 16px;
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 10px;
        padding: 0px 0px 20px;
    }
    
    .tab {
        min-height: 44px;
        padding: 8px 10px;
        font-size: 14px;
        border-radius: 10px;
        border: 1px solid #aeb8b0;
        background: var(--bg);
    }
    .tab.active {
        border-bottom: none;
        border: 1px solid #aeb8b0;
        
    }
    
    /* Галерея */
    .gallery {
        min-height: 180px;
        padding: 8px;
        gap: 8px;
    }
    
    .gallery img {
        height: 160px;
    }
    
    /* Этапы */
    .step {
        padding: 12px 10px;
        gap: 10px;
    }
    
    .step .num {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        font-size: 14px;
    }
    
    .step-text {
        font-size: 15px;
    }
    
    /* Dock-панель */
    .dock {
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    }
    
    .dock > div {
        gap: 8px;
    }
    
    .primary, .secondary {
        min-height: 52px;
        font-size: 16px;
        padding: 10px 14px;
    }
    
    /* Кнопки назад */
    .back {
        min-height: 44px;
        padding: 6px 12px;
        font-size: 16px;
        margin-bottom: 0px;
    }
    
    /* Формы */
    .form {
        padding: 20px 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form label {
        margin-bottom: 14px;
        font-size: 12px;
    }
    
    .form input[type="text"],
    .form input[type="password"],
    .form select,
    .form input[type="file"] {
        padding: 12px;
        font-size: 16px; /* Важно для iOS — чтобы не зумило */
    }
    
    /* Таблицы — скрываем неважные колонки */
    .table th:nth-child(4),
    .table td:nth-child(4) {
        display: none;
    }
    
    .table th, .table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .actions-cell {
        flex-direction: column;
        gap: 6px;
    }
    
    .actions-cell .btn {
        min-height: 36px;
        padding: 4px 10px;
        font-size: 12px;
    }
    
    /* Модалки */
    .modal-content {
        padding: 20px 16px;
        max-height: 90vh;
    }
    
    .history-entry {
        padding: 10px;
    }
    
    /* Статистика */
    .grid-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 32px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    /* Панели */
    .panel {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .panel-header .btn {
        width: 100%;
    }
}

/* Маленькие мобильные (до 480px) */
@media (max-width: 480px) {
    .container {
        padding: 12px 10px 70px;
    }
    
    .topbar {
        height: 56px;
    }
    
    .brand {
        font-size: 20px;
        letter-spacing: -0.5px;
    }
    
    .user-chip span:not(.avatar-mini):not(.badge) {
        display: none; /* Скрываем имя, оставляем только аватар */
    }
    
    .user-chip {
        padding: 4px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    /* Карточки товаров */
    .item {
        padding: 10px;
        gap: 10px;
        min-height: 100px;
    }
    
    .thumb {
        width: 80px;
        height: 80px;
        flex: 0 0 80px;
    }
    
    .item strong {
        font-size: 18px;
    }
    
    .item-info {
        font-size: 14px;
    }
    
    /* Поиск */
    .search {
        min-height: 50px;
    }
    
    .search input {
        font-size: 16px;
    }
    
    /* Фильтры */
    .filters {
        flex-wrap: wrap;
    }
    
    .filter {
        flex: 1 1 auto;
        min-height: 40px;
        font-size: 13px;
        padding: 6px 10px;
    }
    
    /* Табы */
    .tab {
        min-height: 40px;
        padding: 6px 8px;
        font-size: 13px;
    }
    
    /* Галерея */
    .gallery {
        min-height: 150px;
    }
    
    .gallery img {
        height: 140px;
    }
    
    .gallery.single img {
        height: 180px;
    }
    
    /* Этапы */
    .step {
        padding: 10px 8px;
        gap: 8px;
    }
    
    .step .num {
        width: 28px;
        height: 28px;
        flex: 0 0 28px;
        font-size: 13px;
    }
    
    .step-text {
        font-size: 14px;
    }
    
    /* Dock */
    .dock {
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    }
    
    .primary, .secondary {
        min-height: 48px;
        font-size: 15px;
    }
    
    /* Кнопка назад */
    .back {
        min-height: 40px;
        font-size: 15px;
    }
    
    /* Формы */
    .form {
        padding: 16px 12px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Таблицы */
    .table th:nth-child(3),
    .table td:nth-child(3),
    .table th:nth-child(5),
    .table td:nth-child(5) {
        display: none; /* Скрываем "Имя" и "Статус" на очень маленьких */
    }
    
    .table th, .table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    /* Статистика */
    .grid-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    /* Модалки */
    .modal-content {
        padding: 16px 12px;
        width: 95%;
    }
    
    /* Чекбоксы этапов */
    .stages-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .checkbox-card-body {
        padding: 10px 12px;
    }
    
    .checkbox-card-num {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    
    .checkbox-card-name {
        font-size: 14px;
    }
}

/* Очень маленькие экраны (до 360px) */
@media (max-width: 360px) {
    .brand {
        font-size: 18px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    .item strong {
        font-size: 16px;
    }
    
    .thumb {
        width: 70px;
        height: 70px;
        flex: 0 0 70px;
    }
    
    .tab {
        font-size: 12px;
        padding: 6px 6px;
    }
    
    .step .num {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    
    .step-text {
        font-size: 13px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .topbar {
        height: 50px;
    }
    
    .container {
        padding-top: 10px;
    }
    
    .gallery {
        min-height: 120px;
    }
    
    .gallery img {
        height: 120px;
    }
    
    .dock {
        padding: 6px 10px;
    }
    
    .primary, .secondary {
        min-height: 44px;
    }
}

/* Тач-устройства — увеличиваем зоны нажатия */
@media (hover: none) and (pointer: coarse) {
    .btn, .back, .filter, .tab {
        min-height: 44px; /* Apple HIG рекомендует минимум 44px */
    }
    
    .icon-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .actions-cell .btn {
        min-height: 40px;
    }
}

/* Улучшения для iOS safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .dock {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
    
    .container {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* ===== Комментарии ===== */
.comments-section {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}
.comments-section h3 {
    margin: 0 0 16px;
    color: var(--green);
    font-size: 18px;
}
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}
.comment-card {
    position: relative;
    padding: 12px 14px;
    background: #f8f9f7;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
}
.comment-author strong {
    font-size: 14px;
    color: var(--ink);
}
.comment-time {
    font-size: 12px;
    color: var(--muted);
}
.comment-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    white-space: pre-wrap;
    word-break: break-word;
}
.comment-delete {
    position: absolute;
    top: 10px;
    right: 10px;
}
.comment-form {
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

/* ===== Упрощённая история ===== */
.history-entry {
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9f7;
    border-radius: 8px;
    border-left: 3px solid var(--green);
}
.history-entry strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}
.history-entry small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}
.history-entry p {
    margin: 0;
    font-size: 14px;
    color: var(--ink);
}

/* Мобильная адаптация комментариев */
@media (max-width: 480px) {
    .comments-section { padding: 14px; }
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .comment-text { font-size: 14px; }
}


/* ===== Страница чата ===== */
.chat-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px - 80px); /* высота экрана минус topbar и dock */
    max-height: 900px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 80px; /* место для dock */
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
    background: #f8f9f7;
    flex-shrink: 0;
}
.chat-header h1 {
    margin: 0;
    font-size: 26px;
}
.chat-count {
    padding: 6px 12px;
    background: var(--green-light);
    color: var(--green);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
    background: var(--paper);
}

.chat-body .comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 0;
}

.chat-body .comment-card {
    position: relative;
    padding: 12px 14px;
    background: #f8f9f7;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.chat-body .comment-card.own {
    background: var(--green-light);
    border-color: #b7c4ba;
}

.chat-input {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--line);
    background: #f8f9f7;
    flex-shrink: 0;
}
.chat-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.chat-input .textarea {
    flex: 1;
    margin: 0;
    min-height: 48px;
    max-height: 120px;
    resize: none;
}
.chat-input .btn {
    flex-shrink: 0;
    min-height: 48px;
}

/* ===== Прикрепление фото в чате ===== */
.chat-photo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-height: 48px;
    flex-shrink: 0;
    border: 1px dashed #a98989;
    border-radius: 10px;
    background: #fffafa;
    font-size: 22px;
    cursor: pointer;
    transition: background 0.15s;
}
.chat-photo-btn:hover { background: #f4e5e5; }
.chat-photo-btn input[type="file"] { display: none; }

.chat-attach:empty { display: none; }
.chat-attach {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.chat-attach-item { display: inline-flex; align-items: flex-start; gap: 6px; }
.chat-attach-item img {
    display: block;
    max-width: 220px;
    max-height: 130px;
    border: 1px solid var(--line);
    border-radius: 10px;
    object-fit: cover;
}

/* ===== Фото в сообщении чата ===== */
.comment-photo { display: block; margin-top: 10px; }
.comment-photo img {
    display: block;
    max-width: 100%;
    max-height: 340px;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: zoom-in;
    transition: transform 0.2s, box-shadow 0.2s;
}
.comment-photo img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

/* ===== Баннер нерешённой проблемы ===== */
.chat-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 22px;
    background: #fdf0f0;
    border-bottom: 1px solid #e3c3c3;
    color: #8c3333;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}
.chat-alert-text { display: flex; align-items: center; gap: 9px; }
.chat-alert-icon { font-size: 20px; }
.chat-alert .btn { flex-shrink: 0; }

/* Мобильная адаптация чата */
@media (max-width: 768px) {
    .chat-page {
        height: calc(100vh - 60px - 70px);
        border-radius: 0;
        margin: -16px -12px 0;
        border-left: 0;
        border-right: 0;
    }
    .chat-header {
        padding: 14px 16px;
    }
    .chat-header h1 {
        font-size: 22px;
    }
    .chat-body {
        padding: 14px 16px;
    }
    .chat-input {
        padding: 12px 16px;
    }
    .chat-alert {
            flex-direction: row;
        flex-wrap: nowrap;
    }
    .chat-header {
        flex-direction: row;
    }
    .chat-header div p {
        font-size: 14px;
    }
    .chat-header div h1 {
        font-size: 16px;
    }
    .container {
        padding-bottom: 0;
    }
    .chat-page {
        height: calc(100vh - 60px - 0px);
    }
}

@media (max-width: 480px) {
    /* .chat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    } */
    .chat-input-row {
        flex-wrap: wrap;
    }
    .chat-input .btn {
        width: 100%;
    }
    .chat-alert {
        padding: 10px 16px;
    }
}


/* ===== История — раскрываемые блоки со снимками ===== */
.history-entry {
    padding: 0;
    margin-bottom: 10px;
    background: #f8f9f7;
    border-radius: 10px;
    border: 1px solid var(--line);
    overflow: hidden;
}
.history-entry[open] {
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(49, 91, 69, 0.08);
}

.history-entry summary {
    padding: 12px 36px 12px 14px;
    cursor: pointer;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    user-select: none;
    position: relative;
}
.history-entry summary::-webkit-details-marker { display: none; }

.history-entry summary::after {
    content: '▾';
    position: absolute;
    right: 14px;
    top: 14px;
    font-size: 14px;
    color: var(--muted);
    transition: transform 0.2s;
}
.history-entry[open] summary::after {
    transform: rotate(180deg);
}

.history-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.history-summary strong {
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
}
.history-time {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}
.history-brief {
    font-size: 13px;
    color: var(--green);
    font-weight: 600;
}

.history-details {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--line);
}

/* ===== Снимок этапа (snapshot) ===== */
.snapshot-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    background: var(--green-light);
    color: var(--green);
}

.snapshot-list {
    margin: 0;
    padding-left: 24px;
    list-style-type: decimal;
}
.snapshot-list li {
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.5;
    border-bottom: 1px dashed var(--line);
}
.snapshot-list li:last-child {
    border-bottom: 0;
}

.snapshot-text {
    color: var(--ink);
    word-break: break-word;
}

.snapshot-photo {
    display: block;
    max-width: 150px;
    max-height: 120px;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
}

/* Мобильная адаптация */
@media (max-width: 480px) {
    .history-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .snapshot-list li {
        font-size: 13px;
    }
    .snapshot-photo {
        max-width: 120px;
        max-height: 100px;
    }
}

/* ===== Кнопка поиска / очистки ===== */
.search-action-btn {
    min-width: 56px;
    min-height: 56px;
    font-size: 26px;
    font-weight: 700;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--green);
    cursor: pointer;
    transition: color 0.15s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
}
.search-action-btn:hover {
    color: var(--green-dark);
    transform: scale(1.1);
}
.search-action-btn.clear-mode {
    color: var(--red);
    font-size: 30px;
}
.search-action-btn.clear-mode:hover {
    color: #7a2f2f;
}

/* Мобильная адаптация */
@media (max-width: 480px) {
    .search-action-btn {
        min-width: 48px;
        min-height: 48px;
        font-size: 22px;
        padding: 0 10px;
    }
    .search-action-btn.clear-mode {
        font-size: 26px;
    }
}

/* ===== Кнопки перемещения этапов ===== */
.icon-btn {
    min-width: 36px;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: var(--green);
    transition: all 0.15s;
}
.icon-btn:hover:not(:disabled) {
    background: var(--green-light);
    border-color: var(--green);
}
.icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.icon-btn.small {
    min-width: 26px;
    min-height: 26px;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

/* ===== Бейджик количества сообщений ===== */
.chat-badge {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 6px;
    background: var(--green);
    color: white;
    font-size: 12px;
    font-weight: 750;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    vertical-align: middle;
}
.chat-badge.danger { background: #b23b3b; }

.avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line);
    background: var(--green-light);
    flex-shrink: 0;
}

/* ===== Бейджик количества шагов в табе ===== */
.step-count-badge {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 6px;
    background: var(--green);
    color: white;
    font-size: 12px;
    font-weight: 750;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    vertical-align: middle;
}

.edit-box {
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 0.25s ease,
                box-shadow 0.2s ease;
    will-change: transform, opacity;
}

.edit-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.photo-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px dashed #e2ceb0;
    border-radius: 8px;
    background: #fff2de;
    color: var(--green);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
