:root { --main:#30507a; --bg:#f3f4f6; --card:#fff; --line:#dde1e6; --muted:#6b7280; --must:#fff7e0; --mustline:#f0c24b; --ok:#2e7d4f; --warn:#c0392b; }
* { box-sizing: border-box; }
body { margin:0; font-family: -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; background:var(--bg); color:#1f2937; font-size:15px; line-height:1.55; padding-bottom: env(safe-area-inset-bottom); }
.top { position:sticky; top:0; z-index:5; display:flex; align-items:center; justify-content:space-between; background:var(--main); color:#fff; padding:10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); }
.brand { font-weight:700; cursor:pointer; }
.icon-btn { background:transparent; border:0; color:#fff; font-size:20px; cursor:pointer; }
.tabs { display:flex; background:#fff; border-bottom:1px solid var(--line); position:sticky; top:44px; z-index:4; }
.tabs button { flex:1; border:0; background:none; padding:10px 4px; font-size:14px; color:var(--muted); border-bottom:3px solid transparent; cursor:pointer; }
.tabs button.on { color:var(--main); border-bottom-color:var(--main); font-weight:700; }
.badge { display:inline-block; min-width:18px; padding:0 5px; border-radius:9px; background:var(--main); color:#fff; font-size:12px; }
.badge:empty { display:none; }
.badge.warn { background:var(--warn); }
main { max-width:760px; margin:0 auto; padding:12px; }
.muted { color:var(--muted); }
.center { text-align:center; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin-bottom:10px; }
.item { cursor:pointer; }
.item:active { background:#eef2f7; }
.item .t { font-weight:700; }
.item .meta { font-size:12px; color:var(--muted); margin-top:2px; }
.item .s { font-size:13px; margin-top:6px; color:#374151; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pri-urgent { border-left:5px solid var(--warn); }
.pri-high { border-left:5px solid #e67e22; }
.origin { font-size:12px; background:#eef2f7; border-radius:8px; padding:8px 10px; margin-bottom:10px; }
.origin b { color:var(--main); }
.origin .row { margin:1px 0; }
.must { background:var(--must); border:2px solid var(--mustline); border-radius:12px; padding:12px 14px; margin-bottom:12px; }
.sec-h { font-weight:700; font-size:13px; color:#8a6100; margin-bottom:6px; }
.summary { font-size:16px; font-weight:700; margin-bottom:8px; }
.ask { background:#fff; border-radius:8px; padding:8px 10px; margin:8px 0; white-space:pre-wrap; }
.ask-h { font-size:12px; color:var(--muted); }
table.w5 { width:100%; border-collapse:collapse; font-size:14px; background:#fff; border-radius:8px; overflow:hidden; }
table.w5 th { width:5.5em; text-align:left; vertical-align:top; background:#fdf1cf; padding:6px 8px; font-weight:600; white-space:nowrap; border-bottom:1px solid #f3e2ad; }
table.w5 td { padding:6px 8px; white-space:pre-wrap; border-bottom:1px solid #f3e2ad; }
.imgs { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.imgs figure { margin:0; width:calc(50% - 4px); }
.imgs img { width:100%; border-radius:6px; border:1px solid var(--line); cursor:zoom-in; background:#fff; }
.imgs figcaption { font-size:12px; color:var(--muted); }
.choices { display:flex; flex-direction:column; gap:8px; margin:10px 0; }
.choice { text-align:left; border:2px solid var(--line); background:#fff; border-radius:10px; padding:12px 12px; font-size:15px; cursor:pointer; }
.choice .k { display:inline-block; width:1.8em; height:1.8em; line-height:1.8em; text-align:center; border-radius:50%; background:#e5e7eb; font-weight:700; margin-right:8px; }
.choice .d { display:block; font-size:13px; color:var(--muted); margin-top:4px; margin-left:2.6em; }
.choice.sel { border-color:var(--main); background:#eaf1fb; }
.choice.sel .k { background:var(--main); color:#fff; }
.rec { font-size:11px; background:var(--ok); color:#fff; border-radius:4px; padding:1px 6px; margin-left:6px; vertical-align:middle; }
textarea { width:100%; min-height:80px; border:1px solid var(--line); border-radius:8px; padding:8px; font-size:15px; font-family:inherit; }
.btn { border:0; border-radius:10px; padding:12px 16px; font-size:15px; font-weight:700; cursor:pointer; }
.btn.primary { background:var(--main); color:#fff; width:100%; margin-top:8px; }
.btn.primary:disabled { opacity:.45; }
.btn.sub { background:#e5e7eb; color:#374151; }
.btn.small { padding:6px 10px; font-size:13px; font-weight:600; }
.row-btns { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
details.ref { background:#fff; border:1px solid var(--line); border-radius:10px; padding:10px 14px; margin-bottom:12px; }
details.ref summary { cursor:pointer; font-weight:700; color:var(--muted); }
.md h1, .md h2, .md h3 { font-size:15px; margin:12px 0 4px; }
.md pre { background:#f3f4f6; padding:8px; border-radius:6px; overflow:auto; font-size:12px; }
.md code { background:#f3f4f6; padding:0 3px; border-radius:3px; }
.md ul { padding-left:1.3em; margin:4px 0; }
.md p { margin:4px 0; }
.answered { background:#e8f5ec; border:1px solid #b9dfc6; border-radius:10px; padding:10px 14px; margin-bottom:12px; }
.log { font-size:12px; color:var(--muted); margin-top:6px; }
.log div { border-top:1px dashed var(--line); padding:2px 0; }
.st { font-size:12px; font-weight:700; padding:1px 6px; border-radius:4px; }
.st.delivered, .st.ai_received { background:#d9f0e1; color:var(--ok); }
.st.waiting { background:#fff2cc; color:#8a6100; }
.st.failed { background:#fde2e0; color:var(--warn); }
.st.cancelled { background:#e5e7eb; color:#555; }
.viewer { display:none; position:fixed; inset:0; background:rgba(0,0,0,.9); z-index:20; align-items:center; justify-content:center; }
.viewer.on { display:flex; }
.viewer img { max-width:100%; max-height:100%; }
.toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); background:#111827; color:#fff; padding:8px 14px; border-radius:8px; font-size:14px; opacity:0; transition:opacity .2s; pointer-events:none; z-index:30; }
.toast.on { opacity:.95; }
.back { display:inline-block; margin-bottom:8px; color:var(--main); cursor:pointer; font-size:14px; }
