/* app.css — tinyfiles screens: file rows + grid, space bar, upload bar, viewer, settings rows, share page.
   Tokens come from styles.css; the glass layer from glass.css. */

.gbtn.accent { color: var(--accent-fg); }
.gbtn.dark { background: rgba(60, 60, 64, .55); color: #fff; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.pt-sub { margin: -2px 0 8px; color: var(--ink-2); font-size: 15px; }
.empty { text-align: center; color: var(--ink-2); padding: 48px 16px; }
.hd { font: 700 10px/1 var(--body); color: #fff; background: var(--accent); border-radius: 4px; padding: 2px 4px; vertical-align: 1px; font-style: normal; letter-spacing: .3px; }
.spin { animation: mfspin .9s linear infinite; }
@keyframes mfspin { to { transform: rotate(360deg); } }

/* ---------- space bar (My Files / team) ---------- */
.spacebar { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; cursor: pointer;
  background: var(--surface); border-radius: var(--r-group); padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 14px; }
.sb-ic { width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-fg); display: grid; place-items: center; }
.sb-ic svg { width: 22px; height: 22px; }
.sb-main { flex: 1; min-width: 0; display: grid; }
.sb-main b { font-size: 17px; } .sb-main small { color: var(--ink-2); font-size: 13px; }
.sb-chev { color: var(--ink-2); } .sb-chev svg { width: 18px; height: 18px; }

/* ---------- file rows ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-group); box-shadow: var(--shadow); overflow: hidden; }
.list.plain { background: none; box-shadow: none; }
.list.drop { outline: 3px dashed var(--accent); outline-offset: -3px; }
.node { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 14px; min-height: 60px; border-top: 1px solid var(--line); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.node:first-child { border-top: 0; }
.node:active { background: var(--raised); }
.n-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 9px; overflow: hidden; }
.n-ic { position: relative; }
.n-ic img { width: 100%; height: 100%; object-fit: cover; }
.n-play { position: absolute; right: 3px; bottom: 3px; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; }
.n-play svg { width: 9px; height: 9px; }
.list.grid .n-play { width: 24px; height: 24px; right: 6px; bottom: 6px; } .list.grid .n-play svg { width: 12px; height: 12px; }
.n-ic.has-thumb > svg { display: none; }
.fglyph { width: 36px; height: 36px; }
.n-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.n-main b { font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-main small { color: var(--ink-2); font-size: 13px; }
.n-star { color: var(--orange); display: grid; } .n-star svg { width: 16px; height: 16px; }
.n-more { color: var(--ink-2); }
.node.share .n-ic { color: var(--accent-fg); } .node.share .n-ic svg { width: 24px; height: 24px; }
.node.folder .n-ic > svg:not(.fglyph) { width: 26px; height: 26px; color: var(--accent-fg); }
.node.share .btn.small svg { width: 16px; height: 16px; }

/* grid */
.list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; background: none; box-shadow: none; overflow: visible; }
.list.grid .node { flex-direction: column; gap: 6px; padding: 10px 8px 8px; border: 0; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); align-items: stretch; position: relative; }
.list.grid .n-ic { width: 100%; height: 92px; border-radius: 10px; background: var(--raised); }
.list.grid .fglyph { width: 56px; height: 56px; }
.list.grid .n-main b { font-size: 13px; text-align: center; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list.grid .n-main small { text-align: center; font-size: 11px; }
.list.grid .n-more { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.35); color: #fff; border-radius: 50%; padding: 4px; }
.list.grid .n-more svg { width: 16px; height: 16px; }
.list.grid .n-star { position: absolute; top: 8px; left: 8px; }

/* ---------- search ---------- */
.searchbar { display: flex; align-items: center; gap: 10px; background: var(--raised); border-radius: 14px; padding: 0 12px; margin-bottom: 14px; color: var(--ink-2); }
.searchbar svg { width: 18px; height: 18px; flex: none; }
.searchbar input { background: none; border: 0; padding: 12px 0; min-height: 44px; }
.searchbar input:focus { outline: 0; }

/* ---------- upload bar ---------- */
.upbar { position: fixed; left: max(14px, calc(50% - 260px)); right: max(14px, calc(50% - 260px)); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 19; background: var(--surface); border-radius: 18px; padding: 10px 14px 12px; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
/* Crumbs downloads (downloader.js): same card; sits above the upload bar when both show; no tab bar on share pages */
/* the upload bar: a stuck upload's text opens its crumb map; "Upload not complete" gets a warning sign */
.up-pow { margin: 6px 0 0; font-size: 10.5px; letter-spacing: .02em; color: var(--ink-2); text-align: right; opacity: .8; } .up-pow.center { text-align: center; margin-top: 2px; }
.up-tap { background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.up-ic .warn { color: var(--orange, #e8890c); display: grid; } .up-ic .warn svg { width: 20px; height: 20px; }

/* crumb map (crumbmap.js): crumbs on the floor (green, on your server) vs still on the table (grey) */
.cm { display: grid; gap: 14px; }
.cm-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cm-pct { font-size: 34px; font-weight: 700; letter-spacing: -.02em; color: var(--accent-fg); }
.cm-top span { color: var(--ink-2); font-size: 14px; }
.cm-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 4px; padding: 12px; border-radius: 16px; background: var(--raised); }
.cm-map i, .cm-key i { display: block; aspect-ratio: 1; border-radius: 4px 5px 3px 6px; background: color-mix(in srgb, var(--ink-2) 22%, transparent); transform: rotate(calc(var(--r, 0) * 4deg - 12deg)) scale(.86); }
.cm-map i.on, .cm-key i.on { background: var(--accent); transform: rotate(calc(var(--r, 0) * 4deg - 12deg)); }
.cm-map i.some { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.cm-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 13px; color: var(--ink-2); }
.cm-key span { display: inline-flex; align-items: center; gap: 6px; } .cm-key i { width: 12px; }
.btn.red { color: var(--red); }

/* crumbs in action (crumblive.js): lanes of crumbs in the air, table → floor, over the whole-file crumb map */
.cl { display: grid; gap: 12px; }
.cl-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cl-pct { font-size: 34px; font-weight: 700; letter-spacing: -.02em; color: var(--accent-fg); font-variant-numeric: tabular-nums; }
.cl-stat { color: var(--ink-2); font-size: 14px; }
.cl-speed { margin: -6px 0 0; min-height: 1.3em; }
.cl-sky { display: grid; gap: 0; padding: 10px 12px; border-radius: 16px; background: var(--raised); }
.cl-end { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 12px; }
.cl-end span { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cl-end svg { width: 18px; height: 18px; }
.cl-end b { color: var(--ink); font-size: 13px; }
.cl-table { padding-bottom: 8px; border-bottom: 3px solid color-mix(in srgb, var(--ink-2) 35%, transparent); }   /* the table top */
.cl-floor { padding-top: 8px; border-top: 3px solid var(--accent); }                                           /* the floor */
.cl-floor span { color: var(--accent-fg); }
.cl-lanes { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); height: 170px; }
.cl-lane { position: relative; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--ink-2) 22%, transparent) 0 6px, transparent 6px 12px) center / 2px 100% no-repeat; }
.cl-crumb { position: absolute; left: 50%; top: calc(var(--p, 0) * (100% - 26px)); width: 36px; height: 26px; margin-left: -18px; border-radius: 9px 11px 8px 12px;
  background: linear-gradient(180deg, var(--accent) calc(var(--p, 0) * 100%), color-mix(in srgb, var(--accent) 35%, var(--surface)) 0);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 35%, transparent); transition: top .12s linear; animation: cl-bob 1.1s ease-in-out infinite; display: grid; place-items: center; }
.cl-crumb.landed { top: calc(100% - 22px); height: 22px; background: var(--accent); animation: cl-squish .5s ease-out both; }
@keyframes cl-squish { 0% { transform: scale(1.1, .7); } 60% { transform: scale(.95, 1.05); } 100% { transform: none; opacity: .6; } }
.cl-crumb[hidden] { display: none; }
.cl-crumb b { font-size: 10px; font-weight: 700; color: var(--accent-ink, #fff); font-variant-numeric: tabular-nums; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.cl-quiet { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; font-size: 13px; color: var(--ink-2); pointer-events: none; text-align: center; }
@keyframes cl-bob { 50% { transform: rotate(-6deg); } }
.cm-map i.air, .cm-key i.air { background: color-mix(in srgb, var(--accent) 55%, transparent); animation: cl-glow 0.9s ease-in-out infinite alternate; }
@keyframes cl-glow { to { transform: translateY(-2px) rotate(calc(var(--r, 0) * 4deg - 12deg)) scale(.95); opacity: .7; } }
.cm-map i.land { animation: cl-land .55s cubic-bezier(.3,1.6,.5,1); position: relative; }
.cm-map i.land::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #fff; animation: cl-tick .9s ease-out forwards; }
@keyframes cl-land { from { transform: translateY(-14px) scale(1.25); } }
@keyframes cl-tick { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.cm-map i.shake { animation: cl-shake .45s ease-in-out; background: var(--orange, #ff9500); }
@keyframes cl-shake { 25% { transform: translateX(-3px) rotate(-10deg); } 75% { transform: translateX(3px) rotate(10deg); } }
.cm-map.wave i.on { animation: cl-wave .6s ease-in-out; animation-delay: calc(var(--r, 0) * 40ms); }
@keyframes cl-wave { 50% { transform: translateY(-4px) scale(1.08); } }
.cl-seal { margin: 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-fg); font-size: 14px; }
.cl-seal code { font-size: 12px; }
.cl-per { font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .cl-crumb, .cl-crumb.landed, .cm-map i.air, .cm-map i.land, .cm-map i.shake, .cm-map.wave i.on { animation: none; transition: none; } }
.dlbar { z-index: 20; }
.dlbar.stacked { bottom: calc(176px + env(safe-area-inset-bottom)); }
html:not(:has(.tabbar)) .dlbar { bottom: calc(16px + env(safe-area-inset-bottom)); }
.dlbar .up-row .btn.small { flex: none; }
.dlbar .iconbtn { flex: none; margin-right: -6px; }
.up-row { display: flex; align-items: center; gap: 10px; }
.up-ic { color: var(--accent-fg); display: grid; } .up-ic svg { width: 20px; height: 20px; }
.up-main { flex: 1; min-width: 0; display: grid; }
.up-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .up-main small { color: var(--ink-2); font-size: 12px; }
.up-track { height: 4px; background: var(--raised); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.up-track i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .25s; }

/* ---------- viewer ---------- */
html.viewing { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: flex; flex-direction: column; }
.v-head { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 10px) 12px 10px; background: linear-gradient(rgba(0,0,0,.6), transparent); position: absolute; left: 0; right: 0; top: 0; z-index: 2; }
.v-title { flex: 1; min-width: 0; display: grid; text-align: center; }
.v-title b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .v-title small { font-size: 12px; opacity: .7; }
.v-stage { flex: 1; display: grid; place-items: center; overflow: auto; }
.v-stage img, .v-stage video { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.v-stage video { width: 100%; max-height: 100dvh; }
.v-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.v-text { width: 100%; height: 100%; margin: 0; padding: calc(env(safe-area-inset-top) + 70px) 16px 24px; overflow: auto; font: 13px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.v-card { display: grid; gap: 14px; place-items: center; padding: 24px; text-align: center; }
.v-card > svg { width: 56px; height: 56px; opacity: .7; }
.v-loading svg { width: 36px; height: 36px; opacity: .6; }
.v-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(60,60,64,.55); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.v-nav svg { width: 22px; height: 22px; } .v-nav.prev { left: 10px; } .v-nav.next { right: 10px; }
@media (hover: none) { .v-nav { display: none; } }

/* ---------- details pop ---------- */
.details { display: grid; gap: 6px; text-align: left; }
.details div { display: flex; justify-content: space-between; gap: 12px; } .details span { color: var(--ink-2); } .details b { font-weight: 500; text-align: right; }

/* ---------- share sheet ---------- */
.linkbox { display: flex; align-items: center; gap: 8px; background: var(--raised); border-radius: 12px; padding: 8px 8px 8px 14px; }
.linkbox span { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toggle { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.toggle input { width: 51px; height: 31px; appearance: none; -webkit-appearance: none; background: var(--seg-off); border-radius: 16px; position: relative; cursor: pointer; margin: 0; }
.toggle input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.toggle input:checked { background: var(--green); } .toggle input:checked::after { transform: translateX(20px); }
.panel-lite summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.mv-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-bottom: 8px; color: var(--ink-2); }
.mv-crumbs svg { width: 14px; height: 14px; }
.crumb { background: none; border: 0; color: var(--accent-fg); font-weight: 600; padding: 6px 4px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.crumb svg { width: 16px; height: 16px; }

/* ---------- settings (account card + grouped rows) ---------- */
.acct { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: var(--r-group); padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow); margin-bottom: 22px; }
.acct-av { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #5cc98d, #237046); color: #fff; display: grid; place-items: center; font: 700 24px var(--code); }
.acct-main { flex: 1; min-width: 0; display: grid; } .acct-main b { font-size: 19px; } .acct-main small { color: var(--ink-2); }
.acct > svg { width: 18px; height: 18px; color: var(--ink-2); }
.sgroup { background: var(--surface); border-radius: var(--r-group); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.srow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 50px; text-decoration: none; color: inherit; border-top: 1px solid var(--line); }
.srow:first-child { border-top: 0; }
.srow:active { background: var(--raised); }
.s-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; }
.s-ic svg { width: 18px; height: 18px; }
.srow b { flex: 1; font-weight: 500; }
.s-val { color: var(--ink-2); font-size: 15px; }
.srow > svg { width: 16px; height: 16px; color: var(--ink-2); flex: none; }
.spage { animation: slidein .28s cubic-bezier(.2,.8,.2,1); }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.lines select.role { width: auto; min-height: 36px; padding: 6px 10px; font-size: 14px; }
code { font: 13px ui-monospace, Menlo, monospace; background: var(--raised); padding: 1px 5px; border-radius: 5px; }

/* ---------- public share page ---------- */
body.pubpage { padding-bottom: 0; background: var(--bg); }
.pub-card { max-width: 420px; margin: 12vh auto 0; padding: 28px 20px; text-align: center; }
.pub-card h1 { font: 700 26px/1.2 var(--code); margin: 10px 0 6px; overflow-wrap: anywhere; }
.pub-lock { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-fg); }
.pub-lock svg { width: 30px; height: 30px; }
.pub { max-width: 960px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 12px) 12px 24px; }
.pub-media { background: #000; border-radius: 16px; overflow: hidden; display: grid; place-items: center; min-height: 200px; }
.pub-media video, .pub-media img { width: 100%; max-height: 80dvh; object-fit: contain; display: block; }
.pub.image .pub-media { background: var(--raised); }
.pub-frame { width: 100%; height: 80dvh; border: 0; background: #fff; }
.pub-audio { display: grid; gap: 14px; place-items: center; padding: 40px 20px; color: #fff; width: 100%; } .pub-audio > svg { width: 60px; height: 60px; opacity: .8; } .pub-audio audio { width: 100%; max-width: 480px; }
.pub-blank { display: grid; place-items: center; gap: 6px; padding: 40px; color: #fff; background: var(--surface); width: 100%; color: var(--ink); } .pub-blank .fglyph { width: 72px; height: 72px; }
.pub-bar { display: flex; align-items: center; gap: 12px; padding: 14px 4px 0; }
.pub-bar.top { padding: 0 4px 12px; }
.pub-title { flex: 1; min-width: 0; display: grid; } .pub-title b { font-size: 17px; overflow-wrap: anywhere; } .pub-title small { color: var(--ink-2); font-size: 13px; }
.pub .list { margin-top: 4px; }
/* embed: tight, no page padding, media fills the frame */
html.embed, html.embed body { height: 100%; background: #000; }
.pub.embed { max-width: none; padding: 0; height: 100dvh; display: flex; flex-direction: column; }
.pub.embed .pub-media { flex: 1; border-radius: 0; min-height: 0; }
.pub.embed .pub-media video, .pub.embed .pub-media img { max-height: 100%; height: 100%; }
.pub.embed .pub-frame { height: 100%; }
.pub.embed .pub-bar { padding: 8px 12px; background: #111; color: #fff; } .pub.embed .pub-title small { color: #aaa; }
.pub.embed.folder { background: var(--bg); padding: 12px; overflow: auto; }
.pub.embed.folder .pub-bar { background: none; color: inherit; }

/* ---------- photos ---------- */
.ph-month { font: 600 15px/1 var(--body); color: var(--ink-2); margin: 18px 2px 8px; }
.ph-month:first-child { margin-top: 0; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 3px; }
.ph { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 6px; cursor: pointer; background: var(--raised) center / cover no-repeat; overflow: hidden; }
.ph.video { background-color: #1c1c1e; }
.ph:active { opacity: .8; }
.ph-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.ph-play svg { width: 34px; height: 34px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.ph .hd { position: absolute; right: 6px; bottom: 6px; }

/* ---------- file request page ---------- */
.pub-card.req { max-width: 480px; margin-top: 6vh; }
.dropzone { display: grid; place-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed var(--line); border-radius: 18px; cursor: pointer; background: var(--surface); text-align: center; }
.dropzone.drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.dropzone > span { color: var(--accent-fg); } .dropzone > span svg { width: 32px; height: 32px; }
.dropzone small { color: var(--ink-2); }
.pubpage .upbar { position: static; box-shadow: var(--shadow); }
.pubpage .lines li > svg { width: 20px; height: 20px; color: var(--green); }

/* ---------- office: page list + document ---------- */
.pg-ic { font-size: 24px; color: var(--ink-2); } .pg-ic svg { width: 26px; height: 26px; }
.node.page > svg { width: 16px; height: 16px; color: var(--ink-2); }
.doc { background: var(--surface); border-radius: var(--r-group); padding: 18px 18px 24px; box-shadow: var(--shadow); min-height: 60dvh; }
.doc-icon { font-size: 40px; line-height: 1; background: none; border: 0; padding: 0; cursor: pointer; display: block; margin-bottom: 8px; }
.doc-icon svg { width: 36px; height: 36px; }
.doc-title { font: 700 30px/1.2 var(--code); margin: 0 0 14px; outline: 0; overflow-wrap: anywhere; }
.doc-title:empty::before, .bt:empty::before { content: attr(data-placeholder); color: var(--ink-2); opacity: .6; pointer-events: none; }
.bt:not(:focus):empty::before { opacity: .35; }
.editor .blk { position: relative; padding: 3px 0; display: flex; gap: 8px; align-items: flex-start; }
.bt { flex: 1; min-width: 0; outline: 0; font-size: 17px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.blk.h1 .bt { font: 700 26px/1.25 var(--code); margin-top: 14px; }
.blk.h2 .bt { font: 700 21px/1.3 var(--code); margin-top: 10px; }
.blk.h3 .bt { font: 600 18px/1.35 var(--code); margin-top: 6px; }
.blk.ul::before { content: '•'; width: 22px; text-align: center; flex: none; line-height: 1.5; font-size: 17px; }
.blk.ol::before { content: counter(x); counter-reset: x var(--n, 1); width: 22px; text-align: right; flex: none; line-height: 1.5; font-size: 15px; color: var(--ink-2); }
.blk.ul .bt, .blk.ol .bt, .blk.todo .bt { }
.todo-box { width: 22px; height: 22px; margin-top: 2px; border-radius: 6px; border: 1.5px solid var(--ink-2); background: none; padding: 0; color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.todo-box svg { width: 14px; height: 14px; opacity: 0; } .todo-box.on { background: var(--accent); border-color: var(--accent); } .todo-box.on svg { opacity: 1; }
.blk.done .bt { color: var(--ink-2); text-decoration: line-through; }
.blk.quote .bt { border-left: 3px solid var(--ink); padding-left: 12px; color: var(--ink); }
.blk.code .bt { font: 14px/1.5 ui-monospace, Menlo, monospace; background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.blk.hr { padding: 8px 0; cursor: default; } .blk.hr hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 0; } .blk.hr:focus { outline: 2px solid var(--focus); border-radius: 4px; }
.bt b { font-weight: 700; } .bt code { font-size: 15px; } .bt a { color: var(--accent-fg); }
.editor.readonly .bt { cursor: default; }
.doc-meta { margin: 20px 0 0; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; } .emoji-row button { font-size: 24px; background: var(--raised); border: 0; border-radius: 10px; width: 44px; height: 44px; cursor: pointer; }

/* ---------- dev analytics ---------- */
.kpis.small3 { grid-template-columns: repeat(3, 1fr); margin: 0 0 12px; } .kpis.small3 strong { font-size: 20px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; background: var(--bg); border-radius: 10px; padding: 6px; }
.bars i { flex: 1; min-height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }

/* ---------- drag & drop ---------- */
.dropzone.slim { margin-top: 14px; padding: 18px 16px; }
#dropveil { position: fixed; inset: 0; z-index: 70; background: color-mix(in srgb, var(--accent) 18%, rgba(0,0,0,.35)); backdrop-filter: blur(6px); display: none; place-items: center; pointer-events: none; }
#dropveil.show { display: grid; }
#dropveil > div { display: grid; place-items: center; gap: 10px; background: var(--surface); color: var(--ink); border-radius: 24px; padding: 32px 48px; font-size: 19px; box-shadow: 0 20px 60px rgba(0,0,0,.3); border: 3px dashed var(--accent); }
#dropveil svg { width: 40px; height: 40px; color: var(--accent-fg); }

/* ---------- showcase gallery ---------- */
html.gallery, html.gallery body { background: #0b0b0c; color: #f2f2f0; }
html.gallery body { padding: 0; }
.gal { max-width: 1200px; margin: 0 auto; padding: 0 0 48px; font-family: var(--body); }
.gal h2 { font: 500 13px/1 var(--body); letter-spacing: .22em; text-transform: uppercase; color: #9a9a9e; margin: 48px 20px 18px; }
.gal-hero { min-height: 68dvh; display: grid; align-items: end; background: #16161a center / cover no-repeat; position: relative; }
.gal-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,11,12,1) 0%, rgba(11,11,12,.55) 40%, rgba(11,11,12,.1) 100%); }
.gal-hero-in { position: relative; z-index: 1; padding: 0 20px 40px; max-width: 760px; }
.gal-kicker { font: 500 13px/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: #c8c8cc; margin: 0 0 14px; }
.gal-hero h1 { font: 400 clamp(36px, 7vw, 72px)/1.05 ui-serif, "New York", Georgia, "Times New Roman", serif; letter-spacing: -.01em; margin: 0 0 14px; }
.gal-note { font: 400 18px/1.5 ui-serif, Georgia, serif; color: #d8d8dc; margin: 0 0 12px; font-style: italic; }
.gal-count { color: #9a9a9e; font-size: 14px; margin: 0; }
.gal-films { display: grid; gap: 28px; padding: 0 20px; }
.gal-films h2 { margin-left: 0; margin-right: 0; grid-column: 1 / -1; }
.gal-film { margin: 0; }
.gal-film video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; display: block; }
.gal-film figcaption { padding: 12px 2px 0; font: 400 17px/1.3 ui-serif, Georgia, serif; color: #e8e8ec; }
.gal-grid { padding: 0 20px; columns: 3 240px; column-gap: 8px; }
.gal-ph { position: relative; display: block; width: 100%; margin: 0 0 8px; background: #16161a; border-radius: 10px; overflow: hidden; break-inside: avoid; }
.gal-ph[hidden], .gal-film[hidden], .gal-films[hidden], .gal-photos[hidden] { display: none; }
.gal-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gal-ph img { width: 100%; display: block; transition: transform .35s ease; }
.gal-ph:hover img { transform: scale(1.03); }
.gal.protect img { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
/* favorites: a heart on each photo / film, a filter, and "Choosing as …" */
.gal-fav { position: absolute; right: 8px; bottom: 8px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(11, 11, 12, .5); color: #fff; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: transform .2s ease, background .2s; }
.gal-fav svg { width: 20px; height: 20px; }
.gal-fav[aria-pressed="true"] { color: #ff4d6d; background: rgba(255, 255, 255, .92); transform: scale(1.06); }
.gal-film figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gal-film .gal-fav { position: static; flex: none; }
.gal-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 4px; }
.gal-seg { background: #1b1b1e; max-width: 320px; flex: 1; }
.gal-seg button { color: #a8a8ad; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.gal-seg button[aria-pressed="true"] { background: #f2f2f0; color: #0b0b0c; }
.gal-seg svg { width: 15px; height: 15px; color: #ff4d6d; }
.gal-who { border: 0; background: none; color: #a8a8ad; font: 400 14px var(--body); cursor: pointer; padding: 8px 2px; min-height: 44px; }
.gal-who b { color: #f2f2f0; }
dialog.gal-name { border: 0; padding: 0; border-radius: 22px; background: #1b1b1e; color: #f2f2f0; width: min(380px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
dialog.gal-name::backdrop { background: rgba(0, 0, 0, .55); }
.gal-name-in { display: grid; gap: 12px; padding: 24px; }
.gal-name-in h3 { margin: 0; font: 600 20px var(--body); }
.gal-name-in p { margin: 0; color: #a8a8ad; font-size: 14px; line-height: 1.45; }
.gal-name-in input { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid #333338; background: #0f0f11; color: #f2f2f0; font: 400 17px var(--body); }
.gal-name-row { display: flex; justify-content: flex-end; gap: 8px; }
/* watermark: one tiled SVG (set as --wm by gallery.js) over photos, films and the lightbox */
html.wm .gal-ph::after, html.wm .gal-vbox::after, html.wm .viewer .v-stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1; background-image: var(--wm); background-repeat: repeat; }
.gal-vbox { position: relative; }
html.wm .viewer .v-stage { position: relative; }
.gal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 40px 20px 0; }
.gal-foot .btn { background: #f2f2f0; color: #0b0b0c; }
.gal.embed .gal-hero { min-height: 48dvh; }
@media (min-width: 900px) { .gal-films { grid-template-columns: 1fr 1fr; } .gal-films .gal-film:first-child:nth-last-child(odd) { grid-column: 1 / -1; } }

/* ---------- Scan sheet (capture.js): page thumbnails ---------- */
.scan-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.scan-page { position: relative; margin: 0; background: var(--surface); border-radius: var(--r-item); overflow: hidden; box-shadow: var(--shadow); }
.scan-page canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
.scan-page figcaption { position: absolute; left: 6px; bottom: 6px; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: rgba(0, 0, 0, .55); color: #fff; font: 600 12px var(--body); text-align: center; }
.scan-page .iconbtn { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, .5); color: #fff; border-radius: 50%; }

/* ---------- folder path (files.js): My Files › Photos › 2026 ---------- */
.pathbar { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 0 10px; padding: 2px 0; white-space: nowrap; }
.pathbar::-webkit-scrollbar { display: none; }
.pb-step { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 6px 8px; border-radius: 10px; font: 600 14px var(--body); color: var(--accent-fg); text-decoration: none; }
.pb-step svg { width: 16px; height: 16px; }
.pb-step.here { color: var(--ink); }
a.pb-step:active { background: var(--raised); }
@media (hover: hover) { a.pb-step:hover { background: var(--raised); } }
.pb-sep { flex: none; display: inline-flex; color: var(--ink-2); }
.pb-sep svg { width: 13px; height: 13px; }

/* ---------- Add a server: guides (server-guides.js) ---------- */
ol.guide { margin: 0; padding: 0; list-style: none; counter-reset: g; display: grid; gap: 14px; }
ol.guide > li { counter-increment: g; position: relative; padding-left: 34px; }
ol.guide > li::before { content: counter(g); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 13px/24px var(--body); text-align: center; }
ol.guide > li > b { display: block; margin-bottom: 4px; }
ol.guide p { margin: 4px 0; font-size: 15px; }
ol.guide ol { margin: 6px 0; padding-left: 20px; display: grid; gap: 4px; }
ol.guide code { font-size: 13px; background: var(--raised); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
.where { display: inline-block; font: 700 11px var(--body); letter-spacing: .03em; color: var(--accent-fg); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 2px 6px; border-radius: 6px; }
.guide-code { display: grid; gap: 6px; justify-items: start; margin: 6px 0; }
.guide-code pre.snippet { width: 100%; max-height: 220px; overflow: auto; margin: 0; white-space: pre; word-break: normal; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
details.opt { background: var(--surface); border-radius: var(--r-item); padding: 10px 12px; margin-top: 8px; }
details.opt > summary { cursor: pointer; font-weight: 600; }

/* ---------- Shared tab: Links / Requests switch ---------- */
.shared-seg { margin-bottom: 14px; }
.shared-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.shared-seg button svg { width: 17px; height: 17px; }
.seg-n { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--raised); color: var(--ink-2); font: 600 12px/20px var(--body); }
.shared-seg button[aria-pressed="true"] .seg-n { background: var(--accent); color: var(--accent-ink); }

.picks-names { margin: 0 0 10px; color: var(--ink-2); line-height: 1.5; word-break: break-word; }

.details .fp { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* My Files without a drive (free accounts) / the drive a team lends them */
.nodrive { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 36px 20px; color: var(--ink-2); }
.nodrive svg { width: 40px; height: 40px; opacity: .6; }
.nodrive b { color: var(--ink); font-size: 17px; }
.nodrive p { max-width: 34ch; margin: 0; font-size: 14px; }
.drive-line { display: flex; align-items: center; gap: 8px; margin: 4px 2px 10px; }
.drive-line svg { width: 16px; height: 16px; flex: none; }
.drive-line span { flex: 1; }

/* Move to server (relocate.js) */
.mv { display: grid; gap: 12px; margin-top: 8px; }
.mv-route { display: flex; align-items: center; justify-content: center; gap: 14px; }
.mv-route span { display: grid; text-align: center; }
.mv-route small { color: var(--ink-2); font-size: 12px; }
.mv-route svg { width: 18px; height: 18px; color: var(--ink-2); }
.mv .up-track { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.mv-bar { display: block; height: 100%; background: var(--accent); transition: width .3s; }

/* read-only files (kept on a server no longer lent to you) */
.node .ro { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-2); }
.node .ro svg { width: 12px; height: 12px; }
