:root {
  --navy: #284D72;
  --teal: #6DC5AE;
  --coral: #D9534F;
  --text: #1f2933;
  --muted: #6b7280;
  --bg: #f7f9fb;
  --card: #ffffff;
  --line: #e3e8ee;
  --focus: rgba(109, 197, 174, 0.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
.wordmark {
  font-weight: 700; letter-spacing: 0.18em; color: var(--navy); font-size: 15px;
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
}
.wordmark img { width: 26px; height: 26px; }
.muted { color: var(--muted); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 32px 28px; box-shadow: 0 10px 30px rgba(40, 77, 114, 0.06);
}
.login-card h1 { font-size: 22px; margin: 22px 0 6px; color: var(--navy); }
.login-card p { margin: 0 0 22px; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input[type="text"] {
  width: 100%; padding: 12px 14px; font-size: 17px; letter-spacing: 0.08em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase;
  border: 1px solid #cbd3dc; border-radius: 8px; background: #fff; color: var(--text);
}
input[type="text"]:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--focus); }
button {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid transparent;
}
.btn-primary {
  width: 100%; margin-top: 14px; padding: 12px; background: var(--navy); color: #fff; font-weight: 600;
}
.btn-primary:hover { background: #1f3e5d; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-ghost { background: transparent; border-color: var(--line); padding: 6px 12px; color: var(--text); font-size: 14px; }
.btn-ghost:hover { border-color: #cbd3dc; }
.error { color: var(--coral); font-size: 14px; min-height: 21px; margin-top: 10px; }
.fineprint { font-size: 13px; margin-top: 18px; }

/* Room */
header.top {
  background: var(--card); border-bottom: 1px solid var(--line);
}
.top-inner, main.room { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; }
main.room { padding-top: 36px; padding-bottom: 64px; }
main.room h1 { color: var(--navy); font-size: 28px; margin: 0 0 6px; }
.intro { margin: 0 0 32px; max-width: 640px; }
.empty { padding: 24px; border: 1px dashed #cbd3dc; border-radius: 10px; text-align: center; }
footer.legal { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; margin-top: 40px; }

/* Buttons on documents */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 88px; padding: 8px 14px;
  border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; border: 1px solid transparent;
}
.btn-view { background: var(--navy); color: #fff; }
.btn-view:hover { background: #1f3e5d; }
.btn-download { background: #fff; color: var(--navy); border-color: #cbd3dc; }
.btn-download:hover { border-color: var(--navy); }
.btn:focus-visible, a.title:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); border-radius: 4px; }

/* Toolbar above the folders */
.folder-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.folder-bar .totals { font-size: 14px; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--navy); font-size: 14px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); border-radius: 4px; }
.team-note { font-size: 13px; color: var(--muted); margin: -2px 0 14px; }

/* A folder: one card with a clickable heading row, its documents inside */
details.folder { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
details.folder > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
details.folder > summary::-webkit-details-marker { display: none; }
details.folder > summary:hover { background: #f9fbfc; }
details.folder > summary:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--focus); }
details.folder[open] > summary { border-bottom: 1px solid var(--line); }
details.folder .num {
  flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(40, 77, 114, 0.08); color: var(--navy); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
}
details.folder .head { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
details.folder h2 { margin: 0; font-size: 16px; font-weight: 650; color: var(--text); }
details.folder .count { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 10px; }
details.folder .count-todo { color: #8a6a1f; }
details.folder .chev {
  flex: none; width: 10px; height: 10px; margin-right: 4px; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s ease;
}
details.folder[open] .chev { transform: rotate(45deg); }

/* Documents inside a folder: a flat list with dividers */
.folder-docs { list-style: none; margin: 0; padding: 0; }
.doc { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); }
.doc:first-child { border-top: 0; }
.doc .icon {
  flex: none; width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(109, 197, 174, 0.16); color: var(--navy); font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}
.doc .body { flex: 1; min-width: 0; }
.doc .title { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.title:hover { color: var(--navy); text-decoration: underline; }
.doc .desc { font-size: 14px; color: #4b5563; margin-top: 2px; }
.doc .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.doc .actions { flex: none; display: flex; gap: 8px; }

/* A document still to be uploaded: one quiet line, aligned with the titles above */
.doc.placeholder { padding: 10px 18px 10px 72px; justify-content: space-between; background: #fbfcfd; }
.doc.placeholder .title { font-weight: 500; color: var(--muted); font-size: 15px; }
.tag {
  flex: none; font-size: 12px; font-weight: 600; color: #8a6a1f; background: #fdf3dc; border: 1px solid #f1dfb2;
  border-radius: 999px; padding: 2px 9px;
}

@media (max-width: 600px) {
  .top-inner, main.room { padding-left: 16px; padding-right: 16px; }
  .who .name { display: none; }
  main.room h1 { font-size: 24px; }
  details.folder > summary { padding: 12px 14px; gap: 12px; }
  .doc { flex-wrap: wrap; align-items: flex-start; padding: 14px; }
  .doc .body { flex: 1 1 calc(100% - 56px); }
  .doc .actions { width: 100%; }
  .doc .actions .btn { flex: 1; }
  .doc.placeholder { flex-wrap: nowrap; align-items: center; padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) { details.folder .chev { transition: none; } }
