:root {
  --bg: #f4f6fa; --card: #fff; --txt: #1c2430; --mut: #6b7686;
  --acc: #2a6fd6; --line: #dde3ec;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14181f; --card: #1d232d; --txt: #e8ecf2; --mut: #8b95a5; --line: #2c3442; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--txt);
  font: 15px/1.45 system-ui, "Segoe UI", sans-serif; }

header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; }
h1 { font-size: 18px; margin: 0; }
.spacer { flex: 1; }
.hint { color: var(--mut); font-size: 12.5px; margin: 8px 16px; }
#whoami { color: var(--mut); }
#syncState { font-size: 14px; }

button, .filebtn { background: var(--acc); color: #fff; border: 0; border-radius: 7px;
  padding: 7px 14px; font-size: 14px; cursor: pointer; }
button.ghost { background: transparent; color: var(--mut); border: 1px solid var(--line); }
.filebtn { display: inline-block; }
.toggle { display: flex; align-items: center; gap: 5px; color: var(--mut); font-size: 13px; }

#drop { margin: 0 16px 10px; padding: 10px; border: 2px dashed var(--line);
  border-radius: 10px; text-align: center; color: var(--mut); display: none; }
#drop.on { display: block; border-color: var(--acc); color: var(--acc); }

#list { list-style: none; margin: 0 auto; padding: 0 16px 40px; max-width: 900px; }
#list li { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 10px; padding: 10px 12px; display: grid;
  grid-template-columns: 1fr auto; grid-template-areas: "body actions" "meta actions"; gap: 2px 10px; }
.body { grid-area: body; overflow: hidden; }
.body pre { margin: 0; white-space: pre-wrap; word-break: break-word;
  max-height: 150px; overflow: auto; font: 13.5px/1.4 Consolas, monospace; }
.body img { max-width: 100%; max-height: 220px; border-radius: 6px; }
.badge { font-size: 11px; color: var(--acc); border: 1px solid var(--acc);
  border-radius: 4px; padding: 0 5px; }
.file small { color: var(--mut); }
.meta { grid-area: meta; color: var(--mut); font-size: 12px; }
.actions { grid-area: actions; display: flex; flex-direction: column; gap: 6px; }
.actions button, .actions a { background: transparent; border: 1px solid var(--line);
  border-radius: 7px; padding: 4px 8px; font-size: 15px; text-decoration: none; }

#auth { display: flex; justify-content: center; padding-top: 12vh; }
#auth[hidden], #app[hidden] { display: none; }
#authForm { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 26px 30px; display: flex; flex-direction: column; gap: 12px; width: 300px; }
#authForm h1 { text-align: center; }
#authForm input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--txt); font-size: 15px; }
#authMsg { color: #d6552a; font-size: 13px; margin: 0; min-height: 1em; }
