/* Loose Talk — Instagram-style light UI */
:root {
  --bg: #fafafa; --surface: #ffffff; --line: #dbdbdb; --line-soft: #efefef;
  --text: #262626; --muted: #8e8e8e; --blue: #0095f6; --blue-dark: #1877f2;
  --red: #ed4956; --wave: #d8d8d8; --wave-on: #262626;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.45; }
body { padding-bottom: 64px; max-width: 480px; margin: 0 auto; min-height: 100vh;
  background: var(--surface); border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; margin: 4px 0 12px;
  font: inherit; outline: none; }
input:focus, textarea:focus { border-color: #a8a8a8; }
textarea { min-height: 64px; resize: vertical; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }
hr { border: none; border-top: 1px solid var(--line-soft); margin: 16px 0; }
.field-label { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---- top bar ---- */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; position: sticky; top: 0; z-index: 10;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-family: 'Snell Roundhand', 'Brush Script MT', 'Segoe Script', cursive;
  font-size: 26px; font-weight: 600; letter-spacing: .5px; }
.brand-big { font-size: 42px; text-align: center; margin-bottom: 6px; }
.topbar-me { font-weight: 600; font-size: 14px; color: var(--text); }

/* ---- buttons ---- */
button.primary { display: block; width: 100%; background: var(--blue); color: #fff;
  font-weight: 600; padding: 11px; border-radius: 8px; }
button.primary:disabled { opacity: .4; cursor: default; }
button.ghost { display: block; width: 100%; background: var(--surface); color: var(--text);
  font-weight: 600; border: 1px solid var(--line); padding: 10px; border-radius: 8px; margin-top: 8px; }
button.danger-ghost { display: block; width: 100%; color: var(--red); font-weight: 600;
  border: 1px solid var(--line); padding: 10px; border-radius: 8px; background: var(--surface); }
button.linklike { color: var(--blue); font-weight: 600; padding: 0; }

/* ---- onboarding ---- */
.onboard { display: flex; flex-direction: column; gap: 12px; align-items: center;
  justify-content: center; min-height: 80vh; padding: 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px 36px; width: 100%; max-width: 360px; }
.auth-alt { padding: 18px 36px; }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid;
  place-items: center; z-index: 40; padding: 20px; }
.modal-inner { background: var(--surface); border-radius: 14px; padding: 24px;
  width: 100%; max-width: 380px; }
.modal-inner h2 { margin: 0 0 8px; font-size: 17px; }
.check-row { display: flex; gap: 8px; align-items: center; font-size: 13px;
  margin: 10px 0 14px; cursor: pointer; }
.check-row input { width: auto; margin: 0; }

/* ---- feed chrome ---- */
.screen { padding: 0 0 16px; }
.scope-row { display: flex; border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 49px; z-index: 9; }
.scope { flex: 1; padding: 12px 0; font-weight: 600; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; }
.scope.active { color: var(--text); border-bottom-color: var(--text); }
.tabs { display: flex; gap: 8px; padding: 10px 16px 2px; }
.tab { color: var(--muted); font-weight: 600; font-size: 13px; padding: 5px 12px;
  border: 1px solid var(--line); border-radius: 999px; }
.tab.active { color: var(--surface); background: var(--text); border-color: var(--text); }
.feedlist { display: flex; flex-direction: column; }
.empty { text-align: center; color: var(--muted); padding: 60px 24px; }

/* ---- post ---- */
.post { border-bottom: 1px solid var(--line-soft); padding: 12px 0 14px; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 0 16px 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid;
  place-items: center; font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af); }
.post-head .names { line-height: 1.25; }
.post-head .handle { font-weight: 600; font-size: 14px; cursor: pointer; }
.post-head .when { color: var(--muted); font-size: 12px; }
.followbtn { margin-left: auto; color: var(--blue); font-weight: 600; font-size: 13px; }
.followbtn:disabled { color: var(--muted); }

.player { display: flex; align-items: center; gap: 12px; margin: 0 16px;
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; }
.play-toggle { width: 42px; height: 42px; border-radius: 50%; background: var(--text);
  color: #fff; font-size: 15px; flex: none; display: grid; place-items: center; }
.wave { flex: 1; height: 34px; display: flex; align-items: center; gap: 2px; overflow: hidden; }
.wave i { flex: 1; background: var(--wave); border-radius: 2px; min-width: 2px; }
.wave i.on { background: var(--wave-on); }
.dur { color: var(--muted); font-size: 12px; min-width: 34px; text-align: right; }

.post-foot { display: flex; align-items: center; gap: 4px; padding: 8px 12px 0; }
.react { font-size: 17px; padding: 5px 7px; border-radius: 8px; filter: grayscale(.35); opacity: .8; }
.react.mine { filter: none; opacity: 1; background: var(--line-soft); }
.iconbtn { padding: 5px 7px; }
.iconbtn svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; display: block; }
.spacer { flex: 1; }
.counts { padding: 6px 16px 0; font-weight: 600; font-size: 13px; }
.caption { padding: 3px 16px 0; font-size: 14px; margin: 0; }
.caption b { font-weight: 600; }
.view-comments { display: block; color: var(--muted); font-size: 13px; padding: 4px 16px 0; }

/* ---- comments ---- */
.comments { padding: 6px 16px 0; display: none; }
.comments.open { display: block; }
.comment { display: flex; gap: 10px; padding: 7px 0; align-items: flex-start; }
.comment .avatar { width: 28px; height: 28px; font-size: 12px; }
.comment .c-body { flex: 1; font-size: 13px; }
.comment .c-handle { font-weight: 600; cursor: pointer; }
.comment .c-when { color: var(--muted); font-size: 11px; margin-left: 6px; }
.comment audio { width: 100%; height: 32px; margin-top: 4px; }
.c-input-row { display: flex; gap: 8px; margin-top: 8px; align-items: center;
  border-top: 1px solid var(--line-soft); padding-top: 10px; }
.c-input-row input { margin: 0; border: none; background: none; padding: 6px 0; }
.c-input-row .iconbtn { flex: none; font-size: 18px; }
.c-send { color: var(--blue); font-weight: 600; flex: none; }
.c-send:disabled { opacity: .4; }
.c-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

/* ---- sheets ---- */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid;
  align-items: end; z-index: 20; }
.sheet-inner { background: var(--surface); border-radius: 16px 16px 0 0; padding: 10px 22px 26px;
  max-width: 480px; margin: 0 auto; width: 100%; position: relative; }
.sheet-grab { width: 38px; height: 4px; border-radius: 2px; background: var(--line);
  margin: 4px auto 12px; }
.sheet-close { position: absolute; top: 16px; right: 16px; color: var(--muted); font-size: 16px; }
.sheet h2 { margin: 0 0 4px; font-size: 17px; }

/* ---- recorder ---- */
.meter { height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden; margin: 14px 0 6px; }
.meter-bar { height: 100%; width: 0%; background: var(--blue); transition: width .05s; }
.timer { font-size: 32px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.rec-btn { width: 72px; height: 72px; border-radius: 50%; margin: 14px auto; display: block;
  border: 4px solid var(--line); background: var(--surface); position: relative; }
.rec-btn::after { content: ''; position: absolute; inset: 8px; border-radius: 50%;
  background: var(--red); transition: border-radius .15s, inset .15s; }
.rec-btn.recording::after { inset: 16px; border-radius: 6px; }
.rec-btn.recording { animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(237,73,86,.35); } 100% { box-shadow: 0 0 0 16px rgba(237,73,86,0); } }
#recActions { display: flex; gap: 8px; }
#recActions button { margin-top: 0; }
#recActions .primary { flex: 1.4; width: auto; }
#recActions .ghost { flex: 1; width: auto; }

/* ---- bottom nav ---- */
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  display: flex; background: var(--surface); border-top: 1px solid var(--line); z-index: 15; }
.bottomnav button { flex: 1; padding: 11px 0 max(11px, env(safe-area-inset-bottom)); display: grid; place-items: center; }
.bottomnav svg { width: 26px; height: 26px; fill: none; stroke: var(--text); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.bottomnav button.active svg { stroke-width: 2.6; }
.bottomnav svg .thin { stroke-width: 1.7 !important; }

/* ---- profile ---- */
.profile-head { padding: 20px 16px 8px; border-bottom: 1px solid var(--line-soft); }
.profile-top { display: flex; align-items: center; gap: 22px; }
.profile-top .avatar { width: 76px; height: 76px; font-size: 30px; }
.stats { display: flex; flex: 1; justify-content: space-around; text-align: center; }
.stats b { display: block; font-size: 17px; }
.stats span { color: var(--muted); font-size: 12px; }
.profile-bio { margin: 12px 0 4px; }
.profile-bio .p-handle { font-weight: 600; }
.profile-head .primary { margin-top: 12px; }

/* ---- toast ---- */
.toast { position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%);
  background: #262626; color: #fff; padding: 11px 18px; border-radius: 8px;
  z-index: 50; max-width: 90%; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
