:root {
  color-scheme: light dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 75% 85%, #0f2419 0%, #05070a 45%, #000000 100%);
  color: #1c1c1e;
  overflow: hidden;
}

.bg-watermark {
  position: fixed;
  bottom: -40px;
  right: -40px;
  width: 520px;
  height: auto;
  opacity: 0.4;
  filter: invert(1);
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

/* --- Menu bar --- */
.menubar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(10, 12, 10, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  font-size: 13px;
  font-weight: 500;
  color: #eafff0;
  z-index: 100;
  user-select: none;
}

.menubar-left { display: flex; align-items: center; gap: 8px; }
.menubar-logo {
  width: 15px;
  height: 15px;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}
.breadcrumb span {
  cursor: pointer;
}
.breadcrumb span:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 4px; opacity: 0.5; cursor: default; }
.breadcrumb .sep:hover { text-decoration: none; }

/* --- Desktop --- */
.desktop {
  position: absolute;
  top: 28px; left: 0; right: 0; bottom: 0;
  padding: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 92px);
  grid-auto-rows: 100px;
  gap: 10px;
  align-content: start;
  overflow-y: auto;
}

.icon {
  width: 92px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  border-radius: 8px;
  cursor: default;
  user-select: none;
}

.icon.selected {
  background: rgba(255, 255, 255, 0.25);
  outline: 1px solid rgba(255, 255, 255, 0.4);
}

.icon-glyph {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
  background-size: cover;
  background-position: center;
  border-radius: 6px;
}

/* Folders with cover.jpg show the artwork, with a small folder tab above it. */
.icon-glyph.has-cover {
  position: relative;
  width: 50px;
  height: 44px;
  margin-top: 8px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  outline: 1px solid rgba(255,255,255,0.18);
}

.icon-glyph.has-cover::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 0;
  width: 20px;
  height: 6px;
  background: #b9c0c7;
  border-radius: 3px 3px 0 0;
}

.fw-row-icon.has-cover {
  width: 16px;
  height: 14px;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  outline: 1px solid rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.icon-label {
  font-size: 12px;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  line-height: 1.2;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  max-width: 100px;
}

.empty-msg {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  grid-column: 1 / -1;
}

.hint {
  position: fixed;
  bottom: 8px;
  left: 0; right: 0;
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  margin: 0;
  user-select: none;
}

/* --- Social dock --- */
.social-dock {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 5;
}

.dock-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #f2f2f0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dock-icon:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.55);
}

.dock-icon svg {
  width: 20px;
  height: 20px;
}

.dock-icon.dock-globe {
  padding: 3px;
}

.dock-icon.dock-globe img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0);
  opacity: 0.85;
}

.dock-icon.dock-bc {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 15px;
  color: #111;
}

.dock-icon.dock-nts {
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.dock-icon.dock-nts img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
}

.dock-icon.dock-globe img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Quick Look --- */
.quicklook {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.quicklook.hidden { display: none; }

.quicklook-card {
  background: rgba(250, 250, 250, 0.98);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  min-width: 320px;
  max-width: 90vw;
}

.ql-cover {
  width: 260px;
  height: 260px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  background: #ddd;
}

.ql-image {
  max-width: min(70vw, 720px);
  max-height: 65vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  background: #ddd;
}

.ql-text {
  margin: 0;
  width: min(70vw, 640px);
  max-height: 60vh;
  overflow: auto;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: #1c1c1e;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
}

.ql-title {
  font-size: 15px;
  font-weight: 600;
  color: #1c1c1e;
  text-align: center;
}

.quicklook audio {
  width: 280px;
}

/* --- Finder-style folder window --- */
.finder-window {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, 90vw);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: rgba(246, 246, 246, 0.98);
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  overflow: hidden;
  z-index: 150;
}

.finder-window.hidden { display: none; }

.fw-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(236, 236, 236, 0.95);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  user-select: none;
}

.fw-traffic { display: flex; gap: 8px; }

.fw-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.fw-close { background: #ff5f57; cursor: pointer; }
.fw-min { background: #febc2e; }
.fw-zoom { background: #28c840; }

.fw-title {
  flex: 1;
  text-align: center;
  margin-right: 54px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.fw-toolbar {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: rgba(250, 250, 250, 0.95);
}

.fw-back {
  width: 26px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.8);
  font-size: 14px;
  cursor: pointer;
  color: #333;
}

.fw-back:hover { background: #fff; }

.fw-columns, .fw-row {
  display: grid;
  grid-template-columns: 1fr 140px 110px 90px;
  align-items: center;
}

.fw-columns {
  padding: 4px 12px;
  font-size: 11px;
  color: #777;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: rgba(250, 250, 250, 0.95);
}

.fw-list {
  overflow-y: auto;
  background: #fff;
}

.fw-row {
  padding: 5px 12px;
  font-size: 13px;
  color: #222;
  cursor: default;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.fw-row.selected {
  background: #2f7bf6;
  color: #fff;
}

.fw-cell-name {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fw-row-icon { font-size: 15px; }

.fw-cell-date, .fw-cell-kind, .fw-cell-size {
  font-size: 12px;
  color: inherit;
  opacity: 0.8;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fw-empty {
  padding: 24px;
  text-align: center;
  color: #888;
  font-size: 13px;
}
