/* 3画面で共通の色・文字・部品 */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --surface-3: #e3e8f1;
  --border: #dde2ec;
  --text: #141b2d;
  --muted: #5b6780;
  --primary: #2f5bea;
  --primary-hover: #2449c4;
  --primary-ink: #ffffff;
  --primary-soft: #e7edff;
  --accent: #f5b700;
  --danger: #c2410c;
  --ok: #15803d;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 24px rgba(16, 24, 40, .07);
  --radius: 14px;
  --font: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c111b; --surface: #131a27; --surface-2: #1b2333; --surface-3: #242e42; --border: #283247;
    --text: #e7ecf5; --muted: #9aa6bc; --primary: #5b8cff; --primary-hover: #7aa2ff; --primary-soft: #1c2a4d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.7; }
a { color: var(--primary); }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.fine { font-size: 12px; color: var(--muted); }
.warn { font-size: 13px; color: var(--danger); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); border-radius: 10px; padding: 8px 16px; font: inherit; font-size: 14px;
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 4px 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; border: none; background: transparent; color: var(--text);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* ログインボタン */
.providers { display: flex; flex-direction: column; gap: 10px; }
.provider-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 15px;
  font-weight: 600; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.provider-btn:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.provider-btn:disabled { opacity: .6; cursor: wait; }
.provider-btn svg { width: 22px; height: 22px; flex: none; }
.provider-btn span { flex: 1; text-align: center; margin-right: 34px; }

.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; display: inline-block; }
.avatar.initial { display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 14px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); max-width: 100%; }
.chip button { border: none; background: none; cursor: pointer; color: var(--muted); padding: 0; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.status-badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.status-badge.succeeded { color: var(--ok); }
.status-badge.failed { color: var(--danger); }
.status-badge.running, .status-badge.queued { color: var(--primary); }
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.progress > div { height: 100%; background: var(--primary); transition: width .4s; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; }
.check input { margin-top: 6px; flex: none; }
select { font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); }

table.breakdown { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
table.breakdown td { padding: 6px 0; border-bottom: 1px solid var(--border); }
table.breakdown td:last-child { text-align: right; }

.modal { border: 1px solid var(--border); border-radius: 18px; padding: 0; max-width: 560px; width: calc(100% - 32px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(10, 15, 25, .5); }
.modal-inner { padding: 22px; max-height: calc(100vh - 64px); overflow-y: auto; }
.modal-inner h3 { margin-top: 0; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 12px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); box-shadow: var(--shadow); }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: var(--text); text-decoration: none; letter-spacing: .02em; }
.brand svg { width: 28px; height: 28px; flex: none; }
