.guide-editor-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 140px 0 60px; }
.guide-editor-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.guide-editor-heading h1 { font-size: 38px; margin: 12px 0; }
.guide-editor-heading p, .editor-help { color: var(--muted); font-size: 13px; line-height: 1.8; }
.editor-message { padding: 14px 18px; background: #fff; border-left: 4px solid var(--purple); overflow-wrap: anywhere; }
.editor-toolbar { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; padding: 20px; background: #fff; margin: 20px 0; }
.editor-toolbar label { flex: 1; min-width: 160px; }
.guide-editor-shell label, .category-dialog label { display: grid; gap: 8px; font-size: 13px; font-weight: 800; margin: 12px 0; }
.guide-editor-shell input, .guide-editor-shell select, .guide-editor-shell textarea, .category-dialog input { width: 100%; padding: 12px; border: 1px solid var(--line); background: #fbf9fd; color: var(--ink); font: inherit; }
.guide-editor-shell textarea { resize: vertical; line-height: 1.7; }
.guide-editor-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.editor-sidebar, .editor-workspace { padding: 24px; background: #fff; min-width: 0; }
.editor-list-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.editor-list-heading h2 { font-size: 18px; }
.editor-sidebar button { border: 0; padding: 9px; background: #f3e8ff; color: var(--purple); cursor: pointer; font: inherit; font-size: 12px; }
.editor-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.editor-category-row { margin-inline-start: min(calc(var(--category-depth, 0) * 12px), 72px); }
.editor-category-row .editor-row-actions { flex-wrap: wrap; }
.editor-category-row .editor-category-toggle { flex: 0 0 26px; padding: 9px 0; background: transparent; }
.editor-row-main { display: flex; align-items: stretch; min-width: 0; background: #f3e8ff; }
.editor-row-main .editor-row-title { flex: 1 1 auto; min-width: 0; text-align: left; overflow-wrap: anywhere; background: transparent; }
.editor-row-move { display: flex; flex: 0 0 auto; }
.editor-row-move button { width: 26px; padding: 9px 0; border-left: 1px solid rgba(109, 40, 217, .18); background: transparent; }
.editor-row.active .editor-row-main { background: var(--purple); }
.editor-row.active .editor-row-main button { color: #fff; }
.editor-row-move button:hover:not(:disabled) { background: rgba(109, 40, 217, .12); }
.editor-row.active .editor-row-move button { border-left-color: rgba(255, 255, 255, .3); }
.editor-row.active .editor-row-move button:hover:not(:disabled) { background: rgba(255, 255, 255, .18); }
.editor-row-actions { display: flex; gap: 6px; margin-top: 8px; }
.editor-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor-page-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.editor-preview { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.editor-preview-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; }
.editor-preview h2, [data-preview-category] { overflow-wrap: anywhere; }
.editor-block-heading { margin-top: 28px; }
.editor-block-heading h3 { margin: 0; font-size: 19px; }
.editor-block-heading p { margin: 5px 0 15px; color: var(--muted); font-size: 12px; }
.editor-document { border: 1px solid var(--line); background: #fff; min-height: 230px; padding: 12px 22px; }
.editor-document:focus { outline: 2px solid var(--purple); outline-offset: 2px; }
.editor-document:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.editor-prose-text, .editor-prose-heading { min-height: 1.5em; margin: 0; padding: 5px 0; outline: none; overflow-wrap: anywhere; white-space: pre-wrap; }
.editor-prose-text { font-size: 16px; line-height: 1.9; }
.editor-prose-heading { margin-top: 12px; font-size: 22px; line-height: 1.5; font-weight: 800; }
.editor-document > .editor-block { margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.editor-document > .editor-block-image { background: #fcfaff; }
.editor-block { margin: 0; padding: 14px 0 20px; border-bottom: 1px solid var(--line); background: #fff; }
.editor-block:last-child { border-bottom: 0; }
.editor-block header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.editor-block header div { display: flex; gap: 5px; }
.editor-block header button, .editor-block-toolbar button { border: 1px solid var(--line); padding: 8px 12px; color: var(--purple); background: #fff; cursor: pointer; font: inherit; font-size: 12px; font-weight: 800; }
.editor-block header button:hover { border-color: var(--purple); background: #f3e8ff; }
.editor-block-text label, .editor-block-heading label { margin: 0; }
.editor-block-text textarea, .editor-block-heading input[data-block-field="text"] { border: 0; background: #fff; padding: 8px 2px; }
.editor-block-text textarea { display: block; min-height: 132px; resize: none; line-height: 1.9; font-size: 16px; overflow: hidden; }
.editor-block-heading input[data-block-field="text"] { font-size: 22px; font-weight: 800; }
.editor-block-text textarea:focus, .editor-block-heading input[data-block-field="text"]:focus { outline: 2px solid var(--purple); outline-offset: 2px; }
.editor-block-image, .editor-block-columns, .editor-block-callout, .editor-block-button { background: #fcfaff; padding-left: 14px; padding-right: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.editor-upload-preview { display: block; max-width: min(100%, 380px); max-height: 240px; object-fit: contain; margin: 12px 0; }
.editor-preview [data-preview-blocks] { padding: 25px; background: #fbf9fd; }
.category-dialog { width: min(520px, calc(100% - 32px)); border: 0; padding: 30px; color: var(--ink); }
.category-dialog::backdrop { background: rgba(20, 10, 40, .6); }
.guide-editor-shell button:disabled { opacity: .4; cursor: not-allowed; }
.guide-editor-shell .button-primary:hover { background: #9333ea; color: #fff; }
.guide-editor-shell .button, .category-dialog .button { border: 0; cursor: pointer; }
.guide-editor-shell .button-secondary, .category-dialog .button-secondary { color: var(--purple); background: #f3e8ff; }
.editor-workspace { background: #f5f1fa; }
[data-page-editor] { max-width: 860px; margin: 0 auto; }
.editor-document { min-height: 520px; padding: 46px min(8%, 64px); border: 1px solid #ded7e8; box-shadow: 0 10px 24px #26143d0d; }
.editor-prose-text { min-height: 1.9em; }
.editor-document > .editor-prose-text:only-child[data-empty="true"]::before { content: "ここに文章を入力"; color: #a79aaf; pointer-events: none; }
.editor-prose-heading[data-empty="true"]::before { content: "見出しを入力"; color: #a79aaf; pointer-events: none; }
.editor-prose-heading { margin-top: 22px; }
.editor-document > .editor-block-image { box-sizing: border-box; position: relative; width: 100%; margin: 24px auto; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: center; }
.editor-document > .editor-block-image.guide-image-medium { width: 72%; }
.editor-document > .editor-block-image.guide-image-small { width: 42%; }
.editor-block-image .editor-upload-preview { display: block; width: 100%; max-width: 100%; max-height: 520px; margin: 0 auto; object-fit: contain; }
.editor-block-image figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }
.editor-image-placeholder { width: 100%; min-height: 180px; border: 2px dashed #cdb5e5; border-radius: 8px; background: #fbf8ff; color: var(--purple); font: inherit; font-weight: 800; cursor: pointer; }
.editor-image-actions { display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; margin: 10px 0 0; opacity: .72; transition: opacity .15s; }
.editor-block-image:hover .editor-image-actions, .editor-block-image:focus-within .editor-image-actions { opacity: 1; }
.editor-image-actions button { border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px; background: #fff; color: var(--purple); font: inherit; font-size: 12px; cursor: pointer; }
.editor-preview { max-width: 860px; margin: 20px auto 0; border: 0; padding: 0; }
.editor-preview summary { cursor: pointer; color: var(--purple); font-weight: 800; }
.editor-preview[open] { padding: 20px; background: #fff; }
.editor-image-dialog { max-width: 480px; }
@media (max-width: 800px) { .editor-document { min-height: 380px; padding: 24px; } .editor-image-actions { opacity: 1; } .editor-document > .editor-block-image.guide-image-small { width: 70%; } }
@media (max-width: 800px) { .guide-editor-layout { grid-template-columns: 1fr; } .guide-editor-heading { align-items: start; flex-direction: column; } .editor-field-grid { grid-template-columns: 1fr; } .guide-editor-shell { padding-top: 110px; } }
.guide-editor-layout { grid-template-columns: 210px minmax(0, 1fr) 250px; gap: 16px; }
.editor-sidebar, .editor-inspector { background: #fff; padding: 18px; min-width: 0; }
.editor-inspector { align-self: start; position: sticky; top: 24px; border: 1px solid var(--line); }
.editor-inspector h2 { margin: 0 0 16px; font-size: 17px; }
.editor-inspector-type { font-weight: 800; color: var(--purple); border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.editor-inspector label { display: grid; gap: 7px; margin: 14px 0; font-size: 12px; font-weight: 800; }
.editor-inspector input, .editor-inspector textarea, .editor-inspector select { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; }
.editor-inspector-action { width: 100%; padding: 10px; border: 1px solid var(--purple); background: #fff; color: var(--purple); cursor: pointer; }
.editor-selection-toolbar[hidden] { display: none; }
.editor-selection-toolbar { display: flex; align-items: center; gap: 5px; padding: 8px 12px; border: 1px solid var(--line); border-top: 0; background: #faf7fe; }
.editor-selection-toolbar strong { font-size: 12px; color: var(--purple); }
.editor-selection-toolbar span { flex: 1; }
.editor-selection-toolbar button { padding: 6px 10px; border: 1px solid var(--line); background: #fff; color: var(--purple); cursor: pointer; }
.editor-document > [data-block-index] { position: relative; }
.editor-document > [data-block-index]:hover, .editor-document > [data-block-index].is-selected { outline: 2px solid #d8b6f2; outline-offset: 5px; }
.editor-document > [data-block-index].is-selected { outline-color: #a669dc; }
.editor-document > [data-block-index].is-dragging { opacity: .45; }
.editor-block-drag { position: absolute; left: -42px; top: 4px; z-index: 2; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #d8c6e8; border-radius: 6px; background: #fff; color: var(--purple); cursor: grab; opacity: .45; touch-action: none; }
.editor-block-drag::before { content: "⠿"; font-size: 20px; line-height: 1; }
.editor-document > [data-block-index]:hover .editor-block-drag, .editor-document > [data-block-index].is-selected .editor-block-drag, .editor-block-drag:focus-visible { opacity: 1; }
.editor-block-drag:active { cursor: grabbing; }
.editor-document > .editor-block-image[draggable="true"] { cursor: grab; }
.editor-document > .editor-block-image[draggable="true"]:active { cursor: grabbing; }
.editor-document > .editor-block-columns, .editor-document > .editor-block-callout, .editor-document > .editor-block-button { margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.editor-visual-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.editor-visual-columns p { margin: 0; padding: 12px; background: #f7f3fb; white-space: pre-wrap; overflow-wrap: anywhere; }
.editor-block-callout p { margin: 5px 0; white-space: pre-wrap; }
.editor-document > .editor-block-button { border: 0; padding: 0; background: transparent; }
.editor-block-button span { display: inline-block; padding: 10px 16px; border-radius: 4px; background: var(--purple); color: #fff; }
@media (max-width: 1100px) { .guide-editor-layout { grid-template-columns: 220px minmax(0, 1fr); } .editor-inspector { grid-column: 2; position: static; } }
@media (max-width: 800px) { .guide-editor-layout { grid-template-columns: 1fr; } .editor-inspector { grid-column: 1; } }
.editor-document > .editor-block-list { margin: 18px 0; padding: 8px 8px 8px 38px; border: 0; background: transparent; line-height: 1.9; }
.editor-block-list li { min-height: 1.7em; padding-left: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.editor-block-list li:focus { outline: none; }
.editor-document > .editor-block-table { margin: 20px 0; padding: 12px; border: 1px solid var(--line); background: #fff; }
.editor-table-scroll { max-width: 100%; overflow-x: auto; }
.editor-block-table table { width: 100%; min-width: 360px; border-collapse: collapse; }
.editor-block-table th, .editor-block-table td { border: 1px solid var(--line); padding: 0; }
.editor-block-table th { background: #f3e8ff; }
.editor-block-table input { display: block; width: 100%; min-width: 100px; padding: 10px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13px; }
.editor-block-table input:focus { outline: 2px solid var(--purple); outline-offset: -2px; }
.editor-table-head { display: flex; align-items: stretch; }
.editor-table-head input { min-width: 80px; font-weight: 800; }
.editor-block-table button { border: 0; background: transparent; color: var(--purple); cursor: pointer; }
.editor-block-table button:hover:not(:disabled) { background: #f3e8ff; }
.editor-table-actions { width: 30px; text-align: center; }
.editor-table-actions button { width: 30px; height: 37px; }
.editor-table-controls { display: flex; gap: 8px; margin-top: 10px; }
.editor-table-controls button { padding: 7px 10px; border: 1px solid var(--line); }
.editor-document > [data-block-index].drop-before { box-shadow: 0 -4px 0 var(--purple); }
.editor-document > [data-block-index].drop-after { box-shadow: 0 4px 0 var(--purple); }
@media (max-width: 800px) { .editor-block-drag { left: -22px; width: 26px; height: 30px; } }
.editor-context-menu { position: fixed; z-index: 1000; display: grid; width: 210px; max-height: calc(100vh - 16px); overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 16px 40px #26143d35; }
.editor-context-menu[hidden] { display: none; }
.editor-context-menu button { border: 0; border-radius: 4px; padding: 10px 12px; background: #fff; color: var(--ink); text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
.editor-context-menu button:hover, .editor-context-menu button:focus { background: #f3e8ff; color: var(--purple); }
.editor-context-menu [data-context-delete] { margin-top: 6px; border-top: 1px solid var(--line); color: #b42318; }
.editor-context-menu [data-context-delete]:hover, .editor-context-menu [data-context-delete]:focus { background: #fff0f0; color: #9b1c13; }
.editor-template-label { margin: 12px 0 4px !important; font-size: 11px !important; }
.editor-modal { width: min(680px, calc(100% - 32px)); max-height: min(80vh, 720px); border: 0; padding: 26px; color: var(--ink); }
.editor-modal::backdrop { background: rgba(20, 10, 40, .62); }
.editor-modal h2 { margin-top: 0; }
.editor-modal [data-history-list] { display: grid; gap: 8px; max-height: 48vh; overflow: auto; margin: 20px 0; }
.editor-modal [data-history-list] button { padding: 12px; border: 1px solid var(--line); background: #fff; color: var(--purple); text-align: left; cursor: pointer; }
.editor-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; max-height: 48vh; overflow: auto; margin: 20px 0; }
.editor-media-grid button { min-height: 100px; border: 2px solid var(--line); background: #fbf9fd; cursor: pointer; }
.editor-media-grid button:hover, .editor-media-grid button:focus { border-color: var(--purple); }
.editor-media-grid img { display: block; width: 100%; height: 105px; object-fit: contain; }
.rich-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:12px; border:1px solid #d7c6ed; background:#faf7ff; position:sticky; top:0; z-index:12; }
.rich-toolbar > span { width:100%; font-size:12px; color:#625071; }
.rich-toolbar label { display:flex; flex-direction:column; gap:3px; font-size:12px; }
.rich-toolbar button, .rich-toolbar select { padding:6px 8px; min-height:36px; }
.rich-toolbar input[type=color] { width:48px; height:36px; padding:2px; }
.rich-toolbar output { width:100%; color:#9a2525; font-size:13px; }
.rich-toolbar[hidden] { display:none; }
@media(max-width:600px) { .rich-toolbar { gap:5px; padding:8px; } .rich-toolbar button { font-size:12px; } }
