:root {
  --ink:        #0f1c2e;
  --ink-soft:   #4a5a70;
  --ink-faint:  #8494a8;
  --line:       #e4eaf2;
  --line-soft:  #eef2f7;
  --bg:         #f2f6fb;
  --surface:    #ffffff;
  --accent:     #0b64c8;
  --accent-2:   #23a3d8;
  --accent-deep:#084a95;
  --wash:       #e9f2fd;
  --good:       #12856a;
  --good-wash:  #e3f5ee;
  --warn:       #b26a00;
  --warn-wash:  #fdf3e0;
  --danger:     #c0392b;
  --danger-wash:#fdecea;
  --r:          14px;
  --r-sm:       9px;
  --sh:         0 1px 2px rgba(15,28,46,.05), 0 8px 24px rgba(15,28,46,.06);
  --sh-lift:    0 2px 8px rgba(15,28,46,.08), 0 20px 48px rgba(15,28,46,.12);
  --grad:       linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI",
               "Noto Sans JP", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

button { font: inherit; cursor: pointer; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

/* ==================== topbar ==================== */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex: none;
  z-index: 30;
}

.topbar-inner {
  max-width: 1560px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.corp {
  display: flex; align-items: center; gap: 9px; flex: none;
  text-decoration: none; color: inherit;
}

.corp-mark {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  background: linear-gradient(140deg, #0f1c2e 0%, #26456e 100%);
  display: grid; place-items: center;
}
.corp-mark svg { width: 19px; height: 19px; display: block; }

.corp-name {
  font-size: 15px; font-weight: 800;
  letter-spacing: -.012em; white-space: nowrap;
  color: var(--ink);
}
.corp-name span { color: var(--accent); }
.corp:hover .corp-name { color: var(--accent-deep); }

.brand-sep { width: 1px; height: 26px; flex: none; background: var(--line); }

.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-text strong { font-size: 14.5px; }
.brand-text em {
  font-style: normal; font-size: 11px; color: var(--ink-faint); letter-spacing: .02em;
}

.tabs { display: flex; gap: 3px; margin-left: 8px; }

.tab {
  border: 0; background: transparent;
  color: var(--ink-soft);
  font-size: 13px; font-weight: 600;
  padding: 7px 15px; border-radius: 999px;
  transition: background .14s, color .14s;
}
.tab:hover { background: var(--line-soft); }
.tab.is-on { background: var(--wash); color: var(--accent-deep); }

.topbar-meta { margin-left: auto; }

.pill {
  font-size: 11.5px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
}
.pill[data-state="checking"] { background: #f0f3f7; color: var(--ink-faint); }
.pill[data-state="ok"]       { background: var(--good-wash); color: var(--good); }
.pill[data-state="ng"]       { background: var(--danger-wash); color: var(--danger); }

/* ==================== shell / views ==================== */

.shell { flex: 1; min-height: 0; display: flex; }
.view { display: none; flex: 1; min-height: 0; width: 100%; }
.view.is-on { display: flex; }

.pad {
  max-width: 1560px; width: 100%;
  margin: 0 auto; padding: 26px 22px 48px;
  overflow-y: auto;
}

.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0 0 5px; font-size: 20px; letter-spacing: .01em; }
.page-head p { margin: 0; color: var(--ink-soft); font-size: 13px; }

/* ==================== chat layout ==================== */

.chat-layout {
  max-width: 1560px; width: 100%;
  margin: 0 auto; padding: 0 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  min-height: 0;
}

.chat-main {
  display: flex; flex-direction: column;
  min-height: 0; padding: 20px 0 16px;
}

.thread {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
  padding-right: 6px;
  scroll-behavior: smooth;
}

/* ---------- welcome ---------- */

.welcome {
  margin: auto; text-align: center; max-width: 620px; padding: 20px;
}
.welcome-mark {
  width: 54px; height: 54px; margin: 0 auto 16px;
  border-radius: 16px; background: var(--grad);
  box-shadow: 0 10px 28px rgba(11,100,200,.28);
  position: relative;
}
.welcome-mark::after {
  content: ""; position: absolute; inset: 0;
  background: no-repeat center / 26px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M13 2 4.5 13.5H11L10 22l8.5-11.5H12z'/%3E%3C/svg%3E");
}
.welcome h1 { margin: 0 0 8px; font-size: 21px; }
.welcome p { margin: 0 0 20px; color: var(--ink-soft); font-size: 13.5px; }
.welcome b { color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }

.chip {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 12.5px;
  padding: 7px 14px; border-radius: 999px;
  transition: background .14s, border-color .14s, transform .14s;
}
.chip:hover { background: var(--wash); border-color: #b6d4f5; }
.chip:active { transform: translateY(1px); }

/* ---------- messages ---------- */

.msg { display: flex; flex-direction: column; animation: rise .26s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.msg-user { align-items: flex-end; }

.msg-user .msg-body {
  background: var(--grad); color: #fff;
  padding: 10px 16px; border-radius: 16px 16px 4px 16px;
  max-width: min(76%, 620px);
  box-shadow: 0 4px 14px rgba(11,100,200,.22);
}

.msg-bot { align-items: stretch; }

.msg-bot .msg-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px;
  padding: 14px 18px;
  box-shadow: var(--sh);
  max-width: 100%;
}

.msg-bot.is-nomatch .msg-body {
  background: var(--warn-wash);
  border-color: #f0e0be;
}

.msg-body p { margin: 0 0 9px; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body ul { margin: 0 0 9px; padding-left: 19px; }
.msg-body li { margin-bottom: 3px; }
.msg-body b { color: var(--ink); font-weight: 700; }

.cite {
  border: 0; background: var(--wash); color: var(--accent-deep);
  font-size: 10.5px; font-weight: 700; line-height: 1;
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 5px; margin: 0 2px;
  vertical-align: 2px;
  transition: background .14s;
}
.cite:hover { background: #cfe4fb; }

.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-faint); animation: blink 1.1s infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.msg-foot {
  display: flex; align-items: center; gap: 12px;
  margin-top: 7px; padding-left: 4px;
  font-size: 11px; color: var(--ink-faint);
}
.msg-foot .copy {
  border: 0; background: transparent; color: var(--accent);
  font-size: 11px; font-weight: 600; padding: 0;
}
.msg-foot .copy:hover { text-decoration: underline; }

.callout {
  padding: 10px 14px; border-radius: var(--r-sm); font-size: 13px;
}
.callout.error { background: var(--danger-wash); color: var(--danger); }

.chart-reject {
  margin: 8px 0 0; font-size: 11.5px; color: var(--ink-faint);
}

/* ---------- composer ---------- */

.composer {
  display: flex; align-items: flex-end; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 9px 9px 15px;
  margin-top: 14px;
  box-shadow: var(--sh);
  transition: border-color .16s, box-shadow .16s;
}
.composer:focus-within {
  border-color: #a9cdf3;
  box-shadow: 0 0 0 3px rgba(11,100,200,.12), var(--sh);
}

.composer textarea {
  flex: 1; border: 0; outline: 0; resize: none;
  font: inherit; line-height: 1.6;
  max-height: 140px; padding: 5px 0;
  background: transparent; color: var(--ink);
}

.composer button {
  flex: none; width: 34px; height: 34px;
  border: 0; border-radius: 9px;
  background: var(--grad); color: #fff;
  display: grid; place-items: center;
  transition: opacity .14s, transform .14s;
}
.composer button:hover:not(:disabled) { transform: translateY(-1px); }
.composer button:disabled { opacity: .4; cursor: not-allowed; }

.composer-note {
  margin: 8px 2px 0; font-size: 11px; color: var(--ink-faint);
}

/* ==================== evidence panel ==================== */

.evidence {
  border-left: 1px solid var(--line);
  padding: 20px 0 20px 22px;
  overflow-y: auto;
  min-height: 0;
}

.evidence-empty p {
  margin: 0; font-size: 12.5px; color: var(--ink-faint);
  background: var(--surface); border: 1px dashed var(--line);
  border-radius: var(--r-sm); padding: 16px;
}

.ev-block { margin-bottom: 22px; }

.ev-title {
  margin: 0 0 10px; font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint);
  display: flex; align-items: baseline; gap: 7px;
}
.ev-count { font-size: 11px; letter-spacing: 0; text-transform: none; }

.pipeline { list-style: none; margin: 0; padding: 0; }
.pipeline li {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 0; font-size: 12.5px;
}
.pipe-n {
  width: 17px; height: 17px; flex: none; border-radius: 50%;
  background: var(--wash); color: var(--accent-deep);
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}
.pipe-name { flex: 1; }
.pipe-num { color: var(--ink-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }

.sources { display: flex; flex-direction: column; gap: 9px; }

.src {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 11px 13px;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.src.is-hot {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11,100,200,.12);
  transform: translateX(-2px);
}

.src-top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.src-n {
  width: 17px; height: 17px; flex: none; border-radius: 5px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
}
.src-id { font-size: 11px; font-weight: 700; color: var(--accent-deep); }
.src-cat { font-size: 10.5px; color: var(--ink-faint); margin-left: auto; }

.src-q { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.src-a { margin: 0 0 8px; font-size: 11.5px; color: var(--ink-soft); line-height: 1.55; }

.src-score { display: flex; align-items: center; gap: 8px; }
.bar {
  flex: 1; height: 4px; border-radius: 3px; background: var(--line-soft); overflow: hidden;
}
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 3px; }
.src-num { font-size: 10.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* ==================== rich blocks ==================== */

.blocks { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

.blk {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px 17px;
  box-shadow: var(--sh);
  animation: rise .3s ease-out both;
}

.blk-head {
  display: flex; align-items: baseline; gap: 9px; margin-bottom: 11px;
}
.blk-head h3 {
  margin: 0; font-size: 12.5px; font-weight: 700;
  letter-spacing: .01em; color: var(--ink);
}
.blk-sub { font-size: 11px; color: var(--ink-faint); }

.blk-lead { margin: 0 0 11px; font-size: 12.5px; color: var(--ink-soft); }

.blk-note {
  margin: 10px 0 0; font-size: 11.5px; color: var(--ink-soft);
  line-height: 1.6; display: flex; align-items: flex-start; gap: 6px;
}

.blk-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 11px; font-size: 12px; font-weight: 600;
  color: var(--accent); text-decoration: none;
}
.blk-link:hover { text-decoration: underline; }

.ico { width: 14px; height: 14px; flex: none; }

.src-tag {
  display: inline-block; margin-left: 6px;
  font-size: 10px; font-weight: 600; color: var(--ink-faint);
  background: var(--line-soft); padding: 1px 6px; border-radius: 4px;
  vertical-align: 1px; white-space: nowrap;
}

.badge {
  display: inline-block; font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: var(--wash); color: var(--accent-deep);
}
.badge-soft { background: var(--line-soft); color: var(--ink-soft); }
.badge-good { background: var(--good-wash); color: var(--good); }
.badge-off  { background: var(--warn-wash); color: var(--warn); }

/* ---------- contact ---------- */

.contact-card {
  background: linear-gradient(150deg, #f6fafe, #eef5fd);
  border: 1px solid #dceaf8; border-radius: var(--r-sm);
  padding: 14px 16px;
}
.contact-main {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 11px;
}
.tel {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 22px; font-weight: 800; letter-spacing: .01em;
  color: var(--accent-deep); text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.tel .ico { width: 18px; height: 18px; }
.tel:hover { text-decoration: underline; }
.contact-meta { display: flex; gap: 6px; flex-wrap: wrap; }

.contact-kv { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.contact-kv > div { display: flex; align-items: baseline; gap: 8px; }
.contact-kv dt {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--ink-faint);
}
.contact-kv dd { margin: 0; font-size: 12.5px; font-weight: 600; }

/* ---------- decision ---------- */

.branches { display: flex; flex-direction: column; gap: 0; }

.branch {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; position: relative;
  transition: border-color .18s, box-shadow .18s;
}
.branch.tone-primary { background: #f7fbff; border-color: #d8e9fa; }
.branch.tone-accent  { background: #fbf8ff; border-color: #e3daf7; }
.branch.tone-warn    { background: var(--warn-wash); border-color: #f0e0be; }

.branch.is-now {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11,100,200,.13);
}

.branch-cond {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-faint);
  margin-bottom: 4px;
}
.branch-now {
  font-size: 10px; font-weight: 700; color: #fff;
  background: var(--accent); padding: 1px 7px; border-radius: 999px;
}
.branch-label { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.branch-detail { margin: 0 0 9px; font-size: 12px; color: var(--ink-soft); }

.branch-act {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--accent-deep);
  text-decoration: none; font-variant-numeric: tabular-nums;
  background: #fff; border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 8px;
}
.branch-act:hover { border-color: var(--accent); background: var(--wash); }

.branch-or {
  align-self: center; font-size: 10.5px; font-weight: 700;
  color: var(--ink-faint); padding: 5px 0; letter-spacing: .08em;
}

/* ---------- offices ---------- */

.off-tools { margin-bottom: 11px; }

.off-prefs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }

.pref {
  border: 1px solid var(--line); background: var(--surface);
  font-size: 11.5px; color: var(--ink-soft);
  padding: 4px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
}
.pref em {
  font-style: normal; font-size: 10px; font-weight: 700;
  color: var(--ink-faint); background: var(--line-soft);
  padding: 0 5px; border-radius: 999px;
}
.pref:hover { border-color: #b6d4f5; background: var(--wash); }
.pref.is-on {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.pref.is-on em { background: rgba(255,255,255,.24); color: #fff; }

.off-search {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 11px; font: inherit; font-size: 12.5px; outline: 0;
}
.off-search:focus { border-color: #a9cdf3; box-shadow: 0 0 0 3px rgba(11,100,200,.1); }

.off-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 8px; max-height: 330px; overflow-y: auto; padding-right: 3px;
}

.off-item {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; background: var(--surface);
  transition: border-color .16s, transform .16s;
}
.off-item:hover { border-color: #b6d4f5; transform: translateY(-1px); }

.off-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.off-name { font-size: 12.5px; font-weight: 700; }
.off-pref {
  font-size: 10px; color: var(--accent-deep);
  background: var(--wash); padding: 1px 6px; border-radius: 4px; margin-left: auto;
}
.off-dist {
  margin: 0 0 7px; font-size: 11px; color: var(--ink-faint);
  line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.off-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.off-addr {
  display: flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--ink-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.off-tel {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  font-size: 12px; font-weight: 700; color: var(--accent-deep);
  text-decoration: none; font-variant-numeric: tabular-nums;
}
.off-tel:hover { text-decoration: underline; }

.off-empty { margin: 12px 0 0; font-size: 12px; color: var(--ink-faint); text-align: center; }

/* ---------- link card ---------- */

.linkcard {
  display: flex; align-items: center; gap: 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; text-decoration: none; color: inherit;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.linkcard:hover {
  border-color: #b6d4f5; box-shadow: var(--sh); transform: translateY(-1px);
}
.linkcard-ico {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  background: var(--grad); color: #fff; display: grid; place-items: center;
}
.linkcard-ico .ico { width: 18px; height: 18px; }
.linkcard-body { display: flex; flex-direction: column; min-width: 0; }
.linkcard-title { font-size: 13px; font-weight: 700; }
.linkcard-desc { font-size: 11.5px; color: var(--ink-soft); }
.linkcard-host { font-size: 10.5px; color: var(--ink-faint); }
.linkcard-go { margin-left: auto; color: var(--accent); font-size: 15px; }

/* ---------- area ---------- */

.area { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

.area-map {
  display: grid;
  grid-template-columns: repeat(3, 62px);
  grid-template-rows: repeat(4, 44px);
  gap: 5px;
}
/* 九州の位置関係におおよそ合わせる */
.area-cell[data-pref="福岡県"]   { grid-area: 1 / 2; }
.area-cell[data-pref="佐賀県"]   { grid-area: 2 / 1; }
.area-cell[data-pref="長崎県"]   { grid-area: 3 / 1; }
.area-cell[data-pref="大分県"]   { grid-area: 2 / 3; }
.area-cell[data-pref="熊本県"]   { grid-area: 3 / 2; }
.area-cell[data-pref="宮崎県"]   { grid-area: 4 / 3; }
.area-cell[data-pref="鹿児島県"] { grid-area: 4 / 2; }

.area-cell {
  border-radius: 9px;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.2;
  box-shadow: 0 3px 10px rgba(11,100,200,.22);
  transition: transform .16s;
}
.area-cell:hover { transform: translateY(-2px) scale(1.03); }
.area-cell b { font-size: 12.5px; font-weight: 700; }
.area-cell em { font-style: normal; font-size: 9.5px; opacity: .82; }

.area-side { flex: 1; min-width: 170px; }
.area-count { display: flex; align-items: baseline; gap: 5px; }
.area-count b { font-size: 34px; font-weight: 800; color: var(--accent); line-height: 1; }
.area-count span { font-size: 13px; color: var(--ink-soft); }

/* ---------- timeline ---------- */

.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before {
  content: ""; position: absolute; left: 27px; top: 12px; bottom: 12px;
  width: 2px; background: var(--line);
}

.tl-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 8px 0; position: relative;
}

.tl-day {
  width: 56px; flex: none; text-align: center;
  background: var(--surface); border: 2px solid var(--line);
  border-radius: 10px; padding: 5px 0; z-index: 1;
}
.tl-day b {
  display: block; font-size: 17px; font-weight: 800;
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.tl-day em { font-style: normal; font-size: 9.5px; color: var(--ink-faint); }

.tl-item.is-key .tl-day {
  border-color: var(--accent); background: var(--wash);
}
.tl-item.is-key .tl-day b { color: var(--accent-deep); }

.tl-body { flex: 1; padding-top: 2px; }
.tl-label { display: block; font-size: 13px; font-weight: 700; }
.tl-detail { margin: 2px 0 0; font-size: 11.5px; color: var(--ink-soft); }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; }

table.data {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
table.data th, table.data td {
  border: 1px solid var(--line); padding: 8px 11px;
  text-align: left; vertical-align: top;
}
table.data thead th {
  background: var(--line-soft); font-weight: 700; font-size: 11.5px;
  color: var(--ink-soft); white-space: nowrap;
}
table.data tbody th {
  background: #fafcfe; font-weight: 600; white-space: nowrap; width: 1%;
}
table.data thead th .ico { margin-right: 5px; vertical-align: -2px; }

table.cmp tbody td { color: var(--ink-soft); }

.td-q { max-width: 460px; }

/* ---------- steps ---------- */

.tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 11px; }

.track {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; background: #fbfdff;
}
.track-head {
  display: flex; align-items: center; gap: 7px; margin-bottom: 9px;
  color: var(--accent-deep);
}
.track-label { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.track-head .badge { margin-left: auto; }

.track-steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.track-steps li {
  counter-increment: st;
  position: relative; padding: 0 0 11px 26px;
  font-size: 12.5px; line-height: 1.55;
}
.track-steps li:last-child { padding-bottom: 0; }
.track-steps li::before {
  content: counter(st);
  position: absolute; left: 0; top: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
}
.track-steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 8.5px; top: 22px; bottom: 2px;
  width: 1px; background: var(--line);
}

/* ---------- flow ---------- */

.flow {
  display: flex; align-items: stretch; gap: 4px; flex-wrap: wrap;
}
.flow-node {
  flex: 1 1 130px; min-width: 118px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fbfdff; padding: 12px 11px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 5px;
  transition: border-color .16s, transform .16s;
}
.flow-node:hover { border-color: #b6d4f5; transform: translateY(-2px); }
.flow-ico {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--grad); color: #fff; display: grid; place-items: center;
}
.flow-ico .ico { width: 16px; height: 16px; }
.flow-label { font-size: 12px; font-weight: 700; line-height: 1.35; }
.flow-desc { font-size: 10.5px; color: var(--ink-faint); line-height: 1.4; }

.flow-arrow {
  align-self: center; color: var(--ink-faint);
  font-size: 20px; font-weight: 300; padding: 0 1px;
}

.caveats { list-style: none; margin: 12px 0 0; padding: 0; }
.caveats li {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 11.5px; color: var(--ink-soft); line-height: 1.6;
  padding: 4px 0;
}
.caveats .ico { color: var(--warn); margin-top: 3px; }

/* ---------- facts ---------- */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

.fact {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 14px; background: #fbfdff;
  display: flex; flex-direction: column; gap: 2px;
}
.fact.tone-good { background: var(--good-wash); border-color: #c7e8da; }
.fact-value { font-size: 24px; font-weight: 800; line-height: 1.15; color: var(--accent-deep); }
.fact.tone-good .fact-value { color: var(--good); }
.fact-label { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; }
.fact-sub { font-size: 10.5px; color: var(--ink-faint); }

/* ---------- pros / cons ---------- */

.pc { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 11px; }

.pc-col { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.pc-pro { background: var(--good-wash); border-color: #c7e8da; }
.pc-con { background: var(--warn-wash); border-color: #f0e0be; }

.pc-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; margin-bottom: 7px;
}
.pc-pro .pc-head { color: var(--good); }
.pc-con .pc-head { color: var(--warn); }

.pc-col ul { margin: 0; padding-left: 17px; }
.pc-col li { font-size: 12px; line-height: 1.6; margin-bottom: 4px; color: var(--ink-soft); }

.tips {
  margin-top: 11px; border: 1px dashed #b6d4f5; border-radius: var(--r-sm);
  padding: 11px 14px; background: #f7fbff;
}
.tips-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--accent-deep); margin-bottom: 5px;
}
.tips ul { margin: 0; padding-left: 17px; }
.tips li { font-size: 12px; line-height: 1.6; color: var(--ink-soft); margin-bottom: 3px; }

/* ---------- chart box ---------- */

.chart-box { width: 100%; height: 260px; }

/* ==================== dashboards ==================== */

.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px; margin-bottom: 18px;
}

.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 15px 17px; box-shadow: var(--sh);
  display: flex; flex-direction: column; gap: 2px;
}
.kpi b {
  font-size: 20px; font-weight: 800; line-height: 1.2;
  color: var(--accent-deep); word-break: break-all;
}
.kpi span { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.kpi em { font-style: normal; font-size: 10.5px; color: var(--ink-faint); }

.grid-2 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px; margin-bottom: 14px;
}

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 17px 19px; box-shadow: var(--sh);
  margin-bottom: 14px;
}
.panel:last-child { margin-bottom: 0; }

.panel-title {
  margin: 0 0 13px; font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint);
}
.panel-note {
  margin: 12px 0 0; font-size: 11.5px; color: var(--ink-soft); line-height: 1.7;
}

.archflow { list-style: none; margin: 0; padding: 0; }
.archflow li {
  display: grid; grid-template-columns: 22px 1fr;
  gap: 4px 11px; padding: 0 0 14px;
  position: relative;
}
.archflow li:last-child { padding-bottom: 0; }
.af-n {
  grid-row: span 2; width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.af-label { font-size: 13px; font-weight: 700; line-height: 1.4; }
.af-detail { font-size: 11.5px; color: var(--ink-faint); line-height: 1.5; }
.archflow li:not(:last-child)::after {
  content: ""; position: absolute; left: 10.5px; top: 26px; bottom: 4px;
  width: 1px; background: var(--line);
}

.kv { margin: 0; display: flex; flex-direction: column; gap: 1px;
      background: var(--line-soft); border-radius: var(--r-sm); overflow: hidden; }
.kv > div {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; background: var(--surface); padding: 9px 12px;
}
.kv dt { font-size: 12px; color: var(--ink-faint); }
.kv dd {
  margin: 0; font-size: 12.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* ==================== lightbox ==================== */

.lightbox {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15,28,46,.82);
  display: grid; place-items: center; padding: 40px;
}
/* display 指定が UA の [hidden] を上書きしてしまうため明示的に打ち消す */
.lightbox[hidden] { display: none; }
.lightbox-close {
  position: absolute; top: 18px; right: 22px;
  border: 0; background: transparent; color: #fff; font-size: 30px; line-height: 1;
}

/* ==================== responsive ==================== */

@media (max-width: 1180px) {
  .chat-layout { grid-template-columns: 1fr; }
  .evidence {
    border-left: 0; border-top: 1px solid var(--line);
    padding: 18px 0 20px; overflow: visible;
  }
  .shell, .view.is-on { overflow-y: auto; }
  .thread { overflow: visible; }
}

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px; }
  .tabs { order: 3; width: 100%; }
  .brand-text em { display: none; }
  .brand-text strong { font-size: 13px; }
  .corp-name { font-size: 13.5px; }
  .chat-layout, .pad { padding-left: 14px; padding-right: 14px; }
  .area-map { grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(4, 40px); }
  .off-list { grid-template-columns: 1fr; }
}
