/* 画面ごとの配置（部品の見た目は packages/theme/devteam-theme.css） */

/* システム構成（全画面） */
.dt-main.full { padding: 0; position: relative; overflow: hidden; }
.topo-page { position: relative; height: 100%; overflow: hidden; }
.topo-page .dt-topo { position: absolute; inset: 0; }
.topo-head { position: absolute; top: 16px; left: 18px; right: 18px; display: flex; justify-content: space-between; gap: 16px; pointer-events: none; z-index: 5; }
.topo-health { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: auto; }
.topo-counts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.topo-counts b { margin-left: 2px; }
.topo-legend { position: absolute; left: 18px; top: 96px; padding: 12px 14px; z-index: 4; min-width: 170px; max-height: calc(100% - 180px); overflow: auto; font-size: 12px; }
.topo-legend .sec { color: var(--dt-muted); font-size: 11px; margin: 10px 0 4px; letter-spacing: 0.06em; }
.topo-legend .sec:first-child { margin-top: 0; }
.topo-legend .row { display: flex; align-items: center; gap: 8px; line-height: 1.8; }
.topo-legend i { width: 12px; height: 12px; display: inline-block; border-radius: 3px; flex: none; font-style: normal; }
.topo-legend i.box { border: 1.5px solid currentColor; box-shadow: 0 0 6px currentColor; }
.topo-legend i.st { border-radius: 50%; }
.topo-legend i.shape { width: auto; color: var(--dt-cyan); font-size: 11px; }
.topo-views { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; z-index: 5; align-items: center; border-radius: 14px; }
.topo-views button { background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 7px 12px; white-space: nowrap; }
.topo-views button:hover { border-color: var(--dt-line-strong); }
.topo-views button[aria-pressed="true"] { background: rgba(34, 211, 238, 0.16); border-color: rgba(34, 211, 238, 0.55); }
.topo-views #btn-sim[aria-pressed="true"] { background: rgba(244, 63, 94, 0.18); border-color: rgba(244, 63, 94, 0.6); }
.topo-views .sep { width: 1px; height: 20px; background: var(--dt-line-strong); margin: 0 4px; }
.topo-hint { position: absolute; right: 18px; bottom: 26px; font-size: 11px; z-index: 3; }
.topo-panel { position: absolute; right: 18px; top: 100px; width: 360px; max-height: calc(100% - 180px); overflow: auto; padding: 16px; z-index: 6; }
.topo-panel .close { position: absolute; right: 8px; top: 8px; background: none; border: 0; color: var(--dt-muted); }
.topo-panel .head { display: flex; gap: 12px; align-items: center; padding-right: 22px; }
.topo-panel .head img { width: 44px; height: 44px; border-radius: 10px; background: #0b1324; padding: 4px; box-shadow: 0 0 12px rgba(34, 211, 238, 0.2); }
.topo-panel .name { font-size: 15px; font-weight: 700; white-space: pre-line; }
.topo-panel .cat { color: var(--dt-muted); font-size: 11px; }
.topo-panel .status { margin-top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topo-panel .stackinfo { margin-top: 10px; display: flex; gap: 6px; align-items: center; color: #fed7aa; }
.topo-panel .resource { color: var(--dt-muted); font-size: 11px; margin-top: 6px; word-break: break-all; }
.topo-panel .gauges { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin-top: 10px; }
.topo-panel .gauges .g { display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--dt-line); padding: 4px; }
.topo-panel .alarm { border-left: 3px solid var(--st-error); padding: 6px 8px; margin-top: 8px; background: rgba(244, 63, 94, 0.08); border-radius: 0 8px 8px 0; font-size: 12px; }
.topo-panel .alarm.warn { border-left-color: var(--st-warn); background: rgba(251, 191, 36, 0.08); }
.topo-panel .conns .h { color: var(--dt-muted); font-size: 11px; margin: 12px 0 4px; }
.topo-panel .conns a { display: block; padding: 3px 0; cursor: pointer; }
.topo-panel .conns a:hover { color: var(--dt-cyan); }
.topo-panel .conns a.out { color: #a5f3fc; } .topo-panel .conns a.in { color: #fbcfe8; }
.topo-panel .conns .via { color: var(--dt-muted); font-size: 11px; margin-left: 6px; }

@media (max-width: 759.98px) {
  .topo-legend, .topo-hint { display: none; }
  .topo-panel { left: 12px; right: 12px; width: auto; top: auto; bottom: 76px; max-height: 50%; }
  .topo-views { left: 12px; right: 12px; transform: none; overflow-x: auto; }
}
/* ダッシュボードのエージェントの状態（実行中・待機・回答待ちで停止）。色は [data-state] の --state */
.dt-states { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; }
.dt-states .lbl { color: var(--dt-text-2); font-size: 13px; }
.dt-states .cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dt-states .cols > div { display: flex; flex-direction: column; gap: 2px; padding-left: 10px; border-left: 3px solid var(--state); min-width: 0; }
.dt-states b { font-size: 30px; line-height: 1.1; color: var(--state); text-shadow: 0 0 14px color-mix(in srgb, var(--state) 45%, transparent); }
.dt-states span { font-size: 12px; color: var(--dt-text); }
.dt-states small { font-size: 11px; color: var(--st-approval); }
/* 一覧と詳細の 2 列（AI 組織・判断と承認）。広い画面は左右に並べ、スマホの幅は一覧だけにして詳細はポップアップ（mock/app.js の STACKED と同じ幅） */
.dt-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
/* PC の出し方では、2 列の画面（AI 組織・判断と承認）を中身の列（固定した枠の中の .dt-main）の高さに収め、見出しの下を一覧と詳細で分け、それぞれの列の中でスクロールする。
   ページ全体は動かないので、詳細が一覧と一緒に流れず、下も切れない（2026-11-13 小川さん「詳細画面がリストと同じようにスクロールすんなけど」
   「2列の構成がおかしい 右側のペインの下が切れる」。前の版は詳細を上のバーの下に留めたが、高さを画面の高さにしていたので、
   ページを送る前は詳細の下が画面の外に出ていた） */
/* 左（一覧）は中身の領域の上下いっぱいに広げ、囲みを付けずに、その中で一覧の箱をスクロールする。
   右（詳細）は角丸の箱 1 つで、箱の中でスクロールする。箱の中に角丸の箱を入れない（.dt-sec・.dt-stat で区切る）
   （2026-11-13 小川さん「角丸のスクロールエリアの中に角丸のボックスがあって根本的におかしくね？ 右側は角丸ボックスの中でスクロール
   左側は外側のコンテンツエリアが領域いっぱいにあって、その中で角丸ボックスのリストがスクロールでしょ」「コンテンツエリアが画面の途中で切れてんだけど」） */
@media (min-width: 760px) {
  .dt-main.fill { display: flex; flex-direction: column; overflow: hidden; padding-top: 0; padding-bottom: 0; }
  .dt-main.fill > .dt-split { flex: 1; min-height: 0; align-items: stretch; }
  .dt-main.fill > .dt-split > :first-child { min-height: 0; overflow: auto; overscroll-behavior: contain;
    padding: 20px 0 calc(20px + env(safe-area-inset-bottom, 0px)); }
  .dt-main.fill > .dt-split > .split-detail { min-height: 0; display: flex; flex-direction: column; margin: 20px 0 calc(20px + env(safe-area-inset-bottom, 0px)); }
  .dt-main.fill > .dt-split > .split-detail > .dt-panel { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
}
/* 箱の中の区切り（箱を入れ子にしない）。.dt-sec は上の線で分ける節、.dt-stat は数値の欄 */
.dt-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--dt-line); }
.dt-sec.alert { border-top-color: rgba(251, 191, 36, 0.55); }
.dt-stat { padding: 4px 0; }
/* 長い URL・ID で詳細の列からはみ出さない */
.dec-detail, .split-detail { overflow-wrap: anywhere; }
@media (max-width: 759.98px) { .dt-split { grid-template-columns: minmax(0, 1fr); } .dt-split > .split-detail { display: none; } }

/* 判断・承認の一覧（受信箱・AI 組織の「要確認」） */
.ib-list { display: flex; flex-direction: column; gap: 8px; }
.ib-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; width: 100%;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--dt-line); background: rgba(12, 24, 46, 0.55); color: var(--dt-text); }
.ib-row:hover, .ib-row[aria-selected="true"] { background: rgba(34, 211, 238, 0.07); border-color: rgba(34, 211, 238, 0.35); }
.ib-row[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--dt-cyan); }
.ib-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ib-main b { font-weight: 600; line-height: 1.4; }
.ib-main small, .ib-side small { color: var(--dt-muted); font-size: 12px; }
.ib-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ib-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--st-idle, #64748b); }
.ib-dot[data-state="approval"] { background: var(--st-warn); box-shadow: 0 0 8px var(--st-warn); }
.ib-dot[data-state="waiting"] { background: var(--dt-cyan); }
.ib-dot[data-state="ok"] { background: var(--st-ok); }

/* 判断・承認の対象（部署の色の札・案件・担当）。一覧と詳細で共用 */
.dec-where { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; min-width: 0; }
.dec-where > * { min-width: 0; overflow-wrap: anywhere; }
.dec-dept { padding: 2px 8px; border-radius: 6px; font-weight: 700; color: var(--category, var(--dt-cyan));
  background: color-mix(in srgb, var(--category, var(--dt-cyan)) 14%, transparent); border: 1px solid color-mix(in srgb, var(--category, var(--dt-cyan)) 45%, transparent); }
.dec-proj { padding: 2px 8px; border-radius: 6px; border: 1px solid var(--dt-line-strong); color: var(--dt-text); font-family: var(--dt-mono); }
.dec-who { color: var(--dt-text-2); }
.dec-detail > .dec-where { margin-bottom: 10px; font-size: 13px; }
/* 決まった選択肢（ここでの管理対象から外す・自分で考えろ）は、ほかの選択肢と線で分けて控えめに */
.dec-opts.std { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--dt-line-strong); }
.dec-opt.std { background: transparent; border-style: dashed; }
.dec-opt.std b { font-weight: 500; color: var(--dt-text-2); }
.dec-opt.std[aria-checked="true"] b { color: var(--dt-text); }

/* 判断・承認の詳細 */
.dec-detail h3 { font-size: 13px; color: var(--dt-text-2); margin: 16px 0 8px; letter-spacing: 0.04em; }
.dec-title { margin: 0 0 8px; font-size: 20px; line-height: 1.4; }
.dec-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; }
.dec-text { margin: 12px 0 0; line-height: 1.7; }
.dec-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
@container (max-width: 560px) { .dec-cols { grid-template-columns: minmax(0, 1fr); } }
.dec-detail { container-type: inline-size; }
.dec-facts, .dec-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dec-facts li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; }
.dec-facts li svg { flex: none; margin-top: 3px; color: var(--st-ok); }
.dec-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.dec-opt { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--dt-line-strong); background: rgba(8, 18, 36, 0.6); color: var(--dt-text); }
.dec-opt[aria-checked="true"] { border-color: var(--dt-cyan); background: rgba(34, 211, 238, 0.12); box-shadow: 0 0 14px rgba(34, 211, 238, 0.18); }
.dec-opt:disabled { cursor: default; opacity: 0.55; }
.dec-opt:disabled[aria-checked="true"] { opacity: 1; }
.dec-opt .rec { font-size: 11px; color: var(--dt-cyan); }
.dec-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.dec-detail .field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.dec-detail .field label { font-size: 12px; color: var(--dt-text-2); }
.dec-detail textarea { width: 100%; min-height: 70px; background: rgba(4, 10, 22, 0.5); border: 1px solid var(--dt-line-strong); border-radius: 10px; padding: 10px; resize: vertical; color: var(--dt-text); }

/* 経緯の時系列（縦の線に、種類ごとの色の点） */
.dt-timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.dt-timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, rgba(34, 211, 238, 0.4), rgba(147, 51, 234, 0.25)); }
.dt-timeline li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 12px; padding: 0 0 12px; position: relative; }
.dt-timeline li > i { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: var(--dt-muted); box-shadow: 0 0 0 3px var(--dt-bg); z-index: 1; }
.dt-timeline li[data-kind="request"] > i { background: #a78bfa; }
.dt-timeline li[data-kind="report"] > i { background: var(--dt-cyan); }
.dt-timeline li[data-kind="decision"] > i { background: #60a5fa; }
.dt-timeline li[data-kind="ask"] > i { background: var(--st-warn); box-shadow: 0 0 0 3px var(--dt-bg), 0 0 10px var(--st-warn); }
.dt-timeline li[data-kind="answer"] > i { background: var(--st-ok); box-shadow: 0 0 0 3px var(--dt-bg), 0 0 10px var(--st-ok); }
.dt-timeline li[data-kind="withdraw"] > i { background: var(--st-error); }
.dt-timeline li[data-kind="processed"] > i { background: var(--st-ok); }
.t-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12px; }
.t-head span { color: var(--dt-text-2); }
.t-head time { color: var(--dt-muted); margin-left: auto; }
.t-text { line-height: 1.55; margin-top: 2px; }

/* ログイン画面は枠（トップバー・サイドバー）を出さず、画面いっぱいに地球 */
.dt-app.login { display: block; position: fixed; inset: 0; min-height: 0; }

/* 地球のステージ（ログイン・地球の画面。mock/login.js） */
.earth-stage { position: relative; overflow: hidden; background: #010309; color: var(--dt-text); isolation: isolate; }
.earth-stage .earth-canvas { position: absolute; inset: 0; z-index: 0; }
.earth-stage .earth-canvas canvas { cursor: grab; }
.earth-stage .earth-canvas canvas:active { cursor: grabbing; }
/* ロック画面のような日付と時刻。数字はガラスのような濃淡 */
.earth-clock { position: absolute; left: 50%; top: max(5vh, calc(env(safe-area-inset-top, 0px) + 24px)); transform: translateX(-50%); z-index: 2; text-align: center; pointer-events: none; }
.earth-clock .md { font-size: clamp(18px, 2.4vw, 26px); font-weight: 600; letter-spacing: 0.04em; color: rgba(236, 244, 255, 0.92); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.earth-clock .hm { font-size: clamp(88px, 15vw, 176px); font-weight: 700; line-height: 0.95; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, rgba(225, 235, 250, 0.95) 0%, rgba(150, 170, 200, 0.7) 45%, rgba(170, 205, 245, 0.85) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35)) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.55)); }
.earth-meta { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); z-index: 2; display: flex; gap: 8px; flex-wrap: wrap; }
.earth-meta .chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 12px; color: var(--dt-text-2);
  background: rgba(6, 12, 26, 0.45); border: 1px solid rgba(150, 190, 255, 0.2); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.earth-meta .chip.mono { font-family: var(--dt-mono); font-variant-numeric: tabular-nums; }
.earth-credit { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); z-index: 2; font-size: 10px; color: var(--dt-faint); }
/* ログインのカード：後ろを見せないポップアップなので磨りガラス（.dt-frost） */
.earth-card { position: absolute; z-index: 3; right: max(48px, calc(env(safe-area-inset-right, 0px) + 48px)); top: 50%; transform: translateY(-50%);
  width: min(360px, calc(100% - 32px)); padding: 26px 26px 22px; display: flex; flex-direction: column; gap: 16px; }
.earth-card .brand { display: flex; gap: 12px; align-items: center; justify-content: center; padding-block: 4px 2px; }
.earth-card .brand b { letter-spacing: 0.32em; font-size: 18px; }
.earth-card .wide { width: 100%; justify-content: center; padding: 12px; font-weight: 600; }
.earth-card .note { margin: 0; font-size: 11px; color: var(--dt-muted); text-align: center; }
@media (max-width: 760px) {
  .earth-card { right: auto; left: 50%; top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 64px); transform: translateX(-50%); }
  .earth-credit { display: none; }
}
@media (prefers-reduced-motion: reduce) { .earth-stage .earth-canvas canvas { cursor: default; } }

/* API キーを 1 度だけ見せる箱（コピーのボタン付き） */
.dt-keybox { display: flex; gap: 8px; align-items: stretch; }
.dt-keybox code { flex: 1; min-width: 0; word-break: break-all; white-space: normal; user-select: all; }
.dt-keybox .dt-btn { flex: none; }
