/* 司令室テーマ（ネイビー×ブルー）。正本: ui/オフィス世界観.md W10 ／ 決定ログ 2026-10-27
   ライトが既定。ナイトはオフィス（司令室）画面だけに効かせる（他画面はプラグインの白背景と衝突するため） */

:root {
  --navy-950: #061029;
  --navy-900: #0a1a3a;
  --navy-800: #11264f;
  --navy-700: #1b3566;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbe7ff;
  --blue-50: #eef4ff;
  --signal: #22d3ee;

  --st-run: #2563eb;
  --st-queue: #6366f1;
  --st-human: #f59e0b;
  --st-ext: #8b5cf6;
  --st-idle: #94a3b8;
  --st-alert: #dc2626;
  --st-done: #0e9f6e;

  --bg: #ffffff;
  --canvas: #f3f6fb;
  --ink: #0b1630;
  --muted: #64748b;
  --line: #e2e8f2;
  --panel: #ffffff;
  --sub-box: #f1f5fb;
  --accent: var(--blue-600);
  --accent-ink: #ffffff;
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

a.office-crumb-item:hover { color: var(--blue-600); background: rgba(37, 99, 235, .06); }
.notify-list li.unread { background: var(--blue-50); }

/* —— 上クロム —— */
.office-chrome {
  background: rgba(255, 255, 255, .92);
  border-bottom-color: var(--line);
}
.office-chrome-mark {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .25);
}
.office-chrome-iconbtn { background: #fff; }
.office-chrome-iconbtn:hover { box-shadow: 0 6px 14px rgba(11, 22, 48, .08); }
.office-chrome-iconbtn.is-active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .28);
}
.office-menu-fab,
.office-menu-fab.is-open {
  background: linear-gradient(160deg, var(--navy-800), var(--navy-950));
  color: #e6eeff;
  box-shadow: 0 10px 24px rgba(6, 16, 41, .28);
}
.office-menu-fab-ring { border-color: rgba(34, 211, 238, .4); }
.office-menu-extra-kicker,
.office-quest-kicker { color: var(--blue-600); }
.office-menu-extras-kicker { color: var(--signal); }
.office-menu-extras-count,
.office-menu-plugin-mark {
  color: var(--navy-950);
  background: linear-gradient(135deg, #7dd3fc, var(--signal));
}
.office-menu-plugin-card:hover,
.office-menu-plugin-card.is-active { border-color: rgba(96, 165, 250, .7); }
.office-quest-chip:focus { outline-color: var(--blue-600); }

.office-live-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 26px;
  padding: 0 .65rem;
  border-radius: 13px;
  background: var(--navy-900);
  color: #dbeafe;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  white-space: nowrap;
}
.office-live-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  animation: office-ping 1.6s infinite;
}
.office-live-pill.is-offline i { background: var(--st-idle); animation: none; }
@keyframes office-ping {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, .6); }
  80%, 100% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
}

.office-theme-seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}
.office-theme-seg button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: .35rem .7rem;
  font-size: .75rem;
  font-weight: 650;
  white-space: nowrap;
}
.office-theme-seg button.is-on { background: var(--blue-600); color: #fff; }

/* —— 固定アイコンレール（ネイビー） —— */
.office-rail {
  background: var(--navy-900);
  border-right-color: var(--navy-950);
}
.office-rail-item { color: #9fb2da; }
.office-rail-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.office-rail-item.is-active {
  background: rgba(59, 130, 246, .24);
  color: #fff;
}
.office-rail-item.is-active::before {
  content: "";
  position: absolute;
  left: -.35rem;
  top: .55rem;
  bottom: .55rem;
  width: 3px;
  border-radius: 2px;
  background: var(--signal);
}
.office-rail-badge { background: var(--st-human); color: #1a1200; }

/* —— タブ（色はトークンに寄せる。形は admin レイアウト） —— */
.emp-tabs { border-bottom-color: var(--line); }
.emp-tabs a:hover, .emp-tabs a.is-active, .emp-tabs a.is-active .tab-count, .emp-tabs a.is-active .muted, .emp-tabs a.is-active .mono { color: var(--blue-600); }
.emp-tabs a.is-active { border-bottom-color: var(--blue-600); }
.emp-subtabs a:hover { border-color: var(--blue-600); color: var(--blue-600); }
.emp-subtabs a.is-active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

/* —— ナイト（司令室画面のみ） —— */
html[data-office-theme="night"] .console:has(.office-floor-page, .ov2-page) {
  --bg: #050d22;
  --canvas: #050d22;
  --panel: #0b1836;
  --panel-2: #0e1d40;
  --ink: #e6eeff;
  --muted: #7f93ba;
  --line: #1a2c55;
  --sub-box: #0e1d40;
  --blue-50: #0f2148;
  --blue-100: #16306a;
  background: var(--bg);
  color: var(--ink);
}
html[data-office-theme="night"] body:has(.office-floor-page, .ov2-page) { background: #050d22; }
html[data-office-theme="night"] .console:has(.office-floor-page, .ov2-page) .office-chrome {
  background: rgba(8, 19, 44, .94);
  border-bottom-color: var(--line);
}
html[data-office-theme="night"] .console:has(.office-floor-page, .ov2-page) .office-chrome-word strong { color: var(--ink); }
html[data-office-theme="night"] .console:has(.office-floor-page, .ov2-page) .office-chrome-iconbtn:not(.is-active),
html[data-office-theme="night"] .console:has(.office-floor-page, .ov2-page) .office-theme-seg {
  background: var(--panel);
  border-color: var(--line);
  color: #b9c7e4;
}
html[data-office-theme="night"] .console:has(.office-floor-page, .ov2-page) .office-live-pill {
  background: rgba(34, 211, 238, .12);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, .35) inset;
}
html[data-office-theme="night"] .console:has(.office-floor-page, .ov2-page) .office-rail { background: #071431; }

@media (prefers-reduced-motion: reduce) {
  .office-live-pill i { animation: none; }
}

/* 常駐の目標（プラグイン presence：QUEST／SHELF 等）。重ねずに横に並べ、中身はホバー／フォーカスで開く。全画面で右下固定 */
.office-presence-dock {
  --office-presence-h: 5.5rem; /* 札＋目標確認ボタン分。本文の下余白に使う */
  position: fixed;
  z-index: 65;
  right: .85rem;
  bottom: .85rem;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: .4rem;
  max-width: calc(100vw - 1.5rem);
  pointer-events: none;
}
.office-presence-dock .office-quest-log {
  position: relative;
  inset: auto;
  z-index: auto;
  pointer-events: auto;
}
.office-presence-dock .office-quest-log:hover,
.office-presence-dock .office-quest-log:focus-within { z-index: 2; }
/* 目標サマリーは1件のみ。一覧ツールチップはホバー時だけ（常時表示しない） */
.office-presence-dock .office-quest-sum-tip {
  opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
}
.office-presence-dock .office-quest-sum-focus:hover .office-quest-sum-tip,
.office-presence-dock .office-quest-sum-focus:focus-within .office-quest-sum-tip {
  opacity: 1 !important; visibility: visible !important; pointer-events: auto !important;
}

/* 右下ホバーが本文を隠さないよう、下端に余白を足す（フロアは padding:0 なので別指定） */
body:has(.office-presence-dock) .console-content {
  padding-bottom: calc(3rem + var(--office-presence-h, 5.5rem));
}
body:has(.office-presence-dock) .console:has(.office-floor-page) .console-content {
  padding-bottom: 0;
}
body:has(.office-presence-dock) .office-floor-page,
body:has(.office-presence-dock) .ov2-page {
  padding-bottom: calc(var(--office-presence-h, 5.5rem) + .85rem);
  box-sizing: border-box;
}
