.campaign-editor { position: fixed; z-index: 1000; inset: 0; padding: 20px; background: #071114ef; color: #eee9db; font: 13px/1.45 "Segoe UI", Arial, sans-serif; }
.campaign-editor[hidden] { display: none; }
.campaign-editor * { box-sizing: border-box; }
.ce-shell { width: min(1480px, 100%); height: 100%; margin: auto; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; border: 1px solid #506265; border-top: 3px solid #d3b277; background: #132229; box-shadow: 0 20px 90px #0008; }
.ce-header { display: flex; align-items: center; gap: 25px; padding: 20px 25px 16px; }
.ce-header h2 { margin: 3px 0 0; color: #f4e8c9; font-size: 27px; font-weight: 650; letter-spacing: -.6px; }
.ce-eyebrow { color: #caae74; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; }
.ce-enabled { margin-left: auto; display: flex; align-items: center; gap: 9px; color: #c1e6d0; }
.ce-enabled input { accent-color: #d7b976; width: 17px; height: 17px; }
.campaign-editor button, .campaign-editor select, .campaign-editor input, .campaign-editor textarea { color: #e9e8dc; font: inherit; }
.campaign-editor button { padding: 9px 14px; background: #24373e; border: 1px solid #617477; cursor: pointer; text-align: center; }
.campaign-editor button:hover { border-color: #d8ba80; background: #31434a; }
.campaign-editor button:disabled { opacity: .4; cursor: default; }
.campaign-editor :focus-visible { outline: 2px solid #e6c484; outline-offset: 2px; }
.campaign-editor .ce-close { min-width: 34px; padding: 0; border: 0; font-size: 29px; color: #a5b8b9; background: transparent; }
.ce-selectors { display: grid; grid-template-columns: 1fr 1.4fr .65fr 1fr; gap: 14px; padding: 0 25px 18px; border-bottom: 1px solid #3d5257; }
.ce-field { display: grid; align-content: start; gap: 5px; min-width: 0; }
.ce-field-label { color: #c7d0c8; font-size: 11px; }
.ce-field-hint { color: #9aaeb0; font-size: 10px; min-height: 15px; line-height: 1.5; }
.campaign-editor select, .campaign-editor input:not([type="checkbox"]), .campaign-editor textarea { width: 100%; min-height: 36px; padding: 7px 10px; background: #0f1b21; border: 1px solid #4f656c; border-radius: 0; }
.campaign-editor textarea { min-height: 100px; resize: vertical; }
.campaign-editor input::placeholder { color: #738b91; }
.ce-tabs { display: flex; gap: 5px; padding: 10px 25px 0; background: #101d23; }
.campaign-editor .ce-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: #9cb0b1; padding: 12px 17px; }
.campaign-editor .ce-tab[aria-current="page"] { color: #f1d9a6; border-bottom-color: #d8b778; background: #1c3037; }
.ce-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 270px; min-height: 0; }
.ce-content { overflow: auto; overscroll-behavior: contain; padding: 24px 25px 40px; }
.ce-content > h3 { margin-top: 0; }
.ce-section { margin-bottom: 25px; }
.ce-section h3 { font-size: 17px; font-weight: 600; margin: 0 0 7px; }
.ce-section > .ce-field { margin-top: 14px; }
.ce-muted { color: #9eafb0; font-size: 11px; line-height: 1.65; margin: 0 0 15px; }
.ce-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.ce-resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ce-resource-grid fieldset { min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 1px solid #3d5359; padding: 14px; }
.ce-resource-grid legend { color: #cfbb90; padding: 0 7px; }
.ce-overview { padding: 25px 21px; border-left: 1px solid #3d5359; background: #0e1b21; overflow: auto; }
.ce-overview > strong { display: block; font-size: 17px; margin: 10px 0 5px; color: #ede2c7; }
.ce-count-preview { padding: 20px 0; margin: 17px 0; border-block: 1px solid #334b52; }
.ce-count-preview span { font-size: 9px; letter-spacing: 1px; color: #a7bab5; }
.ce-count-preview strong { display: block; color: #e6c386; font-size: 38px; line-height: 1.4; font-weight: 600; }
.ce-count-preview small { color: #bfd7c6; }
.ce-preview-details { margin-bottom: 22px; }
.ce-preview-details > div { display: grid; grid-template-columns: 1fr auto; gap: 15px; margin: 10px 0; font-size: 10px; color: #a7bab8; }
.ce-preview-details b { color: #e4e6d5; font-weight: 500; }
.ce-footer { padding: 14px 25px; border-top: 1px solid #455d61; display: grid; gap: 10px; background: #172a30; }
.ce-status { color: #c0d6c6; font-size: 11px; margin: 0; min-height: 16px; }
.ce-status[data-error="true"] { color: #ffac93; }
.ce-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.ce-actions > :first-child { margin-right: auto; }
.campaign-editor .ce-primary { background: #cab17b; color: #122127; border-color: #e2c996; font-weight: 700; min-width: 120px; }
.campaign-editor .ce-play { color: #c8f0d7; border-color: #73a68d; background: #263f38; font-weight: 600; }
.campaign-editor .ce-danger { color: #dfaaa0; border-color: #6b514e; }
.ce-scope-notice { margin: 0 0 20px; padding: 11px 13px; border-left: 2px solid #bf9e65; background: #2d352f; color: #d6c9ab; font-size: 11px; }
.ce-placement-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 20px; }
.ce-map-tools { display: grid; grid-template-columns: .7fr .8fr 1.2fr; gap: 9px; margin-bottom: 12px; }
.ce-map-tools button { grid-column: 1 / -1; }
.ce-placement-map { position: relative; height: 430px; min-height: 300px; border: 1px solid #718077; overflow: hidden; background-color: #665640; background-image: linear-gradient(#d7bc7b10 1px, transparent 1px), linear-gradient(90deg, #d7bc7b10 1px, transparent 1px), radial-gradient(ellipse at 75% 20%, #917b4e 0, transparent 45%), radial-gradient(ellipse at 30% 75%, #3e4536 0, transparent 40%); background-size: 10% 10%, 10% 10%, 100% 100%, 100% 100%; }
.ce-placement-map::before { content: 'СХЕМА РАССТАНОВКИ'; position: absolute; left: 10px; top: 10px; pointer-events: none; font-size: 8px; letter-spacing: 1.2px; color: #d7cba8; }
.campaign-editor .ce-map-token { position: absolute; transform: translate(-50%, -50%); padding: 0; width: 19px; height: 19px; min-height: 0; border-radius: 50%; border: 1px solid currentColor; background: #102131d9; font-size: 12px; line-height: 17px; touch-action: none; }
.ce-map-token.ce-friendly, .ce-object-row.ce-friendly { color: #9dcffa; }
.ce-map-token.ce-enemy, .ce-object-row.ce-enemy { color: #f1aa8e; }
.campaign-editor .ce-selected { outline: 2px solid #f5dd9b; outline-offset: 3px; }
.ce-map-token.ce-selected { z-index: 2; }
.ce-placement-list .ce-field-grid { grid-template-columns: 1fr 1fr; }
.ce-placement-list .ce-danger { width: 100%; margin-top: 12px; }
.ce-placement-list h3 { font-size: 15px; }
.ce-section-caption { display: block; font-size: 10px; color: #b4c5be; margin: 15px 0 8px; }
.ce-object-list { display: grid; gap: 5px; max-height: 290px; overflow: auto; padding: 4px; }
.campaign-editor .ce-object-row { text-align: left; font-size: 11px; padding: 6px 8px; }
.ce-wave-list { display: grid; gap: 15px; margin: 20px 0; }
.ce-wave-card { padding: 15px; border: 1px solid #415b61; background: #182c33; }
.ce-wave-heading { display: grid; grid-template-columns: 1fr 130px auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.ce-wave-unit { display: grid; grid-template-columns: 1fr 85px 35px; gap: 10px; margin: 8px 0; }
.campaign-editor .ce-small { padding: 4px; }
@media (min-width: 1500px) { .ce-placement-map { height: 490px; } }
@media (max-width: 1100px) {
  .campaign-editor { padding: 8px; }
  .ce-header, .ce-footer { padding-inline: 18px; }
  .ce-selectors { padding-inline: 18px; grid-template-columns: 1fr 1.4fr; }
  .ce-workspace { grid-template-columns: minmax(0, 1fr) 220px; }
  .ce-content { padding: 20px 18px; }
  .ce-overview { padding: 20px 15px; }
  .ce-tabs { padding-inline: 14px; }
  .ce-placement-layout { grid-template-columns: minmax(0, 1fr); }
  .ce-placement-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .ce-placement-list > .ce-section-caption { display: none; }
  .ce-placement-map { height: 360px; }
}
@media (max-width: 720px) {
  .campaign-editor { padding: 0; }
  .ce-header { flex-wrap: wrap; gap: 9px; padding: 12px; }
  .ce-header h2 { font-size: 22px; }
  .ce-enabled { order: 3; width: 100%; font-size: 11px; }
  .campaign-editor .ce-close { margin-left: auto; }
  .ce-selectors { padding: 0 12px 12px; gap: 9px; }
  .ce-tabs { padding: 5px 6px 0; gap: 0; }
  .campaign-editor .ce-tab { padding: 10px 8px; font-size: 10px; flex: 1; }
  .ce-workspace { grid-template-columns: minmax(0, 1fr); }
  .ce-overview { display: none; }
  .ce-content { padding: 18px 12px; }
  .ce-field-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ce-resource-grid { grid-template-columns: 1fr; }
  .ce-footer { padding: 10px 12px; }
  .ce-actions { gap: 6px; }
  .ce-actions button { padding: 8px 10px; font-size: 10px; }
  .ce-status { font-size: 10px; }
  .ce-wave-heading { grid-template-columns: 1fr 95px; }
  .ce-wave-heading > button { grid-column: 1 / -1; }
  .ce-placement-map { height: 310px; }
  .ce-placement-list { grid-template-columns: 1fr; }
  .ce-map-tools { grid-template-columns: 1fr 1fr; }
  .ce-map-tools .ce-field:nth-child(3) { grid-column: 1 / -1; }
}
