/* pub.s1d.me */
body.pub { min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 680; font-size: 16px; letter-spacing: -.015em; text-decoration: none !important; }
.brand svg { color: var(--accent); }
.top nav { display: flex; align-items: center; gap: 4px; }
.nav-link { color: var(--text-2); font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 7px; text-decoration: none !important; }
.nav-link:hover { background: var(--hover); }
.nav-link.subtle { color: var(--muted); }
.foot { margin-top: auto; border-top: 1px solid var(--line); }
.foot-in { max-width: 1180px; margin: 0 auto; padding: 22px 20px 30px; display: flex; gap: 10px; color: var(--muted); font-size: 13px; }
.foot a { color: var(--muted); }

.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 20px 64px; }
.wrap.center { display: grid; place-items: center; min-height: 60vh; }
.hero { padding: 56px 0 28px; }
.hero h1 { font: 700 38px/1.1 var(--sans); letter-spacing: -.035em; margin: 0 0 10px; }
.lede { font-size: 17px; color: var(--muted); margin: 0; max-width: 560px; }
.items { display: grid; gap: 10px; }
.card.item { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; color: var(--text);
  text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card.item:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.item-ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--muted); }
.item-ic.k-md { background: var(--accent-soft); color: var(--accent); }
.item-ic.k-pdf { background: var(--red-soft); color: var(--red); }
.item-ic.k-image { background: var(--violet-soft); color: var(--violet); }
.item-ic.k-html { background: var(--teal-soft); color: var(--teal); }
.item-body { min-width: 0; flex: 1; }
.item-title { font-weight: 640; font-size: 16px; letter-spacing: -.01em; line-height: 1.35; }
.item-desc { color: var(--text-2); font-size: 14px; margin-top: 3px; }
.item-meta { color: var(--muted); font-size: 12.5px; margin-top: 7px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.empty { border: 1px dashed var(--line-2); border-radius: 12px; padding: 48px; text-align: center; color: var(--muted); }

/* lock */
.lock-card { width: min(400px, 100%); text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 34px 28px 30px; box-shadow: var(--shadow); }
.lock-card h1 { font-size: 21px; margin: 12px 0 6px; letter-spacing: -.02em; }
.lock-ic { width: 54px; height: 54px; border-radius: 15px; margin: 0 auto; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); }
.lock-form { display: grid; gap: 10px; margin-top: 20px; }
.lock-form input { height: 42px; font-size: 15px; text-align: center; letter-spacing: .04em; }
.lock-form .btn { height: 42px; justify-content: center; font-size: 15px; }
.form-err { margin-top: 14px; padding: 8px 12px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 14px; }

/* document */
.doc { width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 20px 72px; }
.doc.wide { max-width: 1180px; }
.doc-head { max-width: 720px; margin-bottom: 30px; position: relative; }
.doc.wide .doc-head { max-width: none; }
.doc-tools { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 10px; }
.doc-title { font: 700 36px/1.15 var(--sans); letter-spacing: -.03em; margin: 0 0 12px; text-wrap: balance; }
.doc-desc { font-size: 18px; line-height: 1.5; color: var(--text-2); margin: 0 0 14px; }
.doc-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13.5px; flex-wrap: wrap; }
.doc .reader-grid { grid-template-columns: minmax(0, 720px) 220px; justify-content: space-between; }
@media (max-width: 1000px) { .doc .reader-grid { grid-template-columns: minmax(0, 1fr); } }
.doc .md-body { font-family: var(--serif); font-size: 18.5px; line-height: 1.7; color: var(--text); }
.doc .md-body h1, .doc .md-body h2, .doc .md-body h3, .doc .md-body h4 { font-family: var(--sans); }
.doc .md-body h2 { border-bottom: 0; padding-bottom: 0; font-size: 1.3em; margin-top: 2em; }
.doc .md-body h3 { font-size: 1.08em; }
.doc .md-body .table-wrap, .doc .md-body pre, .doc .md-body li.task { font-family: var(--sans); }
.doc .md-body .table-wrap table { font-size: 14.5px; }
.doc .md-body pre.code { font-size: 13.5px; }
.doc .md-body blockquote { font-style: italic; }
.doc .md-body img { display: block; margin: 1.5em auto; box-shadow: var(--shadow); }
.pdf-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--sunken); }
.pdf { display: block; width: 100%; height: calc(100vh - 140px); min-height: 520px; border: 0; }
.pdf-fallback { padding: 8px 14px; margin: 0; border-top: 1px solid var(--line); background: var(--panel); }
.html-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.html-frame { display: block; width: 100%; height: calc(100vh - 140px); min-height: 520px; border: 0; background: #fff; }
.img-fig { margin: 0; text-align: center; } .img-fig img { max-width: 100%; border-radius: 10px; box-shadow: var(--shadow); }
.viewer { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--sunken); }
.media video { width: 100%; border-radius: 12px; background: #000; } .media audio { width: 100%; }
.dl-card { display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); max-width: 560px; }
.dl-card > div { flex: 1; min-width: 0; }

/* admin */
.admin-head { padding: 40px 0 18px; }
.admin-head h1 { font-size: 28px; letter-spacing: -.03em; margin: 0 0 6px; }
.drop { display: block; border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 26px; cursor: pointer; background: var(--panel); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-in { display: grid; justify-items: center; gap: 5px; text-align: center; }
.drop .up { transform: rotate(180deg); color: var(--accent); }
.upload-opts { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; flex-wrap: wrap; }
#uploads { display: grid; gap: 6px; margin-top: 8px; }
.up-row { display: flex; gap: 10px; align-items: center; font-size: 13.5px; padding: 8px 12px; border-radius: 8px; background: var(--sunken); }
.up-row .bar { flex: 1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.up-row .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 34px 0 12px; }
.list-head h2 { margin: 0; font-size: 18px; letter-spacing: -.015em; display: flex; gap: 8px; align-items: center; }
.list-head input { width: 220px; }
.count { font: 600 12px var(--sans); color: var(--faint); background: var(--sunken); border-radius: 999px; padding: 2px 8px; }
.admin-items { display: grid; gap: 8px; }
.ai { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.ai.flash { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.ai-top { display: flex; gap: 14px; align-items: center; padding: 12px 14px; }
.ai-top .item-ic { width: 36px; height: 36px; border-radius: 9px; }
.ai-t { flex: 1; min-width: 0; }
.ai-t a { color: var(--text); font-weight: 620; }
.ai-sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.ai-act { display: flex; gap: 4px; flex: none; }
.ai-share { display: grid; gap: 6px; padding: 0 14px 12px 64px; }
.share { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.share > span { width: 82px; color: var(--muted); flex: none; }
.share code { flex: 1; min-width: 0; background: var(--sunken); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-edit { border-top: 1px solid var(--line); padding: 16px 14px 16px 64px; display: grid; gap: 12px; background: var(--bg); }
.ai-edit .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-edit .acts { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.slug-in { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--panel); overflow: hidden; }
.slug-in span { padding: 0 2px 0 10px; color: var(--faint); font-size: 13px; white-space: nowrap; }
.slug-in input { border: 0; box-shadow: none !important; flex: 1; padding-left: 0; }
.audit { margin-top: 30px; } .audit summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.audit pre { max-height: 320px; overflow: auto; background: var(--sunken); padding: 12px; border-radius: 8px; margin-top: 8px; font-size: 11.5px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 9px; font-size: 13.5px; box-shadow: var(--shadow-lg); z-index: 60; transition: all .2s; }
.toast.in { transform: translate(-50%, 0); opacity: 1; } .toast.err { background: var(--red); color: #fff; }

@media (max-width: 720px) {
  .hero { padding: 36px 0 20px; } .hero h1 { font-size: 30px; }
  .doc { padding-top: 24px; } .doc-title { font-size: 28px; } .doc .md-body { font-size: 17px; }
  .ai-share, .ai-edit { padding-left: 14px; } .ai-edit .row2 { grid-template-columns: 1fr; }
  .ai-top { flex-wrap: wrap; } .ai-act { width: 100%; justify-content: flex-end; }
  .list-head input { width: 140px; }
  .pdf, .html-frame { height: 75vh; min-height: 0; }
}
/* team sign-in on the password page */
.lock-or { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.lock-or::before, .lock-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lock-card .team-signin { width: 100%; height: 40px; justify-content: center; border-color: var(--line); }
.lock-card .team-signin + .small { margin: 8px 0 0; }
