  /* v0.10 - mobile iframe scale fix */
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: Arial, sans-serif; background: #0f0f1a; color: #eee; min-height: 100vh; }

  /* AUTH */
  #auth-screen {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 100vh; gap: 24px;
  }
  #auth-screen h1 { font-size: 2em; color: #f0c040; }
  #auth-screen p { color: #888; }
  .btn-google {
    display: flex; align-items: center; gap: 12px;
    background: #fff; color: #333; border: none; border-radius: 8px;
    padding: 12px 24px; font-size: 1em; cursor: pointer; font-weight: bold;
    transition: background 0.2s;
  }
  .btn-google:hover { background: #f0f0f0; }
  .btn-google img { width: 22px; }

  /* LAYOUT */
  #app { display: none; }
  header {
    background: #16213e; border-bottom: 1px solid #0f3460;
    padding: 12px 24px; display: flex; align-items: center; justify-content: space-between;
  }
  header h1 { color: #f0c040; font-size: 1.1em; }
  .user-info { display: flex; align-items: center; gap: 12px; font-size: 0.85em; color: #aaa; }
  .btn-logout {
    background: #0f3460; color: #eee; border: none; border-radius: 6px;
    padding: 6px 12px; cursor: pointer; font-size: 0.8em;
  }
  .btn-logout:hover { background: #e57373; }

  main { padding: 24px; max-width: 1100px; margin: 0 auto; }

  /* PROJECTS VIEW */
  #projects-view h2 { color: #f0c040; margin-bottom: 16px; }
  .projects-toolbar {
    display: flex; flex-wrap: wrap; gap: 10px;
    background: #16213e; border: 1px solid #0f3460; border-radius: 10px;
    padding: 12px; margin-bottom: 16px;
  }
  .projects-toolbar input, .projects-toolbar select {
    background: #0f0f1a; color: #eee; border: 1px solid #0f3460;
    border-radius: 7px; padding: 8px 12px; font-size: 0.9em;
  }
  .projects-toolbar input { flex: 2 1 260px; }
  .projects-toolbar select { flex: 1 1 150px; }
  .projects-toolbar input:focus, .projects-toolbar select:focus {
    outline: none; border-color: #f0c040;
  }
  .btn-reset-filters {
    background: #0f3460; color: #aaa; border: none; border-radius: 7px;
    padding: 8px 12px; font-size: 0.85em; cursor: pointer;
  }
  .btn-reset-filters:hover { color: #eee; background: #1a4a80; }
  .projects-table { width: 100%; border-collapse: collapse; font-size: 0.88em; }
  .projects-table th { background: #0f3460; color: #f0c040; padding: 10px 12px; text-align: left; cursor: pointer; user-select: none; white-space: nowrap; }
  .projects-table th:hover { background: #1a4a80; }
  .projects-table td { padding: 9px 12px; border-bottom: 1px solid #ffffff0d; vertical-align: middle; }
  .projects-table tr:hover td { background: #0f346044; cursor: pointer; }
  .projects-table .td-name { color: #eee; font-weight: bold; }
  .projects-table .td-client { color: #aaa; }
  .projects-table .td-actions { display: flex; gap: 6px; }
  .status-badge {
    display: inline-block;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 0.78em;
    font-weight: bold;
  }
  .status-active { background: #4caf5022; color: #81c784; border: 1px solid #4caf5055; }
  .status-completed { background: #64b5f622; color: #64b5f6; border: 1px solid #64b5f655; }
  .status-paused { background: #f0c04022; color: #f0c040; border: 1px solid #f0c04055; }

  .btn-add {
    display: flex; align-items: center; gap: 8px;
    background: #f0c040; color: #0f0f1a; border: none; border-radius: 8px;
    padding: 10px 20px; font-size: 0.9em; font-weight: bold; cursor: pointer;
    transition: background 0.2s;
  }
  .btn-add:hover { background: #e0b030; }

  /* ITEMS VIEW */
  #items-view { display: none; }
  .back-btn {
    background: none; border: none; color: #f0c040; cursor: pointer;
    font-size: 0.9em; margin-bottom: 16px; display: flex; align-items: center; gap: 6px;
  }
  .back-btn:hover { text-decoration: underline; }
  .items-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
  .items-header h2 { color: #f0c040; }

  table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
  th { background: #0f3460; color: #f0c040; padding: 9px 10px; text-align: left; }
  td { padding: 8px 10px; border-bottom: 1px solid #ffffff0d; vertical-align: middle; }
  tr:hover td { background: #0f346033; }
  .td-name { color: #eee; font-weight: bold; }
  .td-actions { display: flex; gap: 6px; }
  .btn-sm {
    border: none; border-radius: 5px; padding: 4px 10px;
    font-size: 0.8em; cursor: pointer;
  }
  .btn-edit { background: #0f3460; color: #64b5f6; }
  .btn-edit:hover { background: #1a4a80; }
  .btn-del { background: #e5737322; color: #e57373; }
  .btn-del:hover { background: #e5737344; }

  /* ITEM CARD */
  #item-card { display: none; }
  .item-card-wrap {
    background: #16213e; border-radius: 14px; padding: 28px;
    border: 1px solid #0f3460;
  }
  @media (max-width: 600px) {
    .item-card-wrap { padding: 14px; }
  }
  .item-card-wrap h2 { color: #eee; margin-bottom: 6px; font-size: 1.3em; }
  .item-card-section { margin-top: 20px; border-top: 1px solid #0f346066; padding-top: 16px; }
  .item-card-section h4 { color: #f0c040; font-size: 0.8em; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
  .item-card-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
  .item-card-field label { display: block; font-size: 0.75em; color: #888; margin-bottom: 2px; }
  .item-card-field .val { color: #eee; font-size: 0.92em; }
  .item-card-field .val a { color: #64b5f6; text-decoration: none; }
  .item-card-field .val a:hover { text-decoration: underline; }
  .link-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: #0f3460; color: #64b5f6; border: none; border-radius: 8px;
    padding: 8px 16px; font-size: 0.88em; cursor: pointer;
    text-decoration: none; transition: background 0.2s;
  }
  .link-btn:hover { background: #1a4a80; }
  .link-btn-green { background: #1a3a20; color: #81c784; }
  .link-btn-green:hover { background: #1a4a25; }
  .video-embed-wrap {
    margin-top: 12px;
    border-radius: 10px;
    background: #000;
    width: 100%;
    position: relative;
    padding-top: 56.25%;
    height: 0;
    overflow: hidden;
  }
  .video-embed-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
  }
  #card-links-fields .video-embed-wrap {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
  }
  .item-card-notes { margin-top: 16px; }
  .item-card-notes label { display: block; font-size: 0.75em; color: #888; margin-bottom: 6px; }
  .item-card-notes .val { color: #ccc; font-size: 0.9em; line-height: 1.6; white-space: pre-wrap; }
  .card-actions { display: flex; gap: 10px; margin-top: 24px; }
  .btn-back-card { background: #0f3460; color: #aaa; border: none; border-radius: 7px; padding: 8px 18px; cursor: pointer; font-size: 0.9em; }
  .btn-edit-card { background: #f0c040; color: #0f0f1a; border: none; border-radius: 7px; padding: 8px 20px; font-weight: bold; cursor: pointer; font-size: 0.9em; }

  /* MODAL */
  .modal-overlay {
    display: none; position: fixed; inset: 0;
    background: #000000aa; z-index: 100; align-items: center; justify-content: center;
  }
  .modal-overlay.open { display: flex; }
  .modal {
    background: #16213e; border-radius: 14px; padding: 24px;
    width: 90%; max-width: 520px; max-height: 90vh; overflow-y: auto;
    border: 1px solid #0f3460;
  }
  .modal h3 { color: #f0c040; margin-bottom: 18px; }
  .form-group { margin-bottom: 14px; }
  .form-group label { display: block; font-size: 0.82em; color: #aaa; margin-bottom: 5px; }
  .form-group input, .form-group textarea, .form-group select {
    width: 100%; background: #0f0f1a; color: #eee; border: 1px solid #0f3460;
    border-radius: 7px; padding: 8px 12px; font-size: 0.9em;
  }
  .form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: #f0c040;
  }
  .form-group textarea { min-height: 80px; resize: vertical; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
  .btn-cancel { background: #0f3460; color: #aaa; border: none; border-radius: 7px; padding: 8px 18px; cursor: pointer; }
  .btn-save { background: #f0c040; color: #0f0f1a; border: none; border-radius: 7px; padding: 8px 18px; font-weight: bold; cursor: pointer; }
  .btn-save:hover { background: #e0b030; }

  .screenshots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
  }
  @media (max-width: 900px) {
    .item-card-fields { grid-template-columns: 1fr; }
  }
  @media (max-width: 600px) {
    .screenshots-grid { grid-template-columns: 1fr; }
    main { padding: 12px; }
  }
  .screenshot-thumb {
    position: relative; border-radius: 8px; overflow: hidden;
    aspect-ratio: 16/9; background: #0a0a1a; cursor: pointer;
  }
  .screenshot-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
  }
  .screenshot-thumb .del-btn {
    position: absolute; top: 4px; right: 4px;
    background: #00000088; color: #e57373; border: none;
    border-radius: 4px; padding: 2px 6px; cursor: pointer;
    font-size: 0.85em; display: none;
  }
  .screenshot-thumb:hover .del-btn { display: block; }
  .drop-zone {
    border: 2px dashed #0f3460; border-radius: 10px;
    padding: 24px; text-align: center; color: #555;
    cursor: pointer; transition: border-color 0.2s; margin-top: 12px;
  }
  .drop-zone:hover, .drop-zone.drag-over { border-color: #f0c040; color: #f0c040; }
  .drop-zone input[type="file"] { display: none; }

  /* Лайтбокс */
  .lightbox {
    display: none; position: fixed; inset: 0;
    background: #000000cc; z-index: 200;
    align-items: center; justify-content: center;
  }
  .lightbox.open { display: flex; }
  .lightbox img {
    max-width: 90vw; max-height: 90vh;
    border-radius: 10px; object-fit: contain;
  }
  .lightbox-close {
    position: absolute; top: 20px; right: 24px;
    background: none; border: none; color: #fff;
    font-size: 2em; cursor: pointer;
  }
  .lightbox-prev, .lightbox-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: #ffffff22; border: none; color: #fff;
    font-size: 2em; cursor: pointer; padding: 10px 16px;
    border-radius: 8px;
  }
  .lightbox-prev { left: 16px; }
  .lightbox-next { right: 16px; }

  .video-mobile-btn {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; background: #0f3460; color: #eee;
    border: none; border-radius: 10px; padding: 16px 24px;
    font-size: 1em; cursor: pointer; width: 100%; margin-top: 12px;
    transition: background 0.2s; text-decoration: none;
  }
  .video-mobile-btn:hover { background: #1a4a80; }

  .loading { text-align: center; padding: 40px; color: #888; }
  .empty { text-align: center; padding: 40px; color: #555; }
