/* =============================================================================
   Linsta Agent — 画面の共通スタイル (ビルド無し)
   ============================================================================= */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --border: #e3e6ea; --text: #14181d; --text-muted: #5d6873;
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-contrast: #ffffff; --accent-soft: #e8efff;
  --danger: #c8372d; --danger-bg: #fdeceb; --success: #0f7b3f; --success-bg: #e8f6ee; --warn: #b45309; --warn-bg: #fff4e0;
  --radius: 10px; --shadow: 0 1px 2px rgba(20,24,29,.04), 0 4px 16px rgba(20,24,29,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #14181d; --surface: #1c2127; --border: #2c333b; --text: #eef1f4; --text-muted: #9aa5b1;
    --accent-soft: #1b2a4a; --danger: #ff8b81; --danger-bg: #3a1e1c; --success: #6ee7a0; --success-bg: #16301f; --warn: #fbbf24; --warn-bg: #3a2a10;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35);
  }
}
:root[data-theme='dark'] {
  --bg: #14181d; --surface: #1c2127; --border: #2c333b; --text: #eef1f4; --text-muted: #9aa5b1;
  --accent-soft: #1b2a4a; --danger: #ff8b81; --danger-bg: #3a1e1c; --success: #6ee7a0; --success-bg: #16301f; --warn: #fbbf24; --warn-bg: #3a2a10;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', 'Segoe UI', sans-serif; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1 { margin: 0 0 8px; font-size: 22px; }
h2 { margin: 28px 0 10px; font-size: 16px; }
.lede { margin: 0 0 24px; color: var(--text-muted); font-size: 14px; }
.hint { display: block; margin-top: 6px; color: var(--text-muted); font-size: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 16px; }
.field { margin-bottom: 18px; }
label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
input:not([type='checkbox']):not([type='radio']), textarea, select {
  width: 100%; padding: 10px 12px; font-size: 16px; font-family: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
textarea { min-height: 96px; resize: vertical; }
.btn { display: inline-block; padding: 10px 18px; font-size: 14px; font-weight: 600; font-family: inherit; color: var(--accent-contrast); background: var(--accent); border: 1px solid transparent; border-radius: 8px; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { cursor: not-allowed; color: var(--text-muted); background: var(--bg); border-color: var(--border); }
.btn--secondary { color: var(--text); background: transparent; border-color: var(--border); }
.btn--secondary:hover:not(:disabled) { background: var(--bg); }
.btn--danger { color: var(--danger); background: transparent; border-color: var(--border); }
.btn--block { display: block; width: 100%; }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.alert { margin-bottom: 18px; padding: 12px 14px; border-radius: 8px; font-size: 13px; }
.alert--error { color: var(--danger); background: var(--danger-bg); }
.alert--success { color: var(--success); background: var(--success-bg); }
.alert[hidden] { display: none; }
.meta { margin-top: 20px; text-align: center; font-size: 13px; color: var(--text-muted); }
.meta a { color: var(--text); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.badge--muted { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 14px; border: 1.5px dashed var(--border); border-radius: 12px; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--bg); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
pre.code { padding: 12px; white-space: pre-wrap; }

/* ── 認証画面 ───────────────────────────────────────────────────────────── */
.auth { max-width: 440px; margin: 0 auto; padding: 40px 16px 64px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; font-weight: 800; font-size: 22px; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand__mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; display: grid; place-items: center; font-size: 15px; }
.brand__tagline { margin: 0 0 24px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* ── アプリの器: 左メニュー + 本文 ───────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100dvh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100dvh; overflow: auto; }
.side .brand { justify-content: flex-start; font-size: 18px; margin: 0 8px 14px; }
.ws { display: flex; align-items: center; gap: 8px; margin: 0 4px 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.ws select { padding: 4px 6px; font-size: 13px; border: 0; background: transparent; }
.nav { list-style: none; margin: 0; padding: 0; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.nav a:hover { background: var(--bg); }
.nav a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a .soon { margin-left: auto; font-size: 10.5px; color: var(--text-muted); }
.nav__icon { width: 18px; text-align: center; opacity: .8; }
.side__foot { margin-top: 18px; padding: 10px; font-size: 12.5px; color: var(--text-muted); border-top: 1px solid var(--border); }
.main { padding: 28px 32px 64px; max-width: 1080px; width: 100%; }
.topbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 20; transform: translateX(-100%); transition: transform .2s; height: 100dvh; }
  .side.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
  .topbar .brand { margin: 0; font-size: 17px; }
  .topbar__menu { font: inherit; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; color: var(--text); }
  .main { padding: 18px 14px 64px; }
  .table { display: block; overflow-x: auto; }
}
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi__item { padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.kpi__label { font-size: 12px; color: var(--text-muted); }
.kpi__value { font-size: 24px; font-weight: 700; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { position: relative; padding: 10px 0 10px 36px; border-bottom: 1px solid var(--border); font-size: 14px; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 10px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.steps li:last-child { border-bottom: 0; }
.steps li.is-done::before { content: '✓'; background: var(--success-bg); color: var(--success); }
