/**
 * 공통 세그먼트 컨트롤 (프리셋 토글 등)
 * - 보더/선택/곡률 규칙
 * - 페이지별 크기·배치는 style_adventure / style_manage 에서 오버라이드
 */

.adventure-preset-toggle-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
}

.adventure-preset-toggle {
    --preset-radius: 8px;
    display: inline-flex;
    flex-wrap: nowrap;
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    flex-shrink: 0;
    box-sizing: border-box;
}

.btn-preset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 36px;
    min-width: 40px;
    max-width: 100%;
    padding: 0 12px;
    margin: 0;
    /* 칸 사이는 오른쪽 보더 1줄만 */
    border: 1px solid #dee2e6;
    border-left-width: 0;
    border-radius: 0;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: lining-nums;
    letter-spacing: 0.02em;
    line-height: 1;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    z-index: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-preset > .btn-preset-label {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adventure-preset-toggle > .btn-preset:first-child {
    border-left-width: 1px;
    border-radius: var(--preset-radius) 0 0 var(--preset-radius);
}

.adventure-preset-toggle > .btn-preset:last-child {
    border-radius: 0 var(--preset-radius) var(--preset-radius) 0;
}

.adventure-preset-toggle > .btn-preset:only-child {
    border-left-width: 1px;
    border-radius: var(--preset-radius);
}

.btn-preset:hover {
    background: #f1f5f9;
    color: #334155;
    z-index: 1;
}

.btn-preset.active {
    background: var(--pland-brand-solid, #6e84ff);
    color: #fff;
    border-color: var(--pland-brand-solid, #6e84ff);
    border-left-width: 1px;
    z-index: 2;
}

.btn-preset:has(+ .btn-preset.active) {
    border-right-width: 0;
}

.btn-preset.active:hover {
    background: var(--pland-brand-solid-hover, #5a73e6);
    color: #fff;
    border-color: var(--pland-brand-solid-hover, #5a73e6);
}

.btn-preset:has(+ .btn-preset.active:hover) {
    border-right-width: 0;
}

.btn-preset:disabled,
.btn-preset.is-placeholder {
    color: #cbd5e1;
    background: #f8fafc;
    cursor: not-allowed;
    opacity: 0.85;
}

.btn-preset:disabled:hover,
.btn-preset.is-placeholder:hover {
    color: #cbd5e1;
    background: #f8fafc;
}

/* === 다크 모드 === */
[data-theme='dark'] .adventure-preset-toggle {
    border: none;
    background: transparent;
}

[data-theme='dark'] .btn-preset {
    background: #1e293b;
    color: #94a3b8;
    border-color: #475569;
}

[data-theme='dark'] .btn-preset:hover {
    background: #334155;
    color: #e2e8f0;
}

[data-theme='dark'] .btn-preset.active {
    background: var(--pland-brand-solid, #6e84ff);
    color: #fff;
    border-color: var(--pland-brand-solid, #6e84ff);
    border-left-width: 1px;
    box-shadow: none;
}

[data-theme='dark'] .btn-preset:has(+ .btn-preset.active) {
    border-right-width: 0;
}

[data-theme='dark'] .btn-preset.active:hover {
    background: var(--pland-brand-solid-hover, #5a73e6);
    color: #fff;
    border-color: var(--pland-brand-solid-hover, #5a73e6);
}

[data-theme='dark'] .btn-preset:has(+ .btn-preset.active:hover) {
    border-right-width: 0;
}

[data-theme='dark'] .btn-preset:disabled,
[data-theme='dark'] .btn-preset.is-placeholder {
    color: #475569;
    background: #1e293b;
    cursor: not-allowed;
    opacity: 0.85;
}

[data-theme='dark'] .btn-preset:disabled:hover,
[data-theme='dark'] .btn-preset.is-placeholder:hover {
    color: #475569;
    background: #1e293b;
}
