:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #1f2328;
  --muted: #656d76;
  --line: #d8dee4;
  --accent: #1f6feb;
  --danger: #cf222e;
  --up: #cf222e;
  --down: #1a7f37;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 52px;
  background: #24292f; color: #fff;
}
.topbar .brand { color: #fff; font-weight: 700; font-size: 16px; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { color: #d0d7de; padding: 6px 12px; border-radius: 6px; }
.topbar nav a:hover { background: #32383f; text-decoration: none; }
.topbar nav a.active { background: #444c56; color: #fff; }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 24px 0 8px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }

button, .btn {
  display: inline-block; font: inherit; cursor: pointer;
  padding: 6px 14px; border-radius: 6px;
  border: 1px solid var(--line); background: #f6f8fa; color: var(--text);
}
button:hover, .btn:hover { background: #eef1f4; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1a5fd0; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 2px 10px; font-size: 13px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f6f8fa; font-weight: 600; font-size: 13px; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap td:nth-child(-n+2) { white-space: nowrap; }
.table-wrap { border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.table-wrap table tr:last-child td { border-bottom: none; }
tr.inactive td { color: var(--muted); }

.alert { color: var(--danger); font-weight: 700; }
.zero { color: #afb8c1; font-weight: 400; }
.diff-up { color: var(--up); font-size: 12px; }
.diff-down { color: var(--down); font-size: 12px; }
.diff-same { color: var(--muted); font-size: 12px; }
.tag { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 10px; background: #eaeef2; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.card .label { font-size: 12px; color: var(--muted); }
.card .value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }

form.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
form.grid .wide { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.field .req { color: var(--danger); margin-left: 4px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9ec5fe; border-color: var(--accent); }
h3 { font-size: 15px; margin: 8px 0 4px; }
.nowrap { flex-wrap: nowrap; }
.center { text-align: center; }
.table-wrap td.text-cell { white-space: pre-wrap; max-width: 260px; font-size: 13px; }
.tool-section { margin-bottom: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.prev { font-size: 12px; color: var(--muted); margin-top: 2px; }
.paste-box:empty { display: none; }
.paste-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
textarea.raw { min-height: 120px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; margin-bottom: 6px; }
fieldset.metric-group { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 14px; margin: 0 0 12px; }
fieldset.metric-group legend { font-weight: 700; padding: 0 6px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; }
.metric-grid .wide { grid-column: 1 / -1; }
input.num-input { text-align: right; }
.metric-table td { padding: 4px 6px; }
.metric-table input.short { width: 70px; }
.check { display: flex; align-items: center; gap: 6px; }
.check input { width: auto; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }

.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.filters .field { min-width: 160px; }

#toast {
  position: fixed; right: 20px; bottom: 20px; padding: 10px 16px;
  border-radius: 6px; background: #24292f; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
#toast.error { background: var(--danger); }

@media (max-width: 720px) {
  main { padding: 16px; }
  .topbar { gap: 12px; padding: 0 16px; }
  .topbar .brand { display: none; }
  form.grid { grid-template-columns: 1fr; }
}

/* グラフ */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; font-size: 13px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.line-key { display: inline-block; width: 16px; height: 3px; border-radius: 2px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 8px; }
.chart-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 4px; }
.chart-group { font-size: 12px; font-weight: 400; color: var(--muted); }
.tag-alert { background: #ffebe9; color: var(--danger); }
.chart-wrap { position: relative; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart .grid { stroke: #eaeef2; stroke-width: 1; }
svg.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .end-dot { stroke: var(--panel); stroke-width: 2; }
svg.chart .crosshair { stroke: #afb8c1; stroke-width: 1; }
.chart-tip {
  position: absolute; top: 8px; min-width: 150px; pointer-events: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12); padding: 6px 10px; font-size: 12px;
}
.tip-date { font-weight: 700; margin-bottom: 2px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row .swatch { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tip-name { flex: 1; color: var(--muted); }
.tip-val { font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .chart-grid { grid-template-columns: 1fr; }
}
svg.chart .hover-band { fill: #eaeef2; opacity: .6; }
.tip-total { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 3px; }

/* ダッシュボード（項目×拠点の表） */
table.matrix th.row-head { background: none; font-weight: 400; font-size: 14px; white-space: nowrap; }
table.matrix thead th { white-space: nowrap; }
table.matrix .sub-head th { font-weight: 400; color: var(--muted); }
table.matrix .group-row th { background: #f6f8fa; color: var(--muted); font-size: 12px; padding: 4px 10px; }
table.matrix tfoot td { border-bottom: none; }
table.matrix td.text-cell { text-align: right; }
table.matrix tbody tr:last-child td { border-bottom: 1px solid var(--line); }

/* アラート */
.badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.alert-panel { background: var(--panel); border: 1px solid #ffcecb; border-radius: 8px; padding: 12px 16px; margin-bottom: 24px; }
.alert-panel h2 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.alert-list { list-style: none; margin: 0 0 8px; padding: 0; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.alert-item:first-child { border-top: none; }
.alert-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.level-error .alert-icon { background: var(--danger); }
.level-warn .alert-icon { background: #9a6700; }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-size: 14px; }
.alert-msg { font-size: 13px; color: var(--muted); }
.schedule-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; }
@media (max-width: 720px) {
  .schedule-row { grid-template-columns: 1fr; }
  .alert-item { flex-wrap: wrap; }
}

/* メール影響範囲 */
h2.first { margin-top: 0; }
.filters .grow { flex: 1; min-width: 260px; }
.kind-group { background: #ffebe9; color: var(--danger); }
.kind-shared { background: #fff8c5; color: #7d4e00; }
.kind-personal { background: #ddf4ff; color: #0550ae; }
.impact { margin-top: 12px; }
.mail-diagram { margin: 8px 0 12px; }
.dg-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #fbfbfa; }
.dg-scroll svg { display: block; }
.dg-legend { margin-bottom: 6px; align-items: center; }
.dg-key { display: inline-block; width: 14px; height: 10px; border: 2px solid; border-radius: 3px; background: #fff; }
svg .dg-col { font-size: 11px; font-weight: 700; fill: var(--muted); }
svg .dg-link { fill: none; stroke: #afb8c1; stroke-width: 1.5; }
svg .dg-box { fill: #fff; stroke-width: 1.5; }
svg .dg-box.dg-dup { stroke-dasharray: 4 3; fill: #f6f8fa; }
svg .dg-addr { font-size: 12.5px; font-weight: 700; fill: var(--text); }
svg .dg-sub { font-size: 11px; fill: var(--muted); }
svg .dg-sub.dg-warn { fill: var(--danger); font-weight: 700; }
svg .dg-badge { font-size: 11px; font-weight: 700; fill: #fff; }
svg a.dg-node:hover .dg-box { fill: #f0f6ff; }
.report-diagram h3 { font-size: 14px; margin: 14px 0 4px; }
@media print { .dg-scroll { overflow: visible; border: none; } .dg-scroll svg { max-width: 100%; height: auto; } }
.impact > .table-wrap { margin-top: 12px; }
td.chips { display: table-cell; }
.chip { display: inline-flex; align-items: center; gap: 6px; margin: 2px 6px 2px 0; padding: 1px 8px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; color: var(--text); background: #fff; }
a.chip:hover { text-decoration: none; background: #f6f8fa; }
.chip-label { font-size: 11px; color: var(--muted); }
.chip-alert { border-color: #ffcecb; background: #fff5f5; }
.chip-alert .chip-label { color: var(--danger); font-weight: 700; }
.chip-warn { border-color: #f5e0a0; background: #fffbea; }
.chip-warn .chip-label { color: #7d4e00; }

/* 傾向と気づき */
.insights { margin-bottom: 28px; }
.insights .summary { margin: 4px 0 12px; font-size: 15px; }
.finding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.finding { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.finding.sev-high { border-left-color: #d03b3b; }
.finding.sev-medium { border-left-color: #fab219; }
.finding-head { display: flex; align-items: flex-start; gap: 8px; }
.finding-head h3 { margin: 0; font-size: 15px; }
.sev-tag { flex: none; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; }
.sev-tag.sev-high { background: #ffebe9; color: #b42318; }
.sev-tag.sev-medium { background: #fff8c5; color: #7d4e00; }
.sev-tag.sev-low { background: #eaeef2; color: var(--muted); }
.finding-text { margin: 8px 0 4px; font-size: 13.5px; }
.finding-action { margin: 0 0 8px; font-size: 13.5px; background: #f6f8fa; border-radius: 6px; padding: 6px 10px; }
.finding-chart { margin-top: 6px; }
.chart-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; font-weight: 700; color: var(--muted); }
.chart-caption .legend-item { font-weight: 400; }
.panel.calm { color: #1a7f37; background: #f0fff4; border-color: #b4e5c2; }
details.minor, details.numbers { margin-top: 12px; }
details > summary { cursor: pointer; color: var(--accent); margin-bottom: 10px; }
details.numbers { margin-top: 8px; }

/* 報告書 */
.report { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 28px 32px; }
.report-head h1 { font-size: 22px; margin-bottom: 8px; }
.report-head dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; margin: 0 0 8px; font-size: 14px; }
.report-head dt { color: var(--muted); }
.report-head dd { margin: 0; }
.report section { margin-top: 24px; }
.report h2 { font-size: 17px; border-bottom: 2px solid var(--text); padding-bottom: 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.report .finding { margin-bottom: 14px; break-inside: avoid; }
.report .finding-chart { max-width: 620px; }
.comment { margin-top: 8px; }
.comment-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.editable.inline textarea { min-height: 0; height: 34px; max-width: 280px; resize: none; }
.summary-edit textarea { font-size: 14px; }
.print-text { white-space: pre-wrap; }
.print-only { display: none; }
.report-list { padding-left: 20px; margin: 0; }
.report-list li { margin: 4px 0; }
.report-mail { margin-right: 10px; }
.save-status { font-size: 12px; align-self: center; }
@media (max-width: 720px) {
  .finding-grid { grid-template-columns: 1fr; }
  .report { padding: 16px; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .topbar, .no-print, #toast { display: none !important; }
  .print-only { display: block; }
  main { max-width: none; padding: 0; }
  .report { border: none; padding: 0; }
  .finding, .table-wrap { break-inside: avoid; }
  .editable.inline .print-text { display: inline; }
  a { color: inherit; }
}
.print-text:empty::after { content: "（未記入）"; color: var(--muted); }
.panel.explain { margin-bottom: 16px; font-size: 14px; }
.panel.explain ul { margin: 6px 0; padding-left: 20px; }

/* 報告書（一般向け） */
.report-intro { background: #f6f8fa; border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin-top: 8px; }
.status-banner { display: flex; align-items: center; gap: 12px; border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; font-size: 15px; border: 1px solid; }
.status-label { font-size: 20px; font-weight: 700; padding: 2px 14px; border-radius: 6px; color: #fff; }
.status-banner.level-normal { background: #f0fff4; border-color: #b4e5c2; }
.status-banner.level-normal .status-label { background: #1a7f37; }
.status-banner.level-caution { background: #fffbea; border-color: #f5e0a0; }
.status-banner.level-caution .status-label { background: #9a6700; }
.status-banner.level-alert { background: #fff5f5; border-color: #ffcecb; }
.status-banner.level-alert .status-label { background: #b42318; }
.finding.plain dl.plain-rows { display: grid; grid-template-columns: 9em 1fr; gap: 6px 12px; margin: 10px 0; font-size: 14px; }
.finding.plain dt { font-weight: 700; color: var(--muted); }
.finding.plain dt.ask { color: #b42318; }
.finding.plain dd { margin: 0; }
.chart-note { font-size: 12px; color: var(--muted); margin-top: 4px; }
.minor-list h3 { font-size: 14px; margin: 12px 0 4px; }
.minor-list ul { margin: 0; padding-left: 20px; font-size: 13.5px; }
.ask-box { margin-top: 12px; background: #fff5f5; border: 1px solid #ffcecb; border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.level-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 10px; border-radius: 10px; }
.level-tag.level-normal { background: #dafbe1; color: #1a7f37; }
.level-tag.level-caution { background: #fff8c5; color: #7d4e00; }
.level-tag.level-alert { background: #ffebe9; color: #b42318; }
table.site-status td { vertical-align: top; }
dl.glossary { display: grid; grid-template-columns: 14em 1fr; gap: 8px 16px; font-size: 13.5px; }
dl.glossary dt { font-weight: 700; }
dl.glossary dd { margin: 0; }
@media (max-width: 720px) {
  .finding.plain dl.plain-rows, dl.glossary { grid-template-columns: 1fr; }
}
@media print {
  .appendix { break-before: page; }
}

/* 報告書（文書レイアウト：表紙・図表番号・ページ番号） */
.report { counter-reset: fig tbl; }
.cover { border: 1px solid var(--line); border-radius: 8px; padding: 28px 32px; margin-bottom: 24px; background: #fff; }
.cover-mark { display: inline-block; align-self: flex-start; border: 2px solid #b42318; color: #b42318; font-weight: 700; padding: 2px 12px; border-radius: 4px; font-size: 13px; }
.cover-title { margin: 36px 0 28px; border-left: 8px solid #1f3a5f; padding: 6px 0 6px 18px; }
.cover-title h1 { font-size: 28px; margin: 6px 0; color: #1f3a5f; }
.cover-period { font-size: 18px; font-weight: 700; }
dl.cover-meta { display: grid; grid-template-columns: 7em 1fr; gap: 8px 16px; margin: 0 0 20px; font-size: 14px; }
dl.cover-meta dt { color: var(--muted); }
dl.cover-meta dd { margin: 0; }
dl.cover-meta .editable.inline textarea { max-width: 360px; }
.toc { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.toc-title { font-weight: 700; margin-bottom: 4px; }
.toc ol { list-style: none; margin: 0; padding: 0; columns: 2; font-size: 13.5px; }
.toc li { padding: 2px 0; }
.report h2 { color: #1f3a5f; border-bottom-color: #1f3a5f; }
figure { margin: 10px 0 14px; break-inside: avoid; }
figure.fig figcaption { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
figure.fig figcaption::before { counter-increment: fig; content: "図" counter(fig) "　"; font-weight: 700; color: var(--text); }
figure.tbl figcaption { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
figure.tbl figcaption::before { counter-increment: tbl; content: "表" counter(tbl) "　"; }
.trend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.trend-grid figure { margin: 4px 0 10px; }
.report-end { text-align: right; margin-top: 28px; font-size: 14px; }
.print-mode .topbar, .print-mode .no-print, .print-mode #toast { display: none !important; }
.print-mode main { max-width: none; padding: 0; }
.print-mode .report { border: none; padding: 0; }
.print-mode .print-only { display: block; }
.print-mode .editable.inline .print-text { display: inline; }
@media (max-width: 720px) {
  .trend-grid { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
}
@media print {
  @page {
    size: A4;
    margin: 20mm 16mm 18mm;
    @bottom-left { content: "社外秘"; font-size: 8pt; color: #b42318; }
    @bottom-center { content: counter(page) " / " counter(pages); font-size: 9pt; color: #444; }
  }
  @page :first {
    @top-right { content: none; }
    @bottom-left { content: none; }
    @bottom-center { content: none; }
  }
  body { font-size: 10.5pt; line-height: 1.7; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cover { border: none; padding: 0; min-height: 245mm; display: flex; flex-direction: column; break-after: page; margin: 0; }
  .cover-title { margin-top: 55mm; }
  .cover .toc { margin-top: auto; }
  .report h2 { break-after: avoid; font-size: 14pt; }
  .report h3 { break-after: avoid; }
  .report section { margin-top: 18px; }
  .finding { break-inside: avoid; box-shadow: none; }
  .trend-grid { gap: 0 8mm; }
  .table-wrap { overflow: visible; }
  .report-intro { break-inside: avoid; }
}
.cover .print-text:empty::after { content: ""; }

/* ウイルス付きメール */
.chip-wrap { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; }
.chip-wrap .chip { margin-right: 0; }
.chip-add { font-size: 11px; white-space: nowrap; }
.lure-summary { margin-bottom: 10px; }
.tag.status-0 { background: #ffebe9; color: #b42318; }
.tag.status-1 { background: #fff8c5; color: #7d4e00; }
.tag.status-2 { background: #dafbe1; color: #1a7f37; }
.report h3.sub-head { font-size: 14px; margin: 16px 0 6px; }
@media print { .chip-add { display: none; } }
.btn-sm, button.btn-sm { white-space: nowrap; }

/* 詳細ログ */
.grow-input { min-width: 420px; }
.top-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.top-list { padding: 10px 14px; }
.top-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.top-list ol { margin: 0; padding-left: 20px; font-size: 13px; }
.top-list li { display: list-item; }
.top-value { word-break: break-all; }
.top-count { float: right; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 8px; }
p.alert { color: var(--danger); }
@media (max-width: 720px) { .grow-input { min-width: 0; } }
td.nowrap-cell { white-space: nowrap; }
.tag { white-space: nowrap; }
.drop-zone { border: 2px dashed #9ec5fe; border-radius: 10px; background: #f6faff; padding: 28px; text-align: center; cursor: pointer; }
.drop-zone .drop-main { font-size: 16px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.drop-zone.over { background: #e3efff; border-color: var(--accent); }
.drop-zone.disabled { border-color: var(--line); background: #f6f8fa; cursor: not-allowed; }
.drop-zone.disabled .drop-main { color: var(--muted); }
.upload-list { list-style: none; margin: 12px 0 0; padding: 0; }
.upload-list li { display: grid; grid-template-columns: minmax(0, 2fr) 160px minmax(0, 3fr); gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.up-name { word-break: break-all; }
.progress { height: 8px; background: #eaeef2; border-radius: 4px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* 攻撃元の分析 */
.threat-kind { margin-bottom: 20px; }
.threat-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
ol.country-bars { list-style: none; margin: 0; padding: 0; }
ol.country-bars li { display: grid; grid-template-columns: 10em minmax(0, 1fr) 7em; gap: 8px; align-items: center; padding: 3px 0; font-size: 13px; }
.cname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctrack { height: 12px; background: #eef1f4; border-radius: 3px; }
.cbar { display: block; height: 100%; background: #2a78d6; border-radius: 3px; }
.cval { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .threat-grid { grid-template-columns: 1fr; } }
.threat-kind figure.fig { max-width: 760px; margin: 14px auto 0; }
.threat-mini { margin-bottom: 12px; padding: 10px 14px; }
.threat-mini-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.threat-mini-head .btn { margin-left: auto; }
.threat-mini-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 13px; }
.threat-mini-label { font-weight: 700; min-width: 12em; }
.threat-report { break-inside: avoid; }
.threat-report figure { max-width: 620px; }
@media print { .report-end { margin-top: 4px; break-before: avoid; } .report section:last-of-type > :nth-last-child(2) { break-after: avoid; } }
.coverage-note { background: #fffbea; border: 1px solid #f5e0a0; border-radius: 6px; padding: 8px 12px; font-size: 13.5px; margin: 8px 0; }
.fig-legend { justify-content: center; margin: 4px 0 0; }
.threat-report + .threat-report { margin-top: 8px; }
.report figure.narrow { max-width: 680px; margin-left: auto; margin-right: auto; }
.sensitive-warn { background: #fff5f5; border: 1px solid #ffcecb; color: #b42318; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.sensitive-warn div { color: var(--text); font-size: 13px; margin-top: 2px; }
@media print { .comment:has(.print-text:empty) { display: none; } }
.print-mode .comment:has(.print-text:empty) { display: none; }

/* AI による文章作成 */
.ai-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #f3f0ff; border: 1px solid #d8d0ff; border-radius: 8px; padding: 8px 14px; margin-bottom: 12px; font-size: 13.5px; }
.ai-preview { max-height: 360px; overflow: auto; background: #f6f8fa; border-radius: 6px; padding: 10px; font-size: 12px; white-space: pre-wrap; }

/* ================================================================
   報告書：社内文書の体裁（画面と PDF で同じ見た目）
   ================================================================ */
.report.doc {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  font-size: 14px; line-height: 1.85; color: #111;
  max-width: 820px; margin: 0 auto; padding: 48px 56px; border-radius: 0; border-color: #ccc;
  counter-reset: fig tbl;
}
.report.doc h1, .report.doc h2, .report.doc h3, .report.doc th, .report.doc figcaption,
.report.doc .cover-meta dt, .report.doc .toc { font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; }

/* 表紙 */
.report.doc .cover { border: none; border-radius: 0; padding: 0; margin: 0 0 40px; background: none; min-height: 520px; display: flex; flex-direction: column; }
.report.doc .cover-mark { align-self: flex-end; border: 1px solid #111; color: #111; border-radius: 0; font-size: 12px; padding: 1px 10px; }
.report.doc .cover-title { border: none; padding: 0; margin: 120px 0 0; text-align: center; }
.report.doc .cover-title h1 { color: #111; font-size: 26px; letter-spacing: .08em; margin: 0 0 14px; }
.report.doc .cover-period { font-size: 16px; font-weight: 400; }
.report.doc dl.cover-meta { margin: auto 0 0 auto; grid-template-columns: 6em auto; gap: 4px 12px; font-size: 14px; }
.report.doc dl.cover-meta dt { color: #111; }

/* 目次 */
.report.doc .toc h2 { border: none; }
.report.doc .toc ol { list-style: none; padding: 0 0 0 1em; margin: 0; columns: 1; font-size: 13px; line-height: 2; }

/* 見出し */
.report.doc section { margin-top: 28px; }
.report.doc h2 { font-size: 17px; color: #111; border-bottom: 1px solid #111; border-top: none; padding: 0 0 4px; margin: 0 0 12px; }
.report.doc h3, .report.doc h3.sub-head, .report.doc h3.item-head { font-size: 14.5px; color: #111; margin: 18px 0 6px; }
.report.doc p { margin: 6px 0; text-indent: 0; }

/* まとめ（編集欄）は本文と同じ書体で */
.report.doc .summary-edit textarea, .report.doc .editable textarea { font-family: inherit; font-size: 14px; border-radius: 0; }

/* 各項目：枠や色を使わず、罫線の表で */
.report.doc .finding { border: none; border-radius: 0; padding: 0; margin: 0 0 18px; background: none; box-shadow: none; }
.report.doc table.kv { width: 100%; border-collapse: collapse; margin: 4px 0 8px; font-size: 13.5px; background: none; }
.report.doc table.kv th, .report.doc table.kv td { border: 1px solid #888; padding: 6px 10px; vertical-align: top; text-align: left; }
.report.doc table.kv th { width: 9em; background: #f0f0f0; font-weight: 600; font-size: 13px; white-space: nowrap; }
.report.doc table.kv .editable textarea { min-height: 44px; }

/* 表（罫線） */
.report.doc .table-wrap { border: none; border-radius: 0; overflow: visible; }
.report.doc table { background: none; font-size: 13px; }
.report.doc .table-wrap table, .report.doc table.grid-table { border-collapse: collapse; width: 100%; }
.report.doc .table-wrap th, .report.doc .table-wrap td, .report.doc table.grid-table th, .report.doc table.grid-table td {
  border: 1px solid #888; padding: 5px 8px; }
.report.doc .table-wrap th, .report.doc table.grid-table th { background: #f0f0f0; color: #111; font-size: 12.5px; }
.report.doc .table-wrap table tr:last-child td { border-bottom: 1px solid #888; }
.report.doc table.matrix .group-row th { background: #f7f7f7; color: #333; }
.report.doc table.matrix th.row-head { background: none; font-weight: 400; }
.report.doc .country-table { max-width: 460px; margin: 0 auto; }
.report.doc .lv-high, .report.doc .alert { color: #111; font-weight: 700; }

/* 図表番号と図 */
.report.doc figure { margin: 12px auto 16px; }
.report.doc figure.fig { max-width: 600px; }
.report.doc figure.fig figcaption, .report.doc figure.tbl figcaption { font-size: 12.5px; color: #111; text-align: center; }
.report.doc figure.tbl figcaption { margin-bottom: 4px; }
.report.doc figure.fig figcaption::before, .report.doc figure.tbl figcaption::before { color: #111; }
.report.doc .trend-grid { gap: 0 24px; }
.report.doc .trend-grid figure { max-width: none; }
.report.doc .legend { font-size: 12px; justify-content: center; }
.report.doc .dg-scroll { border-radius: 0; background: none; border-color: #ccc; }

/* 注意書き・お願い：色の箱ではなく細い罫線で */
.report.doc .coverage-note, .report.doc .ask-box { background: none; border: 1px solid #888; border-radius: 0; color: #111; padding: 8px 12px; font-size: 13px; }
.report.doc .minor-list ul, .report.doc .report-list { padding-left: 1.5em; }

/* 用語集 */
.report.doc dl.glossary { grid-template-columns: 13em 1fr; font-size: 13px; }
.report.doc dl.glossary dt { font-family: "Hiragino Kaku Gothic ProN", sans-serif; }
.report.doc .muted { color: #444; }

@media print {
  .report.doc { max-width: none; padding: 0; font-size: 10.5pt; }
  .report.doc .cover { min-height: 245mm; break-after: page; }
  .report.doc .cover-title { margin-top: 70mm; }
  .report.doc .toc { margin-top: 0; }
  .report.doc table.kv { font-size: 10pt; }
  .report.doc table, .report.doc .table-wrap table { font-size: 9.5pt; }
  .report.doc tr.comment-row:has(.print-text:empty) { display: none; }
  .report.doc h2 { font-size: 13pt; }
  .report.doc h3, .report.doc h3.item-head, .report.doc h3.sub-head { font-size: 11pt; }
}
.print-mode .report.doc tr.comment-row:has(.print-text:empty) { display: none; }
/* 長い表はページをまたいでよい（見出しは表の先頭と同じページに、行の途中では切らない） */
.report.doc figure.tbl { break-inside: auto; }
.report.doc figure.tbl figcaption { break-after: avoid; }
.report.doc tr { break-inside: avoid; }
.report.doc thead { display: table-header-group; }
.report.doc svg text { font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; }
@media print { .report.doc .table-wrap { break-inside: auto; } .report.doc figure.tbl, .report.doc .table-wrap { break-inside: auto !important; } }
.report.doc .cover-mark { border: 2px solid #c00000; color: #c00000; font-weight: 700; font-size: 13px; padding: 2px 12px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* 表紙は文字を大きく */
.report.doc .cover-title h1 { font-size: 34px; }
.report.doc .cover-period { font-size: 21px; }
.report.doc dl.cover-meta { font-size: 17px; gap: 8px 16px; grid-template-columns: 6em auto; }
.report.doc .cover-mark { font-size: 16px; padding: 3px 14px; }
@media print {
  .report.doc .cover-title h1 { font-size: 26pt; }
  .report.doc .cover-period { font-size: 16pt; }
  .report.doc dl.cover-meta { font-size: 13pt; }
  .report.doc .cover-mark { font-size: 12pt; }
}

/* ================================================================
   報告書の文字は最低 12pt（印刷・PDF）
   ================================================================ */
svg.dg-big .dg-addr { font-size: 17.5px; }
svg.dg-big .dg-sub, svg.dg-big .dg-col, svg.dg-big .dg-badge { font-size: 15.4px; }
.report.doc .trend-grid { grid-template-columns: 1fr; }
.report.doc svg.chart .tick { font-size: 15px; }
@media print {
  @page {
    /* 2ページ目以降は右上に「社外秘」（表紙は本文の赤枠で示す） */
    /* 赤枠の「社外秘」は画像にして、ヘッダーの線を右端まで通す */
    @top-right { content: ""; width: 21mm; background: url("/confidential.svg") no-repeat right 0 top 0.2mm / auto 6.5mm; height: 8mm; margin: auto 0 3mm; text-align: right; vertical-align: middle; border-bottom: 1px solid #888; }
    @bottom-left { content: none; }
    /* ヘッダーの下に境界線（「社外秘」の枠の下辺と同じ高さにそろえる） */
    @top-left { height: 8mm; margin: auto 0 3mm; vertical-align: middle; border-bottom: 1px solid #888; }
    @bottom-center { content: counter(page) " / " counter(pages); font-size: 12pt; color: #333; }
  }
  @page :first { @top-right { content: none; border: none; } @top-left { border: none; } }
  .report.doc { font-size: 12pt; line-height: 1.75; }
  .report.doc p, .report.doc li, .report.doc dd, .report.doc dt, .report.doc td, .report.doc th,
  .report.doc table, .report.doc .table-wrap table, .report.doc table.kv, .report.doc table.kv th,
  .report.doc .table-wrap th, .report.doc table.grid-table th, .report.doc figcaption,
  .report.doc .legend, .report.doc .coverage-note, .report.doc .ask-box, .report.doc dl.glossary,
  .report.doc .toc ol, .report.doc .muted, .report.doc .prev, .report.doc .print-text,
  .report.doc .minor-list ul, .report.doc .report-end { font-size: 12pt; }
  .report.doc h2 { font-size: 15pt; }
  .report.doc h3, .report.doc h3.item-head, .report.doc h3.sub-head { font-size: 13pt; }
  .report.doc table.kv th { width: 8.5em; }
  .report.doc figure.fig { max-width: 100%; }
  .report.doc .dg-legend { font-size: 12pt; }
}
@media print { .report.doc .chart-caption { font-size: 12pt; } }
/* 1列に並べたグラフはページ幅いっぱいに描く（グリッド内で縮まないよう幅を指定） */
.report.doc .trend-grid figure, .report.doc .trend-grid .chart-wrap { width: 100%; max-width: 100%; margin-left: 0; margin-right: 0; }
.report.doc .trend-grid svg.chart { width: 100%; }
/* グラフは幅14cmで中央に。目盛りは印刷で約12pt（viewBox 560 を 14cm に描くと 17 単位 ≒ 12pt） */
.report.doc svg.chart .tick { font-size: 17px; }
@media print {
  .report.doc figure.fig, .report.doc .trend-grid figure { width: 140mm; max-width: 140mm; margin-left: auto; margin-right: auto; }
  .report.doc figure.fig.report-diagram { width: auto; max-width: 100%; }
  .report.doc figure.fig figcaption, .report.doc figure.tbl figcaption { font-size: 12pt; }
}

/* 記述方針・脆弱性情報 */
.guidance-panel { background: #fff; border: 1px solid #d8d0ff; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.guidance-panel label { display: block; margin-bottom: 6px; font-size: 13.5px; }
.guidance-panel textarea { min-height: 80px; }
.news-panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; margin-bottom: 12px; font-size: 13px; }
.news-panel summary { font-weight: 700; color: var(--text); margin: 0; }
table.news-table { font-size: 13px; margin-top: 8px; }
table.news-table td { vertical-align: top; }
table.news-table input:not([type=checkbox]) { min-width: 180px; }
table.news-table tr.is-related td { background: #fff8e1; }
.review-notes { margin-top: 6px; font-size: 13px; }
.review-notes ul { margin: 2px 0 0; padding-left: 20px; }
/* メニューが増えたので1行に収める（狭い画面では横にスクロール） */
.topbar { gap: 16px; }
.topbar nav { gap: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.topbar nav a { padding: 6px 9px; font-size: 13px; }
.topbar .brand { white-space: nowrap; font-size: 15px; }
@media (max-width: 1350px) { .topbar .brand { display: none; } }

/* 用語集 */
.glossary-edit td { vertical-align: top; }
.glossary-edit input { min-width: 180px; }
.glossary-edit textarea { min-height: 52px; }
.report.doc.glossary-doc { margin-top: 8px; }
.glossary-head { display: flex; flex-direction: column; margin-bottom: 18px; }
.glossary-head h1 { font-size: 24px; margin: 16px 0 6px; text-align: center; }
.glossary-meta { text-align: right; }
.report.doc table.glossary-table th { width: 12em; white-space: normal; }
@media print {
  .report.doc .glossary-head h1 { font-size: 20pt; }
  .report.doc table.glossary-table th, .report.doc table.glossary-table td { font-size: 12pt; }
}
/* 付録の拠点別の表：用紙の幅に収める（見出し・項目名を折り返す） */
.report.doc table.matrix { table-layout: fixed; width: 100%; }
.report.doc table.matrix th, .report.doc table.matrix td, .report.doc table.matrix thead th, .report.doc table.matrix th.row-head {
  white-space: normal; word-break: break-word; overflow-wrap: anywhere; }
.report.doc table.matrix tr > :first-child { width: 30%; }
.report.doc .table-wrap td:nth-child(-n+2) { white-space: normal; }
@media print {
  .report.doc table.matrix td, .report.doc table.matrix th { padding: 4px 5px; }
  .report.doc table.matrix .diff-up, .report.doc table.matrix .diff-down, .report.doc table.matrix .diff-same { font-size: 12pt; }
}
.report.doc table td, .report.doc table th { overflow-wrap: anywhere; }
/* 報告書の転送図は、枠の幅に合わせて縮小して全体を表示する（切れて横スクロールにならないように） */
.report.doc .dg-scroll { overflow: visible; }
.report.doc .dg-scroll svg { max-width: 100%; height: auto; }
/* 折り返しは、長い英数字が枠を超えるときだけ（日付は折り返さない） */
.report.doc table td, .report.doc table th { overflow-wrap: break-word; }
.report.doc table td.nowrap-cell { white-space: nowrap; }
.report.doc table.matrix th, .report.doc table.matrix td { overflow-wrap: anywhere; }
.report.doc .table-wrap td.nowrap-cell, .report.doc table td.nowrap-cell { white-space: nowrap !important; }
.report.doc span.nowrap { white-space: nowrap; }
/* 「主な数値の推移」は2列に並べる（横幅の狭い形のグラフで、目盛りは印刷で12pt以上） */
.report.doc .trend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8mm; }
.report.doc svg.chart.compact .tick { font-size: 18px; }
@media print {
  .report.doc .trend-grid figure, .report.doc .trend-grid .chart-wrap { width: 100%; max-width: 100%; margin-left: 0; margin-right: 0; }
}
/* 凡例だけがページの下に残らないようにする */
.report.doc .legend { break-after: avoid; break-inside: avoid; }
/* 「主な数値の推移」の各グラフを細い枠で囲む */
.report.doc .trend-grid figure { box-sizing: border-box; border: 1px solid #999; padding: 2mm 2mm 1mm; margin: 0 0 4mm; }
.report.doc .trend-grid figure figcaption { margin-top: 1mm; }
.report.doc .trend-grid { gap: 0 6mm; }
@media print {
  .report.doc .trend-grid figure { border-color: #888; }
}
/* ダッシュボードの脆弱性情報（件数が多いときは枠の中でスクロール） */
.news-home .news-scroll { max-height: 420px; overflow-y: auto; }
.news-home .news-scroll thead th { position: sticky; top: 0; background: #fff; }
.tag.tag-new { background: #fdecea; color: #b42318; margin-left: 6px; }
/* ダッシュボード「対応が必要なこと」 */
.todo-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.todo-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); border-left: 4px solid transparent; }
.todo-item:first-child { border-top: none; }
.todo-item.level-high { border-left-color: #d03b3b; }
.todo-item.level-medium { border-left-color: #fab219; }
.todo-item .sev-tag { margin-top: 2px; white-space: nowrap; }
.todo-body { flex: 1; min-width: 0; }
.todo-more summary { font-size: 12.5px; color: var(--muted); cursor: pointer; margin-top: 4px; }
.todo-more .finding-chart { max-width: 560px; }
svg.chart .no-data { font-size: 20px; fill: var(--muted, #666); }
/* 脆弱性情報：「対象外」にしたものは薄く表示する */
table.news-table tr.is-excluded td { color: var(--muted); background: #f6f8fa; }
table.news-table tr.is-excluded a { color: var(--muted); text-decoration: line-through; }
.report.doc .related-news { break-before: page; }
.report.doc .related-news table td:nth-child(3), .report.doc .related-news table th:nth-child(3) { width: 40%; }
.report.doc .related-news table td:nth-child(4), .report.doc .related-news table th:nth-child(4),
.report.doc .related-news table td:nth-child(5), .report.doc .related-news table th:nth-child(5) { width: 17%; }
.report.doc .impact-none { color: #555; }
/* 7．参考：公表された脆弱性情報 は件数が多いので、この表だけ文字を小さくする（12pt の例外） */
.report.doc .related-news .table-wrap table td, .report.doc .related-news .table-wrap table th { font-size: 12.5px; line-height: 1.45; padding: 4px 8px; }
@media print {
  .report.doc .related-news .table-wrap table td, .report.doc .related-news .table-wrap table th { font-size: 10pt; line-height: 1.4; padding: 2.5px 6px; }
}
/* 脆弱性情報：対応が必要なもの（コメントが「対象外」以外）は薄い黄色 */
table.news-table tr.needs-action td, .report.doc .related-news tr.needs-action td { background: #fffdf2; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* 報告書の表の見出し（列名）は中央揃え */
.report.doc thead th, .report.doc thead th.num { text-align: center; }
/* 章の見出しには線を引かない（ページ上部のヘッダーの線と重なって見えるため） */
.report.doc h2 { border-bottom: none; padding-bottom: 0; }
/* 社内周知の案内文 */
.notice-controls .notice-src { margin-bottom: 10px; }
.notice-controls textarea { width: 100%; }
.notice-link { margin-left: 8px; white-space: nowrap; }
.notice-link.done { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.report.doc.notice-doc .notice-top { display: flex; justify-content: flex-end; }
.report.doc.notice-doc .notice-head { display: flex; justify-content: space-between; align-items: flex-start; margin: 12px 0 8px; }
.report.doc.notice-doc .notice-from { text-align: right; }
.report.doc.notice-doc h1.notice-title { font-size: 20px; text-align: center; margin: 18px 0 14px; }
.report.doc.notice-doc h1.notice-title textarea { font-size: 18px; font-weight: 700; text-align: center; }
.report.doc.notice-doc .notice-name-input { width: 100%; margin: 0 0 6px; }
.report.doc.notice-doc table.notice-summary { margin: 10px 0 18px; }
.report.doc.notice-doc table.notice-summary th { width: 9em; }
.report.doc.notice-doc .urgency-緊急, .report.doc.notice-doc .necessity-要対応 { color: #c00000; }
.report.doc.notice-doc .urgency-高 { color: #b45309; }
.report.doc.notice-doc ol.notice-actions { margin: 4px 0 8px; padding-left: 1.6em; }
.report.doc.notice-doc .notice-ref { margin-top: 18px; font-size: 13px; color: #333; }
.report.doc.notice-doc .notice-url { overflow-wrap: anywhere; color: #555; }
@media print {
  .report.doc.notice-doc h1.notice-title { font-size: 18pt; }
  .report.doc.notice-doc .notice-ref { font-size: 11pt; }
  .report.doc.notice-doc .urgency-緊急, .report.doc.notice-doc .necessity-要対応 { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.report.doc.notice-doc h2 { display: block; }
.report.doc.notice-doc h1.notice-title .editable, .report.doc.notice-doc h1.notice-title textarea { width: 100%; }
.notice-controls .grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 14px; }
@media (max-width: 900px) { .notice-controls .grid { grid-template-columns: 1fr 1fr; } }
.report.doc.notice-doc h1.notice-title .editable.inline textarea { max-width: none; height: 40px; }
/* 社内周知：「文章を書く」と「仕上がりを見る」の切り替え */
.notice-tabs { display: flex; gap: 0; margin: 18px 0 0; border-bottom: 2px solid var(--line); }
.notice-tabs button { border: 1px solid var(--line); border-bottom: none; border-radius: 8px 8px 0 0; background: #f3f4f6; color: var(--muted); padding: 8px 18px; font-size: 14px; margin-right: 4px; }
.notice-tabs button.active { background: #fff; color: var(--text); font-weight: 700; border-color: #9aa4b2; }
.notice-form { border-top-left-radius: 0; padding: 18px 22px; }
.notice-form .notice-field { display: block; margin-bottom: 16px; }
.notice-form .notice-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: #1f3a5f; }
.notice-form textarea { width: 100%; font-size: 15px; line-height: 1.7; padding: 8px 10px; }
.report.doc.notice-doc { font-size: 15px; line-height: 1.85; max-width: 820px; }
.report.doc.notice-doc h2 { margin-top: 22px; }
/* サイバー攻撃・情報漏えい事案 */
.incident-add summary { font-weight: 700; cursor: pointer; }
.incident-add .grid { display: grid; grid-template-columns: 2fr 2fr 1.5fr 1fr 1fr; gap: 8px 12px; margin-top: 10px; }
.incident-add textarea { width: 100%; }
.incident-add .inline-row { display: flex; gap: 6px; }
.incident-add .inline-row input { flex: 1; min-width: 0; }
table.incident-table td .btn-danger { margin-left: 6px; }
table.incident-table input { min-width: 150px; }
table.incident-table select { min-width: 10.5em; }
table.incident-table td:nth-child(4) input { min-width: 11em; }
/* 利用製品・サービス台帳 */
.asset-form .grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 14px; }
.asset-form input:not([type=checkbox]) { width: 100%; }
@media (max-width: 900px) { .asset-form .grid { grid-template-columns: 1fr 1fr; } }
.asset-csv { border-style: dashed; }
.asset-csv.drag { background: #eef5ff; border-color: #1f6feb; }
.asset-csv .actions { margin-top: 8px; }
table.asset-table td { vertical-align: top; }
.match-badges { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.match-label { font-size: 12px; color: #9a3412; font-weight: 700; }
.match-badge { font-size: 12px; background: #fff1e6; color: #9a3412; border: 1px solid #fdba74; border-radius: 10px; padding: 0 8px; text-decoration: none; }
.hint-btn { margin-top: 4px; }
/* 台帳との一致・当社への影響 */
.match-label.weak { color: #6b7280; }
.match-badge.weak { background: #f3f4f6; color: #4b5563; border-color: #d1d5db; }
.impact-box { margin-top: 6px; font-size: 12.5px; }
.impact-box .impact-tag { font-weight: 700; padding: 0 8px; border-radius: 10px; background: #eef2f6; }
.impact-box.impact-影響あり .impact-tag { background: #fdecea; color: #b42318; }
.impact-box.impact-影響の可能性あり .impact-tag { background: #fff3cd; color: #8a5a00; }
.impact-box.impact-影響なしとみられる .impact-tag { background: #e8f5e9; color: #1b5e20; }
.impact-box .impact-by { color: var(--muted); margin-right: 6px; }
.impact-box .impact-reason { color: #374151; margin: 2px 0; }
.impact-box button { margin-top: 3px; }
.impact-detail summary { cursor: pointer; color: var(--muted); }
.impact-detail ul { margin: 2px 0 4px; padding-left: 1.4em; }
.report.doc .impact-reason { font-size: 0.92em; color: #333; }
.impact-box .impact-comment { margin: 3px 0; color: #1f3a5f; }
.report.doc.notice-doc h2.notice-status-head { margin-top: 26px; }
.report.doc.notice-doc table.notice-status th { width: 9em; }
/* 社内で影響を受ける可能性のあるもの（判定の結論） */
.report.doc.notice-doc .notice-targets { border: 2px solid #b45309; background: #fff8eb; margin: 12px 0 14px; padding: 8px 14px 10px;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
.report.doc.notice-doc .notice-targets-label { font-family: "Hiragino Kaku Gothic ProN", sans-serif; font-weight: 700; color: #92400e; font-size: 0.95em; margin-bottom: 2px; }
.report.doc.notice-doc .notice-targets-body { font-weight: 700; font-size: 1.08em; }
/* 社内周知：判断ステータスを分けない・全体を少し詰めて2ページに収める */
.report.doc.notice-doc .notice-status-box { break-inside: avoid; page-break-inside: avoid; }
.report.doc.notice-doc .notice-status-box table, .report.doc.notice-doc .notice-status-box tr { break-inside: avoid; }
@media print {
  .report.doc.notice-doc { line-height: 1.6; }
  .report.doc.notice-doc p, .report.doc.notice-doc li, .report.doc.notice-doc .print-text, .report.doc.notice-doc td, .report.doc.notice-doc th { line-height: 1.6; }
  .report.doc.notice-doc h2 { margin: 14px 0 6px; }
  .report.doc.notice-doc h3.sub-head { margin: 10px 0 4px; }
  .report.doc.notice-doc .notice-head { margin: 4px 0 4px; }
  .report.doc.notice-doc h1.notice-title { margin: 10px 0 8px; }
  .report.doc.notice-doc table.notice-summary { margin: 6px 0 10px; }
  .report.doc.notice-doc table.kv th, .report.doc.notice-doc table.kv td { padding: 4px 10px; }
  .report.doc.notice-doc .notice-targets { margin: 8px 0 10px; padding: 6px 12px 8px; }
  .report.doc.notice-doc .notice-ref { margin-top: 10px; }
  .report.doc.notice-doc h2.notice-status-head { margin-top: 14px; }
}
/* 同じ事案の記事をまとめる */
.group-box { margin-top: 4px; font-size: 12.5px; }
.group-box summary { cursor: pointer; color: #1f3a5f; }
.group-box.candidates summary { color: #9a3412; }
.group-box ul { margin: 4px 0; padding-left: 1.2em; }
.group-box li { margin: 2px 0; }
.report.doc.notice-doc .notice-ref ol { margin: 4px 0 0; padding-left: 1.6em; }
/* 社内周知：参考（報道・発表）は件数が多くなるので小さめの文字で詰める（12pt の例外） */
@media print {
  .report.doc.notice-doc .notice-ref, .report.doc.notice-doc .notice-ref li, .report.doc.notice-doc .notice-ref .notice-url { font-size: 10pt; line-height: 1.4; }
  .report.doc.notice-doc .notice-ref li { margin: 1px 0; }
}
.report.doc.notice-doc .notice-ref li .notice-url { display: inline; margin-left: 0.5em; }
@media print {
  .report.doc.notice-doc .notice-top { margin: 0; }
  .report.doc.notice-doc .notice-top .cover-mark { padding: 1px 12px; font-size: 13pt; }
  .report.doc.notice-doc .notice-head { margin: 2px 0 0; line-height: 1.5; }
  .report.doc.notice-doc .notice-ref, .report.doc.notice-doc .notice-ref li, .report.doc.notice-doc .notice-ref .notice-url { line-height: 1.3; }
  .report.doc.notice-doc .notice-ref { margin-top: 8px; }
  .report.doc.notice-doc .report-end { margin-top: 4px; }
}
@media print { .report.doc.notice-doc .notice-top { display: none; } }
.print-mode .report.doc.notice-doc .notice-top { display: none; }
/* 配信用の文章（メール・チャット） */
.notice-share { border-top-left-radius: 0; }
.notice-share .share-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; }
@media (max-width: 900px) { .notice-share .share-grid { grid-template-columns: 1fr; } }
.notice-share textarea { width: 100%; font-size: 13.5px; line-height: 1.6; }
.notice-share .share-row { display: flex; gap: 6px; margin-bottom: 8px; }
.notice-share .share-row input { flex: 1; min-width: 0; }
.notice-share .actions { margin-top: 6px; }
.ai-bar select.ai-target { font-size: 13px; padding: 3px 6px; }
/* ダッシュボード：セキュリティ評価 */
.scorecard .score-body { display: grid; grid-template-columns: 170px 340px 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .scorecard .score-body { grid-template-columns: 170px 1fr; } .scorecard .score-table { grid-column: 1 / -1; } }
.score-total { text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 14px 8px; }
.score-total-label { font-weight: 700; color: #1f3a5f; }
.score-total-value { font-size: 46px; font-weight: 800; line-height: 1.2; }
.score-prev { margin-top: 6px; font-size: 13px; }
.score-history { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.score-history .chip { font-size: 11px; padding: 0 5px; border-radius: 8px; background: #eef2f6; }
.good { color: #1a7f37; } .fair { color: #1f6feb; } .warn { color: #b45309; } .bad { color: #b42318; }
.score-history .chip.good { background: #e6f4ea; } .score-history .chip.warn { background: #fff3cd; } .score-history .chip.bad { background: #fdecea; }
svg.score-radar { width: 100%; max-width: 340px; height: auto; overflow: visible; }
svg.score-radar .grid { fill: none; stroke: #d0d7de; stroke-width: 1; }
svg.score-radar .tick { font-size: 10px; fill: #8c959f; }
svg.score-radar polygon.now { fill: rgba(31, 111, 235, 0.18); stroke: #1f6feb; stroke-width: 2.5; }
svg.score-radar polygon.prev { fill: none; stroke: #8c959f; stroke-width: 1.5; stroke-dasharray: 4 3; }
svg.score-radar circle.dot { fill: currentColor; }
svg.score-radar .axis-label { font-size: 12.5px; font-weight: 700; fill: #24292f; }
.score-legend { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; justify-content: center; }
.score-legend .key { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid #1f6feb; margin-left: 8px; }
.score-legend .key.prev { border-top: 1.5px dashed #8c959f; }
.score-table { width: 100%; font-size: 13.5px; }
.score-table th .prev { font-weight: 400; }
.score-value { font-size: 20px; }
.score-delta { font-size: 12px; }
.score-delta.up { color: #1a7f37; } .score-delta.down { color: #b42318; }
.score-reasons { margin: 4px 0 0; padding-left: 0; list-style: none; font-size: 12.5px; color: #374151; }
.score-reasons .minus { display: inline-block; min-width: 2.8em; color: #b42318; font-weight: 700; }
.scorecard .score-body { grid-template-columns: 170px 380px 1fr; }
.score-table { table-layout: fixed; }
.score-table thead th:nth-child(1) { width: 32%; } .score-table thead th:nth-child(2) { width: 78px; }
.score-table tbody th { background: transparent; font-weight: 700; vertical-align: top; }
.score-table td { vertical-align: top; }
svg.score-radar .axis-score { font-size: 15px; font-weight: 800; fill: currentColor; }
svg.score-radar tspan.good { fill: #1a7f37; } svg.score-radar tspan.fair { fill: #1f6feb; } svg.score-radar tspan.warn { fill: #b45309; } svg.score-radar tspan.bad { fill: #b42318; }
.score-table th, .score-table td { white-space: normal; overflow-wrap: anywhere; }
svg.score-radar { max-width: 380px; }
svg.score-radar .axis-label { font-size: 15px; }
svg.score-radar .axis-score { font-size: 17px; }
svg.score-radar .tick { font-size: 11px; }
.score-period select { font-size: 13px; padding: 3px 6px; margin-left: 4px; }
.scorecard details.logcheck { margin-top: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; }
.scorecard details.logcheck summary { font-weight: 700; cursor: pointer; }
table.logcheck-table { font-size: 13px; }
table.logcheck-table tr.mismatch td { background: #fdecea; }
table.logcheck-table tr.nolog td { color: var(--muted); }
.diff-bad { color: #b42318; font-weight: 700; }
.scorecard .score-period { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.scorecard .score-period select { width: auto; max-width: 300px; }
/* 上のメニュー：まとまりごとに開くメニュー */
.topbar nav { overflow: visible; align-items: center; }
.topbar .nav-group { position: relative; }
.topbar .nav-head { background: none; border: none; color: #d0d7de; padding: 6px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; font-family: inherit; }
.topbar .nav-head::after { content: " ▾"; font-size: 10px; opacity: 0.7; }
.topbar .nav-group:hover .nav-head, .topbar .nav-group.open .nav-head { background: #32383f; }
.topbar .nav-group.active .nav-head { background: #444c56; color: #fff; }
.topbar .nav-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 50; min-width: 210px; padding: 6px;
  background: #fff; border: 1px solid #d0d7de; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.topbar .nav-group:hover .nav-menu, .topbar .nav-group.open .nav-menu, .topbar .nav-group:focus-within .nav-menu { display: block; }
.topbar .nav-menu a { display: block; color: #24292f; padding: 7px 10px; font-size: 13.5px; border-radius: 6px; white-space: nowrap; }
.topbar .nav-menu a:hover { background: #f3f4f6; }
.topbar .nav-menu a.active { background: #eaf2ff; color: #0b5cd5; font-weight: 700; }
.topbar .nav-menu .nav-sub { display: block; font-size: 11.5px; color: #6b7280; font-weight: 400; }
@media print { .topbar { display: none; } }
/* メニューをまとまりにしたので、アプリ名は狭い画面のときだけ隠す */
@media (max-width: 1350px) { .topbar .brand { display: inline; } }
@media (max-width: 760px) { .topbar .brand { display: none; } }
.topbar nav > a, .topbar .nav-head { font-size: 14px; padding: 6px 12px; }

/* モーダル（台帳の追加・編集など） */
dialog.modal { width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid #d0d7de; border-radius: 10px;
  padding: 20px 22px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); }
dialog.modal .actions { margin-top: 14px; justify-content: flex-end; }
dialog.modal .asset-form .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { dialog.modal .asset-form .grid { grid-template-columns: 1fr 1fr; } }
.version-check { display: inline-block; margin: 0 6px 0 2px; padding: 0 6px; border-radius: 4px; font-size: 11.5px; }
.version-check.vc-in { background: #fdecea; color: #b42318; }
.version-check.vc-out { background: #e8f5e9; color: #1b5e20; }
.version-check.vc-unknown { background: #f1f3f5; color: #555; }
dialog.modal .asset-csv { margin-top: 18px; padding: 14px 16px; border: 1px dashed #c4ccd4; border-radius: 8px; }
dialog.modal .asset-csv h2 { margin: 0 0 4px; font-size: 15px; }
dialog.modal .asset-csv .actions { justify-content: flex-start; margin-top: 10px; }
.import-status summary { cursor: pointer; font-weight: 600; }
.import-status[open] summary { margin-bottom: 10px; }
.import-status:not([open]) { padding-bottom: 12px; padding-top: 12px; }
.ip-owner { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: #eef2f7; color: #3b4a5c; font-size: 11.5px; white-space: nowrap; }
.threat-grid .ip-owner { display: block; width: fit-content; max-width: 240px; margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; }
.threat-panel { margin-top: 12px; }
.threat-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.threat-level { display: inline-block; min-width: 44px; padding: 4px 12px; border-radius: 8px; font-size: 22px; font-weight: 700; text-align: center; }
.threat-level.threat-high { background: #fdecea; color: #b42318; }
.threat-level.threat-mid { background: #fff3cd; color: #8a5a00; }
.threat-level.threat-low { background: #e8f5e9; color: #1b5e20; }
.threat-kinds { display: flex; gap: 22px; margin-left: auto; }
.threat-kind-num strong { font-size: 18px; }
.threat-remote { margin-top: 8px; }
.threat-remote summary { cursor: pointer; font-weight: 600; }
.threat-remote summary .tag { margin-left: 8px; }
/* 迷惑メールの届き先 */
.spam-matrix th, .spam-matrix td { vertical-align: middle; }
.spam-matrix .spam-subject { min-width: 280px; max-width: 420px; }
.spam-flags { margin-top: 3px; display: flex; gap: 4px; flex-wrap: wrap; }
.spam-person { writing-mode: vertical-rl; white-space: nowrap; padding: 8px 4px; font-weight: 600; font-size: 12px; height: 110px; }
.spam-cell { text-align: center; min-width: 30px; color: #fff; font-weight: 700; }
.spam-cell.hit { background: #e8590c; }
.spam-cell.hit.unmarked { background: #b42318; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px #b42318; }
.spam-matrix tfoot td, .spam-matrix tfoot th { border-top: 2px solid #d0d7de; text-align: center; }
.spam-group-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.spam-group { margin-bottom: 10px; }
.spam-print-head { display: none; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 10pt; }
@media print {
  .spam-print-head { display: flex; }
  .spam-wrap { break-inside: auto; overflow: visible; }
  .spam-matrix tr, .spam-group { break-inside: avoid; }
  .spam-matrix .spam-subject { min-width: 0; max-width: none; font-size: 9pt; }
  .spam-person { height: 80px; font-size: 8.5pt; }
  .cards:has(+ h2) { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .cards .card { padding: 6px 8px; }
  .cards .card .value { font-size: 15pt; }
  .spam-cell.hit { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .spam-detail-head { break-before: page; }
}
.spam-count .spam-bar-cell { min-width: 160px; }
.spam-bar-track { background: #fff1e6; border-radius: 4px; }
.spam-bar { display: block; padding: 2px 8px; border-radius: 4px; background: #e8590c; color: #fff; font-weight: 700; font-size: 13px; white-space: nowrap;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.spam-bar.unmarked { background: #b42318; }
.spam-count .spam-cell { min-width: 48px; }
@media print { .spam-bar-track { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
button.spam-bar-track { display: block; width: 100%; padding: 0; border: 1px solid transparent; text-align: left; cursor: pointer; font: inherit; }
button.spam-bar-track:hover, button.spam-bar-track.open { border-color: #e8590c; }
.spam-who > td { background: #fff8f2; padding: 8px 14px 12px; }
.spam-who table { width: auto; min-width: 60%; background: #fff; }
.wide-input { min-width: 320px; }
.spam-senders { font-size: 12.5px; word-break: break-all; } .spam-senders summary { cursor: pointer; color: var(--muted); }
.spam-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; } .spam-cards .card { padding: 8px 10px; }
/* 長い件名（空白のない英数字の並びなど）も枠からはみ出さないよう折り返す */
.spam-subject, .spam-count td:first-child, .report.doc td { overflow-wrap: anywhere; }
.ai-preview { max-height: 320px; overflow: auto; background: #f6f8fa; padding: 10px; font-size: 12px; white-space: pre-wrap; }
.ai-bar .actions { align-items: center; }
@media print { .report.doc .editable textarea { display: none; } }
/* 迷惑メールの件数の表：横スクロールせずに画面の幅に収める */
.spam-count { table-layout: fixed; width: 100%; }
.spam-count th:nth-child(1) { width: 40%; }
.spam-count th:nth-child(2) { width: 15%; }
.spam-count th:nth-child(3) { width: 7%; }
.spam-count th:nth-child(4) { width: 25%; }
.spam-count th:nth-child(5) { width: 13%; }
.spam-count .spam-subject { min-width: 0; max-width: none; }
.spam-count .spam-bar-cell { min-width: 0; }
.spam-count .spam-cell { min-width: 0; }
.spam-count td, .spam-count th { overflow-wrap: anywhere; }
.spam-count .spam-senders { word-break: break-all; }
.spam-count td.nowrap-cell { white-space: normal; }
.spam-who table { min-width: 0; width: 100%; table-layout: fixed; }
.spam-who td { overflow-wrap: anywhere; }
.spam-count td { white-space: normal; }
.table-wrap .spam-count td { white-space: normal; }
/* 管理者用の表示（誰に届いたかの表・届き先の一覧）でも、長い件名・アドレスが隣の列に重ならないよう折り返す */
.table-wrap .spam-matrix td.spam-subject, .table-wrap .spam-who td, .spam-group .table-wrap td { white-space: normal; overflow-wrap: anywhere; }
.spam-matrix .spam-subject { min-width: 220px; max-width: 360px; }
.spam-flags .sev-tag { white-space: normal; max-width: 100%; }
/* 届いた人数を押して開く一覧：差出人の列を広く取り、アドレスは単語の途中で切らない */
.spam-who-table th:nth-child(1) { width: 26%; }
.spam-who-table th:nth-child(2) { width: 6%; }
.spam-who-table th:nth-child(3) { width: 34%; }
.spam-who-table th:nth-child(4) { width: 16%; }
.spam-who-table th:nth-child(5) { width: 10%; }
.spam-who-table th:nth-child(6) { width: 8%; }
.spam-who-table td { vertical-align: top; }
.spam-who-table .spam-senders { word-break: normal; overflow-wrap: anywhere; }
/* 迷惑メールの報告書：すべての文章を画面で直せる（見出し・表紙は1行の入力欄） */
.spam-report .ed-inline { font: inherit; color: inherit; background: transparent; border: 1px dashed #c4ccd4; border-radius: 4px; padding: 1px 6px;
  width: auto; min-width: 8em; field-sizing: content; max-width: 100%; }
.spam-report .ed-inline:focus { outline: 2px solid #1f6feb33; border-color: #1f6feb; background: #fff; }
.spam-report .cover-title h1 .ed-inline { text-align: center; }
.spam-report .cover-period .ed-inline { text-align: center; }
.spam-report .editable { position: relative; }
.spam-report .ed-reset { margin: 2px 0 6px; font-size: 11px; }
.spam-report .editable.inline .ed-reset { margin-left: 6px; vertical-align: middle; }
.spam-report .editable textarea { width: 100%; }
.spam-report .print-text:empty { display: none; }
@media print { .spam-report .print-text:empty { display: none !important; } }
.print-mode .spam-report .print-text:empty { display: none !important; }
.spam-report .ed-reset[hidden] { display: none !important; }
.spam-report h2, .spam-report h3 { display: flex; align-items: center; justify-content: flex-start; gap: 4px; flex-wrap: wrap; }
.spam-report h2 .ed-inline, .spam-report h3 .ed-inline { font-weight: inherit; }
.spam-report .editable.inline, .spam-report .editable.inline .print-text { font: inherit; letter-spacing: inherit; color: inherit; }
/* 印なしで届いた迷惑メール（管理者用） */
.unmarked-table { table-layout: fixed; width: 100%; }
.unmarked-table th:nth-child(1) { width: 8%; } .unmarked-table th:nth-child(2) { width: 17%; }
.unmarked-table th:nth-child(3) { width: 12%; } .unmarked-table th:nth-child(4) { width: 25%; }
.unmarked-table th:nth-child(5) { width: 15%; } .unmarked-table th:nth-child(6) { width: 11%; }
.unmarked-table th:nth-child(7) { width: 12%; }
.table-wrap .unmarked-table td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.unmarked-table select { width: 100%; font-size: 12px; }
.unmarked-table tr.is-checked td { background: #f6f8fa; color: #6b7280; }
/* メールアドレス一覧 */
.mail-accounts { width: 100%; }
.table-wrap .mail-accounts td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.mail-accounts .alert.small { font-size: 12px; margin-top: 2px; }
.mail-expected .filters { margin-top: 8px; margin-bottom: 0; }
.mail-history summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.mail-history ul { margin: 4px 0 0; padding-left: 16px; font-size: 12px; }
.mail-accounts { table-layout: fixed; }
.mail-accounts th:nth-child(1) { width: 22%; } .mail-accounts th:nth-child(2) { width: 8%; }
.mail-accounts th:nth-child(3) { width: 21%; } .mail-accounts th:nth-child(4) { width: 9%; }
.mail-accounts th:nth-child(5) { width: 6%; } .mail-accounts th:nth-child(6) { width: 7%; }
.mail-accounts th:nth-child(7) { width: 7%; } .mail-accounts th:nth-child(8) { width: 8%; }
.mail-accounts th:nth-child(9) { width: 8%; } .mail-accounts th:nth-child(10) { width: 10%; }
.table-wrap .mail-accounts th { white-space: normal; }
.mail-accounts th:nth-child(1) { width: 20%; } .mail-accounts th:nth-child(10) { width: 12%; }
/* メールアドレスの編集ウィンドウ：区切りごとにまとめる */
.mail-fs { border: 1px solid #d8dee4; border-radius: 8px; padding: 10px 14px 12px; margin: 0 0 12px; }
.mail-fs legend { padding: 0 6px; font-weight: 700; font-size: 14px; color: #1f3a5f; }
.mail-fs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.mail-fs-grid input, .mail-fs-grid select, .mail-fs-grid textarea, .mail-fs > textarea { width: 100%; }
.mail-settings-table { width: 100%; margin-bottom: 10px; border-collapse: collapse; }
.mail-settings-table th, .mail-settings-table td { border: 1px solid #d8dee4; padding: 6px 10px; text-align: left; vertical-align: middle; }
.mail-settings-table thead th { background: #f6f8fa; font-size: 12.5px; }
.mail-settings-table tbody th { width: 34%; background: #fbfcfd; font-weight: 600; font-size: 13.5px; }
.mail-settings-table td:nth-child(3) { width: 22%; font-size: 12.5px; }
.mail-settings-table select, .mail-settings-table input { width: 100%; }
.mail-form-sub { font-size: 14px; font-weight: 400; margin-left: 6px; }
dialog.modal form > .actions { position: sticky; bottom: -20px; background: #fff; padding: 10px 0 4px; margin-bottom: -4px; border-top: 1px solid #eef0f2; }
/* メールアドレス一覧の表：見出しは1行、設定は色付きの印、転送先は押すと開く */
.mail-accounts th:nth-child(n) { width: auto; }
.mail-accounts col, .mail-accounts { table-layout: fixed; }
.mail-accounts th:nth-child(1) { width: 27%; } .mail-accounts th:nth-child(2) { width: 9%; }
.mail-accounts th:nth-child(3) { width: 12%; } .mail-accounts th:nth-child(4) { width: 9%; }
.mail-accounts th:nth-child(5) { width: 7%; } .mail-accounts th:nth-child(6) { width: 8%; }
.mail-accounts th:nth-child(7) { width: 8%; } .mail-accounts th:nth-child(8) { width: 8%; }
.mail-accounts th:nth-child(9) { width: 8%; } .mail-accounts th:nth-child(10) { width: 9%; }
.table-wrap .mail-accounts th { white-space: nowrap; text-align: center; font-size: 12.5px; padding: 8px 4px; }
.table-wrap .mail-accounts th:first-child { text-align: left; padding-left: 12px; }
.mail-accounts td { vertical-align: middle; padding: 8px 6px; }
.mail-accounts td.ma-c { text-align: center; }
.ma-address { font-weight: 600; overflow-wrap: anywhere; }
.ma-warns { margin: 4px 0 0; padding-left: 16px; color: #b42318; font-size: 12px; }
.kind-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; background: #eef2f7; color: #3b4a5c; }
.kind-chip.kind-group { background: #e7f0ff; color: #1f4fa8; }
.kind-chip.kind-shared { background: #f3e8ff; color: #6b21a8; }
.st-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.st-ok { background: #e8f5e9; color: #1b5e20; }
.st-bad { background: #fdecea; color: #b42318; font-weight: 600; }
.st-plain { background: #eef2f7; color: #24292f; }
.st-none { background: transparent; color: #9aa4ae; }
.ma-fwd summary { cursor: pointer; white-space: nowrap; }
.ma-fwd summary .st-badge { margin-left: 4px; }
.ma-fwd div { font-size: 12px; overflow-wrap: anywhere; }
.ma-actions { display: flex; gap: 4px; justify-content: center; }
.mail-accounts .alert.small { font-size: 12px; }
.mail-accounts th:nth-child(1) { width: 25%; } .mail-accounts th:nth-child(10) { width: 11%; } .ma-actions .btn-sm { padding: 3px 8px; }
.ma-fwd-btn { background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; color: #1f6feb; cursor: pointer; font: inherit; white-space: nowrap; }
.ma-fwd-btn::before { content: "▶ "; font-size: 10px; }
.ma-fwd-btn.open::before { content: "▼ "; }
.ma-fwd-btn:hover, .ma-fwd-btn.open { border-color: #c4d4ef; background: #f3f7ff; }
.ma-fwd-btn .st-badge { margin-left: 4px; }
.ma-fwd-row > td { background: #f6f9ff; padding: 8px 14px; }
.ma-fwd-chip { display: inline-block; margin: 2px 6px 2px 4px; padding: 2px 10px; border: 1px solid #d8dee4; border-radius: 12px; background: #fff; font-size: 12.5px; white-space: nowrap; }
.ma-fwd-chip.ext { border-color: #f1aeb5; background: #fdecea; color: #b42318; }
.ma-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ma-toolbar .filters { margin-bottom: 8px; }
.seg { display: flex; align-items: center; gap: 0; margin-bottom: 10px; font-size: 13px; }
.seg-btn { border: 1px solid #c4ccd4; background: #fff; padding: 4px 12px; font: inherit; cursor: pointer; }
.seg-btn:first-of-type { border-radius: 6px 0 0 6px; } .seg-btn:last-of-type { border-radius: 0 6px 6px 0; border-left: none; }
.seg-btn.on { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.ma-fwd-chip.approved { border-color: #a6d8ad; background: #e8f5e9; color: #1b5e20; }
.fwd-approve { margin-left: 8px; font-size: 12px; color: #24292f; cursor: pointer; white-space: nowrap; }
.fwd-approve input { margin: 0 3px 0 0; vertical-align: -1px; }
.ma-fwd-row .ma-fwd-chip { width: auto; }
.fwd-approve { display: inline-flex !important; align-items: center; gap: 3px; width: auto !important; margin: 0 0 0 8px !important; font-weight: 400; }
.fwd-approve input[type=checkbox] { width: auto !important; height: auto; margin: 0; }
.retired-badge { margin-left: 6px; font-weight: 600; vertical-align: 1px; }
.cards:has(> .card:nth-child(7)) { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* 退職者のアカウントは背景を灰色に（退職後に使われているものは左端に赤い線） */
.mail-accounts tr.is-retired > td { background: #e9ecef; color: #6b7280; }
.mail-accounts tr.is-retired .ma-address { color: #4b5563; }
.mail-accounts tr.retired-used > td:first-child { box-shadow: inset 4px 0 0 #b42318; }
.mail-accounts tr.is-retired .ma-warns { color: #b42318; }
/* 設定の値の色（値ごとにはっきり分ける） */
.st-val { padding: 2px 10px; font-weight: 700; border: 1px solid transparent; }
.st-val.v-on { background: #1a7f37; color: #fff; }
.st-val.v-off { background: #cf222e; color: #fff; }
.st-val.v-warn { background: #fb8c00; color: #fff; }
.st-val.v-none { background: #eaeef2; color: #57606a; border-color: #d0d7de; font-weight: 600; }
.st-val.v-pop { background: #0969da; color: #fff; }
.st-val.v-stop { background: #57606a; color: #fff; }
.st-val.st-dev { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #cf222e; }
.st-badge.st-none { color: #b0b8c1; font-weight: 400; }

/* ログイン（Web に載せたときだけ） */
.user-box { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #d0d7de; white-space: nowrap; }
.user-box .user-logout { background: transparent; color: #d0d7de; border-color: #57606a; }
.user-box .user-logout:hover { background: #32383f; }
@media (max-width: 900px) { .user-box .user-email { display: none; } }
.login-page { min-height: 100vh; display: grid; place-items: center; background: #24292f; }
.login-box { background: #fff; border-radius: 12px; padding: 36px 40px; width: min(420px, calc(100vw - 32px)); text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.login-box h1 { margin: 0 0 12px; font-size: 22px; }
.login-box .alert { margin: 12px 0; font-weight: 600; text-align: left; }
.login-btn { display: inline-block; margin-top: 16px; padding: 10px 20px; font-size: 15px; }
.user-add-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.user-add-row > * { flex: 1 1 220px; }
.user-add-row > button { flex: 0 0 auto; }
tr.log-ng > td { background: #fff5f5; }
