:root {
  --bg: #0f1419;
  --bg2: #1a2332;
  --card: #1e2a3a;
  --border: #2d3d52;
  --text: #e8eef5;
  --muted: #8b9cb3;
  --accent: #6b8cae;
  --accent2: #4a6d8c;
  --steel: #7a92a8;
  --danger: #c97070;
  --chip: #243447;
  --folder: #8fa8c0;
  --file: #a8b8c8;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: "Segoe UI", system-ui, sans-serif; }
.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(ellipse at 30% 20%, #1a2838 0%, var(--bg) 60%); }
.login-card { width: min(400px, 92vw); background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 2rem; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.brand { text-align: center; margin-bottom: 1.5rem; }
.mark { font-size: 2rem; color: var(--steel); }
.brand h1 { margin: .4rem 0 0; font-weight: 600; letter-spacing: .04em; }
.sub { color: var(--muted); margin: .25rem 0 0; font-size: .9rem; }
label { display: block; font-size: .8rem; color: var(--muted); margin: .75rem 0 .3rem; }
input { width: 100%; padding: .65rem .8rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); }
button { margin-top: 1.1rem; width: 100%; padding: .7rem; border: 0; border-radius: 8px; background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #fff; font-weight: 600; cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
.error { color: var(--danger); font-size: .85rem; margin-top: .75rem; }
.fine { text-align: center; color: var(--muted); font-size: .75rem; margin-top: 1.25rem; }

.app-header { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: .85rem 1.25rem; background: var(--bg2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.app-header .left { display: flex; align-items: center; gap: .75rem; }
.app-header h1 { font-size: 1.1rem; margin: 0; font-weight: 600; }
.banner { background: #243040; border-bottom: 1px solid var(--border); color: var(--steel); font-size: .82rem; padding: .55rem 1.25rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; padding: .75rem 1.25rem; align-items: center; border-bottom: 1px solid var(--border); background: #121820; }
.toolbar input[type=search] { flex: 1; min-width: 180px; padding: .5rem .7rem; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .8rem; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; font-size: .85rem; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent2); border-color: var(--accent); }
.stats { display: flex; flex-wrap: wrap; gap: .5rem; padding: .65rem 1.25rem; }
.stat { background: var(--chip); border: 1px solid var(--border); border-radius: 999px; padding: .25rem .7rem; font-size: .78rem; color: var(--muted); }
.stat strong { color: var(--text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0 1.25rem .75rem; }
.chip { background: var(--chip); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .65rem; font-size: .75rem; color: var(--steel); cursor: pointer; user-select: none; }
.chip.active { background: var(--accent2); color: #fff; border-color: var(--accent); }
.layout { display: grid; grid-template-columns: 1fr; gap: 0; padding: 0 0 2rem; }
@media (min-width: 960px) { .layout { grid-template-columns: 1fr 320px; } }
.tree-panel { padding: .5rem 1rem 2rem; overflow: auto; max-height: calc(100vh - 220px); }
.side-panel { padding: 1rem; border-left: 1px solid var(--border); background: #121820; }
.tree ul { list-style: none; margin: 0; padding-left: 1rem; }
.tree > ul { padding-left: 0; }
.tree li { margin: .1rem 0; }
.node { display: flex; align-items: center; gap: .35rem; padding: .2rem .35rem; border-radius: 6px; cursor: pointer; }
.node:hover { background: #243040; }
.node .tw { width: 1rem; color: var(--muted); flex: 0 0 auto; user-select: none; }
.node .ico { width: 1.1rem; text-align: center; color: var(--folder); flex: 0 0 auto; }
.node.file .ico { color: var(--file); }
.node .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.node .meta { color: var(--muted); font-size: .72rem; margin-left: .35rem; }
.badge { font-size: .65rem; padding: .05rem .35rem; border-radius: 4px; background: #2a3a4c; color: var(--steel); }
.badge.shared { background: #3a4558; color: #b0c4d8; }
.hidden { display: none !important; }
.note { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.note code { color: var(--steel); }

/* --- auth UX (2026-11-05) --- */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.8rem; }
.eye { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); width: auto; margin: 0; padding: .3rem .45rem; background: none; color: var(--muted); font-size: 1.1rem; font-weight: 400; }
.eye:hover { color: var(--text); }
.links { display: flex; justify-content: space-between; gap: .5rem; margin-top: .9rem; font-size: .82rem; }
.links a, a.link { color: var(--accent); text-decoration: none; cursor: pointer; }
.links a:hover, a.link:hover { text-decoration: underline; }
textarea { width: 100%; padding: .65rem .8rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); font: inherit; resize: vertical; min-height: 4.5rem; }
.success { color: #8fd0a8; font-size: .85rem; margin-top: .75rem; line-height: 1.4; }
.panel-title { font-size: 1rem; margin: 0 0 .25rem; }
.panel-sub { color: var(--muted); font-size: .82rem; margin: 0 0 .5rem; line-height: 1.4; }

.notes-fold { border: 1px solid var(--border); border-radius: 10px; background: var(--card); padding: .55rem .75rem; }
.notes-fold summary { cursor: pointer; color: var(--steel); font-size: .9rem; font-weight: 600; list-style: none; }
.notes-fold summary::-webkit-details-marker { display: none; }
.notes-fold summary::before { content: "▶ "; font-size: .7rem; color: var(--muted); }
.notes-fold[open] summary::before { content: "▼ "; }
.notes-fold .note { margin: .65rem 0 0; }
@media (min-width: 960px) {
  .notes-fold { border: 0; background: transparent; padding: 0; }
  .notes-fold summary { pointer-events: none; }
  .notes-fold summary::before { content: ""; }
  .notes-fold:not([open]) .note { display: block; }
  .notes-fold .note { margin-top: .5rem; }
}
