        .segment-group {
            display: inline-flex;
            border: 1px solid var(--v2-border);
            border-radius: var(--v2-radius-md);
            overflow: hidden;
        }
        .segment-btn {
            padding: 8px 20px;
            font-size: var(--v2-text-sm);
            font-weight: 500;
            background: transparent;
            color: var(--v2-text-secondary);
            border: none;
            border-right: 1px solid var(--v2-border);
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
        }
        .segment-btn:last-child { border-right: none; }
        .segment-btn:hover { background: var(--v2-bg-hover); }
        .segment-btn.active {
            background: var(--v2-accent);
            color: var(--v2-fg-on-accent);
        }
        .segment-hint {
            margin-top: 6px;
            font-size: var(--v2-text-xs);
            color: var(--v2-fg-subtle);
        }
        .lang-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 0;
        }
        .lang-row + .lang-row { border-top: 1px solid var(--v2-border); }
        .lang-default {
            font-size: var(--v2-text-xs);
            color: var(--v2-fg-muted);
            background: var(--v2-bg-hover);
            padding: 2px 8px;
            border-radius: var(--v2-radius-sm);
        }

        /* Voice selection */
        .voice-list { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; }
        .voice-card {
            display: flex; align-items: center; gap: 12px;
            padding: 12px; border-radius: var(--v2-radius-md);
            border: 2px solid var(--v2-border);
            cursor: pointer; transition: border-color 0.15s, background 0.15s;
        }
        .voice-card:hover { background: var(--v2-bg-hover); }
        .voice-card.selected { border-color: var(--v2-accent); background: var(--v2-accent-subtle, rgba(139,92,246,0.06)); }
        .voice-card-info { flex: 1; min-width: 0; }
        .voice-card-name { font-size: var(--v2-text-sm); font-weight: 600; color: var(--v2-fg); }
        .voice-card-badge {
            font-size: var(--v2-text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: var(--v2-tracking-wide);
            padding: 2px 6px; border-radius: var(--v2-radius-sm);
        }
        /* Voice gender badges: intentional category colors, not in canonical --v2-* palette. */
        .voice-card-badge.badge-female { background: rgba(236,72,153,0.12); color: #ec4899; }
        .voice-card-badge.badge-male { background: rgba(59,130,246,0.12); color: #3b82f6; }
        .voice-play-btn {
            width: 32px; height: 32px; border-radius: 50%;
            border: 1px solid var(--v2-border); background: var(--v2-bg);
            color: var(--v2-fg-muted); cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: background 0.15s, color 0.15s; flex-shrink: 0;
        }
        .voice-play-btn:hover { background: var(--v2-accent); color: var(--v2-fg-on-accent); border-color: var(--v2-accent); }
        .voice-play-btn.playing { background: var(--v2-accent); color: var(--v2-fg-on-accent); border-color: var(--v2-accent); }
        .voice-filter-row { display: flex; gap: 8px; margin-bottom: 12px; }
        .voice-filter-btn {
            padding: 4px 12px; font-size: var(--v2-text-xs); font-weight: 500;
            border: 1px solid var(--v2-border); border-radius: var(--v2-radius-full);
            background: transparent; color: var(--v2-fg-muted); cursor: pointer;
            transition: background 0.15s, color 0.15s, border-color 0.15s;
        }
        .voice-filter-btn:hover { background: var(--v2-bg-hover); }
        .voice-filter-btn.active { background: var(--v2-accent); color: var(--v2-fg-on-accent); border-color: var(--v2-accent); }

        @media (max-width: 768px) {
            .voice-list { max-height: none; overflow-y: visible; }
        }

        /* Greeting preview */
        .greeting-preview-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 8px;
        }
        .greeting-preview-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 14px;
            font-size: var(--v2-text-xs);
            font-weight: 500;
            color: var(--v2-accent);
            background: var(--v2-accent-subtle);
            border: none;
            border-radius: var(--v2-radius-md);
            cursor: pointer;
            transition: background 0.15s, opacity 0.15s;
        }
        .greeting-preview-btn:hover { background: var(--v2-accent-ring); }
        .greeting-preview-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .greeting-preview-btn .spinner {
            width: 14px; height: 14px;
            border: 2px solid var(--v2-accent-subtle);
            border-top-color: var(--v2-accent);
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
        }
        .greeting-preview-note {
            margin-top: 8px;
            font-size: var(--v2-text-xs);
            line-height: var(--v2-leading-normal);
            color: var(--v2-fg-muted);
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .greeting-display {
            font-size: var(--v2-text-sm);
            color: var(--v2-fg-muted);
            font-style: italic;
            line-height: var(--v2-leading-normal);
        }

        /* Greeting section (Main + Alternate cards) */
        .greeting-section {
            display: grid;
            grid-template-columns: 1fr;
            gap: var(--v2-space-6);
            margin-top: var(--v2-space-8);
        }
        .greeting-section + .v2-section-card {
            margin-top: var(--v2-space-8);
        }
        @media (max-width: 900px) {
            .greeting-section {
                gap: var(--v2-space-4);
            }
        }
        .greeting-card-main,
        .greeting-card-alt {
            display: flex;
            flex-direction: column;
        }
        .greeting-card-main .v2-section-body,
        .greeting-card-alt .v2-section-body {
            flex: 1;
        }
        .greeting-card-actions {
            display: inline-flex;
            align-items: center;
            gap: var(--v2-space-3);
        }
        .greeting-enabled-toggle {
            position: relative;
        }
        .greeting-enabled-toggle.is-disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }
        .greeting-card-alt .v2-section-body .greeting-empty {
            font-size: var(--v2-text-sm);
            color: var(--v2-fg-muted);
            font-style: italic;
            line-height: var(--v2-leading-normal);
        }
        .greeting-summary-line {
            margin-top: var(--v2-space-3);
            padding: var(--v2-space-2) var(--v2-space-3);
            background: var(--v2-bg-hover);
            border-radius: var(--v2-radius-sm);
            font-size: var(--v2-text-xs);
            color: var(--v2-fg-muted);
            line-height: var(--v2-leading-normal);
        }
        .greeting-summary-line .greeting-summary-icon {
            display: inline-block;
            margin-right: var(--v2-space-2);
            opacity: 0.7;
        }
        .greeting-card-alt .greeting-mode-label {
            display: inline-flex;
            align-items: center;
            padding: 2px 8px;
            font-size: var(--v2-text-xs);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: var(--v2-tracking-wide);
            color: var(--v2-accent);
            background: var(--v2-accent-subtle);
            border-radius: var(--v2-radius-sm);
        }
        .greeting-card-alt .greeting-runtime-warning {
            margin-top: var(--v2-space-3);
            padding: var(--v2-space-3);
            background: var(--v2-bg-hover);
            border: 1px solid var(--v2-border);
            border-radius: var(--v2-radius-md);
            font-size: var(--v2-text-xs);
            color: var(--v2-fg-muted);
            line-height: var(--v2-leading-normal);
        }

        /* Greeting modal — tag chips, mode segment, schedule editor, disclaimer block */
        .greeting-tag-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px;
            font-size: var(--v2-text-xs);
            font-weight: 500;
            color: var(--v2-accent);
            background: var(--v2-accent-subtle);
            border: 1px solid transparent;
            border-radius: var(--v2-radius-sm);
            cursor: grab;
            transition: background 0.15s, border-color 0.15s;
        }
        .greeting-tag-chip:hover {
            background: var(--v2-accent-ring);
            border-color: var(--v2-accent);
        }
        .greeting-tag-chip:active { cursor: grabbing; }

        /* Contenteditable greeting editor (replaces <textarea> so tags can render
           as draggable pills inline). Mimics .v2-input padding/border. */
        .greeting-editor {
            min-height: 64px;
            padding: 8px 12px;
            line-height: 1.5;
            white-space: pre-wrap;
            overflow-wrap: anywhere;
            cursor: text;
            outline: none;
            transition: border-color 0.15s, box-shadow 0.15s;
        }
        .greeting-editor:focus {
            border-color: var(--v2-accent);
            box-shadow: 0 0 0 3px var(--v2-accent-ring, rgba(139, 92, 246, 0.18));
        }
        .greeting-editor:empty::before {
            content: attr(data-placeholder);
            color: var(--v2-fg-subtle);
            pointer-events: none;
        }
        .greeting-editor.greeting-editor-disabled {
            opacity: 0.55;
            cursor: not-allowed;
            background: var(--v2-bg-hover);
        }
        .greeting-editor.greeting-editor-disabled .greeting-tag-pill {
            cursor: not-allowed;
        }

        /* Tag pill rendered inside the editor (atomic, draggable). */
        .greeting-tag-pill {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            margin: 0 1px;
            padding: 2px 10px;
            font-size: var(--v2-text-xs);
            font-weight: 500;
            line-height: 1.4;
            color: var(--v2-accent);
            background: var(--v2-accent-subtle);
            border: 1px solid var(--v2-accent-ring, rgba(139, 92, 246, 0.35));
            border-radius: var(--v2-radius-full, 999px);
            cursor: grab;
            user-select: none;
            white-space: nowrap;
            vertical-align: baseline;
            transition: background 0.15s, border-color 0.15s, transform 0.1s;
        }
        .greeting-tag-pill:hover {
            background: var(--v2-accent-ring);
            border-color: var(--v2-accent);
        }
        .greeting-tag-pill:active { cursor: grabbing; }
        .greeting-tag-pill.greeting-tag-pill-dragging {
            opacity: 0.4;
        }

        /* Drop indicator — vertical bar that follows the drag, showing where
           the tag will land. Fixed-positioned at the body level so it can
           extend outside the editor's overflow if needed. */
        .greeting-drop-indicator {
            position: fixed;
            width: 2px;
            margin-left: -1px;
            background: var(--v2-accent);
            border-radius: 1px;
            box-shadow: 0 0 0 1px var(--v2-accent-ring, rgba(139, 92, 246, 0.3));
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.08s linear;
            z-index: 10000;
        }
        .greeting-drop-indicator.is-active {
            opacity: 1;
            animation: greeting-drop-pulse 0.9s ease-in-out infinite;
        }
        @keyframes greeting-drop-pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.55; }
        }
        .greeting-mode-segment {
            display: inline-flex;
            border: 1px solid var(--v2-border);
            border-radius: var(--v2-radius-md);
            overflow: hidden;
            margin-bottom: var(--v2-space-4);
        }
        .greeting-mode-segment .greeting-mode-btn {
            padding: 8px 20px;
            font-size: var(--v2-text-sm);
            font-weight: 500;
            background: transparent;
            color: var(--v2-fg-muted);
            border: none;
            border-right: 1px solid var(--v2-border);
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
        }
        .greeting-mode-segment .greeting-mode-btn:last-child { border-right: none; }
        .greeting-mode-segment .greeting-mode-btn:hover { background: var(--v2-bg-hover); }
        .greeting-mode-segment .greeting-mode-btn.active {
            background: var(--v2-accent);
            color: var(--v2-fg-on-accent);
        }
        .greeting-schedule-editor {
            display: flex;
            flex-direction: column;
            gap: var(--v2-space-2);
            padding: var(--v2-space-3);
            background: var(--v2-bg-surface);
            border: 1px solid var(--v2-border);
            border-radius: var(--v2-radius-md);
        }
        .greeting-schedule-tz-label {
            font-size: var(--v2-text-xs);
            color: var(--v2-fg-muted);
        }
        .greeting-schedule-row {
            display: flex;
            flex-wrap: nowrap;
            align-items: center;
            gap: var(--v2-space-2);
            padding: var(--v2-space-2) var(--v2-space-2) var(--v2-space-2) var(--v2-space-3);
            background: var(--v2-bg);
            border: 1px solid var(--v2-border);
            border-radius: var(--v2-radius-sm);
        }
        .greeting-schedule-row.has-error {
            border-color: var(--v2-danger, #ef4444);
            background: rgba(239, 68, 68, 0.06);
        }
        .greeting-schedule-row .greeting-schedule-day {
            flex: 0 0 120px;
            width: 120px;
            padding: 6px 28px 6px 10px;
            font-size: var(--v2-text-sm);
            background-position: right 8px center;
        }
        .greeting-schedule-row .greeting-schedule-times {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            flex: 0 1 auto;
            min-width: 0;
        }
        .greeting-schedule-row .greeting-schedule-time-input {
            width: 88px;
            padding: 6px 6px;
            font-size: var(--v2-text-sm);
            color: var(--v2-fg);
            background: var(--v2-bg-surface);
            border: 1px solid var(--v2-border);
            border-radius: var(--v2-radius-sm);
        }
        .greeting-schedule-row .greeting-schedule-allday {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            flex: 0 0 auto;
            font-size: var(--v2-text-xs);
            color: var(--v2-fg-muted);
            white-space: nowrap;
        }
        .greeting-schedule-row .greeting-schedule-delete {
            margin-left: auto;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            padding: 0;
            flex: 0 0 auto;
            font-size: 18px;
            line-height: 1;
            color: var(--v2-fg-muted);
            background: transparent;
            border: 1px solid transparent;
            border-radius: var(--v2-radius-sm);
            cursor: pointer;
            transition: background 0.15s, color 0.15s, border-color 0.15s;
        }
        .greeting-schedule-row .greeting-schedule-delete:hover {
            background: var(--v2-bg-hover);
            color: var(--v2-fg);
            border-color: var(--v2-border);
        }
        .greeting-schedule-empty {
            padding: var(--v2-space-3) var(--v2-space-4);
            font-size: var(--v2-text-xs);
            color: var(--v2-fg-muted);
            background: var(--v2-bg);
            border: 1px dashed var(--v2-border);
            border-radius: var(--v2-radius-sm);
        }
        .greeting-schedule-add {
            align-self: flex-start;
            padding: 6px 12px;
            font-size: var(--v2-text-xs);
            font-weight: 500;
            color: var(--v2-accent);
            background: var(--v2-accent-subtle);
            border: 1px dashed var(--v2-accent);
            border-radius: var(--v2-radius-sm);
            cursor: pointer;
        }
        .greeting-schedule-add:hover { background: var(--v2-accent-ring); }
        .greeting-schedule-error {
            margin-top: 4px;
            font-size: var(--v2-text-xs);
            color: var(--v2-danger, #ef4444);
        }
        .greeting-disclaimer-block {
            margin-top: var(--v2-space-4);
            padding: var(--v2-space-4);
            background: var(--v2-bg-surface);
            border: 1px solid var(--v2-border);
            border-radius: var(--v2-radius-md);
        }
        .greeting-disclaimer-block .greeting-disclaimer-toggle-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: var(--v2-space-3);
        }
        .greeting-disclaimer-block .greeting-disclaimer-text-row {
            margin-top: var(--v2-space-3);
        }
        .greeting-tag-menu {
            display: inline-flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 6px;
            margin-top: var(--v2-space-3);
        }
        .greeting-tag-menu .segment-hint {
            margin-top: 0;
        }
        .greeting-resolved-preview {
            margin-top: var(--v2-space-4);
            padding: var(--v2-space-4);
            background: var(--v2-bg-hover);
            border-radius: var(--v2-radius-md);
            font-size: var(--v2-text-sm);
            color: var(--v2-fg);
            line-height: var(--v2-leading-normal);
        }
        .greeting-resolved-preview-label {
            display: block;
            margin-bottom: 4px;
            font-size: var(--v2-text-xs);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: var(--v2-tracking-wide);
            color: var(--v2-fg-muted);
        }

        /* Greeting edit modals (Main + Alternate): two-column layout — form on the left, preview on the right with its own surface */
        .greeting-edit-modal .greeting-edit-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
            gap: var(--v2-space-5);
            align-items: start;
        }
        .greeting-edit-modal .greeting-edit-form-col { min-width: 0; }
        .greeting-edit-modal .greeting-edit-preview-col {
            min-width: 0;
            position: sticky;
            top: 0;
            align-self: start;
        }
        .greeting-edit-modal .greeting-edit-preview-col .greeting-resolved-preview {
            margin-top: 0;
            background: var(--v2-bg-inset);
            border: 1px solid var(--v2-border);
        }
        @media (max-width: 720px) {
            .greeting-edit-modal .greeting-edit-grid {
                grid-template-columns: 1fr;
            }
            .greeting-edit-modal .greeting-edit-preview-col {
                position: static;
            }
        }

        /* Ambient sound preview (Background noise dropdown) */
        .noise-dropdown .v2-dropdown-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }
        .noise-dropdown .ambient-option-label { flex: 1; min-width: 0; }
        .ambient-preview-btn {
            width: 24px; height: 24px; border-radius: 50%;
            border: 1px solid var(--v2-border); background: var(--v2-bg);
            color: var(--v2-fg-muted); cursor: pointer;
            display: inline-flex; align-items: center; justify-content: center;
            transition: background 0.15s, color 0.15s, border-color 0.15s;
            flex-shrink: 0;
        }
        .ambient-preview-btn:hover { background: var(--v2-accent); color: var(--v2-fg-on-accent); border-color: var(--v2-accent); }
        .ambient-preview-btn.playing { background: var(--v2-accent); color: var(--v2-fg-on-accent); border-color: var(--v2-accent); }
        .ambient-preview-btn .spinner {
            width: 12px; height: 12px;
            border: 2px solid var(--v2-accent-subtle);
            border-top-color: var(--v2-accent);
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
        }

        /* Persona name field — input + Randomize button on one row */
        .persona-name-row {
            display: flex; gap: 8px; align-items: stretch;
        }
        .persona-name-row .v2-input { flex: 1; min-width: 0; }
        .persona-randomize-btn {
            flex: 0 0 auto;
            display: inline-flex; align-items: center; gap: 6px;
            white-space: nowrap;
        }
        @media (max-width: 480px) {
            .persona-name-row { flex-direction: column; align-items: stretch; }
        }
