:root{
  --bg:#0b0c10;
  --card:#11131a;
  --text:#e8e9ee;
  --muted:#9aa0aa;
  --line:#202431;
  --primary:#5b8cff;
  --danger:#ff5b6e;
  --ok:#59d38c;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  --vv-offset: 0px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  background:linear-gradient(180deg, #07080b 0%, var(--bg) 60%, #07080b 100%);
  color:var(--text);
}
button, input, textarea, select{
  font-family:var(--sans);
}
.topbar{
  position:sticky;
  top:0;
  z-index:5;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  background:rgba(11,12,16,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.brand{font-weight:700; letter-spacing:.3px}
.topbar{display:none}
.mono{font-family:var(--mono); color:var(--muted); font-size:12px}
.author-code{
  font-family:inherit;
  color:var(--muted);
  font-size:12px;
  cursor:pointer;
  user-select:none;
}
.author-code.me{
  color: rgba(255,255,255,.92);
}
.author-code.following{
  color:#cde2ff;
  text-shadow: 0 0 20px rgba(91,140,255,.25);
}
.follow-mark{
  margin-right:4px;
  font-weight:700;
}
.follow-mark.out{color:#59c8a5}
.follow-mark.in{color:#6fa9ff}
.follow-mark.mutual{
  color:#5cff87;
  text-shadow: 0 0 12px rgba(92,255,135,.35);
}
.author-code:hover{color:var(--text)}
.main{padding:12px 12px 90px}
.view{max-width:720px; margin:0 auto}
.hidden{display:none !important}
.sentinel{height:1px}
.bottom-nav{
  position:fixed;
  left:0; right:0; bottom:0;
  height:64px;
  display:flex;
  background: linear-gradient(180deg, rgba(17,19,26,.55) 0%, rgba(17,19,26,.92) 55%, rgba(17,19,26,.96) 100%);
  border-top:1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  transition: transform .18s ease;
  z-index:6;
  box-shadow: 0 -10px 30px rgba(0,0,0,.25);
}
.bottom-nav.hidden-ui{transform: translateY(80px)}
.tab{
  flex:1;
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:11px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:8px 0 10px;
  transition: color .15s ease;
}
.tab.active{color:var(--primary)}
.tab-icon{
  width:36px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tab.active .tab-icon{
  background: rgba(91,140,255,.18);
  border-color: rgba(91,140,255,.38);
  box-shadow: 0 10px 20px rgba(91,140,255,.10);
}
.tab:active .tab-icon{transform: scale(.98)}
.tab-icon svg{
  width:20px;
  height:20px;
  display:block;
}
.tab-label{line-height:1}
.tab.active .tab-label{font-weight:600}
.fab{
  position:fixed;
  right:18px;
  bottom:86px;
  width:52px;
  height:52px;
  border-radius:26px;
  border:0;
  background:var(--primary);
  color:white;
  font-size:30px;
  box-shadow: var(--shadow);
  cursor:pointer;
  transition: transform .18s ease, opacity .18s ease;
  z-index:7;
}
.fab.hidden-ui{transform: translateY(90px); opacity:0}
.card{
  background:rgba(17,19,26,.85);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:10px 10px 6px;
  margin:6px 0;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.card .meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:var(--muted);
  font-size:12px;
}
.badge{
  padding:2px 8px;
  border-radius: 999px;
  border:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
}
.badge .unit-num{color:currentColor; font-weight:700}
.badge .unit-unit{color:var(--muted); font-family:var(--mono); font-weight:700; margin-left:1px}
.badge .unit-tail{color:var(--muted)}
.badge.buffer{color:#bcdcff; border-color: rgba(91,140,255,.35); background: rgba(91,140,255,.08)}
.badge.public{color: #cde2ff; border-color: rgba(91,140,255,.5)}
.badge.private{color: #d6ffd6; border-color: rgba(89,211,140,.4)}
.badge.review{color:#ffe5b3; border-color: rgba(255,179,0,.4)}
.badge.locked{color:#ffb3bd; border-color: rgba(255,91,110,.4)}
.content{white-space:pre-wrap; line-height:1.55; margin:6px 0 3px; font-size:15px}
.actions-row{display:flex; gap:8px; flex-wrap:wrap}
.actions-row .btn{font-size:12px; padding:7px 10px}
.icon-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.icon{
  width:16px;
  height:16px;
  display:block;
}
.icon path{stroke-linecap:round; stroke-linejoin:round}
.btn.icon-btn{color:#cde2ff}
.btn.danger.icon-btn{color:#ffd1d8}
.btn.icon-btn.ghost.active{
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.18);
}
.btn.danger.icon-btn.ghost.active{
  background: rgba(255,91,110,.18);
  border-color: rgba(255,91,110,.55);
}
.btn{
  border:1px solid var(--line);
  background:transparent;
  color:var(--text);
  padding:8px 10px;
  border-radius: 12px;
  cursor:pointer;
  font-size:13px;
}
.btn.small{
  padding:6px 10px;
  border-radius: 10px;
  font-size:12px;
}
.btn.primary{background:var(--primary); border-color: rgba(91,140,255,.6)}
.btn.secondary{color:var(--muted)}
.btn.danger{background:rgba(255,91,110,.12); border-color: rgba(255,91,110,.4); color:#ffd1d8}
.muted{color:var(--muted)}
.modal{
  position:fixed;
  left:0; right:0; top:0; bottom:0;
  background: rgba(0,0,0,.55);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:12px;
  z-index:10;
}
#editor.modal{padding-bottom: calc(12px + var(--vv-offset))}
#reply.modal{padding-bottom: calc(12px + var(--vv-offset))}
#modal.modal{padding-bottom: calc(12px + var(--vv-offset))}
.modal-card{
  width:min(760px, 100%);
  background: rgba(17,19,26,.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding:10px 12px 8px;
  box-shadow: var(--shadow);
}
.modal-title{font-weight:700; font-size:14px; margin:0 0 8px}
.modal-title:empty{display:none}
.modal-body{color:var(--text); font-size:13px; line-height:1.55; white-space:pre-wrap; margin:4px 0 8px}
.modal-body:empty{display:none}
.textarea{
  width:100%;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.25);
  color:var(--text);
  padding:10px 12px;
  resize: vertical;
  outline:none;
  font-size:15px;
  line-height:1.5;
  field-sizing: content;
  min-height: calc(1.5em * 3 + 20px);
  max-height: calc(1.5em * 9 + 20px);
  overflow-y: auto;
}
.row{display:flex; gap:12px; align-items:center; margin-top:8px; color:var(--muted)}
.row.actions{justify-content:flex-end}
.row.actions.editor-actions{justify-content:center; margin-top:6px}
.row.editor-top{justify-content:flex-start; gap:14px; margin-top:0; margin-bottom:8px; font-size:12px}
.row.editor-top input{transform: translateY(1px)}
#editor.editing .editor-top{display:none}
#btnPublish{min-width:120px}
.hint{margin-top:8px; color:var(--muted); font-size:12px}
.hint:empty{display:none}
#editorHint{margin-top:6px}
.section-title{
  font-weight:700;
  margin:12px 6px 6px;
  color:var(--muted);
  font-size:12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.reactions-row{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  align-items:center;
  margin-top:10px;
}
.owner-actions{
  display:flex;
  justify-content:center;
  gap:10px;
  align-items:center;
  margin-top:10px;
  padding:10px;
  border-radius: 14px;
  background: rgba(91,140,255,.08);
  border: 1px solid rgba(91,140,255,.25);
}
.btn.ghost{
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.10);
}
.icon-plain{
  border:0;
  background:transparent;
  color:var(--muted);
  padding:6px 6px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  font-size:12px;
}
.icon-plain:hover{color:var(--text)}
.icon-plain.danger{color:#ffd1d8}
.icon-plain.danger:hover{color:#ffd1d8}
.icon-plain.active{color:var(--text)}
.icon-plain.danger.active{color:#ffd1d8}
.icon-plain.disabled{pointer-events:none}
.icon-plain .icon{width:16px; height:16px}

.phase{
  display:inline-flex;
  align-items:center;
  gap:4px;
}
.phase-bar{
  width:74px;
  height:6px;
  border-radius: 999px;
  background: var(--phase-bg);
  overflow:hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.phase-fill{
  height:100%;
  width:0%;
  border-radius: 999px;
  background: var(--phase-fill);
}
.phase-time{
  font-family: var(--mono);
  font-size:12px;
  color: var(--muted);
  min-width: 0;
  text-align:left;
}
.phase-time .num{color:var(--text); font-weight:700}
.phase-time .unit{color:var(--muted); font-weight:700; margin-left:1px}
.phase.buffer{--phase-bg: rgba(255,255,255,.12); --phase-fill: #3f8f78}
.phase.public{--phase-bg: #356aa6; --phase-fill: rgba(255,255,255,.22)}
.input{
  width:100%;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.25);
  color:var(--text);
  padding:10px 12px;
  outline:none;
}
.hint.small{font-size:12px; line-height:1.35}
.me-compact{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:baseline;
}
#viewMe .me-compact{font-size:13px}
#viewMe .me-setting{font-size:12px}
#viewMe .me-setting label{font-size:12px}
.subtabs{
  position:sticky;
  top:0;
  z-index:5;
  display:flex;
  gap:8px;
  padding:10px 2px;
  margin:10px 0 0;
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(11,12,16,.85);
  backdrop-filter: blur(10px);
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
}
.subtab{
  flex:0 0 auto;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  padding:8px 10px;
  border-radius: 999px;
  cursor:pointer;
  font-size:13px;
  white-space:nowrap;
}
.subtab.active{color:var(--text); border-color: rgba(91,140,255,.5); background: rgba(91,140,255,.08)}
.op-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  margin-top:4px;
  margin-bottom:-2px;
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
}
.op-row span{font-size:12px; line-height:1}
.response-card{
  margin-left:16px;
}
.detail-top{
  position:sticky;
  top:0;
  z-index:6;
  padding:8px 0;
  background: rgba(11,12,16,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.search-center{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:center;
  margin: 26vh 0 18px;
}
.search-top.sticky{
  position:sticky;
  top:0;
  z-index:6;
  display:flex;
  gap:8px;
  padding:10px 0;
  background: rgba(11,12,16,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.toast{
  position:fixed;
  top:10px;
  left:50%;
  transform: translateX(-50%);
  z-index:12;
  background: rgba(17,19,26,.94);
  border:1px solid rgba(91,140,255,.45);
  color: var(--text);
  padding:10px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  max-width: min(560px, calc(100% - 24px));
  cursor:pointer;
  user-select:none;
}

.pwa-prompt{
  position:fixed;
  left:12px;
  right:12px;
  bottom:calc(74px + env(safe-area-inset-bottom, 0px));
  z-index:13;
}
.pwa-prompt-card{
  max-width:720px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 10px;
  background: rgba(17,19,26,.92);
  border:1px solid rgba(91,140,255,.28);
  border-radius: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.pwa-prompt-text{
  color:var(--text);
  font-size:12px;
  line-height:1.35;
}
.pwa-prompt-actions{
  display:inline-flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}
