/* БЛОК: Phone — max-width 768px */
/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
  }
  body {
    overflow: hidden;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 200;
    border-radius: 0 16px 16px 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    width: min(85vw, 280px);
    max-height: 100dvh;
    overflow: hidden;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-main { flex: 1; min-height: 0; }
  .sidebar-toggle { display: flex; }
  .file-controls {
    padding: 0 12px 8px;
  }
  .file-control-btn {
    font-size: 13px;
    padding: 6px 8px;
  }
  .header {
    padding: var(--safe-top) 12px 0;
    padding-left: calc(12px + var(--safe-left));
    padding-right: calc(12px + var(--safe-right));
    min-height: 52px;
    gap: 8px;
  }
  .header-bar {
    height: 36px;
    gap: 8px;
  }
  .header-brand {
    height: 36px;
    font-size: 14px;
    gap: 6px;
  }
  .header-bar-sep {
    line-height: 36px;
    font-size: 16px;
  }
  .header-bar {
    flex: 1;
    min-width: 0;
  }
  .breadcrumb {
    height: 36px;
    font-size: 14px;
    line-height: 36px;
    flex: 1;
    min-width: 0;
  }
  .breadcrumb a.breadcrumb-seg {
    max-width: 8em;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .breadcrumb a,
  .breadcrumb span,
  .breadcrumb .current,
  .breadcrumb .sep {
    height: 36px;
    line-height: 36px;
  }
  .file-controls-inner {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }
  .file-controls-inner::-webkit-scrollbar { display: none; }
  .file-dropdown-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto !important;
    bottom: calc(12px + var(--safe-bottom));
    max-height: 50dvh;
    overflow-y: auto;
    min-width: 0;
  }
  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
    padding: 8px 12px 16px;
  }
  .grid-icon-wrap {
    width: 48px;
    height: 48px;
  }
  .file-name {
    word-break: break-word;
  }
  .image-viewer,
  .video-viewer {
    padding: calc(20px + var(--safe-top)) calc(20px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(20px + var(--safe-left));
  }
  .image-viewer-close,
  .video-viewer-close {
    top: calc(12px + var(--safe-top));
    right: calc(12px + var(--safe-right));
    width: 44px;
    height: 44px;
  }
  .empty-state .hint-desktop { display: none; }
  .empty-state .hint-mobile { display: inline; }
  .mobile-add-btn {
    display: flex;
    order: 2;
  }
  .main {
    margin: 12px 12px 16px;
    border-radius: 12px;
    flex: 1;
    min-height: 0;
    padding-bottom: 8px;
  }
  .main.files-view-table .file-table {
    display: block;
  }
  .file-table thead {
    display: none;
  }
  .file-table tbody {
    display: block;
  }
  .file-table tbody {
    padding: 8px;
  }
  .file-table tr {
    display: block;
    border: 1px solid var(--yd-border);
    padding: 12px;
    margin-bottom: 8px;
    background: var(--yd-bg);
    border-radius: var(--yd-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }
  .file-table tr:active {
    opacity: 0.9;
  }
  .file-table tr:last-child {
    margin-bottom: 0;
  }
  .file-table td {
    display: flex;
    align-items: center;
    padding: 4px 0;
    border: none;
    text-align: left !important;
  }
  .file-table td:first-child {
    padding-left: 0;
    padding-top: 0;
    padding-bottom: 8px;
  }
  .file-table td:nth-child(2) {
    padding: 6px 0;
  }
  .file-table td:nth-child(2)::before {
    content: 'Размер: ';
    color: var(--yd-text-muted);
    font-size: 12px;
    margin-right: 4px;
    font-weight: 500;
  }
  .file-table td:nth-child(3) {
    padding: 6px 0;
  }
  .file-table td:nth-child(3)::before {
    content: 'Дата: ';
    color: var(--yd-text-muted);
    font-size: 12px;
    margin-right: 4px;
    font-weight: 500;
  }
  .file-table td:last-child {
    padding-right: 0;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--yd-border);
  }
  .file-actions {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }
  .file-actions .btn {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 10px 12px;
    font-size: 13px;
    justify-content: center;
  }
  .file-actions .btn-danger {
    flex: 0 0 auto;
    min-width: auto;
    padding: 10px 16px;
  }
  .file-item-name {
    gap: 10px;
  }
  .file-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  .file-icon.img {
    width: 40px;
    height: 40px;
  }
  .file-icon.img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .file-name {
    font-size: 15px;
    line-height: 1.4;
  }
  .file-size, .file-date {
    font-size: 13px;
    display: inline;
  }
  .message {
    bottom: calc(16px + var(--safe-bottom));
    right: calc(16px + var(--safe-right));
    left: calc(16px + var(--safe-left));
    padding: 14px 18px;
    font-size: 14px;
    text-align: center;
  }
  .empty-state {
    padding: 60px 20px;
    font-size: 14px;
  }
  .upload-overlay {
    margin: 8px;
    border-width: 2px;
  }
  .upload-overlay span {
    font-size: 16px;
    padding: 14px 20px;
  }
}

