.bulk-page {
    --b-ink: var(--editorial-ink, #263c36);
    --b-text: var(--editorial-text, #37433e);
    --b-muted: #6b736e;
    --b-line: #e3e2d8;
    --b-primary: #246454;
    --b-primary-dark: #194c40;
    --b-tint: rgb(36 100 84 / 0.07);
    --b-tint-strong: rgb(36 100 84 / 0.12);
    --b-soft: #eef1e6;
    --b-warm: #f2f3e9;
    --b-card: #fff;
    --b-page: #fffefa;
    --b-danger: hsl(0 60% 38%);
    padding: 3rem 0 5rem;
    color: var(--b-text);
}
.bulk-page .container { padding-left: 1.5rem; padding-right: 1.5rem; }
.bulk-wrap { width: 100%; margin: 0 auto; }

.bulk-title { font-size: 2.25rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; color: var(--b-ink); }
.bulk-lead { color: var(--b-text); margin-top: 0.875rem; font-size: 1.0625rem; line-height: 1.65; max-width: 48rem; }

.bulk-steps { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.75rem; list-style: none; margin: 0 0 2.5rem; padding: 0 0 1rem; border-bottom: 1px solid var(--b-line); counter-reset: step; overflow-x: auto; }
.bulk-steps li { display: flex; align-items: center; gap: 0.5rem; flex: 0 0 auto; font-size: 0.875rem; color: var(--b-muted); counter-increment: step; white-space: nowrap; }
.bulk-steps li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 1.625rem; height: 1.625rem; border-radius: 50%; border: 1px solid var(--b-line); font-size: 0.75rem; font-weight: 600; background: var(--b-card); flex-shrink: 0; }
.bulk-steps li:not(:last-child)::after { content: ''; display: block; width: 1.5rem; height: 1px; background: var(--b-line); margin-left: 0.25rem; }
.bulk-steps li.is-done { color: var(--b-ink); }
.bulk-steps li.is-done::before { content: '\2713'; background: var(--b-primary); border-color: var(--b-primary); color: #fff; }
.bulk-steps li.is-done:not(:last-child)::after { background: var(--b-primary); }
.bulk-steps li.is-active { color: var(--b-ink); font-weight: 600; }
.bulk-steps li.is-active::before { border-color: var(--b-primary); background: var(--b-primary); color: #fff; }

.bulk-card { background: var(--b-card); border: 1px solid var(--b-line); border-radius: 0.75rem; padding: 1.5rem; margin-top: 1.5rem; }
.bulk-card h2 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--b-ink); }
.bulk-card-sub { color: var(--b-muted); font-size: 0.875rem; margin-bottom: 1rem; line-height: 1.6; }

.bulk-alert { border-radius: 0.625rem; padding: 0.875rem 1rem; font-size: 0.9375rem; margin-top: 1.25rem; border: 1px solid; }
.bulk-alert--error { background: hsl(0 72% 51% / 0.07); border-color: hsl(0 72% 51% / 0.3); color: var(--b-danger); }
.bulk-alert--info { background: var(--b-tint); border-color: rgb(36 100 84 / 0.3); color: var(--b-primary-dark); }
.bulk-beta { display: flex; gap: 0.75rem; align-items: flex-start; background: var(--b-warm); border: 1px solid var(--b-line); border-radius: 0.625rem; padding: 0.875rem 1rem; margin: 0 0 1.5rem; font-size: 0.9375rem; line-height: 1.6; color: var(--b-text); }
.bulk-beta-tag { flex: 0 0 auto; margin-top: 0.15rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--b-primary); color: #fff; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.bulk-beta a { text-decoration: underline; font-weight: 600; color: var(--b-primary-dark); }
.bulk-alert ul { margin: 0; padding-left: 1.25rem; }
.bulk-alert a { text-decoration: underline; font-weight: 600; }

.bulk-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; text-align: center; padding: 2.5rem 1rem; border: 2px dashed var(--b-line); border-radius: 0.75rem; background: var(--b-page); cursor: pointer; transition: border-color .15s, background .15s; }
.bulk-drop:hover, .bulk-drop.is-over { border-color: var(--b-primary); background: var(--b-tint); }
.bulk-drop svg { color: var(--b-primary); }
.bulk-drop strong { font-size: 1rem; color: var(--b-ink); }
.bulk-drop small { color: var(--b-muted); }
.bulk-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bulk-drop-file { font-weight: 600; color: var(--b-ink); word-break: break-all; }

.bulk-facts { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.9375rem; line-height: 1.6; }
.bulk-facts li { display: flex; gap: 0.625rem; align-items: flex-start; }
.bulk-facts li::before { content: '\2713'; color: var(--b-primary); font-weight: 700; flex-shrink: 0; }

.bulk-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }
.bulk-actions .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.bulk-options { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; }
.bulk-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.875rem; }
.bulk-field > span { color: var(--b-muted); font-weight: 500; }
.bulk-select, .bulk-input { font: inherit; font-size: 0.9375rem; padding: 0.5rem 0.625rem; border: 1px solid var(--b-line); border-radius: 0.5rem; background: var(--b-card); color: var(--b-ink); min-width: 12rem; max-width: 100%; }
.bulk-select:focus, .bulk-input:focus { outline: none; border-color: var(--b-primary); box-shadow: 0 0 0 3px hsl(164 40% 40% / 0.12); }
.bulk-check { display: inline-flex; gap: 0.5rem; align-items: center; font-size: 0.9375rem; }
.bulk-check input, .bulk-mode input { accent-color: var(--b-primary); }
.bulk-keep { display: grid; gap: 0.5rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.bulk-keep-item { align-items: flex-start; }
.bulk-keep-item input { margin-top: 0.25rem; }
.bulk-keep-item small { display: block; color: var(--b-muted); }
.bulk-keep-item.is-used { color: var(--b-muted); }
.bulk-keep-links { font-size: 0.875rem; margin-bottom: 0.75rem; color: var(--b-muted); }
.bulk-keep-links a { color: var(--b-primary); }
.bulk-meta { color: var(--b-muted); font-size: 0.875rem; margin-bottom: 1rem; }
.bulk-meta strong { color: var(--b-ink); }
.bulk-form-input { width: 100%; max-width: 28rem; }

.bulk-modes { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.bulk-mode { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.875rem 1rem; border: 1px solid var(--b-line); border-radius: 0.75rem; cursor: pointer; background: var(--b-card); }
.bulk-mode input { margin-top: 0.25rem; }
.bulk-mode.is-selected { border-color: var(--b-primary); background: var(--b-tint); }
.bulk-mode b { display: block; font-size: 0.9375rem; color: var(--b-ink); }
.bulk-mode small { color: var(--b-muted); }

.bulk-map { display: grid; gap: 0.875rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 1.25rem; }
.bulk-map[hidden] { display: none; }
.bulk-req { color: var(--destructive); margin-left: 0.125rem; }

.bulk-table-wrap { overflow-x: auto; border: 1px solid var(--b-line); border-radius: 0.75rem; background: var(--b-card); }
.bulk-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.bulk-table th, .bulk-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--b-line); white-space: nowrap; }
.bulk-table th { font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--b-muted); background: var(--b-warm); position: sticky; top: 0; }
.bulk-table tr:last-child td { border-bottom: 0; }
.bulk-table td.is-raw { color: var(--b-muted); max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }
.bulk-table td.is-idx { color: var(--b-muted); width: 1%; }
.bulk-table .col-arrow { color: var(--b-primary); padding: 0 0.25rem; width: 1%; }
.bulk-table tr.is-invalid td { background: hsl(0 72% 51% / 0.05); }
.bulk-table tr.is-duplicate td { background: hsl(43 96% 56% / 0.08); }
.bulk-scroll { max-height: 28rem; overflow-y: auto; }

.bulk-pill { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 999px; }
.bulk-pill--ok { background: var(--b-tint-strong); color: var(--b-primary-dark); }
.bulk-pill--bad { background: hsl(0 72% 51% / 0.1); color: var(--b-danger); }
.bulk-pill--dup { background: hsl(43 96% 56% / 0.18); color: hsl(43 80% 30%); }

.bulk-stats { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0; }
.bulk-stat { flex: 1 1 140px; padding: 0.875rem 1rem; border: 1px solid var(--b-line); border-radius: 0.75rem; background: var(--b-card); }
.bulk-stat b { display: block; font-size: 1.5rem; line-height: 1.2; color: var(--b-ink); font-weight: 600; }
.bulk-stat span { color: var(--b-muted); font-size: 0.8125rem; }

.bulk-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0.75rem; }
.bulk-filter { font: inherit; font-size: 0.875rem; padding: 0.375rem 0.875rem; border: 1px solid var(--b-line); border-radius: 999px; background: var(--b-card); cursor: pointer; color: var(--b-ink); }
.bulk-filter.is-active { background: var(--b-primary); border-color: var(--b-primary); color: #fff; }

.bulk-link { font: inherit; font-size: 0.8125rem; background: none; border: 0; padding: 0.125rem 0.25rem; margin-right: 0.5rem; color: var(--b-primary); cursor: pointer; text-decoration: underline; }
.bulk-link[hidden] { display: none; }
.bulk-link--danger { color: var(--destructive); }
.bulk-table td.is-actions { width: 1%; }
.bulk-table tr.is-excluded td { color: var(--b-muted); text-decoration: line-through; background: var(--b-page); }
.bulk-table tr.is-excluded td.is-actions, .bulk-table tr.is-excluded td[data-status], .bulk-table tr.is-excluded td.is-idx { text-decoration: none; }
.bulk-table tr.is-editing td { background: var(--b-tint); }
.bulk-input--cell { min-width: 0; width: 7rem; padding: 0.25rem 0.5rem; font-size: 0.875rem; }
.bulk-textarea { width: 100%; min-width: 0; resize: vertical; }
.bulk-add { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.bulk-alert[hidden] { display: none; }
.btn.is-disabled { opacity: 0.45; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.bulk-progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem; color: var(--b-ink); }
.bulk-bar { height: 0.75rem; border-radius: 999px; background: var(--b-soft); overflow: hidden; }
.bulk-bar-fill { height: 100%; background: var(--b-primary); border-radius: 999px; transition: width .6s ease; }
.bulk-bar--busy .bulk-bar-fill { width: 40% !important; animation: bulk-busy 1.2s ease-in-out infinite; }
@keyframes bulk-busy { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .bulk-bar-fill { transition: none; } .bulk-bar--busy .bulk-bar-fill { animation: none; width: 100% !important; } }

.bulk-tools { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 2rem; }
.bulk-tool { display: block; padding: 1.5rem; border: 1px solid var(--b-line); border-radius: 0.75rem; background: var(--b-card); transition: border-color .15s, box-shadow .25s; }
.bulk-tool:hover { border-color: var(--b-primary); box-shadow: 0 8px 24px -8px rgb(36 100 84 / 0.15); }
.bulk-tool h2 { font-size: 1.125rem; margin-bottom: 0.375rem; color: var(--b-ink); font-weight: 600; }
.bulk-tool p { color: var(--b-text); font-size: 0.9375rem; line-height: 1.6; }

@media (max-width: 960px) {
  .bulk-steps li:not(.is-active) span { display: none; }
}

@media (max-width: 640px) {
  .bulk-page { padding: 1.5rem 0 3rem; }
  .bulk-title { font-size: 1.625rem; }
}

.bulk-collapse { border: 1px solid var(--b-line); border-radius: 0.5rem; background: var(--b-card); }
.bulk-collapse > summary { cursor: pointer; padding: 0.75rem 1rem; font-weight: 600; font-size: 0.9375rem; color: var(--b-ink); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.bulk-collapse > summary::-webkit-details-marker { display: none; }
.bulk-collapse > summary::after { content: ""; width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.15s; flex-shrink: 0; margin-top: -0.25rem; }
.bulk-collapse[open] > summary::after { transform: rotate(-135deg); margin-top: 0.25rem; }
.bulk-collapse-body { padding: 0.25rem 1rem 1rem; }

.bulk-fieldset { border: 0; padding: 0; margin: 1rem 0 0; min-width: 0; }
.bulk-fieldset legend { font-weight: 600; font-size: 0.9375rem; color: var(--b-ink); padding: 0; margin-bottom: 0.75rem; }
.bulk-field-hint { color: var(--b-muted); font-size: 0.8125rem; margin: -0.25rem 0 0.75rem; }
.bulk-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-width: 40rem; }
.bulk-field--wide { grid-column: 1 / -1; }
.bulk-form-grid .bulk-input { width: 100%; }
.bulk-fieldset + .bulk-fieldset { padding-top: 1.25rem; border-top: 1px solid var(--b-line); }
@media (max-width: 30rem) { .bulk-form-grid { grid-template-columns: 1fr; } }
