/* LP設定タブ — 白ベース・シアンアクセント */
.lp-settings {
    --lp-cyan: #00bfff;
    --lp-cyan-soft: rgba(0, 191, 255, 0.12);
    --lp-cyan-border: rgba(0, 191, 255, 0.45);
    --lp-white: #ffffff;
    --lp-bg: #f8fafb;
    --lp-border: #e2e8f0;
    --lp-text: #1e293b;
    --lp-muted: #64748b;
    --lp-radius: 12px;
    color: var(--lp-text);
    font-size: 0.9rem;
}

.lp-settings * { box-sizing: border-box; }

.lp-settings-card {
    background: var(--lp-white);
    border: 1px solid var(--lp-border);
    border-radius: var(--lp-radius);
    padding: 20px;
    margin-bottom: 16px;
}

.lp-settings-card h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    color: var(--lp-cyan);
    font-weight: 700;
}

.lp-settings-card h3 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: var(--lp-text);
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--lp-cyan-soft);
}

.lp-settings-lead {
    margin: 0 0 16px;
    font-size: 0.82rem;
    color: var(--lp-muted);
    line-height: 1.5;
}

.lp-settings-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
}

.lp-settings-main { min-width: 0; }

.lp-settings-preview-col {
    position: sticky;
    top: 72px;
}

.lp-settings-preview-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--lp-muted);
    margin: 0 0 8px;
    letter-spacing: 0.04em;
}

/* カラースウォッチ */
.lp-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 4px;
}

.lp-color-swatch {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    padding: 0;
    background: var(--swatch-bg);
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.06);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.lp-color-swatch:hover {
    transform: scale(1.06);
}

.lp-color-swatch.is-selected {
    border-color: var(--lp-cyan);
    box-shadow: 0 0 0 3px var(--lp-cyan-soft), inset 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.lp-color-swatch__name {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.68rem;
    color: var(--lp-muted);
    margin-top: 6px;
}

.lp-color-swatch-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* フォントプリセット */
.lp-font-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.lp-font-preset {
    display: block;
    width: 100%;
    padding: 14px 12px;
    border: 2px solid var(--lp-border);
    border-radius: 10px;
    background: var(--lp-white);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lp-font-preset:hover {
    border-color: var(--lp-cyan-border);
}

.lp-font-preset.is-selected {
    border-color: var(--lp-cyan);
    box-shadow: 0 0 0 3px var(--lp-cyan-soft);
}

.lp-font-preset__sample {
    font-size: 1rem;
    color: var(--lp-text);
    margin-bottom: 4px;
    line-height: 1.4;
}

.lp-font-preset__label {
    font-size: 0.68rem;
    color: var(--lp-muted);
}

/* ブロックリスト */
.lp-block-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lp-block-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--lp-bg);
    border: 1px solid var(--lp-border);
    border-radius: 10px;
    cursor: grab;
}

.lp-block-row.is-disabled {
    opacity: 0.55;
}

.lp-block-row__left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.lp-block-row__icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.lp-block-row__name {
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-block-row__drag {
    font-size: 0.7rem;
    color: var(--lp-muted);
    opacity: 0.5;
}

/* トグル */
.lp-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.lp-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.lp-toggle__track {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s;
}

.lp-toggle__track::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.lp-toggle input:checked + .lp-toggle__track {
    background: var(--lp-cyan);
}

.lp-toggle input:checked + .lp-toggle__track::after {
    transform: translateX(20px);
}

.lp-block-row__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.lp-block-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--lp-border);
    border-radius: 8px;
    background: var(--lp-white);
    color: var(--lp-text);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 0.15s, background 0.15s;
}

.lp-block-btn:hover:not(:disabled) {
    border-color: var(--lp-cyan);
    background: var(--lp-cyan-soft);
}

.lp-block-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.lp-block-btn--gear {
    font-size: 0.95rem;
}

/* 簡易プレビュー */
.lp-mini-preview {
    border: 1px solid var(--lp-border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--lp-white);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.lp-mini-preview__frame {
    max-width: 260px;
    margin: 0 auto;
}

.lp-mini-preview__tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--preview-border, #e8e4dc);
    background: var(--preview-surface, #fff);
    overflow-x: auto;
}

.lp-mini-preview__tab {
    flex: 1;
    padding: 8px 4px;
    font-size: 0.55rem;
    text-align: center;
    color: var(--lp-muted);
    white-space: nowrap;
    font-family: var(--preview-font, serif);
}

.lp-mini-preview__tab.is-active {
    color: var(--preview-accent, #1a1a1a);
    border-bottom: 2px solid var(--preview-accent, #1a1a1a);
    margin-bottom: -1px;
}

.lp-mini-preview__hero {
    height: 100px;
    background: var(--preview-hero, linear-gradient(135deg, #faf9f7, #e8e4dc));
    display: flex;
    align-items: flex-end;
    padding: 12px;
}

.lp-mini-preview__hero-text {
    font-family: var(--preview-font, serif);
    font-size: 0.7rem;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    line-height: 1.3;
}

.lp-mini-preview__body {
    padding: 12px;
    background: var(--preview-bg, #faf9f7);
    font-family: var(--preview-font, serif);
}

.lp-mini-preview__line {
    height: 6px;
    background: var(--preview-border, #e8e4dc);
    border-radius: 3px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.lp-mini-preview__line--short { width: 60%; }
.lp-mini-preview__line--btn {
    height: 24px;
    background: var(--preview-accent, #1a1a1a);
    opacity: 0.35;
    border-radius: 6px;
    margin-top: 12px;
}

/* ブロック設定パネル */
.lp-block-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 4000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.lp-block-panel-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.lp-block-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(100%, 380px);
    height: 100%;
    height: 100dvh;
    background: var(--lp-white);
    z-index: 4001;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.lp-block-panel.is-open {
    transform: translateX(0);
}

.lp-block-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--lp-border);
    flex-shrink: 0;
}

.lp-block-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--lp-text);
}

.lp-block-panel__close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--lp-bg);
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--lp-muted);
}

.lp-block-panel__body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.lp-block-panel__body label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--lp-muted);
}

.lp-block-panel__body input,
.lp-block-panel__body textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 18px;
    border: 1px solid var(--lp-border);
    border-radius: 8px;
    background: var(--lp-white);
    color: var(--lp-text);
    font-size: 0.88rem;
    font-family: inherit;
}

.lp-block-panel__body textarea {
    min-height: 100px;
    resize: vertical;
}

.lp-col-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.lp-col-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--lp-border);
    border-radius: 8px;
    background: var(--lp-white);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--lp-text);
    transition: border-color 0.15s, background 0.15s;
}

.lp-col-btn.is-selected {
    border-color: var(--lp-cyan);
    background: var(--lp-cyan-soft);
    color: var(--lp-cyan);
}

.lp-block-panel__save {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--lp-cyan);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

/* LP設定内フォーム（既存項目） */
.lp-settings .lp-form-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--lp-border);
}

.lp-settings .lp-form-section h3 {
    margin-top: 0;
}

.lp-settings .form-control,
.lp-settings input[type="text"],
.lp-settings input[type="url"],
.lp-settings input[type="file"],
.lp-settings textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--lp-border);
    border-radius: 8px;
    background: var(--lp-white);
    color: var(--lp-text);
    box-sizing: border-box;
}

.lp-settings .btn-sub {
    background: var(--lp-bg);
    color: var(--lp-text);
    border: 1px solid var(--lp-border);
}

.lp-settings .btn-sub:hover {
    border-color: var(--lp-cyan);
}

.lp-settings .btn-lp-save {
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: var(--lp-cyan);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.lp-settings .btn-lp-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lp-settings .btn-lp-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: var(--lp-cyan);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, box-shadow 0.15s;
}

.lp-settings .btn-lp-preview:hover {
    opacity: 0.92;
    box-shadow: 0 2px 12px rgba(0, 191, 255, 0.35);
}

.lp-settings .btn-lp-preview--block {
    width: 100%;
    margin-bottom: 12px;
    padding: 12px 18px;
}

.lp-settings-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.lp-settings-publish {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--lp-border);
    border-radius: 8px;
    background: var(--lp-bg);
    cursor: pointer;
    font-size: 0.88rem;
}

.lp-settings-publish input {
    width: 18px;
    height: 18px;
    accent-color: var(--lp-cyan);
    margin: 0;
}

.lp-settings-url {
    font-size: 0.78rem;
    color: var(--lp-muted);
    word-break: break-all;
    margin: 0 0 12px;
}

.lp-settings-url code {
    color: var(--lp-cyan);
    font-size: 0.78rem;
}

.lp-img-list { display: flex; flex-wrap: wrap; gap: 10px; }
.lp-img-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }

@media (max-width: 900px) {
    .lp-settings-layout {
        grid-template-columns: 1fr;
    }

    .lp-settings-preview-col {
        position: static;
        order: -1;
    }

    .lp-mini-preview__frame {
        max-width: 100%;
    }

    .lp-font-presets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .lp-block-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .lp-block-row__left { order: 1; }

    .lp-block-row__center {
        order: 2;
        justify-self: start;
    }

    .lp-block-row__actions {
        order: 3;
        justify-self: end;
    }

    .lp-color-swatch {
        width: 42px;
        height: 42px;
    }
}
