/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:        #1a73e8;
  --blue-light:  #e8f0fe;
  --blue-dark:   #1557b0;
  --green:       #0f9d58;
  --yellow:      #f4b400;
  --red:         #ea4335;
  --orange:      #fa7b17;
  --purple:      #a142f4;

  --text-primary:   #202124;
  --text-secondary: #5f6368;
  --text-link:      #1a73e8;

  --surface:     #ffffff;
  --surface-2:   #f8f9fa;
  --surface-3:   #f1f3f4;
  --border:      #dadce0;

  --hover-bg:    rgba(32,33,36,.059);
  --active-bg:   #e8f0fe;
  --active-text: #1a73e8;

  --topbar-h:    64px;
  --sidebar-w:   256px;
  --details-w:   316px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;

  --shadow-1: 0 1px 2px 0 rgba(60,64,67,.3),0 1px 3px 1px rgba(60,64,67,.15);
  --shadow-2: 0 1px 3px 0 rgba(60,64,67,.3),0 4px 8px 3px rgba(60,64,67,.15);
  --shadow-3: 0 2px 6px 2px rgba(60,64,67,.15),0 1px 2px 0 rgba(60,64,67,.3);
}

html { height: 100%; }

body {
  font-family: 'Roboto', 'Google Sans', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c4c7cc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9aa0a6; }

/* ===== ICON BUTTONS ===== */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  transition: background .15s ease;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--hover-bg); }
.icon-btn.active { background: var(--active-bg); }

/* ===== TOPBAR ===== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  z-index: 200;
  gap: 8px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  user-select: none;
}
.brand-icon { width: 40px; height: 34px; flex-shrink: 0; }
.brand-name {
  font-size: 22px;
  font-weight: 400;
  font-family: 'Google Sans', sans-serif;
  color: #5f6368;
  letter-spacing: -.5px;
}

/* Search */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface-3);
  border-radius: 24px;
  height: 48px;
  max-width: 720px;
  flex: 1;
  padding: 0 4px;
  transition: background .2s, box-shadow .2s;
  margin: 0 16px;
}
.search-bar:focus-within {
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.search-icon-btn, .search-filter-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background .15s;
  flex-shrink: 0;
}
.search-icon-btn:hover, .search-filter-btn:hover { background: var(--hover-bg); }
.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--text-primary);
  font-family: 'Roboto', sans-serif;
  min-width: 0;
}
.search-input::placeholder { color: var(--text-secondary); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Google Sans', sans-serif;
  cursor: pointer;
  margin-left: 4px;
  user-select: none;
}

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  margin-top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
  position: relative;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px 0 16px;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.new-btn-wrap { padding: 8px 16px 8px; }
.new-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 16px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-family: 'Google Sans', sans-serif;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: box-shadow .2s, background .15s;
  width: 100%;
}
.new-btn:hover { box-shadow: var(--shadow-2); background: var(--surface-2); }
.new-btn svg { flex-shrink: 0; }

/* Sidebar Nav */
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-radius: 0 24px 24px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background .15s;
  cursor: pointer;
  border-radius: 24px;
  white-space: nowrap;
  user-select: none;
}
.nav-item svg { color: var(--text-secondary); flex-shrink: 0; }
.nav-item:hover { background: var(--hover-bg); }
.nav-item.active { background: var(--active-bg); color: var(--active-text); }
.nav-item.active svg { color: var(--active-text); }

.nav-divider { height: 1px; background: var(--border); margin: 8px 16px; }

/* Storage widget */
.storage-widget {
  margin-top: auto;
  padding: 16px 16px 8px;
}
.storage-label {
  font-size: 14px; font-weight: 500;
  color: var(--text-primary); margin-bottom: 10px;
}
.storage-bar-track {
  height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden; margin-bottom: 8px;
}
.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a73e8 0%, #ea4335 100%);
  border-radius: 2px;
  transition: width .5s ease;
}
.storage-text {
  font-size: 12px; color: var(--text-secondary); margin-bottom: 12px;
}
.storage-buy-btn {
  width: 100%;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--surface);
  transition: background .15s, box-shadow .15s;
  font-family: 'Google Sans', sans-serif;
}
.storage-buy-btn:hover { background: var(--surface-3); box-shadow: var(--shadow-1); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.32);
  z-index: 100;
  opacity: 0;
  transition: opacity .25s;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  min-width: 0;
  padding: 0 24px 32px;
}

/* Toolbar */
.content-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 8px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.breadcrumb-item {
  font-size: 18px;
  font-family: 'Google Sans', sans-serif;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color .15s;
}
.breadcrumb-item:hover { color: var(--text-primary); }
.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 500;
}
.breadcrumb-chevron { flex-shrink: 0; }

.toolbar-actions { display: flex; align-items: center; gap: 0; }

/* ===== SUGGESTED SECTION ===== */
.suggested-section { margin-bottom: 8px; }
.section-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-family: 'Google Sans', sans-serif;
}

.suggested-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.suggested-row::-webkit-scrollbar { display: none; }

.suggested-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px 10px 8px;
  cursor: pointer;
  min-width: 200px;
  max-width: 240px;
  flex-shrink: 0;
  transition: background .15s, box-shadow .15s;
}
.suggested-chip:hover { background: var(--surface-3); box-shadow: var(--shadow-1); }

.chip-thumb {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chip-thumb.pdf    { background: #ea4335; }
.chip-thumb.sheets { background: #0f9d58; }
.chip-thumb.slides { background: #f4b400; }
.chip-thumb.zip    { background: #9aa0a6; }
.chip-thumb.docs   { background: #4285f4; }

.chip-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chip-name { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-meta { font-size: 11px; color: var(--text-secondary); }

/* ===== FILES SECTION ===== */
.files-section { margin-bottom: 8px; }

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

/* ===== FILE/FOLDER CARDS ===== */
.file-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, border-color .15s;
  outline: none;
  background: var(--surface);
  position: relative;
}
.file-card:hover { background: var(--surface-3); box-shadow: var(--shadow-1); }
.file-card:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-light); }
.file-card.selected { background: var(--active-bg); border-color: var(--blue); }
.file-card.selected .card-more-btn { display: flex; }

/* Folder cards */
.folder-card { display: flex; flex-direction: column; }
.folder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 12px 12px;
  position: relative;
}
.folder-icon-wrap { flex-shrink: 0; }
.folder-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-star {
  position: absolute;
  top: 10px; right: 36px;
}

/* Folder preview row */
.folder-previews {
  display: flex;
  height: 96px;
  border-top: 1px solid var(--border);
  overflow: hidden;
}
.folder-preview-item {
  flex: 1;
  border-right: 1px solid var(--border);
}
.folder-preview-item:last-child { border-right: none; }

.folder-preview-item.docs  { background: linear-gradient(160deg,#e8f0fe 0%,#c5ceff 100%); }
.folder-preview-item.img   { background: linear-gradient(160deg,#fce8e6 0%,#f5c6c3 100%); }
.folder-preview-item.img2  { background: linear-gradient(160deg,#fce8e6 0%,#f28b82 100%); }
.folder-preview-item.pdf   { background: linear-gradient(160deg,#fce8e6 0%,#ea4335 100%); }
.folder-preview-item.pdf2  { background: linear-gradient(160deg,#fdecea 0%,#ea4335 80%); }
.folder-preview-item.sheets{ background: linear-gradient(160deg,#e6f4ea 0%,#81c995 100%); }
.folder-preview-item.slides{ background: linear-gradient(160deg,#fff8e1 0%,#fdd663 100%); }
.folder-preview-item.code  { background: linear-gradient(160deg,#f3e8fd 0%,#c58af9 100%); }
.folder-preview-item.code2 { background: linear-gradient(160deg,#e8f5e9 0%,#a8dab5 100%); }

/* File cards */
.file-item { display: flex; flex-direction: column; }
.file-thumb {
  height: 136px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Thumb type badge */
.thumb-type-badge {
  position: absolute;
  bottom: 8px; left: 8px;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.docs-badge   { background: #4285f4; }
.sheets-badge { background: #0f9d58; }
.slides-badge { background: #f4b400; }
.pdf-badge    { background: #ea4335; }
.img-badge    { background: #00897b; }
.zip-badge    { background: #757575; }
.video-badge  { background: #e53935; }

/* Docs thumb */
.docs-thumb {
  background: linear-gradient(160deg, #e8f0fe 0%, #c5ceff 100%);
  padding: 16px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
}
.thumb-lines { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.tl { height: 6px; background: rgba(66,133,244,.35); border-radius: 3px; width: 100%; }
.tl.w90 { width: 90%; }
.tl.w80 { width: 80%; }
.tl.w70 { width: 70%; }
.tl.w60 { width: 60%; }
.tl.w50 { width: 50%; }

/* Sheets thumb */
.sheets-thumb { background: linear-gradient(160deg, #e6f4ea 0%, #c8e6c9 100%); padding: 12px; flex-direction: column; align-items: stretch; justify-content: flex-start; }
.sheet-grid { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.sg-row { display: flex; gap: 2px; }
.sg-cell { flex: 1; height: 16px; background: rgba(15,157,88,.15); border-radius: 2px; }
.sg-cell.header { background: rgba(15,157,88,.4); }
.sg-cell.filled { background: rgba(15,157,88,.35); }
.sg-cell.filled2 { background: rgba(15,157,88,.25); }

/* Slides thumb */
.slides-thumb { background: linear-gradient(160deg, #fff8e1 0%, #fdd663 100%); padding: 12px; flex-direction: column; align-items: center; justify-content: center; }
.slide-preview { width: 100%; background: rgba(255,255,255,.6); border-radius: 4px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.slide-title-bar { height: 8px; background: rgba(244,180,0,.7); border-radius: 3px; width: 70%; }
.slide-content-bar { height: 6px; background: rgba(0,0,0,.15); border-radius: 3px; width: 50%; }
.slide-img-box { height: 40px; background: rgba(244,180,0,.2); border-radius: 4px; margin-top: 4px; }

/* PDF thumb */
.pdf-thumb { background: linear-gradient(160deg, #fce8e6 0%, #f5c6c3 100%); padding: 16px; flex-direction: column; align-items: flex-start; justify-content: flex-start; }
.pdf-page-lines { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.ppl { height: 5px; background: rgba(234,67,53,.3); border-radius: 3px; }
.ppl.w80 { width: 80%; }
.ppl.w60 { width: 60%; }
.ppl.w90 { width: 90%; }
.ppl.w70 { width: 70%; }
.ppl.w50 { width: 50%; }
.ppl.w40 { width: 40%; }

/* Image thumb */
.image-thumb { background: #e0e0e0; overflow: hidden; }
.img-preview-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ZIP thumb */
.zip-thumb { background: linear-gradient(160deg, #f5f5f5 0%, #e0e0e0 100%); overflow: hidden; }
.zip-stripes {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(0,0,0,.05) 8px, rgba(0,0,0,.05) 16px);
}

/* Video thumb */
.video-thumb {
  background: linear-gradient(160deg, #212121 0%, #424242 100%);
  display: flex; align-items: center; justify-content: center;
}
.video-play-icon {
  width: 48px; height: 48px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}

/* File info row */
.file-info {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.file-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.file-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-meta { font-size: 12px; color: var(--text-secondary); }

/* More button on cards */
.card-more-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.file-card:hover .card-more-btn,
.folder-card:hover .card-more-btn { opacity: 1; }
.card-more-btn:hover { background: var(--border); }

/* ===== DETAILS PANEL ===== */
.details-panel {
  width: var(--details-w);
  flex-shrink: 0;
  height: 100%;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(var(--details-w));
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.details-panel.open {
  transform: translateX(0);
}
.details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.details-title {
  font-size: 16px;
  font-family: 'Google Sans', sans-serif;
  font-weight: 500;
  color: var(--text-primary);
}
.details-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.details-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 200px;
  color: var(--text-secondary);
  text-align: center;
}
.details-placeholder p { font-size: 14px; }

/* Details content */
.details-file-icon {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.details-file-name {
  font-size: 16px;
  font-family: 'Google Sans', sans-serif;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  word-break: break-word;
}
.details-section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin: 16px 0 8px;
}
.details-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.details-row-label { font-size: 12px; color: var(--text-secondary); min-width: 80px; }
.details-row-value { font-size: 12px; color: var(--text-primary); text-align: right; flex: 1; word-break: break-word; }
.details-divider { height: 1px; background: var(--border); margin: 12px 0; }

/* ===== CONTEXT MENU ===== */
.context-menu, .new-menu {
  position: fixed;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px 0 rgba(60,64,67,.3);
  min-width: 200px;
  padding: 8px 0;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transform: scale(.95);
  transform-origin: top left;
  transition: opacity .15s, transform .15s;
}
.context-menu.visible, .new-menu.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
.ctx-item, .new-menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-primary);
  width: 100%;
  text-align: left;
  transition: background .1s;
  font-family: 'Roboto', sans-serif;
}
.ctx-item:hover, .new-menu-item:hover { background: var(--surface-3); }
.ctx-item.ctx-danger { color: #d93025; }
.ctx-item.ctx-danger svg { color: #d93025; }
.ctx-divider, .new-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #323232;
  color: white;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  z-index: 600;
  opacity: 0;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== FAB (mobile) ===== */
.fab {
  display: none;
  position: fixed;
  bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--blue);
  color: white;
  align-items: center; justify-content: center;
  box-shadow: var(--shadow-2);
  z-index: 150;
  transition: box-shadow .2s, transform .15s;
}
.fab:hover { box-shadow: var(--shadow-3); transform: scale(1.05); }
.fab:active { transform: scale(.97); }

/* ===== LIST VIEW ===== */
.files-grid.list-view {
  grid-template-columns: 1fr;
  gap: 0;
}
.files-grid.list-view .file-card {
  border-radius: 0;
  border-left: none; border-right: none; border-top: none;
  display: flex;
  flex-direction: row;
  align-items: center;
}
.files-grid.list-view .file-card:first-child { border-top: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.files-grid.list-view .file-card:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.files-grid.list-view .file-thumb {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  margin: 8px;
  border-top: none;
}
.files-grid.list-view .file-info {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  border-top: none;
  padding: 8px 8px 8px 0;
}
.files-grid.list-view .file-name-row { flex: 1; }
.files-grid.list-view .file-meta { min-width: 120px; text-align: right; }
.files-grid.list-view .thumb-type-badge { display: none; }

/* List view folders */
.files-grid.list-view .folder-card {
  flex-direction: row;
  align-items: center;
  padding: 0;
  border-radius: 0;
  border-left: none; border-right: none; border-top: none;
}
.files-grid.list-view .folder-card:first-child { border-top: 1px solid var(--border); }
.files-grid.list-view .folder-header {
  flex: 1;
  padding: 10px 12px;
}
.files-grid.list-view .folder-previews { display: none; }
.files-grid.list-view .folder-star { top: 50%; transform: translateY(-50%); right: 48px; }

/* ===== SEARCH ACTIVE ===== */
.search-bar.focused { background: var(--surface); box-shadow: var(--shadow-1); }

/* ===== RESPONSIVE — TABLET ===== */
@media (max-width: 1024px) {
  :root { --details-w: 280px; }
  .files-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ===== RESPONSIVE — MOBILE ===== */
@media (max-width: 768px) {
  :root {
    --topbar-h: 56px;
    --sidebar-w: 280px;
  }

  body { overflow: hidden; }

  /* Topbar mobile */
  .topbar { padding: 0 4px; }
  .brand-name { display: none; }
  .search-bar { margin: 0 4px; }
  .apps-btn { display: none; }

  /* Sidebar slides over */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 150;
    background: var(--surface);
    box-shadow: var(--shadow-3);
    transform: translateX(-100%);
    padding-top: calc(var(--topbar-h) + 8px);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.visible {
    display: block;
    opacity: 1;
  }

  /* Main content full width */
  .main-content { padding: 0 12px 80px; }

  /* Grid smaller */
  .files-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }

  /* Suggested chips scrollable */
  .suggested-chip { min-width: 170px; }

  /* Details panel */
  .details-panel {
    position: fixed;
    top: var(--topbar-h); left: 0; right: 0; bottom: 0;
    width: 100%;
    z-index: 160;
    transform: translateY(100%);
    box-shadow: var(--shadow-3);
  }
  .details-panel.open { transform: translateY(0); }

  /* FAB */
  .fab { display: flex; }

  /* New btn in topbar on mobile */
  .new-btn-wrap { padding: 16px 12px 8px; }

  /* Breadcrumb smaller */
  .breadcrumb-item { font-size: 16px; }
}

@media (max-width: 480px) {
  .files-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-right .icon-btn:not(.apps-btn):nth-child(n+3) { display: none; }
  .search-input { font-size: 14px; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.file-card, .suggested-chip {
  animation: fadeInUp .3s ease both;
}
.file-card:nth-child(1)  { animation-delay: .02s; }
.file-card:nth-child(2)  { animation-delay: .04s; }
.file-card:nth-child(3)  { animation-delay: .06s; }
.file-card:nth-child(4)  { animation-delay: .08s; }
.file-card:nth-child(5)  { animation-delay: .10s; }
.file-card:nth-child(6)  { animation-delay: .12s; }
.file-card:nth-child(7)  { animation-delay: .14s; }
.file-card:nth-child(8)  { animation-delay: .16s; }

.suggested-chip:nth-child(1) { animation-delay: .05s; }
.suggested-chip:nth-child(2) { animation-delay: .10s; }
.suggested-chip:nth-child(3) { animation-delay: .15s; }
.suggested-chip:nth-child(4) { animation-delay: .20s; }

/* Nav item click ripple */
.nav-item { position: relative; overflow: hidden; }

/* Hover shimmer on file thumbs */
.file-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background .15s;
  pointer-events: none;
}
.file-card:hover .file-thumb::after { background: rgba(0,0,0,.04); }
