 :root{
      --primary-color:#2c3e50;
      --secondary-color:#34495e;
      --accent-color:#3498db;
      --dark-color:#212529;
      --border-radius:12px;
      --shadow2: 0 2px 8px rgba(16,24,40,.05);
      --transition: all .18s ease;

      --warn-bg: rgba(245, 158, 11, .12);
      --warn-br: rgba(245, 158, 11, .25);
      --warn-tx: #8a4b00;

      --mobile-btn-bg: #3b971d;
      --mobile-btn-tx: #ffffff;
    }
    


    
    h1{
      font-size:1.35rem;
      font-weight:700;
      color:var(--primary-color);
      margin-bottom:8px;
    }
    
    .sub{
      color:#667085;
      font-size:.95rem;
      margin-bottom:16px;
    }

    .layout{
      display:grid;
      grid-template-columns: 1.2fr .85fr;
      gap:14px;
      align-items:start;
    }

    .card{
      background:#fff;
      border:1px solid rgba(16,24,40,.08);
      border-radius: var(--border-radius);
      box-shadow: var(--shadow2);
      padding:16px;
    }

    .island{
    background: #e0e0e061;
    border: 1px solid rgb(226 226 226 / 76%);
    border-radius: 14px;
    padding: 14px 14px 10px;
    margin-bottom: 14px;
    }
    
    .island-title{
      font-size:1.05rem;
      font-weight:700;
      color:var(--secondary-color);
      margin-bottom:10px;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
    }
    
    .island .divider{
      margin:10px 0;
    }

    .card-title{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      margin-bottom:12px;
    }
    
    .card-title h2{
      font-size:1.08rem;
      font-weight:700;
      color:var(--primary-color);
    }
    
    .badge{
      display:inline-flex;
      align-items:center;
      gap:8px;
      padding:6px 10px;
      border-radius:999px;
      border:1px solid rgba(52,152,219,.18);
      background: rgba(52,152,219,.08);
      color:#1f5f86;
      font-size:.85rem;
      white-space:nowrap;
    }

    .warn{
      border:1px solid var(--warn-br);
      background: var(--warn-bg);
      color: var(--warn-tx);
      border-radius: 12px;
      padding:10px 12px;
      font-size:.92rem;
      margin-top:10px;
    }

    label{
      display:block;
      margin-bottom:7px;
      font-weight:600;
      color:var(--secondary-color);
    }
    
    input, select, textarea{
      width:100%;
      padding:10px 12px;
      border:1px solid rgba(16,24,40,.12);
      border-radius: 10px;
      background:#fff;
      font-size:1rem;
      transition: var(--transition);
    }
    
    input:focus, select:focus, textarea:focus{
      outline:none;
      border-color: rgba(52,152,219,.65);
      box-shadow: 0 0 0 3px rgba(52,152,219,.18);
    }
    
    .help{
      margin-top:6px;
      font-size:.85rem;
      color:#667085;
    }
    
    .form-group{
      margin-bottom:14px;
    }

    .row2{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:12px;
    }
    
    .row3{
      display:grid;
      grid-template-columns:1fr 1fr 1fr;
      gap:12px;
    }
    
    .divider{
      border-top:1px solid rgba(16,24,40,.08);
      margin:12px 0;
    }

    .check{
      display:flex;
      align-items:center;
      gap:10px;
      padding:10px 12px;
      border:1px solid rgba(16,24,40,.12);
      border-radius: 10px;
      background:#fff;
      min-height:44px;
    }
    
    .check input{
      width:auto;
    }

    .actions{
      display:flex;
      gap:10px;
      flex-wrap:wrap;
      margin-top:10px;
    }
    
    .btn{
      padding:10px 14px;
      border-radius: 10px;
      border:1px solid transparent;
      cursor:pointer;
      font-weight:700;
      display:inline-flex;
      align-items:center;
      gap:8px;
      transition: var(--transition);
      text-decoration:none;
      user-select:none;
    }
    
    .btn-primary{
      background:var(--accent-color);
      color:#fff;
    }
    
    .btn-primary:hover{
      filter:brightness(.95);
    }
    
    .btn-secondary{
      background:#fff;
      border-color: rgba(16,24,40,.14);
      color: var(--secondary-color);
    }
    
    .btn-secondary:hover{
      background:#f3f6fb;
    }
    
    .btn-danger{
      background: rgb(204 236 51 / 56%);
      border-color: rgb(96 157 21 / 20%);
      color: #272727;
    }

    .mono{
      font-variant-numeric: tabular-nums;
    }
    
    .big{
      font-size:1.2rem;
      font-weight:800;
      color: var(--primary-color);
    }
    
    .muted{
      color:#667085;
    }

    .sticky{
      position: sticky;
      top: 14px;
    }

    table{
      width:100%;
      border-collapse:collapse;
    }
    
    th,td{
      padding:9px 0;
      border-bottom:1px solid rgba(16,24,40,.06);
      vertical-align:top;
    }
    
    th{
      font-size:.92rem;
      color:#475467;
      text-align:left;
    }
    
    td:last-child,
    th:last-child{
      text-align:right;
    }
    
    tfoot td{
      border-bottom:none;
      padding-top:10px;
      font-weight:800;
    }

    textarea{
      min-height:140px;
      resize:vertical;
    }

    /* Mobile bottom summary bar */
    .bottom-bar{
      display:none;
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(255,255,255,.92);
      backdrop-filter: blur(10px);
      border-top: 1px solid rgba(16,24,40,.10);
      box-shadow: 0 -12px 28px rgba(16,24,40,.10);
      padding: 10px 12px;
      z-index: 999;
      transition: opacity .18s ease;
    }
    
    .bottom-inner{
      max-width:1100px;
      margin:0 auto;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
    }
    
    .bottom-left{
      display:flex;
      flex-direction:column;
      gap:2px;
      min-width: 0;
    }
    
    .bottom-title{
      font-size:.82rem;
      color:#667085;
    }
    
    .bottom-price{
      font-weight:900;
      font-size:0.95rem;
      color:#0f172a;
    }
    
    .bottom-actions{
      display:flex;
      gap:8px;
      flex-shrink:0;
    }
    
    .btn-mini{
      padding:10px 12px;
      border-radius: 12px;
      font-weight:800;
      border:1px solid rgba(16,24,40,.12);
      background: var(--mobile-btn-bg);
      cursor:pointer;
      color: var(--mobile-btn-tx);
    }
    
    .btn-mini.secondary{
      background:#fff;
      color:#0f172a;
    }

    body.has-bottom-bar{
      padding-bottom: 78px;
    }

    /* Блок авторизации вверху */
    .auth-block {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border-radius: 16px;
      padding: 24px;
      margin: 20px 0 30px;
      color: white;
      box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
      position: relative;
      overflow: hidden;
    }
    
    .auth-block::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="white" opacity="0.1"/></svg>');
      pointer-events: none;
    }
    
    .auth-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 16px;
    }
    
    .auth-icon {
      font-size: 1.5rem;
    }
    
    .auth-title {
      font-size: 1.1rem;
      font-weight: 700;
      margin: 0;
    }
    
    .auth-content {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      align-items: center;
    }
    
    .auth-text {
      font-size: 1rem;
      line-height: 1.5;
      margin: 0;
    }
    
    .auth-buttons {
      display: flex;
      gap: 12px;
      justify-content: flex-end;
    }
    
    .auth-btn {
      padding: 12px 24px;
      border-radius: 10px;
      font-weight: 700;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: all 0.2s ease;
      min-width: 160px;
      justify-content: center;
    }
    
    .auth-btn.login {
      background: white;
      color: #667eea;
      border: 2px solid white;
    }
    
    .auth-btn.register {
      background: transparent;
      color: white;
      border: 2px solid rgba(255, 255, 255, 0.7);
    }
    
    .auth-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    }
    
    .auth-btn.login:hover {
      background: rgba(255, 255, 255, 0.9);
    }
    
    .auth-btn.register:hover {
      background: rgba(255, 255, 255, 0.1);
      border-color: white;
    }
    
    .auth-note {
      font-size: 0.9rem;
      opacity: 0.9;
      margin-top: 8px;
      text-align: center;
      grid-column: 1 / -1;
      padding-top: 15px;
      border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .free-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: rgba(255, 255, 255, 0.2);
      padding: 6px 12px;
      border-radius: 20px;
      font-size: 0.85rem;
      margin-top: 5px;
    }

    /* Стили для верхнего меню переключения */
    .top-switch{
      display:flex;
      gap:10px;
      flex-wrap:wrap;
      margin:10px 0 16px;
    }
    
    .ts-btn{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      padding:10px 14px;
      border-radius:12px;
      border:1px solid #ddd;
      background:#fff;
      color:#222;
      text-decoration:none;
      font-weight:700;
    }
    
    .ts-btn.active{
      border-color:#111;
      background:#111;
      color:#fff;
    }

    /* Блокировка интерфейса для неавторизованных */
    .calculator-disabled {
      opacity: 0.7;
      pointer-events: none;
      position: relative;
    }
    
    .calculator-disabled::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 1;
      cursor: not-allowed;
    }
    
    .login-prompt {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: #d4d4d4;
      padding: 20px;
      border-radius: 10px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.1);
      text-align: center;
      z-index: 2;
      max-width: 90%;
    }

    /* Адаптивность */
    @media (max-width: 980px){
      .layout{
        grid-template-columns:1fr;
      }
      
      .sticky{
        position:static;
      }
      
      .auth-content {
        grid-template-columns: 1fr;
        gap: 15px;
      }
      
      .auth-buttons {
        justify-content: center;
      }
    }
    
    @media (max-width: 720px){
      .top-switch{
        gap:8px;
      }
      
      .ts-btn{
        flex:1 1 0;
      }
      
      .auth-buttons {
        flex-direction: column;
      }
      
      .auth-btn {
        width: 100%;
      }
    }
    
    @media (max-width: 640px){
      .row2,
      .row3{
        grid-template-columns:1fr;
      }
      
      .bottom-bar{
        display:block;
      }
      
      .bottom-inner{
        justify-content:center;
      }
      
      .bottom-left{
        width:100%;
      }
      
      .bottom-title,
      .bottom-price{
        width:100%;
        text-align:center;
      }
      
      .auth-block {
        padding: 20px;
      }
      
      .auth-title {
        font-size: 1rem;
      }
    }


/* ================================================
   БЛОК "ДЕЙСТВИЯ С РАСЧЁТОМ" — actions-island
   Добавить в calculator.css или в <style> страницы
   ================================================ */

.actions-island {
    padding: 14px;
}

/* Разделитель внутри блока */
.act-divider {
    border-top: 1px solid rgba(16, 24, 40, .07);
    margin: 11px 0;
}

/* Строка с кнопками */
.act-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.act-row--footer {
    gap: 8px;
}

/* Секция сохранения */
.act-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.act-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    font-weight: 700;
    color: #475467;
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Строка одиночного действия */
.act-action-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* ── Базовая кнопка ── */
.act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: .83rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s ease;
    white-space: nowrap;
    line-height: 1;
    user-select: none;
}

.act-btn--wide {
    width: 100%;
}

.act-btn svg {
    flex-shrink: 0;
    opacity: .85;
}

/* Рассчитать — синий */
.act-btn--calc {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
    flex: 1;
}
.act-btn--calc:hover {
    background: #1558b0;
    border-color: #1558b0;
}

/* Копировать смету — светлый */
.act-btn--copy {
    background: #f3f6fb;
    color: #344a5e;
    border-color: #d8dde4;
    flex: 1;
}
.act-btn--copy:hover {
    background: #e8edf4;
}

/* Сохранить — серо-зелёный */
.act-btn--save {
    background: #f0f4f0;
    color: #2e6b2e;
    border-color: #c3d9c3;
    align-self: flex-start;
}
.act-btn--save:hover {
    background: #ddeedd;
    border-color: #a8c8a8;
}

/* Создать объект — тёмно-синий */
.act-btn--object {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}
.act-btn--object:hover {
    background: #162d4a;
}
.act-btn--object:disabled {
    background: #8fa3b8;
    border-color: #8fa3b8;
    cursor: not-allowed;
}

/* Отправить компании — зелёный */
.act-btn--send {
    background: #1b7f3e;
    color: #fff;
    border-color: #1b7f3e;
}
.act-btn--send:hover {
    background: #156231;
}

/* Мои расчёты — жёлто-зелёный акцент */
.act-btn--archive {
    background: #e8f5d0;
    color: #2e5e0e;
    border-color: #b8d98a;
    flex: 1;
}
.act-btn--archive:hover {
    background: #d4edae;
}

/* Назад на главную — нейтральный */
.act-btn--back {
    background: #f3f6fb;
    color: #475467;
    border-color: #d8dde4;
    flex: 1;
}
.act-btn--back:hover {
    background: #e8edf4;
}

/* Disabled общий */
.act-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Мобильная адаптация */
@media (max-width: 640px) {
    .act-btn--calc,
    .act-btn--copy {
        flex: 1 1 100%;
    }
}