/* ===== CSS Variables (match desktop) ===== */
:root {
    --bg: #fff8f3;
    --card-bg: #ffffff;
    --primary: #e8745a;
    --primary-hover: #d55f44;
    --primary-light: #fce8e1;
    --primary-alpha: rgba(232, 116, 90, 0.1);
    --text: #3d2e2a;
    --text-secondary: #8a7870;
    --text-tertiary: #c8b8b0;
    --border: #f0e0d8;
    --them-bubble: #f0f0f0;
    --them-text: #333;
    --me-bubble: #e8745a;
    --me-text: #fff;
    --danger: #dc3545;
    --success: #155724;
    --shadow: 0 2px 12px rgba(180, 100, 70, 0.08);
    --shadow-lg: 0 4px 20px rgba(180, 100, 70, 0.12);
    --radius: 14px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

input, textarea, select {
    -webkit-user-select: text;
    user-select: text;
    font-family: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* ===== App Container ===== */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: max(20px, env(safe-area-inset-top));
}

/* ===== Header (desktop style: white bg) ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    flex-shrink: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.app-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.mode-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary);
    white-space: nowrap;
}
.mode-badge.demo { background: #fff3cd; color: #856404; }
.mode-badge.live { background: #d4edda; color: #155724; }

/* Model Status Bar */
.model-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.model-status-disconnected {
    background: #e2e3e3;
    color: #6c757d;
}
.model-status-connected {
    background: #d4edda;
    color: #155724;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Nav buttons (mobile only, hidden on desktop) */
.nav-btn {
    display: none;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: var(--bg);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
}
.nav-btn.active { background: var(--primary); }
.nav-btn:active { transform: scale(0.95); }

/* Icon buttons (settings, mobile access) */
.icon-btn, .header-btn {
    width: 34px;
    height: 34px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 16px;
}
.icon-btn:hover, .header-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== Main Content (three-column layout) ===== */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Panels - all visible on desktop */
.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.contacts-col {
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
}

.chat-col {
    flex: 1;
    min-width: 0;
}

.analysis-col {
    width: 340px;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
}

/* Panel Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.add-btn {
    font-size: 13px;
    color: var(--primary);
    padding: 5px 12px;
    border: none;
    border-radius: 8px;
    background: var(--primary-light);
    cursor: pointer;
    transition: background 0.2s;
}
.add-btn:hover { background: var(--primary); color: #fff; }

/* Chat Header */
.chat-header { gap: 8px; }

.chat-contact-name {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stage-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    background: var(--primary-light);
    color: var(--primary);
    white-space: nowrap;
}

/* ===== Contacts List (desktop style: list, not cards) ===== */
.contacts-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    position: relative;
}
.contact-item:hover { background: var(--primary-light); }
.contact-item:active { transform: scale(0.98); }
.contact-item.active {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.contact-info { flex: 1; min-width: 0; }

.contact-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.contact-stage {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.contact-preview {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ===== Progress Reminder Card ===== */
.progress-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #fff8e1, #fce8e1);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    animation: fadeUp 0.3s ease;
}

.progress-card-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.progress-icon { font-size: 16px; flex-shrink: 0; }

.progress-text {
    flex: 1;
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
    min-width: 0;
}

.refresh-btn {
    flex-shrink: 0;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    width: 26px;
    height: 26px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.refresh-btn:hover { background: var(--primary); transform: rotate(180deg); }

/* ===== Messages Area ===== */
.messages-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Message Bubbles ===== */
.message-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    position: relative;
    animation: fadeUp 0.3s ease;
}

.message-bubble.them {
    align-self: flex-start;
    background: var(--them-bubble);
    color: var(--them-text);
    border-bottom-left-radius: 4px;
}

.message-bubble.me {
    align-self: flex-end;
    background: var(--me-bubble);
    color: var(--me-text);
    border-bottom-right-radius: 4px;
}

.message-text {
    white-space: pre-wrap;
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

.message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 2px;
    text-align: right;
}

/* Copy toast notification */
.copy-toast {
    position: fixed;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}
.copy-toast.show {
    opacity: 1;
}

.message-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.msg-action {
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: background 0.15s;
}
.msg-action:hover { background: var(--primary); color: #fff; }
.msg-action.delete-action { color: #dc3545; }
.msg-action.delete-action:hover { background: #dc3545; color: #fff; }

/* Inline Edit */
.edit-textarea {
    width: 100%;
    min-height: 60px;
    padding: 6px 8px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    margin-bottom: 4px;
}
.message-bubble.me .edit-textarea { border-color: rgba(255, 255, 255, 0.4); }

.edit-buttons {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.edit-save-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.edit-cancel-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 6px;
    background: #eee;
    color: #666;
    font-size: 12px;
    cursor: pointer;
}

/* ===== Chat Input Area ===== */
.chat-input-area {
    padding: 8px 14px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--card-bg);
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.chat-input-row { display: flex; gap: 6px; min-width: 0; }

.message-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.message-input:focus { border-color: var(--primary); }

.send-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.them-btn { background: #e0e0e0; color: #333; }
.them-btn:hover { background: #d0d0d0; }
.me-btn { background: var(--primary); color: #fff; }
.me-btn:hover { background: var(--primary-hover); }

.chat-toolbar {
    display: flex;
    flex-wrap: wrap;   /* 手机窄屏自动换行，避免最右侧“清空”按钮被挤出屏幕 */
    gap: 6px;
    margin-top: 6px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.tool-btn {
    flex: 1 1 calc(50% - 3px);  /* 4 个小按钮两两一行，任意窄屏都放得下，不会溢出 */
    min-width: 0;
    padding: 8px 6px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tool-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Primary tool button (生成回复) - stands out，单独占一整行更醒目 */
.tool-btn.primary-tool {
    flex: 1 1 100%;  /* 智能回复独占一整行，最醒目 */
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}
.tool-btn.primary-tool:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}
.tool-btn.primary-tool:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Copy action button on message bubbles */
.msg-action.copy-action {
    color: var(--text-secondary);
}
.msg-action.copy-action:hover {
    background: var(--primary);
    color: #fff;
}

.danger-text { color: var(--danger); }

/* ===== Analysis Panel ===== */
.analysis-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
}

.analysis-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.analysis-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    animation: fadeUp 0.3s ease;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.card-content {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-wrap;
}

/* ===== Topic & Reply Cards ===== */
.topic-cards, .reply-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.topic-card, .reply-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    animation: fadeUp 0.3s ease;
    position: relative;
}

.topic-card { border-left: 4px solid var(--primary); }

.topic-number, .reply-number {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.topic-content, .reply-content {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 6px;
    padding-right: 30px;
}

.topic-reason, .reply-reason {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
    background: var(--bg);
    padding: 6px 10px;
    border-radius: 6px;
}

.copy-btn {
    padding: 2px 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.copy-btn:hover { border-color: var(--primary); color: var(--primary); }

.reply-actions { display: flex; gap: 6px; }

.fill-btn {
    padding: 2px 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 6px;
    font-size: 11px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.15s;
}
.fill-btn:hover { background: var(--primary); color: #fff; }

.refresh-topics-btn {
    width: 100%;
    margin-top: 12px;
    padding: 8px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.refresh-topics-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== Scene Selector ===== */
.scene-selector { margin-bottom: 12px; }

.scene-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.scene-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.scene-btn {
    padding: 8px 14px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}
.scene-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.scene-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.topics-results { min-height: 60px; }

/* ===== Empty Hint ===== */
.empty-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 20px;
}

/* ===== Modals (desktop style: centered overlay) ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: fadeUp 0.25s ease;
    display: flex;
    flex-direction: column;
}

.reply-sheet { max-width: 460px; max-height: 92vh; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    width: 26px;
    height: 26px;
    border: none;
    background: var(--bg);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.modal-close:hover { background: var(--primary-light); color: var(--primary); }

.modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px;
}

.modal-footer {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
}
.modal-footer .btn-primary { flex: 1; }

/* ===== Form Elements ===== */
.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 12px;
    color: var(--text);
}
.form-group:first-child label { margin-top: 0; }

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--card-bg);
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--primary); }

.form-group textarea { resize: vertical; min-height: 60px; }

.format-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Quoted Message */
.quoted-message {
    background: var(--bg);
    border-left: 3px solid var(--text-secondary);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Presets */
.presets { display: flex; flex-wrap: wrap; gap: 6px; }

.preset-btn {
    padding: 4px 12px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}
.preset-btn:hover { border-color: var(--primary); color: var(--primary); }
.preset-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* Style Buttons */
.style-buttons { display: flex; flex-wrap: wrap; gap: 5px; }

.style-btn {
    padding: 5px 10px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    border-radius: 18px;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.style-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.style-btn.selected { border-color: var(--primary); background: var(--primary); color: #fff; }

/* Replies Content */
.replies-content {
    padding: 0 18px 16px;
    max-height: 35vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== Buttons ===== */
.btn-primary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.btn-secondary {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger {
    padding: 8px 14px;
    border: 2px solid var(--danger);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--danger);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ===== Loading Spinner ===== */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

/* ===== Error Message ===== */
.error-msg {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 10px;
}

/* ===== Animations ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Responsive (mobile: single panel) ===== */
@media (max-width: 768px) {
    .nav-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .app-title { font-size: 16px; }
    .mode-badge { font-size: 10px; }
    .model-status { font-size: 10px; }

    .main-content { position: relative; }

    .panel {
        width: 100%;
        border: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg);
        display: none;
    }

    .panel.active {
        display: flex;
        position: relative;
    }
}

@media (max-width: 320px) {
    .app-title { font-size: 15px; }
    .message-bubble { max-width: 88%; font-size: 13px; }
    .send-btn { padding: 5px 10px; font-size: 12px; }
    .tool-btn { font-size: 11px; padding: 6px 8px; }
    .style-btn { font-size: 11px; padding: 4px 8px; }
}

/* ===== Activation Overlay ===== */
.activation-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #fff8f3 0%, #fce8e1 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.activation-card {
    background: #fff;
    border-radius: 20px;
    padding: 36px 28px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(180, 100, 70, 0.15);
    animation: fadeUp 0.3s ease;
}

.activation-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.activation-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.activation-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.activation-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    text-align: center;
    letter-spacing: 1px;
    color: var(--text);
    background: var(--card-bg);
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 16px;
}
.activation-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 116, 90, 0.1);
}

.activation-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.activation-btn:hover { background: var(--primary-hover); }
.activation-btn:active { transform: scale(0.97); }

.activation-error {
    margin-top: 12px;
    font-size: 13px;
    color: var(--danger);
    min-height: 18px;
}
