:root { --bg:#111; --fg:#eee; --muted:#888; --card:#1c1c1c; --line:#2c2c2c; --red:#e53935; --ok:#66bb6a; }
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin:0 auto; background:var(--bg); color:var(--fg); font:16px/1.5 -apple-system, system-ui, sans-serif;
       padding: 0 16px 40px; max-width:720px; }
[hidden] { display:none !important; }

.bar { display:flex; align-items:center; gap:10px; padding: calc(env(safe-area-inset-top) + 8px) 0 8px; }
.icon { background:none; border:0; color:var(--fg); padding:6px; cursor:pointer; display:flex; }
#title { font-weight:600; }
#menu { position:absolute; z-index:10; background:#222; border:1px solid var(--line); border-radius:10px;
        display:flex; flex-direction:column; min-width:210px; overflow:hidden; box-shadow:0 8px 24px rgba(0,0,0,.5); }
#menu button { background:none; border:0; color:var(--fg); text-align:left; padding:13px 16px; font-size:16px; cursor:pointer; }
#menu button + button { border-top:1px solid var(--line); }
#menu button:hover { background:#2a2a2a; }

header { text-align:center; padding:24px 0 12px; }
#btn { width:140px; height:140px; border-radius:50%; border:6px solid #333; background:var(--red);
       color:#fff; font-size:20px; font-weight:600; cursor:pointer; -webkit-tap-highlight-color:transparent; }
#btn.rec { border-radius:24px; animation:pulse 1.4s infinite; }
#btn:disabled { background:#444; cursor:wait; }
@keyframes pulse { 50% { box-shadow:0 0 0 18px rgba(229,57,53,.15); } }
#status { color:var(--muted); margin-top:14px; min-height:1.5em; }

.item { background:var(--card); border-radius:12px; padding:14px 16px; margin:14px 0; }
.item .meta { font-size:14px; color:var(--muted); display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.item .actions { display:flex; gap:6px; flex-wrap:wrap; }
.notes h2 { font-size:15px; margin:14px 0 4px; }
.notes ul { margin:4px 0; padding-left:20px; }
details { margin-top:10px; color:#bbb; font-size:14px; }
details pre { white-space:pre-wrap; font:inherit; }
button.small { background:none; border:1px solid #444; color:var(--muted); border-radius:6px; font-size:12px; padding:3px 9px; cursor:pointer; }
.badge { font-size:12px; color:var(--ok); }
audio { width:100%; margin-top:10px; }
.err { color:#ff8a80; }
.empty { color:var(--muted); text-align:center; margin-top:40px; }

#toast { position:fixed; left:50%; bottom:calc(env(safe-area-inset-bottom) + 20px); transform:translateX(-50%);
         background:#333; color:#fff; padding:10px 16px; border-radius:10px; max-width:calc(100% - 32px); font-size:14px; }
