  :root {
    /* Continexus palette: bright yellow accent, near-black for primary
       actions and text, clean white surfaces. Yellow is used as a stroke /
       underline / highlight — not as a button fill (since white text on
       yellow is unreadable). Primary buttons are dark instead. */
    --bg-1: #ffffff;
    --bg-2: #f1f2f5;
    --bg-3: #fff0e0;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --surface-tint: rgba(255, 255, 255, 0.62);
    --hairline: rgba(20, 24, 32, 0.09);
    --hairline-strong: rgba(20, 24, 32, 0.16);
    --inner-highlight: rgba(255, 255, 255, 0.7);
    --text: #1a1a1a;
    --text-2: #4a4a4a;
    --muted: #888a92;
    --accent: #ff6a1a;
    --accent-2: #f04e10;
    --accent-soft: rgba(255, 106, 26, 0.14);
    --accent-glow: rgba(255, 106, 26, 0.45);
    --primary: #1a1a1a;
    --primary-2: #000000;
    --primary-hover: #2a2a2a;
    --ok: #1f9f56;
    --ok-soft: rgba(31, 159, 86, 0.13);
    --bad: #d33232;
    --bad-soft: rgba(211, 50, 50, 0.13);
    --radius-xs: 8px;
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(20,24,32,0.05), 0 1px 1px rgba(20,24,32,0.03);
    --shadow: 0 8px 24px rgba(20,24,32,0.07), 0 2px 6px rgba(20,24,32,0.04);
    --shadow-lg: 0 18px 48px rgba(20,24,32,0.09), 0 4px 12px rgba(20,24,32,0.05);
  }

  * { box-sizing: border-box; }

  html, body {
    margin: 0; padding: 0;
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    height: 100%;
    overflow: hidden;
    /* Clean white base with subtle cool + warm tints in the corners */
    background:
      radial-gradient(ellipse at 12% 12%, var(--bg-3) 0%, transparent 45%),
      radial-gradient(ellipse at 88% 88%, #eef0f5 0%, transparent 50%),
      linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .app {
    display: grid;
    grid-template-columns: 400px 1fr;
    height: 100vh;
    gap: 14px;
    padding: 14px;
  }

  /* ============ SIDEBAR (Glass surface) ============ */
  .sidebar {
    /* Subtilus vertikalus gradient'as — viršuje šviesesnė balta, apačioje
     * šiltesnis cream/peach atspalvis (Cubivo accent palette). Nedominuoja,
     * bet sukuria gylį ir „šiltą" pabaigą, kad sidebar'as nesibaigtų
     * staiga į baltą foną. */
    background:
      linear-gradient(180deg,
        rgba(255, 255, 255, 0.92) 0%,
        rgba(255, 250, 244, 0.88) 50%,
        rgba(255, 241, 226, 0.85) 100%);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-xl);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    /* Subtle inner highlight at the top edge */
    position: relative;
  }
  .sidebar::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 var(--inner-highlight);
  }

  /* ============ HEADER (sticky at top of scrollable sidebar) ============
   * Header lieka matomas net kai vartotojas scroll'ina sidebar žemyn —
   * brand'inimas (logo + Cubivo + alpha + lang) yra svarbus identifikacijai
   * ir turi būti visada akivaizdus. */
  .header {
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--hairline);
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
  }
  .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
  }
  .logo {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    /* Soft drop shadow grounds the logo against the glass surface */
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12));
  }
  .logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
  }
  .logo-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text);
  }
  .logo-version {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--accent);
    text-transform: uppercase;
    margin-top: 2px;
  }
  /* Compact one-line tagline directly under logo + lang switch */
  .tagline-only {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
    font-weight: 400;
    letter-spacing: 0.2px;
  }
  /* App title — compact single line above tagline.
   * Mažas, bet aiškiai matomas; padariau accent spalvos pabraukimą po
   * antros frazės kaip pirmojo dizaino reminisencija. */
  .app-title-compact {
    margin-top: 10px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--text);
    line-height: 1.25;
  }
  .app-title-compact span:nth-child(2) {
    position: relative;
    display: inline-block;
  }
  .app-title-compact span:nth-child(2)::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    bottom: 0px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0.85;
  }
  /* Legacy h1/subtitle still kept for fallback but no longer rendered */
  h1 { display: none; }
  .subtitle { display: none; }

  /* ============ LANGUAGE PILL ============ */
  .lang-switch {
    display: flex;
    background: var(--surface-tint);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    padding: 2px;
    backdrop-filter: blur(20px);
  }
  .lang-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    border-radius: 999px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .lang-btn:hover { color: var(--text); }
  .lang-btn.active {
    background: var(--surface-strong);
    color: var(--text);
    box-shadow: var(--shadow-sm);
  }

  /* ============ HEADER ACTIONS (lang + user) ============ */
  .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* ============ USER MENU ============ */
  .user-menu {
    position: relative;
  }
  .user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: var(--surface-tint);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
  }
  .user-avatar-btn:hover {
    background: var(--surface-strong);
    box-shadow: var(--shadow-sm);
  }
  .user-avatar-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    object-fit: cover;
  }
  .user-avatar-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .user-avatar-chevron {
    color: var(--muted);
    transition: transform 0.2s;
  }
  .user-menu.open .user-avatar-chevron {
    transform: rotate(180deg);
  }
  .user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
  }
  .user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--hairline);
    background: linear-gradient(180deg, rgba(255, 106, 26, 0.03), transparent);
  }
  .user-dropdown-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    object-fit: cover;
  }
  .user-dropdown-info {
    flex: 1;
    min-width: 0;
  }
  .user-dropdown-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .user-dropdown-status {
    font-size: 10px;
    color: #2eb872;
    margin-top: 2px;
  }
  .user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
  }
  .user-dropdown-item:hover {
    background: var(--surface-tint);
  }
  .user-dropdown-item svg {
    color: var(--muted);
  }

  /* ============ LOGIN MODAL — SPLIT SCREEN ============ */
  .login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
  }
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  .login-modal {
    width: 100%;
    max-width: 920px;
    min-height: 580px;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    box-shadow: 0 30px 80px rgba(255, 106, 26, 0.25);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  @keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ===== LEFT HERO SIDE ===== */
  .login-hero {
    background: linear-gradient(135deg, #ffe4cc 0%, #ffc99c 45%, #ffa86b 100%);
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
  }
  /* Dekoratyvūs blob'ai fone */
  .login-hero-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
  }
  .login-hero-blob-1 {
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.2);
  }
  .login-hero-blob-2 {
    bottom: -80px;
    left: -80px;
    width: 280px;
    height: 280px;
    background: rgba(255, 106, 26, 0.12);
  }
  .login-hero-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
  }
  .login-hero-logo {
    width: 40px;
    height: 40px;
    background: white;
    color: #ff6a1a;
    font-weight: 800;
    font-size: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
  .login-hero-brand-name {
    font-size: 20px;
    font-weight: 800;
    color: #4a1f00;
    letter-spacing: -0.3px;
  }
  .login-hero-headline {
    position: relative;
    z-index: 1;
    margin: 30px 0 20px;
  }
  .login-hero-title-1 {
    font-size: 30px;
    font-weight: 800;
    color: #4a1f00;
    line-height: 1.1;
    letter-spacing: -0.7px;
    margin-bottom: 4px;
  }
  .login-hero-title-2 {
    font-size: 30px;
    font-weight: 800;
    color: #c43d00;
    line-height: 1.1;
    letter-spacing: -0.7px;
    margin-bottom: 14px;
  }
  .login-hero-subtitle {
    font-size: 14px;
    color: #6b3d1c;
    line-height: 1.5;
    max-width: 340px;
  }
  .login-hero-accent {
    color: #c43d00;
    font-weight: 700;
  }
  .login-hero-illustration {
    width: 100%;
    aspect-ratio: 2.2/1;
    position: relative;
    z-index: 1;
    margin: 20px 0;
  }
  .login-hero-illustration svg {
    width: 100%;
    height: 100%;
  }
  .login-hero-features {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    position: relative;
    z-index: 1;
  }
  .login-hero-feature {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.7);
  }
  .login-hero-feature-icon {
    width: 26px;
    height: 26px;
    background: white;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
  }
  .login-hero-feature-title {
    font-size: 11px;
    font-weight: 700;
    color: #4a1f00;
    margin-bottom: 2px;
    line-height: 1.2;
  }
  .login-hero-feature-desc {
    font-size: 10px;
    color: #6b3d1c;
    line-height: 1.4;
  }

  /* ===== RIGHT FORM SIDE ===== */
  .login-form-panel {
    background: white;
    padding: 56px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
  }
  .login-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent) 0%, #ff8848 100%);
    color: white;
    font-weight: 800;
    font-size: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(255, 106, 26, 0.3);
  }
  .login-brand-text {
    flex: 1;
  }
  .login-brand-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
  }
  .login-brand-tagline {
    font-size: 10px;
    color: var(--muted);
    margin-top: 1px;
  }
  .login-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
  }
  .login-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 22px;
    line-height: 1.4;
  }
  .login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
  }
  .login-input-icon {
    position: absolute;
    left: 14px;
    pointer-events: none;
    z-index: 1;
  }
  .login-input {
    width: 100%;
    padding: 14px 16px 14px 38px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: white;
    border: 1.5px solid var(--hairline);
    border-radius: 11px;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
  }
  .login-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 106, 26, 0.1);
  }
  .login-input::placeholder {
    color: #b0afa9;
  }
  .login-submit {
    width: 100%;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--accent) 0%, #ff8848 100%);
    border: none;
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
    box-shadow: 0 4px 14px rgba(255, 106, 26, 0.3);
  }
  .login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 106, 26, 0.4);
  }
  .login-submit:active {
    transform: translateY(0);
  }
  .login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
  }
  .login-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(226, 75, 74, 0.08);
    border: 1px solid rgba(226, 75, 74, 0.2);
    border-radius: 10px;
    color: #c43d3d;
    font-size: 12px;
    font-weight: 500;
  }
  .login-footer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--hairline);
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
  }

  /* ===== MOBILE RESPONSIVE (≤800px) ===== */
  @media (max-width: 800px) {
    .login-overlay {
      padding: 0;
      align-items: stretch;
    }
    .login-modal {
      max-width: none;
      min-height: 100vh;
      grid-template-columns: 1fr;
      grid-template-rows: auto 1fr;
      border-radius: 0;
      box-shadow: none;
    }
    .login-hero {
      padding: 24px 22px 20px;
      min-height: 0;
    }
    .login-hero-headline {
      margin: 16px 0 12px;
    }
    .login-hero-title-1,
    .login-hero-title-2 {
      font-size: 22px;
    }
    .login-hero-subtitle {
      font-size: 12px;
      max-width: none;
    }
    .login-hero-illustration {
      aspect-ratio: 2.8/1;
      margin: 10px 0;
    }
    .login-hero-features {
      display: none; /* Features perkelti į form panel apačią mobile */
    }
    .login-form-panel {
      padding: 28px 24px 36px;
    }
    .login-title {
      font-size: 22px;
    }
    .login-subtitle {
      font-size: 12px;
      margin-bottom: 16px;
    }
    /* Mobile features versija — kompaktiškesnė, po form'os */
    .login-form-panel::after {
      content: '';
      display: block;
    }
  }
  @media (max-width: 480px) {
    .login-hero-title-1,
    .login-hero-title-2 {
      font-size: 20px;
    }
    .login-hero-brand-name {
      font-size: 17px;
    }
    .login-hero-logo {
      width: 34px;
      height: 34px;
      font-size: 17px;
    }
  }

  /* Auto-save indicator */
  .save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 14px;
    background: rgba(46, 184, 114, 0.95);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(46, 184, 114, 0.3);
    backdrop-filter: blur(10px);
    z-index: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
  }
  .save-indicator.show {
    opacity: 1;
    transform: translateY(0);
  }
  .save-indicator.saving {
    background: rgba(255, 106, 26, 0.95);
    box-shadow: 0 4px 14px rgba(255, 106, 26, 0.3);
  }
  .save-indicator.error {
    background: rgba(226, 75, 74, 0.95);
    box-shadow: 0 4px 14px rgba(226, 75, 74, 0.3);
  }

  /* ============ TAB BAR ============ */
  .tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--hairline);
    align-items: center;
  }
  .tab {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-tint);
    border: 1px solid var(--hairline);
    padding: 6px 8px 6px 12px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 999px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 160px;
    backdrop-filter: blur(10px);
  }
  .tab:hover {
    background: var(--surface-strong);
    transform: translateY(-1px);
  }
  .tab.active {
    background: var(--primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  }
  .tab.active .tab-name-input { color: #fff; }
  .tab-name-input {
    background: transparent;
    border: 1px dashed transparent;
    color: inherit;
    font: inherit;
    font-weight: 500;
    width: 110px;
    outline: none;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.15s;
    cursor: text;
  }
  .tab-name-input[readonly] {
    cursor: pointer;
    text-overflow: ellipsis;
  }
  .tab:not(.active) .tab-name-input[readonly] { cursor: pointer; }
  .tab.active .tab-name-input[readonly]:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
  }
  .tab:not(.active) .tab-name-input[readonly]:hover {
    border-color: rgba(255, 106, 26, 0.4);
    background: rgba(255, 106, 26, 0.05);
  }
  /* Kai aktyvus tab'as REDAGAVIMO režime — baltas fonas + JUODAS tekstas.
   * Stipresnis selektorius (su .tab.active) overridoma anksčiau apibrėžtą
   * `color: #fff` ant aktyvaus tab'o input'o. */
  .tab-name-input:not([readonly]),
  .tab.active .tab-name-input:not([readonly]) {
    border-color: var(--accent);
    border-style: solid;
    background: #fff;
    color: var(--text);
    cursor: text;
    caret-color: var(--accent);
  }
  .tab-close {
    opacity: 0.55;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    transition: all 0.15s;
  }
  .tab-close:hover { opacity: 1; background: rgba(0,0,0,0.12); }
  .tab.active .tab-close:hover { background: rgba(255,255,255,0.25); }
  .tab-add {
    background: transparent;
    border: 1px dashed var(--hairline-strong);
    color: var(--muted);
    padding: 6px 12px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 999px;
    transition: all 0.2s;
  }
  .tab-add:hover {
    color: var(--accent);
    border-color: var(--accent);
    border-style: solid;
    background: var(--accent-soft);
  }

  /* ============ SECTIONS ============ */
  .section {
    padding: 18px 24px;
    border-bottom: 1px solid var(--hairline);
    position: relative;
    /* Be modifikatoriaus klasės sekcija lieka neutrali; modifikatoriai
       toliau prideda subtilų spalvotą atspalvį, kad vartotojas iš karto
       matytų, kur baigiasi sunkvežimio nustatymai ir kur prasideda
       kroviniai. */
  }
  .section:last-child { border-bottom: none; }
  /* Kairysis spalvotas akcento brūkšnys padeda akiai greitai surasti
     sekciją be jokio "užkimštos meniu" jausmo. */
  .section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: opacity 0.2s;
  }
  /* Sunkvežimio sekcija: neutralus fonas (kaip pagrindinis meniu).
     Aiškumą užtikrina tik plonas akcento brūkšnys kairėje. */
  .section-truck {
    background: transparent;
  }
  .section-truck::before {
    background: var(--text-2);
    opacity: 0.35;
  }
  /* View sekcija: minimalus atspalvis, lieka neutrali — pereinama zona. */
  .section-view {
    background: rgba(245, 245, 248, 0.4);
  }
  /* Krovinių sekcija: šiltas smėlio/persikinis atspalvis, dera su
     bendra spalvine tema (Cubivo oranžinė) ir aiškiai skiriasi nuo
     mėlyno sunkvežimio bloko. Gradient'as intensyvėja link apačios,
     kad sekcija jaustųsi „šilta" ir CTA mygtukas atrodytų natūraliai. */
  .section-cargo {
    background: linear-gradient(180deg,
      rgba(253, 240, 226, 0.45) 0%,
      rgba(253, 230, 210, 0.55) 50%,
      rgba(255, 220, 185, 0.65) 100%);
    /* Tegul sekcija užima visą laisvą vietą sidebar'e — kad gradient'as
     * tęstųsi iki pat apačios, o ne sustotų po krovinių sąrašu. */
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .section-cargo::before {
    background: var(--accent);
    opacity: 0.55;
  }
  .section-title {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
  }
  .section-title-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  /* Subtle clear button — small, low-contrast by default, turns red on
     hover so the destructive intent is obvious only at the moment of
     intent. Hidden when there's nothing to clear. */
  .clear-cargo-btn {
    background: transparent;
    border: 1px solid var(--hairline);
    color: var(--muted);
    padding: 3px 9px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 999px;
    transition: all 0.15s;
  }
  .clear-cargo-btn:hover {
    color: var(--bad);
    border-color: var(--bad);
    background: var(--bad-soft);
  }
  .clear-cargo-btn[hidden] { display: none; }

  /* ============ FIELDS ============ */
  .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }
  .field {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .field label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 5px;
    font-weight: 500;
  }
  .field input, .field select {
    background: var(--surface-tint);
    border: 1px solid var(--hairline);
    color: var(--text);
    padding: 9px 12px;
    font-size: 14px;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    font-weight: 500;
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
  }
  .field input:focus, .field select:focus {
    border-color: var(--accent);
    background: var(--surface-strong);
    box-shadow: 0 0 0 4px var(--accent-soft);
  }

  /* ============ PRESET BUTTONS ============ */
  .preset-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 14px;
    /* Vidinė padding'as 2px viršuje — kad mygtukai gali pakilti
     * 1px translateY animacijoje be tėvinio overflow:hidden apkarpymo. */
    padding-top: 2px;
  }
  .preset-btn {
    background: var(--surface-tint);
    border: 1px solid var(--hairline);
    color: var(--text-2);
    padding: 8px 4px 6px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 58px;
    line-height: 1.15;
    text-align: center;
  }
  .preset-btn svg {
    width: 38px;
    height: 22px;
    color: var(--text-2);
    transition: color 0.2s;
  }
  .preset-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(255, 106, 26, 0.12);
  }
  .preset-btn:hover svg { color: var(--accent); }
  .preset-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 2px 8px rgba(255, 106, 26, 0.18);
  }
  .preset-btn.active svg { color: var(--accent); }

  /* ============ CARGO ITEMS (Compact + Expandable) ============
   * Default — kompaktiška ~52px aukščio kortelė su visa info vienoje eilėje.
   * Paspaudus — atsiveria pilno redagavimo laukai (visi įvesties laukai
   * vienoje vietoje, kad nereikėtų skirtinguose dialoguose blaškytis). */
  .cargo-item {
    background: #ffffff;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    margin-bottom: 6px;
    position: relative;
    transition: all 0.2s;
    overflow: hidden;
  }
  .cargo-item:hover {
    border-color: var(--hairline-strong);
  }
  .cargo-item.expanded {
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(255, 106, 26, 0.1);
  }

  /* KOMPAKTIŠKA EILUTĖ — visada matoma */
  .cargo-compact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
  }
  .cargo-compact-color {
    width: 4px;
    align-self: stretch;
    border-radius: 2px;
    flex-shrink: 0;
  }
  .cargo-compact-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .cargo-compact-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cargo-compact-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .cargo-compact-dims {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 10px;
  }
  .cargo-compact-sep { opacity: 0.5; }
  .cargo-compact-weight { font-weight: 500; }
  .cargo-compact-flags {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
  }
  .cargo-flag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
  }
  .cargo-compact-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }
  .cargo-quick-btn {
    background: transparent;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.15s;
    padding: 0;
  }
  .cargo-quick-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
  }
  .cargo-quick-btn svg {
    width: 13px;
    height: 13px;
  }
  /* Delete mygtukas — raudonas hover'as kompaktiškoje eilutėje */
  .cargo-quick-btn.cargo-quick-delete:hover {
    background: rgba(226, 75, 74, 0.1);
    color: #E24B4A;
  }
  .cargo-compact-qty {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface-tint);
    padding: 3px 8px;
    border-radius: 6px;
    min-width: 32px;
    text-align: center;
    font-variant-numeric: tabular-nums;
  }
  .cargo-toggle-chevron {
    background: transparent;
    border: none;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    padding: 0;
    transition: transform 0.25s;
  }
  .cargo-toggle-chevron svg {
    width: 14px;
    height: 14px;
  }
  .cargo-item.expanded .cargo-toggle-chevron {
    transform: rotate(180deg);
  }

  /* IŠSKLEIDŽIAMAS BLOKAS — pasirodo tik .expanded būsenoje */
  .cargo-expanded-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.2s ease;
    padding: 0 12px;
    border-top: 1px solid transparent;
  }
  .cargo-item.expanded .cargo-expanded-body {
    max-height: 500px;
    opacity: 1;
    padding: 12px;
    border-top-color: var(--hairline);
  }
  .cargo-expanded-section {
    margin-bottom: 10px;
  }
  .cargo-expanded-section:last-of-type {
    margin-bottom: 8px;
  }
  .cargo-expanded-label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 4px;
  }
  .cargo-expanded-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .cargo-name-input-expanded {
    width: 100% !important;
    border: 1px solid var(--hairline) !important;
    border-style: solid !important;
    background: #fff !important;
    padding: 7px 10px !important;
    font-size: 12px !important;
    border-radius: 7px !important;
  }
  .cargo-name-input-expanded:focus {
    border-color: var(--accent) !important;
  }
  .cargo-expanded-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
  }
  .cargo-remove-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid var(--hairline);
    color: var(--muted);
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
  }
  .cargo-remove-btn:hover {
    background: var(--bad-soft, rgba(226,75,74,0.08));
    border-color: rgba(226, 75, 74, 0.3);
    color: var(--bad, #E24B4A);
  }
  .cargo-remove-btn svg {
    width: 12px;
    height: 12px;
  }

  /* Legacy stiliai (kad senas kodas neapsigriūtų, jei kažkur naudoja) */
  .cargo-head { display: flex; }
  .cargo-name { font-size: 13px; font-weight: 600; }
  .cargo-name-input {
    background: transparent;
    border: 1px dashed transparent;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    outline: none;
    font-family: inherit;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.15s;
    cursor: text;
  }
  .cargo-name-input:hover {
    border-color: rgba(255, 106, 26, 0.4);
    background: rgba(255, 106, 26, 0.05);
  }
  .cargo-name-input:focus {
    border-color: var(--accent);
    border-style: solid;
    background: #fff;
  }
  .cargo-color {
    width: 12px; height: 12px;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
  }
  .cargo-actions { display: flex; gap: 4px; }
  .icon-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.15s;
  }
  .icon-btn:hover {
    color: var(--bad);
    background: var(--bad-soft);
  }
  .cargo-dims {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .cargo-dims input {
    background: var(--surface-strong);
    border: 1px solid var(--hairline);
    color: var(--text);
    padding: 7px 8px;
    font-size: 12px;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    font-weight: 500;
    border-radius: var(--radius-xs);
    width: 100%;
    outline: none;
    transition: all 0.18s;
  }
  .cargo-dims input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  /* Vienodas stilius VISIEMS input'ams expanded body viduje (qty, weight, name) */
  .cargo-expanded-body input[type="number"],
  .cargo-expanded-body input[type="text"]:not(.cargo-name-input-expanded) {
    background: var(--surface-strong);
    border: 1px solid var(--hairline);
    color: var(--text);
    padding: 7px 10px;
    font-size: 12px;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    font-weight: 500;
    border-radius: var(--radius-xs);
    width: 100%;
    outline: none;
    transition: all 0.18s;
    box-sizing: border-box;
  }
  .cargo-expanded-body input[type="number"]:focus,
  .cargo-expanded-body input[type="text"]:not(.cargo-name-input-expanded):focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  /* iOS-stiliaus checkbox'ai cargo flags'ams — aiškiai matomi, su pill fonu.
   * Naudojami expanded režime tarp matmenų ir Pašalinti mygtuko.
   * Optimizuoti, kad telpa vienoje eilutėje net ir su LT vertimais. */
  .cargo-flags {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin-top: 10px;
    margin-bottom: 4px;
    width: 100%;
  }
  .cargo-flags label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    background: var(--surface-tint);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 10.5px;
    color: var(--muted);
    font-weight: 500;
    transition: all 0.15s;
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
  }
  .cargo-flags label:hover {
    border-color: var(--hairline-strong);
    color: var(--text);
  }
  /* Aktyvus (checked) — accent border ir tekstas */
  .cargo-flags label:has(input:checked) {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
  }
  .cargo-flags input[type="checkbox"] {
    accent-color: var(--accent);
    cursor: pointer;
    width: 13px;
    height: 13px;
    margin: 0;
    flex-shrink: 0;
  }
  .cargo-flags label span {
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* "Užbaigti" mygtukas — aiški iOS-stiliaus CTA. Užima visą eilutę,
   * kad vartotojas iškart suprastų: paspaudus uždaroma redagavimo kortelė. */
  .cargo-done-btn {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
  }
  .cargo-done-btn:hover {
    background: #E55A0F;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 106, 26, 0.25);
  }
  .cargo-done-btn:active {
    transform: translateY(0);
  }
  .cargo-done-btn svg {
    width: 14px;
    height: 14px;
  }

  /* ============ ADD / CALCULATE BUTTONS ============ */
  .cargo-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
  }
  .cargo-preset-btn {
    background: var(--surface-tint);
    border: 1px solid var(--hairline);
    color: var(--text);
    padding: 8px 10px;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .cargo-preset-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
  }
  .cargo-preset-btn .cp-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
  }
  .cargo-preset-btn .cp-dims {
    font-size: 10px;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    color: var(--muted);
    font-weight: 500;
  }

  .add-btn {
    width: 100%;
    background: var(--surface-tint);
    border: 1px dashed var(--hairline-strong);
    color: var(--muted);
    padding: 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
    margin-top: 4px;
  }
  .add-btn:hover {
    border-style: solid;
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
  }
  /* Smart Import mygtukas — išsiskiria nuo įprasto add-btn */
  .smart-import-btn {
    background: linear-gradient(135deg, #ff6a1a 0%, #ff8d4a 100%);
    color: #fff;
    border: none;
    margin-top: 6px;
    font-weight: 600;
  }
  .smart-import-btn:hover {
    background: linear-gradient(135deg, #e85f15 0%, #ff7d3a 100%);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 106, 26, 0.3);
  }

  /* ============ MODAL ============ */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: modal-fade-in 0.2s ease-out;
  }
  @keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  .modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modal-slide-in 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }
  @keyframes modal-slide-in {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--hairline);
  }
  .modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
  }
  .modal-close {
    background: transparent;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0 8px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
  }
  .modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text);
  }
  .modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
  }
  .modal-hint {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 12px;
    line-height: 1.5;
  }
  .modal-examples {
    background: var(--surface-tint);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
  }
  .examples-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 6px;
  }
  .examples-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .examples-list code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.04);
    padding: 4px 8px;
    border-radius: 6px;
  }
  #smart-import-text {
    width: 100%;
    min-height: 140px;
    padding: 12px 14px;
    border: 1px solid var(--hairline-strong);
    border-radius: 10px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    background: #fff;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.15s;
  }
  #smart-import-text:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 106, 26, 0.15);
  }
  .modal-preview {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface-tint);
    border-radius: 8px;
    font-size: 13px;
  }
  .preview-item.preview-error {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
  }
  .preview-item .preview-icon {
    font-size: 16px;
  }
  .preview-item .preview-name {
    font-weight: 600;
    color: var(--text);
  }
  .preview-item .preview-dims {
    color: var(--muted);
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12px;
  }
  .preview-item .preview-qty {
    margin-left: auto;
    font-weight: 600;
    color: var(--accent);
  }
  .modal-footer {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--hairline);
    background: var(--surface-tint);
  }
  .modal-footer .edit-btn {
    flex: 1;
    padding: 11px;
    font-size: 13px;
  }
  .smart-import-confirm {
    background: var(--accent) !important;
    color: #fff !important;
  }
  .smart-import-confirm:disabled {
    background: var(--hairline-strong) !important;
    color: var(--muted) !important;
    cursor: not-allowed;
  }
  .calc-btn {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 15px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    border-radius: var(--radius);
    margin-top: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.1);
  }
  .calc-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  }
  .calc-btn:active { transform: translateY(0); }

  /* ============ VIEW SECTION ============ */
  .label-mode-row {
    display: flex;
    background: var(--surface-tint);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    padding: 3px;
    backdrop-filter: blur(10px);
  }
  .label-mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 7px 10px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 999px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .label-mode-btn:hover { color: var(--text); }
  .label-mode-btn.active {
    background: var(--surface-strong);
    color: var(--text);
    box-shadow: var(--shadow-sm);
  }
  .view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
    font-weight: 500;
  }
  .view-toggle input {
    accent-color: var(--accent);
    cursor: pointer;
    width: 16px; height: 16px;
  }

  /* ============ VIEWPORT (3D area) ============ */
  .viewport {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background:
      radial-gradient(ellipse at top, rgba(255,255,255,0.6) 0%, transparent 60%),
      linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    border: 1px solid var(--hairline);
    box-shadow: var(--shadow);
  }
  #canvas-container { width: 100%; height: 100%; }

  /* ============ FLOATING GLASS PANELS ============ */
  .results, .selection-panel {
    position: absolute;
    background: var(--surface-strong);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
  }
  .results::before, .selection-panel::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 var(--inner-highlight);
  }
  .results {
    top: 20px;
    right: 20px;
    padding: 18px 22px;
    min-width: 270px;
    font-size: 12px;
    /* Ribojam aukštį, kad nepasislinktume už ekrano kai krovinių daug.
     * Apačios 20px paliekam view-buttons mygtukams + 80px buffer'ui. */
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    overflow-x: hidden;
    /* Smooth scroll'as kai vartotojas naviguoja per ilgą sąrašą */
    scroll-behavior: smooth;
    /* Plonas iOS stiliaus scroll bar — nedominuoja UI */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
  }
  .results::-webkit-scrollbar {
    width: 6px;
  }
  .results::-webkit-scrollbar-track {
    background: transparent;
  }
  .results::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
  }
  .results::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
  }
  .results-title {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hairline);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
  }
  .stat-label { color: var(--muted); font-weight: 500; }
  .stat-value {
    color: var(--text);
    font-weight: 600;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
  }
  .stat-value.ok { color: var(--ok); }
  .stat-value.bad { color: var(--bad); }
  .verdict {
    margin-top: 14px;
    padding: 12px;
    font-size: 13px;
    text-align: center;
    font-weight: 600;
    border-radius: var(--radius);
  }
  .verdict.ok {
    background: var(--ok-soft);
    color: var(--ok);
  }
  .verdict.bad {
    background: var(--bad-soft);
    color: var(--bad);
  }
  .legend {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--hairline);
    max-height: 200px;
    overflow-y: auto;
  }
  .legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
  }
  .legend-swatch {
    width: 14px; height: 14px;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
  }

  /* ============ SELECTION PANEL ============ */
  .selection-panel {
    top: 20px;
    left: 20px;
    padding: 16px 20px;
    min-width: 260px;
    font-size: 12px;
  }
  .sel-clear {
    cursor: pointer;
    background: var(--surface-tint);
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    font-size: 10px;
    font-weight: 500;
    text-transform: lowercase;
    color: var(--muted);
    letter-spacing: 0;
  }
  .sel-clear:hover { color: var(--accent); border-color: var(--accent); }
  .sel-dims {
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hairline);
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
  }
  .sel-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
  }
  .sel-btn {
    flex: 1;
    background: var(--surface-tint);
    border: 1px solid var(--hairline);
    color: var(--text);
    padding: 8px 10px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
  }
  .sel-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
  }
  .sel-btn-danger:hover {
    border-color: var(--bad);
    color: var(--bad);
    background: var(--bad-soft);
  }
  .sel-btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
  }
  .sel-btn[disabled]:hover { border-color: var(--hairline); color: var(--text); background: var(--surface-tint); }
  .sel-hint {
    font-size: 10px;
    color: var(--muted);
    line-height: 1.5;
  }

  /* ============ EDIT TOOLBAR ============ */
  .edit-toolbar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 0.5px solid var(--hairline);
    padding: 4px;
    border-radius: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    max-width: calc(100% - 620px);
    justify-content: center;
  }
  .edit-toolbar::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 var(--inner-highlight);
  }
  .edit-btn {
    background: transparent;
    border: none;
    color: var(--text);
    padding: 7px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }
  .edit-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
  }
  .edit-btn:active {
    transform: scale(0.97);
  }
  /* Tamsus mygtukas (PDF) — paryškintas accent veiksmas */
  .edit-btn[style*="#1a1a1a"] {
    padding: 7px 14px;
    border-radius: 10px;
  }

  /* ============ SCENE OVERLAY — Floating UI virš 3D scenos ============
   * iOS toggle stiliaus mygtukai apačioje kairėje (etikečių rodymas, LDM).
   * Tai pakeičia sidebar'o "Rodymas" sekciją, kad valdikliai būtų arčiau
   * vietos, kur veikia (3D scenoje). */
  .scene-overlay {
    position: absolute;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 0.5px solid var(--hairline);
    border-radius: 14px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    gap: 2px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    z-index: 5;
    font-family: inherit;
  }
  .scene-overlay-view {
    bottom: 20px;
    left: 20px;
  }
  .scene-overlay-divider {
    width: 1px;
    height: 22px;
    background: var(--hairline);
    margin: 0 2px;
  }

  /* iOS-stiliaus toggle switch — pilkas kai išjungtas, oranžinis kai įjungtas */
  .scene-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    cursor: pointer;
    user-select: none;
    border-radius: 10px;
    transition: background 0.15s;
  }
  .scene-toggle:hover {
    background: rgba(0, 0, 0, 0.03);
  }
  .scene-toggle input[type="checkbox"] {
    /* Slepiam tikrą checkbox'ą — vaizduojam savo switch'ą */
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
  }
  .scene-toggle-switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 18px;
    background: rgba(120, 120, 128, 0.32);
    border-radius: 999px;
    transition: background 0.2s ease;
    flex-shrink: 0;
  }
  .scene-toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  }
  .scene-toggle input:checked + .scene-toggle-switch {
    background: var(--accent);
  }
  .scene-toggle input:checked + .scene-toggle-switch::before {
    transform: translateX(12px);
  }
  .scene-toggle-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
  }

  /* "More" mygtukas — atveria popover su label mode pasirinkimu */
  .scene-overlay-more {
    background: transparent;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.15s;
    padding: 0;
    margin-left: 2px;
  }
  .scene-overlay-more:hover {
    background: var(--accent-soft);
    color: var(--accent);
  }
  .scene-overlay-more svg {
    width: 14px;
    height: 14px;
  }
  .scene-overlay-more.active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  /* Label mode popover — atveriasi virš more mygtuko */
  .scene-label-mode-popover {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 4px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid var(--hairline);
    border-radius: 10px;
    padding: 4px;
    display: none;
    flex-direction: column;
    gap: 1px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    min-width: 130px;
  }
  .scene-label-mode-popover.visible {
    display: flex;
  }
  .scene-popover-item {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.12s;
  }
  .scene-popover-item:hover {
    background: var(--surface-tint);
  }
  .scene-popover-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
  }

  /* ============ VIEW BUTTONS ============
   * Tekstiniai mygtukai vietoj ViewCube. Apačioje dešinėje, segmentinis
   * iOS-style indikatorius — vienu paspaudimu perjungia kamerą į norimą
   * vaizdą (3D, iš viršaus, iš šono, iš priekio). */
  .view-buttons {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 0.5px solid var(--hairline);
    border-radius: 12px;
    padding: 3px;
    gap: 1px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    z-index: 5;
  }
  .view-btn {
    background: transparent;
    border: none;
    padding: 7px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-radius: 9px;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .view-btn:hover {
    color: var(--text);
  }
  .view-btn.active {
    background: #fff;
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 600;
  }
  .view-btn:active {
    transform: scale(0.97);
  }

  .edit-toggle {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    cursor: pointer;
    user-select: none;
  }
  .edit-toggle input { accent-color: var(--accent); width: 14px; height: 14px; }

  /* ============ TOAST ============ */
  .toast {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.92);
    backdrop-filter: blur(20px);
    color: #fff;
    padding: 12px 22px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
    box-shadow: var(--shadow-lg);
  }
  .toast.visible { opacity: 1; }

  /* ============ HINTS at bottom ============ */
  .controls-hint {
    position: absolute;
    background: var(--surface-tint);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 10px 16px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    bottom: 20px;
    right: 20px;
  }

  /* ============ BOX & LDM LABELS ============ */
  .box-label {
    background: rgba(20, 20, 20, 0.82);
    backdrop-filter: blur(10px);
    color: #fff;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    padding: 4px 10px;
    border-radius: 999px;
    pointer-events: none;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translate(-50%, -50%);
    user-select: none;
    box-shadow: var(--shadow-sm);
  }
  .box-label.selected {
    background: var(--accent);
    color: var(--text);
    box-shadow: 0 4px 12px var(--accent-glow);
  }
  .ldm-marker {
    color: var(--text-2);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 10px;
    font-weight: 600;
    pointer-events: none;
    transform: translate(-50%, -50%);
    user-select: none;
    opacity: 0.75;
    letter-spacing: 0.2px;
  }
  .cab-label {
    background: var(--primary);
    color: var(--accent);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 5px 12px;
    border-radius: 999px;
    pointer-events: none;
    white-space: nowrap;
    transform: translate(-50%, -50%);
    user-select: none;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.1);
  }

  /* ============ FLASH ANIMATION ============ */
  .invalid-flash { animation: flashRed 0.4s ease; }
  @keyframes flashRed {
    0%, 100% { }
    50% { background: var(--bad-soft); }
  }

  /* ============ SCROLLBARS ============ */
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); background-clip: padding-box; border: 2px solid transparent; }

  /* ============ iOS-STYLE TRUCK SUMMARY CELL ============
   * iOS Settings.app inspired: balta kortelė pilkame fone, su accent ikona
   * dėžutėje, pavadinimu, metrikomis ir chevron rodykle. Visa eilutė yra
   * paspaudžiama — atveria pilną sunkvežimio redagavimo formą.
   *
   * Vizualinė hierarchija:
   *   [orange icon box]  Standartinis            >
   *                      L 1360 · W 245 · H 270 · 24t
   */
  .section-title-compact {
    padding: 0 !important;
    margin: 0 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text) !important;
    display: block !important;
  }
  .section-title-compact::before { display: none !important; }
  .truck-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    padding: 10px 12px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--hairline);
    transition: all 0.2s ease;
    user-select: none;
  }
  .truck-summary:hover {
    border-color: var(--hairline-strong);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  }
  .truck-summary:active {
    transform: translateY(0);
    background: var(--surface-tint);
  }
  /* Accent ikona dėžutėje, iOS Settings.app stiliumi */
  .truck-name-badge {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: var(--accent-soft);
    border-radius: 8px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    gap: 0 !important;
  }
  .truck-name-badge svg {
    width: 16px; height: 16px;
    color: var(--accent);
  }
  /* Tekstinis dalies blokas — pavadinimas + matmenys eile žemiau */
  .truck-name-badge > span {
    display: none; /* tekstas perkeliamas į kitur (truck-info) */
  }
  .truck-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .truck-info-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .truck-dims-inline {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
  }
  /* Chevron > rodyklė dešinėje (iOS stilius) */
  .truck-collapse-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #c0c0c0;
    transition: transform 0.25s ease, color 0.2s;
    padding: 0;
  }
  .truck-summary:hover .truck-collapse-btn {
    color: var(--muted);
  }
  .truck-collapse-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
  }
  .truck-body.collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.2s ease, padding 0.2s ease;
    margin: 0;
    padding: 0;
  }
  .truck-body {
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    overflow: hidden;
    margin-top: 12px;
  }
  /* Kai atverta — chevron pasisuka 90° (> tampa ^) */
  .section-title-compact.expanded .truck-collapse-btn svg {
    transform: rotate(90deg);
  }
  /* Sekcijos truck section padding'as su iOS-style "inset" jausmu */
  .section-truck {
    padding: 14px 16px !important;
  }
  .section-truck::before { display: none !important; }

  /* ============ CARGO DUAL CTA GRID ============
   * Du mygtukai šalia — paprastas pridėjimas ir Smart importas.
   * Vartotojui aiškiai parodo, kad yra du būdai. */
  .cargo-cta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
  }
  .cargo-cta-btn {
    padding: 11px 10px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .cargo-cta-manual {
    background: var(--surface-tint);
    color: var(--text);
    border: 1px dashed var(--hairline-strong);
  }
  .cargo-cta-manual:hover {
    border-style: solid;
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft, rgba(255,106,26,0.06));
  }
  .cargo-cta-smart {
    background: linear-gradient(135deg, #ff6a1a 0%, #ff8d4a 100%);
    color: #fff;
  }
  .cargo-cta-smart:hover {
    background: linear-gradient(135deg, #e85f15 0%, #ff7d3a 100%);
    box-shadow: 0 2px 8px rgba(255, 106, 26, 0.3);
  }

  /* ============ CARGO PRESETS — Collapsible ============
   * Greitos paletės dabar yra "details" elementas — paslėpta pagal default.
   * Vartotojas paspaudžia "Greitos paletės ▼" kad išskleistų. */
  .cargo-presets-collapse {
    margin-top: 10px;
  }
  .cargo-presets-summary {
    cursor: pointer;
    list-style: none;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 500;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
  }
  .cargo-presets-summary::-webkit-details-marker { display: none; }
  .cargo-presets-summary::after {
    content: '▾';
    font-size: 9px;
    transition: transform 0.2s;
    color: var(--muted);
  }
  .cargo-presets-collapse[open] .cargo-presets-summary::after {
    transform: rotate(180deg);
  }
  .cargo-presets-collapse .cargo-presets {
    margin-top: 6px;
  }

  /* ============ SECTION LABELS ============
   * Maži pilki UPPERCASE label'ai tarp blokų (greitos paletės, kroviniai)
   * — vizualinė hierarchija be pertekliaus. */
  .cargo-presets-label,
  .cargo-list-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 600;
    margin-top: 14px;
    margin-bottom: 8px;
  }
  /* Header su label kairėje + pack mode toggle dešinėje */
  .cargo-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    margin-bottom: 8px;
  }
  .cargo-list-header .cargo-list-label {
    margin: 0;
  }
  /* Pack mode toggle — du iconinai mygtukai iOS-style segmented control */
  .pack-mode-toggle {
    display: inline-flex;
    background: var(--surface-tint);
    border-radius: 8px;
    padding: 2px;
    gap: 1px;
  }
  .pack-mode-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.15s;
    padding: 0;
  }
  .pack-mode-btn svg {
    width: 13px; height: 13px;
  }
  .pack-mode-btn:hover { color: var(--text); }
  .pack-mode-btn.active {
    background: #fff;
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }

  /* ============ SUBTLE STICKY CALCULATE BUTTON ============
   * Apačios "Apskaičiuoti pakrovimą" mygtukas visada matomas (sticky),
   * bet švelnus — oranžinis outline, ne juoda dėmė. Hover'as užpildo
   * oranžine spalva. Vartotojui visada matomas, bet nekrenta į akis. */
  .calc-btn-subtle {
    margin-top: auto; /* Tegul mygtukas spaudžiamas link sekcijos apačios,
                         o ne klajoja viduryje kai krovinių mažai. */
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--accent) !important;
    border: 1px solid var(--accent) !important;
    font-weight: 600;
    transition: all 0.2s;
    position: sticky;
    bottom: 12px;
    z-index: 3;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Switlus accent glow, kad mygtukas atrodytų kaip galutinis CTA, ne
     * neutralus dar vienas elementas. */
    box-shadow: 0 0 0 4px rgba(255, 106, 26, 0.06);
  }
  .calc-btn-subtle:hover {
    background: var(--accent) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(255, 106, 26, 0.25);
  }

  /* ============ COLLAPSED CARGO CARDS ============
   * Krovinių kortelės — visada matomos su matmenimis, bet kompaktiškesnės.
   * Detalūs nustatymai (svoris, stack, rotate) atveriami paspaudus kortelę. */
  /* Note: čia tik papildomi tweaks, pagrindinis cargo-item stilius lieka */

  /* ============ SMART WIDGET PANEL ============
   * Pakeičia statinę Pakrovimo analizės lentelę į iOS stiliaus widget'us.
   * Kiekvienas widget'as — atskira kortelė su aiškiu pavadinimu, dideliu
   * skaičiumi ir vizualiniu indikatorium (progress bar arba badge).
   *
   * Spalvos:
   *   Žalia (<70%) — saugu, daug vietos
   *   Geltona (70-90%) — beveik užimta
   *   Raudona (>90% / >100%) — pilna arba per pilna
   */

  /* Sekcijos antraštė */
  .results-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 8px;
    padding: 0 4px;
  }
  .results-section-title svg {
    width: 12px;
    height: 12px;
  }

  /* Pamatinis widget'o stilius — visi widget'ai paveldi */
  .widget {
    background: #ffffff;
    border-radius: 14px;
    border: 0.5px solid var(--hairline);
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: all 0.2s;
  }
  .widget-header {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .widget-header > svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
  }
  .widget-header > span:first-of-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
  }
  .widget-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 4px;
    font-size: 9px;
  }
  .widget-footer-left {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .widget-footer-right {
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  /* Bendras horizontal bar (per visą plotį) */
  .widget-bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 6px;
  }
  .widget-bar-fill {
    height: 100%;
    width: 0%;
    background: #97C459;
    border-radius: 999px;
    transition: width 0.3s, background 0.3s;
  }

  /* Spalvų klasės (pridedamos JS) */
  .widget-bar-fill.warn { background: #EF9F27; }
  .widget-bar-fill.danger { background: #E24B4A; }
  .widget-footer-right.warn { color: #BA7517; }
  .widget-footer-right.danger { color: #C73C3A; }
  .widget-footer-right.ok { color: #639922; }

  /* ----- STATUS WIDGET ----- */
  .widget-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(151, 196, 89, 0.08), rgba(99, 153, 34, 0.04));
    border-color: rgba(99, 153, 34, 0.2);
  }
  .widget-status.warn {
    background: linear-gradient(135deg, rgba(239, 159, 39, 0.1), rgba(186, 117, 23, 0.05));
    border-color: rgba(186, 117, 23, 0.25);
  }
  .widget-status.danger {
    background: linear-gradient(135deg, rgba(226, 75, 74, 0.1), rgba(199, 60, 58, 0.05));
    border-color: rgba(199, 60, 58, 0.25);
  }
  .widget-status.empty {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.01));
    border-color: var(--hairline);
  }
  .widget-status-icon {
    width: 32px;
    height: 32px;
    background: #1D9E75;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
  }
  .widget-status.warn .widget-status-icon { background: #EF9F27; }
  .widget-status.danger .widget-status-icon { background: #E24B4A; }
  .widget-status.empty .widget-status-icon { background: #aaa; }
  .widget-status-icon svg {
    width: 18px;
    height: 18px;
  }
  .widget-status-text {
    flex: 1;
    min-width: 0;
  }
  .widget-status-title {
    font-size: 13px;
    font-weight: 600;
    color: #157A5A;
    line-height: 1.2;
  }
  .widget-status.warn .widget-status-title { color: #93590F; }
  .widget-status.danger .widget-status-title { color: #B83332; }
  .widget-status.empty .widget-status-title { color: var(--text); }
  .widget-status-sub {
    font-size: 10px;
    color: #6B8678;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
  }
  .widget-status.warn .widget-status-sub { color: #6B5C2C; }
  .widget-status.danger .widget-status-sub { color: #8B4847; }
  .widget-status.empty .widget-status-sub { color: var(--muted); }

  /* ----- PAIR (2 widget'ai šalia) ----- */
  .widget-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }
  .widget-pair .widget {
    margin-bottom: 0;
  }

  /* ----- METRIC widget (Svoris, Tūris) ----- */
  .widget-big-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    display: flex;
    align-items: baseline;
  }
  .widget-unit {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    margin-left: 2px;
  }

  /* ----- LDM widget ----- */
  .widget-ldm .widget-header {
    margin-bottom: 8px;
  }
  .widget-badge {
    margin-left: auto;
    background: rgba(99, 153, 34, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    color: #639922;
    font-variant-numeric: tabular-nums;
  }
  .widget-badge.warn {
    background: rgba(186, 117, 23, 0.1);
    color: #BA7517;
  }
  .widget-badge.danger {
    background: rgba(199, 60, 58, 0.1);
    color: #C73C3A;
  }
  .widget-ldm-main {
    display: flex;
    align-items: baseline;
    gap: 6px;
  }
  .widget-ldm-big {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1;
  }
  .widget-ldm-divider {
    font-size: 14px;
    color: var(--muted);
  }
  .widget-ldm-total {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .widget-ldm-subs {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    font-size: 10px;
  }
  .widget-ldm-sub {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .widget-ldm-sub-label {
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
  }
  .widget-ldm-sub-value {
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
  }
  .widget-ldm-sub-value.widget-ldm-sub-accent {
    color: var(--accent);
  }

  /* ----- SPACE widget ----- */
  .widget-space .widget-header {
    margin-bottom: 8px;
  }
  /* Kai progress bar yra SUJUNGTAS LDM widget'o apačioje, pridedam viršuje
   * tarpą atskirti nuo sub-rodiklių (Teorinis/Praktinis/Laisva) */
  .widget-ldm .widget-space-bar.widget-ldm-bar {
    margin-top: 12px;
  }
  .widget-space-pct {
    margin-left: auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
  }
  .widget-space-bar {
    height: 28px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 4px;
  }
  .widget-space-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(180deg, #D85A30, #993C1D);
    border-radius: 6px;
    transition: width 0.3s, background 0.3s;
  }
  .widget-space-fill.ok { background: linear-gradient(180deg, #97C459, #639922); }
  .widget-space-fill.warn { background: linear-gradient(180deg, #EF9F27, #BA7517); }
  .widget-space-fill.danger { background: linear-gradient(180deg, #E24B4A, #C73C3A); }

  /* ----- TYPES widget ----- */
  .widget-types .widget-header {
    margin-bottom: 10px;
  }
  .widget-types-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-secondary, var(--muted));
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  .widget-types-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* Kai krovinių tipų daug (10+), sąrašas auga ir gali per daug išsiplėsti.
     * Ribojam aukštį iki ~8 eilučių (apie 200px), o likusieji scroll'inami. */
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Plonas scroll bar — nedominuoja UI */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
    /* Mažas padding dešinėje, kad scrollbar'as neperdengtų teksto */
    padding-right: 4px;
    margin-right: -4px;
  }
  .widget-types-list::-webkit-scrollbar {
    width: 4px;
  }
  .widget-types-list::-webkit-scrollbar-track {
    background: transparent;
  }
  .widget-types-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 2px;
  }
  .widget-types-list .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    background: transparent;
    border: none;
    padding: 0;
  }
  .widget-types-list .legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
  }

  /* ============ TABLET BREAKPOINT (801-1280px) ============
   * Tablet režime — sidebar siauresnis, toolbar kompaktiškesnis.
   * Widget panel'is dešinėje lieka matomas (jis nebe per platus, dabar
   * yra iOS widget'ai, ne lentelė kaip anksčiau). */
  @media (min-width: 801px) and (max-width: 1280px) {
    /* App pertvarko: sidebar siauresnis (320px), nes turim mažiau vietos */
    .app {
      grid-template-columns: 320px 1fr;
    }
    /* Edit toolbar — kompaktiškesnis tablet'e (mažesnis padding, mažesnis font) */
    .edit-toolbar {
      padding: 5px;
      gap: 3px;
      top: 16px;
    }
    .edit-btn {
      padding: 6px 11px;
      font-size: 11px;
    }
  }

  /* ============ RESPONSIVE — Mobile bottom sheet layout ============
   *
   * Mobile strategija: 3D scena užima pilną ekraną, sidebar paslepiamas
   * kaip "bottom sheet" (slenkantis panelis iš apačios). Vartotojas
   * paspaudžia floating action mygtuką, kad atvertų / uždarytų panelį.
   *
   * Tai įprasta paradigma iš Google Maps, Figma mobile ir kt. — leidžia
   * 3D ekvivalentui užimti pilną ekraną, kuomet sidebar reikia tik
   * periodiškai (keičiant nustatymus ar pridedant krovinį).
   */
  @media (max-width: 800px) {
    .app {
      grid-template-columns: 1fr;
      grid-template-rows: 1fr;
      padding: 0;
      gap: 0;
    }
    /* Sidebar tampa bottom sheet — slankojantis panelis iš apačios */
    .sidebar {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      top: auto;
      width: 100%;
      max-height: 75vh;
      height: 75vh;
      border-radius: 20px 20px 0 0;
      transform: translateY(calc(100% - 56px));
      transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
      z-index: 100;
      box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
    }
    .sidebar.mobile-open {
      transform: translateY(0);
    }
    /* "Drag handle" indikatorius viršuje — vizualinė užuomina, kad
       panelį galima patempti / paliesti */
    .sidebar::after {
      content: '';
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
      width: 40px;
      height: 5px;
      background: rgba(0,0,0,0.18);
      border-radius: 3px;
      pointer-events: none;
    }
    /* Mobile peek tab — viršutinė juosta, kuri matoma kai panelis uždarytas */
    .mobile-sheet-peek {
      display: flex !important;
      align-items: center;
      justify-content: center;
      gap: 8px;
      height: 56px;
      padding: 0 20px;
      cursor: pointer;
      user-select: none;
      flex-shrink: 0;
      font-weight: 600;
      font-size: 15px;
      color: var(--text);
      border-bottom: 1px solid var(--hairline);
    }
    .mobile-sheet-peek svg {
      width: 18px; height: 18px;
      transition: transform 0.32s;
    }
    .sidebar.mobile-open .mobile-sheet-peek svg {
      transform: rotate(180deg);
    }
    /* Bottom sheet turinys turi turėti scroll'ą */
    .sidebar > *:not(.mobile-sheet-peek) {
      padding-left: 16px;
      padding-right: 16px;
    }
    /* 3D scena užima pilną ekraną */
    .main {
      border-radius: 0;
      height: 100vh;
    }
    /* Edit toolbar mobile — kompaktinis. JS pakeičia mygtuko tekstą į
       ikoną (data-mobile atributas), todėl CSS čia tik mažina paddings. */
    .edit-toolbar {
      max-width: calc(100% - 80px);
      left: 12px;
      right: 60px;
      top: 12px;
      transform: none;
      padding: 5px;
      gap: 2px;
      font-size: 14px;
      justify-content: flex-start;
      flex-wrap: nowrap;
      overflow: hidden;
    }
    .edit-btn {
      padding: 8px 10px !important;
      font-size: 15px !important;
      min-width: 36px;
    }
    /* Gravitacijos toggle mobile — paslepiame label tekstą, paliekam tik
       checkbox (oranžinis kvadratėlis) */
    .edit-toggle {
      padding: 4px 6px !important;
      gap: 0 !important;
    }
    .edit-toggle span {
      display: none;
    }
    /* Mažesnis header mobile */
    .header { padding: 10px 14px 8px 14px !important; }
    .logo-img { width: 40px !important; height: 40px !important; }
    .logo-name { font-size: 15px !important; }
    .logo-version { font-size: 9px !important; }
    .tagline-only { font-size: 10px !important; margin-top: 4px !important; }
    .app-title-compact { font-size: 14px !important; margin-top: 8px !important; }
    h1 { font-size: 22px !important; }
    .tagline { font-size: 11px !important; }
    /* Preset mygtukai mobile — kompaktiškesnis */
    .preset-btn { padding: 8px 6px !important; font-size: 11px !important; }
    .preset-btn svg { width: 28px !important; height: 28px !important; }
  }
  /* Desktop — paslėpiam mobile peek juostą */
  .mobile-sheet-peek {
    display: none;
  }
  /* Desktop — paslėpiam mobile results toggle mygtuką */
  .mobile-results-toggle {
    display: none;
  }
  /* ============ RESPONSIVE — Loading Analysis ant mobile ============
   *
   * Mobile režime analizės panelis užima ekrane vietos. Paslepiam jį
   * po toggle mygtuku (apvalus mygtukas viršuje dešinėje). Vartotojas
   * paspaudžia — panelis išplaukia, vėl paspaudžia — paslepiama.
   */
  @media (max-width: 800px) {
    /* Pagal default — analizės panelis paslėptas */
    .results {
      display: none !important;
    }
    /* Paspaudus toggle mygtuką — pakeičiame į display: block */
    .results.mobile-visible {
      display: block !important;
      position: fixed;
      top: 70px;
      right: 12px;
      left: auto;
      max-width: calc(100% - 24px);
      max-height: 60vh;
      overflow-y: auto;
      z-index: 90;
      border-radius: 14px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    }
    /* Selection panel taip pat slepiasi mobile pagal default */
    .selection-panel {
      position: fixed !important;
      top: 70px;
      right: 12px;
      left: auto;
      max-width: calc(100% - 24px);
      z-index: 91;
    }
    /* Mobile toggle mygtukas — apvalus, viršuje dešinėje */
    .mobile-results-toggle {
      display: flex !important;
      position: fixed;
      top: 12px;
      right: 12px;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: var(--surface);
      border: 1px solid var(--hairline);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      box-shadow: 0 2px 8px rgba(0,0,0,0.12);
      align-items: center;
      justify-content: center;
      color: var(--text);
      cursor: pointer;
      z-index: 95;
      transition: background 0.2s, transform 0.2s;
    }
    .mobile-results-toggle svg {
      width: 20px;
      height: 20px;
    }
    .mobile-results-toggle.active {
      background: var(--accent);
      color: white;
    }
  }
