:root {
  --bg: #0f1419;
  --card: #1a2230;
  --card-hover: #222d40;
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #3b82f6;
  --border: #2a3548;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

header.site {
  padding: 28px 20px 16px;
  border-bottom: 1px solid var(--border);
}
header.site h1 { margin: 0; font-size: 1.6rem; }
header.site p { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }

.wrap { max-width: 820px; margin: 0 auto; padding: 16px 14px 60px; }

.search {
  width: 100%;
  padding: 12px 14px;
  margin: 14px 0 18px;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.search:focus { outline: none; border-color: var(--accent); }

.file {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin: 10px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: background .15s, transform .05s;
}
.file:active { transform: scale(0.99); }
@media (hover: hover) { .file:hover { background: var(--card-hover); } }

.file .icon {
  flex: 0 0 46px;
  height: 46px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .5px;
  color: #fff;
}
.icon.pdf { background: #d93025; }
.icon.doc { background: #2b579a; }
.icon.xls { background: #217346; }
.icon.ppt { background: #d24726; }
.icon.gen { background: #5f6b7a; }

.file .meta { min-width: 0; }
.file .title {
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file .sub { color: var(--muted); font-size: 0.82rem; margin-top: 3px; }

.state { color: var(--muted); text-align: center; padding: 40px 10px; line-height: 1.5; }
.state code { background: #000; padding: 2px 6px; border-radius: 6px; color: #ffd479; }

/* viewer page */
.viewer-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--card);
  border-bottom: 1px solid var(--border);
}
.viewer-bar a.back { color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }
.viewer-bar .vtitle {
  flex: 1; min-width: 0; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.viewer-bar a.alt { color: var(--muted); text-decoration: none; font-size: 0.85rem; white-space: nowrap; }
.frame-holder { position: fixed; top: 49px; left: 0; right: 0; bottom: 0; }
.frame-holder iframe, .frame-holder object { width: 100%; height: 100%; border: 0; background: #fff; }
