@scope (.cms-admin) {
* { box-sizing: border-box; }
:scope { margin: 0; background: #f5f7fa; color: #1d2939; font: 15px/1.6 system-ui, sans-serif; }
.cms-header { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 16px 32px; background: #10283f; color: white; }
.cms-header a { color: white; font-weight: 700; text-decoration: none; font-size: 14px; }
.cms-header .cms-brand { font-size: 20px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.cms-header-nav { display: flex; flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px 20px; margin-left: auto; min-width: 0; }
.cms-header-nav a { white-space: nowrap; }
.cms-header-nav form { margin: 0; }
.cms-settings-menu { position: relative; }
.cms-settings-menu summary { cursor: pointer; font-size: 14px; font-weight: 700; white-space: nowrap; padding-block: 10px; }
.cms-settings-menu summary:focus-visible { outline: 3px solid #d58b16; outline-offset: 4px; }
.cms-settings-links { position: absolute; z-index: 20; top: 100%; right: 0; min-width: 210px; padding: 8px; background: #10283f; border: 1px solid #63778b; border-radius: 6px; box-shadow: 0 8px 20px #10283f33; }
.cms-settings-links a { display: block; padding: 10px 12px; border-radius: 4px; }
.cms-settings-links a:hover, .cms-settings-links a:focus-visible { background: #29465f; outline-offset: -2px; }
.cms-main { max-width: 1200px; margin: 32px auto; padding: 0 24px 64px; }
:scope h1 { font-size: 26px; }
:scope a { color: #176494; }
.cms-header a { color: white; }
.page-heading, .actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.button { display: inline-block; padding: 10px 18px; border: 1px solid #176494; border-radius: 6px; background: #176494; color: white !important; text-decoration: none; cursor: pointer; font: inherit; }
.button.secondary { background: white; color: #176494 !important; }
.field { display: grid; gap: 6px; margin: 18px 0; max-width: 700px; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=color]), select, textarea { padding: 10px 12px; border: 1px solid #98a7b7; border-radius: 6px; background: #fff; color: inherit; font: inherit; min-width: 0; max-width: 100%; }
input[type=color] { width: 80px; height: 44px; padding: 4px; border: 1px solid #98a7b7; border-radius: 6px; background: #fff; cursor: pointer; }
input:disabled, select:disabled, textarea:disabled { background: #e9eef3; }
input:not([type=checkbox]):not([type=radio]):focus-visible, select:focus-visible, textarea:focus-visible { border-color: #5a9ac2; outline: 3px solid #17649425; outline-offset: 0; }
.field textarea { font: inherit; resize: vertical; }
.block-add-button { width: 100%; margin-top: 24px; }
.block-composer.is-editing .block-add-button { display: none; }
.block-template-panel { position: fixed; inset: 0 auto 0 0; width: 400px; max-width: 90vw; height: 100dvh; max-height: 100dvh; margin: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px; background: white; color: #1d2939; border: 0; box-shadow: 2px 0 12px #0002; overflow-wrap: anywhere; }
.block-template-panel::backdrop { background: rgb(0 0 0 / 30%); }
.block-template-panel[open] { animation: block-template-enter .25s ease-out; }
.block-template-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
@keyframes block-template-enter { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .block-template-panel[open] { animation: none; } }
.block-template-panel h2 { margin: 0; font-size: 18px; }
.block-template-panel p { font-size: 13px; }
.block-template-panel [data-template-error]:empty { display: none; }
.block-template-group { border-top: 1px solid #d6e0e9; }
.block-template-group summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.block-template-group summary span { font-weight: 400; }
.block-template-choice { display: block; width: 100%; padding: 10px; margin-bottom: 6px; text-align: left; overflow-wrap: anywhere; font: inherit; color: #176494; background: #f5f7fa; border: 1px solid #d6e0e9; border-radius: 4px; cursor: pointer; }
.block-template-choice:hover, .block-template-choice:focus-visible { background: #e4eff7; outline: 2px solid #176494; }
.block-template-choice:disabled { opacity: .5; cursor: wait; }
.block-template-group-heading { background: #e9eef3; }
.job-editor { max-width: 760px; margin-inline: auto; }
.job-form .field { max-width: none; }
.job-form fieldset { min-width: 0; padding: 16px; border: 1px solid #cbd5e1; border-radius: 6px; }
.job-form fieldset legend { padding-inline: 6px; }
.check { margin: 14px 0; }
.actions { justify-content: flex-start; margin-top: 24px; }
.node-tree, .node-tree ul { list-style: none; padding-left: 24px; }
.node-tree { padding-left: 0; }
.node-row, .system-entry { display: flex; gap: 16px; align-items: center; padding: 16px; background: white; border: 1px solid #d6e0e9; border-radius: 6px; margin-top: 8px; }
.node-description { display: grid; gap: 2px; flex: 1; overflow-wrap: anywhere; }
.node-description span, .node-description small { color: #526579; }
.node-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.text-button { border: 0; background: transparent; cursor: pointer; padding: 0; font: inherit; }
.danger, .error { color: #a72632; }
.notice { background: #e3f3eb; padding: 12px; }
.error { background: #fff0f0; padding: 12px; }
.drag-handle { cursor: grab; font-size: 24px; }
.drop-targets { display: flex; gap: 8px; padding: 3px 0; }
.drop-targets span { border: 1px dashed #9cabbc; padding: 2px 12px; color: #63778b; font-size: 12px; }
.dragging .drop-targets span { background: #e3f2ff; min-height: 32px; }
:scope table { width: 100%; border-collapse: collapse; background: white; }
:scope td, :scope th { padding: 12px; border-bottom: 1px solid #d6e0e9; text-align: left; overflow-wrap: anywhere; }
.login-panel { max-width: 440px; margin: 64px auto; padding: 28px; background: white; border-radius: 8px; }
.public-page { max-width: 900px; margin: 60px auto; padding: 20px; font-family: system-ui, sans-serif; }
@media (max-width: 700px) { .node-row { flex-wrap: wrap; } .page-heading { display: block; } .cms-main { padding: 0 12px; } .node-tree ul { padding-left: 14px; } }

.block-card { border: 1px solid #cbd5e1; padding: 1rem; margin: 1.5rem 0; background: #fff; border-radius: .5rem; }
.composition-preview { width: 100%; min-height: 120px; border: 1px solid #cbd5e1; background: white; }
:scope textarea { width: 100%; box-sizing: border-box; font-family: ui-monospace, monospace; }
:scope small { font-size: .85rem; }

/* Composition controls sit above the preview without adding card spacing. */
.composition-workspace .block-stack { background: #fff; }
.composition-workspace .block-card { position: relative; border: 0; border-radius: 0; margin: 0; padding: 0; min-height: 0; }
.composition-workspace .drag-handle { font-size: .9rem; }
.composition-workspace .composition-preview { display: block; min-height: 0; border: 0; }
.composition-workspace .drop-targets { position: absolute; inset: 0; padding: 0; pointer-events: none; z-index: 4; }
.composition-workspace .drop-targets span { position: absolute; left: 0; right: 0; height: 16px; padding: 0; font-size: 0; border: 0; }
.composition-workspace [data-placement=before] { top: 0; }
.composition-workspace [data-placement=after] { bottom: 0; }
.composition-workspace.is-dragging .drop-targets span { height: 30%; min-height: 16px; pointer-events: auto; background: #dbeafa55; border: 1px dashed #8eafc5; }
.composition-workspace .drop-targets .drop-active { background: #acd5f2aa; border: 3px solid #176494; }
.composition-workspace .block-card.is-source { opacity: .5; }

/* Shared row actions: same geometry for links and form submit buttons. */
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-actions > form { display: inline-flex; margin: 0; }
.admin-action { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 6px 12px; border: 1px solid var(--action-border, #c4cfda); border-radius: 6px; background: var(--action-bg, #f2f5f8); color: var(--action-color, #40566b); font: 600 13px/1.5 system-ui, sans-serif; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .15s, border-color .15s; }
:scope a.admin-action { color: var(--action-color, #40566b); text-decoration: none; }
.admin-action--edit { --action-color: #fff; --action-bg: #176494; --action-border: #176494; --action-hover: #104e76; }
.admin-action--view { --action-color: #17634c; --action-bg: #edf7f2; --action-border: #bad8c9; --action-hover: #dcefe5; }
.admin-action--copy { --action-color: #40566b; --action-bg: #f2f5f8; --action-border: #c4cfda; --action-hover: #e3eaf0; }
.admin-action--delete { --action-color: #ac2938; --action-bg: #fff2f3; --action-border: #edbcc3; --action-hover: #ffe0e4; }
.admin-action:hover { background: var(--action-hover, #e3eaf0); }
.admin-action:focus-visible { outline: 3px solid #d58b16; outline-offset: 2px; }
.admin-action:disabled { opacity: .55; cursor: not-allowed; }

}

/* Shared transient feedback for asynchronous admin updates. */
.cms-admin .admin-toast { position: fixed; top: 1rem; right: 1rem; z-index: 1000; max-width: min(28rem, calc(100vw - 2rem)); padding: 1rem 1.25rem; border-radius: .5rem; background: #166534; color: #fff; box-shadow: 0 4px 16px #0003; pointer-events: none; }
.cms-admin .admin-toast[hidden] { display: none; }
.cms-admin .admin-toast--error { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.cms-admin [data-controller~="async-update"] button:disabled { opacity: .6; cursor: wait; }

.cms-admin .job-publication--published, .cms-admin .publication--published { --action-color: #fff; --action-bg: #176494; --action-border: #176494; --action-hover: #104e76; }
.cms-admin .job-publication--unpublished, .cms-admin .publication--unpublished { --action-color: #fff; --action-bg: #6b7280; --action-border: #6b7280; --action-hover: #4b5563; }

/* Admin action roles: state, editing, navigation, creation and destructive actions. */
.cms-admin .admin-action--edit { --action-color: #854d0e; --action-bg: #fef3c7; --action-border: #d6b65c; --action-hover: #fde68a; }
.cms-admin .admin-action--content { --action-color: #6b21a8; --action-bg: #f3e8ff; --action-border: #d8b4fe; --action-hover: #e9d5ff; }
.cms-admin .admin-action--manage, .cms-admin .admin-action--view { --action-color: #155e75; --action-bg: #ecfeff; --action-border: #8dcbd5; --action-hover: #cffafe; }
.cms-admin .admin-action--create { --action-color: #166534; --action-bg: #dcfce7; --action-border: #86c89b; --action-hover: #bbf7d0; }
.cms-admin .admin-action--move { --action-color: #40566b; --action-bg: #f2f5f8; --action-border: #c4cfda; --action-hover: #e3eaf0; }
.cms-admin .button--create { background: #166534; border-color: #166534; }
.cms-admin .button--create:hover { background: #14532d; }
.cms-admin .button--delete { background: #a72632; border-color: #a72632; }
.cms-admin .admin-list-scroll { max-width: 100%; overflow-x: auto; padding-bottom: 6px; }
.cms-admin .admin-list-scroll:focus-visible { outline: 2px solid #176494; outline-offset: 2px; }
.cms-admin .admin-list-table { min-width: 760px; }
.cms-admin .admin-list-table th { background: #edf2f7; color: #40566b; font-size: 13px; white-space: nowrap; }
.cms-admin .admin-list-table td { vertical-align: top; }
.cms-admin .admin-list-table .admin-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 92px; align-items: start; justify-content: start; gap: 8px; }
.cms-admin .admin-list-table td:last-child { width: 1%; }
.cms-admin .admin-list-table .admin-actions > form, .cms-admin .admin-action-slot, .cms-admin .admin-action-slot > form { display: flex; margin: 0; min-width: 0; }
.cms-admin .admin-list-table .admin-actions .admin-action, .cms-admin .node-actions .admin-action { width: 100%; box-sizing: border-box; }
.cms-admin .admin-action-slot > .admin-action, .cms-admin .admin-action-slot > form, .cms-admin .admin-action-slot > form > .admin-action { width: 100%; }
.cms-admin .node-tree { padding-left: 0; }
.cms-admin .node-tree ul { padding-left: 24px; border-left: 1px solid #d6e0e9; }
.cms-admin .site-structure-list > .node-tree, .cms-admin .node-columns { min-width: 1156px; }
.cms-admin .node-row, .cms-admin .node-columns { display: grid; grid-template-columns: 24px minmax(180px, 1fr) 86px 140px 452px; align-items: start; gap: 12px; padding: 16px; box-sizing: border-box; }
.cms-admin .node-columns { color: #40566b; font-size: 13px; font-weight: 600; background: #edf2f7; border: 1px solid transparent; }
.cms-admin .node-description { min-width: 0; }
.cms-admin .node-publication form { margin: 0; }
.cms-admin .node-publication .admin-action { width: 86px; box-sizing: border-box; }
.cms-admin .node-row .node-actions { display: grid; grid-template-columns: 92px 92px 92px 72px 72px; gap: 8px; align-items: start; }
.cms-admin .node-actions > form { margin: 0; }

.cms-admin .admin-list-table .publication--published, .cms-admin .admin-list-table .publication--unpublished, .cms-admin .admin-list-table .job-publication--published, .cms-admin .admin-list-table .job-publication--unpublished { width: 86px; box-sizing: border-box; }
@media (max-width: 1000px) {
  .cms-admin .admin-list-scroll::before { content: "左右にスクロールして操作できます"; display: block; color: #526579; font-size: 12px; padding: 8px 0; }
}

.cms-admin .admin-view-column { width: 68px; text-align: center; white-space: nowrap; }
.cms-admin .admin-view-link { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 34px; padding: 7px; box-sizing: border-box; }
.cms-admin .admin-view-link img { display: block; width: 18px; height: 18px; }
.cms-admin .node-view { display: flex; justify-content: center; align-items: center; min-height: 34px; color: #63778b; }

/* Only the active Block can be edited; previews of its siblings stay mounted. */
[data-controller="block-editor"].is-editing .block-controls,
[data-controller="block-editor"].is-editing .drop-targets { display: none; }
.composition-workspace { overflow-anchor: none; }
.composition-workspace[aria-busy="true"] .block-toolbar { pointer-events: none; }

/* Block body editing: uninterrupted previews, controls on demand, form below. */
.cms-admin .block-edit-page { overflow-anchor: none; padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.cms-admin .block-preview { min-height: 48px; }
.cms-admin .block-controls { position: absolute; inset: 0; pointer-events: auto; opacity: 0; }
.cms-admin .block-overlay { position: absolute; inset: 0; background: rgb(255 255 255 / 48%); }
.cms-admin .block-card:hover > .block-controls,
.cms-admin .block-card:has(:focus-visible) > .block-controls { opacity: 1; }
.cms-admin .block-card:hover > .block-controls :is(a, button, .drag-handle),
.cms-admin .block-card:has(:focus-visible) > .block-controls :is(a, button, .drag-handle) { pointer-events: auto; }
.cms-admin .block-edit-button { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); box-shadow: 0 2px 8px #20344430; }
.cms-admin .block-toolbar { position: absolute; top: 8px; right: 8px; z-index: 3; display: flex; gap: 6px; margin: 0; padding: 4px; background: #ffffffed; border-radius: 6px; }
.cms-admin .block-toolbar form { margin: 0; display: flex; }
.cms-admin .block-toolbar .admin-action { min-height: 36px; }
.cms-admin .block-toolbar .drag-handle { cursor: grab; padding: 5px; color: #526476; }
.cms-admin .block-edit-panel { padding: 24px; background: #eef3f8; border-block: 1px solid #bacbdd; }
.cms-admin .block-edit-heading { margin: 0; font-size: 18px; }
.cms-admin .block-edit-heading small { display: block; margin-top: 4px; font-weight: 400; color: #526476; overflow-wrap: anywhere; }
.cms-admin .block-edit-panel .field { max-width: none; margin: 24px 0; }
.cms-admin .block-edit-panel .field > label:first-child { font-weight: 700; }
.cms-admin .block-edit-panel :is(input:not([type=checkbox]):not([type=hidden]):not([type=submit]), select, textarea) { width: 100%; }
.cms-admin .block-edit-panel textarea { min-height: 140px; }
.cms-admin .block-edit-panel .field p { margin: 4px 0; overflow-wrap: anywhere; }
.cms-admin .block-current-image { max-width: 200px; max-height: 150px; object-fit: contain; background: #fff; border: 1px solid #cbd5e1; padding: 4px; }
.cms-admin .block-edit-actions { justify-content: flex-start; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
.cms-admin .block-cancel-button { background: #687586; border-color: #687586; }
.cms-admin .block-bottom-bar { position: fixed; inset: auto 0 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px max(16px, calc((100vw - 1152px) / 2)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #cbd5e1; box-shadow: 0 -2px 12px #20344414; }
.cms-admin .block-bottom-bar form { margin: 0; }
.cms-admin .block-publication { display: inline-flex; gap: 10px; align-items: center; min-height: 44px; }
.cms-admin .block-publication.publication--published { --action-bg: #0d6efd; --action-border: #0d6efd; --action-hover: #0b5ed7; }
.cms-admin .block-switch-track { display: inline-block; width: 32px; height: 18px; border-radius: 12px; background: #ffffff50; padding: 3px; }
.cms-admin .block-switch-track::after { content: ""; display: block; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.cms-admin .block-publication[aria-checked=true] .block-switch-track::after { transform: translateX(14px); }
.cms-admin .block-bottom-bar .button { white-space: nowrap; }
.composition-workspace[aria-busy=true] .block-controls { pointer-events: none; }
.composition-workspace[aria-busy=true] .block-controls :is(a, button, .drag-handle) { pointer-events: none; }
@media (hover: none), (pointer: coarse), (max-width: 600px) {
  .cms-admin .block-controls { position: relative; opacity: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px; background: #f5f7fa; }
  .cms-admin .block-overlay { display: none; }
  .cms-admin .block-controls :is(a, button) { pointer-events: auto; min-height: 44px; }
  .cms-admin .block-edit-button { position: static; transform: none; padding: 8px 12px; box-shadow: none; }
  .cms-admin .block-toolbar { position: static; padding: 0; background: transparent; flex-wrap: nowrap; }
  .cms-admin .block-toolbar .drag-handle { display: none; }
  .cms-admin .block-edit-panel { padding: 16px; }
}

/* Shared job and search-master CSV controls. */
@scope (.cms-admin) {
.csv-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.csv-controls { margin-block: 16px 8px; }
.csv-controls__import { display: flex; align-items: stretch; gap: 0; margin: 0; min-width: 0; max-width: 100%; }
.csv-controls input[type="file"] { flex: 1 1 280px; width: 280px; max-width: 100%; min-width: 0; box-sizing: border-box; border-radius: 6px 0 0 6px !important; border-right-width: 0 !important; }
.csv-controls__import input[type="submit"] { flex: 0 0 auto; border-radius: 0 6px 6px 0; white-space: nowrap; }
.csv-controls__file-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Compact job rows retain the shared admin controls and horizontal scrolling. */
.cms-admin .job-admin-list td { vertical-align: middle; white-space: nowrap; padding-block: 8px; }
.cms-admin .job-admin-list .admin-actions { align-items: center; grid-auto-columns: 72px; }
.cms-admin .job-admin-list td > form { margin: 0; }
.cms-admin .job-admin-list .job-list-code,
.cms-admin .job-admin-list .job-list-company,
.cms-admin .job-admin-list .job-list-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cms-admin .job-admin-list .job-list-code { max-width: 8rem; }
.cms-admin .job-admin-list .job-list-company { max-width: 10rem; }
.cms-admin .job-admin-list .job-list-title { width: 15rem; }

/* Edit screens reuse the Block footer surface and publication switch. */
.cms-admin .admin-edit-page .field_with_errors { min-width: 0; max-width: 100%; }
.cms-admin .admin-edit-page { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
.cms-admin .admin-edit-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.cms-admin .admin-edit-bar__publication { justify-self: start; }
.cms-admin .admin-edit-bar__save { grid-column: 2; grid-row: 1; min-width: 112px; }
.cms-admin .admin-edit-bar__view { grid-column: 3; justify-self: end; }
.cms-admin .admin-edit-bar .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box; }
@media (max-width: 600px) {
  .cms-admin .admin-edit-page { padding-bottom: calc(156px + env(safe-area-inset-bottom)); }
  .cms-admin .admin-edit-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .cms-admin .admin-edit-bar__publication { grid-column: 1; grid-row: 1; }
  .cms-admin .admin-edit-bar__view { grid-column: 2; grid-row: 1; padding-inline: 8px; font-size: 14px; }
  .cms-admin .admin-edit-bar__save { grid-column: 1 / -1; grid-row: 2; justify-self: center; min-width: 160px; }
  .cms-admin .admin-edit-bar__save:only-child { grid-row: 1; }
}
