/*
 * styles.css — Googleコンソール系(GA / Search Console)のトーンを踏襲したモックスタイル。
 * 外部フォント・CDNは読み込まない。system-uiフォールバックのみ。
 */

:root {
  color-scheme: light;
  --font: "Google Sans", Roboto, "Helvetica Neue", -apple-system, "Hiragino Sans",
    "Noto Sans JP", Meiryo, sans-serif;
  --blue: #1a73e8;
  --blue-dark: #185abc;
  --blue-bg: #e8f0fe;
  --text: #202124;
  --text-2: #5f6368;
  --border: #dadce0;
  --border-light: #e8eaed;
  --bg: #f8f9fa;
  --card: #ffffff;
  --success: #188038;
  --success-bg: #e6f4ea;
  --warning: #b06000;
  --warning-strong: #e37400;
  --warning-bg: #fef7e0;
  --error: #d93025;
  --error-bg: #fce8e6;
  --infra: #8c1d18;
  --infra-bg: #f9dedc;
  --safety: #7627bb;
  --safety-bg: #f3e8fd;
  --target: #00838f;
  --target-bg: #e0f7fa;
  --radius: 8px;
  --popover-fade-duration: 30ms;
  --popover-scale-duration: 180ms;
  --popover-scale-easing: cubic-bezier(0.16, 1, 0.3, 1); /* EaseOutExpo */
  --accordion-open-easing: cubic-bezier(0.87, 0, 0.13, 1); /* EaseInOutExpo */
  --accordion-close-easing: cubic-bezier(0.445, 0.05, 0.55, 0.95); /* EaseInOutSine */
  --accordion-open-duration: 270ms;
  --accordion-close-duration: 210ms;
  --accordion-fade-duration: 150ms;
  --accordion-fade-delay: 120ms;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.1), 0 1px 3px 1px rgba(60, 64, 67, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

/* bodyは直下のsticky要素（.demo-banner / .appbar）の包含ブロック。高さを100%に固定すると
   1画面分スクロールした時点でbodyの下端と一緒にヘッダーが画面外へ出るため、min-heightにとどめる */
body {
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--card);
  color: var(--blue-dark);
  box-shadow: var(--shadow);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

#main-content:focus {
  outline: none;
}

.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: none;
  vertical-align: middle;
}

.icon.sm {
  width: 16px;
  height: 16px;
}

.icon.lg {
  width: 24px;
  height: 24px;
}

/* ---------- demo banner ---------- */
.demo-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 24px;
  background: var(--warning-bg);
  color: var(--warning);
  border-bottom: 1px solid #fde293;
  font-size: 12px;
  font-weight: 500;
}

.demo-banner.connected-banner {
  background: var(--success-bg);
  color: var(--success);
  border-bottom-color: #a8dab5;
}

.demo-banner.error-banner {
  background: var(--error-bg);
  color: var(--error);
  border-bottom-color: #f3b8b8;
}

/* ---------- app bar ---------- */
.appbar {
  position: sticky;
  top: 31px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 24px 0 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.guide-surface .appbar {
  top: 0;
}

.appbar .product {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
}

.appbar .product .logo {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.2px;
}

.appbar .product .logo b {
  color: var(--blue);
  font-weight: 500;
}

.appbar .product .console {
  font-size: 15px;
  color: var(--text-2);
  font-weight: 400;
}

.appbar .beta-tag {
  align-self: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--blue-bg);
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.appbar .spacer {
  flex: 1;
}

/* ---------- サイドバー左上: 現在の組織とメニュー（#603） ---------- */
.sidenav-organization {
  position: relative;
  display: grid;
  gap: 2px;
  margin: 0 0 8px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border-light);
}

/* 「組織」の見出しはビルのアイコンで伝わるため視覚的には出さず、読み上げ（aria-describedby）にだけ残す */
.sidenav-organization .organization-context-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sidenav-organization[hidden],
.mobile-organization-context[hidden],
.mobile-nav-current-organization[hidden] {
  display: none;
}

.organization-menu-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.organization-menu-toggle:hover,
.organization-menu-toggle[aria-expanded="true"] {
  background: #f1f3f4;
}

.organization-menu-toggle:focus-visible,
.account-menu-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.organization-menu-toggle .icon {
  flex: none;
  color: var(--text-2);
}

.organization-menu-toggle .organization-current {
  flex: 1;
  max-width: none;
}

.organization-menu-toggle .organization-menu-caret,
.account-menu-toggle .account-menu-caret {
  width: 18px;
  height: 18px;
}

.sidenav .menu {
  left: 0;
  right: 0;
  top: calc(100% - 6px);
  min-width: 0;
}

.sidenav .menu-item,
.sidenav a.menu-item {
  margin: 0;
  padding: 9px 16px;
  border-radius: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
}

.sidenav a.menu-item:hover {
  background: #f1f3f4;
  color: var(--text);
}

.menu-heading {
  padding: 6px 16px 4px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
}

/* .menu-item（後で宣言、flex・nowrap・padding 9px 16px）より優先させるため .menu を付ける */
.menu .organization-menu-option {
  position: relative;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 16px 8px 34px;
  text-align: left;
  white-space: normal;
}

.organization-menu-option[aria-current="true"]::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.organization-menu-option-name {
  min-width: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.organization-menu-option-meta {
  min-width: 0;
  color: var(--text-2);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mobile-organization-settings-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-size: 13px;
  text-decoration: none;
}

.organization-context-label {
  flex: none;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
}

.organization-current {
  display: block;
  min-width: 0;
  max-width: 220px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}


html[data-ui-surface="production_direct"] .demo-banner.connected-banner,
html[data-ui-surface="production_direct"] #connection-chip {
  display: none;
}

html[data-ui-surface="production_direct"] .appbar {
  top: 0;
}

.guide-link,
.auth-guide-link a {
  color: var(--blue);
  text-decoration: none;
}

.guide-link {
  padding: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.appbar .guide-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  color: var(--text-2);
}

.appbar .guide-icon-link:hover {
  background: #f1f3f4;
  color: var(--text);
  text-decoration: none;
}

.appbar .guide-icon-link .icon {
  width: 22px;
  height: 22px;
}

.guide-link:hover,
.auth-guide-link a:hover {
  text-decoration: underline;
}

/* ---------- サイドバー左下: 本人のアカウントメニュー（#603） ---------- */
.sidenav-account {
  position: relative;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.sidenav-account[hidden] {
  display: none;
}

.account-menu-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.account-menu-toggle:hover,
.account-menu-toggle[aria-expanded="true"] {
  background: #f1f3f4;
}

.account-menu-toggle .account-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-toggle .account-menu-caret {
  color: var(--text-2);
}

.sidenav-account .menu {
  top: auto;
  bottom: calc(100% + 4px);
}

.sidenav .sidenav-footer {
  margin-top: 0;
  padding-top: 12px;
}

.user-menu-identity {
  display: grid;
  gap: 6px;
  padding: 8px 16px 10px;
}

.user-menu-email {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.user-menu-scope {
  color: var(--text-2);
  font-size: 12px;
}

.user-menu-scope .organization-switcher {
  width: 100%;
  max-width: none;
}

.avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
}

.auth-guide-link {
  margin-top: 14px;
  text-align: center;
}

.guide-page {
  min-height: 100%;
  padding: 40px 20px 72px;
}

.guide-article {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.guide-article h1 {
  margin-bottom: 10px;
  font-size: 30px;
  line-height: 1.35;
}

.guide-article h2 {
  margin: 34px 0 12px;
  padding-top: 4px;
  border-top: 1px solid var(--border-light);
  font-size: 21px;
  line-height: 1.45;
}

.guide-article p + p,
.guide-article ul + p,
.guide-article ol + p,
.guide-article table + p {
  margin-top: 14px;
}

.guide-article ul,
.guide-article ol {
  margin: 10px 0 0 24px;
}

.guide-article li + li {
  margin-top: 6px;
}

.guide-article table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-size: 13px;
}

.guide-article th,
.guide-article td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.guide-article th {
  background: var(--bg);
}

.guide-lead {
  color: var(--text-2);
  font-size: 15px;
}

.guide-article h3 {
  margin: 22px 0 8px;
  font-size: 16px;
  line-height: 1.5;
}

.guide-article h3 + p,
.guide-article h3 + ul,
.guide-article h3 + dl {
  margin-top: 0;
}

.guide-article p + ul,
.guide-article p + ol,
.guide-article p + dl {
  margin-top: 8px;
}

.guide-article dl + p,
.guide-article ol.guide-steps + p,
.guide-article h3 + p + ul {
  margin-top: 14px;
}

.guide-toc {
  margin: 22px 0 8px;
  padding: 16px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg);
}

.guide-toc-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.guide-toc ol {
  margin: 0 0 0 20px;
  columns: 2;
  column-gap: 24px;
}

.guide-toc li {
  margin: 0;
  padding: 2px 0;
  break-inside: avoid;
  font-size: 14px;
}

.guide-toc a {
  color: var(--blue);
  text-decoration: none;
}

.guide-toc a:hover {
  text-decoration: underline;
}

.guide-steps li + li {
  margin-top: 8px;
}

.guide-fields {
  margin: 12px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.guide-article [id] {
  scroll-margin-top: 112px;
}

.guide-fields dt {
  padding: 10px 14px 4px;
  font-weight: 500;
  background: var(--bg);
}

.guide-fields dd {
  margin: 0;
  padding: 0 14px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.guide-fields dd:last-child {
  border-bottom: 0;
}

.guide-example {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.guide-article code {
  font-size: 0.92em;
  word-break: break-all;
}

.guide-note {
  margin-top: 26px;
  padding: 14px 16px;
  border-left: 4px solid var(--blue);
  background: var(--blue-bg);
}

.auth-gate {
  min-height: calc(100vh - 95px);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(100%, 420px);
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 10px 0 6px;
  font-size: 22px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.auth-card .auth-lead {
  margin: 0 0 16px;
  color: var(--text-2);
}

.auth-card .auth-lead-after-alert {
  margin-top: 16px;
}

.auth-card-progress {
  text-align: center;
}

.auth-card-progress h1 {
  margin-top: 16px;
}

.auth-card-progress .auth-lead {
  margin-bottom: 0;
}

.auth-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-light);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.auth-logo {
  font-size: 22px;
}

.auth-logo b {
  color: var(--blue);
}

.auth-card .field {
  margin-top: 16px;
}

.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-inline-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--blue);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-inline-link:hover {
  color: var(--blue-dark);
}

.auth-field-error {
  margin: 6px 0 0;
  color: var(--error);
  font-size: 12px;
  line-height: 1.5;
}

.auth-card input[aria-invalid="true"] {
  border-color: var(--error);
}

.auth-card input[readonly] {
  background: var(--bg);
  color: var(--text-2);
}

.auth-guide-link a {
  white-space: nowrap;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 24px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
  cursor: pointer;
}

.check-row > input[type="checkbox"] {
  appearance: none;
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  border: 1px solid var(--text-2);
  border-radius: 3px;
  background: var(--card);
  cursor: inherit;
  transition: background-color 30ms linear, border-color 30ms linear;
}

.check-row > input:checked {
  background: var(--blue);
  border-color: var(--blue);
}

.check-row > input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.check-row > span {
  grid-area: 1 / 2;
}

.check-row-mark {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  pointer-events: none;
  fill: none;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.check-row-mark path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  /* Keep the drawn shape until its exit fade finishes, then reset for the next check. */
  transition: opacity 120ms linear, stroke-dashoffset 0ms linear 120ms;
}

.check-row > input:checked + .check-row-mark path {
  stroke-dashoffset: 0;
  opacity: 1;
}

.check-row > input:checked + .check-row-mark .check-short {
  transition: stroke-dashoffset 60ms linear 30ms, opacity 0ms linear 30ms;
}

.check-row > input:checked + .check-row-mark .check-long {
  transition: stroke-dashoffset 90ms linear 90ms, opacity 0ms linear 90ms;
}

.check-row > input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.check-row > input:disabled + .check-row-mark {
  opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
  .check-row > input[type="checkbox"],
  .check-row-mark path,
  .check-row > input:checked + .check-row-mark path[class] {
    transition: none;
  }
}

@media (forced-colors: active) {
  .check-row > input[type="checkbox"] {
    appearance: auto;
  }
  .check-row-mark {
    display: none;
  }
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.auth-storage-note {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 12px;
}

.auth-card .auth-note {
  margin: 20px 0 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.auth-legal-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 18px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.6;
}

.auth-legal-consent input {
  margin-top: 3px;
}

.auth-legal-consent a {
  color: var(--blue);
}

.legal-draft-label {
  display: inline-block;
  margin: 0 0 8px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #7a4a00;
  background: #fff4d6;
  font-size: 12px;
  font-weight: 600;
}

.auth-alert {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}

.auth-alert.error {
  color: var(--error);
  background: var(--error-bg);
}

.auth-alert.success {
  color: var(--success);
  background: var(--success-bg);
}

.auth-alert.info {
  color: var(--blue-dark);
  background: var(--blue-bg);
}

.auth-alert.progress {
  color: var(--blue-dark);
  background: var(--blue-bg);
}

.auth-invitation-summary {
  display: grid;
  gap: 10px;
  margin: 16px 0 4px;
  padding: 14px;
  border-radius: 8px;
  background: var(--bg);
}

.auth-invitation-summary > div {
  display: grid;
  gap: 2px;
}

.auth-invitation-summary span {
  color: var(--text-2);
  font-size: 12px;
}

.auth-invitation-summary strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.auth-action-complete {
  margin-top: 20px;
}

.auth-action-complete p {
  margin: 0;
  color: var(--text);
}

.auth-action-complete .auth-submit {
  display: flex;
}

/* ---------- layout ---------- */
/* 画面上部に固定されるヘッダーの高さ。接続バナー31px + アプリバー64px。
   顧客向け画面（production_direct）は接続バナーを表示しないため64px */
:root {
  --sticky-header-height: 95px;
}

html[data-ui-surface="production_direct"] {
  --sticky-header-height: 64px;
}

.layout {
  display: flex;
  min-height: calc(100vh - var(--sticky-header-height));
}

.mobile-nav {
  display: none;
}

/* サイドバーは表示領域の高さに固定し、ページ本文の長さに引き伸ばさない。
   組織と「新規サイト」は上、アカウントと規約リンクは下に固定し、間のページ一覧だけが.sidenav-scrollでスクロールする。
   固定位置と高さは --sticky-header-height（バナーの有無で変わる）に従う */
.sidenav {
  position: sticky;
  top: var(--sticky-header-height);
  align-self: flex-start;
  width: 256px;
  height: calc(100vh - var(--sticky-header-height));
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 24px;
  background: var(--card);
  border-right: 1px solid var(--border);
}

.sidenav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -4px;
  padding: 0 4px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.sidenav-footer,
.mobile-nav-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding: 20px 12px 0;
  font-size: 12px;
  color: var(--text-2);
}

.sidenav .sidenav-footer a,
.mobile-nav .mobile-nav-footer a {
  display: inline;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 400;
  text-decoration: none;
}

.sidenav .sidenav-footer a:hover,
.mobile-nav .mobile-nav-footer a:hover {
  background: none;
  color: var(--text);
  text-decoration: underline;
}

/* 規約リンクの隣に置く計測許可の切替。リンクと同じ見た目のボタンにし、計測が無効な環境では区切りごと隠す */
.footer-consent {
  display: inline-flex;
  gap: 8px;
}

.footer-consent[hidden] {
  display: none;
}

.sidenav-footer button,
.mobile-nav-footer button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.sidenav-footer button:hover,
.mobile-nav-footer button:hover {
  color: var(--text);
  text-decoration: underline;
}

.mobile-nav-footer {
  margin-top: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border-light);
}

.sidenav .nav-section {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 16px 16px 6px 24px;
}

.sidenav a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 12px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  margin-bottom: 2px;
}

.sidenav a:hover {
  background: #f1f3f4;
  color: var(--text);
}

.sidenav a.active {
  background: var(--blue-bg);
  color: var(--blue-dark);
}

.sidenav a .icon {
  color: inherit;
}

.sidenav a .nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidenav .nav-sub {
  padding-left: 38px;
  font-weight: 400;
  font-size: 13px;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 24px 32px 64px;
  max-width: 1160px;
}

/* ---------- typography / headers ---------- */
.page-header {
  margin-bottom: 20px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--blue);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .icon {
  color: #9aa0a6;
}

h1.page-title {
  font-size: 24px;
  font-weight: 400;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.page-sub {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 4px;
  max-width: 760px;
}

h2.section-title {
  font-size: 16px;
  font-weight: 500;
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

h2.section-title .icon {
  color: var(--text-2);
}

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.card.flat {
  box-shadow: none;
}

.card-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  color: var(--text-2);
}

/* カード内の素の<h2>も .card-title と同じ見た目にし、画面ごとの見出しスタイルを増やさない */
.card > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 500;
}

/* カード内の補助項目: ラベル（12px・補助色）→ 値（13px）、注記（12px・補助色） */
.card-field {
  margin-top: 14px;
}

/* テストエージェントへの共通指示: 文脈の下に許可・禁止の2列を続ける */
.card-field + .result-cols {
  margin-top: 18px;
}

.card-field-label {
  margin-bottom: 4px;
  color: var(--text-2);
  font-size: 12px;
}

.card-field-value {
  font-size: 13px;
}

.card-field-note {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card-grid .card {
  margin-bottom: 0;
}

.guidance-card {
  border-color: #cfe0fb;
  background: linear-gradient(135deg, #f7fbff 0%, #fff 72%);
}

.guidance-card h2,
.guidance-card h3 {
  margin: 5px 0 8px;
  font-size: 20px;
  line-height: 1.45;
}

.guidance-card p {
  margin: 0 0 16px;
  color: var(--text-2);
}

.result-guidance-card > .card-title {
  margin-top: 5px;
}

#comparison-customer-decision:focus,
#customer-feedback:focus,
#execution-record:focus {
  outline: 3px solid color-mix(in srgb, var(--blue) 28%, transparent);
  outline-offset: 3px;
}

.guidance-kicker {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.guidance-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.guidance-choice {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.guidance-choice:hover {
  border-color: var(--blue);
  background: var(--blue-bg);
}

.guidance-choice:focus-visible {
  outline: 3px solid rgba(26, 115, 232, .25);
  outline-offset: 2px;
}

.guidance-choice span {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

.site-card {
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.site-card:hover {
  box-shadow: var(--shadow);
}

.site-card .site-url {
  color: var(--text-2);
  font-size: 12px;
  word-break: break-all;
}

.site-card .site-meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-2);
}

.site-card .site-meta b {
  color: var(--text);
  font-weight: 500;
  font-size: 16px;
  display: block;
}

/* ---------- 新しい操作テスト: 対象サイトの選択（#/tests/new） ----------
   カード全体が1つのリンク。リンク既定の青・下線を打ち消し、選択肢として読めるようにする */
.site-chooser {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

a.site-choice {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

a.site-choice:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
}

a.site-choice:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.site-choice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
}

.site-choice-title .icon {
  flex: none;
  color: var(--text-2);
}

.site-choice-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.site-choice-url {
  color: var(--text-2);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.site-choice-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-2);
}

.site-choice-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-weight: 500;
}

.site-choice-action .icon {
  color: inherit;
}

/* ---------- chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  line-height: 16px; /* 12px × 1.6 = 19.2px の端数を避け、枠線ありでも同じ外形高さにする */
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  vertical-align: middle;
}

.chip .icon {
  width: 14px;
  height: 14px;
}

.chip.neutral {
  background: #f1f3f4;
  color: var(--text-2);
}

.chip.info {
  background: var(--blue-bg);
  color: var(--blue-dark);
}

.chip.success {
  background: var(--success-bg);
  color: var(--success);
}

.chip.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.chip.error {
  background: var(--error-bg);
  color: var(--error);
}

.chip.infra {
  background: #ede7f6;
  color: #5e35b1;
  padding: 1px 9px;
  border: 1px solid #b39ddb;
}

.chip.safety {
  background: var(--safety-bg);
  color: var(--safety);
}

.chip.target {
  background: var(--target-bg);
  color: var(--target);
}

.chip.outline {
  background: transparent;
  padding: 1px 9px;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-weight: 400;
}

.pulse-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 1.2s ease-in-out infinite;
}

.loading-spinner {
  display: inline-block;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.task-registration-pending {
  align-items: center;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot,
  .loading-spinner {
    animation: none;
  }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  background: transparent;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-dark);
  box-shadow: var(--shadow);
}

.btn-outlined {
  border-color: var(--border);
  color: var(--blue);
  background: var(--card);
}

.btn-outlined:hover {
  background: #f6f9fe;
}

.btn-text {
  color: var(--blue);
  padding: 8px 12px;
}

.btn-text:hover {
  background: var(--blue-bg);
}

.btn-text.danger {
  color: var(--error);
}

.btn-text.danger:hover {
  background: #fef1f0;
}

.btn-danger-outlined {
  border-color: var(--border);
  color: var(--error);
  background: var(--card);
}

.btn-danger-outlined:hover {
  background: #fef1f0;
}

.danger-zone {
  border-color: #f3b8b3;
  background: #fffafa;
  margin-top: 28px;
}

.danger-zone .card-title {
  color: var(--error);
}

.organization-closure .parameter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.organization-closure .parameter-grid > div {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 12px 14px;
}

.organization-closure .parameter-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.organization-closure .parameter-grid dd {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.danger-zone .card-title .icon {
  color: inherit;
}

.danger-zone code {
  overflow-wrap: anywhere;
}

.site-header-url {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.btn:focus,
.btn:focus-visible {
  outline: 3px solid #174ea6;
  outline-offset: 2px;
}

.btn-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ---------- tables ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}

th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr.rowlink {
  cursor: pointer;
}

tbody tr.rowlink:hover {
  background: var(--bg);
}

td .td-sub,
.continuity-task-head .task-meta {
  color: #80868b;
  font-size: 12px;
}

.continuity-task-head .task-meta {
  margin-top: 4px;
}

td .task-summary {
  display: -webkit-box;
  max-width: 680px;
  margin-top: 3px;
  overflow: hidden;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- forms ---------- */
.form-grid {
  display: grid;
  gap: 18px;
  max-width: 720px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

.field .hint {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
  font-weight: 400;
}

.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field input[type="number"],
.field input[type="password"],
.field input[type="datetime-local"],
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
}

.direct-schedule-card {
  display: grid;
  gap: 16px;
}

.direct-schedule-card .card-title .chip {
  margin-left: 4px;
}

.schedule-form {
  padding-top: 4px;
}

.schedule-form select { width: min(100%, 16rem); }
.schedule-form input[type="datetime-local"] { width: min(100%, 24rem); }

.schedule-date-field[hidden] {
  display: none;
}

.schedule-facts {
  margin-top: 0;
}

.direct-deploy-hook-card {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding-top: 20px;
}

.direct-deploy-hook-card > summary {
  cursor: pointer;
  font-weight: 600;
}

.direct-deploy-hook-card > summary .chip {
  margin-left: 4px;
}

.automation-hook-body {
  display: grid;
  gap: 16px;
  padding-top: 20px;
  min-width: 0;
}

.automation-hook-body > p { margin: 0; }

.deploy-hook-facts {
  margin-top: 0;
}

.deploy-hook-endpoint {
  max-width: 760px;
}

.deploy-hook-copy-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.deploy-hook-secret > div { width: 100%; min-width: 0; }
.deploy-hook-secret .btn-row { margin-top: 16px; }

.deploy-hook-copy-row input {
  min-width: 0;
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.deploy-hook-secret p {
  margin: 6px 0 10px;
}

@media (max-width: 640px) {
  .deploy-hook-copy-row {
    align-items: stretch;
    flex-direction: column;
  }
}

.form-subsection {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}

.form-subsection-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.form-subsection-title .icon {
  color: var(--text-2);
}

.optional-label {
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 400;
}

.credential-fields {
  width: min(100%, 440px);
  gap: 12px;
}

/* メンバー一覧: 権限と状態は各列の中で変更する */
.member-field-select {
  min-width: 112px;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  color: var(--text);
  font: inherit;
}

.member-field-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.organization-members-card td {
  vertical-align: middle;
}

/* 組織情報: 閲覧を既定にし、Organization IDは入力欄と区別できる読み取り専用の値として出す */
.organization-profile-card.editable h2 {
  padding-right: 40px;
}

.kv-grid.organization-profile-facts {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 16px;
}

.organization-profile-card .kv .v {
  word-break: normal;
  overflow-wrap: anywhere;
}

.organization-profile-form {
  margin-bottom: 16px;
}

.organization-profile-form .btn-row {
  margin-top: 0;
}

.kv .k .kv-note {
  padding: 0 6px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
}

.organization-id-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 400;
}

.integration-card {
  border-left: 4px solid var(--success);
}

.plan-text {
  margin: 0;
  line-height: 1.7;
}

.criteria-list {
  margin: 0 0 10px;
  padding-left: 24px;
  line-height: 1.65;
}

.criteria-list li + li {
  margin-top: 6px;
}

.finding-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.finding-item {
  padding: 16px 0;
}

.finding-item + .finding-item {
  border-top: 1px solid var(--border-light);
}

.finding-heading {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.finding-severity {
  flex: none;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  text-transform: uppercase;
}

.severity-critical,
.severity-high {
  color: var(--error);
  background: var(--error-bg);
}

.severity-medium {
  color: #a14200;
  background: #feefe0;
}

.severity-low {
  color: #6f5b00;
  background: #fff4c2;
}

.severity-info {
  color: var(--blue-dark);
  background: var(--blue-bg);
}

.severity-positive {
  color: var(--success);
  background: var(--success-bg);
}

.severity-neutral {
  color: var(--text-2);
  background: var(--bg);
}

.finding-detail + .finding-detail {
  margin-top: 4px;
}

/* ---------- Direct customer page hierarchy ---------- */
.direct-customer-page,
.direct-result-page {
  max-width: 1080px;
}

.direct-customer-page .page-header,
.direct-result-page .page-header {
  margin-bottom: 24px;
}

.direct-customer-page h1.page-title,
.direct-result-page h1.page-title {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

.page-header-with-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-header-with-actions > div {
  min-width: 0;
}

.page-header-with-actions > .btn {
  flex: none;
  margin-top: 2px;
}

.count-badge {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--text-2);
  background: #f1f3f4;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0 12px;
}

.section-heading-row .section-title {
  margin: 0;
}

.direct-dashboard-page .beta-scope-banner {
  margin-bottom: 18px;
}

.direct-dashboard-page .capacity-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
}

.direct-dashboard-page .capacity-summary > div {
  min-height: 70px;
  padding: 16px 18px;
}

.direct-dashboard-page .capacity-summary b {
  font-size: 24px;
}

.capacity-details {
  margin: 0 0 20px;
  padding: 0 4px;
}

.capacity-details summary {
  width: fit-content;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.capacity-detail-grid {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 10px;
}

.capacity-detail-grid > div {
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--card);
}

.capacity-detail-grid span,
.capacity-detail-grid b {
  display: block;
}

.capacity-detail-grid span {
  color: var(--text-2);
  font-size: 11px;
}

.capacity-detail-grid b {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
}

.capacity-detail-grid p {
  align-self: center;
  max-width: 520px;
  color: var(--text-2);
  font-size: 12px;
}

/* 行の「…」メニューを外へ出すため、カード自身では切り抜かない（DESIGN.md §13.6）。表の横スクロールは .table-wrap が担う。 */
.dashboard-task-list {
  padding: 0;
}

.dashboard-task-list > .card-title {
  margin: 0;
  padding: 20px 16px 14px;
}

.dashboard-task-list > .table-wrap {
  margin: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.direct-site-page .page-header {
  margin-bottom: 8px;
}

.direct-site-page .site-task-list {
  margin-top: 0;
}

.direct-site-page > .card.editable {
  padding: 24px 26px;
}

.direct-task-page .task-lifecycle-card {
  padding: 22px 26px;
}

.direct-task-page .task-lifecycle-card .card-title {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
}

.direct-task-page .task-request-card {
  padding: 26px 30px;
}

.direct-task-page .task-request-card .result-request-text {
  font-size: 18px;
  font-weight: 500;
}

.task-detail-actions {
  align-items: center;
  margin: 0 0 28px;
  padding: 2px 0;
}

#direct-rerun-step {
  scroll-margin-top: 100px;
}

.task-report-actions {
  margin-bottom: 28px;
}

.notification-follow-button {
  width: 12em;
  max-width: 100%;
  justify-content: center;
}

/* position: relative は横の(?)の吹き出し（.field-help .help-pop）の基準 */
.notification-follow-control {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.notification-follow-control > span {
  white-space: nowrap;
}

.notification-follow-control > div {
  flex-basis: 100%;
}

.notification-follow-button .icon {
  flex: 0 0 18px;
}

.task-detail-information {
  margin-top: 18px;
}

.task-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.direct-task-menu-wrap .menu {
  min-width: 210px;
}

.direct-run-history-card {
  margin-bottom: 28px;
  padding: 24px 26px;
}

.direct-run-history-card > .hint {
  margin-bottom: 16px;
}

.direct-run-history-card .table-wrap {
  margin-bottom: 0;
}

.run-history-table {
  min-width: 520px;
}

.current-run-label {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--blue-bg);
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.direct-customer-page > .danger-zone {
  margin-top: 36px;
  padding: 20px 24px;
  background: #fffdfd;
}

/* ---------- Direct customer result readability ---------- */

.result-updated-at {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 12px;
}

.direct-result-page > .card {
  margin-bottom: 20px;
  padding: 26px 30px;
}

.direct-result-page > .card > .card-title {
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
}

/* Long-form reports use the same 8px / 4px grid with a reading density of their own. */
.direct-edited-report {
  --report-body-size: 16px;
  --report-body-leading: 2;
  --report-title-size: 28px;
  --report-title-leading: 40px;
  --report-section-size: 22px;
  --report-section-leading: 32px;
  --report-subsection-size: 18px;
  --report-subsection-leading: 28px;
  --report-paragraph-gap: 16px;
  --report-subsection-gap: 24px;
  --report-section-gap: 40px;
  --report-intro-gap: 48px;
  --report-divider-gap: 32px;
  --report-reading-width: 45em;
}

.direct-report-prose {
  max-width: var(--report-reading-width);
  margin-top: var(--report-intro-gap);
  font-size: var(--report-body-size);
  line-height: var(--report-body-leading);
  overflow-wrap: anywhere;
}

.direct-report-prose > .plan-text {
  margin: 0;
  line-height: inherit;
}

.direct-report-prose > .plan-text + .plan-text {
  margin-top: var(--report-paragraph-gap);
}

.direct-report-list {
  margin: var(--report-paragraph-gap) 0;
  padding: 16px 16px 16px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  list-style: disc;
}

.direct-report-list > li + li {
  margin-top: 8px;
}

.direct-report-prose > :is(h3, h4, h5, h6) {
  margin: var(--report-subsection-gap) 0 var(--report-paragraph-gap);
  font-weight: 600;
  font-size: var(--report-subsection-size);
  line-height: var(--report-subsection-leading);
}

.direct-report-prose > h3 {
  font-size: var(--report-title-size);
  line-height: var(--report-title-leading);
}

.direct-report-prose > h4 {
  margin-top: var(--report-section-gap);
  font-size: var(--report-section-size);
  line-height: var(--report-section-leading);
}

/* Keep the title attached to its opening section; separate subsequent sections
   within the reading column, without extending the rule to the card edges. */
.direct-report-prose > h3 + h4 {
  margin-top: var(--report-subsection-gap);
}

.direct-report-prose > h4 ~ h4 {
  position: relative;
  margin-top: var(--report-divider-gap);
  padding-top: var(--report-divider-gap);
}

.direct-report-prose > h4 ~ h4::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  border-top: 1px solid var(--border-light);
}

.direct-report-prose > :is(h3, h4, h5, h6):first-child {
  margin-top: 0;
}


.result-request-text {
  width: 100%;
  max-width: none;
  padding: 18px 20px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.8;
}

.result-request-meta {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}

.detail-facts .kv {
  min-width: 0;
}

.kv-grid.detail-facts {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.detail-facts .kv .k {
  margin-bottom: 5px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.03em;
}

.detail-facts .kv .v,
.detail-facts .kv .v.small {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  word-break: normal;
  overflow-wrap: anywhere;
}

.task-constraints {
  margin-top: 16px;
  padding: 15px 18px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--card);
}

.task-constraints h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.task-constraints h3 .icon {
  width: 16px;
  height: 16px;
}

.task-constraints .plan-text {
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
}

.result-request-details {
  margin-top: 18px;
}

.result-request-details summary {
  width: fit-content;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.result-request-details .result-request-meta {
  margin-top: 12px;
}

.direct-agent-report {
  padding-top: 28px;
  padding-bottom: 28px;
}

.automated-checks-card {
  display: grid;
  gap: 14px;
}

.automated-checks-card .hint,
.automated-checks-card p {
  margin: 0;
}

.automated-check-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.automated-check-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 13px 0;
}

.automated-check-item + .automated-check-item {
  border-top: 1px solid var(--border-light);
}

.automated-check-item p,
.automated-checks-limitations p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}

.automated-check-detail {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.automated-check-detail div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
}

.automated-check-detail dt,
.automated-check-pages > span {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.automated-check-detail dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.automated-check-pages {
  margin-top: 12px;
}

.automated-check-pages ul {
  display: grid;
  gap: 3px;
  margin: 5px 0 0;
  padding: 0;
  list-style: none;
}

.automated-check-pages li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.automated-check-pages li span {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
}

.automated-checks-limitations summary {
  width: fit-content;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.automated-checks-more {
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
}

.automated-checks-more summary {
  width: fit-content;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.automated-checks-more .automated-check-list {
  margin-top: 8px;
}

.finding-observation-details {
  margin-top: 12px;
}

.finding-observation-details > summary,
.automated-check-nodes > summary,
.comparison-record-details > summary,
.comparison-count-details > summary {
  cursor: pointer;
}

.finding-observation-content {
  padding: 16px;
  background: var(--bg, #f8f9fa);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.automated-check-selector code {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.automated-check-nodes {
  width: 100%;
  margin-top: 8px;
}

.automated-check-nodes li,
.automated-check-pages li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.automated-check-pages li {
  flex-wrap: wrap;
}

.comparison-record-details > summary .card-title {
  display: inline-flex;
  margin: 0;
}

.comparison-count-details {
  margin-top: 16px;
}

.run-comparison-card > .hint,
.run-comparison-card > .banner {
  margin-bottom: 18px;
}

.comparison-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.comparison-summary > div {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg);
}

.comparison-summary span {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}

.comparison-operator-notes {
  margin-top: 16px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.comparison-operator-notes .banner > div {
  min-width: 0;
}

.comparison-customer-context,
.comparison-customer-decision {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg);
  min-width: 0;
  overflow-wrap: anywhere;
}

.comparison-customer-context p,
.comparison-customer-decision p {
  margin: 0;
}

.comparison-customer-decision .feedback-choices {
  margin: 4px 0 0;
}

.semantic-comparison {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--blue-bg);
}

.semantic-comparison-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.semantic-verdict,
.semantic-change-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.semantic-verdict {
  padding: 5px 10px;
}

.semantic-verdict.verdict-positive,
.semantic-change-status.status-improved {
  color: var(--success);
  background: var(--success-bg);
}

.semantic-change-status.status-continued {
  color: var(--blue-dark);
  background: var(--blue-bg);
}

.semantic-verdict.verdict-warning,
.semantic-change-status.status-worsened {
  color: var(--error);
  background: var(--error-bg);
}

.semantic-change-status.status-new {
  color: var(--warning);
  background: var(--warning-bg);
}

.semantic-verdict.verdict-neutral,
.semantic-change-status.status-not_observed,
.semantic-change-status.status-uncertain {
  color: var(--text-2);
  background: var(--bg);
}

.semantic-comparison-summary,
.semantic-limitations,
.semantic-comparison .hint {
  margin: 0;
}

.semantic-change-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.semantic-change-list li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.semantic-change-status {
  justify-content: center;
  min-width: 76px;
  padding: 3px 8px;
}

.semantic-limitations {
  color: var(--text-2);
  font-size: 12px;
}

.semantic-limitations ul {
  margin: 5px 0 0;
  padding-left: 18px;
}

.comparison-summary strong {
  font-size: 14px;
  font-weight: 600;
}

.comparison-section + .comparison-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.comparison-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}

.comparison-section > .hint {
  margin-bottom: 10px;
}

.comparison-finding-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.comparison-finding-list li {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .comparison-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.report-summary {
  max-width: 900px;
  margin-bottom: 26px;
  padding: 18px 20px;
  border-radius: 8px;
  background: #f6f9fe;
}

.report-kicker {
  margin-bottom: 6px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.report-summary .plan-text {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.75;
}

.report-section {
  max-width: 900px;
}

.report-site-assessment {
  max-width: none;
  padding: 18px 20px;
  border-radius: 8px;
  background: #f6f9fe;
}

.report-section + .report-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.report-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.report-section > .plan-text,
.report-section > .criteria-list {
  font-size: 14px;
  line-height: 1.75;
}

.direct-finding-list {
  margin-bottom: 0;
}

.direct-finding-list .finding-item {
  padding: 20px 0;
}

.direct-finding-list .finding-item:first-child {
  padding-top: 8px;
}

.direct-finding-list .finding-item:last-child {
  padding-bottom: 0;
}

.direct-finding-list .finding-heading {
  align-items: flex-start;
  margin-bottom: 6px;
}

.direct-finding-list .finding-copy {
  min-width: 0;
}

.direct-finding-list .finding-copy > strong {
  display: block;
  margin-bottom: 9px;
  font-size: 15px;
  line-height: 1.55;
}

.direct-finding-list .finding-detail {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
}

.direct-finding-list .finding-recommendation {
  color: var(--text);
}

.finding-evidence-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.finding-evidence-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.finding-evidence-link:hover {
  text-decoration: underline;
}

.finding-detail-label {
  color: var(--text-2);
  font-weight: 600;
  white-space: nowrap;
}

.direct-result-page .investigation-scope-card {
  margin-top: 4px;
  border-left: 1px solid var(--border);
}

.direct-result-page .scope-boundary-note {
  background: #f6f9fe;
}

.direct-result-page .scope-section {
  padding: 16px 18px;
}

.direct-result-page .customer-feedback-card,
.direct-result-page .operator-review-card {
  background: #fcfcfd;
}

.direct-result-page .evidence-thumb {
  height: 140px;
}

@media (max-width: 700px) {
  .direct-customer-page h1.page-title,
  .direct-result-page h1.page-title {
    display: block;
    font-size: 23px;
  }

  .page-header-with-actions,
  .section-heading-row {
    display: block;
  }

  .page-header-with-actions > .btn,
  .section-heading-row > .btn {
    margin-top: 14px;
  }

  .direct-dashboard-page .capacity-summary {
    grid-template-columns: 1fr;
  }

  .direct-dashboard-page .capacity-summary > div {
    min-height: 0;
  }

  .capacity-detail-grid {
    display: grid;
  }

  .capacity-detail-grid > div {
    min-width: 0;
  }

  .direct-task-page .task-request-card,
  .direct-task-page .task-lifecycle-card,
  .direct-site-page > .card.editable {
    padding: 20px;
  }

  .direct-result-page h1.page-title .title-edit,
  .direct-result-page h1.page-title .chip {
    vertical-align: middle;
  }

  .direct-result-page h1.page-title .chip {
    margin-left: 6px;
  }

  .direct-result-page > .card {
    padding: 20px;
  }

  .result-request-text {
    font-size: 15px;
  }

  .direct-finding-list .finding-detail {
    grid-template-columns: 1fr;
    gap: 1px;
  }
}

.field textarea {
  resize: vertical;
  min-height: 72px;
}

.feedback-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
  padding: 0;
  border: 0;
}

.feedback-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
}

.feedback-choice:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-bg);
}

.feedback-choice input {
  margin-top: 3px;
}

.feedback-choice strong,
.feedback-choice small {
  display: block;
}

.feedback-choice small {
  margin-top: 3px;
  color: var(--text-2);
  line-height: 1.45;
}

.feedback-choices:disabled .feedback-choice {
  cursor: wait;
  opacity: 0.7;
}

.feedback-note {
  max-width: 720px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.field-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 640px) {
  .field-2col {
    grid-template-columns: 1fr;
  }

  .guidance-choices {
    grid-template-columns: 1fr;
  }

  .feedback-choices {
    grid-template-columns: 1fr;
  }

  .demo-banner {
    position: static;
    padding: 7px 16px;
    line-height: 1.45;
  }

  .appbar {
    position: sticky;
    top: 0;
    height: 56px;
    padding: 0 12px;
    gap: 8px;
  }

  .appbar .product .logo {
    font-size: 19px;
    white-space: nowrap;
  }

  .appbar .product .console,
  .appbar .user {
    display: none;
  }

  .appbar .chip {
    white-space: nowrap;
  }

  .guide-link {
    font-size: 12px;
  }

  .guide-page {
    padding: 16px 10px 40px;
  }

  .guide-article {
    padding: 26px 20px;
  }

  .guide-article h1 {
    font-size: 24px;
  }

  .guide-article table {
    display: block;
    min-width: 0;
    overflow-x: auto;
    table-layout: fixed;
  }

  .guide-toc {
    padding: 12px 14px;
  }

  .guide-toc ol {
    columns: 1;
  }

  .guide-article h3 {
    font-size: 15px;
  }
}

/* ---------- key-value summary ---------- */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px 24px;
}

.kv .k {
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.kv .k .icon {
  width: 14px;
  height: 14px;
}

.kv .v {
  font-size: 15px;
  font-weight: 500;
  word-break: break-all;
}

.kv .v.small {
  font-size: 13px;
  font-weight: 400;
}

/* ---------- actors strip ---------- */
.actors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 16px;
}

.actors .actor {
  display: flex;
  align-items: center;
  gap: 4px;
}

.actors .actor .icon {
  width: 16px;
  height: 16px;
  color: var(--text-2);
}

.actors .actor b {
  color: var(--text);
  font-weight: 500;
}

/* ---------- timeline ---------- */
.timeline {
  list-style: none;
  margin: 4px 0 0;
}

.timeline li {
  position: relative;
  padding: 0 0 18px 36px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 22px;
  bottom: -2px;
  width: 2px;
  background: var(--border-light);
}

.timeline li:last-child::before {
  display: none;
}

.timeline .tl-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f3f4;
  color: var(--text-2);
}

.timeline .tl-icon .icon {
  width: 14px;
  height: 14px;
}

.timeline .tl-icon.navigate {
  background: var(--blue-bg);
  color: var(--blue-dark);
}

.timeline .tl-icon.action {
  background: var(--blue-bg);
  color: var(--blue-dark);
}

.timeline .tl-icon.policy {
  background: var(--safety-bg);
  color: var(--safety);
}

.timeline .tl-icon.system {
  background: var(--infra-bg);
  color: var(--infra);
}

.timeline .tl-icon.stop {
  background: #f1f3f4;
  color: var(--text);
}

.timeline .tl-icon.done {
  background: var(--success-bg);
  color: var(--success);
}

.timeline .tl-text {
  font-size: 13.5px;
}

.timeline .tl-meta {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ev-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--blue);
  background: var(--blue-bg);
  border: none;
  border-radius: 10px;
  padding: 1px 8px;
  cursor: pointer;
  font-family: var(--font);
}

.ev-link:hover {
  background: #d2e3fc;
}

/* ---------- evidence ---------- */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.evidence-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

button.evidence-thumb {
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  font: inherit;
}

button.evidence-thumb:focus-visible {
  outline: 3px solid rgba(26, 115, 232, 0.35);
  outline-offset: -3px;
}

.evidence-item.highlight {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.evidence-thumb {
  height: 110px;
  background: repeating-linear-gradient(
    45deg,
    #f1f3f4,
    #f1f3f4 12px,
    #f8f9fa 12px,
    #f8f9fa 24px
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #9aa0a6;
  font-size: 11px;
}

.evidence-thumb.real-evidence-thumb {
  background: #f8f9fa;
}

.evidence-thumb.real-evidence-thumb a,
.evidence-thumb.real-evidence-thumb img {
  width: 100%;
  height: 100%;
  display: block;
}

.evidence-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.evidence-association-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.evidence-association-badge.has-finding {
  color: #174ea6;
  background: #e8f0fe;
}

.evidence-association-badge.needs-review {
  color: #a14200;
  background: #fef0e0;
}

.evidence-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.evidence-lightbox-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(32, 33, 36, 0.72);
  cursor: default;
}

.evidence-lightbox-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  height: min(800px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

.evidence-lightbox-header,
.evidence-lightbox-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  flex: none;
  border: 0;
}

.evidence-lightbox-header h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.evidence-lightbox-content {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  min-height: 0;
  overflow: auto;
}

.evidence-lightbox-media {
  display: grid;
  min-height: 0;
  min-width: 0;
  position: relative;
  place-items: center;
  padding: 16px;
  background: var(--card);
}

.evidence-lightbox-media:only-child { grid-column: 1 / -1; }

.evidence-lightbox-media img {
  display: block;
  max-width: 100%;
  position: absolute;
  inset: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  object-fit: contain;
}

.evidence-lightbox-message {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  text-align: center;
}

.evidence-lightbox-findings {
  padding: 16px;
  overflow: auto;
}

.evidence-lightbox-findings h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.evidence-lightbox-finding + .evidence-lightbox-finding {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.evidence-lightbox-finding div {
  margin-top: 10px;
}

.evidence-lightbox-finding span {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.evidence-lightbox-finding p {
  margin: 3px 0 0;
  white-space: pre-wrap;
}

.evidence-lightbox-nav {
  justify-content: center;
  border: 0;
}

@media (max-width: 700px) {
  .evidence-lightbox { padding: 0; }
  .evidence-lightbox-panel { width: 100%; height: 100dvh; max-height: 100dvh; min-height: 0; border-radius: 0; }
  .evidence-lightbox-content { display: block; }
  .evidence-lightbox-media { height: 46dvh; min-height: 0; }
  .evidence-lightbox-media img { max-height: none; }
}

.evidence-thumb.real-evidence-thumb img {
  object-fit: cover;
  object-position: top center;
}

.evidence-body {
  padding: 10px 12px;
}

.evidence-body .ev-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
}

.evidence-body .ev-label {
  font-size: 13px;
  font-weight: 500;
}

.evidence-body .ev-caption {
  font-size: 12px;
  color: var(--text-2);
}

.adv-body pre {
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.55;
}

.evidence-quote {
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg);
  border-left: 3px solid var(--border);
  font-size: 12px;
  color: var(--text);
  border-radius: 0 4px 4px 0;
}

/* ---------- banners ---------- */
.banner {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  align-items: flex-start;
  border: 1px solid transparent;
}

.banner.banner-in-form {
  margin-bottom: 0;
}

.banner .icon {
  margin-top: 1px;
}

.banner.success {
  background: var(--success-bg);
  color: #0d652d;
  border-color: #ceead6;
}

.banner.warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: #fde293;
}

.banner.error {
  background: var(--error-bg);
  color: var(--error);
  border-color: #f6c1bd;
}

.banner.infra {
  background: var(--infra-bg);
  color: var(--infra);
  border-color: #ecb2ad;
}

.banner.safety {
  background: var(--safety-bg);
  color: var(--safety);
  border-color: #e0c3f8;
}

.banner.target {
  background: var(--target-bg);
  color: var(--target);
  border-color: #b2ebf2;
}

.banner.info {
  background: var(--blue-bg);
  color: var(--blue-dark);
  border-color: #d2e3fc;
}

.banner.neutral {
  background: var(--bg);
  color: var(--text-2);
  border-color: var(--border-light);
}

.banner b {
  font-weight: 700;
}

/* ---------- lists ---------- */
.plain-list {
  list-style: none;
}

.plain-list li {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  font-size: 13.5px;
  align-items: flex-start;
}

.plain-list li .icon {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  flex: none;
}

.plain-list.good li .icon {
  color: var(--success);
}

.plain-list.bad li .icon {
  color: var(--error);
}

.plain-list.neutral li .icon {
  color: var(--text-2);
}

ol.next-actions {
  margin-left: 20px;
}

ol.next-actions li {
  padding: 5px 0;
  font-size: 13.5px;
}

/* ---------- accordion ---------- */
/* Animate layout height so following content moves with the disclosure.
   Browsers without intrinsic-size transitions retain native instant toggling. */
details:not(.mobile-nav) {
  --accordion-duration: var(--accordion-close-duration);
  --accordion-easing: var(--accordion-close-easing);
}

details[open]:not(.mobile-nav) {
  --accordion-duration: var(--accordion-open-duration);
  --accordion-easing: var(--accordion-open-easing);
}

@supports (interpolate-size: allow-keywords) and selector(details::details-content) {
  details:not(.mobile-nav)::details-content {
    interpolate-size: allow-keywords;
    block-size: 0;
    overflow: clip;
    opacity: 0;
    transition:
      block-size var(--accordion-duration) var(--accordion-easing),
      content-visibility var(--accordion-duration) allow-discrete,
      opacity 0ms linear var(--accordion-duration);
  }

  details[open]:not(.mobile-nav)::details-content {
    block-size: auto;
    opacity: 1;
    transition:
      block-size var(--accordion-duration) var(--accordion-easing),
      content-visibility var(--accordion-duration) allow-discrete,
      opacity var(--accordion-fade-duration) linear var(--accordion-fade-delay);
  }
}

@media (prefers-reduced-motion: reduce) {
  details:not(.mobile-nav),
  details[open]:not(.mobile-nav) {
    --accordion-open-duration: 0ms;
    --accordion-close-duration: 0ms;
    --accordion-fade-duration: 0ms;
    --accordion-fade-delay: 0ms;
  }
}

details.acc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 10px;
}

details.acc summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  list-style: none;
}

details.acc summary::-webkit-details-marker {
  display: none;
}

details.acc summary .icon {
  color: var(--text-2);
}

details.acc summary .acc-chevron {
  margin-left: auto;
  transition: transform var(--accordion-duration) var(--accordion-easing);
  color: var(--text-2);
}

details.acc[open] summary .acc-chevron {
  transform: rotate(90deg);
}

details.acc .acc-body {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--border-light);
}

details.acc .acc-body > :first-child {
  margin-top: 12px;
}

/* ---------- result hero ---------- */
.result-hero {
  border-left: 6px solid var(--border);
}

.result-hero.success {
  border-left-color: var(--success);
}

.result-hero.warning {
  border-left-color: var(--warning-strong);
}

.result-hero.error {
  border-left-color: var(--error);
}

.result-hero.infra {
  border-left-color: var(--infra);
}

.result-hero.safety {
  border-left-color: var(--safety);
}

.result-hero.target {
  border-left-color: var(--target);
}

.result-hero.info {
  border-left-color: var(--blue);
}

.result-hero .hero-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.result-hero .hero-state {
  font-size: 18px;
  font-weight: 500;
}

.result-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 860px) {
  .result-cols {
    grid-template-columns: 1fr;
  }
}

/* ---------- verdict ---------- */
.verdict-supported {
  color: var(--success);
}

.verdict-unsupported {
  color: var(--error);
}

.verdict-insufficient {
  color: var(--warning);
}

.verdict-notEvaluated {
  color: var(--text-2);
}

/* ---------- run tabs ---------- */
.run-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.run-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.run-tab:hover {
  background: var(--bg);
}

.run-tab.active {
  background: var(--blue-bg);
  border-color: var(--blue);
  color: var(--blue-dark);
}

/* ---------- demo controls ---------- */
.demo-controls {
  border: 1px dashed #c58af9;
  background: #fbf7ff;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}

.demo-controls .dc-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--safety);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-controls .dc-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-controls button {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  color: var(--text);
}

.demo-controls button:hover {
  background: var(--bg);
}

/* ---------- progress ---------- */
.limitbar {
  margin-bottom: 10px;
}

.limitbar .lb-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 4px;
}

.limitbar .lb-track {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.limitbar .lb-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
}

/* ---------- report doc ---------- */
.report-doc {
  max-width: 760px;
}

.report-doc h3 {
  font-size: 15px;
  font-weight: 500;
  margin: 18px 0 6px;
}

.report-doc p {
  font-size: 13.5px;
}

.report-note {
  font-size: 12px;
  color: var(--text-2);
  border-top: 1px solid var(--border-light);
  margin-top: 20px;
  padding-top: 12px;
}

/* ---------- misc ---------- */
.muted {
  color: var(--text-2);
}

.small {
  font-size: 12px;
}

.mono {
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.empty-note {
  color: var(--text-2);
  font-size: 13px;
  padding: 18px;
  text-align: center;
}

.mt0 {
  margin-top: 0;
}

.link {
  color: var(--blue);
  text-decoration: none;
  cursor: pointer;
}

.link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .layout {
    display: block;
  }

  td .btn-report {
    padding: 8px;
  }

  td .btn-report .btn-label {
    display: none;
  }

  .sidenav {
    display: none;
  }

  .appbar .organization-context {
    display: none;
  }

  .mobile-nav {
    display: block;
    background: var(--card);
    border-bottom: 1px solid var(--border);
  }

  .mobile-nav summary {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 16px;
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
    list-style: none;
  }

  .mobile-nav-title {
    margin-right: auto;
  }

  .mobile-nav-current-organization {
    max-width: min(52vw, 280px);
    overflow: hidden;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav summary::-webkit-details-marker {
    display: none;
  }

  .mobile-nav summary::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: 12px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
  }

  .mobile-nav[open] summary::after {
    transform: rotate(225deg) translate(-2px, -2px);
  }

  .mobile-nav summary:focus-visible,
  .mobile-nav a:focus-visible,
  .mobile-nav button:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: -3px;
  }

  .mobile-nav nav {
    display: grid;
    gap: 2px;
    padding: 0 8px 10px;
  }

  .mobile-organization-context {
    display: grid;
    gap: 5px;
    margin: 0 4px 8px;
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--border-light);
  }

  .mobile-organization-context .organization-switcher {
    width: 100%;
    max-width: none;
  }

  .mobile-nav-account {
    display: grid;
    gap: 2px;
    margin: 8px 4px 0;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
  }

  .mobile-nav-account-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 10px;
  }

  .mobile-nav-account-text {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .mobile-nav-account-email {
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    overflow-wrap: anywhere;
  }

  .mobile-nav-account-role {
    color: var(--text-2);
    font-size: 12px;
  }

  .mobile-nav a,
  .mobile-nav button {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-2);
    text-decoration: none;
  }

  .mobile-nav button {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
    text-align: left;
  }

  .mobile-nav a:hover,
  .mobile-nav a.active,
  .mobile-nav button:hover {
    background: var(--blue-bg);
    color: var(--blue-dark);
  }

  .main {
    padding: 16px;
  }
}

/* ---------- site detail: large title & external link ---------- */
h1.page-title.lg {
  font-size: 32px;
}

.page-sub a.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  text-decoration: none;
}

.page-sub a.ext-link:hover {
  text-decoration: underline;
}

.page-sub a.ext-link .icon.sm {
  width: 14px;
  height: 14px;
}

/* ---------- collapsed advanced settings (site registration) ---------- */
details.adv-settings {
  border-top: 1px solid var(--border-light);
  padding-top: 4px;
}

details.adv-settings summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 10px 0;
  font-weight: 500;
  color: var(--blue);
  user-select: none;
}

details.adv-settings summary::-webkit-details-marker {
  display: none;
}

details.adv-settings summary .icon.caret {
  transform-box: view-box;
  transform-origin: center;
  transition: transform var(--accordion-duration) var(--accordion-easing);
  color: var(--blue);
}

details.adv-settings[open] summary .icon.caret {
  transform: rotate(180deg);
}

details.adv-settings .summary-sub {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-2);
  margin-left: 4px;
}

details.adv-settings .adv-body {
  display: grid;
  gap: 18px;
  padding: 4px 0 8px;
}

/* ---------- success-criteria summary (site detail test list) ---------- */
.crit-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.crit-row .crit-ic {
  display: inline-flex;
}

.crit-row .crit-ic .icon.sm {
  width: 16px;
  height: 16px;
}

.crit-row > .small {
  margin-left: 6px;
}

/* ---------- 左ナビの主要操作 ---------- */
.sidenav a.btn-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 4px 0 14px;
  padding: 9px 16px;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 4px;
  box-shadow: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.sidenav a.btn-new:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  box-shadow: var(--shadow);
  color: #fff;
}

.sidenav a.btn-new .icon {
  color: inherit;
}

/* ---------- サイト詳細: 操作テスト名を1ランク大きく ---------- */
td .test-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

/* Runテーブルの行タイトル(操作テスト名) */
td .row-name {
  font-weight: 700;
  color: var(--text);
}

.task-name-link {
  display: -webkit-box;
  width: 100%;
  appearance: none;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  color: var(--blue);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-name-link:hover {
  text-decoration: underline;
}

.task-name-link:focus-visible {
  outline: 3px solid #174ea6;
  outline-offset: 2px;
}

/* タイムスタンプ等の右端カラム */
th.col-right,
td.col-right {
  text-align: right;
}

.btn-report {
  white-space: nowrap;
}

/* 行頭の始め括弧を半角分ぶら下げる（DESIGN.md §5.1 光学補正。app.js markHangingPunctuation が付与） */
.hang {
  text-indent: -0.5em;
}

/* ---------- ケバブメニュー(副次操作) ---------- */
.kebab-wrap {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.kebab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.kebab-btn:hover {
  background: #f1f3f4;
  color: var(--text);
}

.kebab-btn:focus-visible,
.menu-item:focus-visible {
  outline: 3px solid #174ea6;
  outline-offset: 1px;
}

.menu {
  position: absolute;
  right: 0;
  top: 36px;
  z-index: 30;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.24), 0 4px 8px 3px rgba(60, 64, 67, 0.12);
  padding: 6px 0;
  text-align: left;
  transform-origin: top right;
}

.menu:not([hidden]):not([data-menu-restored]) {
  animation:
    popover-fade-in var(--popover-fade-duration) linear both,
    popover-scale-in var(--popover-scale-duration) var(--popover-scale-easing) both;
}

.sidenav .menu {
  transform-origin: top left;
}

.sidenav-account .menu {
  transform-origin: bottom left;
}

@keyframes popover-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popover-scale-in {
  from { scale: 0.9; }
  to { scale: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .menu:not([hidden]):not([data-menu-restored]) {
    animation: none;
  }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 16px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.menu-item:hover {
  background: #f1f3f4;
}

.menu-item[disabled] {
  color: #9aa0a6;
  cursor: default;
}

.menu-item[disabled]:hover {
  background: transparent;
}

.menu-item .icon {
  color: inherit;
}

.menu-item.danger {
  color: var(--error);
}

.menu-sep {
  height: 1px;
  background: var(--border-light);
  margin: 6px 0;
}

.table-wrap.menu-open {
  overflow: visible;
}

/* ---------- 行セルのオブジェクトアイコン(操作テスト) ---------- */
.cell-with-icon {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.cell-with-icon > .icon.obj {
  color: var(--blue);
  width: 22px;
  height: 22px;
  margin-top: 1px;
}

.cell-with-icon > .icon.obj.dim {
  color: var(--text-2);
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

/* ---------- テスト一覧の実行ボタン(コンパクト) ---------- */
.btn.btn-run {
  padding: 5px 14px;
  font-size: 13px;
  gap: 8px;
}

.btn.btn-run .icon {
  width: 16px;
  height: 16px;
}

/* ---------- サイドナビのグループ区切り(見出しの代わりにDrive風divider) ---------- */
.sidenav .nav-divider {
  height: 1px;
  background: var(--border-light);
  margin: 8px 0;
}

/* ---------- ページ見出しの編集導線(鉛筆+インライン入力) ---------- */
.page-header .title-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  opacity: 0.45;
  margin-left: -4px;
}

.page-header .title-edit[hidden] {
  display: none;
}

.page-header:hover .title-edit,
.page-header .title-edit:focus-visible {
  opacity: 1;
}

.page-header .title-edit:hover {
  background: #f1f3f4;
  color: var(--text);
}

.page-header .title-edit:focus-visible {
  outline: 3px solid #174ea6;
  outline-offset: 2px;
}

.page-header .title-edit .icon {
  width: 18px;
  height: 18px;
}

.title-editor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.title-editor .title-input {
  font-family: var(--font);
  font-size: inherit;
  font-weight: inherit;
  color: var(--text);
  border: none;
  border-bottom: 2px solid var(--blue);
  outline: none;
  background: transparent;
  min-width: 240px;
  max-width: 60%;
}

.title-editor-action {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-2);
  cursor: pointer;
  font: 600 12px/1 var(--font);
  padding: 7px 10px;
  white-space: nowrap;
}

.title-editor-action:hover {
  background: #f1f3f4;
  color: var(--text);
}

.title-editor-action:focus-visible {
  outline: 3px solid #174ea6;
  outline-offset: 2px;
}

.title-editor-save {
  border-color: var(--blue);
  color: var(--blue);
}

/* ---------- カード単位の編集モード ---------- */
.card.editable {
  position: relative;
}

.card .card-edit {
  position: absolute;
  top: 12px;
  right: 12px;
  opacity: 0.45;
}

.card.editable:hover .card-edit {
  opacity: 1;
}

/* ---------- 見出しの(?)ヘルプツールチップ ---------- */
.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
}

.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #9aa0a6;
  cursor: pointer;
}

.help-btn:hover {
  color: var(--text-2);
  background: #f1f3f4;
}

.help-pop {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  padding: 10px 14px;
  background: #3c4043;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.3);
  z-index: 40;
  text-align: left;
  white-space: normal;
}

.help-tip:hover .help-pop,
.help-tip.open .help-pop {
  display: block;
}

/* フォーム項目横の(?)ヘルプ。ラベル行に並べ、ホバー / フォーカスで説明、クリックで利用ガイドの該当項目を開く */
.field-label-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 6px;
}

.field-label-row label {
  margin-bottom: 0;
}

.field-help .help-btn {
  padding: 2px;
  color: #9aa0a6;
  text-decoration: none;
  line-height: 0;
}

.field-help .help-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

/* 吹き出しはラベル行(=入力欄の幅)を基準に置き、狭い画面でも画面外へはみ出さない */
.field-label-row,
.form-subsection-title {
  position: relative;
}

.field-help {
  position: static;
}

.field-help .help-pop {
  left: 0;
  top: calc(100% + 4px);
  transform: none;
  width: min(300px, 100%);
}

.field-help:focus-within .help-pop {
  display: block;
}

/* 画面見出し横の(?)ヘルプ。見出しの外に並べ、吹き出しは(?)自体を基準に置く */
.page-title-row,
.heading-with-help {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-title-row h1.page-title,
.heading-with-help h2 {
  margin: 0;
}

.page-help {
  position: relative;
}

.page-help .help-pop {
  width: 300px;
}

.form-subsection-title .field-help {
  margin-left: 0;
}

.capacity-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.capacity-summary > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: #fff;
}

.capacity-summary b {
  font-size: 22px;
}

.capacity-summary span,
.task-capacity-note {
  color: var(--text-2);
  font-size: 13px;
}

.task-capacity-note {
  margin: -4px 0 14px;
}

.task-row-notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
  font-size: 12px;
}

.task-row-notice.error {
  color: var(--error);
}

.task-row-notice.success {
  color: var(--success);
}

.task-row-notice .btn-small {
  min-height: 28px;
  padding: 3px 9px;
  font-size: 12px;
  box-shadow: none;
}

.task-live-summary {
  color: var(--blue);
  font-weight: 600;
}

.task-lifecycle-card {
  border-color: #c6dafc;
  background: #f6f9fe;
}

.task-lifecycle-card[data-task-lifecycle="complete"] {
  border-color: #a8dab5;
  background: var(--success-bg);
}

.task-lifecycle-card[data-task-lifecycle="stopped"],
.task-lifecycle-card[data-task-lifecycle="failed"],
.task-lifecycle-card[data-task-lifecycle="needs_review"] {
  border-color: #fde293;
  background: var(--warning-bg);
}

.task-lifecycle-card .card-title .icon {
  color: var(--blue-dark);
}

.task-lifecycle-card[data-task-lifecycle="complete"] .card-title .icon {
  color: var(--success);
}

.task-lifecycle-card[data-task-lifecycle="stopped"] .card-title .icon,
.task-lifecycle-card[data-task-lifecycle="failed"] .card-title .icon,
.task-lifecycle-card[data-task-lifecycle="needs_review"] .card-title .icon {
  color: var(--warning);
}

.task-lifecycle-meta {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.investigation-scope-card {
  border-left: 4px solid var(--blue);
}

.scope-boundary-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--blue-bg);
  color: var(--text-1);
}

.scope-boundary-note span,
.scope-section p {
  color: var(--text-2);
  line-height: 1.65;
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scope-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.scope-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.scope-section p {
  margin: 0 0 8px;
}

.scope-pages summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.scope-unassessed {
  border-color: var(--warning);
}

@media (max-width: 700px) {
  .scope-grid {
    grid-template-columns: 1fr;
  }
}

.saved-task-operator-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.saved-task-operator-summary > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg);
}

.saved-task-operator-summary span,
.saved-task-operator-summary small {
  display: block;
  color: var(--text-2);
  font-size: 11px;
}

.saved-task-operator-summary b {
  display: -webkit-box;
  margin: 3px 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.saved-task-actions {
  margin: 0 0 14px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.organization-switcher {
  max-width: 240px;
  padding: 6px 28px 6px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.compact-form {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 220px) auto;
  align-items: end;
}

/* 組織操作はviewportではなく利用できるカード幅に応じて折り返す。 */
#form-organization-invitation,
#form-organization-ownership-request {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 192px), 1fr));
}

#form-close-organization,
#form-cancel-organization-closure {
  grid-template-columns: minmax(0, 1fr);
}

/* 値をコピーする行（招待リンク、接続用URL、デプロイHook）は同じ骨格を共有し、用途ごとの差は余白だけにする */
.invitation-copy-row,
.deploy-hook-copy-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.invitation-copy-row {
  margin: 10px 0 4px;
}

.invitation-copy-row input {
  min-width: 0;
  flex: 1;
}

.ai-connection-copy-row input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-head-row h2 {
  margin: 0;
}

/* ---------- 外部AIとの接続（#603）: カード内の見出し・説明・入力欄・表の間隔を一つの規則にそろえる ---------- */
.ai-connections-page .card > h2,
.ai-connections-page .heading-with-help h2 {
  margin: 0;
}

.ai-connections-page .card-lead {
  margin: 8px 0 16px;
  color: var(--text-2);
  font-size: 13px;
  max-width: 760px;
}

.ai-connections-page .field {
  max-width: 720px;
}

.ai-connections-page .ai-connection-copy-row {
  margin: 0 0 4px;
}

.ai-connections-page .btn-row {
  margin-top: 16px;
}

.ai-connections-page .table-wrap {
  margin: 0 0 12px;
}

.ai-connections-page .hint {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
}

.ai-connections-page .empty-note {
  padding: 12px 0 0;
  text-align: left;
}

.ai-connection-permissions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ai-connections-page td.col-right .btn {
  white-space: nowrap;
}

.auth-signed-in-as strong {
  overflow-wrap: anywhere;
}

/* ---------- 外部AIからの接続要求の許可画面（#609） ---------- */
.ai-connection-state {
  font-size: 13px;
  white-space: normal;
  min-width: 9em;
}
.ai-connection-state.warn {
  color: var(--warning);
  font-weight: 600;
}
.ai-consent-card h2 {
  margin: 18px 0 8px;
  font-size: 16px;
}

.ai-consent-card h2:first-child {
  margin-top: 0;
}

.ai-consent-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0 0 12px;
}

.ai-consent-facts dt {
  color: var(--text-2);
  font-size: 13px;
}

.ai-consent-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.ai-consent-facts dd .muted {
  margin-left: 6px;
  font-size: 13px;
}

.ai-consent-organization {
  margin: 0 0 8px;
}

.ai-consent-scopes {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-consent-scope {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

.ai-consent-scope input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
}

.ai-consent-scope label {
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.ai-consent-scope label .hint {
  margin: 0;
}

.ai-consent-scope.is-disabled {
  color: var(--text-2);
  background: var(--bg);
}

.ai-consent-scope input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .ai-consent-facts {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }

  .ai-consent-facts dt {
    margin-top: 6px;
  }

  .ai-consent-card .btn-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.ai-connection-status {
  display: block;
  min-height: 1.6em; /* 本文と同じ行送り分を空でも確保し、「コピーしました」で下の要素がずれないようにする */
  margin-top: 4px;
}

.organization-membership-exit {
  max-width: none;
}

.organization-membership-exit > p {
  margin: 8px 0 16px;
  color: var(--text-2);
}

.no-organization-main {
  min-height: calc(100vh - 64px);
  padding: 48px 24px;
}

.no-organization-page {
  display: grid;
  min-height: 60vh;
  place-items: center;
}

.no-organization-card {
  width: min(100%, 560px);
  text-align: center;
}

.no-organization-card > .icon {
  width: 40px;
  height: 40px;
  color: var(--text-2);
}

.no-organization-card h1 {
  margin: 12px 0 8px;
}

.no-organization-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 12px;
}

@media (max-width: 760px) {
  .compact-form {
    grid-template-columns: 1fr;
  }

  .invitation-copy-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .capacity-summary {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }

  .saved-task-operator-summary {
    grid-template-columns: 1fr;
  }
}

/* Result-to-retest choices share existing Task editing and execution flows. */
.next-test-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 20px;
  margin: 16px 0;
}
.next-test-options > div { min-width: 0; overflow-wrap: anywhere; }
.next-test-options h3 { margin-top: 0; font-size: 1rem; }
.next-test-options p { line-height: 1.7; }
.next-test-options .btn { max-width: 100%; white-space: normal; }

.rerun-condition-change { margin: 16px 0; min-width: 0; }
.rerun-condition-change h3 { font-size: 1rem; }
.rerun-condition-change dd { margin: 4px 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.direct-rerun-confirmation .btn { max-width: 100%; white-space: normal; }

/* Saved meeting / delivery briefs reuse immutable customer-facing Run projections. */
.section-actions {
  margin: 0;
}

/* A Site's latest result, exact comparison decision, and next check stay together. */
.continuity-list {
  display: grid;
  gap: 14px;
}

.continuity-panel {
  margin: 0;
}

/* カード内の「…」メニューはカード枠の外へ広がるため、カードで切り抜かない（DESIGN.md §13.6） */
.continuity-task {
  margin: 0;
  padding: 0;
}

.continuity-task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 14px;
}

.continuity-task-head > div {
  min-width: 0;
}

.continuity-task-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--blue);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.continuity-task-title:hover {
  color: var(--blue-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.continuity-task-title:focus-visible {
  border-radius: 2px;
  outline: 3px solid #174ea6;
  outline-offset: 2px;
}

.continuity-task-head p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--text-2);
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.continuity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.continuity-grid > section {
  min-width: 0;
  padding: 18px 22px;
}

.continuity-grid > section + section {
  border-left: 1px solid var(--border-light);
}

.continuity-grid h4 {
  margin: 0 0 9px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.continuity-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.continuity-value > strong {
  display: inline-block;
  margin: 0 6px 3px 0;
  font-size: 14px;
}

.continuity-decision-reason {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

.continuity-actions {
  justify-content: flex-end;
  margin: 0;
  padding: 0 18px 18px;
}

@media (max-width: 800px) {
  .continuity-task-head {
    gap: 12px;
    padding: 18px;
  }

  .continuity-grid {
    grid-template-columns: 1fr;
  }

  .continuity-grid > section {
    padding: 15px 18px;
  }

  .continuity-grid > section + section {
    border-top: 1px solid var(--border-light);
    border-left: 0;
  }

  .continuity-actions {
    justify-content: flex-start;
    padding: 0 14px 16px;
  }
}

.meeting-brief-list {
  margin-top: 20px;
}

.meeting-task-choices,
.meeting-observations {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  border: 0;
}

.meeting-task-choices legend,
.meeting-observations legend {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.meeting-task-choice,
.meeting-observation-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
}

.meeting-task-choice:hover,
.meeting-observation-choice:hover {
  border-color: var(--blue);
  background: var(--blue-bg);
}

.meeting-task-choice input,
.meeting-observation-choice input {
  flex: none;
  margin-top: 3px;
}

.meeting-task-choice span,
.meeting-observation-choice span {
  min-width: 0;
}

.meeting-task-choice strong,
.meeting-task-choice small,
.meeting-observation-choice strong,
.meeting-observation-choice small {
  display: block;
  overflow-wrap: anywhere;
}

.meeting-task-choice small,
.meeting-observation-choice small {
  margin-top: 3px;
  color: var(--text-2);
  line-height: 1.5;
}

.meeting-observation-choice .finding-severity {
  display: inline-flex;
  margin-bottom: 6px;
}

.meeting-brief-item-list {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.meeting-brief-item-list > li {
  padding: 14px;
  border-radius: 8px;
  background: var(--bg);
}

.meeting-brief-item-list .chip {
  margin-left: 8px;
}

.meeting-brief-item-list p {
  margin: 8px 0;
}

.meeting-brief-page {
  max-width: 920px;
}

.meeting-brief-kicker,
.meeting-run-meta {
  color: var(--text-2);
  font-size: 12px;
}

.meeting-brief-summary {
  background: var(--blue-bg);
}

.meeting-brief-task {
  margin: 18px 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}

.meeting-brief-task h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.meeting-task-summary {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--bg);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
}

.meeting-comparison {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

.meeting-comparison-insight {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #e6f4ea;
}

.meeting-comparison-insight p {
  margin: 6px 0 0;
}

.meeting-source-link {
  display: inline-block;
  margin-top: 10px;
}

.meeting-additional-reviews {
  margin-top: 18px;
}

.meeting-additional-review + .meeting-additional-review {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.meeting-additional-review > ol {
  display: grid;
  gap: 14px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.meeting-additional-finding {
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

.meeting-additional-source {
  font-size: 12px;
}

.meeting-additional-finding blockquote {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--border);
  background: var(--bg);
  font-weight: 500;
}

.meeting-additional-detail {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.meeting-additional-detail div {
  display: grid;
  grid-template-columns: minmax(118px, 0.28fr) 1fr;
  gap: 12px;
}

.meeting-additional-detail dt {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.meeting-additional-detail dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .section-heading-row {
    align-items: stretch;
    flex-direction: column;
  }

  .section-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .section-actions .btn {
    justify-content: center;
    width: 100%;
  }

  .meeting-brief-task {
    padding: 18px;
  }

  .meeting-additional-detail div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

/* Shared public-page consent control. Hidden unless analytics.js is explicitly enabled. */
.analytics-consent {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
}

.direct-rerun-accepted-toast {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 300;
  width: min(360px, calc(100vw - 40px));
  margin: 0;
  box-shadow: var(--shadow);
}

@media (max-width: 600px) {
  .direct-rerun-accepted-toast {
    top: 64px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media print {
  .direct-rerun-accepted-toast {
    display: none !important;
  }
}

.analytics-consent p {
  flex: 1 1 320px;
  margin: 0;
  line-height: 1.6;
}

.analytics-consent a {
  color: var(--blue);
}

.analytics-consent-actions {
  display: flex;
  gap: 8px;
}

/* ---------- サポートチャット（support-chat.js。公開ページ / と /guide） ---------- */
/* 起動ボタンは layer-sticky(100)、表示枠は layer-navigation(200)（DESIGN.md §13.3）。同意バー(.analytics-consent, 40)より前面。
   表示枠は viewport に固定した overlay 自身なので、iframe の角を自分で切り抜く overflow: hidden は §13.6 の禁止対象ではない。 */
.support-chat-launcher {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px 10px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
  cursor: pointer;
}

.support-chat-launcher .icon {
  width: 20px;
  height: 20px;
}

.support-chat-launcher:hover {
  background: var(--blue-dark);
}

.support-chat-launcher:focus-visible {
  outline: 3px solid #174ea6;
  outline-offset: 2px;
}

.support-chat-panel {
  position: fixed;
  right: 16px;
  bottom: 76px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 96px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

.support-chat-panel[hidden] {
  display: none;
}

.support-chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 10px 16px;
  border-bottom: 1px solid var(--border-light);
}

.support-chat-title {
  flex: 1;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.support-chat-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.support-chat-close .icon {
  width: 20px;
  height: 20px;
}

.support-chat-close:hover {
  background: #f1f3f4;
  color: var(--text);
}

.support-chat-close:focus-visible {
  outline: 3px solid #174ea6;
  outline-offset: 1px;
}

.support-chat-note {
  margin: 0;
  padding: 8px 16px;
  background: var(--bg);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}

.support-chat-body {
  flex: 1 1 auto;
  min-height: 0;
}

.support-chat-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 本文中の起動リンク（miibo埋め込み仕様の class="chatButton"）。JS無効時は hidden のまま */
button.chatButton {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

button.chatButton:hover {
  color: var(--blue-dark);
}

button.chatButton:focus-visible {
  border-radius: 2px;
  outline: 3px solid #174ea6;
  outline-offset: 2px;
}

/* ---------- task creation assistant ---------- */
.task-assist-mount {
  display: flex;
  justify-content: flex-end;
  min-height: 0;
  margin: 0 0 12px;
}

.task-assist-launch {
  gap: 8px;
  background: var(--card);
}

.task-assist-launch > span {
  color: var(--safety);
  font-size: 18px;
  line-height: 1;
}

.task-assist-panel {
  position: fixed;
  z-index: 45;
  top: 112px;
  right: 20px;
  display: flex;
  flex-direction: column;
  width: min(430px, calc(100vw - 40px));
  height: min(720px, calc(100vh - 132px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 12px 38px rgba(60, 64, 67, 0.2);
}

.task-assist-panel[hidden] {
  display: none;
}

.task-assist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 12px 20px;
  border-bottom: 1px solid var(--border-light);
}

.task-assist-header h2 {
  margin: 1px 0 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
}

.task-assist-eyebrow {
  margin: 0;
  color: var(--safety);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.task-assist-close {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  font: 24px/1 var(--font);
  cursor: pointer;
}

.task-assist-close:hover {
  background: var(--bg);
  color: var(--text);
}

.task-assist-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 4px;
}

.task-assist-usage,
.task-assist-status {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.55;
}


.task-assist-context {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
}

.task-assist-site-url {
  overflow-wrap: anywhere;
  color: var(--text-2);
  font-size: 11px;
}




.task-assist-usage {
  margin: 8px 0 12px;
}

.task-assist-messages {
  display: grid;
  gap: 10px;
}

.task-assist-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f3f0fb;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-assist-bubble.user {
  justify-self: end;
  background: var(--blue-bg);
}

.task-assist-bubble.streaming:empty {
  display: none;
}

.task-assist-bubble.streaming {
  border-left: 3px solid #9d85d7;
}

.task-assist-proposal {
  margin-top: 16px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--border-light);
}

.task-assist-proposal h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.task-assist-change {
  margin: 12px 0;
  padding-left: 12px;
  border-left: 3px solid #b9a7e4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-assist-change strong,
.task-assist-change small {
  display: block;
}

.task-assist-change small {
  margin: 2px 0 5px;
  color: var(--text-2);
}

.task-assist-change p {
  margin: 0;
}

.task-assist-composer {
  flex: none;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--card);
}

.task-assist-composer label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 500;
}

.task-assist-composer textarea {
  display: block;
  width: 100%;
  min-height: 76px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font: inherit;
}

.task-assist-composer textarea:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(26, 115, 232, 0.18);
}

.task-assist-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.task-assist-actions .btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.task-assist-status {
  margin: 7px 0 0;
}

.task-assist-status {
  color: #5e3f91;
}

.task-assist-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #5e3f91;
  font-size: 12px;
}

.task-assist-progress[hidden] {
  display: none;
}

.task-assist-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ddd4ee;
  border-top-color: #6c4eb0;
  border-radius: 50%;
  animation: task-assist-spin 0.8s linear infinite;
}

@keyframes task-assist-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .task-assist-panel {
    inset: 0;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .task-assist-spinner {
    animation: none;
    border-top-color: #6c4eb0;
  }
}

.chatButton[hidden] {
  display: none;
}

@media (max-width: 600px) {
  .support-chat-panel {
    inset: 0;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
  }

  body.support-chat-open .support-chat-launcher {
    display: none;
  }
}

@media print {
  .support-chat-launcher,
  .support-chat-panel,
  .task-assist-mount {
    display: none;
  }

  @page {
    margin: 14mm;
  }

  body {
    background: #fff;
    color: #202124;
  }

  .demo-banner,
  .appbar,
  .sidenav,
  .mobile-nav,
  .skip-link,
  .analytics-consent,
  .breadcrumb,
  .no-print {
    display: none !important;
  }

  .layout {
    display: block;
    min-height: 0;
  }

  .main,
  .meeting-brief-page,
  .direct-result-page {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .meeting-brief-page .card,
  .meeting-brief-task,
  .meeting-brief-page .finding-item {
    break-inside: avoid;
    box-shadow: none;
  }

  .meeting-source-link {
    color: #202124;
    text-decoration: none;
  }

  .meeting-source-link::after {
    content: " (" attr(href) ")";
    font-size: 10px;
    overflow-wrap: anywhere;
  }

  .direct-result-page {
    font-size: 11pt;
    line-height: 1.55;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .direct-result-page .page-header { margin-bottom: 7mm; }
  .direct-result-page .page-title { font-size: 20pt; }

  .direct-result-page .title-edit,
  .direct-result-page .customer-feedback-card,
  .direct-result-page .operator-review-card,
  .direct-result-page .execution-record-card,
  .direct-result-page .evidence-card,
  .direct-result-page .direct-run-comparison-card,
  .direct-result-page .btn-row,
  .direct-result-page .finding-evidence-link { display: none !important; }

  .direct-result-page .print-result-metadata {
    display: flex !important;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 8px;
    color: #3c4043;
    font-size: 10pt;
  }

  .direct-result-page > .card,
  .direct-result-page .direct-agent-report,
  .direct-result-page .original-agent-report {
    margin: 0 0 7mm;
    padding: 0;
    border: 0;
    box-shadow: none;
    break-inside: auto;
  }

  .direct-result-page :is(h2, h3, h4, h5) { break-after: avoid-page; }

  .direct-result-page .finding-item,
  .direct-result-page .automated-check-item,
  .direct-result-page .scope-section,
  .direct-result-page .direct-report-list { break-inside: avoid; }

  .direct-result-page details:not([open]) > :not(summary) { display: block !important; }

  .direct-result-page .result-request-details > summary,
  .direct-result-page .original-agent-report > summary,
  .direct-result-page .automated-check-nodes > summary {
    margin: 12px 0 6px;
    font-weight: 600;
  }

  .direct-result-page .automated-check-selector { display: none; }

  .direct-result-page .report-reference {
    padding: 0;
    color: #202124;
    text-decoration: none;
  }

  .direct-result-page .report-reference::after {
    content: "（この資料内の根拠を参照）";
    margin-left: 2px;
    font-size: 9pt;
  }

  .direct-result-page a[href] {
    color: #202124;
    text-decoration: none;
  }

  .direct-result-page a[href]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    overflow-wrap: anywhere;
  }
}

.print-result-metadata { display: none; }

/* Evidence navigation stays within the current report and survives sticky headers. */
.report-reference {
  display: inline;
  padding: 2px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--blue-dark);
  font: inherit;
  font-size: 14px;
  line-height: inherit;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.report-reference:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.report-reference-unavailable { color: var(--text-2); font-size: 14px; }
[id^="report-check-"], [id^="report-finding-"], #report-site-assessment {
  scroll-margin-top: 112px;
}
[id^="report-check-"]:focus:not(:focus-visible), [id^="report-finding-"]:focus:not(:focus-visible), #report-site-assessment:focus:not(:focus-visible) {
  outline: none;
}
[id^="report-check-"]:focus-visible, [id^="report-finding-"]:focus-visible, #report-site-assessment:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

/* 根拠リンクの移動先だけを短く示し、元の背景へ戻す。 */
.report-reference-arrival { animation: report-reference-arrival 2.5s ease-out; }
@keyframes report-reference-arrival {
  0%, 20% { background-color: #fff6cf; }
}
@media (prefers-reduced-motion: reduce) {
  .report-reference-arrival { animation-timing-function: step-end; animation-duration: 1s; }
}

.result-export-actions { display: flex; flex: none; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 8px; max-width: 100%; }
.result-export-actions > .btn { flex: none; }
.repair-pack-action { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.repair-pack-action .btn { white-space: normal; flex-wrap: wrap; }
.repair-pack-beta { font-size: 11px; border: 1px solid currentColor; border-radius: 4px; padding: 1px 4px; }
@media (max-width: 400px) { .repair-pack-action { width: 100%; } }

@media (max-width: 700px) { .result-export-actions { justify-content: flex-start; margin-top: 16px; } }

.evidence-lightbox-control.btn { width: 44px; min-width: 44px; height: 44px; padding: 10px; flex: 0 0 44px; border: 0; gap: 0; }
.evidence-lightbox-control.btn .icon { margin: 0; width: 24px; height: 24px; }
.evidence-lightbox-control.btn:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.evidence-lightbox-control.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.evidence-lightbox-previous .icon { transform: rotate(180deg); }

/* Report diagrams share the report's 8px spacing grid. */
.direct-report-diagrams { border-top: 1px solid var(--border, #d6dfdb); margin-top: 32px; padding-top: 32px; }
.direct-report-diagrams > h3 { font-size: 22px; line-height: 32px; margin: 0 0 24px; }
.direct-report-diagram { margin: 0 0 32px; }
.direct-report-diagram h4 { font-size: 18px; line-height: 28px; margin: 0 0 16px; }
.direct-report-diagram img { display: block; width: 100%; max-width: 440px; height: auto; margin: 0 auto; }
.direct-report-diagram figcaption { font-size: 14px; line-height: 24px; margin-top: 16px; }
@media print { .direct-report-diagram { break-inside: avoid; } .direct-report-diagram img { max-width: 360px; } }

/* Only the versioned editorial rules reserve strong for observed problems. */
.direct-report-problem-emphasis > :is(p, ul) strong {
  background-color: #fce3e3;
  color: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 2px 1px;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
