/* Drive Files view upgrades: bigger cards, snapshot previews, list mode, details pane.
   Loaded after app.css; only overrides/additions live here. Uses theme vars throughout. */

/* Bigger cards: wider floor, sparse rows centered, section full-bleed. */
.files-card { width: 100%; }
#dFiles.file-cards {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  justify-content: center;
  width: 100%;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

/* Larger card internals. */
.file-row.file-card .file-card-top { padding: 14px 14px 0; gap: 12px; }
.file-row.file-card .file-type-icon { width: 40px; height: 40px; font-size: 13px; border-radius: 9px; }
.file-card-top .file-copy { flex: 1 1 auto; min-width: 0; padding-right: 6px; }
.file-card-top .file-copy b {
  display: block; font-size: 13px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-card-top .file-copy span {
  display: block; font-size: 11px; color: var(--muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-row.file-card .file-card-meta { font-size: 11px; padding: 10px 14px 0; }

/* Kebab overlap fix: name/date column shrinks with ellipsis, controls never move. */
.file-card-top .drive-check { flex: none; }
.file-card-top [data-kebab],
.file-card-top .mini { flex: none; margin-left: auto; }

/* Content snapshot preview slot. Hidden until a preview succeeds. */
.drive-snap {
  margin: 10px 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
}
.drive-snap[hidden] { display: none; }
.drive-snap-img { display: block; width: 100%; height: 130px; object-fit: cover; }
.drive-snap-text {
  margin: 0; padding: 8px 10px;
  font-size: 11px; line-height: 1.5; color: var(--muted);
  max-height: 96px; overflow: hidden;
  white-space: pre-wrap; word-break: break-word;
}

/* List mode: same elements, compact rows. */
#dFiles.file-cards.list { display: block; max-width: none; margin: 0; }
#dFiles.list .file-row.file-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 8px;
}
#dFiles.list .file-row.file-card .file-tab { display: none; }
#dFiles.list .file-card-top { flex: 1 1 auto; min-width: 0; padding: 0; }
#dFiles.list .file-card-meta { flex: none; padding: 0; }
#dFiles.list .drive-snap { display: none; }

/* View option buttons next to the mode switcher. */
.drive-viewopts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Right-side details pane. */
.drive-details {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 320px; max-width: 86vw; z-index: 60;
  background: var(--card); border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.12);
  padding: 16px; overflow-y: auto;
}
.drive-details-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.drive-details-head b { font-size: 13px; color: var(--ink); }
.drive-details-thumbwrap {
  border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; margin-bottom: 12px;
  min-height: 64px; display: flex; align-items: center; justify-content: center;
  padding: 10px;
}
.drive-details-thumb { width: 100%; max-height: 220px; object-fit: cover; border-radius: 6px; }
.drive-details-thumbwrap .drive-snap-text { max-height: 180px; }
.drive-details-name {
  font-size: 13px; font-weight: 700; color: var(--ink);
  overflow-wrap: anywhere; margin-bottom: 10px;
}
.drive-details-facts { margin: 0 0 12px; display: grid; gap: 8px; }
.drive-details-facts div { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.drive-details-facts dt { color: var(--muted); flex: none; }
.drive-details-facts dd { margin: 0; color: var(--ink); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.drive-details-activity b { display: block; font-size: 12px; color: var(--ink); margin-bottom: 8px; }
.drive-details-activity .activity { display: flex; gap: 10px; align-items: center; }


/* Files / Drive layout refresh — 2026-10-06 */
.drive-toolbar-shell{display:flex;flex-direction:column;gap:10px!important;padding:12px 14px!important;border:1px solid var(--line);border-radius:16px;background:var(--card);box-shadow:0 8px 24px rgba(26,55,94,.06);margin-bottom:10px}
.drive-actionbar{display:flex;align-items:stretch;justify-content:space-between;gap:10px;flex-wrap:wrap}
.drive-actions-primary,.drive-actions-secondary{display:flex;align-items:stretch;gap:8px;flex-wrap:wrap}
.drive-action{display:flex;align-items:center;gap:8px;border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:11px;padding:8px 10px;min-height:44px;cursor:pointer;text-align:left}
.drive-action:hover{border-color:var(--blue);background:var(--blue-soft)}
.drive-action.primary{background:var(--blue);border-color:var(--blue);color:#fff}.drive-action.primary .drive-action-icon,.drive-action.primary small{color:#fff}
.drive-action.danger{color:#b4232a}
.drive-action-icon{width:25px;height:25px;display:grid;place-items:center;flex:none;color:var(--blue)}.drive-action-icon svg{width:18px;height:18px}
.drive-action-copy b,.drive-action-copy small{display:block;white-space:nowrap}.drive-action-copy b{font-size:11px;font-weight:850}.drive-action-copy small{font-size:8.5px;color:var(--muted);margin-top:2px}
.drive-google-import{display:flex;align-items:center;gap:9px;border:1px solid #d7dce4;background:#fff;color:#202124;border-radius:11px;padding:8px 11px;min-height:44px;cursor:pointer;text-align:left}
.drive-google-import:hover{border-color:#9db8e8;background:#f8fbff}.drive-google-import img{width:22px;height:22px;flex:none}.drive-google-import b,.drive-google-import small{display:block}.drive-google-import b{font-size:11px}.drive-google-import small{font-size:8.5px;color:#6b7280;margin-top:2px}
.drive-navrow{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid var(--line);padding-top:10px;flex-wrap:wrap}
.drive-modes{display:flex!important;align-items:center;gap:6px!important;flex-wrap:wrap}
.drive-mode-btn,.drive-view-btn{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--card);color:var(--text);border-radius:999px;padding:7px 10px;font-size:10px;font-weight:800;cursor:pointer}
.drive-mode-btn svg,.drive-view-btn svg{width:14px;height:14px}.drive-mode-btn:hover,.drive-view-btn:hover{border-color:var(--blue);color:var(--blue);background:var(--blue-soft)}
.drive-mode-btn.active{background:var(--blue);border-color:var(--blue);color:#fff}
.drive-viewopts{margin-left:auto}
.drive-crumbs{margin:6px 0 10px}.drive-files-hero{margin-top:0!important;min-height:120px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.drive-files-hero h2{font-size:22px!important}.drive-files-hero p{font-size:11px!important;max-width:700px}.drive-hero-kicker,.drive-section-kicker{display:block;font-size:9px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:var(--blue);margin-bottom:4px}
.drive-section-head{display:flex;justify-content:space-between;align-items:end;margin:16px 0 10px}.drive-section-head h3,.drive-files-head h3{margin:0;font-size:15px;color:var(--ink)}.drive-section-head>span,.drive-files-head>span{font-size:9px;color:var(--muted)}
.drive-folder-grid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))!important;gap:12px!important}.drive-folder-grid .folder-card{min-height:116px!important}
.drive-content-grid{display:grid!important;grid-template-columns:minmax(0,1fr) 270px!important;gap:14px!important;align-items:start!important}
.drive-content-grid .files-card{padding:14px!important;min-height:360px}
.drive-files-head{display:flex;justify-content:space-between;align-items:end;margin:0 0 10px}
.drive-side-panel{display:flex!important;flex-direction:column;gap:12px!important;position:sticky;top:76px}
#dFiles.file-cards{grid-template-columns:repeat(auto-fill,minmax(235px,1fr));gap:12px;max-width:none!important;margin:0!important;align-items:stretch}
.file-row.file-card{display:flex;flex-direction:column;min-height:285px;border-radius:14px!important;overflow:hidden;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease}
.file-row.file-card:hover{transform:translateY(-2px);border-color:#b6c9e5;box-shadow:0 10px 26px rgba(26,55,94,.10)}
.file-row.file-card .file-card-top{padding:13px 12px 0;gap:9px}.file-row.file-card .file-type-icon{width:34px;height:34px;font-size:11px}
.drive-preview-btn{width:30px!important;height:30px!important;display:grid!important;place-items:center}.drive-preview-btn svg{width:15px;height:15px}
.drive-snap{display:flex!important;align-items:stretch;justify-content:center;min-height:142px;height:142px;margin:10px 12px 0;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#f7f9fc;position:relative}
.drive-snap[hidden]{display:none!important}.drive-snap-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;width:100%;height:100%;color:var(--muted)}.drive-snap-placeholder span,.drive-snap-fallback span{width:36px;height:36px;border:1.5px solid;display:grid;place-items:center;border-radius:9px;font-size:12px;font-weight:900;background:#fff}.drive-snap-placeholder small{font-size:9px}
.drive-snap-img,.drive-snap-video{display:block;width:100%;height:100%;object-fit:cover}.drive-snap-video{background:#101828}.drive-snap-media-label{position:absolute;left:7px;bottom:7px;background:rgba(255,255,255,.94);color:#344054;border-radius:999px;padding:4px 7px;font-size:8px;font-weight:800}
.drive-snap-pdf{width:100%;height:180px;border:0;background:#fff;pointer-events:none}
.drive-snap-text{width:100%;margin:0;padding:11px 12px;font-size:10px;line-height:1.55;color:var(--text);max-height:none;overflow:hidden;white-space:pre-wrap;word-break:break-word;background:#fbfcfe}
.drive-snap-fallback{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;height:100%;text-align:center}.drive-snap-fallback b{font-size:10px;color:var(--ink)}.drive-snap-fallback small{font-size:8.5px;color:var(--muted)}
.file-row.file-card .file-card-meta{margin-top:auto;padding:9px 12px 11px;border-top:1px solid #edf1f6;display:flex;justify-content:space-between;gap:8px;font-size:9px}
.google-import-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.google-import-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;text-align:left;border:1px solid var(--line);border-radius:13px;background:var(--card);color:var(--ink);padding:13px;cursor:pointer}.google-import-card:hover{border-color:var(--blue);background:var(--blue-soft)}.google-import-card img{width:28px;height:28px}.google-import-card b,.google-import-card small{display:block}.google-import-card b{font-size:12px}.google-import-card small{font-size:9.5px;color:var(--muted);margin-top:3px;line-height:1.35}.google-import-arrow{color:var(--blue);font-size:18px}
.drive-empty{grid-column:1/-1;min-height:180px;display:grid;place-items:center;text-align:center}
#dFiles.list .file-row.file-card{min-height:0;transform:none}.file-row.file-card.drive-cut{opacity:.55}
html[data-theme="dark"] .drive-google-import,html[data-theme="dark"] .drive-snap-placeholder span{background:#141f31;color:var(--ink)}
html[data-theme="dark"] .drive-snap,html[data-theme="dark"] .drive-snap-text{background:#152033}
@media(max-width:1050px){.drive-content-grid{grid-template-columns:1fr!important}.drive-side-panel{position:static;display:grid!important;grid-template-columns:1fr 1fr}}
@media(max-width:720px){.drive-toolbar-shell{padding:10px!important}.drive-actions-primary,.drive-actions-secondary{width:100%}.drive-action,.drive-google-import{flex:1 1 calc(50% - 8px)}.drive-action-copy small,.drive-google-import small{display:none}.drive-navrow{align-items:flex-start}.drive-viewopts{margin-left:0}.drive-files-hero{display:block}.drive-files-hero .hero-stat{margin-top:12px}.drive-side-panel{grid-template-columns:1fr!important}.google-import-grid{grid-template-columns:1fr}#dFiles.file-cards{grid-template-columns:1fr 1fr}.drive-folder-grid{grid-template-columns:1fr 1fr!important}}
@media(max-width:500px){#dFiles.file-cards,.drive-folder-grid{grid-template-columns:1fr!important}.drive-action,.drive-google-import{flex:1 1 100%}.drive-mode-btn span{display:none}.drive-mode-btn{width:36px;height:36px;padding:0;justify-content:center}}
