/* One stylesheet, design tokens + light-dark(), same as the house style. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#faf9f7, #14161a);
  --panel: light-dark(#ffffff, #1d2128);
  --panel2: light-dark(#f1efe9, #232730);
  --ink: light-dark(#1c1d21, #e8e6e1);
  --muted: light-dark(#6d6f76, #9a9da6);
  --accent: light-dark(#2f6df6, #6f9dff);
  --danger: light-dark(#c23b3b, #ff8484);
  --border: light-dark(#e2e0da, #2e333d);
  font-size: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#app { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
h1 { font-size: 1.4rem; letter-spacing: -0.02em; margin: 0.5rem 0; }
h2 { font-size: 1.15rem; margin: 1.2rem 0 0.6rem; }
h3.folder { font-size: 0.85rem; color: var(--muted); margin: 1.2rem 0 0.3rem; font-weight: 600; }
form { display: flex; flex-direction: column; gap: 0.7rem; max-width: 26rem; margin-top: 2rem; }
/* The front door: pitch left, sign-in right; one column on narrow screens. */
.door { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-top: 2.5rem; align-items: start; }
.pitch img.logo { display: block; width: 72px; height: 72px; margin: 0 0 1rem; }
.pitch h1 { font-size: 2rem; margin: 0 0 0.3rem; }
.pitch p { margin: 0; }
.pitch ul { margin: 0.7rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.entry { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; }
.entry form { margin-top: 0; }
.entry h2 { margin-top: 0; }
@media (max-width: 640px) { .door { grid-template-columns: 1fr; gap: 1.8rem; } }
form.toolbar { flex-direction: row; margin-top: 0.5rem; }
input {
  padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--ink); font-size: 1rem; flex: 1;
}
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button {
  padding: 0.55rem 1rem; border: none; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 0.95rem; font-weight: 600;
}
button.ghost { background: var(--panel2); color: var(--ink); font-weight: 500; }
button.ghost.danger { color: var(--danger); }
.tabs { display: flex; gap: 0.4rem; }
.tabs button[data-tab] { background: var(--panel2); color: var(--muted); }
.tabs button.active { background: var(--accent); color: #fff; }
.reload-pill { background: var(--accent); color: #fff; font-size: 0.85rem; padding: 0.4rem 0.8rem; }
.toolbar { display: flex; gap: 0.5rem; margin: 1rem 0; align-items: center; }
.hidden-input { display: none; }
.filelist { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.filerow {
  display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 1rem; align-items: center;
  padding: 0.6rem 0.9rem; background: var(--panel);
}
.fthumb {
  width: 40px; height: 40px; object-fit: cover; border-radius: 6px;
  background: var(--panel2); display: block;
}
.fthumb.glyph {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.9rem;
}
.fthumb.glyph svg { width: 20px; height: 20px; }
.spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 2.4s; }
}
.fname.linklike {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  color: var(--accent); font: inherit; font-weight: 500; text-align: left;
  overflow-wrap: anywhere;
}
.uploads .filerow.uploading { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.4rem; }
/* Not-yet-real rows (uploading, from any device) read as greyed out —
   the text dims, the progress bar stays vivid. */
.filerow.uploading .fname, .filerow.uploading .fsize { color: var(--muted); font-weight: 400; }
.filerow.uploading .fthumb.glyph { opacity: 0.5; }
.progress {
  display: block; height: 6px; border-radius: 3px; background: var(--panel2);
  overflow: hidden; min-width: 8rem;
}
.progress-bar {
  display: block; height: 100%; background: var(--accent);
  transition: width 0.2s ease;
}
.fsize.error { color: var(--danger); }
button.danger-solid { background: var(--danger); color: #fff; }
button.danger-solid[disabled] { opacity: 0.4; cursor: default; }
.selectall { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.9rem; }
.trash .filerow { grid-template-columns: 1fr auto auto auto; }
.trashpick { display: flex; align-items: center; gap: 1rem; cursor: pointer; min-width: 0; }
.trashpick .fname { overflow-wrap: anywhere; }
.viewer {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem; gap: 0.8rem;
}
.viewer-bar {
  display: flex; align-items: center; gap: 1rem; color: #fff;
  width: 100%; max-width: 60rem; justify-content: space-between;
}
.viewer-name { overflow-wrap: anywhere; }
.viewer-media {
  max-width: 100%; max-height: 85vh; border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}
.filerow + .filerow { border-top: 1px solid var(--border); }
.fname { font-weight: 500; overflow-wrap: anywhere; }
.fsize, .ftime { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.factions { display: flex; gap: 0.4rem; }
.factions button { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.empty, .status { color: var(--muted); }
.status:empty { display: none; }
pre.kit {
  background: var(--panel2); border: 1px dashed var(--border); border-radius: 10px;
  padding: 1rem; font-size: 1.05rem; user-select: all; overflow-x: auto;
}
.tiles { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.4rem; min-width: 10rem; }
.tile-value { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; }
.tile-label { color: var(--muted); font-size: 0.85rem; }
@media (max-width: 640px) {
  .filerow { grid-template-columns: 1fr auto; }
  .ftime { display: none; }
}
