:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #15233a;
  --muted: #5b6b82;
  --border: #d5deea;
  --primary: #123a6b;
  --primary-hover: #0d2d54;
  --primary-soft: #e8eef7;
  --accent: #1d5aa8;
  --ok: #1f6b45;
  --ok-soft: #e6f4ec;
  --warn: #8a5a12;
  --warn-soft: #fff6e8;
  --shadow: 0 10px 28px rgba(18, 58, 107, 0.08);
  --font: "IBM Plex Sans JP", "DM Sans", sans-serif;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(18, 58, 107, 0.08), transparent 42%),
    linear-gradient(180deg, #f8fafc, var(--bg));
}
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 16px 40px;
  display: grid;
  gap: 14px;
}

.app-header {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
}
.brand, .meta-card, .pane, .note-banner, .policy-banner, .role-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.brand { padding: 20px 22px; display: grid; grid-template-columns: 1fr auto; gap: 12px 18px; align-items: center; }
.brand-illust {
  width: min(220px, 32vw);
  pointer-events: none;
}
.brand-illust svg {
  width: 100%;
  height: auto;
  display: block;
}
.kn-paper-a { animation: knFloat 3.6s ease-in-out infinite; }
.kn-paper-b { animation: knFloat 4.1s ease-in-out infinite 0.25s; }
.kn-paper-c { animation: knFloat 3.8s ease-in-out infinite 0.5s; }
.kn-glass { animation: knSearch 5.2s ease-in-out infinite; }
.kn-spark { animation: knTwinkle 2.4s ease-in-out infinite; }
.kn-folder { animation: knIdle 6s ease-in-out infinite; }
.kn-glow { animation: knPulse 5s ease-in-out infinite; }
.brand-illust .kn-paper-a,
.brand-illust .kn-paper-b,
.brand-illust .kn-paper-c,
.brand-illust .kn-glass,
.brand-illust .kn-spark,
.brand-illust .kn-folder,
.brand-illust .kn-glow {
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes knFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes knSearch {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  40% { transform: translate(-10px, -8px) rotate(-8deg); }
  70% { transform: translate(6px, 4px) rotate(6deg); }
}
@keyframes knTwinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes knIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}
@keyframes knPulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-illust * { animation: none !important; }
}
.kicker {
  margin: 0 0 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--primary);
}
.brand h1 {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2.05rem);
  line-height: 1.2;
}
.sub {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}
.header-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.meta-card {
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  align-content: center;
}
.meta-card span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.meta-card strong { font-size: 1.25rem; }

.note-banner {
  background: #fff8e8;
  border: 1px solid #ecd9a8;
  border-radius: 12px;
  color: #6a4e16;
  padding: 12px 16px;
  font-size: 0.92rem;
  line-height: 1.55;
}
.policy-banner {
  background: #f3f7fb;
  border: 1px solid #c9d7e6;
  border-radius: 12px;
  color: #2c4660;
  padding: 12px 16px;
  font-size: 0.92rem;
  line-height: 1.65;
}
.policy-banner strong { display: inline; }
.note-banner summary,
.policy-banner summary {
  cursor: pointer;
  display: block;
  padding-left: 1.15em;
  position: relative;
  list-style: none;
  font-size: 0.95rem;
  line-height: 1.45;
}
.note-banner summary::-webkit-details-marker,
.policy-banner summary::-webkit-details-marker {
  display: none;
}
.note-banner summary::marker,
.policy-banner summary::marker {
  content: "";
}
.note-banner summary::before,
.policy-banner summary::before {
  content: "▶";
  position: absolute;
  left: 0;
  top: 0.12em;
  font-size: 0.72em;
  line-height: 1.4;
  transition: transform 0.15s ease;
}
.note-banner[open] summary::before,
.policy-banner[open] summary::before {
  transform: rotate(90deg);
}
.note-banner[open] summary,
.policy-banner[open] summary {
  margin-bottom: 8px;
}
.note-banner > p,
.policy-banner > p {
  margin: 0;
}

.home-lead {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f5f8fc, #eef3f9);
  border: 1px solid #d5deea;
}
.home-lead p {
  margin: 0;
  line-height: 1.55;
}
.home-lead p + p {
  margin-top: 4px;
}
.recent-hint {
  margin: 6px 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.role-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 18px;
  align-items: center;
  padding: 12px 16px;
}
.role-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.role-select-wrap {
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.role-select-wrap select {
  min-width: 200px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-weight: 600;
  color: var(--ink);
}

.denied-pane h2 {
  margin: 6px 0 10px;
  font-size: 1.15rem;
  line-height: 1.45;
}
.denied-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8a2b2b;
}

.view-root { display: grid; gap: 14px; }
.pane { padding: 18px 20px 22px; }
.detail-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 40;
  margin: -18px -20px 16px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.detail-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.pane-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.pane-head h2 {
  margin: 0 0 6px;
  font-size: 1.28rem;
}

.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: #eef2f7; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 18px;
}
.ai-ask {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 14px 16px 16px;
  border: 1px solid #c9d6e8;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7f9fc, #eef3f9);
}
.ai-ask-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-ask-head strong {
  font-size: 0.95rem;
  color: var(--primary);
}
.ai-ask-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #5a6a80;
  background: #fff;
  border: 1px solid #d5deea;
}
.ai-ask-example {
  display: grid;
  gap: 6px;
  margin-top: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #dde5ef;
}
.ai-ask-example > p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
}
.ai-ask-label {
  margin-top: 6px !important;
  font-size: 0.75rem !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted) !important;
}
.ai-ask-example .ai-ask-label:first-child {
  margin-top: 0 !important;
}
.ai-ask-ref {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ai-ask-note {
  margin: 2px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
}
.ai-ask-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.ai-ask textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  font-size: 1.02rem;
  line-height: 1.55;
}
.ai-ask-status {
  margin: 0;
}
.btn.tiny {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 0.78rem;
  border-radius: 8px;
}
.search-row input[type="search"],
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  font-size: 1.05rem;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.cat-btn {
  display: grid;
  gap: 6px;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 14px;
  padding: 14px 14px 16px;
  min-height: 138px;
  text-decoration: none;
  align-content: start;
}
.cat-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
  color: var(--primary);
}
.cat-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(18, 58, 107, 0.12);
}
.cat-btn strong {
  font-size: 1.05rem;
  line-height: 1.35;
}
.cat-btn span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  font-weight: 500;
}

.doc-list { display: grid; gap: 10px; }
.doc-card,
.doc-row {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
}
.doc-card:hover,
.doc-row:hover {
  border-color: var(--primary);
  background: #f8fbff;
}
.doc-card h3,
.doc-row h3 {
  margin: 0 0 6px;
  font-size: 1.12rem;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}
.chip.cat { background: var(--primary-soft); color: var(--primary); }
.chip.status-published { background: var(--ok-soft); color: var(--ok); }
.chip.status-draft { background: var(--warn-soft); color: var(--warn); }
.chip.ver { background: #eef2f7; color: var(--muted); }
.chip.audience-all { background: #eef2f7; color: #3d4f66; }
.chip.audience-somu { background: #f3eef8; color: #5a2d7a; }
.chip.replaced { background: #e8f1fb; color: #123a6b; }
.chip.file-type { font-weight: 800; letter-spacing: 0.02em; }
.chip.file-pdf { background: #fdecec; color: #8a2b2b; }
.chip.file-docx { background: #e8eef7; color: #123a6b; }
.chip.file-excel { background: #e8f6ee; color: #1b6b3a; }
.chip.file-csv { background: #eef8f1; color: #2a6a40; }
.chip.file-pptx { background: #fff0e8; color: #9a4a12; }
.chip.file-keynote { background: #eef7ff; color: #0d4a8a; }
.chip.file-image { background: #e6f4ec; color: #1f6b45; }
.chip.file-text { background: #f3f1ea; color: #5a4a2a; }

.file-name {
  font-size: 0.84rem;
  margin-top: 4px;
  word-break: break-all;
}
.doc-card .doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.doc-card .file-name { margin: 0 0 6px; }

.file-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  margin: 8px 0 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff, #eef3fa);
}
.file-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.file-icon.file-pdf { background: #fdecec; color: #8a2b2b; }
.file-icon.file-docx { background: #e8eef7; color: #123a6b; }
.file-icon.file-excel { background: #e8f6ee; color: #1b6b3a; }
.file-icon.file-csv { background: #eef8f1; color: #2a6a40; }
.file-icon.file-pptx { background: #fff0e8; color: #9a4a12; }
.file-icon.file-keynote { background: #eef7ff; color: #0d4a8a; }
.file-icon.file-image { background: #e6f4ec; color: #1f6b45; }
.file-icon.file-text { background: #f3f1ea; color: #5a4a2a; }
.file-info h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  word-break: break-all;
}
.file-info p { margin: 0; }
.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.file-preview {
  margin: 8px 0 24px;
  border: 1px solid #c5d3e4;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 0 0 7px #f3f6fb,
    0 0 0 8px #d7e1ee,
    0 16px 34px rgba(18, 58, 107, 0.06);
}
.file-preview-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  padding: 9px 16px 8px;
  background: linear-gradient(180deg, #f8fafc, #f1f5fa);
  border-bottom: 1px solid #e3ebf4;
}
.file-preview-kicker {
  font-family: "DM Sans", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a97aa;
}
.file-preview-caption strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.06em;
}
.file-preview-caption-note {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
}
.file-preview-unavailable {
  box-shadow:
    0 0 0 7px #f7f8fa,
    0 0 0 8px #e4e9f0,
    0 10px 24px rgba(18, 58, 107, 0.04);
}
.file-preview iframe {
  width: 100%;
  height: 420px;
  border: 0;
  display: block;
  background: #fff;
}
.file-preview img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
  background: #fff;
}
.file-preview-placeholder {
  padding: 18px 20px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}
.file-preview-note {
  margin: 0;
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--muted);
  background: #f5f8fc;
  border-bottom: 1px solid var(--border);
}
.docx-preview-body {
  padding: 20px 24px;
  min-height: 420px;
  max-height: 420px;
  overflow: auto;
  background: #fff;
  font-size: 1rem;
  line-height: 1.75;
}
.office-preview-body {
  padding: 20px 24px;
  min-height: 420px;
  max-height: 420px;
  overflow: auto;
  background: #fff;
}
.slide-deck-preview {
  display: grid;
  gap: 12px;
}
.slide-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
}
.slide-card h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--primary);
}
.slide-card p {
  margin: 0 0 0.5em;
  line-height: 1.65;
}
.slide-card-image {
  padding: 0;
  overflow: hidden;
}
.slide-card-image img {
  width: 100%;
  display: block;
  background: #fff;
}
.slide-card-image figcaption {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.88rem;
}
.docx-preview-body p {
  margin: 0 0 0.75em;
}
.docx-preview-body p:last-child {
  margin-bottom: 0;
}
.csv-preview-body {
  padding: 0;
}
.csv-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.csv-preview-table th,
.csv-preview-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.csv-preview-table th {
  background: #f5f8fc;
  font-weight: 700;
  white-space: nowrap;
}
.csv-preview-table tr:last-child td {
  border-bottom: 0;
}
.text-preview-body {
  padding: 20px 24px;
}
.text-preview-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "IBM Plex Sans JP", ui-monospace, monospace;
  font-size: 0.95rem;
  line-height: 1.75;
}

.memo-box h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--muted);
}

.table-wrap { overflow-x: auto; }
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}
.doc-table th,
.doc-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.doc-table th {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}
.doc-table tbody tr { cursor: pointer; }
.doc-table tbody tr:hover { background: #f5f8fc; }
.doc-table .title-cell { font-weight: 700; color: var(--primary); }

.filter-row {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-title {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 1.15rem + 1vw, 1.85rem);
  line-height: 1.3;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin: 12px 0 18px;
  font-size: 0.95rem;
}
.detail-grid dt { color: var(--muted); font-weight: 700; font-size: 0.8rem; }
.detail-grid dd { margin: 0 0 8px; }
.body-box {
  background: #fbfcfe;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  font-size: 1.12rem;
  line-height: 1.85;
  white-space: pre-wrap;
}
.photo-block { margin-top: 18px; }
.photo-block h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.photo-grid figure { margin: 0; }
.photo-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  position: relative;
  text-align: left;
}
.photo-open img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: block;
}
.file-preview-image .photo-open img {
  height: auto;
  max-height: 420px;
  object-fit: contain;
}
.photo-open-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 35, 58, 0.72);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  pointer-events: none;
}
.photo-grid figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}
.slide-card-image .photo-open {
  width: 100%;
}
.slide-card-image.pptx-thumb img {
  max-height: 360px;
  object-fit: contain;
}

.kn-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.kn-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 35, 0.82);
}
.kn-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 1100px);
  max-height: calc(100vh - 40px);
  display: grid;
  gap: 12px;
  justify-items: center;
}
.kn-lightbox-panel figure {
  margin: 0;
  width: 100%;
  display: grid;
  gap: 10px;
  justify-items: center;
}
.kn-lightbox-panel img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}
.kn-lightbox-panel figcaption {
  color: #eef3fa;
  font-size: 0.92rem;
  text-align: center;
}
.kn-lightbox-close {
  justify-self: end;
  background: rgba(255, 255, 255, 0.95);
}
body.kn-lightbox-open {
  overflow: hidden;
}

.preview-focus-bar {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1100;
}
body.is-focus-preview .preview-focus-bar .btn {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 0.92rem; }
.req { color: #a33; font-size: 0.82rem; }
.field textarea { min-height: 220px; resize: vertical; }
.form-error {
  background: #fdecec;
  color: #8a2b2b;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.replace-box {
  border: 1px solid #c9d7e6;
  background: #f6f9fc;
  border-radius: 14px;
  padding: 14px 16px;
  gap: 8px;
}
.replace-box strong { font-size: 0.95rem; }
.replace-current {
  margin: 0;
  font-size: 0.9rem;
  color: #123a6b;
}
.replace-missing,
.replace-status.is-error {
  margin: 0;
  font-size: 0.9rem;
  color: #8a2b2b;
}
.replace-status {
  margin: 0;
  font-size: 0.9rem;
  color: #1f6b45;
}
.file-pick {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
}
.file-pick input[type="file"] {
  padding: 8px 0;
}
.replace-hint {
  margin: 0 0 12px;
}

body.is-focus-preview .app-header,
body.is-focus-preview .role-bar,
body.is-focus-preview .note-banner,
body.is-focus-preview .policy-banner,
body.is-focus-preview .app-footer,
body.is-focus-preview .detail-grid,
body.is-focus-preview .pane-head,
body.is-focus-preview .detail-nav,
body.is-focus-preview .file-hero,
body.is-focus-preview .replace-hint,
body.is-focus-preview .memo-box,
body.is-focus-preview .photo-block,
body.is-focus-preview .actions {
  display: none;
}
body.is-focus-preview .app { max-width: none; padding: 12px; }
body.is-focus-preview #detailPane {
  min-height: calc(100vh - 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1724;
  border: none;
  box-shadow: none;
}
body.is-focus-preview .file-preview {
  border: none;
  margin: 0;
  width: 100%;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
body.is-focus-preview .file-preview-caption {
  display: none;
}
body.is-focus-preview .file-preview iframe,
body.is-focus-preview .office-preview-body,
body.is-focus-preview .docx-preview-body,
body.is-focus-preview .csv-preview-body,
body.is-focus-preview .text-preview-body {
  width: min(96vw, 1200px);
  height: calc(100vh - 80px);
  max-height: none;
}
body.is-focus-preview .file-preview-image .photo-open {
  cursor: default;
  width: auto;
  max-width: min(96vw, 1200px);
}
body.is-focus-preview .file-preview-image .photo-open img {
  max-width: min(96vw, 1200px);
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  border: none;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}
body.is-focus-preview .photo-open-hint {
  display: none;
}
body.is-focus-preview .file-preview-office .file-preview-note {
  display: none;
}
body.is-focus-preview .office-preview-body,
body.is-focus-preview .docx-preview-body,
body.is-focus-preview .csv-preview-body,
body.is-focus-preview .text-preview-body {
  min-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px 32px;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 2px 0;
}

.print-head { display: none; }
.empty {
  color: var(--muted);
  padding: 18px 4px;
}

@media (max-width: 900px) {
  .app-header,
  .brand,
  .cat-grid,
  .filter-row,
  .form-grid,
  .detail-grid,
  .search-row,
  .ai-ask-row,
  .header-meta,
  .file-hero,
  .role-bar {
    grid-template-columns: 1fr;
  }
  .header-meta { grid-template-columns: 1fr 1fr; }
  .brand-illust { width: 160px; }
  .file-actions { justify-content: flex-start; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .file-preview {
    box-shadow:
      0 0 0 5px #f3f6fb,
      0 0 0 6px #d7e1ee,
      0 12px 28px rgba(18, 58, 107, 0.06);
  }
  .file-preview-caption-note {
    margin-left: 0;
    width: 100%;
  }
}

@media print {
  body { background: #fff; }
  .no-print,
  .actions,
  .app-footer,
  .note-banner,
  .policy-banner,
  .role-bar,
  .app-header {
    display: none !important;
  }
  .print-head { display: block; margin-bottom: 16px; }
  .print-head h1 { margin: 0 0 8px; font-size: 1.6rem; }
  .app, .pane {
    box-shadow: none;
    border: none;
    max-width: none;
    padding: 0;
  }
  .body-box {
    border: none;
    padding: 0;
    font-size: 12pt;
  }
}
