.ai-campus-editor-panel {
    position: fixed;
    top: 72px;
    right: 16px;
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100vh - 88px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 120000;
    background: rgba(18, 22, 30, 0.96);
    color: #f5f0e8;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    padding: 0;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
}

.ai-campus-editor-panel h2 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
}

.ai-campus-editor-panel-header {
    flex: 0 0 auto;
    margin-bottom: 0;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-campus-editor-category-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 6px;
}

.ai-campus-editor-category-tab {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(245, 240, 232, 0.72);
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.ai-campus-editor-category-tab.is-active {
    background: rgba(201, 169, 110, 0.18);
    border-color: rgba(201, 169, 110, 0.55);
    color: #f5f0e8;
}

.ai-campus-editor-category {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px 16px;
}

.ai-campus-editor-category[hidden] {
    display: none !important;
}

.ai-campus-editor-panel-footer {
    flex: 0 0 auto;
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(18, 22, 30, 0.98);
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.22);
}

.ai-campus-editor-panel section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-campus-editor-category section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ai-campus-editor-panel h3 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #c9a96e;
}

.ai-campus-editor-block-spacing {
    margin-top: 12px;
}

.ai-campus-editor-block-spacing h4 {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(245, 240, 232, 0.9);
}

.ai-campus-editor-field {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.ai-campus-editor-field label {
    font-size: 12px;
    color: rgba(245, 240, 232, 0.75);
}

.ai-campus-editor-field input[type="text"],
.ai-campus-editor-field input[type="number"],
.ai-campus-editor-field input[type="color"] {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #f5f0e8;
    padding: 8px 10px;
    font-size: 13px;
}

.ai-campus-editor-field input[type="range"] {
    width: 100%;
}

.ai-campus-design-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-campus-design-section-title {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(201, 169, 110, 0.9);
    text-transform: uppercase;
}

.ai-campus-design-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
}

.ai-campus-design-grid-2 .ai-campus-editor-field {
    margin-bottom: 0;
}

.ai-design-range-v {
    display: inline-block;
    min-width: 42px;
    margin-left: 8px;
    font-size: 12px;
    color: rgba(245, 240, 232, 0.7);
}

.ai-campus-editor-field select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #f5f0e8;
    padding: 8px 10px;
    font-size: 13px;
}

.ai-design-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(245, 240, 232, 0.85);
}

/* Figma-style design panel */
.ai-ds-panel {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ai-ds-type {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(245, 240, 232, 0.55);
    letter-spacing: 0.02em;
}

.ai-ds-section {
    padding: 10px 0 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-ds-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.ai-ds-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(245, 240, 232, 0.72);
    text-transform: uppercase;
}

.ai-ds-head-btn {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(245, 240, 232, 0.45);
    font-size: 16px;
    line-height: 1;
    cursor: default;
    padding: 0;
}

.ai-ds-dim-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
    margin-bottom: 4px;
}

.ai-ds-dim-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.ai-ds-dim-label {
    flex-shrink: 0;
    width: 14px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(245, 240, 232, 0.45);
}

.ai-ds-dim-cell input[type="number"] {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: #f5f0e8;
    padding: 5px 8px;
    font-size: 12px;
}

.ai-ds-inline-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.ai-ds-inline-row:last-child {
    margin-bottom: 0;
}

.ai-ds-inline-label {
    flex-shrink: 0;
    font-size: 12px;
    color: rgba(245, 240, 232, 0.65);
}

.ai-ds-inline-input {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.ai-ds-inline-input input[type="number"] {
    width: 64px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: #f5f0e8;
    padding: 5px 8px;
    font-size: 12px;
    text-align: right;
}

.ai-ds-unit {
    font-size: 11px;
    color: rgba(245, 240, 232, 0.45);
}

.ai-ds-paint-row {
    position: relative;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 44px auto 22px 22px;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.ai-ds-sel-color-row {
    position: relative;
    grid-template-columns: 28px minmax(0, 1fr) 44px auto minmax(72px, 1fr);
}

.ai-ds-sel-color-count {
    font-size: 11px;
    color: rgba(245, 240, 232, 0.5);
    text-align: right;
    white-space: nowrap;
}

.ai-ds-swatch {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0;
    cursor: pointer;
    background: #d9d9d9;
}

.ai-ds-color-native {
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    opacity: 0;
    cursor: pointer;
    border: 0;
    padding: 0;
}

.ai-ds-hex {
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: #f5f0e8;
    padding: 5px 8px;
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ai-ds-hex[readonly] {
    color: rgba(245, 240, 232, 0.55);
    text-transform: none;
    font-family: inherit;
    letter-spacing: 0;
}

.ai-ds-opacity-num {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: #f5f0e8;
    padding: 5px 6px;
    font-size: 11px;
    text-align: right;
    -moz-appearance: textfield;
    appearance: textfield;
    cursor: ew-resize;
}

.ai-ds-inline-input input[type="number"]::-webkit-inner-spin-button,
.ai-ds-inline-input input[type="number"]::-webkit-outer-spin-button,
.ai-ds-opacity-num::-webkit-inner-spin-button,
.ai-ds-opacity-num::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ai-ds-inline-input input[type="number"].ai-ds-scrub-num,
.ai-ds-scrub-num {
    cursor: ew-resize;
    -moz-appearance: textfield;
    appearance: textfield;
}

.ai-ds-inline-input input[type="number"].ai-ds-scrub-num::-webkit-inner-spin-button,
.ai-ds-inline-input input[type="number"].ai-ds-scrub-num::-webkit-outer-spin-button,
.ai-ds-scrub-num::-webkit-inner-spin-button,
.ai-ds-scrub-num::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#ai-design-opacity-num {
    cursor: ew-resize;
    -moz-appearance: textfield;
    appearance: textfield;
}

#ai-design-opacity-num::-webkit-inner-spin-button,
#ai-design-opacity-num::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ai-ds-icon-btn {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(245, 240, 232, 0.4);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.ai-ds-icon-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(245, 240, 232, 0.85);
}

.ai-ds-icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.ai-ds-fill-types {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.ai-ds-fill-type {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.18);
    color: rgba(245, 240, 232, 0.7);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}

.ai-ds-fill-type.is-active {
    border-color: rgba(201, 169, 110, 0.75);
    background: rgba(201, 169, 110, 0.15);
    color: #f5f0e8;
}

.ai-ds-fill-type:hover {
    background: rgba(255, 255, 255, 0.08);
}

.ai-ds-fill-patterns {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.ai-ds-fill-pattern {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.18);
    color: rgba(245, 240, 232, 0.7);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.ai-ds-fill-pattern.is-active {
    border-color: rgba(201, 169, 110, 0.75);
    background: rgba(201, 169, 110, 0.15);
    color: #f5f0e8;
}

.ai-ds-fill-pattern:hover {
    background: rgba(255, 255, 255, 0.08);
}

.ai-ds-icon-btn.is-off {
    opacity: 0.4;
}

.ai-ds-icon-btn.is-removed {
    color: rgba(201, 169, 110, 0.95);
}

.ai-ds-select {
    min-width: 72px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: #f5f0e8;
    padding: 5px 8px;
    font-size: 12px;
    cursor: pointer;
}

.ai-ds-text-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: #f5f0e8;
    padding: 7px 10px;
    font-size: 12px;
}

.ai-ds-row-note {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: rgba(245, 240, 232, 0.48);
}

.ai-ds-type-section .ai-ds-paint-row {
    margin-bottom: 10px;
}

.ai-ds-type-font-row select,
.ai-ds-type-style-row select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: #f5f0e8;
    padding: 7px 10px;
    font-size: 12px;
}

.ai-ds-type-font-row {
    margin-bottom: 6px;
}

.ai-ds-type-style-row {
    display: grid;
    grid-template-columns: 1fr 64px;
    gap: 6px;
    margin-bottom: 8px;
}

.ai-ds-type-size {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: #f5f0e8;
    padding: 7px 4px 7px 8px;
    font-size: 12px;
    text-align: right;
    color-scheme: dark;
}

/* 다크 패널: 기본 number 스피너(검정 화살표) → 밝게 */
.ai-ds-type-size::-webkit-inner-spin-button,
.ai-ds-type-size::-webkit-outer-spin-button {
    opacity: 1;
    filter: invert(1) brightness(1.1);
}

.ai-ds-type-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.ai-ds-type-metric {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    padding: 0 8px;
    min-height: 32px;
}

.ai-ds-type-metric-icon {
    flex-shrink: 0;
    font-size: 11px;
    color: rgba(245, 240, 232, 0.45);
    width: 14px;
    text-align: center;
}

.ai-ds-type-metric-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: #f5f0e8;
    font-size: 12px;
    padding: 6px 0;
    outline: none;
    pointer-events: auto;
}

.ai-ds-type-metric-input.ai-ds-scrub-num {
    cursor: ew-resize;
}

.ai-ds-type-metric-input::placeholder {
    color: rgba(245, 240, 232, 0.38);
}

.ai-ds-type-align-block {
    padding-top: 4px;
}

.ai-ds-type-align-head {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(245, 240, 232, 0.55);
    letter-spacing: 0.04em;
}

.ai-ds-align-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ai-ds-align-row:last-child {
    margin-bottom: 0;
}

.ai-ds-align-axis {
    flex-shrink: 0;
    width: 28px;
    font-size: 11px;
    color: rgba(245, 240, 232, 0.45);
}

.ai-ds-align-btns {
    display: flex;
    flex: 1;
    gap: 2px;
    padding: 2px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-ds-align-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(245, 240, 232, 0.55);
    cursor: pointer;
    padding: 0;
}

.ai-ds-align-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(245, 240, 232, 0.85);
}

.ai-ds-align-btn.is-active {
    background: rgba(201, 169, 110, 0.22);
    color: #f5f0e8;
    box-shadow: inset 0 0 0 1px rgba(201, 169, 110, 0.45);
}

.ai-ds-polygon-count input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: #f5f0e8;
    padding: 7px 10px;
    font-size: 12px;
}

.ai-ds-actions {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-ds-tabs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-ds-tabs-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-ds-tabs-row.is-active .ai-ds-tabs-label {
    border-color: rgba(201, 169, 110, 0.45);
}

.ai-ds-tabs-pick {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(245, 240, 232, 0.75);
    cursor: pointer;
}

.ai-ds-tabs-label {
    flex: 1;
    min-width: 0;
}

.ai-ds-tabs-del {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(245, 240, 232, 0.55);
    cursor: pointer;
}

.ai-ds-tabs-del:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ai-ds-section .ai-campus-editor-field {
    margin-bottom: 8px;
}

.ai-ds-section .ai-campus-editor-field label {
    font-size: 11px;
    color: rgba(245, 240, 232, 0.55);
}

.ai-campus-editor-scrub-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.ai-campus-editor-scrub-wrap input[type="text"] {
    flex: 1;
    min-width: 0;
}

.ai-campus-editor-scrub-handle {
    flex-shrink: 0;
    width: 12px;
    min-width: 12px;
    height: 24px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.16);
    cursor: ew-resize;
    padding: 0;
}

.ai-campus-editor-scrub-handle:hover {
    background: rgba(255, 255, 255, 0.32);
}

.ai-campus-editor-scrub-handle:active {
    background: rgba(201, 169, 110, 0.55);
}

.ai-campus-editor-actions {
    display: flex;
    gap: 8px;
    margin-top: 0;
}

.ai-campus-editor-actions button {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ai-campus-editor-actions button[data-action="save"] {
    background: #1a73e8;
    color: #fff;
}

.ai-campus-editor-actions button[data-action="preview"] {
    background: rgba(255, 255, 255, 0.08);
    color: #f5f0e8;
}

.ai-campus-editor-status {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12px;
    color: rgba(245, 240, 232, 0.72);
}

.ai-campus-editor-hint {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(245, 240, 232, 0.65);
}

.ai-campus-editor-section-note {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(245, 240, 232, 0.58);
}

.ai-campus-editor-text-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.55;
    color: rgba(245, 240, 232, 0.72);
}

.ai-campus-layer-gui {
    margin-top: 4px;
}

.ai-campus-layer-gui .dg .close-button {
    display: none !important;
}

.ai-campus-layer-gui .dg,
.ai-campus-smoke-gui .dg {
    width: 100% !important;
    color: #f5f0e8;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
}

.ai-campus-layer-gui .dg.main,
.ai-campus-smoke-gui .dg.main {
    margin: 0;
}

.ai-campus-layer-gui .dg .cr,
.ai-campus-smoke-gui .dg .cr {
    border-left-color: #c9a96e;
}

.ai-campus-layer-gui .dg .c input[type="text"],
.ai-campus-smoke-gui .dg .c input[type="text"] {
    color: #f5f0e8;
}

.ai-campus-layer-fallback,
.ai-campus-smoke-fallback {
    display: grid;
    gap: 10px;
}

.ai-campus-layer-stack {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.ai-campus-layer-stack-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.ai-campus-layer-stack-label {
    font-size: 12px;
    color: rgba(245, 240, 232, 0.85);
}

.ai-campus-layer-stack-actions {
    display: flex;
    gap: 6px;
}

.ai-campus-layer-stack-actions button {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #f5f0e8;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
}

.ai-campus-layer-stack-actions button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ai-campus-layer-inset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    margin-top: 10px;
}

.ai-campus-layer-inset-grid .ai-campus-editor-field {
    margin-bottom: 0;
}

.ai-campus-editor-upload {
    display: flex;
    gap: 8px;
}

.ai-campus-editor-upload button {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #f5f0e8;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .ai-campus-editor-panel {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-height: 48vh;
        border-radius: 14px 14px 0 0;
    }
}

/* === Content-block editor (콘텐츠 블록 tab) === */

.ai-campus-editor-block-library {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.ai-campus-editor-block-library button {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #f5f0e8;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.ai-campus-editor-block-library button:hover {
    background: rgba(201, 169, 110, 0.18);
    border-color: rgba(201, 169, 110, 0.5);
    color: #fff;
}

.ai-campus-editor-block-props {
    margin-top: 12px;
}

.ai-campus-block-align-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.ai-campus-block-align-buttons button {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #f5f0e8;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
}

.ai-campus-block-align-buttons button.is-active {
    background: rgba(201, 169, 110, 0.22);
    border-color: rgba(201, 169, 110, 0.55);
    color: #fff;
}

.ai-campus-block-action {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #f5f0e8;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.ai-campus-block-action + .ai-campus-block-action {
    margin-top: 6px;
}

.ai-campus-block-action:hover {
    background: rgba(201, 169, 110, 0.18);
    border-color: rgba(201, 169, 110, 0.45);
}

/* === Canvas: per-block visual states (edit mode only) === */

#campus-content.campus-editor-blocks {
    width: 100%;
    box-sizing: border-box;
}

body.youth-ai-campus-edit:not(.ai-campus-view-preview) #campus-content > .editor-block {
    z-index: 1;
}

.editor-block {
    position: relative;
    transition: outline-color 0.15s ease, box-shadow 0.15s ease;
    outline: 1px dashed transparent;
    outline-offset: 6px;
    border-radius: 4px;
}

body.youth-ai-campus-edit:not(.ai-campus-view-preview) .editor-block:hover {
    outline-color: rgba(201, 169, 110, 0.4);
}

body.youth-ai-campus-edit:not(.ai-campus-view-preview) .editor-block.is-selected {
    outline-color: rgba(201, 169, 110, 0.9);
    outline-style: solid;
    box-shadow: 0 0 0 1px rgba(201, 169, 110, 0.2);
}

.editor-block.is-dragging {
    opacity: 0.45;
}

.editor-block.is-drop-target.drop-before::before,
.editor-block.is-drop-target.drop-after::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #4a90ff;
    border-radius: 2px;
}

.editor-block.is-drop-target.drop-before::before { top: -6px; }
.editor-block.is-drop-target.drop-after::after { bottom: -6px; }

/* In view mode hide all editor-block decorations */
body.ai-campus-view-preview .editor-block,
body:not(.youth-ai-campus-edit) .editor-block {
    outline: none !important;
    box-shadow: none !important;
}

/* Placeholder text via [data-placeholder] for empty editable */
.editor-block [data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: rgba(245, 240, 232, 0.4);
    pointer-events: none;
}

/* === Floating hover controls (singleton, anchored next to hovered block) === */

.ai-campus-block-controls {
    position: fixed;
    z-index: 119500;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    border-radius: 8px;
    background: rgba(18, 22, 30, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
}

.ai-campus-block-controls button {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #f5f0e8;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.ai-campus-block-controls button:hover {
    background: rgba(201, 169, 110, 0.22);
}

.ai-campus-block-controls [data-control="drag"] {
    cursor: grab;
}

.ai-campus-block-controls [data-control="drag"]:active {
    cursor: grabbing;
}

.ai-campus-block-controls [data-control="delete"]:hover {
    background: rgba(207, 46, 46, 0.32);
    color: #fff;
}

/* View mode hides hover controls entirely */
body.ai-campus-view-preview .ai-campus-block-controls,
body:not(.youth-ai-campus-edit) .ai-campus-block-controls {
    display: none !important;
}

.ai-ds-multi-head {
    margin-bottom: 12px;
}

.ai-ds-multi-head strong {
    display: block;
    font-size: 13px;
    color: #f5f0e8;
}

.ai-ds-multi-hint {
    margin: 4px 0 0;
    font-size: 11px;
    color: rgba(245, 240, 232, 0.55);
    line-height: 1.4;
}

.ai-ds-text-format-row {
    display: flex;
    gap: 6px;
    margin: 8px 0 4px;
}

.ai-ds-text-fmt-btn {
    min-width: 30px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: #f5f0e8;
    font-size: 13px;
    cursor: pointer;
}

.ai-ds-text-fmt-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ai-ds-text-run-hint {
    margin: 0 0 8px;
    font-size: 11px;
    line-height: 1.45;
    color: rgba(245, 240, 232, 0.55);
}

/* 보기 미리보기: 패널 본문·탭 숨기고 상단에 «편집으로 돌아가기»만 */
body.ai-campus-view-preview .ai-campus-editor-panel {
    top: max(72px, env(safe-area-inset-top, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
    left: auto;
    bottom: auto;
    width: auto;
    min-width: 0;
    max-width: min(320px, calc(100vw - 24px));
    max-height: none;
    overflow: visible;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
}

body.ai-campus-view-preview .ai-campus-editor-panel-header,
body.ai-campus-view-preview .ai-campus-editor-category {
    display: none !important;
}

body.ai-campus-view-preview .ai-campus-editor-panel-footer {
    margin: 0;
    padding: 8px 10px;
    border-top: none;
    box-shadow: none;
    background: rgba(18, 22, 30, 0.94);
}

body.ai-campus-view-preview .ai-campus-editor-status {
    display: none !important;
}

body.ai-campus-view-preview .ai-campus-editor-actions {
    margin: 0;
    gap: 0;
}

body.ai-campus-view-preview .ai-campus-editor-actions button[data-action="save"] {
    display: none !important;
}

body.ai-campus-view-preview .ai-campus-editor-actions button[data-action="preview"] {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f5f0e8;
}

body.ai-campus-view-preview .ai-campus-editor-actions button[data-action="preview"]:hover {
    background: rgba(255, 255, 255, 0.18);
}
