/* ============================================================
   THE DAILY DROP — styles
   Dark-first design system, light theme via [data-theme=light]
   ============================================================ */

:root {
  --bg: #0d1017;
  --bg2: #12161f;
  --surface: #161b26;
  --surface2: #1c2231;
  --border: rgba(255, 255, 255, .08);
  --border2: rgba(255, 255, 255, .15);
  --text: #eef1f7;
  --muted: #99a3b8;
  --faint: #67718c;
  --accent: #fbbf24;
  --accent2: #fb7185;
  --grad: linear-gradient(135deg, #fbbf24, #fb7185);
  --gradsoft: linear-gradient(135deg, rgba(251,191,36,.16), rgba(251,113,133,.16));
  --like: #fb5970;
  --danger: #f87171;
  --ok: #34d399;
  --radius: 18px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .38);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

[data-theme="light"] {
  --bg: #f6f4ef;
  --bg2: #fdfcf9;
  --surface: #ffffff;
  --surface2: #f1efe9;
  --border: rgba(25, 30, 45, .10);
  --border2: rgba(25, 30, 45, .18);
  --text: #191e2b;
  --muted: #5a6379;
  --faint: #8b93a7;
  --shadow: 0 12px 30px rgba(35, 40, 65, .12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(251, 113, 133, .07), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(251, 191, 36, .06), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(251, 146, 60, .35); }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
img, video, svg { display: block; max-width: 100%; }
a { color: var(--accent); }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.logo { display: grid; place-items: center; filter: drop-shadow(0 4px 12px rgba(251, 113, 133, .35)); }
.brand-text { min-width: 0; }
.brand-text h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tagline { margin: 1px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topactions { display: flex; gap: 4px; flex: none; }
.iconbtn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--muted);
  transition: background .15s, color .15s, transform .1s;
}
.iconbtn svg { width: 21px; height: 21px; }
.iconbtn:hover { background: var(--surface2); color: var(--text); }
.iconbtn:active { transform: scale(.92); }
.iconbtn.on { color: var(--accent); }
.iconbtn.on svg { filter: drop-shadow(0 0 8px rgba(251,191,36,.6)); }

/* ---------------- filter chips ---------------- */
.chips {
  position: sticky;
  top: calc(61px + var(--safe-t));
  z-index: 29;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--border2); }
.chip.on {
  color: #20150a;
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(251, 113, 133, .35);
}

/* ---------------- feed ---------------- */
.feed { max-width: 620px; margin: 0 auto; padding: 16px 14px 0; }
.feedend { max-width: 620px; margin: 0 auto; padding: 6px 14px calc(30px + var(--safe-b)); text-align: center; }
.feedend .caught { color: var(--faint); font-size: 13px; }
.widemore {
  margin: 4px auto 10px;
  padding: 10px 26px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}
.widemore:hover { border-color: var(--accent); }

/* banners */
.demobanner, .offlinebanner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid var(--border2);
}
.demobanner { background: var(--gradsoft); color: var(--text); }
.offlinebanner { background: rgba(248, 113, 113, .12); color: var(--danger); }
.demobanner b { font-weight: 700; }
.demobanner .x, .offlinebanner .x { margin-left: auto; color: var(--muted); flex: none; }

/* ---------------- post card ---------------- */
.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 18px;
  box-shadow: var(--shadow);
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.post.leaving { transition: all .25s; opacity: 0; transform: scale(.95); }

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px 11px;
}
.kindchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}
.kindchip svg { width: 13px; height: 13px; }
.post-date { margin-left: auto; font-size: 12.5px; color: var(--faint); flex: none; }

.media { background: #000; position: relative; }
.media img, .media video {
  width: 100%;
  max-height: min(78vh, 760px);
  object-fit: contain;
  margin: 0 auto;
}
.media img { min-height: 120px; }

/* link / embed facade */
.linkfac {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 420px;
  background:
    radial-gradient(600px 300px at 30% 20%, rgba(251, 191, 36, .25), transparent 60%),
    radial-gradient(600px 300px at 75% 85%, rgba(251, 113, 133, .28), transparent 60%),
    #14181f;
  cursor: pointer;
  overflow: hidden;
}
.linkfac img.yt { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.linkfac iframe { width: 100%; height: 100%; border: 0; }
.playbtn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px; height: 68px;
  border-radius: 50%;
  background: rgba(10, 12, 18, .72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  transition: transform .15s, background .15s;
}
.linkfac:hover .playbtn { transform: scale(1.1); background: rgba(251, 113, 133, .85); }
.embednote { position: absolute; left: 12px; bottom: 10px; font-size: 11.5px; color: rgba(255,255,255,.75); background: rgba(0,0,0,.45); padding: 3px 9px; border-radius: 99px; }
.playbtn svg { width: 32px; height: 32px; }

.linkcard {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.linkcard .go svg { width: 18px; height: 18px; }
.linkcard:hover { background: color-mix(in srgb, var(--surface2) 70%, var(--accent) 8%); }
.linkcard .host { font-size: 12.5px; color: var(--faint); }
.linkcard .go { margin-left: auto; color: var(--muted); flex: none; }

/* audio */
.audio-wrap { padding: 14px 16px 4px; }
.audiodeco { display: flex; align-items: flex-end; gap: 4px; height: 44px; margin-bottom: 10px; }
.audiodeco i {
  flex: 1;
  max-width: 9px;
  border-radius: 4px;
  background: var(--grad);
  opacity: .8;
  animation: wave 1.4s ease-in-out infinite;
}
.audiodeco i:nth-child(odd) { animation-delay: .35s; }
.audiodeco i:nth-child(3n) { animation-delay: .7s; }
@keyframes wave { 0%, 100% { height: 22%; } 50% { height: 95%; } }
audio { width: 100%; height: 44px; }

/* documents (PDF / EPUB) */
.docblock {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  text-decoration: none;
  color: var(--text);
  background: var(--gradsoft);
  border-bottom: 1px solid var(--border);
  transition: background .15s, transform .12s;
}
.docblock:hover { background: linear-gradient(135deg, rgba(251,191,36,.26), rgba(251,113,133,.26)); }
.docblock:active { transform: scale(.99); }
.docicon {
  width: 54px; height: 54px;
  border-radius: 15px;
  background: var(--grad);
  color: #231407;
  display: grid; place-items: center;
  flex: none;
  box-shadow: 0 6px 18px rgba(251, 113, 133, .35);
}
.docicon.epub { background: linear-gradient(135deg, #34d399, #22d3ee); color: #062018; box-shadow: 0 6px 18px rgba(52, 211, 153, .3); }
.docicon svg { width: 26px; height: 26px; }
.docmeta { min-width: 0; }
.docmeta b { display: block; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docmeta span { font-size: 12.5px; color: var(--muted); }
.docblock .go { margin-left: auto; color: var(--muted); flex: none; }
.docblock .go svg { width: 18px; height: 18px; }

/* optional cover images */
.media img.cover { max-height: 340px; object-fit: cover; }
.audio-wrap img.audiocover {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 10px;
}

/* composer thumbnail picker */
.thumbbtn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 14px;
  border: 1.5px dashed var(--border2);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: border-color .15s, color .15s;
}
.thumbbtn:hover { border-color: var(--accent); color: var(--text); }
.thumbbtn svg { width: 17px; height: 17px; flex: none; }
.thumbprev { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; }
.thumbprev img { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; }
.thumbprev span { font-size: 12.5px; color: var(--ok); flex: 1; font-weight: 600; }

/* text content */
.post-title { margin: 13px 16px 0; font-size: 19px; line-height: 1.3; letter-spacing: -.01em; }
.post-caption { margin: 10px 16px 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.artbody { margin: 12px 16px 0; font-size: 15.5px; line-height: 1.7; overflow-wrap: anywhere; }
.artbody p { margin: 0 0 1em; }
.artbody a { text-decoration: none; border-bottom: 1px solid rgba(251, 146, 60, .5); }
.artbody code { background: var(--surface2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
.artbody.readmore { position: relative; max-height: 340px; overflow: hidden; }
.artbody.readmore::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(transparent, var(--surface));
}
.readmore-btn { margin: 4px 16px 4px; font-size: 13.5px; font-weight: 700; color: var(--accent); }

/* actions */
.actions { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 8px; }
.act {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, color .15s, transform .1s;
}
.act svg { width: 20px; height: 20px; }
.act:hover { background: var(--surface2); color: var(--text); }
.act:active { transform: scale(.94); }
.act.like.liked { color: var(--like); }
.act.like svg { fill: currentColor; color: var(--faint); transition: color .15s; }
.act.like.liked svg { color: var(--like); animation: pop .4s cubic-bezier(.2, 2, .4, 1); }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.45); } 100% { transform: scale(1); } }
.act.del { margin-left: auto; color: var(--faint); }
.act.del:hover { color: var(--danger); background: rgba(248, 113, 113, .1); }
.act .cnt { min-width: 14px; }

/* comments */
.comments { border-top: 1px solid var(--border); background: var(--bg2); padding: 13px 16px 15px; }
.clist { display: flex; flex-direction: column; gap: 12px; margin-bottom: 13px; }
.comment { display: flex; gap: 10px; }
.avatar {
  width: 33px; height: 33px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  flex: none;
  margin-top: 2px;
}
.cbody { min-width: 0; flex: 1; }
.chead { display: flex; align-items: baseline; gap: 8px; }
.chead b { font-size: 13.5px; }
.chead time { font-size: 11.5px; color: var(--faint); }
.ctext { margin: 2px 0 0; font-size: 14px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; white-space: pre-line; }
.cdel { color: var(--faint); flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.cdel:hover { color: var(--danger); background: rgba(248, 113, 113, .12); }
.cdel svg { width: 14px; height: 14px; }
.cform { display: flex; flex-direction: column; gap: 8px; }
.cform .row2 { display: flex; gap: 8px; }
.cform input { flex: 1; min-width: 0; }

/* ---------------- inputs & buttons ---------------- */
.field {
  width: 100%;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(251, 191, 36, .18); }
.field::placeholder { color: var(--faint); }
textarea.field { resize: vertical; min-height: 90px; line-height: 1.55; }
.field.big { min-height: 220px; font-size: 15.5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 13px;
  background: var(--grad);
  color: #231407;
  font-weight: 800;
  font-size: 15px;
  border: none;
  transition: transform .12s, box-shadow .15s, opacity .15s;
  box-shadow: 0 6px 18px rgba(251, 113, 133, .35);
}
.btn:hover { box-shadow: 0 8px 24px rgba(251, 113, 133, .5); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  box-shadow: none;
}
.btn.ghost:hover { border-color: var(--accent); }
.btn.danger { background: linear-gradient(135deg, #f87171, #ef4444); color: #fff; box-shadow: 0 6px 18px rgba(239, 68, 68, .35); }
.btn.wide { width: 100%; }
.btn.small { padding: 8px 14px; font-size: 13px; border-radius: 11px; }

/* ---------------- modals ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(4, 7, 13, .62);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fade .2s ease;
}
.modal[hidden] { display: none; }
[hidden] { display: none !important; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%;
  max-width: 590px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 8px 18px calc(20px + var(--safe-b));
  animation: up .28s cubic-bezier(.2, .9, .3, 1);
}
.sheet.slim { max-width: 420px; }
@keyframes up { from { transform: translateY(60px); opacity: .4; } }
.sheet-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 10px;
  background: var(--surface);
  z-index: 2;
}
.sheet-head h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.iconbtn.x { width: 34px; height: 34px; }
@media (min-width: 680px) {
  .modal { align-items: center; padding: 20px; }
  .sheet { border-radius: 24px; border-bottom: 1px solid var(--border2); padding-bottom: 20px; }
}

.muted { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.center { text-align: center; }
.err { color: var(--danger); font-size: 13.5px; line-height: 1.45; margin: 10px 0 0; }
.formgap { display: flex; flex-direction: column; gap: 12px; }
.label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; display: block; }

/* tabs */
.tabs { display: flex; gap: 6px; background: var(--surface2); padding: 5px; border-radius: 14px; margin-bottom: 16px; }
.tabs button { flex: 1; padding: 9px 6px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: all .15s; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }

/* ---------------- composer ---------------- */
.seg { display: flex; gap: 6px; background: var(--surface2); padding: 5px; border-radius: 15px; margin-bottom: 15px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 4px;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  transition: all .15s;
  min-width: 64px;
}
.seg button svg { width: 20px; height: 20px; }
.seg button.on { background: var(--surface); color: var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }

.drop {
  border: 2px dashed var(--border2);
  border-radius: 16px;
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(251, 191, 36, .06); color: var(--text); }
.drop svg { width: 30px; height: 30px; margin: 0 auto 8px; color: var(--faint); }
.drop b { color: var(--text); }
.drop small { display: block; margin-top: 5px; font-size: 12px; color: var(--faint); }
.filepreview { margin-top: 12px; display: flex; gap: 12px; align-items: center; background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 10px; }
.filepreview img, .filepreview video { width: 86px; height: 62px; object-fit: cover; border-radius: 9px; background: #000; flex: none; }
.filepreview .fmeta { min-width: 0; flex: 1; font-size: 13px; }
.filepreview .fmeta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filepreview .fmeta span { color: var(--faint); font-size: 12px; }
.filepreview .iconbtn { color: var(--faint); }

.prog { height: 8px; background: var(--surface2); border-radius: 99px; overflow: hidden; margin: 4px 0 2px; }
.prog > i { display: block; height: 100%; width: 0%; background: var(--grad); border-radius: 99px; transition: width .25s; }
.prognote { font-size: 12.5px; color: var(--faint); margin: 6px 0 0; }

.linkprev { margin-top: 12px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.linkprev .linkfac { aspect-ratio: 16 / 9; cursor: default; }

/* ---------------- links sheet ---------------- */
.linkrows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.linkrow {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: var(--surface2);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, transform .12s;
}
.linkrow:hover { border-color: var(--accent); transform: translateY(-1px); }
.linkrow .lmeta { min-width: 0; flex: 1; }
.linkrow .lmeta b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkrow .lmeta span { font-size: 12.5px; color: var(--faint); }
.linkrow .arrow { color: var(--faint); flex: none; }
.picon {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
  overflow: hidden;
}
.picon svg { width: 22px; height: 22px; }

.linkedit { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface2); margin-bottom: 8px; }
.linkedit .picon { width: 36px; height: 36px; border-radius: 11px; }
.linkedit .picon svg { width: 18px; height: 18px; }
.linkedit .lmeta { flex: 1; min-width: 0; }
.linkedit .lmeta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkedit .lmeta span { font-size: 12px; color: var(--faint); }
.minibtn { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); flex: none; }
.minibtn:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.minibtn.del:hover { color: var(--danger); }
.minibtn svg { width: 16px; height: 16px; }

/* ---------------- settings ---------------- */
.setcard { border: 1px solid var(--border); border-radius: 16px; padding: 15px; margin-bottom: 14px; background: var(--surface2); }
.setcard h3 { margin: 0 0 4px; font-size: 14.5px; }
.setcard .hint { margin: 0 0 12px; font-size: 12.5px; color: var(--faint); line-height: 1.5; }
.setcard .row { display: flex; gap: 8px; }
.setcard .row .field { flex: 1; }
.adminbadge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--accent); }

/* ---------------- fab ---------------- */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(20px + var(--safe-b));
  width: 60px; height: 60px;
  border-radius: 19px;
  background: var(--grad);
  color: #231407;
  display: grid;
  place-items: center;
  z-index: 40;
  box-shadow: 0 12px 30px rgba(251, 113, 133, .5), 0 4px 10px rgba(0, 0, 0, .35);
  transition: transform .15s, box-shadow .15s;
}
.fab:hover { transform: translateY(-2px) scale(1.03); }
.fab:active { transform: scale(.9); }

/* ---------------- toasts ---------------- */
.toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(22px + var(--safe-b));
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: min(94vw, 430px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1d2330;
  border: 1px solid rgba(255, 255, 255, .14);
  color: #e8ecf4;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: toastin .25s ease;
  max-width: 100%;
}
.toast.out { transition: all .3s; opacity: 0; transform: translateY(8px); }
.toast .tact { color: #fbbf24; font-weight: 700; flex: none; }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } }

/* ---------------- skeletons & empty ---------------- */
.skel { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); margin-bottom: 18px; overflow: hidden; }
.skel .a { height: 50px; }
.skel .b { height: 260px; background: linear-gradient(100deg, var(--surface2) 40%, var(--bg2) 50%, var(--surface2) 60%); background-size: 220% 100%; animation: shine 1.3s linear infinite; }
.skel .c { height: 44px; }
@keyframes shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.empty { text-align: center; padding: 60px 20px 30px; color: var(--muted); }
.empty svg { width: 54px; height: 54px; margin: 0 auto 14px; opacity: .9; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 17px; }
.empty p { margin: 0; font-size: 14px; line-height: 1.55; }

/* install hint chip */
.hintchip {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(96px + var(--safe-b));
  z-index: 45;
  background: #1d2330;
  color: #e8ecf4;
  border: 1px solid rgba(255, 255, 255, .16);
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 92vw;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (min-width: 680px) {
  .topbar, .chips { padding-left: max(16px, calc(50vw - 310px)); padding-right: max(16px, calc(50vw - 310px)); }
}


/* ---------------- hero / introduction ---------------- */
.hero {
  position: relative;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background:
    radial-gradient(520px 230px at 110% -20%, rgba(251, 191, 36, .15), transparent 60%),
    radial-gradient(520px 230px at -10% 120%, rgba(251, 113, 133, .15), transparent 60%),
    var(--surface);
  padding: 24px 20px 22px;
  margin: 0 0 18px;
  box-shadow: var(--shadow);
  animation: rise .35s ease both;
}
.hero-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.hero h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .iconbtn { width: 30px; height: 30px; }
.hero-tag { margin: 6px 0 0; font-style: italic; color: var(--muted); font-size: 14px; }
.hero-p { margin: 14px 0 0; color: var(--text); font-size: 15px; line-height: 1.68; }
.hero-close {
  margin: 18px 0 0;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--gradsoft);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  letter-spacing: .01em;
}


/* ---------------- storage bar ---------------- */
.storbar {
  height: 10px;
  border-radius: 99px;
  background: var(--surface2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.storbar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--grad);
  transition: width .6s ease, background .3s ease;
}
.stor-meta { margin: 9px 0 0; font-size: 12.5px; }


/* ---------------- website embed ---------------- */
.webembed {
  border: 1px solid var(--border2);
  border-radius: 14px;
  overflow: hidden;
  margin: 0 0 12px;
}
.webbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.webbar .picon { width: 24px; height: 24px; border-radius: 7px; }
.webbar .picon svg { width: 13px; height: 13px; }
.webhost { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.webopen { margin-left: auto; width: 28px; height: 28px; flex: none; }
.webph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.webph .picon { width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); }
.webph .picon svg { width: 30px; height: 30px; }
.webembed iframe { width: 100%; height: 480px; border: 0; display: block; background: #fff; }
@media (max-width: 480px) { .webembed iframe { height: 420px; } }


/* ---------------- share / edit / deep-link highlight ---------------- */
.act.share { color: var(--muted); }
.act.share:hover { color: var(--text); }
.act.edit { color: var(--muted); }
.act.edit:hover { color: #fbbf24; }
.post.flash { animation: postflash 2.6s ease 1; }
@keyframes postflash {
  0% { box-shadow: 0 0 0 3px rgba(251, 191, 36, .8); transform: scale(1.008); }
  60% { box-shadow: 0 0 0 3px rgba(251, 191, 36, .35); transform: scale(1); }
  100% { box-shadow: 0 0 0 3px rgba(251, 191, 36, 0); }
}


/* ---------------- contact & inbox ---------------- */
.chanrow { display: flex; gap: 9px; flex-wrap: wrap; }
.chanbtn {
  flex: 1; min-width: 104px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px; font-weight: 700;
  text-decoration: none;
  transition: .18s;
}
.chanbtn:hover { border-color: var(--accent); transform: translateY(-1px); }
.chanbtn svg { width: 17px; height: 17px; }
.disclaim { margin: 14px 0 0; font-size: 11.5px; color: var(--faint); text-align: center; line-height: 1.5; }
.msg-item { border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; margin-bottom: 9px; background: var(--surface2); }
.msg-item.unread { border-color: var(--accent); background: var(--gradsoft); }
.msg-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.msg-meta b { color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time { margin-left: auto; flex: none; }
.msg-body { margin: 7px 0 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.msg-foot .iconbtn { width: 26px; height: 26px; }


/* ---------------- bottom tab bar ---------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  padding: 6px 8px calc(7px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.tabbtn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px 5px;
  background: none; border: 0;
  color: var(--muted);
  font-size: 11px; font-weight: 700; font-family: inherit;
  border-radius: 12px;
  transition: color .15s;
  cursor: pointer;
}
.tabbtn svg { width: 22px; height: 22px; }
.tabbtn.on { color: var(--accent); }
.tabbtn.on svg { filter: drop-shadow(0 0 8px rgba(251,191,36,.55)); }

/* ---------------- search ---------------- */
.searchwrap {
  position: sticky; top: calc(61px + var(--safe-t));
  z-index: 29;
  padding: 10px 16px 12px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.sinput { width: 100%; }

/* ---------------- month markers ---------------- */
.monthmark {
  display: flex; align-items: center; gap: 12px;
  margin: 26px 0 14px;
  color: var(--faint);
  font-size: 11.5px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
}
.monthmark::before, .monthmark::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------------- back-to-top ---------------- */
.fab.totop {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
}

/* ---------------- lift above the tab bar ---------------- */
.fab { bottom: calc(88px + var(--safe-b)); }
.fab.totop { bottom: calc(80px + var(--safe-b)); }
.toasts { bottom: calc(86px + var(--safe-b)); }
body { padding-bottom: calc(66px + var(--safe-b)); }

@media (min-width: 680px) {
  .tabbar {
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(94vw, 620px);
    border: 1px solid var(--border); border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }
  .searchwrap { padding-left: max(16px, calc(50vw - 310px)); padding-right: max(16px, calc(50vw - 310px)); }
}


/* ---------------- library ---------------- */
.libhead { padding: 22px 2px 6px; }
.libhead h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.libhead p { margin: 0; color: var(--muted); font-size: 14px; }
.libcard {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 18px;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.libcard:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 14px 34px rgba(0, 0, 0, .3); }
.liblink { display: block; color: var(--text); text-decoration: none; }
.libcover { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.libcover.libph { display: grid; place-items: center; background: var(--gradsoft); color: var(--accent); }
.libcover.libph svg { width: 44px; height: 44px; opacity: .8; }
.libmeta { padding: 14px 16px 16px; }
.libbadge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 7px; }
.libmeta h3 { margin: 0 0 6px; font-size: 17.5px; line-height: 1.3; letter-spacing: -.01em; }
.libmeta p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.libedit, .libdel {
  position: absolute; top: 10px;
  width: 34px; height: 34px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
}
.libedit { right: 52px; }
.libdel { right: 10px; }

/* ---------------- html project upload ---------------- */
.dropremove {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--muted); font-size: 12.5px; font-weight: 700;
}
.dropremove:hover { color: var(--danger); border-color: var(--danger); }


/* ---------------- project reader (fullscreen) ---------------- */
.modal.project { align-items: stretch; padding: 0; }
.projwrap { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; background: var(--bg); }
.projbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-t)) 12px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex: none;
}
.projbar b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.modal.project iframe { flex: 1; width: 100%; border: 0; display: block; background: #fff; }
.projload { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--muted); font-size: 14px; font-weight: 600; }
