  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
  }

  .header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 28px 40px 0;
  }

  .header-top { padding-bottom: 20px; }

  .header h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
  }

  .header p {
    margin-top: 5px;
    font-size: 13px;
    color: #a0a8b8;
    max-width: 600px;
    line-height: 1.5;
  }

  /* Mode tabs */
  .mode-tabs {
    display: flex;
    gap: 4px;
    margin-top: 20px;
  }

  .mode-tab {
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,.08);
    color: #a0a8b8;
  }

  .mode-tab.active {
    background: #f0f2f5;
    color: #1a1a2e;
  }

  .mode-tab:hover:not(.active) {
    background: rgba(255,255,255,.14);
    color: white;
  }

  .mode-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    background: rgba(233,69,96,.25);
    color: #f9a8b8;
  }

  .mode-tab.active .mode-badge {
    background: #fff0f3;
    color: #e94560;
  }

  .beta-badge {
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
    background: rgba(234,179,8,.25);
    color: #ca8a04;
    margin-left: 2px;
  }
  .mode-tab.active .beta-badge {
    background: #fefce8;
    color: #a16207;
  }

  /* Layout */
  .main {
    max-width: 980px;
    margin: 0 auto;
    padding: 28px 20px 60px;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 22px;
    align-items: start;
  }

  /* ——— INPUT PANEL ——— */
  .panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    position: sticky;
    top: 20px;
  }

  .panel-header {
    background: #16213e;
    color: white;
    padding: 14px 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
  }

  .panel-body { padding: 18px; }

  .section-label {
    font-size: 10px;
    font-weight: 700;
    color: #8892a4;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 16px 0 10px;
  }

  .section-label:first-child { margin-top: 0; }

  .field { margin-bottom: 12px; }

  .field label {
    display: block;
    font-size: 12.5px;
    color: #4a5568;
    margin-bottom: 4px;
    font-weight: 500;
    line-height: 1.3;
  }

  .field .hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
    line-height: 1.4;
  }

  /* подсказка под тумблером модуля — .field .hint сюда не достаёт */
  .toggle-hint {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
    margin: -2px 0 0 46px;
  }

  .field input[type="number"] {
    width: 100%;
    padding: 8px 11px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    background: #f8fafc;
    transition: border-color .15s, box-shadow .15s;
    -moz-appearance: textfield;
  }

  .field input::-webkit-outer-spin-button,
  .field input::-webkit-inner-spin-button { -webkit-appearance: none; }

  .field input[type="number"]:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233,69,96,.12);
    background: white;
  }

  .field input.ha-highlight {
    border-color: #6366f1;
    background: #faf5ff;
  }

  .field input.ha-highlight:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  }

  /* Smart know/auto toggle */
  .smart-seg {
    display: flex;
    gap: 0;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 6px;
  }

  .smart-btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    transition: all .15s;
  }

  .smart-btn.active {
    background: white;
    color: #1a1a2e;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
  }

  .auto-note {
    font-size: 11px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    padding: 7px 10px;
    line-height: 1.5;
  }

  .auto-note strong { color: #1a1a2e; }

  .cfg-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,.15);
  }

  /* Validation */
  .field-error input[type="number"] {
    border-color: #f87171 !important;
    background: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(248,113,113,.15) !important;
  }

  .error-msg {
    display: none;
    font-size: 11px;
    color: #dc2626;
    margin-top: 4px;
    font-weight: 500;
    line-height: 1.4;
  }

  .error-msg.visible { display: block; }

  .toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
  }

  .toggle-row label {
    font-size: 12.5px;
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
  }

  .switch {
    position: relative;
    width: 38px;
    height: 21px;
    flex-shrink: 0;
  }

  .switch input { opacity: 0; width: 0; height: 0; }

  .slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 21px;
    cursor: pointer;
    transition: background .2s;
  }

  .slider:before {
    content: '';
    position: absolute;
    height: 15px; width: 15px;
    left: 3px; top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
  }

  .switch input:checked + .slider { background: #e94560; }
  .switch input:checked + .slider:before { transform: translateX(17px); }

  .collapsible {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    border: 1.5px solid #e2e8f0;
    margin-top: 2px;
    display: none;
  }

  .collapsible.visible { display: block; }

  .collapsible .field { margin-bottom: 10px; }
  .collapsible .field:last-child { margin-bottom: 0; }

  .divider {
    height: 1px;
    background: #f1f5f9;
    margin: 16px 0;
  }

  .ha-note {
    background: #fffbeb;
    border: 1.5px solid #fcd34d;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: #78350f;
    line-height: 1.6;
    margin-bottom: 16px;
    display: none;
    gap: 10px;
  }
  .ha-note.visible { display: flex; align-items: flex-start; }
  .ha-note-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
  .ha-note-text strong { display: block; font-size: 13px; margin-bottom: 3px; color: #92400e; }

  /* ——— RESULTS ——— */
  .results-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .result-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
  }

  .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-bottom: 1px solid #f1f5f9;
  }

  .card-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
  }

  .card-icon.blue { background: #eff6ff; }
  .card-icon.green { background: #f0fdf4; }
  .card-icon.purple { background: #faf5ff; }
  .card-icon.orange { background: #fff7ed; }
  .card-icon.indigo { background: #eef2ff; }

  .card-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1a1a2e;
  }

  .card-subtitle { font-size: 11.5px; color: #94a3b8; }

  .summary-chips {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
  }

  .chip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    flex: 1;
    min-width: 72px;
  }

  .chip-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
  }

  .chip-label {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .chip.hl .chip-value { color: #e94560; }
  .chip.hl-indigo .chip-value { color: #6366f1; }

  /* Component table */
  .comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
  }

  .comp-table th {
    text-align: right;
    font-size: 9.5px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 9px 14px 7px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
  }

  .comp-table th:first-child { text-align: left; }

  .comp-table td {
    padding: 8px 14px;
    border-bottom: 1px solid #f8fafc;
    text-align: right;
    color: #4a5568;
  }

  .comp-table td:first-child {
    text-align: left;
    color: #1a1a2e;
    font-weight: 500;
  }

  .comp-table .total-row td {
    font-weight: 700;
    color: #1a1a2e;
    border-top: 2px solid #f1f5f9;
    border-bottom: none;
    background: #fafbfc;
  }

  .comp-table .note-row td {
    font-size: 10.5px;
    color: #94a3b8;
    font-style: italic;
    padding-top: 4px;
    padding-bottom: 6px;
    border-bottom: none;
  }

  .rep { font-size: 10px; color: #94a3b8; }

  .badge-client {
    display: inline-block;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    background: #fff7ed;
    color: #c2410c;
    margin-left: 4px;
    vertical-align: middle;
  }

  .storage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #fafbfc;
    border-top: 1px solid #f1f5f9;
    font-size: 12.5px;
  }

  .storage-label { color: #64748b; }
  .storage-value { font-weight: 700; color: #1a1a2e; }

  /* Per-DC distribution card */
  .dc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    padding: 14px 18px;
  }

  .dc-box {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
  }

  .dc-box-title {
    font-size: 11px;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
  }

  .dc-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #4a5568;
    margin-bottom: 4px;
  }

  .dc-row:last-child { margin-bottom: 0; }
  .dc-val { font-weight: 600; color: #1a1a2e; }

  /* Grand total */
  .grand-total {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    padding: 22px 18px;
    color: white;
  }

  .grand-total h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #a0a8b8;
    margin-bottom: 14px;
  }

  .gt-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .gt-chip {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    padding: 13px;
    text-align: center;
  }

  .gt-chip-value {
    font-size: 26px;
    font-weight: 800;
    color: #e94560;
    line-height: 1;
  }

  .gt-chip-label {
    font-size: 10px;
    color: #a0a8b8;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .gt-note {
    margin-top: 12px;
    font-size: 11.5px;
    color: #8892a4;
    line-height: 1.5;
  }

  /* Empty */
  .empty-state {
    text-align: center;
    padding: 36px 20px;
    color: #94a3b8;
  }

  .empty-state .icon { font-size: 36px; margin-bottom: 10px; }
  .empty-state p { font-size: 13px; line-height: 1.5; }

  /* ——— DIAGRAM VIEW ——— */
  .diagram-view {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 40px;
    display: none;
  }

  .diagram-view.visible { display: block; }

  .diagram-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-radius: 12px 12px 0 0;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    padding: 10px 16px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .diagram-toolbar-left { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

  .diagram-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
  }

  .diagram-btn:hover { background: #f1f5f9; border-color: #cbd5e1; color: #1a1a2e; }
  .diagram-btn.primary { background: #1a1a2e; border-color: #1a1a2e; color: white; }
  .diagram-btn.primary:hover { background: #16213e; }

  .diagram-sep { width: 1px; height: 20px; background: #e2e8f0; margin: 0 2px; }

  .diagram-hint {
    font-size: 11px;
    color: #94a3b8;
  }

  .diagram-frame-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: white;
  }

  #drawio-frame {
    width: 100%;
    height: calc(100vh - 220px);
    min-height: 560px;
    border: none;
    display: block;
  }

  .diagram-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #94a3b8;
    font-size: 14px;
    gap: 10px;
  }

  @keyframes spin { to { transform: rotate(360deg); } }
  .spinner {
    width: 20px; height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin .7s linear infinite;
  }

  @media (max-width: 720px) {
    .main { grid-template-columns: 1fr; }
    .panel { position: static; }
    .header { padding: 20px 20px 0; }
  }

  /* ——— AUTH LOADING ——— */
  #auth-loading {
    position: fixed;
    inset: 0;
    background: #f0f2f5;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
  }
  #auth-loading .auth-logo {
    font-size: 40px;
    margin-bottom: 4px;
  }
  #auth-loading .auth-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin .7s linear infinite;
  }
  #auth-loading p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
  }

  /* Бейдж роли в шапке */
  .role-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 20px;
    padding: 4px 12px 4px 10px;
    font-size: 12px;
    color: rgba(255,255,255,.85);
    cursor: default;
    user-select: none;
  }
  .role-badge .role-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .role-badge .btn-logout {
    background: none;
    border: none;
    color: rgba(255,255,255,.6);
    cursor: pointer;
    font-size: 11px;
    padding: 0 0 0 6px;
    transition: color .15s;
  }
  .role-badge .btn-logout:hover { color: #fff; }

  /* ——— FEEDBACK ——— */
  .btn-feedback {
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: rgba(255,255,255,.85);
    cursor: pointer;
    transition: background .15s;
  }
  .btn-feedback:hover { background: rgba(255,255,255,.22); }

  .feedback-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9000;
    align-items: center;
    justify-content: center;
  }
  .feedback-overlay.open { display: flex; }
  .feedback-modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px 28px 24px;
    width: 460px;
    max-width: calc(100vw - 32px);
    box-shadow: 0 24px 60px rgba(0,0,0,.2);
  }
  .feedback-modal h3 { margin: 0 0 4px; font-size: 16px; color: #1a1a2e; }
  .feedback-modal p  { margin: 0 0 16px; font-size: 13px; color: #64748b; }
  .feedback-type-row { display: flex; gap: 8px; margin-bottom: 14px; }
  .feedback-type-btn {
    flex: 1; padding: 7px; border-radius: 8px; border: 1.5px solid #e2e8f0;
    background: #f8fafc; font-size: 13px; cursor: pointer; transition: all .15s;
  }
  .feedback-type-btn.active {
    border-color: #6366f1; background: #eef2ff; color: #4338ca; font-weight: 600;
  }
  .feedback-modal textarea {
    width: 100%; box-sizing: border-box;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    padding: 10px 12px; font-size: 13px; resize: vertical;
    min-height: 110px; font-family: inherit; color: #1a1a2e;
    transition: border-color .15s;
  }
  .feedback-modal textarea:focus { outline: none; border-color: #6366f1; }
  .feedback-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; }
  .feedback-cancel {
    padding: 8px 16px; border-radius: 8px; border: 1.5px solid #e2e8f0;
    background: #fff; font-size: 13px; cursor: pointer; color: #64748b;
  }
  .feedback-send {
    padding: 8px 20px; border-radius: 8px; border: none;
    background: #1a1a2e; color: #fff; font-size: 13px; cursor: pointer;
    transition: background .15s;
  }
  .feedback-send:hover { background: #6366f1; }
  .feedback-send:disabled { opacity: .5; cursor: default; }
  .feedback-ok { text-align: center; padding: 12px 0 4px; }
  .feedback-ok .ok-icon { font-size: 36px; margin-bottom: 8px; }
  .feedback-ok p { color: #64748b; font-size: 13px; margin: 0; }

  /* ——— HELP MODAL ——— */
  .help-btn {
    position: fixed;
    bottom: 28px;
    right: 32px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1a1a2e;
    color: white;
    border: 1px solid rgba(255,255,255,.15);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    transition: background .15s, transform .15s;
    z-index: 500;
  }
  .help-btn:hover { background: #16213e; transform: scale(1.08); }

  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .modal-overlay.open { display: flex; }

  .modal {
    background: white;
    border-radius: 16px;
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
  }
  .modal-header {
    position: sticky;
    top: 0;
    background: #16213e;
    color: white;
    padding: 18px 24px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1;
  }
  .modal-header h2 { font-size: 16px; font-weight: 700; }
  .modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
  }
  .modal-close:hover { color: white; }
  .modal-body { padding: 24px; }

  .help-section { margin-bottom: 24px; }
  .help-section:last-child { margin-bottom: 0; }
  .help-section h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #6366f1;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e8eaf6;
  }
  .help-section p, .help-section li {
    font-size: 13px;
    line-height: 1.65;
    color: #374151;
  }
  .help-section ul { padding-left: 18px; }
  .help-section li { margin-bottom: 5px; }
  .help-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
  .help-kv dt { font-weight: 600; color: #1a1a2e; white-space: nowrap; }
  .help-kv dd { color: #374151; margin: 0; line-height: 1.5; }
  .help-note {
    background: #f0f9ff;
    border-left: 3px solid #38bdf8;
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
    font-size: 12px;
    color: #0369a1;
    margin-top: 8px;
    line-height: 1.5;
  }

  /* ——— админка прав ——— */
  .btn-admin {
    background: rgba(129,140,248,.22);
    border: 1px solid rgba(129,140,248,.55);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #e0e7ff;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
  }
  .btn-admin:hover { background: rgba(129,140,248,.38); }

  .admin-list {
    margin: 12px 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    max-height: 260px;
    overflow-y: auto;
  }
  .admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    font-size: 13px;
  }
  .admin-row + .admin-row { border-top: 1px solid #f1f5f9; }
  .admin-email { color: #1a1a2e; word-break: break-all; }
  .admin-lock {
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 5px;
    padding: 2px 7px;
    flex-shrink: 0;
  }
  .admin-del {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    padding: 0 3px;
  }
  .admin-del:hover { color: #ef4444; }

  .admin-add { display: flex; gap: 8px; }
  .admin-add input {
    flex: 1;
    padding: 8px 11px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #1a1a2e;
    min-width: 0;
  }
  .admin-add input:focus { outline: none; border-color: #6366f1; }

  .admin-note { font-size: 12px; margin-top: 8px; min-height: 16px; color: #64748b; }
  .admin-note.ok  { color: #16a34a; }
  .admin-note.err { color: #dc2626; }

  /* ——— мастер для продаж ——— */
  .wizard-view { display: none; padding: 24px 20px 40px; }
  .wizard-view.visible { display: block; }
  #wizard-body {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    max-width: 1080px;
    margin: 0 auto;
    flex-wrap: wrap;
  }

  .wiz-card {
    flex: 1 1 520px;
    background: #fff;
    border-radius: 14px;
    padding: 26px 28px 22px;
    box-shadow: 0 1px 3px rgba(16,24,40,.08);
  }
  .wiz-card-wide { flex: 1 1 100%; }

  .wiz-progress { height: 4px; background: #eef2f7; border-radius: 4px; overflow: hidden; }
  .wiz-progress-bar { height: 100%; background: #6366f1; transition: width .25s; }
  .wiz-step-num { font-size: 11.5px; color: #94a3b8; margin: 12px 0 6px; letter-spacing: .04em; }

  .wiz-q { font-size: 20px; line-height: 1.3; color: #1a1a2e; margin: 0 0 8px; font-weight: 600; }
  .wiz-why { font-size: 13px; line-height: 1.55; color: #64748b; margin: 0 0 18px; }
  .wiz-body { margin-bottom: 6px; }

  .wiz-input {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 15px;
    color: #1a1a2e;
  }
  .wiz-input:focus { outline: none; border-color: #6366f1; }

  .wiz-opts { display: flex; flex-direction: column; gap: 8px; }
  .wiz-opt {
    text-align: left;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
    font-size: 14px;
    color: #1a1a2e;
    cursor: pointer;
    transition: border-color .12s, background .12s;
  }
  .wiz-opt:hover { border-color: #c7d2fe; background: #f8fafc; }
  .wiz-opt.active { border-color: #6366f1; background: #eef2ff; font-weight: 500; }

  .wiz-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #1a1a2e;
  }
  .wiz-check:hover { border-color: #c7d2fe; }
  .wiz-check input { margin-top: 3px; flex-shrink: 0; }
  .wiz-sub { font-size: 12px; color: #94a3b8; font-weight: 400; }

  .wiz-warn {
    margin-top: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 9px;
    padding: 11px 13px;
    font-size: 12.5px;
    line-height: 1.5;
  }
  .wiz-warn div + div { margin-top: 6px; }

  .wiz-err { color: #dc2626; font-size: 12.5px; min-height: 17px; margin-top: 8px; }

  .wiz-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
  .wiz-back, .wiz-next {
    padding: 10px 20px;
    border-radius: 9px;
    font-size: 14px;
    cursor: pointer;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #475569;
  }
  .wiz-back:disabled { opacity: .4; cursor: default; }
  .wiz-next { background: #1a1a2e; border-color: #1a1a2e; color: #fff; font-weight: 500; }
  .wiz-next:hover { background: #2d2d4a; }

  .wiz-aside { flex: 0 1 260px; }
  .wiz-mail {
    width: 100%;
    padding: 10px 14px;
    border-radius: 9px;
    border: 1.5px solid #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
    font-size: 13px;
    cursor: pointer;
  }
  .wiz-mail:hover { background: #e0e7ff; }
  .wiz-aside-note { font-size: 12px; color: #94a3b8; line-height: 1.5; margin-top: 10px; }

  .wiz-result { margin: 4px 0 8px; }

  @media (max-width: 860px) {
    .wiz-aside { flex: 1 1 100%; }
  }
