/* ==========================================================================
   TBU-Jemy · Materiały — Drive-style marketing library
   Brand: plate blue + Polish red, black pill buttons, Inter
   ========================================================================== */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e6e9ee;
  --hover: rgba(31, 35, 41, .06);
  --text: #1a1c1f;
  --text-2: #5c6370;
  --text-3: #8a919c;
  --border: #e2e5ea;

  --red: #e03131;
  --red-ink: #c92a2a;
  --red-tint: #fdecec;
  --blue: #1d3fbb;          /* EU strip on the plate */
  --blue-tint: #dfe6fb;
  --blue-ink: #13297c;
  --ink: #111111;           /* black pill buttons */
  --ink-text: #ffffff;

  --t-video: #e03131;
  --t-podcast: #7c4dff;
  --t-presentation: #f29900;
  --t-image: #0f9d58;
  --t-logo: #1d3fbb;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-2: 0 4px 10px rgba(16, 24, 40, .08), 0 12px 32px rgba(16, 24, 40, .10);
  --radius: 16px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317; --surface: #1a1d23; --surface-2: #23272f; --surface-3: #2d323b;
    --hover: rgba(255, 255, 255, .06);
    --text: #e8eaed; --text-2: #a4abb6; --text-3: #7b828d; --border: #2e333b;
    --red: #ff5a5a; --red-ink: #ff7b7b; --red-tint: #3b1d20;
    --blue: #7d9bff; --blue-tint: #243466; --blue-ink: #c9d5ff;
    --ink: #f2f3f5; --ink-text: #111111;
    --t-video: #ff5a5a; --t-podcast: #a98bff; --t-presentation: #ffb84d; --t-image: #3ecf8e; --t-logo: #7d9bff;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 28px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111317; --surface: #1a1d23; --surface-2: #23272f; --surface-3: #2d323b;
  --hover: rgba(255, 255, 255, .06);
  --text: #e8eaed; --text-2: #a4abb6; --text-3: #7b828d; --border: #2e333b;
  --red: #ff5a5a; --red-ink: #ff7b7b; --red-tint: #3b1d20;
  --blue: #7d9bff; --blue-tint: #243466; --blue-ink: #c9d5ff;
  --ink: #f2f3f5; --ink-text: #111111;
  --t-video: #ff5a5a; --t-podcast: #a98bff; --t-presentation: #ffb84d; --t-image: #3ecf8e; --t-logo: #7d9bff;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 28px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }

.ms {
  font-family: 'Material Symbols Rounded';
  font-weight: 400; font-style: normal; font-size: 22px; line-height: 1;
  letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr;
  display: inline-block; flex-shrink: 0;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased; user-select: none;
}
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.t-video { color: var(--t-video); } .t-podcast { color: var(--t-podcast); }
.t-presentation { color: var(--t-presentation); } .t-image { color: var(--t-image); } .t-logo { color: var(--t-logo); }

/* ---------- buttons ---------- */
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center; color: var(--text-2);
  transition: background .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on-dark { color: #e8eaed; }
.icon-btn.on-dark:hover { background: rgba(255,255,255,.12); color: #fff; }

.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.pill-btn .ms { font-size: 20px; }
.pill-btn.sm { height: 36px; padding: 0 14px; font-size: 13px; }
.pill-btn.dark { background: var(--ink); color: var(--ink-text); }
.pill-btn.red { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(224,49,49,.35); }
.pill-btn.light { background: #fff; color: #111; }
.pill-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }

/* ---------- top bar ---------- */
.topbar {
  height: 64px; padding: 8px 16px 8px 12px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; width: 244px; flex-shrink: 0; }
.brand img { width: 112px; height: auto; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
.brand-word { font-size: 20px; font-weight: 500; color: var(--text-2); letter-spacing: -.01em; }

.search {
  flex: 1; max-width: 720px; height: 48px;
  display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px;
  background: var(--surface-3); border-radius: 999px;
  transition: background .15s, box-shadow .15s;
}
.search:focus-within { background: var(--surface); box-shadow: var(--shadow-2); }
.search > .ms { color: var(--text-2); }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; color: var(--text);
}
.search input::placeholder { color: var(--text-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 36px; height: 36px; }
.search-kbd {
  font-size: 12px; color: var(--text-3); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 7px; margin-right: 6px;
}
.search:focus-within .search-kbd { display: none; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lang { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-3); margin-right: 4px; }
.lang button { width: 34px; height: 28px; border-radius: 999px; display: grid; place-items: center; opacity: .55; transition: .15s; }
.lang button.active { background: var(--surface); opacity: 1; box-shadow: var(--shadow-1); }
.flag { width: 20px; height: 14px; border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.12); background-size: cover; }
.flag-pl { background: linear-gradient(#fff 50%, #dc143c 50%); }
.flag-en { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='a'%3E%3Cpath d='M0 0v30h60V0z'/%3E%3C/clipPath%3E%3CclipPath id='b'%3E%3Cpath d='M30 15h30v15zv15H0zH0V0zV0h30z'/%3E%3C/clipPath%3E%3Cg clip-path='url(%23a)'%3E%3Cpath d='M0 0v30h60V0z' fill='%23012169'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' clip-path='url(%23b)' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/g%3E%3C/svg%3E"); }

/* ---------- shell ---------- */
.shell { display: flex; height: calc(100% - 64px); }

/* ---------- sidebar ---------- */
.sidebar { width: 256px; flex-shrink: 0; padding: 8px 12px 16px 12px; display: flex; flex-direction: column; overflow-y: auto; }
.new-btn {
  display: inline-flex; align-items: center; gap: 12px; align-self: flex-start;
  height: 56px; padding: 0 22px 0 18px; margin: 0 0 16px 4px; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-1); font-weight: 600;
  transition: box-shadow .15s, background .15s;
}
.new-btn .ms { color: var(--red); font-size: 24px; }
.new-btn:hover { box-shadow: var(--shadow-2); background: var(--red-tint); }

.nav a {
  display: flex; align-items: center; gap: 14px; height: 36px; padding: 0 12px 0 16px;
  border-radius: 999px; color: var(--text); font-weight: 500; transition: background .12s;
}
.nav a .ms { font-size: 20px; color: var(--text-2); }
.nav a .ms[class*="t-"] { color: inherit; }
.nav a .ms.t-video { color: var(--t-video); } .nav a .ms.t-podcast { color: var(--t-podcast); }
.nav a .ms.t-presentation { color: var(--t-presentation); } .nav a .ms.t-image { color: var(--t-image); } .nav a .ms.t-logo { color: var(--t-logo); }
.nav a:hover { background: var(--hover); }
.nav a.active { background: var(--blue-tint); color: var(--blue-ink); font-weight: 700; }
.nav a.active > .ms:first-child:not([class*="t-"]) { color: var(--blue-ink); font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.nav .count { margin-left: auto; font-style: normal; font-size: 12px; color: var(--text-3); font-weight: 500; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 12px 10px 16px; }
.nav-label { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 4px 16px 6px; }

.storage { margin-top: auto; padding: 16px 16px 4px; }
.storage-row { display: flex; align-items: center; gap: 12px; font-weight: 500; margin-bottom: 10px; }
.storage-row .ms { font-size: 20px; color: var(--text-2); }
.meter { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--blue), var(--red)); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.storage p { margin-top: 8px; font-size: 12.5px; color: var(--text-2); }

/* ---------- main panel ---------- */
.panel {
  flex: 1; min-width: 0; background: var(--surface);
  border-radius: var(--radius); margin: 0 16px 16px 0;
  padding: 8px 24px 0; overflow-y: auto; overflow-x: hidden;
  scroll-behavior: smooth;
}
.panel-head {
  position: sticky; top: -8px; z-index: 5; background: var(--surface);
  display: flex; align-items: center; gap: 12px; padding: 14px 0 10px; margin-top: -8px;
}
.crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex-wrap: wrap; }
.crumbs a, .crumbs span.cur {
  font-size: 22px; font-weight: 500; padding: 4px 12px; border-radius: 999px; letter-spacing: -.01em; white-space: nowrap;
}
.crumbs a { color: var(--text-2); }
.crumbs a:hover { background: var(--hover); color: var(--text); }
.crumbs .ms { color: var(--text-3); font-size: 22px; }

.view-toggle { margin-left: auto; display: flex; border: 1px solid var(--text-3); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.view-toggle button { height: 32px; padding: 0 12px; display: flex; align-items: center; gap: 2px; color: var(--text); }
.view-toggle button + button { border-left: 1px solid var(--text-3); }
.view-toggle .ms { font-size: 18px; }
.view-toggle .check { display: none; }
.view-toggle button.active { background: var(--blue-tint); color: var(--blue-ink); }
.view-toggle button.active .check { display: inline-block; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 0 18px; }
.chip {
  height: 32px; padding: 0 14px 0 10px; border-radius: 8px; border: 1px solid var(--text-3);
  display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13.5px; color: var(--text);
  transition: background .12s, border-color .12s;
}
.chip .ms { font-size: 18px; }
.chip:hover { background: var(--hover); }
.chip.active { background: var(--blue-tint); border-color: transparent; color: var(--blue-ink); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; margin-bottom: 28px;
  min-height: 290px; display: flex; align-items: center; isolation: isolate;
  background:
    radial-gradient(120% 140% at 0% 100%, rgba(224,49,49,.35) 0%, transparent 45%),
    linear-gradient(135deg, #0a1440 0%, #13297c 60%, #0d1b55 100%);
}
.hero-bg {
  position: absolute; top: 0; right: 0; width: 60%; height: 100%; object-fit: cover; object-position: center 45%; z-index: -2;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%); mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("../img/thumbs/blue_walllpaper.webp") center / 520px auto; opacity: .07; mix-blend-mode: screen;
}
.hero-body { padding: 32px 36px; max-width: 560px; color: #fff; }
.hero-script { font-family: 'Kaushan Script', cursive; font-size: 30px; color: #ff6b6b; display: block; line-height: 1; margin-bottom: 8px; text-shadow: 0 2px 10px rgba(224,49,49,.4); }
.hero h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.hero p { margin-top: 10px; color: rgba(255,255,255,.82); font-size: 15px; max-width: 460px; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- sections ---------- */
.sec-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.sec-head .sec-title { margin: 0; }
.sort-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-weight: 500; color: var(--text-2); }
.sort-btn:hover { background: var(--hover); color: var(--text); }
.sort-btn .ms { font-size: 18px; transition: transform .2s; }
.sort-btn.asc .ms { transform: rotate(180deg); }
#foldersSection { margin-bottom: 28px; }

/* folders */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.folder {
  display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 8px 0 16px;
  background: var(--surface-2); border-radius: 12px; font-weight: 500; transition: background .12s, box-shadow .12s;
}
.folder:hover { background: var(--surface-3); }
.folder .ms.fill { font-size: 24px; }
.folder .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder small { font-size: 12px; color: var(--text-2); font-weight: 500; background: var(--surface); padding: 2px 9px; border-radius: 999px; }

/* ---------- file grid ---------- */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; padding: 12px 0 8px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface-2); border-radius: 14px; padding: 0 4px 4px; cursor: pointer;
  transition: background .12s, box-shadow .2s, transform .2s;
  animation: rise .35s cubic-bezier(.2,.8,.2,1) both;
}
.card:hover { background: var(--surface-3); }
.card.selected { background: var(--blue-tint); }
.card-head { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 0 0 12px; }
.card-head .ms.fill { font-size: 20px; }
.card-title { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kebab { width: 32px; height: 32px; }
.kebab .ms { font-size: 20px; }

.thumb {
  position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden;
  background: var(--surface); display: grid; place-items: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.card:hover .thumb img { transform: scale(1.04); }
.thumb.logo { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; padding: 14px; }
.thumb.logo img { object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.18)); }
.card:hover .thumb.logo img { transform: scale(1.06); }

.thumb .badge {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; color: #fff; padding: 3px 8px 3px 6px; border-radius: 6px;
  background: rgba(10,12,18,.72); backdrop-filter: blur(6px);
}
.thumb .badge .ms { font-size: 15px; }
.thumb .soon {
  position: absolute; right: 8px; top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--red); padding: 3px 8px; border-radius: 999px; box-shadow: 0 2px 8px rgba(224,49,49,.4);
}
.thumb .play {
  position: absolute; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: #111; box-shadow: 0 6px 20px rgba(0,0,0,.35);
  transition: transform .2s;
}
.thumb .play .ms { font-size: 32px; }
.card:hover .thumb .play { transform: scale(1.1); }
.thumb.dim img { filter: saturate(.85) brightness(.82); }

.card-foot { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px; font-size: 12.5px; color: var(--text-2); }
.card-foot .star { margin-left: auto; font-size: 18px; color: #f5b400; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- list view ---------- */
.file-grid.list { display: block; padding-top: 4px; }
.list-head, .row {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px 140px 120px 44px; align-items: center; gap: 12px;
}
.list-head { height: 44px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; color: var(--text); padding: 0 8px 0 16px; }
.row {
  height: 52px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background .1s; animation: fade .25s both;
}
.row:hover { background: var(--hover); }
.row .name { display: flex; align-items: center; gap: 14px; min-width: 0; font-weight: 500; }
.row .name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .mini { width: 40px; height: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.row .mini.logo { object-fit: contain; }
.row .muted { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--red); background: var(--red-tint); padding: 2px 7px; border-radius: 999px; margin-left: 4px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 56px 16px 72px; color: var(--text-2); }
.empty .ms { font-size: 72px; color: var(--text-3); font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 48; }
.empty p { font-size: 18px; font-weight: 600; color: var(--text); margin-top: 8px; }

/* ---------- footer ---------- */
.foot { display: flex; align-items: center; gap: 14px; padding: 40px 0 28px; color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--border); margin-top: 32px; }
.foot img { width: 84px; height: auto; opacity: .9; }

/* ---------- context menu ---------- */
.menu {
  position: fixed; z-index: 60; min-width: 220px; padding: 8px 0; border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow-2); border: 1px solid var(--border);
  animation: pop .14s ease-out;
}
.menu button { width: 100%; display: flex; align-items: center; gap: 14px; height: 38px; padding: 0 18px; text-align: left; font-size: 14px; }
.menu button .ms { font-size: 20px; color: var(--text-2); }
.menu button:hover { background: var(--hover); }
.menu button:disabled { opacity: .4; cursor: default; background: none; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- viewer (Drive preview) ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 80; background: rgba(12, 13, 16, .92);
  display: grid; grid-template-rows: 64px 1fr auto; animation: fade .18s;
  backdrop-filter: blur(4px);
}
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 0 16px 0 8px; color: #e8eaed; }
.viewer-type { font-size: 22px; }
.viewer-name { font-size: 16px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; align-items: center; gap: 4px; }
.viewer-stage { grid-row: 2; display: grid; place-items: center; padding: 8px 88px 8px; min-height: 0; }
.viewer-stage > img { max-width: 100%; max-height: calc(100vh - 170px); object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: pop .2s ease-out; }
.viewer-stage > img.logo { background: repeating-conic-gradient(#2a2d33 0 25%, #22252a 0 50%) 0 0 / 20px 20px; padding: 32px; }
.frame { width: min(100%, 1200px, calc((100vh - 170px) * 16 / 9)); aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.frame.tall { aspect-ratio: auto; height: min(100%, 420px); max-width: 760px; }
.placeholder {
  width: min(100%, 560px); text-align: center; color: #e8eaed; padding: 40px 32px; border-radius: 20px;
  background: linear-gradient(160deg, rgba(29,63,187,.35), rgba(224,49,49,.22)); border: 1px solid rgba(255,255,255,.1);
}
.placeholder img { width: 100%; border-radius: 12px; margin-bottom: 24px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.placeholder h3 { font-size: 20px; font-weight: 700; }
.placeholder p { color: #b5bac3; margin-top: 6px; }
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.08); transition: background .15s;
}
.viewer-nav:hover { background: rgba(255,255,255,.18); }
.viewer-nav .ms { font-size: 32px; }
.viewer-nav.prev { left: 20px; } .viewer-nav.next { right: 20px; }
.viewer-meta { grid-row: 3; text-align: center; color: #a4abb6; font-size: 13px; padding: 12px 16px 18px; }
.viewer-meta b { color: #e8eaed; font-weight: 500; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 24px; bottom: 24px; z-index: 100; max-width: calc(100% - 48px);
  background: #1f2329; color: #fff; padding: 14px 20px; border-radius: 8px; box-shadow: var(--shadow-2);
  font-weight: 500; transform: translateY(120%); opacity: 0; transition: .25s cubic-bezier(.2,.8,.2,1); pointer-events: none;
}
.toast.show { transform: none; opacity: 1; }

/* ---------- responsive ---------- */
.only-mobile { display: none; }
.scrim { display: none; }

@media (max-width: 1100px) {
  .brand { width: auto; }
  .hide-sm { display: none; }
}
@media (max-width: 860px) {
  body { overflow: auto; overflow-x: hidden; }
  .only-mobile { display: inline-grid; }
  .topbar { position: sticky; top: 0; z-index: 30; background: var(--bg); padding: 8px 12px 8px 4px; gap: 4px; flex-wrap: wrap; height: auto; }
  .brand { padding: 0 4px; }
  .brand img { width: 96px; }
  .brand-word { font-size: 17px; }
  .search { order: 5; flex-basis: 100%; max-width: none; height: 44px; margin: 4px 4px 0 8px; }
  .search-kbd { display: none; }
  .shell { display: block; height: auto; }
  .sidebar {
    position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: 280px; background: var(--bg);
    padding-top: 20px; transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
    box-shadow: var(--shadow-2);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.4); }
  .panel { margin: 0; border-radius: 20px 20px 0 0; padding: 8px 16px 0; overflow: visible; min-height: calc(100vh - 120px); }
  .panel-head { top: 104px; }
  .crumbs a, .crumbs span.cur { font-size: 18px; padding: 4px 8px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 16px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }
  .hero { min-height: 0; align-items: flex-end; }
  .hero-bg { width: 100%; height: 62%; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); }
  .hero-body { padding: 170px 20px 22px; }
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .folder { height: 52px; padding: 0 8px 0 12px; gap: 10px; }
  .folder small { display: none; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .list-head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) 44px; }
  .row .col-hide { display: none; }
  .viewer-stage { padding: 8px 12px; }
  .viewer-nav { top: auto; bottom: 12px; transform: none; width: 44px; height: 44px; }
  .viewer-nav.prev { left: 12px; } .viewer-nav.next { right: 12px; }
  .viewer-meta { padding: 18px 64px 22px; }
  .viewer-actions .pill-btn span:last-child { display: none; }
  .viewer-actions .pill-btn { padding: 0 10px; }
  .toast { left: 16px; bottom: 16px; }
}
@media (max-width: 420px) {
  .brand-word { display: none; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-head { height: 42px; padding-left: 8px; gap: 6px; }
  .card-foot { padding: 8px 6px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
