:root {
  color-scheme: light dark;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #172033;
  --muted: #697386;
  --border: #dfe5ee;
  --accent: #3158e6;
  --accent-strong: #2344be;
  --danger-bg: #fff0f0;
  --danger: #a52828;
  --shadow: 0 18px 55px rgba(24, 35, 58, .10);
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1018;
    --surface: #141a24;
    --surface-2: #1b2330;
    --text: #edf1f7;
    --muted: #99a5b7;
    --border: #283244;
    --accent: #7690ff;
    --accent-strong: #90a5ff;
    --danger-bg: #351b1d;
    --danger: #ff9b9b;
    --shadow: 0 18px 55px rgba(0, 0, 0, .28);
  }
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .65rem; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -.045em; }
h2 { margin-bottom: .55rem; font-size: 1.1rem; }
small { color: var(--muted); }

.auth-body { display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 28rem), var(--bg); }
.auth-main { width: min(100%, 500px); }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: clamp(24px, 5vw, 42px); box-shadow: var(--shadow); }
.auth-card h1 { font-size: clamp(2rem, 7vw, 3rem); }

.eyebrow { margin-bottom: 12px; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); }
.lead { max-width: 800px; color: var(--muted); font-size: 1.1rem; }
.center { text-align: center; }

.form-stack { display: grid; gap: 17px; margin-top: 25px; }
label { display: grid; gap: 7px; font-weight: 700; }
label small { font-weight: 400; }
input { width: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); padding: 12px 14px; font: inherit; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 17%, transparent); }
.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 12px; padding: 10px 16px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-strong); }
.button-secondary { border-color: var(--border); background: var(--surface-2); color: var(--text); }
.button-ghost { border-color: var(--border); background: transparent; color: var(--text); }
.full { width: 100%; }
.security-note { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; }
.alert { margin: 18px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 12px 14px; }
.alert small { display: block; margin-top: 4px; }
.alert-error { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: var(--danger-bg); color: var(--danger); }

.app-body { display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; gap: 22px; border-right: 1px solid var(--border); background: var(--surface); padding: 22px 16px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 900; text-decoration: none; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--accent); color: #fff; }
.nav { display: grid; gap: 6px; }
.nav-link { border-radius: 10px; padding: 10px 12px; color: var(--muted); font-weight: 700; text-decoration: none; }
.nav-link:hover, .nav-link.active { background: var(--surface-2); color: var(--text); }
.sidebar-footer { display: grid; gap: 14px; margin-top: auto; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px 7px; }
.user-chip div { min-width: 0; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--surface-2); font-weight: 900; text-transform: uppercase; }
.app-main { min-width: 0; }
.page { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 46px 0 70px; }
.page-narrow { width: min(920px, calc(100% - 48px)); }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-header h1 { font-size: clamp(2rem, 5vw, 3.2rem); }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat-card, .panel, .feature-card, .callout, .empty-state { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 7px 25px rgba(24, 35, 58, .04); }
.stat-card { display: grid; gap: 5px; padding: 20px; }
.stat-card span, .stat-card small { color: var(--muted); }
.stat-card strong { font-size: 1.7rem; }
.panel { margin-top: 18px; padding: 24px; }
.panel p { max-width: 700px; color: var(--muted); }

.onboarding-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 30px 0; }
.feature-card { padding: 22px; }
.feature-card p { margin-bottom: 0; color: var(--muted); }
.step { display: inline-block; margin-bottom: 28px; color: var(--accent); font-weight: 900; }
.callout { margin: 20px 0; padding: 22px; }
.callout p { margin: 5px 0 0; color: var(--muted); }
.actions { display: flex; justify-content: flex-end; margin-top: 22px; }

.empty-state { padding: 60px 24px; text-align: center; }
.empty-state p { max-width: 560px; margin: 0 auto; color: var(--muted); }
.empty-icon { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 18px; border-radius: 17px; background: var(--surface-2); color: var(--accent); font-size: 2rem; }
.photo-skeleton-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.photo-skeleton-grid div { aspect-ratio: 1; border-radius: 14px; background: linear-gradient(120deg, var(--surface-2), var(--surface), var(--surface-2)); border: 1px solid var(--border); }

@media (max-width: 820px) {
  .app-body { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 14px 16px; }
  .brand { margin-bottom: 2px; }
  .nav { display: flex; overflow-x: auto; }
  .nav-link { white-space: nowrap; }
  .sidebar-footer { display: none; }
  .page, .page-narrow { width: min(100% - 30px, 1180px); padding-top: 30px; }
  .stats-grid, .onboarding-grid { grid-template-columns: 1fr; }
  .photo-skeleton-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .auth-body { padding: 14px; }
  .auth-card { border-radius: 18px; padding: 22px; }
  .photo-skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions .button { width: 100%; }
}

select { width: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); padding: 12px 14px; font: inherit; outline: none; color-scheme: light; }
select option, select optgroup { background: #ffffff; color: #172033; }
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 17%, transparent); }
@media (prefers-color-scheme: dark) {
  select { color-scheme: dark; background: var(--surface-2); color: var(--text); }
  select option, select optgroup { background: #141a24; color: #edf1f7; }
  select option:checked { background: #26375c; color: #ffffff; }
}
code { border-radius: 7px; background: var(--surface-2); padding: 2px 6px; }
.alert-success { border-color: color-mix(in srgb, #2b8a5a 35%, var(--border)); background: color-mix(in srgb, #2b8a5a 9%, var(--surface)); color: color-mix(in srgb, #2b8a5a 80%, var(--text)); }
.button-row { display: flex; align-items: center; gap: 10px; }
.button-row.wrap { flex-wrap: wrap; }
.button-row form { margin: 0; }
.stats-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.storage-grid { display: grid; gap: 18px; }
.storage-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 22px; box-shadow: 0 7px 25px rgba(24, 35, 58, .04); }
.storage-card-detected { border-style: dashed; }
.storage-card-head { display: flex; justify-content: space-between; align-items: start; gap: 22px; }
.storage-card-head h2 { margin-bottom: 5px; font-size: 1.35rem; }
.storage-capacity { display: grid; text-align: right; }
.status-line { display: flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 700; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status-online { background: #2f9e63; }
.status-idle { background: #d69e2e; }
.status-offline { background: #8a94a5; }
.meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.meta-grid div { min-width: 0; border-radius: 12px; background: var(--surface-2); padding: 11px 12px; }
.meta-grid dt { color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.meta-grid dd { margin: 3px 0 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break-all { word-break: break-all; white-space: normal !important; }
.storage-details { margin-top: 17px; border-top: 1px solid var(--border); padding-top: 15px; }
.storage-details summary { cursor: pointer; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.form-grid > .button, .form-grid > small { align-self: end; }
.check { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.check input { width: auto; }
.photo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.photo-card { position: relative; overflow: hidden; min-width: 0; aspect-ratio: 1; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); text-decoration: none; }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .18s ease; }
.photo-card:hover img { transform: scale(1.025); }
.photo-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--muted); }
.photo-meta { position: absolute; inset: auto 0 0; display: grid; padding: 28px 10px 9px; background: linear-gradient(transparent, rgba(0,0,0,.72)); color: white; }
.photo-meta strong, .photo-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: white; }
.photo-meta small { opacity: .82; font-size: .73rem; }
.pagination-row { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }

@media (max-width: 1050px) {
  .stats-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .storage-card-head { display: grid; }
  .storage-capacity { text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .stats-grid-4 { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.button:disabled { opacity: .55; cursor: not-allowed; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: -8px 0 22px; color: var(--muted); font-size: .9rem; }
.breadcrumbs a { color: var(--text); text-decoration: none; font-weight: 750; }
.file-root-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.file-root-card { display: flex; align-items: center; gap: 14px; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 18px; color: var(--text); text-decoration: none; box-shadow: 0 7px 25px rgba(24, 35, 58, .04); }
.file-root-card:hover, .file-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.file-root-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--accent); font-size: 1.4rem; }
.file-root-card div:last-child { min-width: 0; }
.file-root-card strong, .file-root-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-root-card small { margin-top: 4px; color: var(--muted); }
.file-root-card.is-offline, .file-row.is-offline { background:color-mix(in srgb,var(--surface) 78%,var(--muted) 22%); border-color:color-mix(in srgb,var(--border) 72%,var(--muted) 28%); color:var(--muted); filter:grayscale(.72); opacity:.72; }
.file-root-card.is-offline:hover, .file-row.is-offline:hover { border-color:color-mix(in srgb,var(--border) 55%,var(--muted) 45%); opacity:.82; }
.file-root-card.is-offline .file-root-icon, .file-row.is-offline .file-kind { color:var(--muted); background:color-mix(in srgb,var(--surface-2) 78%,var(--muted) 22%); }
.offline-indicator { display:inline-flex; align-items:center; gap:6px; font-weight:750; }
.offline-dot { width:7px; height:7px; flex:0 0 auto; border-radius:50%; background:currentColor; opacity:.82; }
.file-list { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.file-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 64px; border-bottom: 1px solid var(--border); padding: 9px 14px; color: var(--text); text-decoration: none; }
.file-row:last-child { border-bottom: 0; }
.file-kind { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--accent); font-weight: 900; }
.file-kind.folder { font-size: 1.2rem; }
.file-main { min-width: 0; }
.file-main strong, .file-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-main small, .file-size { color: var(--muted); }
.file-size { font-size: .88rem; white-space: nowrap; }
.upload-panel { margin-top: 22px; }
.compact-empty { margin-top: 0; padding: 38px 22px; }

@media (max-width: 900px) {
  .file-root-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .file-root-grid { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: 38px minmax(0, 1fr); }
  .file-size { grid-column: 2; }
}

/* Navegación e iconos offline */
.nav-link { display:flex; align-items:center; gap:10px; }
.nav-icon { width:20px; height:20px; flex:0 0 auto; }
.inline-icon { width:18px; height:18px; vertical-align:-3px; }
.page-header-actions { align-items:center; }
.header-tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:10px; }

/* Selector reutilizable de modo de listado */
.listing-controls { display:inline-flex; align-items:center; gap:4px; padding:4px; border:1px solid var(--border); border-radius:12px; background:var(--surface); white-space:nowrap; }
.listing-controls > span { padding:0 8px; color:var(--muted); font-size:.82rem; font-weight:800; }
.listing-option { padding:7px 10px; border-radius:8px; color:var(--muted); text-decoration:none; font-size:.85rem; font-weight:800; }
.listing-option.active { background:var(--surface-2); color:var(--text); }
.page-number { display:inline-flex; align-items:center; color:var(--muted); font-weight:800; }
.infinite-sentinel { padding:22px 12px; text-align:center; color:var(--muted); font-size:.88rem; }

/* Progreso de indexación */
.index-progress { margin:16px 0; padding:13px 14px; border:1px solid var(--border); border-radius:13px; background:var(--surface-2); }
.index-progress.active { border-color:color-mix(in srgb,var(--accent) 45%,var(--border)); }
.progress-copy { display:flex; justify-content:space-between; gap:12px; margin-bottom:8px; }
.progress-copy strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.index-progress progress { width:100%; height:9px; accent-color:var(--accent); }
.index-progress small { display:block; margin-top:7px; color:var(--muted); }

/* Galería y visor */
.media-card { appearance:none; padding:0; color:inherit; cursor:pointer; text-align:left; }
.media-badge { position:absolute; top:8px; left:8px; z-index:2; padding:4px 7px; border-radius:8px; background:rgba(0,0,0,.62); color:white; font-size:.7rem; font-weight:900; backdrop-filter:blur(5px); }
.media-viewer, .upload-dialog, .filter-dialog { border:0; padding:0; background:transparent; }
.media-viewer::backdrop, .upload-dialog::backdrop, .filter-dialog::backdrop { background:rgba(5,8,15,.82); backdrop-filter:blur(7px); }
.media-viewer { position:fixed; inset:0; margin:0; width:100vw; max-width:none; height:100vh; height:100dvh; max-height:none; overflow:hidden; }
.viewer-shell { position:relative; width:100%; height:100%; background:#05070b; color:white; overflow:hidden; }
.viewer-stage { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; min-width:0; min-height:0; overflow:hidden; padding:0; }
.viewer-image, .viewer-video { display:block; width:100%; height:100%; max-width:none; max-height:none; margin:0; object-fit:contain; object-position:center center; transition:transform .14s ease-out; transform-origin:center center; background:#05070b; }
.viewer-video { position:absolute; inset:0; transition:transform .14s ease-out,opacity .08s linear; }
.viewer-video-staging { opacity:0; pointer-events:none; }
.viewer-audio { display:grid; align-content:center; justify-items:center; gap:24px; width:min(680px,90vw); min-height:100%; padding:80px 24px; }
.viewer-audio img { width:min(520px,78vw); height:min(520px,58vh); border-radius:18px; object-fit:contain; }
.viewer-audio audio { width:100%; }
.viewer-media-error { max-width:min(560px,84vw); padding:18px 22px; border:1px solid rgba(255,255,255,.18); border-radius:14px; background:rgba(0,0,0,.56); color:#f1f3f4; text-align:center; }
.viewer-meta { position:absolute; z-index:3; top:0; left:0; right:0; display:flex; justify-content:flex-start; align-items:flex-start; gap:16px; pointer-events:none; padding:16px 104px 58px 20px; background:linear-gradient(rgba(0,0,0,.78),rgba(0,0,0,.36) 52%,transparent); }
.viewer-meta strong, .viewer-meta small { display:block; max-width:min(72vw,900px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-shadow:0 1px 8px rgba(0,0,0,.9); }
.viewer-meta small { margin-top:3px; color:#d1d7e0; }
.icon-button { display:grid; place-items:center; width:42px; height:42px; border:1px solid var(--border); border-radius:12px; background:var(--surface); color:var(--text); cursor:pointer; }
.viewer-shell .icon-button { position:absolute; z-index:5; border-color:rgba(255,255,255,.2); background:rgba(0,0,0,.52); color:white; backdrop-filter:blur(7px); }
.viewer-close { top:14px; right:14px; }
.viewer-nav { top:50%; transform:translateY(-50%); }
.viewer-prev { left:16px; }
.viewer-next { right:16px; }
.filter-button { position:relative; }
.filter-count { position:absolute; top:-5px; right:-5px; display:grid; place-items:center; min-width:18px; height:18px; padding:0 4px; border-radius:999px; background:var(--accent); color:white; font-size:.65rem; font-weight:900; }
.filter-dialog { width:min(520px,calc(100% - 28px)); }
.filter-card { gap:14px; }
.filter-card .button-row { justify-content:flex-end; }

/* Menú contextual seguro */
.context-menu { position:fixed; z-index:10000; min-width:180px; padding:6px; border:1px solid var(--border); border-radius:12px; background:var(--surface); box-shadow:0 18px 60px rgba(0,0,0,.28); }
.context-menu[hidden] { display:none; }
.context-menu button { display:flex; align-items:center; gap:9px; width:100%; padding:10px 12px; border:0; border-radius:8px; background:transparent; color:var(--text); font:inherit; text-align:left; cursor:pointer; }
.context-menu button:hover, .context-menu button:focus-visible { background:var(--surface-2); outline:none; }
.context-menu .inline-icon { width:18px; height:18px; }
.selection-menu { min-width:210px; }
.selection-menu button + button { border-top:1px solid var(--border); border-radius:0 0 8px 8px; }
.selection-menu button:first-child { border-radius:8px 8px 0 0; }

/* Widget de subida contextual */
.upload-dialog { width:min(560px,calc(100% - 28px)); }
.dialog-card { display:grid; gap:16px; border:1px solid var(--border); border-radius:20px; background:var(--surface); color:var(--text); padding:22px; box-shadow:0 24px 80px rgba(0,0,0,.28); }
.dialog-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.dialog-head h2 { margin:3px 0 0; font-size:1.2rem; word-break:break-word; }
.dialog-card label { display:grid; gap:7px; }
.dialog-card small { color:var(--muted); }

@media (max-width:720px) {
  .page-header-actions { align-items:flex-start; }
  .header-tools { width:100%; justify-content:flex-start; }
  .viewer-nav { top:auto; bottom:76px; }
  .viewer-prev { left:14px; }.viewer-next { right:14px; }
  .viewer-meta { padding:14px 74px 48px 12px; }
  .viewer-meta small { display:none; }
}

/* Controles de video propios: locales, responsivos y alineados abajo. */
.viewer-video-controls { position:absolute; z-index:6; left:0; right:0; bottom:0; padding:48px 16px 12px; background:linear-gradient(transparent,rgba(0,0,0,.78) 46%,rgba(0,0,0,.92)); color:white; transition:opacity .16s ease; }
.viewer-video-controls[hidden] { display:none; }
.viewer-video-progress { width:100%; }
.viewer-video-progress input { width:100%; height:18px; margin:0; accent-color:#fff; cursor:pointer; }
.viewer-video-control-row { display:flex; align-items:center; gap:9px; min-width:0; }
.video-control-button { display:grid; place-items:center; width:38px; height:38px; flex:0 0 auto; border:0; border-radius:9px; background:transparent; color:white; cursor:pointer; }
.video-control-button:hover,.video-control-button:focus-visible { background:rgba(255,255,255,.14); outline:none; }
.viewer-video-time { font-variant-numeric:tabular-nums; font-size:.78rem; color:#f4f5f7; white-space:nowrap; }
.viewer-video-volume { width:92px; accent-color:#fff; cursor:pointer; }
.viewer-video-spacer { flex:1 1 auto; min-width:8px; }
.viewer-video-speed select,.viewer-quality-inline select { min-height:34px; border:1px solid rgba(255,255,255,.18); border-radius:9px; background:rgba(0,0,0,.72); color:white; padding:5px 8px; font:inherit; font-size:.78rem; font-weight:800; cursor:pointer; color-scheme:dark; box-shadow:none; }
.viewer-video-speed select option,.viewer-quality-inline select option { background:#0b0d12; color:#fff; }
.viewer-quality-inline { position:relative; display:flex; align-items:center; gap:6px; }
.viewer-quality-inline[hidden] { display:none; }
.viewer-quality-inline small { position:absolute; right:0; bottom:42px; max-width:min(260px,65vw); padding:5px 8px; border-radius:8px; background:rgba(0,0,0,.72); color:#dfe3e8; font-size:.68rem; white-space:nowrap; pointer-events:none; }
.viewer-quality-inline small:empty { display:none; }
.viewer-loading-overlay { position:absolute; z-index:5; inset:0; display:grid; place-content:center; justify-items:center; gap:12px; pointer-events:none; background:rgba(3,5,9,.18); color:#fff; text-shadow:0 1px 10px rgba(0,0,0,.9); }
.viewer-loading-overlay[hidden] { display:none; }
.viewer-loading-spinner { width:46px; height:46px; border:4px solid rgba(255,255,255,.28); border-top-color:#fff; border-radius:50%; animation:viewer-spin .72s linear infinite; box-shadow:0 0 24px rgba(0,0,0,.3); }
.viewer-loading-overlay strong { padding:6px 10px; border-radius:9px; background:rgba(0,0,0,.48); font-size:.78rem; backdrop-filter:blur(5px); }
@keyframes viewer-spin { to { transform:rotate(360deg); } }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }

@media (max-width:720px) {
  .viewer-video-controls { padding:42px 10px 9px; }
  .viewer-video-control-row { gap:5px; }
  .viewer-video-volume { width:58px; }
  .viewer-video-time { font-size:.7rem; }
  .viewer-video-speed select,.viewer-quality-inline select { padding:4px 5px; font-size:.7rem; max-width:82px; }
  .viewer-quality-inline small { display:none; }
}

/* R12: integridad, selección y operaciones masivas */
.button-danger { border-color:color-mix(in srgb,#d94a4a 55%,var(--border)); background:#b83232; color:#fff; }
.button-danger:hover { background:#9f2929; }
.alert-warning { border-color:color-mix(in srgb,#d99a2b 50%,var(--border)); background:color-mix(in srgb,#d99a2b 12%,var(--surface)); }
.damaged-alert { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.damaged-alert strong,.damaged-alert small { display:block; }
.damaged-alert small { margin-top:4px; color:var(--muted); }
.media-badge-danger { background:rgba(178,42,42,.9); }
.is-damaged { outline:1px solid color-mix(in srgb,#d94a4a 55%,transparent); }
.context-menu button.danger { color:#e25d5d; }
.settings-grid { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(280px,.7fr); gap:18px; }
.panel-card { border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); padding:20px; }
.panel-card h2 { margin:5px 0 10px; }
.settings-status { display:grid; gap:4px; margin:16px 0; padding:12px 14px; border-radius:12px; background:var(--surface-2); }
.settings-status small { color:var(--muted); }
.feature-list { margin:12px 0 0; padding-left:20px; color:var(--muted); line-height:1.8; }
.select-with-icon { display:grid; grid-template-columns:34px minmax(0,1fr); align-items:center; border:1px solid var(--border); border-radius:11px; background:var(--surface-2); overflow:hidden; }
.select-with-icon .select-leading { display:grid; place-items:center; height:100%; color:var(--accent); font-weight:900; }
.select-with-icon select { width:100%; border:0; border-left:1px solid var(--border); border-radius:0; background:transparent; }
.selection-check { position:absolute; z-index:4; top:9px; right:9px; display:none; place-items:center; width:28px; height:28px; border:2px solid rgba(255,255,255,.9); border-radius:9px; background:rgba(0,0,0,.5); color:white; pointer-events:none; }
body.selection-mode .selection-check { display:grid; }
[data-selectable-file] { transition:transform .14s ease, box-shadow .14s ease, opacity .14s ease; }
[data-selectable-file].is-selected { transform:scale(.965); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 75%,transparent); }
[data-selectable-file].is-selected .selection-check { background:var(--accent); border-color:var(--accent); }
.file-row { position:relative; }
.file-selection-check { position:relative; top:auto; right:auto; grid-column:1; grid-row:1; }
body.selection-mode .file-row[data-selectable-file] { grid-template-columns:30px 42px minmax(0,1fr) auto; }
body.selection-mode .file-row[data-selectable-file] .file-kind { grid-column:2; }
body.selection-mode .file-row[data-selectable-file] .file-main { grid-column:3; }
body.selection-mode .file-row[data-selectable-file] .file-size { grid-column:4; }
.bulk-toolbar { position:fixed; z-index:9500; left:50%; bottom:22px; transform:translateX(-50%); display:flex; align-items:center; gap:18px; max-width:calc(100vw - 28px); padding:10px 12px 10px 16px; border:1px solid var(--border); border-radius:16px; background:color-mix(in srgb,var(--surface) 94%,transparent); box-shadow:0 16px 60px rgba(0,0,0,.32); backdrop-filter:blur(12px); }
.bulk-toolbar[hidden] { display:none; }
.bulk-toolbar-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.move-dialog { width:min(560px,calc(100% - 28px)); border:0; padding:0; background:transparent; }
.move-dialog::backdrop { background:rgba(5,8,15,.82); backdrop-filter:blur(7px); }
@media (max-width:780px) {
  .settings-grid { grid-template-columns:1fr; }
  .bulk-toolbar { width:calc(100vw - 24px); bottom:12px; align-items:flex-start; flex-direction:column; gap:8px; }
  .bulk-toolbar-actions { width:100%; }
  .bulk-toolbar-actions .button { flex:1 1 auto; }
  body.selection-mode .file-row[data-selectable-file] { grid-template-columns:30px 38px minmax(0,1fr); }
  body.selection-mode .file-row[data-selectable-file] .file-size { grid-column:3; }
}

/* R13: integridad visible y selector de carpetas */
.settings-section { margin-top:22px; }
.section-heading { display:flex; justify-content:space-between; align-items:end; gap:18px; margin-bottom:14px; }
.section-heading h2 { margin:4px 0 0; }
.integrity-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:14px; }
.integrity-card { border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); padding:18px; display:grid; gap:14px; }
.integrity-card.is-offline { opacity:.62; filter:saturate(.6); }
.integrity-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.integrity-head h3 { margin:0 0 4px; }
.health-counts { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.health-counts span { padding:5px 8px; border-radius:999px; font-size:.72rem; font-weight:800; background:var(--surface-2); }
.health-ok { color:#62c983; }.health-warning { color:#d9a33a; }.health-danger { color:#e36b6b; }
.damaged-list { display:grid; gap:7px; padding:12px; border-radius:12px; background:color-mix(in srgb,#d94a4a 7%,var(--surface-2)); }
.damaged-list-item { display:grid; gap:2px; padding-top:7px; border-top:1px solid var(--border); }
.damaged-list-item:first-of-type { border-top:0; padding-top:0; }
.damaged-list-item small { color:var(--muted); overflow-wrap:anywhere; }
.compact-copy { margin:5px 0 0; }
.folder-picker { display:grid; gap:10px; border:1px solid var(--border); border-radius:14px; padding:12px; background:var(--surface-2); }
.folder-picker-head { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.folder-picker-head small,.folder-picker-head strong { display:block; }
.folder-list { display:grid; gap:6px; max-height:220px; overflow:auto; }
.folder-choice { display:flex; align-items:center; gap:9px; width:100%; padding:9px 10px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text); cursor:pointer; text-align:left; }
.folder-choice:hover { border-color:var(--accent); }
.folder-choice-icon { color:var(--accent); }
.folder-create-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
.button-small { min-height:34px; padding:6px 9px; }
.select-leading-stack > span { display:grid; place-items:center; }
.select-leading-stack > span[hidden] { display:none; }
.select-leading .nav-icon,.select-leading .inline-icon { width:19px; height:19px; }
@media(max-width:700px){.section-heading,.integrity-head{align-items:flex-start;flex-direction:column}.health-counts{justify-content:flex-start}.folder-create-row{grid-template-columns:1fr}}

/* R17 · Lenguaje visual tipo Drive en modo oscuro, completamente local. */
:root {
  color-scheme: dark;
  --bg: #111315;
  --surface: #1b1d1f;
  --surface-2: #26282b;
  --surface-3: #303236;
  --text: #e3e3e3;
  --muted: #a9acb0;
  --border: #3b3d40;
  --accent: #a8c7fa;
  --accent-strong: #c2e7ff;
  --accent-container: #004a77;
  --accent-container-text: #c2e7ff;
  --danger-bg: #3b1f22;
  --danger: #ffb4ab;
  --shadow: 0 8px 28px rgba(0,0,0,.28);
  --radius: 16px;
  --drive-header-height: 72px;
  --drive-sidebar-width: 256px;
}
html,body { background:#111315; }
body { color:var(--text); font-family:Arial,"Segoe UI",Roboto,sans-serif; font-size:14px; }

.site-footer {
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:48px;
  padding:12px 16px 20px;
  color:#9aa0a6;
  font-size:13px;
  letter-spacing:.01em;
  text-align:center;
}
.site-footer a {
  color:inherit;
  text-decoration:none;
}
.site-footer a:hover {
  color:#e8eaed;
  text-decoration:underline;
}
.auth-main .site-footer {
  width:100%;
  margin-top:10px;
}
.app-main > .site-footer {
  padding-bottom:14px;
}
h1,h2,h3,strong { font-weight:500; }
h1 { letter-spacing:-.02em; }
select,select option,select optgroup,input,textarea { color-scheme:dark; background:#202124; color:var(--text); }
select option,select optgroup { background:#202124; color:#e8eaed; }

.app-body {
  min-height:100vh;
  display:grid;
  grid-template-columns:var(--drive-sidebar-width) minmax(0,1fr);
  grid-template-rows:var(--drive-header-height) minmax(0,1fr);
  grid-template-areas:"topbar topbar" "sidebar main";
  background:#111315;
}
.drive-topbar {
  grid-area:topbar;
  position:sticky;
  top:0;
  z-index:8000;
  display:grid;
  grid-template-columns:var(--drive-sidebar-width) minmax(320px,980px) 1fr;
  align-items:center;
  min-height:var(--drive-header-height);
  padding:8px 18px 8px 20px;
  background:#111315;
}
.drive-brand { display:flex; align-items:center; gap:10px; width:max-content; color:#e8eaed; text-decoration:none; font-size:22px; }
.drive-brand-mark { display:grid; width:42px; height:38px; place-items:center; }
.drive-brand-mark svg { width:40px; height:36px; display:block; }
.drive-brand-name { font-weight:400; }
.drive-search {
  justify-self:stretch;
  display:grid;
  grid-template-columns:48px minmax(0,1fr);
  align-items:center;
  height:52px;
  border-radius:28px;
  background:#282a2d;
  color:#bdc1c6;
  transition:background .15s ease,box-shadow .15s ease;
}
.drive-search:focus-within { background:#303134; box-shadow:0 1px 3px rgba(0,0,0,.35); }
.drive-search-icon { display:grid; place-items:center; }
.drive-search-icon .inline-icon { width:22px; height:22px; }
.drive-search input { height:100%; border:0; padding:0 18px 0 0; background:transparent; color:#e8eaed; font-size:16px; outline:0; box-shadow:none; }
.drive-search input::placeholder { color:#bdc1c6; opacity:1; }
.drive-search-submit { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); border:0; }
.drive-topbar-actions { justify-self:end; display:flex; align-items:center; gap:8px; padding-left:18px; }
.drive-top-action { display:grid; width:42px; height:42px; place-items:center; border-radius:50%; color:#c4c7c5; }
.drive-top-action:hover { background:#292b2e; }
.drive-top-action .nav-icon,.drive-top-action .inline-icon { width:23px; height:23px; }
.account-menu { position:relative; }
.account-menu > summary { list-style:none; }
.account-menu > summary::-webkit-details-marker { display:none; }
.avatar-button { width:38px; height:38px; cursor:pointer; background:#7259d9; color:white; border:2px solid #111315; box-shadow:0 0 0 1px #5f6368; }
.account-popover { position:absolute; top:48px; right:0; width:270px; padding:14px; border:1px solid #3c4043; border-radius:18px; background:#252629; box-shadow:0 12px 36px rgba(0,0,0,.45); }
.account-popover-user { display:flex; align-items:center; gap:12px; padding:6px 4px 14px; }
.account-popover-user .avatar { background:#7259d9; color:white; }
.account-popover-user strong,.account-popover-user small { display:block; }

.sidebar {
  grid-area:sidebar;
  position:sticky;
  top:var(--drive-header-height);
  height:calc(100vh - var(--drive-header-height));
  display:flex;
  flex-direction:column;
  gap:16px;
  border:0;
  background:#111315;
  padding:10px 14px 18px 18px;
  overflow:auto;
}
.drive-new-button {
  display:inline-flex;
  align-self:flex-start;
  align-items:center;
  gap:13px;
  min-width:124px;
  min-height:56px;
  margin-bottom:2px;
  padding:0 18px;
  border:0;
  border-radius:16px;
  background:#27292c;
  color:#e8eaed;
  text-decoration:none;
  font-size:14px;
  font-weight:600;
  box-shadow:0 1px 3px rgba(0,0,0,.45);
}
.drive-new-button:hover { background:#303236; box-shadow:0 2px 6px rgba(0,0,0,.5); }
.drive-new-button .inline-icon { width:24px; height:24px; }
.nav { display:grid; gap:2px; }
.nav-link { min-height:40px; display:flex; align-items:center; gap:16px; padding:0 16px; border-radius:22px; color:#c4c7c5; font-weight:500; }
.nav-link:hover { background:#25272a; color:#e8eaed; }
.nav-link.active { background:var(--accent-container); color:var(--accent-container-text); }
.nav-link .nav-icon { width:20px; height:20px; }
.nav-separator { height:1px; margin:8px 10px; background:#303134; }
.drive-sidebar-note { margin-top:auto; display:flex; gap:10px; padding:14px 12px; border-top:1px solid #303134; color:#bdc1c6; }
.drive-sidebar-note-icon { flex:0 0 auto; }
.drive-sidebar-note strong,.drive-sidebar-note small { display:block; }
.drive-sidebar-note strong { color:#e8eaed; font-size:12px; }
.drive-sidebar-note small { margin-top:3px; font-size:11px; line-height:1.35; }

.app-main { grid-area:main; min-width:0; min-height:0; padding:0 16px 16px 0; }
.page,.page-narrow {
  width:100%;
  max-width:none;
  min-height:calc(100vh - var(--drive-header-height) - 16px);
  margin:0;
  padding:26px 24px 52px;
  border-radius:24px;
  background:#1b1d1f;
}
.drive-page { overflow:hidden; }
.page-header { margin:0 0 20px; align-items:center; }
.page-header h1 { margin:0 0 6px; font-size:28px; font-weight:400; }
.page-header .eyebrow { display:none; }
.page-header .muted { max-width:760px; margin:0; font-size:13px; }
.drive-page-titlebar,.drive-files-header { display:flex; align-items:center; justify-content:space-between; gap:20px; min-height:48px; margin-bottom:22px; }
.drive-page-titlebar h1 { margin:0; font-size:28px; line-height:1.2; font-weight:400; }
.drive-title-info { display:grid; width:36px; height:36px; place-items:center; border-radius:50%; color:#c4c7c5; }
.drive-title-info:hover { background:#2b2d30; }
.drive-title-info .inline-icon { width:21px; height:21px; }

.drive-section { margin-top:20px; }
.drive-section-heading { display:flex; align-items:center; min-height:42px; margin-bottom:8px; }
.drive-section-heading-actions { justify-content:space-between; }
.drive-section-heading h2 { margin:0; font-size:16px; font-weight:500; }
.drive-section-chevron { display:inline-block; width:24px; color:#c4c7c5; font-size:20px; }
.drive-suggested-folders { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.drive-folder-chip,.file-root-card {
  display:grid;
  grid-template-columns:32px minmax(0,1fr) 26px;
  align-items:center;
  gap:10px;
  min-height:64px;
  padding:10px 12px;
  border:0;
  border-radius:14px;
  background:#282a2d;
  color:#e8eaed;
  text-decoration:none;
  box-shadow:none;
}
.drive-folder-chip:hover,.file-root-card:hover { background:#303236; border-color:transparent; }
.drive-folder-icon,.file-root-icon { display:grid; width:28px; height:28px; place-items:center; border-radius:0; background:transparent; color:#c4c7c5; font-size:initial; }
.drive-folder-icon .inline-icon,.file-root-icon .inline-icon { width:25px; height:25px; }
.drive-folder-copy,.file-root-copy { min-width:0; }
.drive-folder-copy strong,.drive-folder-copy small,.file-root-copy strong,.file-root-copy small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.drive-folder-copy strong,.file-root-copy strong { font-size:14px; font-weight:500; }
.drive-folder-copy small,.file-root-copy small { margin-top:2px; color:#aeb0b4; font-size:12px; }
.drive-card-more { justify-self:end; font-size:22px; line-height:1; color:#c4c7c5; }
.drive-folder-chip.is-offline,.file-root-card.is-offline { opacity:.58; filter:saturate(.55); }

.drive-view-toggle { display:inline-flex; align-items:center; height:40px; overflow:hidden; border:1px solid #5f6368; border-radius:22px; background:transparent; }
.drive-view-button { display:grid; place-items:center; width:50px; height:100%; border:0; border-left:1px solid #5f6368; background:transparent; color:#c4c7c5; cursor:pointer; }
.drive-view-button:first-child { border-left:0; }
.drive-view-button.active { background:#004a77; color:#c2e7ff; }
.drive-view-button:hover:not(.active) { background:#2b2d30; }
.drive-view-button .inline-icon { width:20px; height:20px; }

.drive-home-files { display:grid; gap:16px; }
.drive-home-files.is-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
.drive-home-file-card { min-width:0; overflow:hidden; border:0; border-radius:14px; background:#282a2d; }
.drive-home-file-card:hover { background:#303236; }
.drive-home-file-card.is-offline { opacity:.62; filter:saturate(.55); }
.drive-home-file-head { display:grid; grid-template-columns:24px minmax(0,1fr) 32px; align-items:center; gap:8px; min-height:52px; padding:6px 8px 6px 12px; }
.drive-home-file-head strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.drive-kind-icon { display:grid; place-items:center; color:#c4c7c5; }
.drive-kind-icon .inline-icon,.drive-kind-icon .nav-icon { width:18px; height:18px; }
.drive-kind-image { color:#f28b82; }.drive-kind-video { color:#f28b82; }.drive-kind-audio { color:#8ab4f8; }.drive-kind-document { color:#8ab4f8; }.drive-kind-archive { color:#bdc1c6; }
.drive-more-button { display:grid; place-items:center; width:32px; height:32px; border:0; border-radius:50%; background:transparent; color:#c4c7c5; cursor:pointer; }
.drive-more-button:hover { background:#3a3c40; }
.drive-more-button .inline-icon { width:18px; height:18px; }
.drive-home-file-preview { display:grid; height:154px; margin:0 8px; overflow:hidden; place-items:center; border-radius:4px; background:#202124; text-decoration:none; }
.drive-home-file-preview img { width:100%; height:100%; object-fit:cover; }
.drive-preview-placeholder { display:grid; width:64px; height:64px; place-items:center; color:#8ab4f8; }
.drive-preview-placeholder .inline-icon,.drive-preview-placeholder .nav-icon { width:48px; height:48px; }
.drive-home-file-meta { display:flex; justify-content:space-between; gap:8px; min-height:44px; padding:10px 12px; color:#aeb0b4; font-size:11px; }
.drive-home-files.is-list { display:block; border-top:1px solid #3c4043; }
.drive-home-files.is-list .drive-home-file-card { display:grid; grid-template-columns:minmax(0,1fr) 210px; border-radius:0; border-bottom:1px solid #3c4043; background:transparent; }
.drive-home-files.is-list .drive-home-file-preview { display:none; }
.drive-home-files.is-list .drive-home-file-meta { align-items:center; }
.drive-empty-inline { display:flex; align-items:center; gap:14px; min-height:92px; padding:16px 18px; border-radius:14px; background:#282a2d; }
.drive-empty-inline strong,.drive-empty-inline small { display:block; }
.drive-empty-inline small { margin-top:4px; }
.drive-empty-icon { display:grid; width:42px; height:42px; place-items:center; border-radius:50%; background:#34363a; color:#c4c7c5; }

.drive-files-header { margin-bottom:16px; }
.drive-breadcrumb-title { display:flex; align-items:center; min-width:0; gap:4px; font-size:24px; }
.drive-breadcrumb-title a,.drive-breadcrumb-title > span:not(.drive-breadcrumb-separator) { max-width:340px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#e8eaed; text-decoration:none; font-weight:400; }
.drive-breadcrumb-title a:hover { background:#2b2d30; border-radius:8px; }
.drive-breadcrumb-separator { display:grid; place-items:center; color:#9aa0a6; }
.drive-breadcrumb-separator .inline-icon { width:20px; height:20px; }
.drive-files-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.drive-files-actions .icon-button { border:0; border-radius:50%; background:transparent; }
.drive-files-actions .icon-button:hover { background:#2b2d30; }
.drive-upload-inline { min-height:38px; border-radius:20px; }
.drive-content-label { margin:10px 0 12px 4px; font-size:14px; color:#c4c7c5; }
.file-root-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.drive-search-results-heading { margin:10px 0 16px; }
.drive-search-results-heading h2 { margin:0 0 3px; font-size:16px; }

.listing-controls { min-height:38px; padding:0; overflow:hidden; border:1px solid #5f6368; border-radius:20px; background:transparent; }
.listing-controls > span { display:none; }
.listing-option { display:flex; align-items:center; min-height:36px; padding:0 13px; border-radius:0; border-left:1px solid #5f6368; font-size:12px; color:#c4c7c5; }
.listing-option:first-of-type { border-left:0; }
.listing-option.active { background:#004a77; color:#c2e7ff; }
.drive-filter-chip { position:relative; min-height:38px; border:1px solid #5f6368; border-radius:20px; background:transparent; color:#e8eaed; font-weight:500; }
.drive-filter-chip:hover { background:#2b2d30; }

.file-list.drive-file-list { overflow:visible; border:0; border-radius:0; background:transparent; }
.file-list.drive-file-list.is-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:16px; }
.file-list.drive-file-list.is-grid .file-row {
  position:relative;
  display:grid;
  grid-template-columns:24px minmax(0,1fr) 32px;
  grid-template-rows:52px 154px 42px;
  gap:0 8px;
  min-width:0;
  min-height:248px;
  padding:0;
  overflow:hidden;
  border:0;
  border-radius:14px;
  background:#282a2d;
  color:#e8eaed;
}
.file-list.drive-file-list.is-grid .file-row:hover { background:#303236; }
.file-list.drive-file-list.is-grid .file-card-preview { grid-column:1/-1; grid-row:2; display:grid; place-items:center; min-width:0; margin:0 8px; overflow:hidden; border-radius:4px; background:#202124; }
.file-list.drive-file-list.is-grid .file-card-preview img { width:100%; height:100%; object-fit:cover; }
.file-list.drive-file-list.is-grid .file-card-preview.folder-preview { color:#c4c7c5; }
.file-list.drive-file-list.is-grid .file-card-preview.folder-preview .inline-icon { width:66px; height:66px; }
.file-list.drive-file-list.is-grid .file-kind { grid-column:1; grid-row:1; width:auto; height:auto; margin-left:12px; border-radius:0; background:transparent; color:#c4c7c5; }
.file-list.drive-file-list.is-grid .file-kind .inline-icon,.file-list.drive-file-list.is-grid .file-kind .nav-icon { width:18px; height:18px; }
.file-list.drive-file-list.is-grid .file-main { grid-column:2; grid-row:1; align-self:center; }
.file-list.drive-file-list.is-grid .file-main strong { font-size:14px; font-weight:500; }
.file-list.drive-file-list.is-grid .file-main small { display:none; }
.file-list.drive-file-list.is-grid .file-size { grid-column:1/-1; grid-row:3; align-self:center; padding:0 12px; color:#aeb0b4; font-size:11px; }
.file-list.drive-file-list.is-grid .file-row-more { grid-column:3; grid-row:1; align-self:center; justify-self:center; }
.file-list.drive-file-list.is-grid .file-selection-check { position:absolute; top:8px; right:8px; z-index:8; grid-column:auto; grid-row:auto; }
.file-list.drive-file-list.is-list { display:block; border-top:1px solid #3c4043; }
.file-list.drive-file-list.is-list .file-row { display:grid; grid-template-columns:38px minmax(0,1fr) 120px 42px; align-items:center; min-height:56px; padding:0 6px 0 10px; border:0; border-bottom:1px solid #3c4043; border-radius:0; background:transparent; }
.file-list.drive-file-list.is-list .file-row:hover { background:#282a2d; }
.file-list.drive-file-list.is-list .file-card-preview { display:none; }
.file-list.drive-file-list.is-list .file-kind { width:34px; height:34px; border-radius:0; background:transparent; color:#c4c7c5; }
.file-list.drive-file-list.is-list .file-kind .inline-icon,.file-list.drive-file-list.is-list .file-kind .nav-icon { width:20px; height:20px; }
.file-list.drive-file-list.is-list .file-main small { margin-top:2px; font-size:11px; }
.file-list.drive-file-list.is-list .file-row-more { justify-self:end; }
.file-list.drive-file-list.is-list .file-selection-check { position:absolute; left:10px; top:13px; }
body.selection-mode .file-list.drive-file-list.is-list .file-row[data-selectable-file] { grid-template-columns:38px minmax(0,1fr) 120px 42px; padding-left:52px; }
body.selection-mode .file-list.drive-file-list.is-grid .file-row[data-selectable-file] { grid-template-columns:24px minmax(0,1fr) 32px; }

.photo-grid { grid-template-columns:repeat(5,minmax(0,1fr)); gap:16px; }
.photo-card { border:0; border-radius:14px; background:#282a2d; box-shadow:none; }
.photo-card:hover { background:#303236; transform:none; }
.photo-card img,.photo-placeholder { aspect-ratio:4/3; background:#202124; }
.photo-meta { background:transparent; padding:10px 12px; }
.photo-meta strong { font-weight:500; }
.media-badge { border-radius:12px; background:rgba(32,33,36,.82); }

.stat-card,.panel,.feature-card,.callout,.empty-state,.storage-card,.panel-card,.integrity-card { border:0; background:#282a2d; box-shadow:none; }
.storage-card,.panel-card,.integrity-card { border-radius:16px; }
.storage-card:hover,.panel-card:hover,.integrity-card:hover { background:#2d2f32; }
.meta-grid div,.settings-status,.index-progress,.folder-picker { background:#202124; }
.button { min-height:40px; border-radius:20px; font-weight:600; }
.button-primary { background:#a8c7fa; color:#062e6f; }
.button-primary:hover { background:#c2e7ff; }
.button-secondary { border-color:#5f6368; background:transparent; color:#e8eaed; }
.button-secondary:hover,.button-ghost:hover { background:#303236; }
.button-ghost { border-color:#5f6368; }
.icon-button { border-color:#5f6368; border-radius:50%; background:transparent; }
.icon-button:hover { background:#303236; }
input,select { border-color:#5f6368; border-radius:8px; background:#202124; }
input:focus,select:focus { border-color:#a8c7fa; box-shadow:0 0 0 1px #a8c7fa; }
.dialog-card { border-color:#3c4043; border-radius:24px; background:#282a2d; }
.context-menu { border-color:#3c4043; border-radius:8px; background:#282a2d; box-shadow:0 8px 28px rgba(0,0,0,.48); }
.context-menu button:hover,.context-menu button:focus-visible { background:#3a3c40; }
.alert { border-color:#3c4043; background:#25272a; }

.auth-body { background:#111315; }
.auth-main { width:min(100%,520px); }
.auth-card { border:1px solid #3c4043; border-radius:28px; background:#1b1d1f; box-shadow:none; }
.auth-card h1 { font-size:32px; font-weight:400; }
.auth-card .eyebrow { color:#a8c7fa; }

@media (max-width:1280px) {
  .drive-home-files.is-grid,.file-list.drive-file-list.is-grid,.photo-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .drive-suggested-folders,.file-root-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:980px) {
  :root { --drive-sidebar-width:210px; }
  .drive-topbar { grid-template-columns:var(--drive-sidebar-width) minmax(240px,1fr) auto; }
  .drive-home-files.is-grid,.file-list.drive-file-list.is-grid,.photo-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .drive-suggested-folders,.file-root-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .app-body { display:block; padding-top:64px; }
  .drive-topbar { position:fixed; inset:0 0 auto 0; display:grid; grid-template-columns:auto minmax(0,1fr) auto; min-height:64px; padding:7px 10px; }
  .drive-brand-name { display:none; }
  .drive-brand-mark { width:40px; }
  .drive-search { height:46px; border-radius:24px; grid-template-columns:42px minmax(0,1fr); }
  .drive-topbar-actions { padding-left:6px; }
  .drive-top-action { display:none; }
  .sidebar { position:fixed; z-index:7000; left:0; right:0; top:auto; bottom:0; height:62px; padding:6px 8px; background:#1b1d1f; border-top:1px solid #303134; overflow:hidden; }
  .drive-new-button,.drive-sidebar-note,.drive-storage-summary,.nav-separator { display:none; }
  .nav { display:grid; grid-template-columns:repeat(5,1fr); gap:2px; }
  .nav-link { display:grid; justify-items:center; align-content:center; gap:2px; min-height:50px; padding:2px 4px; border-radius:16px; font-size:10px; }
  .nav-link .nav-icon { width:19px; height:19px; }
  .app-main { padding:0 0 62px; }
  .page,.page-narrow { min-height:calc(100vh - 126px); padding:18px 14px 34px; border-radius:0; }
  .drive-page-titlebar h1,.drive-breadcrumb-title { font-size:21px; }
  .drive-files-header { align-items:flex-start; flex-direction:column; gap:10px; }
  .drive-files-actions { width:100%; justify-content:flex-start; overflow-x:auto; flex-wrap:nowrap; padding-bottom:2px; }
  .drive-home-files.is-grid,.file-list.drive-file-list.is-grid,.photo-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .drive-suggested-folders,.file-root-grid { grid-template-columns:1fr; gap:8px; }
  .drive-home-file-preview,.file-list.drive-file-list.is-grid .file-card-preview { height:128px; }
  .file-list.drive-file-list.is-grid .file-row { grid-template-rows:48px 128px 38px; min-height:214px; }
  .drive-home-files.is-list .drive-home-file-card { grid-template-columns:1fr; }
  .drive-home-files.is-list .drive-home-file-meta { display:none; }
}
@media (max-width:460px) {
  .drive-home-files.is-grid,.file-list.drive-file-list.is-grid,.photo-grid { grid-template-columns:1fr 1fr; }
  .drive-search input { font-size:14px; }
  .drive-home-file-preview,.file-list.drive-file-list.is-grid .file-card-preview { height:112px; }
  .file-list.drive-file-list.is-grid .file-row { grid-template-rows:46px 112px 36px; min-height:194px; }
}

/* Drive parity r18: unidades con acciones reales y página principal tipo Drive. */
.drive-folder-unit,.file-root-card { position:relative; min-width:0; border:0; border-radius:14px; background:#282a2d; }
.drive-folder-unit:hover,.file-root-card:hover { background:#303236; }
.drive-folder-unit.is-offline,.file-root-card.is-offline { opacity:.64; filter:saturate(.62); }
.drive-folder-chip { grid-template-columns:32px minmax(0,1fr); padding-right:48px; background:transparent; }
.drive-folder-chip:hover { background:transparent; }
.drive-unit-more { position:absolute; right:8px; top:50%; transform:translateY(-50%); z-index:3; }
.file-root-card { display:block; padding:0; }
.file-root-link { display:grid; grid-template-columns:32px minmax(0,1fr); align-items:center; gap:10px; min-height:64px; padding:10px 48px 10px 12px; color:#e8eaed; text-decoration:none; }
.file-root-link:hover { color:#fff; }

.drive-home-files { position:relative; }
.drive-home-list-header { display:none; }
.drive-home-file-head { grid-template-columns:24px minmax(0,1fr); }
.drive-home-file-name { min-width:0; overflow:hidden; color:#e8eaed; font-size:14px; font-weight:500; text-decoration:none; text-overflow:ellipsis; white-space:nowrap; }
.drive-home-file-name:hover { text-decoration:underline; }
.drive-home-file-more { position:absolute; right:7px; top:9px; z-index:3; }
.drive-home-file-card { position:relative; }
.drive-home-file-reason,.drive-home-file-owner,.drive-home-file-location { display:none; }
.drive-owner-avatar { display:inline-grid; width:26px; height:26px; place-items:center; border-radius:50%; background:#6f42c1; color:#fff; font-size:9px; }

.drive-home-files.is-list { border-top:0; }
.drive-home-files.is-list .drive-home-list-header { display:grid; grid-template-columns:minmax(260px,1.6fr) minmax(210px,1.15fr) minmax(150px,.65fr) minmax(170px,.75fr) 40px; align-items:center; min-height:42px; padding:0 8px 0 14px; border-bottom:1px solid #3c4043; color:#c4c7c5; font-size:13px; }
.drive-home-files.is-list .drive-home-file-card { display:grid; grid-template-columns:minmax(260px,1.6fr) minmax(210px,1.15fr) minmax(150px,.65fr) minmax(170px,.75fr) 40px; align-items:center; min-height:58px; overflow:visible; border-bottom:1px solid #3c4043; background:transparent; }
.drive-home-files.is-list .drive-home-file-card:hover { background:#282a2d; }
.drive-home-files.is-list .drive-home-file-head { display:grid; grid-template-columns:28px minmax(0,1fr); min-height:58px; padding:0 10px 0 14px; }
.drive-home-files.is-list .drive-home-file-preview,.drive-home-files.is-list .drive-home-file-meta { display:none; }
.drive-home-files.is-list .drive-home-file-reason,.drive-home-files.is-list .drive-home-file-owner,.drive-home-files.is-list .drive-home-file-location { display:flex; min-width:0; align-items:center; gap:8px; overflow:hidden; padding:0 10px; color:#bdc1c6; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.drive-home-files.is-list .drive-home-file-location .inline-icon { width:18px; height:18px; flex:0 0 auto; color:#9aa0a6; }
.drive-home-files.is-list .drive-home-file-more { position:static; justify-self:center; transform:none; }

.unit-context-menu a { display:flex; align-items:center; gap:12px; min-height:40px; padding:0 14px; border:0; background:transparent; color:#e8eaed; text-decoration:none; font:inherit; }
.unit-context-menu a:hover { background:#3c4043; }
.unit-context-menu a .inline-icon,.unit-context-menu a .nav-icon { width:19px; height:19px; }
.drive-properties-dialog { width:min(600px,calc(100vw - 24px)); max-width:none; padding:0; border:1px solid #3c4043; border-radius:22px; background:#282a2d; color:#e8eaed; box-shadow:0 20px 70px rgba(0,0,0,.55); }
.drive-properties-dialog::backdrop { background:rgba(0,0,0,.58); backdrop-filter:blur(2px); }
.drive-properties-card { padding:22px; }
.drive-properties-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:16px; }
.drive-properties-head small { display:block; margin-bottom:4px; color:#9aa0a6; font-size:12px; }
.drive-properties-head h2 { margin:0; font-size:22px; font-weight:500; }
.drive-properties-status { margin-bottom:18px; padding:10px 12px; border-radius:12px; background:#202124; color:#bdc1c6; font-size:13px; }
.drive-properties-status.online { background:#173326; color:#a8dab5; }
.drive-properties-status.offline { background:#3b2525; color:#f2b8b5; }
.drive-properties-grid { display:grid; grid-template-columns:1fr 1fr; gap:0; margin:0; border-top:1px solid #3c4043; }
.drive-properties-grid > div { min-width:0; padding:12px 10px; border-bottom:1px solid #3c4043; }
.drive-properties-grid dt,.drive-properties-technical dt { color:#9aa0a6; font-size:11px; }
.drive-properties-grid dd,.drive-properties-technical dd { margin:4px 0 0; overflow-wrap:anywhere; color:#e8eaed; font-size:13px; }
.drive-properties-technical { margin-top:16px; }
.drive-properties-technical summary { cursor:pointer; color:#c2e7ff; font-size:13px; }
.drive-properties-technical dl { display:grid; gap:10px; margin:14px 0 0; padding:14px; border-radius:12px; background:#202124; }
.drive-unit-toast { position:fixed; right:22px; bottom:22px; z-index:120; max-width:min(380px,calc(100vw - 32px)); padding:12px 16px; border-radius:12px; background:#e8eaed; color:#202124; box-shadow:0 8px 30px rgba(0,0,0,.45); font-size:13px; }

@media (max-width: 900px) {
  .drive-home-files.is-list .drive-home-list-header { display:none; }
  .drive-home-files.is-list .drive-home-file-card { grid-template-columns:minmax(0,1fr) 40px; }
  .drive-home-files.is-list .drive-home-file-reason,.drive-home-files.is-list .drive-home-file-owner,.drive-home-files.is-list .drive-home-file-location { display:none; }
  .drive-properties-grid { grid-template-columns:1fr; }
}
.context-menu-separator { height:1px; margin:6px 0; background:#4a4d51; }
.context-menu button:disabled { opacity:.42; cursor:not-allowed; }
.context-menu button:disabled:hover { background:transparent; }

/* R18: acciones Drive reales, creación y drag & drop */
.drive-new-menu { min-width:240px; padding:8px; }
.drive-new-menu .nav-icon,.drive-new-menu .inline-icon,.context-menu .nav-icon { width:19px; height:19px; flex:0 0 auto; }
.drive-folder-dialog .dialog-card { width:min(460px,calc(100vw - 28px)); }
.drive-folder-destination { display:grid; gap:4px; padding:12px 14px; border:1px solid #4a4d51; border-radius:10px; background:#202124; }
.drive-folder-destination small { color:#9aa0a6; font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.drive-folder-destination strong { overflow:hidden; color:#e8eaed; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.drive-drop-overlay { position:absolute; z-index:45; inset:12px; display:grid; place-items:center; border:2px dashed #a8c7fa; border-radius:20px; background:rgba(23,29,38,.9); pointer-events:none; backdrop-filter:blur(3px); }
.drive-drop-overlay[hidden] { display:none; }
.drive-drop-overlay > div { display:grid; justify-items:center; gap:10px; color:#e8eaed; text-align:center; }
.drive-drop-overlay .inline-icon { width:42px; height:42px; color:#a8c7fa; }
.drive-drop-overlay strong { font-size:18px; }
.drive-drop-overlay small { color:#bdc1c6; }
.drive-files-page { position:relative; }
.drive-files-page.is-dragging-files { outline:1px solid rgba(168,199,250,.35); outline-offset:-1px; }
.drive-rename-dialog { width:min(460px,calc(100vw - 24px)); max-width:none; padding:0; border:1px solid #3c4043; border-radius:20px; background:#282a2d; color:#e8eaed; box-shadow:0 20px 70px rgba(0,0,0,.55); }
.drive-rename-dialog::backdrop { background:rgba(0,0,0,.58); backdrop-filter:blur(2px); }
.drive-rename-card { display:grid; gap:18px; padding:22px; }
.drive-rename-card label { display:grid; gap:8px; color:#e8eaed; }
.drive-rename-card input { width:100%; }
@media (max-width:760px) {
  .drive-drop-overlay { inset:6px; border-radius:14px; }
  .drive-rename-card { padding:18px; }
}

/* R18: filtros funcionales de Mi unidad, Recientes y Destacados. */
.drive-filter-row {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin:-2px 0 16px;
}
.drive-filter-select { display:inline-flex; margin:0; }
.drive-filter-select select {
  width:auto;
  min-width:116px;
  height:38px;
  margin:0;
  padding:0 34px 0 13px;
  border:1px solid #5f6368;
  border-radius:8px;
  background-color:#1b1d1f;
  color:#e8eaed;
  color-scheme:dark;
  font:500 13px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
  cursor:pointer;
}
.drive-filter-select select:hover { background-color:#282a2d; border-color:#7a7e83; }
.drive-filter-select select:focus { border-color:#a8c7fa; box-shadow:0 0 0 1px #a8c7fa; outline:0; }
.drive-filter-select select option { background:#202124; color:#e8eaed; }
.drive-filter-clear {
  min-height:38px;
  padding:0 12px;
  border:0;
  border-radius:18px;
  background:transparent;
  color:#a8c7fa;
  font:500 13px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
  cursor:pointer;
}
.drive-filter-clear:hover { background:#2b2d30; }
@media (max-width: 640px) {
  .drive-filter-row { gap:8px; overflow-x:auto; flex-wrap:nowrap; padding-bottom:4px; }
  .drive-filter-select,.drive-filter-clear { flex:0 0 auto; }
}
.drive-home-file-activity { display:flex; min-width:0; align-items:center; gap:8px; }
.drive-home-file-activity > span:last-child { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.drive-home-files.is-grid .drive-owner-avatar { width:26px; height:26px; flex:0 0 auto; }

/* R19: Mi unidad separa carpetas/archivos e iconografía local por extensión. */
.drive-browser-sections { display:grid; gap:22px; }
.drive-browser-section[hidden] { display:none; }
.drive-folder-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:16px; }
.drive-folder-card {
  display:grid;
  grid-template-columns:32px minmax(0,1fr);
  align-items:center;
  gap:10px;
  min-height:58px;
  padding:9px 14px;
  overflow:hidden;
  border:0;
  border-radius:12px;
  background:#282a2d;
  color:#e8eaed;
  text-decoration:none;
}
.drive-folder-card:hover { background:#303236; }
.drive-folder-card.is-offline { opacity:.58; filter:saturate(.55); }
.drive-folder-card-icon { display:grid; width:28px; height:28px; place-items:center; color:#c4c7c5; }
.drive-folder-card-icon .inline-icon { width:25px; height:25px; }
.drive-folder-card strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; font-weight:500; }
.file-root-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }

.file-type-icon {
  --file-icon:#7b8190;
  position:relative;
  display:inline-block;
  width:24px;
  height:29px;
  flex:0 0 auto;
  color:#fff;
  vertical-align:middle;
}
.file-type-icon svg { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.file-type-vendored { display:block; width:100%; height:100%; object-fit:contain; }
.file-type-sheet { fill:var(--file-icon); }
.file-type-corner { fill:none; stroke:rgba(255,255,255,.78); stroke-width:1.1; stroke-linejoin:round; }
.file-type-badge {
  position:absolute;
  left:3px;
  right:3px;
  bottom:5px;
  overflow:hidden;
  color:#fff;
  font:800 5.5px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
  letter-spacing:-.03em;
  text-align:center;
  text-overflow:clip;
  white-space:nowrap;
}
.file-type-pdf { --file-icon:#ea4335; }
.file-type-word { --file-icon:#4285f4; }
.file-type-excel { --file-icon:#1e8e3e; }
.file-type-powerpoint { --file-icon:#f29900; }
.file-type-office { --file-icon:#5f6368; }
.file-type-markdown { --file-icon:#687078; }
.file-type-text { --file-icon:#5f6368; }
.file-type-data { --file-icon:#9c6ade; }
.file-type-code { --file-icon:#a142f4; }
.file-type-database { --file-icon:#00acc1; }
.file-type-archive { --file-icon:#7e766a; }
.file-type-disk { --file-icon:#5f6368; }
.file-type-executable { --file-icon:#5f6368; }
.file-type-android { --file-icon:#34a853; }
.file-type-ebook { --file-icon:#9c6ade; }
.file-type-contact { --file-icon:#00acc1; }
.file-type-calendar { --file-icon:#4285f4; }
.file-type-font { --file-icon:#5f6368; }
.file-type-certificate { --file-icon:#f9ab00; }
.file-type-image { --file-icon:#ea4335; }
.file-type-video { --file-icon:#ea4335; }
.file-type-audio { --file-icon:#4285f4; }
.file-type-document { --file-icon:#4285f4; }

.drive-preview-placeholder .file-type-icon { width:62px; height:75px; }
.drive-preview-placeholder .file-type-badge { left:7px; right:7px; bottom:13px; font-size:9px; }
.drive-kind-icon .file-type-icon { width:20px; height:24px; }
.file-kind .file-type-icon { width:20px; height:24px; }
.file-list.drive-file-list.is-list .file-kind .file-type-icon { width:21px; height:25px; }

.viewer-star { top:14px; right:62px; }
.viewer-star.is-starred,[data-bulk-star].is-starred { color:#fdd663; }
.viewer-star.is-starred .nav-icon path,[data-bulk-star].is-starred .nav-icon path { fill:currentColor; stroke:currentColor; }
.viewer-star:disabled { opacity:.58; cursor:progress; }

@media (max-width:1280px) {
  .drive-folder-grid,.file-root-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (max-width:980px) {
  .drive-folder-grid,.file-root-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .drive-folder-grid,.file-root-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .drive-browser-sections { gap:16px; }
}
@media (max-width:480px) {
  .drive-folder-grid,.file-root-grid { grid-template-columns:1fr; }
}

/* R20: visor local de Markdown, HTML, texto y PDF. */
.document-viewer {
  width:min(96vw,1500px);
  height:min(94vh,980px);
  max-width:none;
  max-height:none;
  margin:auto;
  padding:0;
  overflow:hidden;
  border:1px solid #3c4043;
  border-radius:16px;
  background:#202124;
  color:#e8eaed;
  box-shadow:0 24px 80px rgba(0,0,0,.58);
}
.document-viewer::backdrop { background:rgba(0,0,0,.78); backdrop-filter:blur(2px); }
.document-viewer-shell { display:grid; grid-template-rows:auto minmax(0,1fr) auto; width:100%; height:100%; min-height:0; }
.document-viewer-toolbar {
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto minmax(220px,1fr);
  align-items:center;
  gap:14px;
  min-height:64px;
  padding:8px 10px 8px 16px;
  border-bottom:1px solid #3c4043;
  background:#202124;
}
.document-viewer-title { display:flex; min-width:0; align-items:center; gap:12px; }
.document-viewer-title > div { min-width:0; }
.document-viewer-title strong,.document-viewer-title small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.document-viewer-title strong { font-size:14px; font-weight:600; color:#e8eaed; }
.document-viewer-title small { margin-top:2px; color:#9aa0a6; font-size:12px; }
.document-viewer-type {
  display:grid;
  width:36px;
  height:36px;
  flex:0 0 auto;
  place-items:center;
  border-radius:8px;
  background:#303134;
  color:#a8c7fa;
  font:700 10px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
  letter-spacing:.02em;
}
.document-viewer-tabs { display:flex; align-items:center; justify-content:center; border:1px solid #5f6368; border-radius:20px; padding:2px; background:#202124; }
.document-viewer-tab { min-width:70px; height:32px; border:0; border-radius:16px; background:transparent; color:#c4c7c5; font:500 13px/1 system-ui,-apple-system,"Segoe UI",sans-serif; cursor:pointer; }
.document-viewer-tab:hover { background:#303134; }
.document-viewer-tab.is-active { background:#c2e7ff; color:#001d35; }
.document-viewer-actions { display:flex; min-width:0; align-items:center; justify-content:flex-end; gap:7px; }
.document-viewer-actions .button { min-height:38px; border-radius:19px; padding:7px 13px; font-size:13px; }
.document-viewer-actions .icon-button { flex:0 0 auto; }
.document-viewer-star.is-starred { color:#fdd663; }
.document-viewer-star.is-starred .nav-icon path { fill:currentColor; stroke:currentColor; }
.document-viewer-body { position:relative; min-height:0; overflow:hidden; background:#171819; }
.document-viewer-loading { position:absolute; z-index:5; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; background:rgba(23,24,25,.94); color:#e8eaed; }
.document-viewer-loading[hidden],.document-viewer-error[hidden],.document-viewer-frame[hidden],.document-viewer-markdown[hidden],.document-viewer-source[hidden],.document-viewer-editor[hidden] { display:none !important; }
.document-viewer-error { display:grid; height:100%; place-items:center; padding:32px; color:#f2b8b5; text-align:center; }
.document-viewer-frame { width:100%; height:100%; border:0; background:#fff; }
.document-viewer-markdown {
  width:min(100%,980px);
  height:100%;
  margin:0 auto;
  overflow:auto;
  padding:46px clamp(24px,5vw,72px) 80px;
  color:#e8eaed;
  font:400 16px/1.7 system-ui,-apple-system,"Segoe UI",sans-serif;
  overflow-wrap:anywhere;
}
.document-viewer-markdown h1,.document-viewer-markdown h2,.document-viewer-markdown h3,.document-viewer-markdown h4,.document-viewer-markdown h5,.document-viewer-markdown h6 { margin:1.45em 0 .55em; color:#f1f3f4; line-height:1.28; letter-spacing:-.02em; }
.document-viewer-markdown h1 { margin-top:0; padding-bottom:.28em; border-bottom:1px solid #3c4043; font-size:2rem; }
.document-viewer-markdown h2 { padding-bottom:.2em; border-bottom:1px solid #303134; font-size:1.55rem; }
.document-viewer-markdown h3 { font-size:1.25rem; }
.document-viewer-markdown p { margin:0 0 1em; }
.document-viewer-markdown a { color:#a8c7fa; text-decoration:none; }
.document-viewer-markdown a:hover { text-decoration:underline; }
.document-viewer-markdown ul,.document-viewer-markdown ol { margin:.6em 0 1.15em; padding-left:1.6em; }
.document-viewer-markdown li { margin:.26em 0; }
.document-viewer-markdown blockquote { margin:1em 0; border-left:4px solid #5f6368; padding:.15em 1em; color:#bdc1c6; }
.document-viewer-markdown pre { overflow:auto; margin:1em 0 1.3em; border:1px solid #3c4043; border-radius:10px; background:#111315; padding:15px 17px; }
.document-viewer-markdown pre code { padding:0; background:transparent; color:#e8eaed; font:13px/1.6 ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace; white-space:pre; }
.document-viewer-markdown code { background:#303134; color:#f1f3f4; padding:2px 5px; font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace; }
.document-viewer-markdown hr { margin:2em 0; border:0; border-top:1px solid #3c4043; }
.document-viewer-markdown input[type="checkbox"] { width:auto; margin-right:7px; accent-color:#8ab4f8; }
.document-viewer-source {
  width:100%;
  height:100%;
  margin:0;
  overflow:auto;
  border:0;
  border-radius:0;
  background:#111315;
  padding:24px 28px 70px;
  color:#d7dadc;
  white-space:pre;
  tab-size:2;
}
.document-viewer-source code { padding:0; background:transparent; color:inherit; font:13px/1.58 ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace; }
.document-viewer-editor {
  width:100%;
  height:100%;
  resize:none;
  border:0;
  border-radius:0;
  outline:0;
  background:#111315;
  color:#f1f3f4;
  padding:24px 28px 80px;
  font:13px/1.58 ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;
  tab-size:2;
  white-space:pre;
}
.document-viewer-editor:focus { box-shadow:inset 0 0 0 2px rgba(138,180,248,.36); }
.document-viewer-footer { display:flex; min-height:34px; align-items:center; justify-content:space-between; gap:16px; border-top:1px solid #3c4043; padding:6px 15px; background:#202124; color:#9aa0a6; font-size:11px; }

@media (max-width:900px) {
  .document-viewer { width:100vw; height:100dvh; border:0; border-radius:0; }
  .document-viewer-toolbar { grid-template-columns:minmax(0,1fr) auto; gap:8px; padding-left:10px; }
  .document-viewer-tabs { grid-row:2; grid-column:1 / -1; justify-self:center; margin-bottom:3px; }
  .document-viewer-actions .button { width:38px; min-width:38px; padding:0; overflow:hidden; gap:14px; color:transparent; }
  .document-viewer-actions .button .inline-icon { flex:0 0 auto; color:#e8eaed; }
  .document-viewer-actions [data-document-viewer-cancel] { width:auto; min-width:auto; padding:0 10px; color:#e8eaed; }
  .document-viewer-title small { display:none; }
  .document-viewer-markdown { padding:28px 20px 70px; }
  .document-viewer-source,.document-viewer-editor { padding:18px 16px 70px; }
}

/* R22: almacenamiento unificado, confirmaciones y acciones consistentes. */
.drive-storage-summary {
  margin-top:auto;
  display:grid;
  gap:7px;
  padding:13px 12px 11px;
  border-radius:14px;
  color:#bdc1c6;
  text-decoration:none;
}
.drive-storage-summary:hover { background:#25272a; }
.drive-storage-summary-title { display:flex; align-items:center; gap:10px; color:#e8eaed; }
.drive-storage-summary-title strong { font-size:13px; font-weight:500; }
.drive-storage-summary-title .nav-icon,.drive-storage-summary-title .inline-icon { width:20px; height:20px; }
.drive-storage-summary small { display:block; margin:0; color:#a9acb0; font-size:11px; line-height:1.35; }
.drive-storage-summary small strong { color:#e8eaed; font-weight:500; }
.drive-storage-mini-track { display:block; width:100%; height:4px; overflow:hidden; border:0; border-radius:999px; appearance:none; -webkit-appearance:none; background:#5f6368; color:#8ab4f8; }

.drive-storage-page { padding-top:20px; }
.drive-storage-header { display:flex; align-items:center; justify-content:space-between; min-height:52px; margin-bottom:20px; }
.drive-storage-header h1 { margin:0; font-size:28px; line-height:1.2; font-weight:400; }
.drive-storage-overview { padding:12px 2px 28px; border-bottom:1px solid #3c4043; }
.drive-storage-capacity-copy h2 { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px; margin:0; color:#e8eaed; font-size:16px; font-weight:400; }
.drive-storage-capacity-copy h2 strong { font-size:38px; font-weight:400; letter-spacing:-.035em; }
.drive-storage-capacity-copy h2 span { color:#e8eaed; font-size:14px; }
.drive-storage-capacity-copy p { margin:4px 0 18px; color:#a9acb0; font-size:13px; }
.drive-storage-track { display:block; width:100%; height:10px; overflow:hidden; border:0; border-radius:999px; appearance:none; -webkit-appearance:none; background:#5f6368; color:#8ab4f8; }
.drive-storage-legend { display:flex; flex-wrap:wrap; gap:18px; margin-top:12px; color:#c4c7c5; font-size:12px; }
.drive-storage-legend span { display:inline-flex; align-items:center; gap:7px; }
.storage-dot { width:8px; height:8px; border-radius:50%; }
.storage-dot-used { background:#8ab4f8; }
.storage-dot-free { background:#5f6368; }
.drive-storage-empty-summary { display:flex; align-items:center; gap:16px; min-height:100px; color:#c4c7c5; }
.drive-storage-empty-summary > span { display:grid; width:48px; height:48px; place-items:center; border-radius:50%; background:#282a2d; }
.drive-storage-empty-summary h2 { margin:0 0 4px; font-size:18px; }
.drive-storage-empty-summary p { margin:0; color:#a9acb0; }

.drive-storage-units,.drive-storage-files,.drive-storage-admin { padding:28px 0 4px; }
.drive-storage-files,.drive-storage-admin { border-top:1px solid #3c4043; margin-top:24px; }
.drive-storage-section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:14px; }
.drive-storage-section-head h2 { margin:0 0 3px; font-size:16px; font-weight:500; }
.drive-storage-section-head p { margin:0; color:#a9acb0; font-size:12px; }
.drive-storage-section-head > a { color:#a8c7fa; text-decoration:none; font-weight:500; }
.drive-storage-section-head > a:hover { text-decoration:underline; }
.drive-storage-unit-list { overflow:hidden; border:1px solid #3c4043; border-radius:14px; }
.drive-storage-unit-row { display:grid; grid-template-columns:38px minmax(220px,1fr) minmax(300px,auto) 44px; align-items:center; gap:14px; min-height:82px; padding:12px 14px; border-bottom:1px solid #3c4043; background:#202124; }
.drive-storage-unit-row:last-child { border-bottom:0; }
.drive-storage-unit-row:hover { background:#25272a; }
.drive-storage-unit-icon { display:grid; width:36px; height:36px; place-items:center; color:#c4c7c5; }
.drive-storage-unit-icon .nav-icon,.drive-storage-unit-icon .inline-icon { width:23px; height:23px; }
.drive-storage-unit-main { min-width:0; }
.drive-storage-unit-title { display:flex; align-items:baseline; gap:9px; min-width:0; margin-bottom:9px; }
.drive-storage-unit-title strong { overflow:hidden; color:#e8eaed; text-overflow:ellipsis; white-space:nowrap; }
.drive-storage-unit-title small { overflow:hidden; color:#9aa0a6; text-overflow:ellipsis; white-space:nowrap; }
.drive-storage-unit-track { display:block; width:100%; height:6px; overflow:hidden; border:0; border-radius:999px; appearance:none; -webkit-appearance:none; background:#5f6368; color:#8ab4f8; }
.drive-storage-mini-track::-webkit-progress-bar,.drive-storage-track::-webkit-progress-bar,.drive-storage-unit-track::-webkit-progress-bar { background:#5f6368; border-radius:999px; }
.drive-storage-mini-track::-webkit-progress-value,.drive-storage-track::-webkit-progress-value,.drive-storage-unit-track::-webkit-progress-value { background:#8ab4f8; border-radius:999px; }
.drive-storage-mini-track::-moz-progress-bar,.drive-storage-track::-moz-progress-bar,.drive-storage-unit-track::-moz-progress-bar { background:#8ab4f8; border-radius:999px; }

.drive-storage-unit-metrics { display:grid; grid-template-columns:repeat(3,minmax(82px,1fr)); gap:12px; }
.drive-storage-unit-metrics span { display:grid; }
.drive-storage-unit-metrics strong { color:#e8eaed; font-size:13px; font-weight:500; }
.drive-storage-unit-metrics small { color:#9aa0a6; font-size:10px; }

.drive-storage-file-table { overflow:hidden; border-top:1px solid #3c4043; border-bottom:1px solid #3c4043; }
.drive-storage-file-head,.drive-storage-file-row { display:grid; grid-template-columns:minmax(260px,1fr) minmax(130px,220px) 130px 42px; align-items:center; gap:14px; padding:0 8px; }
.drive-storage-file-head { min-height:42px; color:#bdc1c6; font-size:12px; }
.drive-storage-file-row { min-height:58px; border-top:1px solid #3c4043; color:#e8eaed; text-decoration:none; }
.drive-storage-file-row:hover { background:#282a2d; }
.drive-storage-file-name { display:flex; min-width:0; align-items:center; gap:12px; }
.drive-storage-file-name > span:last-child { min-width:0; }
.drive-storage-file-name strong,.drive-storage-file-name small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.drive-storage-file-name strong { font-size:13px; font-weight:500; }
.drive-storage-file-name small { margin-top:2px; color:#9aa0a6; font-size:10px; }
.drive-storage-file-source,.drive-storage-file-size { overflow:hidden; color:#bdc1c6; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.drive-storage-admin-grid { gap:14px; }
.drive-storage-admin .storage-card { scroll-margin-top:90px; background:#202124; box-shadow:none; }
.drive-storage-admin .storage-card:target { outline:2px solid #8ab4f8; outline-offset:2px; }

.viewer-delete { top:14px; right:110px; }
.viewer-delete:hover,.document-viewer-delete:hover { color:#ffb4ab !important; background:rgba(116,36,42,.62) !important; }
.viewer-meta { padding-right:158px; }
.selection-context-menu { min-width:220px; }
.selection-context-menu [data-selection-context-delete] { color:#ffb4ab; }

.delete-confirm-dialog { width:min(440px,calc(100% - 28px)); max-width:none; padding:0; border:0; border-radius:24px; background:transparent; color:#e8eaed; }
.delete-confirm-dialog::backdrop { background:rgba(0,0,0,.72); backdrop-filter:blur(3px); }
.delete-confirm-card { display:grid; grid-template-columns:46px minmax(0,1fr); gap:16px; border:1px solid #3c4043; border-radius:24px; background:#282a2d; padding:22px; box-shadow:0 24px 70px rgba(0,0,0,.52); }
.delete-confirm-icon { display:grid; width:44px; height:44px; place-items:center; border-radius:50%; background:#4b2326; color:#ffb4ab; }
.delete-confirm-icon .nav-icon,.delete-confirm-icon .inline-icon { width:22px; height:22px; }
.delete-confirm-copy h2 { margin:1px 0 8px; font-size:20px; font-weight:500; }
.delete-confirm-copy p { margin:0 0 6px; color:#e3e3e3; }
.delete-confirm-copy small { color:#a9acb0; }
.delete-confirm-actions { grid-column:1 / -1; display:flex; justify-content:flex-end; gap:8px; margin-top:6px; }
.button-danger { border-color:#8c4a4f; background:#8c1d18; color:#fff; }
.button-danger:hover { background:#a3241d; }

@media (max-width:900px) {
  .drive-storage-unit-row { grid-template-columns:36px minmax(0,1fr) 42px; }
  .drive-storage-unit-metrics { grid-column:2 / 3; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; }
  .drive-storage-file-head,.drive-storage-file-row { grid-template-columns:minmax(0,1fr) 100px 42px; }
  .drive-storage-file-head span:nth-child(2),.drive-storage-file-source { display:none; }
}
@media (max-width:620px) {
  .drive-storage-capacity-copy h2 strong { font-size:30px; }
  .drive-storage-unit-row { grid-template-columns:32px minmax(0,1fr); gap:10px; }
  .drive-storage-unit-row > .icon-button { display:none; }
  .drive-storage-unit-metrics { grid-column:1 / -1; }
  .drive-storage-file-head,.drive-storage-file-row { grid-template-columns:minmax(0,1fr) 74px 38px; gap:8px; }
  .drive-storage-file-name small { display:none; }
  .drive-storage-section-head { align-items:flex-start; flex-direction:column; gap:8px; }
  .viewer-delete { right:104px; }
  .viewer-star { right:59px; }
  .viewer-meta { padding-right:148px; }
  .delete-confirm-card { grid-template-columns:1fr; }
  .delete-confirm-icon { width:40px; height:40px; }
}

/* R24: destino de subida explícito y enlaces públicos estilo Drive. */
.upload-destination-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; border:1px solid #3c4043; border-radius:12px; background:#202124; padding:12px 14px; }
.upload-destination-summary > div { min-width:0; }
.upload-destination-summary small,.upload-destination-summary strong { display:block; }
.upload-destination-summary small { color:#9aa0a6; font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.upload-destination-summary strong { overflow:hidden; margin-top:3px; color:#e8eaed; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:500; }
.upload-location-panel { display:grid; gap:12px; border:1px solid #3c4043; border-radius:14px; background:#17191c; padding:14px; }
.upload-folder-picker { max-height:300px; overflow:hidden; }
.folder-list { display:grid; max-height:190px; overflow:auto; gap:4px; }
.folder-list-item { display:flex; width:100%; min-height:38px; align-items:center; gap:10px; border:0; border-radius:8px; background:transparent; color:#e8eaed; padding:7px 9px; font:inherit; text-align:left; cursor:pointer; }
.folder-list-item:hover { background:#303134; }
.folder-list-icon { opacity:.88; }

/* R25: subida múltiple simple por defecto; destino manual dentro de Avanzados. */
.upload-dialog-card { gap:14px; }
.upload-picker { display:grid; min-height:220px; place-items:center; align-content:center; gap:10px; border:2px dashed #5f6368; border-radius:18px; background:#202124; padding:28px 20px; color:#e8eaed; text-align:center; cursor:pointer; outline:none; transition:border-color .16s ease,background .16s ease,transform .16s ease; }
.upload-picker:hover,.upload-picker:focus-visible,.upload-picker.is-dragging { border-color:#a8c7fa; background:#23272f; }
.upload-picker.is-dragging { transform:scale(.995); }
.upload-picker-icon { display:grid; width:54px; height:54px; place-items:center; border-radius:18px; background:#303134; color:#a8c7fa; }
.upload-picker-icon .inline-icon { width:30px; height:30px; }
.upload-picker strong { font-size:17px; font-weight:500; }
.upload-picker small { color:#bdc1c6; }
.upload-picker .button { margin-top:4px; cursor:pointer; }
.upload-selection { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:10px 14px; border:1px solid #3c4043; border-radius:14px; background:#202124; padding:12px 14px; }
.upload-selection > div:first-child { min-width:0; }
.upload-selection strong,.upload-selection small { display:block; }
.upload-selection small { margin-top:3px; color:#9aa0a6; }
.upload-selection-list { grid-column:1 / -1; display:flex; gap:6px; overflow:auto hidden; padding-bottom:2px; scrollbar-width:thin; }
.upload-selection-item { flex:0 0 auto; max-width:210px; overflow:hidden; border-radius:8px; background:#303134; color:#dfe1e5; padding:5px 8px; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.upload-advanced-toggle { display:flex; width:100%; min-height:42px; align-items:center; justify-content:space-between; border:0; border-radius:10px; background:transparent; color:#a8c7fa; padding:8px 10px; font:inherit; font-weight:500; cursor:pointer; }
.upload-advanced-toggle:hover { background:#303134; }
.upload-advanced-toggle > span:first-child { display:flex; align-items:center; gap:9px; }
.upload-advanced-toggle .nav-icon { width:20px; height:20px; }
.upload-advanced-chevron { font-size:20px; transition:transform .15s ease; }
.upload-advanced-toggle[aria-expanded="true"] .upload-advanced-chevron { transform:rotate(180deg); }
.upload-advanced-panel { display:grid; gap:12px; border:1px solid #3c4043; border-radius:14px; background:#17191c; padding:14px; }
.upload-advanced-panel[hidden],.upload-selection[hidden] { display:none; }
.upload-limit { color:#9aa0a6; }
.upload-dialog-card [data-upload-submit]:disabled { opacity:.5; cursor:not-allowed; }

.share-dialog { width:min(640px,calc(100% - 28px)); max-width:none; border:0; padding:0; background:transparent; }
.share-dialog::backdrop { background:rgba(0,0,0,.72); backdrop-filter:blur(4px); }
.share-dialog-card { display:grid; gap:16px; border:1px solid #3c4043; border-radius:24px; background:#282a2d; color:#e8eaed; padding:22px; box-shadow:0 24px 80px rgba(0,0,0,.52); }
.share-access-card { display:grid; gap:12px; border:1px solid #3c4043; border-radius:14px; background:#202124; padding:14px; }
.share-link-panel { display:grid; gap:12px; border-top:1px solid #3c4043; padding-top:14px; }
.share-copy-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
.share-copy-row input { min-width:0; }
.share-status { min-height:20px; color:#bdc1c6; font-size:12px; }
.share-dialog-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.share-action-spacer { flex:1 1 auto; }

.shared-page { width:min(1420px,calc(100% - 48px)); }
.shared-page-header { align-items:flex-start; }
.shared-page-header h1 { margin:0 0 6px; font-size:30px; font-weight:400; letter-spacing:-.02em; }
.shared-list { overflow:hidden; border:1px solid #3c4043; border-radius:16px; background:#202124; }
.shared-row { display:grid; grid-template-columns:42px minmax(240px,1fr) 90px minmax(150px,200px) auto; align-items:center; gap:14px; min-height:76px; border-top:1px solid #3c4043; padding:10px 14px; }
.shared-row:first-child { border-top:0; }
.shared-row:hover { background:#282a2d; }
.shared-row.is-offline { opacity:.72; }
.shared-file-icon { display:grid; width:38px; height:38px; place-items:center; border-radius:50%; background:#303134; color:#8ab4f8; }
.shared-file-icon .nav-icon { width:20px; height:20px; }
.shared-file-main { min-width:0; }
.shared-file-main strong,.shared-file-main small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.shared-file-main strong { font-size:14px; font-weight:500; }
.shared-file-main small { margin-top:4px; color:#9aa0a6; font-size:11px; }
.shared-stat { display:grid; }
.shared-stat small { color:#9aa0a6; font-size:10px; }
.shared-stat strong { margin-top:2px; color:#e8eaed; font-size:12px; font-weight:500; }
.shared-row-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; }

.viewer-share { top:14px; right:158px; }
.viewer-meta { padding-right:204px; }

.share-body { min-height:100vh; background:#111315; color:#e8eaed; color-scheme:dark; }
.share-body .auth-main { width:100%; }
.public-share-page { min-height:100vh; background:#111315; color:#e8eaed; }
.public-share-brand { display:flex; height:68px; align-items:center; border-bottom:1px solid #303134; background:#111315; padding:0 24px; }
.public-share-brand a { display:flex; align-items:center; gap:10px; color:#e8eaed; text-decoration:none; font-size:20px; }
.public-share-logo { color:#8ab4f8; }
.public-share-shell { display:grid; min-height:calc(100vh - 68px); grid-template-rows:auto minmax(0,1fr); }
.public-share-toolbar { display:flex; min-height:82px; align-items:center; justify-content:space-between; gap:18px; border-bottom:1px solid #303134; background:#202124; padding:12px 22px; }
.public-share-title { min-width:0; }
.public-share-title small,.public-share-title h1,.public-share-title span { display:block; }
.public-share-title h1 { overflow:hidden; margin:2px 0; font-size:18px; font-weight:500; letter-spacing:0; text-overflow:ellipsis; white-space:nowrap; }
.public-share-title small,.public-share-title span { color:#9aa0a6; font-size:11px; }
.public-share-canvas { position:relative; display:flex; min-height:0; align-items:center; justify-content:center; overflow:hidden; background:#050607; }
.public-share-image img { display:block; max-width:100%; max-height:calc(100vh - 150px); object-fit:contain; }
.public-share-audio { padding:24px; }
.public-share-audio audio { width:min(680px,92vw); }
.public-share-video-player { min-height:calc(100vh - 150px); }
.public-share-video-player video { width:100%; height:100%; max-height:calc(100vh - 150px); object-fit:contain; background:#000; }
.public-video-controls { display:block; }
.public-share-document { width:100%; min-height:calc(100vh - 150px); border:0; background:#fff; }
.public-share-unavailable { display:grid; place-items:center; align-content:center; gap:8px; min-height:420px; padding:28px; text-align:center; background:#17191c; }
.public-share-unavailable p { max-width:620px; margin:0; color:#9aa0a6; }
.public-share-password-card { width:min(460px,calc(100% - 28px)); margin:10vh auto 0; border:1px solid #3c4043; border-radius:24px; background:#202124; padding:28px; box-shadow:0 24px 80px rgba(0,0,0,.38); }
.public-share-password-card h1 { margin:4px 0 10px; font-size:24px; font-weight:500; letter-spacing:-.02em; }
.public-share-password-card p { color:#bdc1c6; }
.public-share-lock { display:grid; width:48px; height:48px; place-items:center; margin-bottom:16px; border-radius:50%; background:#303134; color:#8ab4f8; }
.public-share-lock .inline-icon { width:24px; height:24px; }
.public-share-password-form { display:grid; gap:14px; margin-top:20px; }
.public-share-page.is-embed { min-height:100vh; }
.public-share-page.is-embed .public-share-shell { min-height:100vh; grid-template-rows:minmax(0,1fr); }
.public-share-page.is-embed .public-share-video-player,.public-share-page.is-embed .public-share-document { min-height:100vh; }
.public-share-page.is-embed .public-share-video-player video { max-height:100vh; }
.public-embed-download { position:fixed; z-index:9; top:12px; right:12px; border:1px solid rgba(255,255,255,.22); border-radius:18px; background:rgba(0,0,0,.58); color:#fff; padding:7px 12px; text-decoration:none; backdrop-filter:blur(6px); }

@media (max-width:820px) {
  .shared-row { grid-template-columns:36px minmax(0,1fr) auto; }
  .shared-stat { display:none; }
  .shared-row-actions .button { display:none; }
  .share-copy-row { grid-template-columns:1fr; }
}
@media (max-width:620px) {
  .viewer-share { right:149px; }
  .viewer-delete { right:104px; }
  .viewer-star { right:59px; }
  .viewer-meta { padding-right:194px; }
  .upload-destination-summary { align-items:flex-start; flex-direction:column; }
  .upload-picker { min-height:190px; padding:22px 14px; }
  .upload-selection { grid-template-columns:1fr; }
  .upload-selection .button { justify-self:start; }
  .public-share-toolbar { align-items:flex-start; flex-direction:column; }
  .public-share-document,.public-share-video-player { min-height:calc(100vh - 190px); }
}
.public-share-video-player .public-video-staging { position:absolute; inset:0; z-index:1; opacity:0; pointer-events:none; }
.public-share-video-player > video:not(.public-video-staging) { position:relative; z-index:2; }
.public-share-video-player .viewer-video-controls { z-index:6; }
