body { font-family: system-ui, sans-serif; margin: 0; padding: 24px 16px; background: #fff; color: #111; }
main { max-width: 640px; margin: 0 auto; }
pre { background: #f4f4f5; padding: 12px; border-radius: 6px; overflow-x: auto; }
.err { color: #b00020; }
#library select, #library input { display: block; width: 100%; margin: 8px 0; padding: 8px; font-size: 16px; box-sizing: border-box; }
ul.rows { list-style: none; padding: 0; margin: 0; }
ul.rows li { border-bottom: 1px solid #ddd; }
button.row { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px 0; color: inherit; font: inherit; cursor: pointer; }
button.row .title { display: block; font-weight: 600; }
.meta { display: block; font-size: 13px; color: #666; }
pre.doc { white-space: pre-wrap; word-break: break-word; }
.dropzone { border: 2px dashed #bbb; border-radius: 8px; padding: 32px 12px; text-align: center; margin: 12px 0; }
.dropzone.over { border-color: #111; }
ul.rows li .title { display: block; font-weight: 600; padding-top: 8px; }
@media (prefers-color-scheme: dark) { body { background: #111; color: #eee; } pre { background: #222; } ul.rows li { border-color: #333; } .meta { color: #999; } }

.ph { font-family: Inter, system-ui, sans-serif; color: var(--fg); background: var(--bg); padding-bottom: 88px; }
:root { --fg: #15181d; --muted: #5b6470; --line: #eef0f3; --bg: #ffffff; --link: #1d4ed8; --warn-bg: #fdf6ec;
        --warn-line: #f3d9b8; --warn: #8a4b0f; --ok: #1f6b3a; --bad: #b00020; --bar: #e3e6ea; }
@media (prefers-color-scheme: dark) { :root { --fg: #eceff3; --muted: #9aa3ad; --line: #262a30; --bg: #111317;
        --link: #8ab4ff; --warn-bg: #2a2116; --warn-line: #5a4220; --warn: #f0b36a; --ok: #6fcf8f; --bad: #ff8a8a;
        --bar: #262a30; } }
.ph header { padding: 16px 16px 12px; border-bottom: 1px solid var(--bar); }
.ph header .back { font-size: 14px; color: var(--link); text-decoration: none; display: inline-block; min-height: 44px;
        line-height: 44px; }
.ph header .over { font-size: 12px; font-weight: 500; color: var(--muted); display: block; }
.ph header h1 { margin: 0; font-size: 24px; font-weight: 700; }
.ph header .sub { font-size: 13px; color: var(--muted); display: block; }
.ph h2 { margin: 0; padding: 18px 16px 6px; font-size: 12px; font-weight: 600; color: var(--muted);
        text-transform: uppercase; letter-spacing: 0.06em; }
.ph ul { list-style: none; margin: 0; padding: 0; }
.ph li { border-bottom: 1px solid var(--line); }
.ph .row { min-height: 56px; padding: 10px 16px; display: flex; align-items: center; gap: 12px; color: inherit;
        text-decoration: none; box-sizing: border-box; width: 100%; background: none; border: 0; font: inherit;
        text-align: left; cursor: pointer; }
.ph .row .main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ph .row .title { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.ph .row .meta { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ph .tag { flex: none; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; border: 1px solid var(--bar);
        color: var(--muted); }
.ph .dot { flex: none; width: 10px; height: 10px; border-radius: 5px; background: var(--muted); }
.ph .dot.on { background: var(--ok); }
.ph .waiting { margin: 16px 16px 4px; padding: 12px 16px; border: 1px solid var(--warn-line); background: var(--warn-bg);
        border-radius: 12px; display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.ph .waiting .count { font-size: 22px; font-weight: 700; color: var(--warn); }
.ph .bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.ph .bar span { display: block; height: 100%; background: var(--ok); }
.ph .refused { color: var(--bad); padding: 10px 16px; font-size: 14px; }
.ph .empty { color: var(--muted); padding: 10px 16px; font-size: 14px; }
.ph .detail { padding: 4px 16px 12px; font-size: 14px; }
.ph .detail .words { color: var(--muted); }
.ph .md { padding: 0 16px 12px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.ph .md code { background: var(--line); padding: 0 3px; border-radius: 3px; }
.ph details > summary { list-style: none; }
.ph nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: 72px; border-top: 1px solid var(--bar);
        background: var(--bg); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ph nav.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
        text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; }
.ph nav.tabs a[aria-current="page"] { color: var(--link); font-weight: 600; }
