/* ==========================================================================
   経営コックピット / デイリーQ&A 共通スタイル(静的CSS・ビルド工程なし)
   見た目の正: docs/superpowers/specs/assets/cockpit-mockup.html
   トークン・アニメ曲線・時間・スタッガーの値はモックから一切変更しない。
   ========================================================================== */

/* ===== デザイントークン(モックの :root と同一) ===== */
:root {
  --primary: #FF4438;        /* 情熱レッド */
  --accent: #FF8A00;         /* エネルギーオレンジ */
  --grad: linear-gradient(135deg, #FF4438, #FF8A00);
  --bg: #FFFFFF;
  --bg-soft: #F7F7F8;
  --ink: #222222;
  --ink-2: #666a70;          /* 補助文字(わずかに暖色寄りのグレー) */
  --ink-3: #9a9ea3;
  --line: #ececee;
  --good: #F28C1E;           /* 成果=オレンジ系 */
  --warn-bg: #FFF3E0; --warn-ink: #A85B00;
  --danger: #C62828;
  --r: 10px;
  --shadow: 0 1px 3px rgba(20,10,5,.08);
  --shadow-lift: 0 6px 20px rgba(255,68,56,.14);
  --ease: cubic-bezier(0.32, 0.72, 0.24, 1);  /* ぬるっと曲線 */
}
/* 本番アプリは白ベース単一テーマの意匠(意図的選択)。ダーク閲覧環境でも同じ見えを維持 */
* { box-sizing: border-box; margin: 0; }
html { background: var(--bg-soft); }
body {
  background: var(--bg-soft); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 14px; line-height: 1.5;   /* ← ココナラ密度 */
  padding-bottom: 48px;
}

.app-in { animation: appIn .5s var(--ease) both; }
@keyframes appIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ===== スプラッシュ(ログイン直後のダッシュボード初回描画のみ表示) ===== */
#splash {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px;
}
#splash .mark { font-size: 56px; transform: scale(.7); opacity: 0; animation: pop .55s var(--ease) .15s forwards; }
#splash .word {
  font-size: 22px; font-weight: 800; letter-spacing: .04em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(8px); animation: rise .45s var(--ease) .5s forwards;
}
#splash .sweep {
  position: absolute; inset: 0; background: var(--grad); opacity: .06;
  transform: translateY(100%); animation: sweep .7s var(--ease) .1s forwards;
}
#splash.leave { animation: splashOut .4s var(--ease) forwards; }
@keyframes pop  { to { transform: scale(1); opacity: 1; } }
@keyframes rise { to { transform: translateY(0); opacity: 1; } }
@keyframes sweep{ to { transform: translateY(0); } }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }

/* ===== グローバルヘッダー ===== */
header.gh {
  position: sticky; top: 0; z-index: 40; height: 52px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
}
.gh-logo { font-size: 16px; font-weight: 800; text-decoration: none; }
.gh-logo .w { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gh-burger {
  width: 40px; height: 40px; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.gh-burger span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
/* モックの body.drawer-open 相当。Alpineでシェル最上位divに drawer-open を付与するため .app.drawer-open に書換え */
.app.drawer-open .gh-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.app.drawer-open .gh-burger span:nth-child(2) { opacity: 0; }
.app.drawer-open .gh-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* PC幅(768px〜): ヘッダー内タブ横並び(主要7項目)+ハンバーガー併設 */
.gh-tabs { display: none; }
@media (min-width: 768px) {
  .gh-tabs { display: flex; align-items: center; gap: 4px; }
  .gh-tabs a {
    text-decoration: none; color: var(--ink-2); font-size: 13px; font-weight: 600;
    padding: 8px 10px; border-radius: 8px;
  }
  .gh-tabs a.on { color: var(--primary); background: var(--warn-bg); }
}

/* ===== ドロワー ===== */
.backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(20,10,5,.4);
  opacity: 0; pointer-events: none; transition: opacity .32s var(--ease);
}
.app.drawer-open .backdrop { opacity: 1; pointer-events: auto; }
nav.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: 280px;
  background: var(--bg); box-shadow: -8px 0 30px rgba(0,0,0,.12);
  transform: translateX(100%); transition: transform .32s var(--ease);
  padding: 60px 0 20px; overflow-y: auto;
}
.app.drawer-open nav.drawer { transform: translateX(0); }
.drawer .grp { font-size: 11px; letter-spacing: .1em; color: var(--ink-3); padding: 14px 20px 4px; }
.drawer a, .drawer form button {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px; width: 100%;
  color: var(--ink); text-decoration: none; font-size: 14px; position: relative;
  opacity: 0; transform: translateX(12px);
  border: 0; background: none; font: inherit; text-align: left; cursor: pointer;
}
.app.drawer-open .drawer a { animation: itemIn .3s var(--ease) forwards; }
.app.drawer-open .drawer a:nth-of-type(1) { animation-delay: .06s } .app.drawer-open .drawer a:nth-of-type(2) { animation-delay: .09s }
.app.drawer-open .drawer a:nth-of-type(3) { animation-delay: .12s } .app.drawer-open .drawer a:nth-of-type(4) { animation-delay: .15s }
.app.drawer-open .drawer a:nth-of-type(5) { animation-delay: .18s } .app.drawer-open .drawer a:nth-of-type(6) { animation-delay: .21s }
.app.drawer-open .drawer a:nth-of-type(7) { animation-delay: .24s } .app.drawer-open .drawer a:nth-of-type(8) { animation-delay: .27s }
.app.drawer-open .drawer a:nth-of-type(9) { animation-delay: .30s } .app.drawer-open .drawer a:nth-of-type(10){ animation-delay: .33s }
.app.drawer-open .drawer a:nth-of-type(11){ animation-delay: .36s }
/* ログアウトはPOSTフォーム(<form><button>)のため <a> の nth-of-type 連番に乗らない。
   12番目の項目として同じ .39s(値は変更せず流用)を明示的に適用する */
.app.drawer-open .drawer form button { animation: itemIn .3s var(--ease) forwards; animation-delay: .39s; }
@keyframes itemIn { to { opacity: 1; transform: none; } }
.drawer a.on { color: var(--primary); font-weight: 700; }
.drawer a.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
@media (prefers-reduced-motion: reduce) {
  #splash { display: none; }
  .app-in { animation: none; opacity: 1; transform: none; }
  .gh-burger span { transition: none; }
  .backdrop, nav.drawer, .drawer a, .drawer form button { transition: none; animation: none !important; opacity: 1; transform: none; }
  nav.drawer { display: none; } .app.drawer-open nav.drawer { display: block; }
  .vcard { transition: none; }
  .btn { transition: none; }
}

main { max-width: 720px; margin: 0 auto; padding: 12px 12px 0; }

/* ===== ダッシュボード ===== */
/* クイックリンク(管理画面進化R1): 最上部の大きめタップターゲット2つ。.panelを流用しつつ中央寄せの大きめ表示にする。
   .panel(padding/margin-top)より後勝ちさせるため.quicklinks配下のセレクタで詳細度を上げて上書きする */
.quicklinks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quicklinks .quicklink {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 18px 10px; margin-top: 0; text-decoration: none; color: var(--ink); text-align: center;
}
.quicklinks .quicklink:active, .quicklinks .quicklink:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
/* 準備中(aria-disabled)は非インタラクティブなdivのため、リンクらしいhover/active演出を出さない */
.quicklinks .quicklink[aria-disabled="true"] { cursor: default; opacity: .7; }
.quicklinks .quicklink[aria-disabled="true"]:active, .quicklinks .quicklink[aria-disabled="true"]:hover { transform: none; box-shadow: var(--shadow); }
.quicklink-emoji { font-size: 26px; }
.quicklink-label { font-size: 13px; font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
@media (max-width: 520px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--bg); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 12px; }
.kpi .l { font-size: 11px; color: var(--ink-2); }
.kpi .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .d { font-size: 11px; color: var(--good); font-weight: 700; }

.vgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
@media (min-width: 640px) { .vgrid { grid-template-columns: repeat(3, 1fr); } }
.vcard {
  background: var(--bg); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden;
  text-decoration: none; color: var(--ink); display: block;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.vcard:active, .vcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
/* .vpanel(ventures-page一覧のカード)もvcardと同じhero帯実装を流用する(管理画面進化R1) */
.vcard .hero, .vpanel .hero { height: 74px; display: flex; align-items: center; justify-content: center; font-size: 34px; position: relative; }
.vcard .hero .st {
  position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 700;
  background: rgba(255,255,255,.9); border-radius: 99px; padding: 2px 8px;
  z-index: 1; /* image_path設定時、img(hero帯全体を覆う)より手前に出す */
}
.vcard .hero img, .vpanel .hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vcard .bd { padding: 8px 10px 10px; }
.vcard .nm { font-size: 13px; font-weight: 700; line-height: 1.3; }
/* .vpanelは.panelの上部パディングを打ち消してhero帯を上端いっぱいに表示する(見た目はvcardのhero帯と統一)。
   .panel.vpanelで詳細度をpanel単体より上げ、.panelのoverflow-x:auto/padding指定より確実に後勝ちさせる */
.panel.vpanel { padding-top: 0; overflow: hidden; }
.vpanel .hero { margin: 0 -12px 10px; }
.vcard .mt { font-size: 11px; color: var(--ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.vcard .bar { height: 4px; border-radius: 2px; background: var(--bg-soft); margin-top: 6px; overflow: hidden; }
.vcard .bar i { display: block; height: 100%; background: var(--grad); border-radius: 2px; }

/* overflow-x:auto は旧.table-wrapの代替。posts/insights等の多列table.denseが
   スマホ幅(375px)で溢れるのを防ぎ、パネル内で横スクロールに収める */
.panel { background: var(--bg); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; margin-top: 10px; overflow-x: auto; }
.panel h3 { font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.panel h3 .chip { font-size: 10px; background: var(--warn-bg); color: var(--warn-ink); border-radius: 99px; padding: 2px 8px; font-weight: 700; }
table.dense { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.dense th { text-align: left; color: var(--ink-3); font-weight: 600; font-size: 11px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.dense td { padding: 6px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.dense tr:last-child td { border-bottom: 0; }
.hpill { color: var(--primary); font-weight: 700; }

.btn {
  display: inline-block; border: 0; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 700; padding: 8px 14px; color: #fff; background: var(--grad);
  box-shadow: 0 2px 8px rgba(255,68,56,.3); transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  text-decoration: none;
}
.btn:active { transform: scale(.97); box-shadow: 0 1px 4px rgba(255,68,56,.3); }
.btn.ghost { background: var(--bg); color: var(--primary); border: 1px solid #ffd2c2; box-shadow: none; }

/* ===== デイリーQ&A ===== */
.qa-q { background: var(--bg); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; margin-top: 8px; }
.qa-q .tag { font-size: 10px; font-weight: 700; color: var(--accent); letter-spacing: .06em; }
.qa-q p { font-size: 14px; font-weight: 600; margin: 3px 0 8px; }
.qa-q textarea { width: 100%; min-height: 64px; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; resize: vertical; }
.qa-q textarea:focus { outline: 2px solid #ffb8a3; border-color: var(--primary); }

/* Task 5: デイリーQ&A4画面(下書き/履歴)で .qa-q を使わないカードにも
   タグ・警告チップ・メタ行を提供するための追加class(既存トークンのみ使用、
   .qa-q内の値は変更しない・追加のみ)。
   レビュー対応: 素の .tag/.chip/.meta はcockpit側の既存 .meta 使用箇所(venture-detail/
   content-detail/settings/calendar等、多くは.card外でも使用)に無審査で波及するため、
   Q&Aビューが実際に使う親要素( .panel / .qa-q )にスコープする */
.panel .tag { font-size: 10px; font-weight: 700; color: var(--accent); letter-spacing: .06em; }
.panel .chip { font-size: 10px; background: var(--warn-bg); color: var(--warn-ink); border-radius: 99px; padding: 2px 8px; font-weight: 700; display: inline-block; }
.panel .meta { font-size: 11px; color: var(--ink-2); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* today-pageの一次情報(URL+改行+要約)は行内文章のためflex化しない。.card .metaと同じ見た目のみ提供 */
.qa-q .meta { font-size: 11px; color: var(--ink-2); margin-bottom: 8px; }

/* ===== カレンダー(見た目の正: cockpit-mockup.htmlには専用例なし。.panel/table.dense系の
   トークンを流用して新配色に統一。チップの背景色は各account.colorを維持するため
   ビュー側でインラインstyleのまま) ===== */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-cell { min-height: 4.5rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px; font-size: 11px; }
.cal-day-out { color: var(--ink-3); } /* 当月外の日付番号 */
.cal-chip { display: block; color: #fff; border-radius: 5px; padding: 0 5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }

/* ===== Task 6: 台帳/コンテンツ/投稿/アカウント/分析/設定の共通ユーティリティ
   (静的インラインstyleのclass化。動的値(account color/幅%/heroGradient)のみ
   引き続きインラインstyleを許容する) ===== */
.panel-title { font-size: 1rem; } /* パネル内の小見出し(h2)。margin-topは * { margin:0 } のリセットで0のため指定不要 */
.mt-xs { margin: 0.25rem 0; }
.mt-sm { margin-top: 0.75rem; }
.mt-half { margin-top: 0.5rem; }
.item-title { font-weight: 600; margin: 0.25rem 0; }
.meta.tight { margin: 0.25rem 0; }
.color-dot { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; } /* 背景色はaccount.colorのため動的 */
.inline-check { width: auto; display: inline-block; }
.check-inline { display: inline-flex; align-items: center; gap: 0.25rem; margin: 0; }
.chip.neutral { background: var(--bg-soft); color: var(--ink-2); } /* 状態/種別など警告ではないピル(旧.badge相当) */
.chip-block { display: block; padding: 0.5rem; }
.score-list { display: flex; flex-direction: column; gap: 0.2rem; margin: 0.5rem 0; }
.score-row { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--ink-2); }
.score-label { width: 4.5rem; }
.bar-track { flex: 1; height: 4px; border-radius: 2px; background: var(--bg-soft); overflow: hidden; } /* .score-barの後継(vcardの.bar準拠) */
.bar-track i { display: block; height: 100%; background: var(--grad); border-radius: 2px; }
.next-action { font-size: 0.9rem; margin: 0.25rem 0; }
.emoji-lg { font-size: 2rem; line-height: 1; }
.venture-image { max-width: 100%; max-height: 160px; border-radius: 8px; }
.hero-sm { border-radius: 8px; height: 74px; display: flex; align-items: center; justify-content: center; font-size: 2rem; } /* 背景(heroGradient)は動的 */
.divider { margin: 0.75rem 0; border-color: var(--line); }
.note-item { margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
.mono { font-family: monospace; }
.mono-break { font-family: monospace; word-break: break-all; }
.mono-block { display: block; word-break: break-all; user-select: all; }
.select-all { user-select: all; }
.recovery-list { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.token-row { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.btn-row.spread { justify-content: space-between; align-items: center; }
.btn-row.center { justify-content: center; }
.vcard-add { display: flex; align-items: center; justify-content: center; min-height: 120px; border: 1.5px dashed #ffb8a3; box-shadow: none; }
.vcard-add-label { color: var(--primary); font-weight: 700; font-size: 13px; }
.action-label { font-weight: 700; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.action-item { margin: 6px 0; }
.q-body { font-weight: 600; margin: 0.25rem 0; } /* history-pageの質問本文 */
.answer-quote { border-left: 3px solid var(--line); padding-left: 0.6rem; } /* .draft-bodyに付与する回答引用の修飾 */
.draft-body-sm { font-size: 0.9rem; } /* .draft-bodyに付与するネスト下書きの縮小表示 */
.drawer-logout { color: var(--danger); } /* ドロワーのログアウトボタン */
.btn-block { width: 100%; justify-content: center; } /* login-pageの全幅ボタン */

/* ===== ログイン(中央カード+🔥ロゴ+グラデボタン) ===== */
.login-shell { min-height: calc(100vh - 52px); display: flex; align-items: center; justify-content: center; padding: 24px 12px; }
.login-card { background: var(--bg); border-radius: var(--r); box-shadow: var(--shadow); padding: 28px 24px; width: 100%; max-width: 340px; }
.login-logo { text-align: center; font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.login-logo .w { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-sub { text-align: center; color: var(--ink-2); font-size: 12.5px; margin-bottom: 16px; }

/* ==========================================================================
   全画面共通で使う要素・class(Task 6で.card/.badge/.score-bar/.table-wrap/
   table.listは全ビュー張替え済みのためapp.cssから削除。以下は新デザインでも
   引き続き使用する)
   ========================================================================== */
/* パンくず(.panel外に置かれる「一覧へ戻る」リンク行)。.panel .meta / .qa-q .meta と
   同系統だが、どの.panel/.qa-q配下にも属さないためスコープせず単独classとして定義 */
.breadcrumb { font-size: 11px; color: var(--ink-2); }
.notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; font-size: 13px; }
.error { background: #FDE8E6; color: var(--danger); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.btn.secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.small { font-size: 12px; padding: 6px 10px; }
textarea {
  width: 100%; min-height: 7rem; font-size: 14px; padding: 8px;
  border: 1px solid var(--line); border-radius: 8px; resize: vertical; font-family: inherit;
}
input[type="email"], input[type="password"], input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"], select {
  width: 100%; font-size: 14px; padding: 8px;
  border: 1px solid var(--line); border-radius: 8px; font-family: inherit; background: var(--bg); color: var(--ink);
}
label { font-size: 12.5px; color: var(--ink-2); display: block; margin: 10px 0 4px; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.draft-body { white-space: pre-wrap; word-break: break-word; margin: 8px 0; }
.posted { opacity: .55; }
.check-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.history-date { font-size: 14px; font-weight: 700; margin: 18px 0 8px; }
.empty { color: var(--ink-2); text-align: center; padding: 32px 0; }
