:root {
  color-scheme: light;
  --bg: #f7f8f4; --panel: #fffefa; --ink: #2c3930; --muted: #65715f;
  --line: #dfe5db; --soft-line: #edf0e9; --green: #345941; --green-soft: #e7eee1;
  --blue: #436753; --blue-soft: #eef3ea; --amber: #8a7045; --amber-soft: #f7f0e3;
  --danger: #a04f3e; --danger-soft: #fbefea; --shadow: 0 8px 32px #354b3210;
  --header-height: 76px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.65 "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button { background: transparent; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, input, select, textarea, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #6e9163; outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: #dfead5; }
.stock-svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.stock-icon { fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: 0 0 auto; }
.stock-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.stock-skip { position: fixed; left: 16px; top: -70px; z-index: 100; background: var(--green); color: #fff; padding: 12px 20px; border-radius: 8px; }
.stock-skip:focus { top: 8px; }
.stock-header { height: var(--header-height); flex-shrink: 0; display: flex; align-items: center; gap: 36px; padding: 0 28px; background: #fdfdf9; border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.stock-brand { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.stock-brand-mark { display: grid; place-items: center; width: 37px; height: 40px; color: #fff; background: var(--green); border-radius: 10px 10px 10px 3px; }
.stock-brand-mark .stock-icon { width: 24px; height: 24px; }
.stock-brand strong { display: block; font-size: 24px; font-weight: 550; letter-spacing: -.8px; line-height: 1.15; }
.stock-brand strong span { color: #8b9e80; }
.stock-brand small { display: block; font-size: 10px; color: var(--muted); margin-top: 5px; letter-spacing: .04em; }
.stock-nav { display: flex; align-items: stretch; height: 100%; gap: 26px; font-size: 12px; color: var(--muted); }
.stock-nav a { display: flex; align-items: center; position: relative; white-space: nowrap; }
.stock-nav a:hover, .stock-nav a.active { color: var(--green); }
.stock-nav a.active:after { content: ""; height: 2px; background: #6c865d; position: absolute; bottom: 0; left: 0; right: 0; }
.stock-header-actions { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.stock-preview-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; padding: 10px 28px; background: #eaf0e2; border-bottom: 1px solid var(--line); color: var(--green); font-size: 12px; }
.stock-preview-banner > span { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.stock-preview-banner a { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
@media (max-width: 600px) { .stock-preview-banner { padding: 9px 16px; font-size: 11px; } }
@media print { .stock-preview-banner { display: none; } }
.button, .stock-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 7px; background: #fffefa; font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.button:hover, .stock-button:hover { background: #f0f4eb; }
.button.primary, .stock-button.primary { color: #fff; background: var(--green); border-color: var(--green); }
.button.primary:hover, .stock-button.primary:hover { background: #294c35; }
.button.danger { color: var(--danger); background: #fffaf8; border-color: #e6c9bf; }
.button.small { min-height: 30px; padding: 3px 10px; }
.stock-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 7px; border: 0; border-radius: 6px; color: #6e7d6d; flex-shrink: 0; }
.stock-icon-button:hover { background: var(--green-soft); color: var(--green); }
.stock-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e7eadf; color: #5c6d52; font-size: 12px; }
.stock-menu { position: relative; }
.stock-menu summary { list-style: none; }
.stock-menu summary::-webkit-details-marker { display: none; }
.stock-account summary { display: flex; gap: 8px; align-items: center; }
.stock-account summary > .stock-icon { width: 13px; height: 13px; }
.stock-menu-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 205px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffefa; box-shadow: 0 12px 36px #29372b1a; z-index: 50; }
.stock-menu-panel p { margin: 2px 7px 6px; }
.stock-menu-panel button, .stock-menu-panel > a { display: block; border: 0; padding: 9px 8px; width: 100%; text-align: left; border-radius: 5px; font-size: 12px; }
.stock-menu-panel button:hover, .stock-menu-panel > a:hover { background: var(--bg); }
.stock-menu-panel .danger { color: var(--danger); }
.stock-caption { color: var(--muted); font-size: 11px; }
.stock-account-name { font-weight: 600; }
.stock-content { width: min(1160px, calc(100% - 64px)); margin: 32px auto; }
.stock-messages { padding: 12px; }
.stock-message { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 12px 16px; }
.stock-message.success { background: var(--green-soft); }
.stock-message.error { background: var(--danger-soft); color: var(--danger); }
.stock-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; padding: 10px 20px; border-radius: 8px; box-shadow: var(--shadow); z-index: 80; font-size: 13px; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; color: var(--muted); }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.field label { display: block; color: #5b6a5a; font-size: 12px; font-weight: 500; margin-bottom: 7px; }
.field input:not([type="checkbox"]):not([type="color"]), .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fffefa; padding: 10px 12px; min-height: 40px; }
.field .helptext { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.stock-sharing-members { grid-column: 1 / -1; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #f5f8f0; }
.stock-sharing-members #id_members { max-height: 280px; overflow: auto; margin-top: 12px; }
.stock-sharing-members #id_members label { display: flex; align-items: center; gap: 9px; padding: 9px; margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.stock-sharing-members input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--green); }
.stock-member-heading h1 { font-size: 26px; font-weight: 500; margin: 0; }
.stock-member-heading p { color: var(--muted); margin-bottom: 28px; }
.stock-member-layout { display: grid; grid-template-columns: minmax(260px, 350px) minmax(0, 1fr); gap: 24px; }
.stock-member-panel { border: 1px solid var(--line); border-radius: 12px; padding: 24px; background: var(--panel); min-width: 0; }
.stock-member-panel h2 { font-size: 18px; font-weight: 500; margin: 0 0 22px; }
.stock-member-field { margin-bottom: 16px; }
.stock-member-field input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }
.stock-member-table { overflow-x: auto; }
.stock-member-table table { width: 100%; font-size: 12px; }
.stock-member-table small { display: block; color: var(--muted); margin-top: 5px; }
.stock-member-disable { margin-top: 8px; }
.errorlist { color: var(--danger); font-size: 12px; padding-left: 16px; }
@media (max-width: 900px) { .stock-member-layout { grid-template-columns: minmax(0, 1fr); } }
table { border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 12px; font-weight: 500; }
.table-wrap { overflow-x: auto; }
.empty-state { color: var(--muted); text-align: center; padding: 48px 24px; font-size: 13px; }
/* ライブラリは各列を独立してスクロールさせ、本文の読み位置を保つ。 */
.stock-workspace { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.stock-workspace .stock-content { width: 100%; margin: 0; flex: 1; min-height: 0; position: relative; }
.stock-workspace .stock-messages { position: absolute; top: 10px; right: 20px; z-index: 20; max-width: min(460px, 90%); }
.knowledge-shell { display: grid; grid-template-columns: 224px 320px minmax(0, 1fr); height: 100%; min-height: 0; }
.knowledge-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.knowledge-folder-pane { background: #f0f3eb; color: #586850; }
.knowledge-folder-intro { display: flex; align-items: center; gap: 10px; padding: 25px 20px 22px; }
.knowledge-folder-intro > .stock-icon { width: 24px; height: 24px; color: #6a805b; }
.knowledge-folder-intro strong { display: block; font-size: 12px; font-weight: 600; color: #3a4b35; }
.knowledge-folder-intro small { display: block; font-size: 10px; color: #8a9482; margin-top: 3px; }
.knowledge-collections { padding: 0 10px 20px; }
.knowledge-folder-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 20px; scrollbar-width: thin; scrollbar-color: #c8d2bf transparent; }
.knowledge-folder-label { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 10px; font-size: 10px; letter-spacing: .08em; color: #89917f; }
.knowledge-folder-label .stock-icon-button { width: 26px; height: 26px; }
.knowledge-folder-item, .knowledge-folder-parent { display: grid; grid-template-columns: 17px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px 10px; min-height: 38px; border-radius: 6px; margin: 2px 0; font-size: 12px; }
.knowledge-folder-item:hover, .knowledge-folder-parent:hover { background: #e7ecdf; }
.knowledge-folder-item.active, .knowledge-folder-parent.active { background: #dfe8d6; color: #345336; }
.knowledge-folder-item > .stock-icon { width: 17px; height: 17px; }
.knowledge-folder-parent { grid-template-columns: 14px minmax(0, 1fr) auto auto; gap: 5px; font-weight: 500; }
.knowledge-folder-parent-link { display: flex; align-items: center; gap: 8px; min-width: 0; }
.knowledge-folder-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.knowledge-folder-count { color: #8a9582; font-size: 10px; font-variant-numeric: tabular-nums; }
.knowledge-folder-mark { width: 13px; height: 10px; border: 1px solid #8a9c7e; border-radius: 2px; position: relative; flex-shrink: 0; }
.knowledge-folder-mark:before { content: ""; position: absolute; top: -3px; left: -1px; width: 7px; height: 3px; border: 1px solid #8a9c7e; border-bottom: none; border-radius: 2px 2px 0 0; }
.knowledge-folder-toggle, .knowledge-folder-child-add { display: grid; place-items: center; background: none; color: #859279; border: 0; width: 20px; height: 24px; padding: 0; font-size: 15px; }
.knowledge-folder-child-add { opacity: 0; }
.knowledge-folder-parent:hover .knowledge-folder-child-add, .knowledge-folder-child-add:focus-visible { opacity: 1; }
.knowledge-folder-caret { display: inline-block; transition: transform .15s; }
.knowledge-folder-section.is-open > .knowledge-folder-parent .knowledge-folder-caret { transform: rotate(90deg); }
.knowledge-folder-children { display: none; margin: 0 0 5px 10px; padding-left: 5px; border-left: 1px solid #d7dfce; }
.knowledge-folder-section.is-open > .knowledge-folder-children { display: block; }
.knowledge-folder-footer { padding: 15px 20px; border-top: 1px solid #e0e5d9; font-size: 10px; color: #8c9583; display: flex; gap: 7px; align-items: center; }
.knowledge-folder-footer .stock-icon { width: 14px; height: 14px; }
.knowledge-list-pane { background: #fafbf7; }
.knowledge-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 25px 22px 18px; }
.knowledge-eyebrow { display: block; color: #8a947f; font-size: 9px; letter-spacing: .16em; margin-bottom: 5px; }
.knowledge-list-heading h1 { font-size: 18px; font-weight: 600; line-height: 1.55; margin: 0; overflow-wrap: anywhere; }
.knowledge-search { margin: 0 20px 17px; display: flex; align-items: center; border: 1px solid var(--line); background: #fffefa; border-radius: 7px; padding: 0 7px 0 11px; gap: 5px; }
.knowledge-search:focus-within { border-color: #8da381; box-shadow: 0 0 0 2px #dfead680; }
.knowledge-search > .stock-icon { width: 16px; height: 16px; color: #93a086; }
.knowledge-search input { width: 100%; min-width: 0; min-height: 39px; border: 0; outline: 0; background: none; font-size: 12px; }
.knowledge-search input::placeholder { color: #98a08e; }
.knowledge-search button { width: 26px; height: 28px; border: 0; padding: 3px; border-radius: 4px; color: #9ba78f; }
.knowledge-search button:hover { color: var(--green); background: var(--green-soft); }
.knowledge-list-tools { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 22px 12px; font-size: 11px; color: #8b9583; border-bottom: 1px solid var(--line); }
.knowledge-list-tools strong { color: #607455; font-weight: 500; }
.knowledge-sort { display: flex; align-items: center; gap: 4px; }
.knowledge-sort select { max-width: 140px; border: 0; background: none; font-size: 10px; padding: 5px 0; cursor: pointer; }
.knowledge-sort button { border: 0; font-size: 10px; color: var(--green); }
.knowledge-note-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: #d4dccd transparent; }
.knowledge-note-card { display: block; padding: 16px 15px 14px; border: 1px solid transparent; border-bottom-color: #e8ecdf; border-radius: 6px; position: relative; }
.knowledge-note-card:hover { background: #f0f4e9; }
.knowledge-note-card.active { background: #ebf0e4; border-color: #dbe4ce; }
.knowledge-note-card.active:before { content: ""; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 3px; border-radius: 0 2px 2px 0; background: #6c875e; }
.knowledge-note-category { display: flex; align-items: center; gap: 5px; font-size: 9px; color: #8b9980; margin-bottom: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.knowledge-note-category .stock-icon { width: 12px; height: 12px; }
.knowledge-note-card strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14px; font-weight: 550; line-height: 1.6; overflow-wrap: anywhere; }
.knowledge-note-card p { margin: 7px 0 9px; font-size: 12px; line-height: 1.7; color: #66715f; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.knowledge-note-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #94a087; font-size: 9px; }
.knowledge-note-bottom .stock-icon { width: 11px; height: 11px; margin-right: 3px; }
.knowledge-pagination { display: flex; align-items: center; justify-content: space-between; padding: 10px 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; min-height: 47px; }
.knowledge-detail { border: 0; background: #fffefa; }
.knowledge-detail-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 59px; padding: 12px 26px; gap: 12px; border-bottom: 1px solid var(--soft-line); }
.knowledge-breadcrumb { display: flex; align-items: center; gap: 7px; min-width: 0; color: #92a088; font-size: 11px; }
.knowledge-breadcrumb span { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.knowledge-breadcrumb .stock-icon { width: 14px; height: 14px; }
.knowledge-detail-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.knowledge-edit-button { display: inline-flex; gap: 5px; align-items: center; border: 1px solid var(--line); border-radius: 5px; padding: 4px 10px; color: #64775b; font-size: 11px; }
.knowledge-edit-button .stock-icon { width: 13px; height: 13px; }
.knowledge-detail-scroll { overflow: auto; min-height: 0; flex: 1; scrollbar-width: thin; scrollbar-color: #d9dfd1 transparent; }
.knowledge-detail-main { width: min(100%, 920px); margin: auto; padding: 44px clamp(26px, 4vw, 64px) 60px; overflow-wrap: anywhere; }
.knowledge-note-kicker { display: flex; align-items: center; gap: 7px; color: #839475; font-size: 10px; margin-bottom: 16px; }
.knowledge-note-kicker .stock-icon { width: 14px; height: 14px; }
.knowledge-detail-main > h2 { margin: 0 0 20px; color: #30412f; font-size: clamp(23px, 2.2vw, 32px); line-height: 1.6; font-weight: 550; letter-spacing: -.035em; }
.knowledge-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px; color: #929a89; font-size: 10px; }
.knowledge-meta .stock-icon { width: 13px; height: 13px; margin-right: 3px; }
.knowledge-document-meta { padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.knowledge-body { color: #46513f; font-size: 14px; line-height: 2.05; word-break: normal; overflow-wrap: anywhere; }
.knowledge-body p { margin: .75em 0 1.15em; }
.knowledge-rich-body h2 { font-size: 20px; font-weight: 600; line-height: 1.65; color: #385032; padding-bottom: 8px; border-bottom: 1px solid var(--soft-line); margin: 1.9em 0 .75em; }
.knowledge-rich-body h3 { font-size: 16px; font-weight: 600; margin: 1.6em 0 .5em; }
.knowledge-rich-body ul, .knowledge-rich-body ol { padding-left: 1.6em; }
.knowledge-rich-body li { margin: .35em 0; }
.knowledge-rich-body blockquote { background: #f2f5ec; color: #65735a; margin: 20px 0; padding: 14px 20px; border-left: 3px solid #9bb18a; border-radius: 0 6px 6px 0; }
.knowledge-rich-body a { color: #597849; text-decoration: underline; text-underline-offset: 3px; }
.knowledge-rich-body pre { padding: 20px; background: #f3f5ef; border-radius: 6px; white-space: pre-wrap; }
.knowledge-rich-body table { width: 100%; table-layout: fixed; margin: 20px 0; font-size: 12px; }
.knowledge-rich-body td, .knowledge-rich-body th { border: 1px solid var(--line); padding: 10px 14px; vertical-align: top; }
.knowledge-rich-body th { background: #f3f6ed; }
.knowledge-rich-body img { max-width: 100%; height: auto; }
.knowledge-rich-body .text-small { font-size: 12px; }
.knowledge-rich-body .text-large { font-size: 18px; }
.knowledge-rich-body .text-xlarge { font-size: 22px; }
.knowledge-rich-body .text-color-black { color: #111827; }
.knowledge-rich-body mark { background: #f4edb6; color: inherit; }
.knowledge-inline-image { margin: 24px 0; max-width: 100%; }
.knowledge-inline-image img, .knowledge-image-card img { max-height: 500px; object-fit: contain; border: 1px solid var(--line); border-radius: 7px; background: #f7f8f3; }
.knowledge-inline-image figcaption, .knowledge-image-card figcaption { font-size: 10px; color: var(--muted); margin-top: 5px; }
.knowledge-attachments { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.knowledge-attachments > h3 { margin: 0 0 16px; font-size: 12px; color: #79876c; font-weight: 500; }
.knowledge-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.knowledge-image-card { margin: 0; min-width: 0; }
.knowledge-image-card img { width: 100%; height: 150px; }
.knowledge-file-list { display: grid; gap: 8px; margin-top: 16px; }
.knowledge-file-link { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: #66785c; }
.knowledge-file-link span:first-child { min-width: 0; overflow-wrap: anywhere; }
.knowledge-file-link span:last-child { white-space: nowrap; font-size: 10px; color: var(--muted); }
.knowledge-reading-footer { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 52px; color: #a8b09e; font-size: 10px; }
.knowledge-reading-footer:before, .knowledge-reading-footer:after { content: ""; height: 1px; width: 28px; background: var(--line); }
/* 小さな補助文字も読み取れる濃度を保つ。 */
.knowledge-note-category, .knowledge-note-bottom, .knowledge-folder-count,
.knowledge-meta, .knowledge-list-tools, .knowledge-breadcrumb, .knowledge-folder-label,
.knowledge-folder-footer, .knowledge-note-kicker, .knowledge-eyebrow { color: var(--muted); }
.knowledge-note-category, .knowledge-note-bottom, .knowledge-meta, .knowledge-sort select { font-size: 11px; }
.knowledge-search input::placeholder { color: #707a68; }
.knowledge-empty { display: flex; flex: 1; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px; padding: 48px 24px; color: #8c987f; }
.knowledge-empty > .stock-icon { width: 42px; height: 42px; stroke-width: 1; color: #a5b298; margin-bottom: 10px; }
.knowledge-empty h2 { font-size: 18px; font-weight: 500; margin: 0; color: #627556; }
.knowledge-empty p { font-size: 12px; line-height: 1.9; max-width: 260px; margin: 0 0 8px; }
.knowledge-filter-note { margin: -4px 22px 12px; font-size: 10px; color: var(--amber); }
.knowledge-filter-note a { text-decoration: underline; }
.knowledge-shell.is-focused { grid-template-columns: minmax(0, 1fr); }
.knowledge-shell.is-focused > .knowledge-folder-pane, .knowledge-shell.is-focused > .knowledge-list-pane { display: none; }
.knowledge-shell.is-focused .knowledge-detail { background: #f7f8f2; }
.knowledge-shell.is-focused .knowledge-detail-main { background: #fffefa; min-height: 100%; padding-left: 72px; padding-right: 72px; }
.stock-mobile-only, .stock-drawer-trigger, .stock-drawer-close, .knowledge-drawer-backdrop { display: none; }
/* 編集画面も同じ用紙と余白にそろえ、既存エディターの機能は保つ。 */
.stock-app .knowledge-form-panel { margin: 0 auto; border-radius: 12px; border-color: var(--line); box-shadow: none; max-width: 1040px; }
.stock-app .knowledge-form-header { background: #f1f5eb; padding: 22px 30px; align-items: center; }
.stock-app .knowledge-form-header h2 { font-size: 18px; font-weight: 500; }
.stock-app .knowledge-form-body { padding: 28px 32px; gap: 22px; }
.stock-app .knowledge-editor-shell { border-color: var(--line); border-radius: 8px; background: #fffefa; }
.stock-app .knowledge-rich-editor { padding: 30px; background: #fffefa; line-height: 1.95; }
.stock-app .knowledge-editor-toolbar, .stock-app .knowledge-editor-subtoolbar { background: #f4f6ef; border-color: var(--line); gap: 4px; padding: 9px; }
.stock-app .knowledge-tool-button, .stock-app .knowledge-tool-select, .stock-app .knowledge-tool-label { font-weight: 500; color: #506348; border-color: #e0e6d8; border-radius: 4px; background: #fffefa; }
.stock-app .field .knowledge-tool-select { width: auto; min-height: 34px; padding: 5px 9px; }
.stock-app .field .knowledge-tool-label { display: inline-flex; margin: 0; }
.stock-app .knowledge-subtool-text, .stock-app [data-editor-command="createLink"], .stock-app [data-editor-command="insertDriveLink"], .stock-app [data-upload-trigger] { padding-left: 10px; padding-right: 10px; }
.knowledge-detail-main > h2 { text-wrap: balance; }
.stock-app .knowledge-form-actions { padding-top: 6px; }
.stock-app .knowledge-danger-zone { border-color: #ecd8cf; background: #fcf5f0; }
@media (max-width: 1200px) {
  .knowledge-shell { grid-template-columns: 206px 290px minmax(0, 1fr); }
  .stock-header { padding: 0 22px; gap: 28px; }
  .knowledge-detail-main { padding: 34px 32px 48px; }
  .knowledge-detail-toolbar { padding: 12px 20px; }
}
@media (max-width: 1040px) {
  .knowledge-shell { grid-template-columns: 300px minmax(0, 1fr); }
  .knowledge-folder-pane { display: none; }
  .stock-drawer-trigger, .stock-drawer-close { display: inline-flex; }
  .knowledge-list-heading { padding-left: 14px; gap: 7px; }
  .knowledge-list-heading > div { flex: 1; min-width: 0; }
  .stock-drawer-close { margin-left: auto; }
  .knowledge-shell.folder-drawer-open > .knowledge-folder-pane { display: flex; position: fixed; z-index: 60; width: 280px; left: 0; top: 0; height: 100vh; height: 100dvh; box-shadow: 10px 0 50px #24332026; }
  .knowledge-shell.folder-drawer-open > .knowledge-drawer-backdrop { display: block; position: fixed; inset: 0; background: #27372145; border: 0; z-index: 55; }
  .knowledge-folder-child-add { opacity: 1; }
}
@media (max-width: 760px) {
  :root { --header-height: 66px; }
  .stock-header { padding: 0 16px; gap: 12px; }
  .stock-brand { min-width: 0; gap: 8px; }
  .stock-brand strong { font-size: 21px; }
  .stock-brand small, .stock-nav, .stock-header-actions .stock-button > span { display: none; }
  .stock-brand-mark { width: 31px; height: 34px; border-radius: 8px 8px 8px 3px; }
  .stock-header-actions { gap: 14px; }
  .stock-header-actions .stock-button { padding: 7px 9px; min-height: 34px; }
  .stock-content { width: calc(100% - 24px); margin: 16px auto; }
  .knowledge-shell { grid-template-columns: minmax(0, 1fr); }
  .knowledge-shell > .knowledge-detail { display: none; }
  .knowledge-shell[data-mobile-view="note"] > .knowledge-list-pane { display: none; }
  .knowledge-shell[data-mobile-view="note"] > .knowledge-detail { display: flex; }
  .knowledge-list-heading { padding-top: 20px; }
  .knowledge-note-card { padding: 18px 16px; }
  .knowledge-note-card strong { font-size: 14px; }
  .knowledge-note-card p { font-size: 12px; }
  .knowledge-search input { font-size: 16px; }
  .knowledge-search input::placeholder { font-size: 12px; }
  .stock-mobile-only { display: inline-flex; }
  .knowledge-detail-toolbar { padding: 9px 14px; }
  .knowledge-detail-main { padding: 27px 24px 42px; }
  .knowledge-detail-main > h2 { font-size: 23px; }
  .knowledge-detail-actions { gap: 4px; }
  [data-reading-toggle] { display: none; }
  .knowledge-detail-toolbar .knowledge-breadcrumb { max-width: 45%; }
  .knowledge-shell.is-focused > .knowledge-list-pane { display: flex; }
  .knowledge-shell.is-focused[data-mobile-view="note"] > .knowledge-list-pane { display: none; }
  .knowledge-shell.is-focused .knowledge-detail-main { padding-left: 24px; padding-right: 24px; }
  .stock-app .knowledge-form-body { padding: 20px 16px; }
  .stock-app .knowledge-form-header { padding: 18px 16px; }
  .stock-app .knowledge-rich-editor { padding: 18px; }
  .stock-menu-panel { max-width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print {
  .stock-header, .knowledge-folder-pane, .knowledge-list-pane, .knowledge-detail-toolbar, .knowledge-reading-footer, .stock-toast { display: none !important; }
  body.stock-workspace { height: auto; overflow: visible; }
  .stock-workspace .stock-content, .knowledge-shell { display: block; height: auto; }
  .knowledge-shell > .knowledge-detail { display: block !important; }
  .knowledge-detail-scroll { overflow: visible; }
  .knowledge-detail-main { padding: 0; width: 100%; }
}

/* 下書き・公開・履歴 */
.stock-publication-status{display:flex;flex-direction:column;gap:5px;padding:15px 18px;background:#eef3ef;border:1px solid #d5e1d8;border-radius:12px;color:#314b3c;font-size:13px;line-height:1.7;margin-bottom:18px}
.stock-publication-badge{display:inline-block;padding:3px 8px;border-radius:6px;background:#eef3ef;color:#355641;font-size:11px;margin:3px 0}
.stock-history-layout{display:grid;grid-template-columns:290px minmax(0,1fr);gap:24px;max-width:1280px;margin:0 auto;padding:0 24px 40px}
.stock-history-list{display:flex;flex-direction:column;gap:9px}.stock-history-item{display:flex;flex-direction:column;gap:6px;padding:15px;border:1px solid #dde4de;border-radius:12px;text-decoration:none;color:#344c3e;background:#fff}.stock-history-item span,.stock-history-item small{font-size:12px}.stock-history-item.active{background:#eaf2ec;border-color:#6b8b76}
.stock-history-content{background:#fff;border:1px solid #e2e7e2;border-radius:16px;padding:28px;min-width:0;overflow-wrap:anywhere}.stock-history-content img{max-width:100%;height:auto}.stock-history-content table{max-width:100%;display:block;overflow:auto}.stock-history-content pre{white-space:pre-wrap}.stock-history-restore{border-top:1px solid #e5e8e3;margin-top:24px;padding-top:22px}.stock-history-paging{display:flex;justify-content:space-between;padding:12px;font-size:13px}
@media(max-width:760px){.stock-history-layout{grid-template-columns:1fr;padding:0 12px 24px}.stock-history-content{padding:18px}.stock-history-list{max-height:220px;overflow:auto}.knowledge-form-actions{flex-wrap:wrap}}
