:root {
  color-scheme: dark;
  --bg: #0a0d13;
  --surface: #12161f;
  --surface-2: #181d29;
  --surface-3: #1f2534;
  --border: #232a3a;
  --border-strong: #2f3950;
  --text: #e7eaf2;
  --text-2: #9aa4b8;
  --muted: #667089;
  --accent: #6d8dff;
  --accent-2: #8b6dff;
  --accent-soft: rgba(109, 141, 255, 0.13);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.12);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html { scrollbar-color: var(--border-strong) transparent; }

body {
  margin: 0;
  font-family: "Pretendard", -apple-system, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(109, 141, 255, 0.35); }

.hidden { display: none !important; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.right { justify-content: flex-end; margin-top: 4px; }
.muted { color: var(--muted); }

svg { flex-shrink: 0; }

/* ---------- login ---------- */

.view.center {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(600px 400px at 20% 10%, rgba(109, 141, 255, 0.09), transparent 60%),
    radial-gradient(700px 500px at 85% 90%, rgba(139, 109, 255, 0.08), transparent 60%),
    var(--bg);
  padding: 20px;
}

.login-card {
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 36px 32px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.logo-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 20px rgba(109, 141, 255, 0.35);
}

.login-card h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
}

.login-sub {
  margin: 0 0 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- inputs ---------- */

input, select {
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
input[type="checkbox"]:focus { box-shadow: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(109, 141, 255, 0.25);
}
.btn.primary:hover { filter: brightness(1.1); }

.btn.danger {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(255, 107, 107, 0.25);
}
.btn.danger:hover { filter: brightness(1.1); }

.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }

.btn.tab {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
}
.btn.tab:hover { color: var(--text); background: var(--surface-3); }
.btn.tab.active { color: var(--text); background: var(--surface-3); box-shadow: var(--shadow-sm); }

.btn.icon {
  padding: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
}
.btn.icon:hover { background: var(--surface-3); color: var(--text); }
.btn.icon.danger:hover { background: var(--danger-soft); color: var(--danger); }

.danger-btn { color: var(--danger); }
.danger-btn:hover { background: var(--danger-soft); border-color: var(--danger); }

/* ---------- header ---------- */

header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 22px;
  background: rgba(13, 16, 24, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand .logo-sm {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

nav.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.userbox { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}
.whoami { color: var(--text-2); font-size: 13px; font-weight: 500; }

.usage { color: var(--muted); font-size: 12px; text-align: right; }
.usage .bar {
  width: 140px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
  margin-top: 4px;
}
.usage .bar > div {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s;
}

/* ---------- layout ---------- */

main {
  max-width: 1040px;
  margin: 28px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

h2 { font-size: 15px; font-weight: 650; margin: 0 0 14px; letter-spacing: -0.01em; }

/* ---------- toolbar / breadcrumb ---------- */

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13.5px;
  flex-wrap: wrap;
}
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: 7px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.breadcrumb a:hover { background: var(--surface-2); color: var(--text); }
.breadcrumb a:last-child { color: var(--text); font-weight: 600; }
.breadcrumb .sep { color: var(--muted); display: flex; }

.search-box { position: relative; display: flex; align-items: center; }
.search-box svg {
  position: absolute;
  left: 11px;
  color: var(--muted);
  pointer-events: none;
}
.filter { width: 190px; padding: 8px 11px 8px 34px; background: var(--surface); }

/* ---------- bulkbar ---------- */

.bulkbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  border: 1px solid rgba(109, 141, 255, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
  animation: slide-in 0.15s ease-out;
}
.bulk-count { font-size: 13px; font-weight: 650; color: var(--accent); padding: 0 4px; }
.bulkbar .btn { background: transparent; border-color: transparent; }
.bulkbar .btn:hover { background: rgba(109, 141, 255, 0.15); }
.bulkbar .danger-btn:hover { background: var(--danger-soft); }

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- file table ---------- */

.dropzone {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dropzone.drag {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 60px rgba(109, 141, 255, 0.05);
}

table { width: 100%; border-collapse: collapse; }
/* The name column absorbs all spare width and truncates with an ellipsis;
   every other column sizes to its own content. Without this a long file name
   stretched the name column and squeezed the date into several wrapped lines.
   max-width:0 + width:100% is what makes truncation work inside a table. */
table.files td.name {
  max-width: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Exactly one column per table may carry .name — two of them would fight over
   the leftover width and the loser collapses. The admin table's path column
   gets a bounded width of its own instead. */
table.files td.path {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
thead th {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  padding: 9px 14px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.selected { background: var(--accent-soft); }
tbody tr.selected:hover { background: rgba(109, 141, 255, 0.18); }

th.chk, td.chk { width: 36px; padding-right: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; width: 1%; }
td.date, th.date { white-space: nowrap; width: 1%; }
td.actions, th.actions { text-align: right; white-space: nowrap; width: 1%; }
td.actions .btn.icon { opacity: 0; transition: opacity 0.1s, background 0.15s, color 0.15s; }
tr:hover td.actions .btn.icon,
tr.selected td.actions .btn.icon,
td.actions .btn.icon:focus-visible { opacity: 1; }

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sortable.asc::after { content: " ↑"; color: var(--accent); }
th.sortable.desc::after { content: " ↓"; color: var(--accent); }

.name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.name-cell a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  min-width: 0;
}
.name-cell a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-cell a:hover span { color: var(--accent); }

.fi { color: var(--muted); }
.fi.folder { color: #eac36a; }
.fi.image { color: #5fb8ff; }
.fi.video { color: #c98bff; }
.fi.audio { color: #4fd6b0; }
.fi.archive { color: #ffa94d; }
.fi.doc { color: #8fa3c4; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  color: var(--muted);
  padding: 64px 0;
  font-size: 13.5px;
}
.empty svg { color: var(--border-strong); }

/* ---------- uploads ---------- */

.uploads { display: flex; flex-direction: column; gap: 6px; }
.uploads:empty { display: none; }
.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  animation: slide-in 0.15s ease-out;
}
.upload-item .progress {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.upload-item .progress > div {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.15s;
}
.upload-item.done .progress > div { background: var(--ok); }
.upload-item.done { border-color: rgba(61, 220, 151, 0.35); }
.upload-item.error { border-color: rgba(255, 107, 107, 0.45); }
.upload-item.error .progress > div { background: var(--danger); }

/* ---------- dialogs ---------- */

dialog {
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 26px;
  width: 360px;
  box-shadow: var(--shadow);
}
dialog[open] { animation: dlg-in 0.16s ease-out; }
dialog::backdrop {
  background: rgba(4, 6, 10, 0.65);
  backdrop-filter: blur(3px);
}
@keyframes dlg-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.dlg-form { display: flex; flex-direction: column; gap: 10px; }
.dlg-form h2 { margin: 0 0 6px; font-size: 16px; }
.dlg-sub { margin: -6px 0 2px; color: var(--muted); font-size: 12.5px; }

/* ---------- folder picker ---------- */

.dir-picker {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 6px;
}
.dir-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  text-align: left;
}
.dir-item:hover { background: var(--surface-2); color: var(--text); }
.dir-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dir-item:disabled { opacity: 0.35; cursor: default; background: transparent; }
.dir-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- drag & drop move ---------- */

tbody tr.drop-hover {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.breadcrumb a.drop-hover {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

/* ---------- admin ---------- */

.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat {
  flex: 1;
  min-width: 140px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.stat .k { color: var(--muted); font-size: 12px; margin-top: 2px; }

.badge {
  display: inline-block;
  padding: 2.5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge.gray { background: rgba(102, 112, 137, 0.16); color: var(--text-2); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.green { background: var(--ok-soft); color: var(--ok); }

.card table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: table; }
.card thead th { background: var(--surface-2); }

.hint { color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.error { color: var(--danger); font-size: 13px; min-height: 1em; margin: 4px 0 0; }

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
  max-width: 360px;
}
.toast.ok { border-color: rgba(61, 220, 151, 0.4); }
.toast.ok svg { color: var(--ok); }
.toast.error { border-color: rgba(255, 107, 107, 0.45); }
.toast.error svg { color: var(--danger); }
.toast.out { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(16px); }
}

/* ---------- preview ---------- */

dialog.preview {
  width: min(1180px, 94vw);
  max-width: 98vw;
  height: min(880px, 92vh);
  max-height: 96vh;
  min-width: 360px;
  min-height: 240px;
  padding: 0;
  overflow: hidden;
}
dialog.preview.maximized {
  width: 98vw;
  height: 96vh;
}

/* resize grips — the dialog is centred, so dragging an edge moves it by half
   the pointer delta; the drag handler compensates by doubling. */
.pv-grip { position: absolute; z-index: 4; touch-action: none; }
.pv-grip-r { top: 0; right: 0; width: 8px; height: 100%; cursor: ew-resize; }
.pv-grip-b { left: 0; bottom: 0; width: 100%; height: 8px; cursor: ns-resize; }
.pv-grip-c {
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 0 46%, var(--border-strong) 46% 54%, transparent 54%),
    linear-gradient(135deg, transparent 0 66%, var(--border-strong) 66% 74%, transparent 74%);
}
.pv-grip-c:hover { background-color: var(--surface-3); }
dialog.preview.maximized .pv-grip { display: none; }
body.pv-resizing { user-select: none; }
body.pv-resizing * { cursor: nwse-resize !important; }
dialog.preview::backdrop { background: rgba(4, 6, 11, 0.82); }
/* Only the [open] rule may set display: a bare `display: flex` on the dialog
   would beat the UA's `dialog:not([open]) { display: none }` and leave the
   modal permanently on screen. */
dialog.preview[open] { display: flex; }

.pv {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.pv-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex: none;
}
.pv-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.pv-title .fi { flex: none; }
.pv-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pv-meta { color: var(--muted); font-size: 12px; white-space: nowrap; flex: none; }
.pv-head .spacer { flex: 1; }
.pv-tools { display: flex; align-items: center; gap: 4px; flex: none; }

.pv-body {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: auto;
}
.pv-body.pad { padding: 18px; }
/* A centred flex item clamps scrollTop/Left at 0, so a zoomed image could never
   be panned back to its top-left. Anchor it while zoomed. */
.pv-body.zoomed { align-items: flex-start; justify-content: flex-start; }

.pv-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.pv-body img.zoom { max-width: none; max-height: none; cursor: zoom-out; }
.pv-body img.fit { cursor: zoom-in; }
.pv-body video, .pv-body audio { max-width: 100%; max-height: 100%; outline: none; }
.pv-body audio { width: min(560px, 100%); }
/* flex:1 + align-self:stretch, because a bare height:100% collapses against
   the centred flex parent and the PDF viewer ends up zero-height. */
.pv-body iframe {
  flex: 1;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

/* code / text */
.pv-code {
  align-self: stretch;
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  tab-size: 4;
}
.pv-gutter {
  padding: 14px 12px 14px 16px;
  text-align: right;
  color: var(--muted);
  background: var(--surface);
  border-right: 1px solid var(--border);
  user-select: none;
  white-space: pre;
  position: sticky;
  left: 0;
}
.pv-src { margin: 0; padding: 14px 18px; white-space: pre; overflow-wrap: normal; font: inherit; }
.pv-code.wrap .pv-src { white-space: pre-wrap; overflow-wrap: anywhere; }
.pv-code.wrap .pv-gutter { display: none; }

.tok-com { color: var(--muted); font-style: italic; }
.tok-str { color: #9ede73; }
.tok-key { color: #c79bff; }
.tok-num { color: #ffab70; }
.tok-fn  { color: #7fb4ff; }
.tok-atr { color: #ffd479; }

/* ---- office documents: render like the real application ---- */

.pv-body.doc {
  align-items: flex-start;
  justify-content: center;
  background: #3a3f4b;      /* the grey desk Word/PowerPoint put the page on */
  padding: 26px 20px;
}
.pv-body.doc.sheet { background: var(--bg); padding: 0; align-items: stretch; }

/* Word: a real page with the document's own size and margins */
.pv-paper {
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 3px 22px rgba(0, 0, 0, 0.45);
  margin: 0 auto;
  max-width: 100%;
  line-height: 1.5;
  font-size: 16px;
  overflow-wrap: break-word;
}
.pv-paper .pv-p { margin: 0 0 8px; }
.pv-paper h1, .pv-paper h2, .pv-paper h3,
.pv-paper h4, .pv-paper h5, .pv-paper h6 {
  color: inherit;
  font-weight: 700;
  line-height: 1.3;
  margin: 14px 0 8px;
}
.pv-paper h1 { font-size: 2em; }
.pv-paper h2 { font-size: 1.5em; }
.pv-paper h3 { font-size: 1.25em; }
.pv-paper a.pv-link { color: #0563c1; text-decoration: underline; }
.pv-paper .pv-img { max-width: 100%; height: auto; vertical-align: top; }
.pv-paper .pv-tabstop { display: inline-block; width: 40px; }
.pv-doc-list { margin: 0 0 8px; padding-left: 0; }
.pv-doc-list li { margin: 0 0 4px; }
.pv-doc-empty { color: #888; font-style: italic; }

.pv-wtable {
  border-collapse: collapse;
  margin: 8px 0 12px;
  font-size: inherit;
  table-layout: fixed;
}
.pv-wtable td {
  padding: 4px 8px;
  vertical-align: top;
  overflow-wrap: break-word;
}
.pv-wtable td > .pv-p:last-child { margin-bottom: 0; }

/* Excel: column letters, row numbers, sheet tabs along the bottom */
.pv-xl { display: flex; flex-direction: column; width: 100%; min-height: 0; flex: 1; }
.pv-xl-host { flex: 1; min-height: 0; overflow: auto; background: #fff; }
.pv-xltable {
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  color: #1a1a1a;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  width: auto;
  table-layout: fixed;
}
.pv-xltable th {
  background: #f0f0f0;
  color: #444;
  font-weight: 600;
  font-size: 11.5px;
  text-align: center;
  border: 1px solid #c6c6c6;
  padding: 3px 6px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.pv-xltable td {
  border: 1px solid #d8d8d8;
  padding: 3px 7px;
  min-width: 68px;
  max-width: 340px;
  height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pv-xl-rowhead {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 42px;
  width: 42px;
}
.pv-xl-corner { position: sticky; left: 0; z-index: 3; width: 42px; }
.pv-xl .pv-tabs {
  border-top: 1px solid var(--border);
  border-bottom: none;
  padding: 6px 12px;
  background: var(--surface-2);
}
.pv-tabs { display: flex; gap: 2px; overflow-x: auto; flex: none; }
.pv-tab {
  border: 1px solid var(--border);
  border-radius: 0 0 7px 7px;
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  padding: 5px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.pv-tab:hover { color: var(--text); background: var(--surface-3); }
.pv-tab.active { background: var(--bg); color: var(--accent); border-color: var(--border-strong); }

/* PowerPoint: white slides at the deck's real aspect ratio */
.pv-deck { width: 100%; max-width: 1000px; margin: 0 auto; }
.pv-slide-holder { margin: 0 0 22px; }
.pv-slide-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 3px 22px rgba(0, 0, 0, 0.45);
}
.pv-slide-canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  color: #1a1a1a;
  font-size: 18px;
}
.pv-shape { position: absolute; overflow: hidden; }
.pv-slide-p { margin: 0 0 4px; line-height: 1.25; }
.pv-slide-p.pv-bullet { position: relative; padding-left: 1.1em; }
.pv-slide-p.pv-bullet::before {
  content: "•";
  position: absolute;
  left: 0.1em;
}
.pv-slide-no {
  color: #cfd5e3;
  font-size: 12px;
  text-align: right;
  padding: 6px 2px 0;
}

.pv-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
  padding: 40px;
  font-size: 13.5px;
}
.pv-msg svg { color: var(--border-strong); }

.pv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(18, 22, 31, 0.86);
  color: var(--text-2);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.pv-nav { pointer-events: none; }
.pv-body:hover .pv-nav, .pv-nav:focus-visible { opacity: 1; pointer-events: auto; }
.pv-nav:hover { color: var(--text); background: var(--surface-3); }
.pv-nav.prev { left: 12px; }
.pv-nav.next { right: 12px; }
.pv-nav[disabled] { display: none; }

.pv-foot {
  flex: none;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pv-foot .spacer { flex: 1; }
.pv-foot kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-2);
}

.pv-spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: pv-spin 0.7s linear infinite;
}
@keyframes pv-spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  header { flex-wrap: wrap; padding: 10px 14px; }
  .usage { display: none; }
  .filter { width: 130px; }
  main { margin: 16px auto; padding: 0 12px; }
  th.date, td.date { display: none; }
  td.actions .btn.icon { opacity: 1; }
}
