/* LexCorp shared stylesheet */
:root {
  --bg-deep: #0a0e0c;
  --bg-mid: #0f1614;
  --glass: rgba(220, 230, 224, 0.04);
  --glass-strong: rgba(220, 230, 224, 0.08);
  --ink: #e8efe9;
  --ink-dim: #8a9590;
  --ink-faint: #4a554f;
  --green-deep: #0d3d2a;
  --green-mid: #1a6b48;
  --accent-red: #ff3019;
  --accent-orange: #ff7a2e;
  --accent-cyan: #7fffd4;
  --line: rgba(232, 239, 233, 0.08);
  --line-strong: rgba(232, 239, 233, 0.16);
  --warning: #ff3019;
  --grid: rgba(127, 255, 212, 0.03);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-deep);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  position: relative;
  user-select: none;
  cursor: default;
}

.scanlines {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0px, transparent 2px, rgba(0,0,0,0.18) 2px, rgba(0,0,0,0.18) 3px);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: multiply;
  opacity: 0.5;
}
.vignette {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 9998;
}
.grain {
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.08;
  pointer-events: none;
  z-index: 9997;
  mix-blend-mode: overlay;
}
.crt-flicker {
  position: fixed; inset: 0;
  background: rgba(127, 255, 212, 0.02);
  pointer-events: none;
  z-index: 9996;
  animation: flicker 6s infinite;
}
@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.4; }
  97% { opacity: 1; }
  98% { opacity: 0.6; }
  99% { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ==== BOOT ==== */
.boot {
  position: fixed; inset: 0;
  background: var(--bg-deep);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
}
.boot.done { opacity: 0; pointer-events: none; transition: opacity 0.6s ease-out; }
.boot-logo {
  font-family: 'Major Mono Display', monospace;
  font-size: 64px;
  letter-spacing: -2px;
  margin-bottom: 8px;
  text-shadow: 2px 0 0 var(--accent-red), -2px 0 0 var(--accent-cyan);
  animation: glitch 3s infinite;
}
@keyframes glitch {
  0%, 90%, 100% { text-shadow: 2px 0 0 var(--accent-red), -2px 0 0 var(--accent-cyan); transform: translate(0,0); }
  92% { text-shadow: -3px 0 0 var(--accent-red), 3px 0 0 var(--accent-cyan); transform: translate(-1px, 1px); }
  94% { text-shadow: 4px 0 0 var(--accent-red), -4px 0 0 var(--accent-cyan); transform: translate(1px, -1px); }
}
.boot-tag { color: var(--ink-dim); font-size: 11px; letter-spacing: 4px; margin-bottom: 40px; }
.boot-log {
  font-size: 12px; line-height: 1.8; max-width: 720px;
  white-space: pre-wrap; color: var(--ink-dim); min-height: 320px;
}
.boot-log .ok { color: var(--accent-cyan); }
.boot-log .warn { color: var(--accent-orange); }
.boot-log .err { color: var(--accent-red); }
.boot-progress {
  margin-top: 30px; width: 480px; height: 2px;
  background: var(--line-strong); position: relative; overflow: hidden;
}
.boot-progress::after {
  content: ''; position: absolute; inset: 0;
  background: var(--accent-cyan); transform-origin: left;
  animation: progress 3.4s linear forwards;
}
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.boot-corner {
  position: absolute; width: 40px; height: 40px;
  border: 1px solid var(--accent-cyan); opacity: 0.3;
}
.boot-corner.tl { top: 30px; left: 30px; border-right: 0; border-bottom: 0; }
.boot-corner.tr { top: 30px; right: 30px; border-left: 0; border-bottom: 0; }
.boot-corner.bl { bottom: 30px; left: 30px; border-right: 0; border-top: 0; }
.boot-corner.br { bottom: 30px; right: 30px; border-left: 0; border-top: 0; }

/* ==== APP ==== */
.app {
  display: grid;
  grid-template-rows: 38px 1fr 28px;
  height: 100vh;
  background:
    linear-gradient(135deg, rgba(13,61,42,0.5) 0%, rgba(10,14,12,0.9) 50%, rgba(10,14,12,1) 100%),
    repeating-linear-gradient(90deg, transparent 0px, transparent 80px, var(--grid) 80px, var(--grid) 81px),
    repeating-linear-gradient(0deg, transparent 0px, transparent 80px, var(--grid) 80px, var(--grid) 81px);
  position: relative;
}

.titlebar {
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(232, 239, 233, 0.92);
  color: #1a1a1a;
  font-size: 11px;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  position: relative;
  z-index: 5;
}
.titlebar-dots { display: flex; gap: 6px; margin-right: 16px; }
.titlebar-dots span { width: 11px; height: 11px; border-radius: 50%; background: rgba(0,0,0,0.15); }
.titlebar-dots span:nth-child(1) { background: #ff5f57; }
.titlebar-dots span:nth-child(2) { background: #ffbd2e; }
.titlebar-dots span:nth-child(3) { background: #28c941; }
.titlebar-title {
  font-family: 'Syncopate', monospace;
  font-weight: 700;
  letter-spacing: 3px;
  font-size: 10px;
}
.titlebar-title b { color: var(--accent-red); }
.titlebar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 10px;
  color: #444;
}
.titlebar-right .dot { width: 6px; height: 6px; border-radius: 50%; background: #28c941; animation: pulse 2s infinite; }
.titlebar-right .logout-link {
  cursor: pointer; color: #444; transition: color 0.2s;
  padding: 4px 8px; border: 1px solid rgba(0,0,0,0.1);
  font-family: inherit; background: transparent; font-size: 9px; letter-spacing: 2px;
}
.titlebar-right .logout-link:hover { color: var(--accent-red); border-color: var(--accent-red); }

.main { display: grid; grid-template-columns: 280px 1fr; overflow: hidden; position: relative; }

.sidebar {
  background: rgba(232, 239, 233, 0.95);
  color: #1a1a1a;
  overflow-y: auto;
  border-right: 1px solid rgba(0,0,0,0.08);
}
.sidebar-head {
  display: flex; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  gap: 10px;
}
.sidebar-head .menu-icon { display: flex; flex-direction: column; gap: 3px; }
.sidebar-head .menu-icon span { display: block; width: 14px; height: 1.5px; background: #444; }
.sidebar-head .search { flex: 1; position: relative; }
.sidebar-head .search input {
  width: 100%; background: transparent; border: none; outline: none;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 4px 0; color: #1a1a1a;
}
.sidebar-head .search-icon {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px; border: 1.5px solid #444; border-radius: 50%;
}
.sidebar-head .search-icon::after {
  content: ''; position: absolute; bottom: -3px; right: -3px;
  width: 4px; height: 1.5px; background: #444; transform: rotate(45deg);
}
.sidebar-list { padding: 8px 0; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; font-size: 12px;
  cursor: pointer; position: relative;
  transition: background 0.15s;
}
.sidebar-item:hover { background: rgba(0,0,0,0.04); }
.sidebar-item.active { background: var(--accent-orange); color: #fff; }
.sidebar-item.active .folder-icon { color: #fff; }
.sidebar-item.locked { opacity: 0.4; cursor: not-allowed; }
.sidebar-item .plus { color: rgba(0,0,0,0.3); font-size: 10px; width: 8px; }
.sidebar-item.active .plus { color: rgba(255,255,255,0.7); }
.sidebar-item .folder-icon { width: 16px; height: 12px; color: #444; flex-shrink: 0; }
.sidebar-item .label { flex: 1; letter-spacing: 0.5px; }
.sidebar-item .meta { font-size: 9px; color: rgba(0,0,0,0.4); letter-spacing: 1px; }
.sidebar-item.active .meta { color: rgba(255,255,255,0.8); }
.sidebar-item .lock-icon { font-size: 10px; color: var(--accent-red); }
.sidebar-item .repo-mark {
  display: inline-flex;
  align-items: center;
  color: var(--accent-cyan);
  opacity: 0.6;
}
.sidebar-item.active .repo-mark { color: #fff; opacity: 1; }
.sidebar-item.has-repo:not(.active):hover .repo-mark { color: var(--accent-red); opacity: 1; }

.sidebar-footer {
  border-top: 1px solid rgba(0,0,0,0.05);
  padding: 16px;
  margin-top: 20px;
}
.sidebar-footer .new-folder {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: rgba(0,0,0,0.4);
  cursor: pointer;
}
.sidebar-footer .new-folder:hover { color: var(--accent-orange); }

.content {
  overflow-y: auto; overflow-x: hidden;
  position: relative;
  padding: 24px 32px;
  background: linear-gradient(180deg, rgba(13,61,42,0.15) 0%, transparent 100%);
}

.crumbs {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
  font-size: 11px; color: var(--ink);
  text-transform: uppercase; letter-spacing: 2px;
}
.crumbs .chev { color: var(--ink-dim); font-size: 14px; }
.crumbs .crumb {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.crumbs .crumb:hover { color: var(--accent-cyan); }
.crumbs .crumb.current {
  background: var(--accent-red); color: #fff; padding: 4px 10px;
}
.crumbs .folder-glyph {
  display: inline-block; width: 16px; height: 12px;
  border: 1.5px solid currentColor; position: relative;
}
.crumbs .folder-glyph::before {
  content: ''; position: absolute; top: -3px; left: 0;
  width: 6px; height: 3px; background: currentColor;
}

.urlbar {
  font-size: 10px; color: var(--ink-dim);
  margin-bottom: 28px; letter-spacing: 1px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
  position: relative;
}
.urlbar::after {
  content: ''; position: absolute;
  bottom: -1px; left: 0; width: 33%; height: 1px;
  background: var(--accent-red);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}

.file-tile {
  background: rgba(232, 239, 233, 0.97);
  color: #1a1a1a;
  position: relative;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s;
  animation: tileIn 0.5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes tileIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.file-tile:nth-child(1) { animation-delay: 0.05s; }
.file-tile:nth-child(2) { animation-delay: 0.15s; }
.file-tile:nth-child(3) { animation-delay: 0.25s; }
.file-tile:nth-child(4) { animation-delay: 0.35s; }
.file-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px var(--accent-cyan);
}
.file-tile:hover .tile-thumb::before { opacity: 1; }
.file-tile:hover .tile-tab { background: var(--accent-red); color: #fff; }
.file-tile.locked { opacity: 0.6; }
.file-tile.locked:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px var(--accent-red); }

.tile-tab {
  position: absolute;
  top: -1px; right: 12px;
  background: rgba(0,0,0,0.08);
  color: #1a1a1a;
  padding: 4px 8px;
  font-size: 9px;
  letter-spacing: 1px;
  display: flex; align-items: center; gap: 4px;
  z-index: 2; transition: all 0.2s;
}
.tile-tab.locked-tab { background: var(--accent-red); color: #fff; }

.tile-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile-thumb::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 3px);
  opacity: 0.6; transition: opacity 0.2s;
  z-index: 2; pointer-events: none;
}
.tile-thumb svg { width: 50%; height: 50%; position: relative; z-index: 1; }
.tile-thumb .crosshair {
  position: absolute; inset: 0; z-index: 3;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.file-tile:hover .tile-thumb .crosshair { opacity: 1; }
.tile-thumb .crosshair::before, .tile-thumb .crosshair::after {
  content: ''; position: absolute; background: var(--accent-cyan);
}
.tile-thumb .crosshair::before { top: 50%; left: 0; right: 0; height: 1px; }
.tile-thumb .crosshair::after { left: 50%; top: 0; bottom: 0; width: 1px; }

.thumb-ww { background: radial-gradient(circle at 30% 70%, #1a6b48 0%, #0d3d2a 50%, #082018 100%); }
.thumb-cy { background: radial-gradient(circle at 50% 50%, #4a0e0e 0%, #2a0606 60%, #1a0303 100%); }
.thumb-fl { background: radial-gradient(circle at 50% 30%, #6b1414 0%, #3a0808 60%, #1a0303 100%); }
.thumb-aq { background: radial-gradient(circle at 50% 50%, #0a2a4a 0%, #051a30 60%, #020a18 100%); }
.thumb-default { background: radial-gradient(circle at 50% 50%, #2a2a2a 0%, #1a1a1a 60%, #0a0a0a 100%); }

.thumb-ww::after, .thumb-cy::after, .thumb-fl::after, .thumb-aq::after, .thumb-default::after {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.3; mix-blend-mode: overlay;
}

.tile-meta { padding: 12px 14px; border-top: 1px solid rgba(0,0,0,0.08); }
.tile-subject {
  font-size: 10px; margin-bottom: 8px; display: block;
  color: #1a1a1a; padding: 2px 4px; background: transparent;
}
.tile-subject.highlight { background: var(--accent-orange); color: #fff; }
.tile-dirpath-label {
  font-size: 8px; letter-spacing: 1.5px;
  color: rgba(0,0,0,0.4); margin-bottom: 6px;
}
.tile-dirpath {
  display: flex; align-items: center; gap: 6px;
  font-size: 9px; color: #1a1a1a;
}
.tile-dirpath .chev { color: rgba(0,0,0,0.3); }
.tile-dirpath .mini-folder {
  display: inline-block; width: 10px; height: 8px;
  border: 1px solid currentColor; position: relative;
}
.tile-dirpath .mini-folder::before {
  content: ''; position: absolute; top: -2px; left: 0;
  width: 4px; height: 2px; background: currentColor;
}
.tile-checksum {
  font-size: 8px; color: rgba(0,0,0,0.35);
  margin-top: 6px; letter-spacing: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.empty-state { padding: 80px 0; text-align: center; color: var(--ink-dim); }
.empty-state h2 {
  font-family: 'Major Mono Display', monospace;
  font-size: 32px; margin-bottom: 8px;
  letter-spacing: 4px; color: var(--accent-red);
}
.empty-state p { font-size: 11px; letter-spacing: 2px; }
.empty-state .seal {
  margin: 30px auto; width: 140px; height: 140px;
  border: 1px solid var(--accent-red); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  animation: rotate 30s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }
.empty-state .seal::before {
  content: 'CLASSIFIED ★ ACCESS DENIED ★ ';
  position: absolute; inset: -20px;
  font-size: 9px; color: var(--accent-red); letter-spacing: 4px;
}

.statusbar {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line-strong);
  display: flex; align-items: center;
  padding: 0 16px;
  font-size: 10px; letter-spacing: 1.5px;
  color: var(--ink-dim); gap: 20px;
  position: relative; z-index: 5;
}
.statusbar .group { display: flex; align-items: center; gap: 8px; }
.statusbar .group .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-cyan);
  animation: pulse 2s infinite;
}
.statusbar .group .dot.red { background: var(--accent-red); }
.statusbar .group .dot.orange { background: var(--accent-orange); }
.statusbar .group b { color: var(--ink); font-weight: 500; }
.statusbar .spacer { flex: 1; }
.statusbar .clock { color: var(--accent-cyan); font-weight: 500; }

/* ==== DOSSIER ==== */
.dossier {
  position: fixed; inset: 0;
  background: rgba(10, 14, 12, 0.92);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: stretch; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.dossier.open { opacity: 1; pointer-events: auto; }
.dossier-panel {
  width: 100%; max-width: 1200px;
  background: var(--bg-mid);
  border: 1px solid var(--line-strong);
  display: grid; grid-template-columns: 1fr 480px;
  overflow: hidden; position: relative;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 0 1px rgba(127,255,212,0.1), 0 20px 80px rgba(0,0,0,0.8);
}
.dossier.open .dossier-panel { transform: translateY(0); }

.dossier-panel::before, .dossier-panel::after {
  content: ''; position: absolute;
  width: 24px; height: 24px;
  border: 1px solid var(--accent-cyan);
  pointer-events: none;
}
.dossier-panel::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.dossier-panel::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

.dossier-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px;
  background: transparent; border: 1px solid var(--ink-dim);
  color: var(--ink); cursor: pointer;
  font-family: inherit; font-size: 14px;
  z-index: 10; transition: all 0.2s;
}
.dossier-close:hover { border-color: var(--accent-red); color: var(--accent-red); }

.dossier-media {
  position: relative; overflow: hidden;
  min-height: 600px; display: flex; flex-direction: column;
}
.media-canvas { flex: 1; position: relative; overflow: hidden; }
.media-canvas canvas { width: 100%; height: 100%; display: block; }
.media-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(0,0,0,0.2) 2px, rgba(0,0,0,0.2) 3px);
}
.media-hud {
  position: absolute; inset: 16px;
  color: var(--accent-cyan); font-size: 10px;
  letter-spacing: 2px; pointer-events: none;
}
.media-hud .top-l { position: absolute; top: 0; left: 0; }
.media-hud .top-r { position: absolute; top: 0; right: 0; text-align: right; }
.media-hud .bot-l { position: absolute; bottom: 0; left: 0; }
.media-hud .bot-r { position: absolute; bottom: 0; right: 0; text-align: right; }
.media-hud .center-tag {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 48, 25, 0.85);
  color: #fff; padding: 4px 10px;
  font-size: 9px; letter-spacing: 3px;
}
.media-controls {
  padding: 10px 16px;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--line-strong);
}
.media-controls .play {
  width: 28px; height: 28px;
  border: 1px solid var(--accent-cyan);
  background: transparent; color: var(--accent-cyan);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.media-controls .play:hover { background: var(--accent-cyan); color: #000; }
.media-controls .timeline {
  flex: 1; height: 2px; background: var(--line-strong);
  position: relative; cursor: pointer;
}
.media-controls .timeline-fill {
  position: absolute; inset: 0;
  background: var(--accent-cyan);
  width: 0%; transition: width 0.2s linear;
}
.media-controls .time { font-size: 10px; color: var(--ink-dim); letter-spacing: 1px; }

.dossier-info {
  padding: 32px 28px;
  overflow-y: auto;
  background: var(--bg-mid);
  position: relative;
}
.dossier-info::before {
  content: ''; position: absolute;
  top: 0; bottom: 0; left: 0; width: 1px;
  background: linear-gradient(180deg, transparent 0%, var(--accent-cyan) 50%, transparent 100%);
  opacity: 0.3;
}
.dossier-classification {
  display: inline-block;
  background: var(--accent-red); color: #fff;
  padding: 4px 10px; font-size: 9px; letter-spacing: 3px;
  margin-bottom: 16px; animation: blink 2s infinite;
}
@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  51%, 75% { opacity: 0.4; }
}
.dossier-codename {
  font-family: 'Syncopate', monospace;
  font-size: 11px; letter-spacing: 4px;
  color: var(--ink-dim); margin-bottom: 6px;
}
.dossier-name {
  font-family: 'Major Mono Display', monospace;
  font-size: 36px; letter-spacing: -1px; line-height: 1;
  margin-bottom: 4px; color: var(--ink);
}
.dossier-alias {
  font-size: 11px; color: var(--accent-cyan);
  letter-spacing: 2px; margin-bottom: 28px;
}

.dossier-section { margin-bottom: 22px; }
.dossier-section h3 {
  font-size: 9px; letter-spacing: 3px;
  color: var(--ink-dim); margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.dossier-section h3 .tag { color: var(--accent-orange); font-size: 8px; }

.dossier-fields { display: grid; gap: 6px; }
.dossier-field {
  display: grid; grid-template-columns: 110px 1fr;
  font-size: 11px; gap: 12px;
}
.dossier-field .key {
  color: var(--ink-dim); letter-spacing: 1.5px;
  font-size: 9px; text-transform: uppercase;
}
.dossier-field .val { color: var(--ink); }
.dossier-field .val.flag { color: var(--accent-red); }
.dossier-field .val.ok { color: var(--accent-cyan); }

.dossier-abilities { display: flex; flex-direction: column; gap: 8px; }
.ability {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center; gap: 12px;
  font-size: 10px;
}
.ability .name { color: var(--ink); letter-spacing: 1px; }
.ability .bar {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--line-strong);
  position: relative; overflow: hidden;
}
.ability .bar-fill {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--accent-cyan) 0%, var(--accent-orange) 100%);
  transform-origin: left; transform: scaleX(0);
  animation: barFill 1.2s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes barFill { to { transform: scaleX(var(--fill, 0.8)); } }
.ability .val {
  font-family: 'Major Mono Display', monospace;
  color: var(--accent-cyan); font-size: 11px;
}

.dossier-notes {
  background: rgba(255, 48, 25, 0.06);
  border-left: 2px solid var(--accent-red);
  padding: 12px 14px;
  font-size: 11px; line-height: 1.7;
  color: var(--ink); font-style: italic;
}
.dossier-notes .sig {
  margin-top: 10px;
  font-style: normal;
  font-size: 9px; letter-spacing: 2px;
  color: var(--accent-orange); text-align: right;
}

.add-note-form {
  display: flex; gap: 8px;
  margin-top: 10px;
}
.add-note-form input {
  flex: 1; padding: 8px 10px;
  background: rgba(127,255,212,0.04);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  outline: none;
}
.add-note-form input:focus { border-color: var(--accent-cyan); }
.add-note-form button {
  background: var(--accent-orange);
  color: #fff; border: none;
  padding: 6px 12px;
  font-family: inherit; font-size: 9px;
  letter-spacing: 2px; cursor: pointer;
  transition: background 0.2s;
}
.add-note-form button:hover { background: var(--accent-red); }

.notes-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 240px; overflow-y: auto;
}
.note-item {
  background: rgba(127,255,212,0.04);
  padding: 8px 10px;
  font-size: 10px; line-height: 1.5;
  border-left: 1px solid var(--accent-cyan);
}
.note-item .note-meta {
  display: flex; justify-content: space-between;
  font-size: 8px; letter-spacing: 1.5px;
  color: var(--ink-dim);
  margin-bottom: 4px;
}
.note-item .note-meta b { color: var(--accent-cyan); }
.note-item .note-content { color: var(--ink); }
.note-item .del {
  background: none; border: none; color: var(--accent-red);
  cursor: pointer; font-family: inherit; font-size: 9px;
  padding: 0 2px;
}

.access-log {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(127,255,212,0.04);
  border: 1px solid var(--line);
  font-size: 9px; color: var(--ink-dim);
  letter-spacing: 1px;
  max-height: 120px; overflow-y: auto;
}
.access-log b { color: var(--accent-cyan); }
.access-log .acc-row { padding: 2px 0; }
.access-log .acc-row.denied { color: var(--accent-red); }

.btn-action {
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 6px 12px;
  font-family: inherit; font-size: 9px;
  letter-spacing: 2px; cursor: pointer;
  transition: all 0.2s;
}
.btn-action:hover { background: var(--accent-cyan); color: #000; }
.btn-action.danger { border-color: var(--accent-red); color: var(--accent-red); }
.btn-action.danger:hover { background: var(--accent-red); color: #fff; }

.toast {
  position: fixed; bottom: 60px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(255, 48, 25, 0.95);
  color: #fff;
  padding: 10px 20px;
  font-size: 10px; letter-spacing: 2px;
  z-index: 9000;
  transition: transform 0.3s;
  border-left: 3px solid #fff;
  text-transform: uppercase;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: rgba(40, 201, 65, 0.95); }
.toast.info { background: rgba(127, 255, 212, 0.95); color: #000; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-cyan); }

.corner-mark {
  position: fixed;
  width: 20px; height: 20px;
  border: 1px solid var(--accent-red);
  pointer-events: none; z-index: 100; opacity: 0.4;
}
.corner-mark.tl { top: 44px; left: 286px; border-right: 0; border-bottom: 0; }
.corner-mark.tr { top: 44px; right: 6px; border-left: 0; border-bottom: 0; }
.corner-mark.bl { bottom: 34px; left: 286px; border-right: 0; border-top: 0; }
.corner-mark.br { bottom: 34px; right: 6px; border-left: 0; border-top: 0; }

@media (max-width: 1100px) {
  .file-grid { grid-template-columns: repeat(2, 1fr); }
  .dossier-panel { grid-template-columns: 1fr; }
  .dossier-media { min-height: 400px; }
}
@media (max-width: 700px) {
  .main { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .file-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}

/* ============ REPO FOLDER VIEW ============ */
.section-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--ink-dim);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.section-label::after {
  content: ''; position: absolute; bottom: -1px; left: 0;
  width: 60px; height: 1px; background: var(--accent-cyan);
}

.repo-banner {
  background: rgba(232, 239, 233, 0.97);
  color: #1a1a1a;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 24px;
  margin-bottom: 24px;
  position: relative;
  animation: tileIn 0.5s cubic-bezier(.2,.8,.2,1) both;
}
.repo-banner::before {
  content: ''; position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--accent-red);
}
.repo-banner-left { flex: 1; }
.repo-banner-org {
  font-size: 10px;
  letter-spacing: 3px;
  color: #6a7570;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.repo-banner-org .chev { color: rgba(0,0,0,0.25); margin: 0 4px; }
.repo-banner-name {
  font-family: 'Major Mono Display', monospace;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -1px;
  color: #1a1a1a;
  margin-bottom: 8px;
  text-shadow: 1px 0 0 rgba(255,48,25,0.25), -1px 0 0 rgba(127,255,212,0.25);
}
.repo-banner-desc {
  font-size: 12px;
  color: #444;
  line-height: 1.6;
  margin-bottom: 12px;
  max-width: 600px;
}
.repo-banner-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.repo-stat {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #444;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.repo-banner-right { flex: 0 0 auto; }
.repo-link {
  display: inline-block;
  background: #1a1a1a;
  color: #e8efe9;
  padding: 8px 14px;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-decoration: none;
  transition: all 0.2s;
}
.repo-link:hover { background: var(--accent-red); }

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.repo-tile {
  background: rgba(232, 239, 233, 0.97);
  color: #1a1a1a;
  position: relative;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s;
  animation: tileIn 0.5s cubic-bezier(.2,.8,.2,1) both;
}
.repo-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px var(--accent-cyan);
}
.repo-tile:hover .tile-thumb::before { opacity: 1; }
.repo-tile:hover .tile-tab { background: var(--accent-red); color: #fff; }
.repo-tile.hero { grid-column: 1 / -1; }
.repo-tile.hero .tile-thumb { aspect-ratio: 5 / 2; }
.repo-tile.hero { box-shadow: 0 0 0 1px var(--accent-orange); }
.repo-tile.hero:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px var(--accent-cyan); }
.repo-tile.hero .repo-thumb { background: radial-gradient(circle at 30% 50%, #1a3d6b 0%, #0a1830 60%, #050a18 100%); }

.repo-thumb { background: radial-gradient(circle at 50% 40%, #1a1a1a 0%, #0a0a0a 60%, #050505 100%); }
.repo-thumb::after {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.3; mix-blend-mode: overlay;
}

.repo-tile-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #1a1a1a;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.repo-tile-desc {
  font-size: 10px;
  line-height: 1.5;
  color: #555;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 30px;
}
.repo-tile-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 1px;
  color: rgba(0,0,0,0.5);
}

.lang-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #888;
}
.lang-dot[data-lang="JavaScript"] { background: #f1e05a; }
.lang-dot[data-lang="TypeScript"] { background: #3178c6; }
.lang-dot[data-lang="Python"]     { background: #3572A5; }
.lang-dot[data-lang="Go"]         { background: #00ADD8; }
.lang-dot[data-lang="Rust"]       { background: #dea584; }
.lang-dot[data-lang="HTML"]       { background: #e34c26; }
.lang-dot[data-lang="CSS"]        { background: #563d7c; }

/* ============ README OVERLAY ============ */
.readme-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 14, 12, 0.94);
  backdrop-filter: blur(10px);
  z-index: 1100;
  display: flex; align-items: stretch; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.readme-overlay.open { opacity: 1; pointer-events: auto; }

.readme-panel {
  width: 100%;
  max-width: 980px;
  background: rgba(232, 239, 233, 0.98);
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 0 1px rgba(127,255,212,0.1), 0 20px 80px rgba(0,0,0,0.8);
}
.readme-overlay.open .readme-panel { transform: translateY(0); }
.readme-panel::before, .readme-panel::after {
  content: ''; position: absolute;
  width: 24px; height: 24px;
  border: 1px solid var(--accent-cyan);
  pointer-events: none;
}
.readme-panel::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.readme-panel::after { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.readme-header {
  background: #1a1a1a;
  color: #e8efe9;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.readme-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.readme-header-left svg { color: var(--accent-cyan); flex-shrink: 0; }
.readme-header-title {
  font-family: 'Syncopate', monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 3px;
}
.readme-header-meta {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--ink-dim);
  margin-top: 2px;
}
.readme-header-meta a {
  color: var(--accent-cyan);
  text-decoration: none;
}
.readme-header-meta a:hover { color: var(--accent-orange); }

.readme-close {
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--ink-dim);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
}
.readme-close:hover { border-color: var(--accent-red); color: var(--accent-red); }

.readme-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px 40px;
  background: rgba(232, 239, 233, 0.98);
}

.readme-classification {
  display: inline-block;
  background: var(--accent-red);
  color: #fff;
  padding: 4px 10px;
  font-size: 9px;
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.readme-markdown {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #1a1a1a;
}
.readme-markdown h1, .readme-markdown h2, .readme-markdown h3,
.readme-markdown h4, .readme-markdown h5, .readme-markdown h6 {
  font-family: 'Major Mono Display', monospace;
  letter-spacing: -0.5px;
  margin: 28px 0 14px;
  color: #1a1a1a;
  padding-bottom: 8px;
  position: relative;
}
.readme-markdown h1 {
  font-size: 28px;
  border-bottom: 2px solid rgba(0,0,0,0.1);
}
.readme-markdown h1::after {
  content: ''; position: absolute;
  bottom: -2px; left: 0;
  width: 60px; height: 2px;
  background: var(--accent-red);
}
.readme-markdown h2 {
  font-size: 22px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.readme-markdown h3 { font-size: 18px; }
.readme-markdown h4 { font-size: 15px; letter-spacing: 1px; text-transform: uppercase; }
.readme-markdown h5, .readme-markdown h6 { font-size: 13px; letter-spacing: 1px; }

.readme-markdown p { margin: 12px 0; }
.readme-markdown ul, .readme-markdown ol { margin: 12px 0 12px 24px; }
.readme-markdown li { margin: 4px 0; }
.readme-markdown a {
  color: var(--accent-red);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.readme-markdown a:hover { color: var(--accent-orange); }
.readme-markdown strong { color: #000; }
.readme-markdown em { color: #444; }
.readme-markdown del { color: #888; }
.readme-markdown hr {
  border: 0;
  height: 1px;
  background: rgba(0,0,0,0.1);
  margin: 24px 0;
  position: relative;
}
.readme-markdown blockquote {
  border-left: 3px solid var(--accent-orange);
  background: rgba(255, 122, 46, 0.06);
  padding: 10px 16px;
  margin: 14px 0;
  font-style: italic;
  color: #444;
}
.readme-markdown code {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 2px;
  color: var(--accent-red);
}
.readme-markdown pre {
  background: #1a1a1a;
  color: #e8efe9;
  padding: 14px 18px;
  overflow-x: auto;
  margin: 14px 0;
  font-size: 12px;
  line-height: 1.6;
  border-left: 2px solid var(--accent-cyan);
}
.readme-markdown pre code {
  background: none;
  padding: 0;
  color: inherit;
  border-radius: 0;
}
.readme-markdown img {
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(0,0,0,0.1);
  margin: 14px 0;
}
.readme-markdown table {
  border-collapse: collapse;
  margin: 14px 0;
  width: 100%;
  font-size: 12px;
}
.readme-markdown th, .readme-markdown td {
  border: 1px solid rgba(0,0,0,0.1);
  padding: 6px 10px;
  text-align: left;
}
.readme-markdown th { background: rgba(0,0,0,0.04); font-weight: 600; }

/* Scrollbar in readme body — dark on light */
.readme-body::-webkit-scrollbar { width: 8px; }
.readme-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.05); }
.readme-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); }
.readme-body::-webkit-scrollbar-thumb:hover { background: var(--accent-red); }

/* ========== FILE EXPLORER ADDITIONS ========== */

/* File tile actions */
.file-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0,0,0,0.08);
}
.file-actions button {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.2px;
  font-weight: 600;
  padding: 6px 8px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.1);
  color: var(--ink, #111);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.file-actions button:hover { background: var(--accent-cyan, #7fffd4); }
.file-actions .file-action-delete { color: var(--accent-red, #ff3019); }
.file-actions .file-action-delete:hover { background: var(--accent-red, #ff3019); color: #fff; }

/* Big extension label inside the thumb */
.file-thumb { position: relative; }
.file-ext-big {
  font-family: 'Major Mono Display', monospace;
  font-size: 38px;
  color: rgba(255,255,255,0.9);
  letter-spacing: 1px;
  z-index: 2;
  position: relative;
}

/* Truncate long file names */
.file-tile .tile-subject {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== DROP ZONE OVERLAY ========== */
.dropzone-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.82);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.dropzone-overlay.active { display: flex; }
.dropzone-frame {
  position: relative;
  padding: 56px 80px;
  border: 2px dashed var(--accent-red, #ff3019);
  text-align: center;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255,48,25,0.05);
  animation: dropzonePulse 1.4s ease-in-out infinite;
}
@keyframes dropzonePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,48,25,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(255,48,25,0); }
}
.dropzone-corner {
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid var(--accent-red, #ff3019);
}
.dropzone-corner.tl { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.dropzone-corner.tr { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.dropzone-corner.bl { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.dropzone-corner.br { bottom: -2px; right: -2px; border-left: none; border-top: none; }
.dropzone-icon { color: var(--accent-red, #ff3019); margin-bottom: 20px; }
.dropzone-title {
  font-family: 'Syncopate', sans-serif;
  font-size: 28px;
  letter-spacing: 6px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #fff;
}
.dropzone-sub {
  font-size: 11px;
  letter-spacing: 2.5px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 8px;
}
.dropzone-sub b, .dropzone-sub span { color: var(--accent-cyan, #7fffd4); }
.dropzone-hint {
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.4);
  margin-top: 14px;
}

/* ========== UPLOAD PROGRESS PANEL ========== */
.upload-panel {
  position: fixed;
  right: 24px;
  bottom: 60px;
  width: 320px;
  background: #181818;
  color: #eee;
  border: 1px solid rgba(255,255,255,0.1);
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,48,25,0.15);
  z-index: 8500;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s, opacity 0.2s;
}
.upload-panel.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.upload-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 10px;
  letter-spacing: 2px;
  background: rgba(255,48,25,0.12);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.upload-panel-head b { color: var(--accent-cyan, #7fffd4); }
.upload-panel-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}
.upload-panel-close:hover { color: var(--accent-red, #ff3019); }
.upload-panel-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px 0;
}
.upload-row {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.upload-row:last-child { border-bottom: none; }
.upload-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.upload-row-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}
.upload-row-status {
  font-size: 9px;
  font-weight: 600;
  color: var(--accent-cyan, #7fffd4);
}
.upload-row.done .upload-row-status { color: #28c941; }
.upload-row.error .upload-row-status { color: var(--accent-red, #ff3019); }
.upload-row-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.upload-row-fill {
  height: 100%;
  background: var(--accent-red, #ff3019);
  transition: width 0.15s linear;
}
.upload-row.done .upload-row-fill { background: #28c941; }
.upload-row.error .upload-row-fill { background: var(--accent-red, #ff3019); }
.upload-row-err {
  margin-top: 4px;
  font-size: 9px;
  color: var(--accent-red, #ff3019);
  letter-spacing: 0.5px;
}

/* Per-folder admin tools in the sidebar */
.folder-tools {
  display: none;
  margin-left: 6px;
  gap: 4px;
}
.sidebar-item:hover .folder-tools { display: inline-flex; }
.folder-tools button {
  background: rgba(0,0,0,0.06);
  border: none;
  color: rgba(0,0,0,0.55);
  font-size: 10px;
  width: 18px;
  height: 18px;
  padding: 0;
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
}
.folder-tools button:hover { background: var(--accent-red, #ff3019); color: #fff; }
.sidebar-item.active .folder-tools button {
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
}
.sidebar-item.active .folder-tools button:hover { background: #fff; color: var(--accent-red, #ff3019); }

/* Review badge on tile */
.review-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.6px;
  padding: 4px 8px;
  background: var(--accent-orange, #ff9d00);
  color: #000;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid rgba(0,0,0,0.2);
}
.review-badge.reviewed {
  background: #28c941;
  color: #fff;
}
.file-tile.pending-review {
  box-shadow: 0 0 0 1px var(--accent-orange, #ff9d00), 0 8px 28px rgba(0,0,0,0.45);
}
.review-line {
  margin-top: 8px;
  font-size: 9px;
  letter-spacing: 1.3px;
  color: var(--ink-dim, #777);
  border-top: 1px dotted rgba(0,0,0,0.08);
  padding-top: 6px;
}
.file-tile.pending-review .review-line { color: var(--accent-orange, #ff9d00); font-weight: 600; }
.file-action-review { background: rgba(255,157,0,0.15) !important; }
.file-action-review:hover { background: var(--accent-orange, #ff9d00) !important; color: #000 !important; }
.file-action-unreview { background: rgba(40,201,65,0.15) !important; }
.file-action-unreview:hover { background: #28c941 !important; color: #fff !important; }

/* Inline denied/error strip (replaces the big rotating empty-state seal) */
.denied-strip {
  margin-top: 24px;
  padding: 14px 20px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent-red, #ff3019);
  border: 1px dashed var(--accent-red, #ff3019);
  background: rgba(255,48,25,0.04);
  text-align: center;
}

/* ========== FILE PREVIEW THUMBNAILS ========== */
.file-thumb {
  position: relative;
  overflow: hidden;
}
.file-thumb-img,
.file-thumb-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  background: transparent;
  opacity: 0;
  transition: opacity 0.25s ease-in;
}
.file-thumb-img.loaded,
.file-thumb-video.loaded { opacity: 1; }
.media-tile.thumb-loaded .tile-thumb {
  background: #1a1a1a;
  transition: background 0.2s ease-in;
}
/* show a subtle "loading" stripe pattern while the image bytes arrive */
.media-tile .tile-thumb {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 10px, rgba(255,255,255,0.05) 10px 20px),
    #1a1a1a;
}
.file-thumb.thumb-error::after {
  content: 'PREVIEW UNAVAILABLE';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  z-index: 2;
}
.media-tile .file-ext-big { display: none; }

/* Play overlay for video thumbs */
.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: 2px solid rgba(255,255,255,0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  z-index: 2;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Non-previewable file glyph (PDF, doc, zip, etc.) */
.file-glyph {
  position: relative;
  z-index: 1;
  width: 50%;
  height: 50%;
  color: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-glyph svg { width: 100%; height: 100%; }
.audio-glyph svg { width: 60%; height: 60%; }

/* Image hover zoom hint */
.media-tile:hover .file-thumb-img,
.media-tile:hover .file-thumb-video {
  transform: scale(1.04);
  transition: transform 0.4s ease;
}

/* Override the colored-thumb gradient on media tiles so image is clean */
.media-tile .tile-thumb::before { display: none; }

/* ========== MODAL DIALOG ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; animation: modalFadeIn 0.15s ease-out; }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-frame {
  position: relative;
  width: min(420px, 92vw);
  background: #fff;
  color: var(--ink, #111);
  border: 1px solid var(--accent-red, #ff3019);
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: modalSlideIn 0.18s cubic-bezier(.2,.8,.2,1);
}
@keyframes modalSlideIn { from { transform: translateY(-8px) scale(0.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-corner {
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid var(--accent-red, #ff3019);
}
.modal-corner.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.modal-corner.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.modal-corner.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.modal-corner.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255,48,25,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.modal-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--accent-red, #ff3019);
  text-transform: uppercase;
}
.modal-close {
  background: none;
  border: none;
  color: rgba(0,0,0,0.4);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  width: 22px;
  height: 22px;
}
.modal-close:hover { color: var(--accent-red, #ff3019); }
.modal-body {
  padding: 20px 18px 8px;
}
.modal-message {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink, #111);
  letter-spacing: 0.2px;
}
.modal-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-dim, #777);
  margin: 10px 0 6px;
}
.modal-label:first-child { margin-top: 0; }
.modal-input {
  width: 100%;
  padding: 9px 11px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  border: 1px solid rgba(0,0,0,0.15);
  background: #fafafa;
  color: var(--ink, #111);
  letter-spacing: 0.3px;
  box-sizing: border-box;
}
.modal-input:focus {
  outline: none;
  border-color: var(--accent-red, #ff3019);
  background: #fff;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.02);
}
.modal-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 9px 16px;
  border: 1px solid rgba(0,0,0,0.15);
  background: #fff;
  color: var(--ink, #111);
  cursor: pointer;
  transition: background 0.12s;
}
.modal-btn:hover { background: rgba(0,0,0,0.04); }
.modal-btn-ok {
  background: var(--ink, #111);
  color: #fff;
  border-color: var(--ink, #111);
}
.modal-btn-ok:hover { background: #000; }
.modal-btn-ok.danger {
  background: var(--accent-red, #ff3019);
  border-color: var(--accent-red, #ff3019);
}
.modal-btn-ok.danger:hover { background: #d4220e; }

/* ========== SKELETON LOADER ========== */
.file-tile.skeleton {
  pointer-events: none;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.file-tile.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.06), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.skeleton-thumb {
  height: 140px;
  background: rgba(0,0,0,0.07);
}
.skeleton-line {
  height: 10px;
  margin: 12px 14px 0;
  background: rgba(0,0,0,0.07);
}
.skeleton-line.w70 { width: 70%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.w40 { width: 40%; margin-bottom: 14px; }

/* ========== EMPTY HINT ========== */
.empty-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 80px 24px;
  color: var(--ink-dim, #777);
  text-align: center;
  border: 1px dashed rgba(0,0,0,0.15);
  margin-top: 24px;
  background: rgba(0,0,0,0.015);
}
.empty-hint-icon {
  color: rgba(0,0,0,0.25);
  font-size: 36px;
  line-height: 1;
}
.empty-hint-icon svg { display: block; }
.empty-hint-msg {
  font-size: 10px;
  letter-spacing: 2.5px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.empty-hint-btn {
  margin-top: 6px;
  background: var(--accent-red, #ff3019);
  color: #fff;
  border: none;
  padding: 10px 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s;
}
.empty-hint-btn:hover { background: #d4220e; }

/* URL bar method tag + meta */
.urlbar-method {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: var(--accent-red, #ff3019);
  color: #fff;
}
.urlbar-meta {
  margin-left: 12px;
  color: var(--ink-dim, #777);
  font-size: 10px;
}

/* Crumbs: small clearance badge */
.crumb-clearance {
  margin-left: 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 2px 7px;
  border: 1px solid var(--accent-orange, #ff9d00);
  color: var(--accent-orange, #ff9d00);
}

/* Drive connection pill in the title bar */
.drive-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 4px 10px;
  border: 1px solid currentColor;
  cursor: default;
  user-select: none;
  font-family: 'JetBrains Mono', monospace;
}
.drive-pill .drive-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: drivePulse 2s ease-in-out infinite;
}
.drive-pill.connected { color: #28c941; }
.drive-pill.disconnected { color: var(--accent-orange, #ff9d00); }
.drive-pill:hover { background: rgba(255,255,255,0.06); }
@keyframes drivePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ========== TOP PROGRESS BAR (replaces white-flash skeleton) ========== */
.content-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent-red, #ff3019);
  z-index: 9999;
  transition: width 0.35s ease;
  opacity: 0;
  pointer-events: none;
}
.content-loading-bar.active {
  opacity: 1;
  width: 70%;
  transition: width 1.2s cubic-bezier(.1, .7, .2, .95), opacity 0.1s linear;
}
.content-loading-bar.done {
  width: 100%;
  opacity: 0;
  transition: width 0.15s ease-out, opacity 0.25s ease-in 0.15s;
}

/* Fade content during folder switch */
.content.loading {
  opacity: 0.45;
  transition: opacity 0.18s ease-out;
  pointer-events: none;
}
.content {
  transition: opacity 0.22s ease-in;
}
