:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --ok: #16a34a;
  --okbg: #ecfdf5;
  --err: #dc2626;
  --errbg: #fef2f2;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 8px 24px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  padding-bottom: env(safe-area-inset-bottom);
}
main { max-width: 720px; margin: 0 auto; padding: 0 16px 40px; }

.app-header {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: #fff; text-align: center;
  padding: 28px 16px 24px; margin-bottom: 20px;
}
.app-header h1 { margin: 0; font-size: 1.45rem; letter-spacing: .01em; }
.tagline { margin: 8px 0 0; opacity: .85; font-size: .9rem; }
.tagline b { color: #93c5fd; font-weight: 600; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 18px;
}

/* ドロップゾーン */
.dropzone {
  display: block; border: 2px dashed #cbd5e1; border-radius: var(--radius);
  padding: 30px 16px; text-align: center; cursor: pointer;
  transition: .15s; background: #f8fafc;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: #eff6ff; }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--okbg); }
.dz-icon { font-size: 2rem; }
.dz-text { font-weight: 600; margin-top: 6px; }
.dz-sub { color: var(--muted); font-size: .82rem; margin-top: 4px; }

/* 入り口の2系統ガイド */
.intake { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.intake-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: .9rem; font-weight: 600; color: var(--ink);
}
.intake-no { color: var(--accent); font-weight: 700; }
.intake-item small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; margin-top: 2px; }

/* URLから取り込み */
.url-sep { text-align: center; color: var(--muted); font-size: .78rem; margin: 14px 0 8px; }
.url-intake { display: flex; gap: 8px; }
.url-field {
  flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: .95rem; font-family: inherit; background: #fff; color: var(--ink);
}
.url-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.url-intake .url-btn { width: auto; margin-top: 0; white-space: nowrap; flex-shrink: 0; }
.url-hint { margin-top: 8px; }

/* 取り込み方ガイド */
.guide { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.guide > summary { cursor: pointer; padding: 11px 13px; font-size: .86rem; font-weight: 600; color: var(--ink); list-style: none; }
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary::before { content: "▸ "; color: var(--muted); }
.guide[open] > summary::before { content: "▾ "; }
.guide-body { padding: 0 14px 12px; font-size: .85rem; line-height: 1.6; }
.guide-body h4 { margin: 12px 0 4px; font-size: .85rem; color: var(--accent); }
.guide-body ol, .guide-body ul { margin: 4px 0; padding-left: 20px; }
.guide-body li { margin: 3px 0; }
.guide-body code { background: #eef2f7; border-radius: 5px; padding: 1px 5px; font-size: .8rem; }
.guide-note { color: #92400e; font-size: .8rem; margin: 8px 0 0; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 7px 10px; }

/* 入力フィールド */
.fields { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field .opt { font-weight: 400; color: #94a3b8; font-size: .75rem; }
.field input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ボタン */
.btn-primary, .btn-secondary {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  font-size: 1.02rem; font-weight: 700; cursor: pointer; margin-top: 18px;
  font-family: inherit; transition: .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #cbd5e1; cursor: not-allowed; }
.btn-secondary { background: #f1f5f9; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: #e2e8f0; }
.hint { font-size: .78rem; color: var(--muted); text-align: center; margin: 12px 0 0; }

/* 進捗 */
.progress-card { text-align: center; }
.spinner {
  width: 40px; height: 40px; margin: 4px auto 14px;
  border: 4px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-stage { font-size: 1.1rem; font-weight: 700; }
.progress-detail { color: var(--muted); font-size: .85rem; min-height: 1.2em; }
.progress-elapsed { color: #94a3b8; font-size: .8rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.steps { list-style: none; padding: 0; margin: 18px 0 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.steps li {
  font-size: .78rem; color: var(--muted); padding: 5px 11px;
  border-radius: 999px; background: #f1f5f9; border: 1px solid var(--line);
}
.steps li.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.steps li.done { background: var(--okbg); color: var(--ok); border-color: #bbf7d0; }

/* エラー */
.error-card { border-color: #fecaca; background: var(--errbg); }
.error-title { font-weight: 700; color: var(--err); }
.error-msg { margin: 8px 0 4px; font-size: .92rem; white-space: pre-wrap; }

/* 結果 */
.saved-banner {
  background: var(--okbg); border: 1px solid #bbf7d0; color: #166534;
  border-radius: var(--radius); padding: 12px 14px; font-size: .88rem; margin-bottom: 14px;
}
.saved-banner b { color: #15803d; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 10px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; font-size: .9rem; font-weight: 600; cursor: pointer; color: var(--muted);
  font-family: inherit;
}
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Threads/X投稿カード */
.xpost {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
.xpost-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.xpost-label { font-size: .8rem; font-weight: 700; color: var(--accent); }
.xpost-body { white-space: pre-wrap; font-size: .98rem; }
.xpost-count { font-size: .75rem; color: var(--muted); margin-top: 8px; text-align: right; }

/* コピー */
.btn-copy {
  border: 1px solid var(--line); background: #fff; color: var(--accent);
  border-radius: 8px; padding: 6px 12px; font-size: .8rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn-copy:hover { background: #eff6ff; }
.btn-copy.copied { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-copy.posted { background: var(--ok); color: #fff; border-color: var(--ok); }
.panel-actions { display: flex; justify-content: flex-end; margin-bottom: 10px; }

/* Threads/X投稿カードのボタン群 */
.xpost-actions { display: flex; gap: 6px; }
.btn-x { background: #0f172a; color: #fff; border-color: #0f172a; }
.btn-x:hover { background: #000; }
.btn-threads { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-threads:hover { filter: brightness(1.08); }
.btn-x.posted { background: var(--ok); border-color: var(--ok); }
.xpost-count.over { color: var(--err); font-weight: 600; }

/* タスク（Lark用）一覧 */
.task-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 14px; margin-bottom: 8px;
}
.task-text { flex: 1; white-space: pre-wrap; font-size: .95rem; line-height: 1.5; }
.task-row .btn-copy { flex: none; }

/* 最近の生成ビュー */
.recent-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.recent-head h2 { margin: 0; font-size: 1.2rem; }
.recent-item { margin-bottom: 24px; }
.recent-title { font-weight: 700; font-size: .95rem; margin: 12px 0 10px; padding-left: 8px; border-left: 3px solid var(--accent); }

/* 操作履歴（アクティビティ） */
.activity-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.activity-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.activity-label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.activity-time { flex: none; font-size: .75rem; color: var(--muted); }
.activity-detail { margin-top: 4px; font-size: .8rem; color: var(--muted); word-break: break-word; }
#activityClear { margin-top: 8px; }

/* 議事録Markdown表示 */
.md {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
}
.md h2 { font-size: 1.2rem; margin: 0 0 10px; }
.md h3 { font-size: 1.05rem; margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.md h4 { font-size: .95rem; margin: 14px 0 6px; color: #334155; }
.md ul { margin: 6px 0; padding-left: 22px; }
.md ul.tasks { list-style: none; padding-left: 4px; }
.md ul.tasks li { margin: 3px 0; }
.md p { margin: 8px 0; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

.transcript {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; white-space: pre-wrap;
  font-family: inherit; font-size: .92rem; max-height: 60vh; overflow: auto; margin: 0;
}
.hidden-raw { position: absolute; left: -9999px; opacity: 0; }
.hidden { display: none !important; }

.app-footer { text-align: center; color: var(--muted); font-size: .78rem; padding: 0 16px 30px; }

/* ログイン画面 */
.login-gate {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px 28px; text-align: center; max-width: 360px; width: 100%;
}
.login-emoji { font-size: 2.4rem; }
.login-card h2 { margin: 6px 0 4px; font-size: 1.3rem; }
.login-card #gbtn { display: flex; justify-content: center; margin: 18px 0 6px; }

@media (max-width: 480px) {
  .field-row { flex-direction: column; }
  .app-header h1 { font-size: 1.2rem; }
}

/* ═══════════════════════ 投稿管理ダッシュボード（queue.html） ═══════════════════════ */
/* ヘッダの「生成画面へ」戻りリンク */
.header-back {
  display: inline-block; margin-top: 12px; color: #bfdbfe; text-decoration: none;
  font-size: .82rem; font-weight: 600;
}
.header-back:hover { color: #fff; text-decoration: underline; }

/* 上部バー */
.queue-bar { display: flex; flex-direction: column; gap: 14px; }

/* 状態フィルタ chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: inherit; transition: .15s; line-height: 1.3;
}
.chip:hover { background: #f1f5f9; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-badge {
  display: inline-block; min-width: 1.4em; text-align: center;
  padding: 0 5px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: #f1f5f9; color: var(--muted);
}
.chip.active .chip-badge { background: rgba(255,255,255,.22); color: #fff; }

/* 接続状態 */
.conn-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.conn-pill {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600;
  border: 1px solid var(--line); background: #f8fafc; color: var(--muted);
}
.conn-pill.conn-ok { background: var(--okbg); color: #15803d; border-color: #bbf7d0; }
.conn-pill.conn-off { background: #f1f5f9; color: #94a3b8; }
.conn-pill.conn-dry { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.conn-pill.conn-auto { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

/* 会議グループ */
.mtg-group { margin-bottom: 22px; }
.mtg-title {
  font-size: .98rem; font-weight: 700; color: var(--ink); margin: 0 0 10px;
  padding-left: 10px; border-left: 3px solid var(--accent); line-height: 1.4;
}

/* 投稿カード */
.qcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 15px 16px; margin-bottom: 12px;
}
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; }
.q-label { font-size: .8rem; font-weight: 700; color: var(--accent); }

/* 状態バッジ */
.q-badge {
  flex: none; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  border: 1px solid var(--line); background: #f1f5f9; color: var(--muted); white-space: nowrap;
}
.q-badge-draft { background: #f1f5f9; color: #475569; border-color: var(--line); }
.q-badge-approved { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.q-badge-posted { background: var(--okbg); color: #15803d; border-color: #bbf7d0; }
.q-badge-failed { background: var(--errbg); color: var(--err); border-color: #fecaca; }
.q-badge-skipped { background: #f8fafc; color: #94a3b8; border-color: var(--line); }

/* 本文 textarea（自動高さ） */
.q-text {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: .96rem; font-family: inherit; line-height: 1.6;
  background: #fff; color: var(--ink); resize: none; overflow: hidden; display: block;
}
.q-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* 文字数＋保存 */
.q-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 7px; min-height: 28px; }
.q-counts { font-size: .74rem; color: var(--muted); }
.q-counts.over { color: var(--err); font-weight: 600; }
.q-count-sep { color: #94a3b8; }
.q-counts.over .q-count-sep { color: var(--err); }
.q-over-note { font-weight: 700; }
.q-save { flex: none; }

/* 投稿先トグル */
.q-targets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.q-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: #f8fafc; font-size: .8rem; font-weight: 600; color: var(--ink); cursor: pointer;
}
.q-toggle input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.q-toggle-note {
  font-size: .68rem; font-weight: 600; color: #94a3b8;
  background: #f1f5f9; border-radius: 999px; padding: 1px 6px;
}

/* 状態別ボタン群 */
.q-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.q-actions button:disabled { opacity: .55; cursor: not-allowed; }
.q-approve { background: var(--accent); color: #fff; border-color: var(--accent); }
.q-approve:hover { background: #1d4ed8; }
.q-now { background: #0f172a; color: #fff; border-color: #0f172a; }
.q-now:hover { background: #000; }
.q-retry { background: var(--accent); color: #fff; border-color: var(--accent); }
.q-retry:hover { background: #1d4ed8; }

/* 投稿結果 */
.q-results { margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 5px; }
.q-result-line { font-size: .8rem; color: #15803d; }
.q-result-line.q-result-err { color: var(--err); }
.q-open { color: var(--accent); font-weight: 700; text-decoration: none; margin-left: 2px; }
.q-open:hover { text-decoration: underline; }
.q-error {
  font-size: .82rem; color: var(--err); background: var(--errbg);
  border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; white-space: pre-wrap;
}

/* 空・エラー表示 */
.queue-empty { text-align: center; color: var(--muted); font-size: .9rem; }

/* トースト */
.toast-wrap {
  position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 2000; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 16px;
}
.toast {
  max-width: 92vw; pointer-events: auto;
  background: var(--ink); color: #fff; border-radius: 12px;
  padding: 11px 16px; font-size: .88rem; font-weight: 600;
  box-shadow: 0 8px 24px rgba(15,23,42,.28);
  opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-ok { background: var(--ok); }
.toast-err { background: var(--err); }

@media (max-width: 480px) {
  .conn-row { font-size: .95em; }
  .q-actions button { flex: 1 1 auto; }
}

/* 自動投稿の設定ダイアログ */
.settings-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 380px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(15, 23, 42, .35);
  color: #0f172a;
}
.settings-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.settings-dialog form { padding: 20px; }
.settings-dialog h2 { margin: 0 0 14px; font-size: 1.1em; }
.settings-field { display: block; margin: 0 0 14px; font-weight: 600; font-size: .95em; }
.settings-field input {
  display: block; margin-top: 6px; width: 100%;
  padding: 10px 12px; font-size: 1.05em;
  border: 1px solid #cbd5e1; border-radius: 8px; box-sizing: border-box;
}
.settings-hours { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.settings-hours input { width: 88px; margin-top: 6px; }
.settings-note { color: #64748b; font-size: .85em; margin: 6px 0 16px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* 会議ToDoページ */
.todo-group { padding: 14px 16px; margin-bottom: 12px; }
.todo-mtg-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #e2e8f0; }
.todo-mtg-date { font-weight: 700; color: #2563eb; font-size: .9em; white-space: nowrap; }
.todo-mtg-title { font-weight: 600; color: #334155; font-size: .95em; overflow-wrap: anywhere; }
.todo-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-radius: 8px; cursor: pointer; }
.todo-row:hover { background: #f1f5f9; }
.todo-check { width: 20px; height: 20px; margin-top: 1px; flex: 0 0 auto; cursor: pointer; accent-color: #16a34a; }
.todo-main { flex: 1 1 auto; min-width: 0; }
.todo-text { color: #0f172a; line-height: 1.5; overflow-wrap: anywhere; }
.todo-row.done .todo-text { text-decoration: line-through; color: #94a3b8; }
.todo-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.todo-badge { font-size: .8em; color: #475569; background: #eef2f7; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.nav-todos { text-decoration: none; }

/* 会議の内容ページ（minutes.html） */
.min-search { display: flex; }
.min-search-input {
  flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: .95rem; font-family: inherit; background: #fff; color: var(--ink);
}
.min-search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

.min-card { padding: 0; overflow: hidden; }
.min-head {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: none; font-family: inherit; color: var(--ink);
  padding: 15px 16px; transition: background .15s;
}
.min-head:hover { background: #f8fafc; }
.min-card.open .min-head { border-bottom: 1px solid #e2e8f0; }
.min-head-top { display: flex; align-items: baseline; gap: 10px; }
.min-date { font-weight: 700; color: #2563eb; font-size: .9em; white-space: nowrap; }
.min-title { font-weight: 600; color: #334155; font-size: .98em; overflow-wrap: anywhere; }
.min-preview { margin-top: 6px; color: #64748b; font-size: .84em; line-height: 1.6; overflow-wrap: anywhere; }

.min-detail { padding: 4px 16px 16px; }
.min-loading, .min-load-err { padding: 12px 0; color: #64748b; font-size: .88em; }
.min-load-err { color: var(--err); }
.min-section { margin-top: 14px; }
.min-section-head {
  margin: 0 0 6px; font-size: .95rem; font-weight: 700; color: #334155;
  padding-left: 10px; border-left: 3px solid var(--accent); line-height: 1.4;
}
.min-section-body {
  color: #0f172a; font-size: .92rem; line-height: 1.7;
  white-space: pre-wrap; overflow-wrap: anywhere;
  background: #eef2f7; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}

/* 全ページ共通タブバー */
.app-tabs { position: sticky; top: 0; z-index: 30; display: flex; gap: 4px; overflow-x: auto; background: #ffffff; border-bottom: 1px solid #e2e8f0; padding: 6px 10px; -webkit-overflow-scrolling: touch; }
.app-tab { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; color: #475569; font-weight: 600; font-size: .92em; padding: 8px 14px; border-radius: 999px; }
.app-tab:hover { background: #f1f5f9; }
.app-tab.active { background: #2563eb; color: #ffffff; }
.app-tab-ic { font-size: 1.05em; }
@media (max-width: 480px) { .app-tab { padding: 8px 12px; } .app-tab-lb { font-size: .95em; } }

/* 取り込んだもの / パイプライン進捗ページ（imports.html） */
.imp-card { padding: 14px 16px; margin-bottom: 12px; }
.imp-card-error { border-color: #fecaca; background: var(--errbg); }
.imp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.imp-head-left { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.imp-date { font-weight: 700; color: #2563eb; font-size: .9em; white-space: nowrap; }
.imp-title { font-weight: 600; color: #334155; font-size: .95em; overflow-wrap: anywhere; }

/* 状態バッジ（queue の q-badge と同系統） */
.imp-status { flex: none; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; border: 1px solid var(--line); background: #f1f5f9; color: #64748b; white-space: nowrap; }
.imp-status-done { background: #ecfdf5; color: #15803d; border-color: #bbf7d0; }
.imp-status-processing { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.imp-status-pending { background: #f8fafc; color: #64748b; border-color: var(--line); }
.imp-status-error { background: var(--errbg); color: var(--err); border-color: #fecaca; }

/* メタ行: ソース + 進捗チップ */
.imp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 9px; }
.imp-source { font-size: .74rem; font-weight: 600; color: #64748b; background: #eef2f7; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.imp-source.cloud { color: #1d4ed8; background: #eff6ff; }
.imp-stages { display: flex; flex-wrap: wrap; gap: 6px; }
.imp-stage { font-size: .76rem; font-weight: 600; color: #64748b; background: #eef2f7; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.imp-stage.on { color: #15803d; background: #ecfdf5; border-color: #bbf7d0; }

/* エラー本文 */
.imp-error { font-size: .82rem; color: var(--err); background: #fff; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; margin-top: 9px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* 上部バーの操作行(取り込みボタン等)。フル幅化と食み出しを防ぐ */
.queue-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.queue-bar-actions .btn-secondary { flex: 0 0 auto; width: auto; }
/* カードのメタ行: 狭い画面では文字数と書き直しボタンを折り返す */
.q-meta { flex-wrap: wrap; }
.q-meta .q-counts { flex: 1 1 auto; min-width: 120px; }
@media (max-width: 480px) {
  .q-rewrite { flex: 1 1 auto; text-align: center; }
}
