:root {
  --ink: #18181b;
  --ink-soft: #52525b;
  --ink-faint: #a1a1aa;
  --bg: #faf9f6;
  --surface: #ffffff;
  --line: #ece9e1;
  --line-soft: #f1efe8;
  --accent: #ffc400;        /* Weekday gold */
  --accent-ink: #18181b;
  --accent-soft: #fff6d6;
  --danger: #dc2626;
  --link: #b45309;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(24,24,27,.04), 0 8px 24px rgba(24,24,27,.05);
  --shadow-lg: 0 12px 40px rgba(24,24,27,.12);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

/* ----- buttons ----- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 550;
  transition: all .15s ease;
}
.btn:hover { border-color: var(--ink-faint); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn.primary:hover { box-shadow: 0 6px 18px rgba(255,196,0,.35); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--danger); border-color: transparent; }
.btn.danger:hover { background: #fef2f2; border-color: #fecaca; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.sm { padding: 6px 12px; font-size: 13px; }

/* ----- sign-in ----- */
.signin-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 80% -10%, #fff7d9 0%, rgba(255,247,217,0) 55%),
    radial-gradient(900px 500px at 0% 110%, #fdeccd 0%, rgba(253,236,205,0) 50%),
    var(--bg);
}
.signin-card {
  width: 100%; max-width: 460px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 22px; padding: 40px;
  box-shadow: var(--shadow-lg);
}
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center; font-weight: 800; color: var(--accent-ink);
  font-size: 17px; box-shadow: 0 2px 8px rgba(255,196,0,.4);
}
.logo-word { font-size: 19px; font-weight: 750; letter-spacing: -.01em; }
.logo-by { color: var(--ink-faint); font-weight: 500; font-size: 13px; margin-left: 2px; }
.signin-card h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; margin: 6px 0 14px; }
.signin-card p.lede { color: var(--ink-soft); font-size: 15px; margin: 0 0 8px; }
.signin-actions { margin-top: 26px; display: flex; flex-direction: column; gap: 14px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-faint); font-size: 12px; margin: 4px 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.dev-login { display: flex; gap: 8px; }
.dev-login input { flex: 1; }
.restricted { margin-top: 26px; font-size: 12.5px; color: var(--ink-faint); }
.restricted code { background: var(--accent-soft); color: var(--link); padding: 1px 6px; border-radius: 5px; font-family: var(--mono); }
.err { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ----- inputs ----- */
input[type=text], input[type=email], textarea, .field {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  padding: 10px 13px; font-size: 14px; font-family: inherit; color: var(--ink); width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0 0 6px; }

/* ----- top bar ----- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(250,249,246,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 13px 24px;
  display: flex; align-items: center; gap: 18px;
}
.nav { display: flex; gap: 4px; margin-left: 14px; }
.nav button {
  border: none; background: transparent; color: var(--ink-soft);
  padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 550;
}
.nav button:hover { background: var(--line-soft); color: var(--ink); }
.nav button.active { background: var(--ink); color: #fff; }
.spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent);
  color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background-size: cover; background-position: center; overflow: hidden;
}
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.avatar.xs { width: 20px; height: 20px; font-size: 10px; margin-left: -7px; border: 2px solid var(--bg); }

/* ----- main ----- */
.main { max-width: 1080px; margin: 0 auto; padding: 36px 24px 80px; }
.page-head { margin-bottom: 26px; }
.page-head h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; }
.page-head p { color: var(--ink-soft); margin: 0; font-size: 15px; }

/* ----- upload ----- */
.seg { display: inline-flex; background: var(--line-soft); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; padding: 6px 15px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.dropzone {
  margin-top: 18px; border: 1.5px dashed var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 56px 24px; text-align: center; transition: all .15s ease; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone h3 { font-size: 19px; margin: 0 0 6px; font-weight: 650; }
.dropzone .hint { color: var(--ink-soft); font-size: 14px; }
.dropzone .exts { color: var(--ink-faint); font-size: 12.5px; font-family: var(--mono); margin-top: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 220px; }
.actions-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px; font-weight: 550; color: var(--ink-soft); background: var(--line-soft);
  border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px;
}
.tag.click { cursor: pointer; }
.tag.click:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--link); }
.tag.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.meta-preview { margin-top: 18px; }
.meta-preview .auto { font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }

/* ----- browse ----- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.search { flex: 1; min-width: 240px; position: relative; }
.search input { padding-left: 38px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }
.tagbar { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 22px; }
.doc-list { display: flex; flex-direction: column; }
.doc-item {
  border-bottom: 1px solid var(--line-soft); padding: 20px 4px; display: flex; gap: 18px;
}
.doc-item:hover { background: rgba(255,196,0,.03); }
.doc-main { flex: 1; min-width: 0; }
.doc-title { font-size: 17.5px; font-weight: 650; letter-spacing: -.01em; cursor: pointer; }
.doc-title:hover { color: var(--link); }
.doc-desc { color: var(--ink-soft); font-size: 14px; margin: 5px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-side { width: 240px; flex-shrink: 0; text-align: right; }
.doc-by { display: flex; align-items: center; justify-content: flex-end; gap: 7px; font-size: 12.5px; color: var(--ink-soft); }
.fmt-badge { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.doc-side .tags { justify-content: flex-end; margin: 10px 0; }
.doc-links { display: flex; gap: 12px; justify-content: flex-end; font-size: 13px; }
.doc-links a, .doc-links button { font-size: 13px; color: var(--ink-soft); background: none; border: none; padding: 0; }
.doc-links a:hover, .doc-links button:hover { color: var(--ink); text-decoration: underline; cursor: pointer; }
.doc-links button.del:hover { color: var(--danger); }
.empty { text-align: center; padding: 70px 20px; color: var(--ink-faint); }
.empty h3 { color: var(--ink-soft); font-weight: 600; }

/* ----- doc view ----- */
.doc-view { display: grid; grid-template-columns: 1fr 280px; gap: 36px; align-items: start; }
.doc-article { min-width: 0; }
.back { color: var(--ink-soft); font-size: 14px; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 18px; background: none; border: none; }
.back:hover { color: var(--ink); }
.doc-article h1.title { font-size: 30px; letter-spacing: -.02em; margin: 0 0 10px; }
.doc-byline { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 13.5px; margin-bottom: 18px; flex-wrap: wrap; }
.share-box {
  display: flex; gap: 8px; align-items: center; background: var(--accent-soft);
  border: 1px solid #f5e3a8; border-radius: var(--radius-sm); padding: 8px 8px 8px 14px; margin-bottom: 26px;
}
.share-box code { flex: 1; font-family: var(--mono); font-size: 13px; color: var(--link); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prose {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 40px; box-shadow: var(--shadow);
}
.prose h1, .prose h2, .prose h3 { letter-spacing: -.01em; line-height: 1.25; margin: 1.4em 0 .5em; }
.prose h1 { font-size: 26px; } .prose h2 { font-size: 21px; } .prose h3 { font-size: 17px; }
.prose p, .prose li { font-size: 15.5px; line-height: 1.7; color: #27272a; }
.prose pre { background: #1c1c1f; color: #f4f4f5; padding: 16px; border-radius: 10px; overflow: auto; font-family: var(--mono); font-size: 13px; }
.prose code { background: var(--line-soft); padding: 2px 6px; border-radius: 5px; font-family: var(--mono); font-size: .9em; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--line-soft); }
.prose img { max-width: 100%; border-radius: 8px; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding: 4px 0 4px 18px; color: var(--ink-soft); }
.prose a { color: var(--link); }

.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.side-card h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.ver { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.ver:last-child { border-bottom: none; }
.ver .vno { font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; height: fit-content; font-size: 12px; }
.ver .vmeta { color: var(--ink-soft); }
.ver.active .vno { background: var(--accent); }
.ver button.vopen { background: none; border: none; text-align: left; padding: 0; cursor: pointer; color: inherit; }
.ver button.vopen:hover .vmeta { color: var(--ink); }

.comment { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.comment:last-child { border-bottom: none; }
.comment .chead { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.comment .cname { font-weight: 600; }
.comment .ctime { color: var(--ink-faint); font-size: 12px; }
.comment .cbody { font-size: 14px; color: #27272a; white-space: pre-wrap; }
.comment-form { margin-top: 12px; }
.comment-form textarea { min-height: 70px; resize: vertical; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; transition: all .2s ease; z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.loading { text-align: center; padding: 80px; color: var(--ink-faint); }

/* ----- write editor (rich + markdown) ----- */
.md-area { min-height: 320px; width: 100%; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.quill-wrap .ql-container.ql-bubble { border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: var(--font); font-size: 16px; }
.quill-wrap .ql-editor { min-height: 340px; line-height: 1.75; color: #27272a; padding: 18px 20px 18px 44px; }
.quill-wrap .ql-editor.ql-blank::before { color: var(--ink-faint); font-style: normal; left: 44px; right: 20px; }
.kb-plus { position: absolute; left: 10px; width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 20px; line-height: 1; cursor: pointer; user-select: none; background: transparent; z-index: 6; transition: background .12s ease, color .12s ease; }
.kb-plus:hover { background: var(--line-soft); color: var(--ink); }
.quill-wrap .ql-editor h1 { font-size: 26px; } .quill-wrap .ql-editor h2 { font-size: 21px; } .quill-wrap .ql-editor h3 { font-size: 17px; }
.quill-wrap .ql-editor a { color: var(--link); }
.ql-bubble .ql-tooltip { z-index: 60; }

/* unfurled embeds (bookmark cards + inline video) — used in editor and read view */
.kb-embed-wrap { margin: 14px 0; }
.kb-embed.kb-video { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 12px; overflow: hidden; }
.kb-embed.kb-video iframe, .kb-embed.kb-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.kb-bookmark { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease; }
.kb-bookmark:hover { border-color: var(--ink-faint); box-shadow: var(--shadow); text-decoration: none; }
.kb-bm-text { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.kb-bm-title { font-weight: 650; color: var(--ink); font-size: 15px; }
.kb-bm-desc { color: var(--ink-soft); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-bm-url { color: var(--ink-faint); font-size: 12px; margin-top: 2px; }
.kb-bm-img { width: 200px; object-fit: cover; flex-shrink: 0; }
.kb-bookmark { min-height: 104px; }
.kb-bm-title { font-size: 16px; }
.kb-hr { border: none; border-top: 1px solid var(--line); margin: 6px 0; }

/* uploaded file previews (large) */
.kb-file-media { margin: 14px 0; }
.kb-file-img { display: block; max-width: 100%; max-height: 540px; border-radius: 12px; border: 1px solid var(--line); }
.kb-file-pdf { width: 100%; height: 580px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.kb-file-cap { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.kb-file { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--surface); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.kb-file:hover { border-color: var(--ink-faint); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.kb-file-ic { font-size: 28px; }
.kb-file-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.kb-file-name { font-weight: 650; color: var(--ink); }
.kb-file-sub { font-size: 12px; color: var(--ink-faint); }
.kb-file-dl { font-size: 13px; font-weight: 600; color: var(--link); }

/* Google Doc / Sheet / Slides live preview */
.kb-gdoc { position: relative; width: 100%; padding-top: 72%; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.kb-gdoc iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.kb-doc { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; overflow-x: auto; background: var(--surface); }
.kb-doc :first-child { margin-top: 0; }
.kb-doc table { border-collapse: collapse; width: 100%; font-size: 14px; }
.kb-doc th, .kb-doc td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; }
.kb-doc th { background: var(--line-soft); font-weight: 650; }
.kb-doc h1, .kb-doc h2, .kb-doc h3 { letter-spacing: -.01em; }
@media (max-width: 560px) { .kb-bm-img { width: 96px; } }

/* slash command menu (Notion-style) */
.slash-menu { position: absolute; z-index: 100; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; width: 300px; max-height: 340px; overflow: auto; }
.slash-group { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); padding: 8px 10px 4px; }
.slash-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.slash-item.on, .slash-item:hover { background: var(--line-soft); }
.slash-ic { width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink); }
.slash-label { font-size: 14px; font-weight: 550; color: var(--ink); flex: 1; }
.slash-hint { font-size: 12px; color: var(--ink-faint); font-family: var(--mono); }
.slash-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; margin-top: 4px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.slash-foot:hover { color: var(--ink); }

/* ----- visibility + source badges ----- */
.vis-badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 4px; }
.vis-badge.org { background: #eef6ff; border-color: #d6e8fb; color: #1d4ed8; }
.vis-badge.priv { background: #f4f4f5; border-color: var(--line); color: var(--ink-soft); }
.vis-badge.team { background: var(--accent-soft); border-color: #f0dd9a; color: var(--link); }
.src-badge { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #1a73e8; background: #e8f0fe; border: 1px solid #d2e3fc; border-radius: 5px; padding: 1px 6px; }
a.src-badge:hover { text-decoration: none; background: #d2e3fc; }
.src-badge.vid { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }

/* ----- video embed (16:9 responsive) ----- */
.video-embed { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.video-embed iframe, .video-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed.file { background: #000; }

/* ----- visibility picker ----- */
.vis-card { margin-top: 18px; }
.vis-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.vis-opt { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; display: flex; gap: 9px; align-items: flex-start; transition: all .12s ease; }
.vis-opt:hover { border-color: var(--ink-faint); }
.vis-opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.vis-opt input { margin-top: 3px; accent-color: var(--ink); }
.vis-opt span { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.vis-opt small { color: var(--ink-faint); font-weight: 400; font-size: 11.5px; line-height: 1.35; }

/* ----- teams ----- */
h4.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin: 0 0 6px; }
.team-row .doc-side { width: 120px; }
.team-row .doc-links { justify-content: flex-end; }

@media (max-width: 820px) {
  .vis-options { grid-template-columns: 1fr; }
  .doc-view { grid-template-columns: 1fr; }
  .doc-item { flex-direction: column; gap: 12px; }
  .doc-side { width: 100%; text-align: left; }
  .doc-by, .doc-side .tags, .doc-links { justify-content: flex-start; }
  .nav { display: none; }
}

/* =====================================================================
   Playful Weekday polish + interaction animations
   ===================================================================== */
body {
  background:
    radial-gradient(1100px 520px at 100% -8%, #fff6d0 0%, rgba(255,246,208,0) 55%),
    radial-gradient(900px 480px at -5% 105%, #fdeccd 0%, rgba(253,236,205,0) 55%),
    var(--bg);
  background-attachment: fixed;
}
@keyframes kb-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes kb-pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes kb-pop-in { 0% { transform: scale(.82); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@keyframes kb-float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-3deg); } }
.main > * { animation: kb-fade-up .38s cubic-bezier(.2,.7,.2,1) both; }
.page-head { animation-delay: .02s; }
.doc-list .doc-item { animation: kb-fade-up .34s cubic-bezier(.2,.7,.2,1) both; }
.doc-list .doc-item:nth-child(2) { animation-delay: .04s; }
.doc-list .doc-item:nth-child(3) { animation-delay: .08s; }
.doc-list .doc-item:nth-child(4) { animation-delay: .12s; }
.doc-list .doc-item:nth-child(5) { animation-delay: .16s; }
.doc-list .doc-item:nth-child(n+6) { animation-delay: .2s; }
.btn { transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease; }
.btn:active { transform: translateY(1px) scale(.97); }
.btn.primary:hover { transform: translateY(-1px); }
.nav button { transition: background .18s ease, color .18s ease, transform .12s ease; }
.nav button:active { transform: scale(.95); }
.nav button.active { animation: kb-pop-in .26s ease; }
.logo-mark { transition: transform .25s cubic-bezier(.2,.8,.2,1); box-shadow: 0 2px 10px rgba(255,196,0,.45); }
.brand-row:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }
.card { transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.doc-item { transition: background .15s ease, transform .12s ease; border-radius: 10px; }
.doc-item:hover { transform: translateX(2px); }
.doc-title { transition: color .15s ease; }
.tag { transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease; }
.tag.click:hover { transform: translateY(-1px); }
.tag.click:active { transform: scale(.94); }
.avatar { transition: transform .15s ease; }
.user-chip:hover .avatar { transform: scale(1.07) rotate(3deg); }
.slash-menu { animation: kb-pop .15s ease; }
.slash-item { transition: background .12s ease; }
.kb-plus { transition: background .12s ease, color .12s ease, transform .12s ease; }
.kb-plus:hover { transform: scale(1.15); }
.signin-card { animation: kb-pop .4s cubic-bezier(.2,.8,.2,1); }
.empty-emoji { font-size: 44px; margin-bottom: 10px; display: inline-block; animation: kb-float 3s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* recents / notes list (Apple Notes style) */
.saved-status { font-size: 12.5px; color: var(--ink-faint); margin-right: auto; align-self: center; transition: opacity .2s ease; }
.notes-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.note-row { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .12s ease; }
.note-row:last-child { border-bottom: none; }
.note-row:hover { background: var(--accent-soft); }
.note-main { flex: 1; min-width: 0; }
.note-title { font-weight: 600; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-sub { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.note-tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.note-tag.draft { background: var(--accent-soft); color: var(--link); border: 1px solid #f0dd9a; }
.note-tag.pub { background: #eef6ff; color: #1d4ed8; border: 1px solid #d6e8fb; }
.note-del { border: none; background: transparent; color: var(--ink-faint); font-size: 18px; line-height: 1; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .12s ease, background .12s ease, color .12s ease; }
.note-row:hover .note-del { opacity: 1; }
.note-del:hover { background: #fef2f2; color: var(--danger); }

/* raw URL shown under an unfurled embed (easy to copy) */
.kb-srcline { margin: 6px 0 2px; font-size: 12px; font-family: var(--mono); }
.kb-srcline a { color: var(--ink-faint); word-break: break-all; text-decoration: none; }
.kb-srcline a:hover { color: var(--link); text-decoration: underline; }
