/* AI Life Coach page styles */

/* Safe-area insets for native apps (Capacitor iOS/Android) */
.wisdom-wrap {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.coach-nav {
    margin-bottom: 16px;
}

.coach-back-link {
    color: #7ba8d9;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.coach-back-link:hover {
    color: #5caeff;
}

.coach-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coach-nav-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.coach-nav-link {
    color: #7ba8d9;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.coach-nav-link:hover {
    color: #5caeff;
}

@media (max-width: 480px) {
    .coach-nav-links {
        gap: 10px;
    }
    .coach-nav-link {
        font-size: 12px;
    }
}

.coach-nav-btn {
    background: none;
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 8px;
    color: #7ba8d9;
    cursor: pointer;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s;
}

.coach-nav-btn:hover {
    color: #5caeff;
    border-color: #5caeff;
    background: rgba(92, 174, 255, 0.06);
}

/* User Menu Dropdown */
.coach-user-menu-wrap {
    position: relative;
}
.coach-user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #111d33;
    border: 1px solid rgba(92, 174, 255, 0.15);
    border-radius: 10px;
    min-width: 180px;
    padding: 6px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 100;
}
.coach-user-menu.open {
    display: block;
}
.coach-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #c8d6e5;
    text-decoration: none;
    font-size: 14px;
    font-family: inherit;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.15s;
}
.coach-menu-item:hover {
    background: rgba(92, 174, 255, 0.08);
    color: #fff;
}
.coach-menu-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}
.coach-menu-divider {
    height: 1px;
    background: rgba(92, 174, 255, 0.1);
    margin: 4px 0;
}

/* Memory Panel */
.memory-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100%;
    background: #0d1b35;
    border-left: 1px solid rgba(92, 174, 255, 0.15);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.memory-panel.open {
    right: 0;
}

.memory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.memory-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.memory-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(92, 174, 255, 0.1);
    flex-shrink: 0;
}

.memory-panel-header h3 {
    margin: 0;
    font-size: 16px;
    color: #c5dcf5;
}

.memory-close {
    background: none;
    border: none;
    color: #7ba8d9;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.memory-close:hover {
    color: #5caeff;
}

.memory-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.memory-loading {
    padding: 40px 20px;
    text-align: center;
    color: #5a7da0;
}

.memory-section {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(92, 174, 255, 0.08);
}

.memory-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #5a7da0;
    margin: 0 0 10px;
}

/* Bio section */
.memory-bio {
    width: 100%;
    background: #1a2a4a;
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 8px;
    color: #c5dcf5;
    padding: 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
    outline: none;
    box-sizing: border-box;
}

.memory-bio:focus {
    border-color: #5caeff;
}

.memory-bio-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.memory-char-count {
    font-size: 11px;
    color: #5a7da0;
}

.memory-save-btn {
    background: #5caeff;
    color: #0a142a;
    border: none;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.memory-save-btn:hover {
    background: #7dc0ff;
}

.memory-save-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.memory-msg {
    font-size: 12px;
    margin-top: 6px;
}

.memory-msg.success {
    color: #5caeff;
}

.memory-msg.error {
    color: #e74c3c;
}

/* Coaching styles */
.memory-styles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.memory-style {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid rgba(92, 174, 255, 0.15);
    background: transparent;
    color: #5a7da0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.memory-style-icon {
    font-size: 14px;
}

.memory-style.active {
    border-color: rgba(92, 174, 255, 0.4);
    background: rgba(92, 174, 255, 0.1);
    color: #c5dcf5;
}

.memory-style:hover {
    border-color: rgba(92, 174, 255, 0.3);
}

/* Custom coaching styles */
.memory-style-custom {
    border-style: dashed;
    position: relative;
    padding-right: 8px;
}
.memory-style-custom .memory-style-actions {
    display: inline-flex;
    gap: 2px;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.memory-style-custom:hover .memory-style-actions {
    opacity: 1;
}
.memory-style-edit, .memory-style-delete {
    font-size: 13px;
    padding: 0 3px;
    color: #5a7da0;
    cursor: pointer;
    line-height: 1;
}
.memory-style-edit:hover { color: #7db8f0; }
.memory-style-delete:hover { color: #f07d7d; }
.memory-style-add {
    border-style: dashed;
    color: #4a6a84;
}
.memory-style-add:hover {
    border-color: rgba(92, 174, 255, 0.4);
    color: #7db8f0;
}

/* Custom style form */
.custom-style-form {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(92, 174, 255, 0.15);
    border-radius: 10px;
    background: rgba(10, 20, 35, 0.5);
}
.csf-row {
    margin-bottom: 10px;
}
.csf-row label {
    display: block;
    font-size: 12px;
    color: #7da0c0;
    margin-bottom: 4px;
}
.csf-optional {
    color: #4a6a84;
    font-size: 11px;
}
.csf-row input[type="text"],
.csf-row textarea {
    width: 100%;
    background: rgba(20, 35, 55, 0.6);
    border: 1px solid rgba(92, 174, 255, 0.15);
    border-radius: 6px;
    color: #c5dcf5;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.csf-row input[type="text"]:focus,
.csf-row textarea:focus {
    outline: none;
    border-color: rgba(92, 174, 255, 0.4);
}
.emoji-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.emoji-pick {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(92, 174, 255, 0.1);
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s;
}
.emoji-pick:hover {
    border-color: rgba(92, 174, 255, 0.3);
    background: rgba(92, 174, 255, 0.05);
}
.emoji-pick.selected {
    border-color: rgba(92, 174, 255, 0.5);
    background: rgba(92, 174, 255, 0.15);
}
.csf-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.csf-cancel, .csf-save {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid rgba(92, 174, 255, 0.2);
    transition: all 0.15s;
}
.csf-cancel {
    background: transparent;
    color: #5a7da0;
}
.csf-cancel:hover {
    border-color: rgba(92, 174, 255, 0.3);
}
.csf-save {
    background: rgba(92, 174, 255, 0.15);
    color: #c5dcf5;
}
.csf-save:hover {
    background: rgba(92, 174, 255, 0.25);
}

/* Voice selector */
.memory-voices {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.memory-voice {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 16px;
    border: 1px solid rgba(92, 174, 255, 0.15);
    background: transparent;
    color: #5a7da0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.memory-voice-gender {
    font-size: 11px;
    opacity: 0.6;
}

.memory-voice-name {
    font-weight: 500;
}

.memory-voice-desc {
    opacity: 0.6;
    font-size: 11px;
}

.memory-voice.active {
    border-color: rgba(92, 174, 255, 0.4);
    background: rgba(92, 174, 255, 0.1);
    color: #c5dcf5;
}

.memory-voice:hover {
    border-color: rgba(92, 174, 255, 0.3);
}

/* Traditions */
.memory-traditions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.memory-tradition {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 16px;
    border: 1px solid rgba(92, 174, 255, 0.15);
    background: transparent;
    color: #5a7da0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.memory-tradition img {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.memory-tradition.active {
    border-color: rgba(92, 174, 255, 0.4);
    background: rgba(92, 174, 255, 0.1);
    color: #c5dcf5;
}

.memory-tradition.active img {
    opacity: 1;
}

.memory-tradition:hover {
    border-color: rgba(92, 174, 255, 0.3);
}

/* Context interactions */
.memory-context-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(92, 174, 255, 0.06);
}

.memory-context-item:last-child {
    border-bottom: none;
}

.memory-context-q {
    font-size: 13px;
    color: #c5dcf5;
    margin: 0 0 4px;
    line-height: 1.4;
}

.memory-context-a {
    font-size: 12px;
    color: #5a7da0;
    margin: 0 0 6px;
    line-height: 1.4;
}

.memory-context-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.memory-context-time {
    font-size: 11px;
    color: #3d5a7a;
}

.memory-context-delete {
    background: none;
    border: none;
    color: #5a7da0;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    transition: all 0.2s;
}

.memory-context-delete:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.memory-context-empty {
    color: #3d5a7a;
    font-size: 13px;
    font-style: italic;
    padding: 8px 0;
}

.memory-clear-btn {
    background: none;
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
    font-family: inherit;
    transition: all 0.2s;
}

.memory-clear-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
}

/* Storage toggle */
.memory-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.memory-toggle-label {
    font-size: 13px;
    color: #c5dcf5;
}

.memory-toggle-desc {
    font-size: 12px;
    color: #5a7da0;
    margin: 6px 0 0;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .memory-panel {
        width: 100%;
        right: -100%;
    }
}

.wisdom-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 0;
    text-align: left;
}

.wisdom-header {
    text-align: center;
    margin-bottom: 30px;
}

.wisdom-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.wisdom-header p {
    color: #7ba8d9;
    font-size: 15px;
    margin: 0;
}

.wisdom-disclaimer {
    color: #5a7da0;
    font-size: 11px;
    margin-top: 6px;
    text-align: center;
}

/* Source selector toggle */
.wisdom-sources-details {
    margin-bottom: 20px;
    text-align: center;
}

.wisdom-sources-toggle {
    color: #7ba8d9;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    display: inline-block;
    list-style: none;
    transition: color 0.2s;
}

.wisdom-sources-toggle:hover {
    color: #5caeff;
}

.wisdom-sources-toggle::-webkit-details-marker {
    display: none;
}

.wisdom-sources-toggle::marker {
    display: none;
    content: '';
}

.wisdom-sources-details[open] .wisdom-sources-toggle {
    margin-bottom: 12px;
}

/* Source selector */
.wisdom-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.wisdom-sources-loading {
    color: #7ba8d9;
    font-size: 14px;
    padding: 10px;
}

.wisdom-source-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(92, 174, 255, 0.08);
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
    user-select: none;
}

.wisdom-source-item:hover {
    background: rgba(92, 174, 255, 0.15);
    border-color: rgba(92, 174, 255, 0.4);
}

.wisdom-source-item:has(input:checked) {
    background: rgba(92, 174, 255, 0.2);
    border-color: #5caeff;
}

.wisdom-source-item input[type="checkbox"] {
    display: none;
}

.wisdom-source-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.wisdom-source-name {
    color: #c5dcf5;
    font-weight: 500;
}

.wisdom-source-count {
    color: #5a7da0;
    font-size: 13px;
}

/* Controls */
.wisdom-controls {
    margin-bottom: 20px;
}

.wisdom-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.wisdom-options label {
    color: #7ba8d9;
    font-size: 14px;
}

.wisdom-options select {
    background: #1a2a4a;
    color: #c5dcf5;
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 15px;
    outline: none;
}

.wisdom-options select:focus {
    border-color: #5caeff;
}

/* Intent chips */
.wisdom-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    justify-content: center;
}

.wisdom-chip {
    background: rgba(92, 174, 255, 0.08);
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 20px;
    color: #7dc0ff;
    padding: 6px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.wisdom-chip:hover {
    background: rgba(92, 174, 255, 0.15);
    border-color: rgba(92, 174, 255, 0.4);
}

.wisdom-input-wrap {
    display: flex;
    gap: 10px;
}

/* Contenteditable input */
.wisdom-input-editable {
    flex: 1 1 0;
    min-width: 0;
    display: block;
    background: #1a2a4a;
    color: #c5dcf5;
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    line-height: 1.4;
    min-height: 44px;
    max-height: 120px;
    overflow-y: auto;
    word-wrap: break-word;
    -webkit-user-modify: read-write;
}

.wisdom-input-editable:focus {
    border-color: #5caeff;
}

.wisdom-input-editable:empty::before {
    content: attr(data-placeholder);
    color: #5a7da0;
    pointer-events: none;
}

#wisdom-ask-btn {
    background: #5caeff;
    color: #0a142a;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

#wisdom-ask-btn:hover {
    background: #7dc0ff;
}

#wisdom-ask-btn:disabled {
    background: #3a6a9a;
    cursor: not-allowed;
}

/* Response area */
.wisdom-response {
    margin-top: 20px;
}

.wisdom-output {
    background: rgba(92, 174, 255, 0.05);
    border: 1px solid rgba(92, 174, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    color: #c5dcf5;
    font-size: 16px;
    line-height: 1.7;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
}

/* Markdown styles */
.wisdom-output p { margin: 0 0 12px 0; }
.wisdom-output p:last-child { margin-bottom: 0; }
.wisdom-output strong { color: #e0ecf8; }
.wisdom-output em { color: #9fcbf0; }

.wisdom-md-h2 {
    font-size: 18px;
    color: #5caeff;
    margin: 18px 0 8px 0;
    font-weight: 600;
}

.wisdom-md-h3 {
    font-size: 16px;
    color: #7dc0ff;
    margin: 14px 0 6px 0;
    font-weight: 600;
}

.wisdom-md-list {
    margin: 8px 0;
    padding-left: 20px;
}

.wisdom-md-list li {
    margin-bottom: 4px;
}

.wisdom-md-quote {
    border-left: 3px solid #5caeff;
    padding: 6px 12px;
    margin: 10px 0;
    color: #9fcbf0;
    font-style: italic;
    background: rgba(92, 174, 255, 0.05);
}

/* Tables in markdown output */
.wisdom-md-table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    font-size: 14px;
}

.wisdom-md-table th,
.wisdom-md-table td {
    border: 1px solid rgba(92, 174, 255, 0.2);
    padding: 8px 12px;
    text-align: left;
}

.wisdom-md-table th {
    background: rgba(92, 174, 255, 0.1);
    color: #5caeff;
    font-weight: 600;
}

/* Loading skeleton */
.wisdom-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wisdom-skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, rgba(92, 174, 255, 0.08) 25%, rgba(92, 174, 255, 0.15) 50%, rgba(92, 174, 255, 0.08) 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Action buttons */
.wisdom-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.wisdom-action-btn {
    background: rgba(92, 174, 255, 0.1);
    border: 1px solid rgba(92, 174, 255, 0.2);
    color: #7dc0ff;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.wisdom-action-btn:hover {
    background: rgba(92, 174, 255, 0.2);
    border-color: rgba(92, 174, 255, 0.4);
}

.wisdom-action-btn.bookmarked {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.wisdom-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Reflection prompt */
.wisdom-reflection {
    margin-top: 20px;
    padding: 20px;
    background: rgba(218, 165, 32, 0.06);
    border: 1px solid rgba(218, 165, 32, 0.15);
    border-radius: 10px;
}

.wisdom-reflection-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.wisdom-reflection-title {
    color: #daa520;
    font-weight: 600;
    font-size: 16px;
}

.wisdom-reflection-prompt {
    color: #c5dcf5;
    font-size: 15px;
    margin-bottom: 12px;
    font-style: italic;
}

.wisdom-reflection-input {
    width: 100%;
    background: #1a2a4a;
    color: #c5dcf5;
    border: 1px solid rgba(218, 165, 32, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

.wisdom-reflection-input:focus {
    border-color: #daa520;
}

.wisdom-reflection-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.wisdom-reflection-msg {
    font-size: 13px;
}

/* Toast notification */
.wisdom-toast {
    position: fixed;
    bottom: calc(30px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a2a4a;
    color: #c5dcf5;
    padding: 10px 24px;
    border-radius: 8px;
    border: 1px solid rgba(92, 174, 255, 0.3);
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 9999;
    pointer-events: none;
}

.wisdom-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Suggested questions */
.wisdom-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.wisdom-suggestion-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(92, 174, 255, 0.05);
    border: 1px solid rgba(92, 174, 255, 0.12);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: calc(50% - 5px);
    box-sizing: border-box;
    font-family: inherit;
    color: inherit;
}

.wisdom-suggestion-card:hover {
    background: rgba(92, 174, 255, 0.12);
    border-color: rgba(92, 174, 255, 0.3);
}

.wisdom-suggestion-text {
    color: #c5dcf5;
    font-size: 15px;
    line-height: 1.4;
}

.wisdom-suggestion-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #5a7da0;
    font-size: 13px;
}

.wisdom-suggestion-icon {
    width: 12px;
    height: 12px;
}

/* Daily wisdom */
.daily-wisdom {
    display: none;
    background: rgba(92, 174, 255, 0.06);
    border: 1px solid rgba(92, 174, 255, 0.12);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
}

.daily-wisdom-label {
    color: #5caeff;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.daily-wisdom-text {
    color: #c5dcf5;
    font-size: 16px;
    line-height: 1.6;
    font-style: italic;
    margin-bottom: 10px;
}

.daily-wisdom-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.daily-wisdom-ref {
    color: #7ba8d9;
    font-size: 14px;
}

.daily-wisdom-explore {
    color: #5caeff;
    font-size: 14px;
    text-decoration: none;
}

.daily-wisdom-explore:hover {
    text-decoration: underline;
}

.daily-wisdom-preview,
.daily-wisdom-full {
    display: inline;
}

.daily-wisdom-full p {
    margin: 0 0 12px;
}

.daily-wisdom-expand {
    background: none;
    border: none;
    color: #5caeff;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 6px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: color 0.2s;
}

.daily-wisdom-expand:hover {
    color: #89c4ff;
    text-decoration: underline;
}

/* User stats */
.user-stats {
    display: none;
    text-align: center;
    color: #5a7da0;
    font-size: 14px;
    margin-bottom: 16px;
}

/* Category tooltips */
.wisdom-source-item {
    position: relative;
}

.wisdom-source-desc {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a2a4a;
    color: #c5dcf5;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(92, 174, 255, 0.3);
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 250px;
    white-space: normal;
    z-index: 100;
    pointer-events: none;
}

.wisdom-source-desc::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(92, 174, 255, 0.3);
}

.wisdom-source-item:hover .wisdom-source-desc {
    display: block;
}

.wisdom-error {
    color: #ff6b6b;
}

/* Source references */
.wisdom-refs {
    margin-top: 20px;
}

.wisdom-refs h3 {
    color: #5caeff;
    font-size: 16px;
    margin: 0 0 12px 0;
}

.wisdom-refs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wisdom-ref-item {
    background: rgba(92, 174, 255, 0.05);
    border: 1px solid rgba(92, 174, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
}

.wisdom-ref-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.wisdom-ref-num {
    color: #daa520;
    font-size: 13px;
    font-weight: 700;
    min-width: 24px;
}

.wisdom-ref-religion {
    background: rgba(92, 174, 255, 0.15);
    color: #7dc0ff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.wisdom-ref-reference {
    color: #c5dcf5;
    font-size: 14px;
    font-weight: 600;
}

.wisdom-ref-score {
    color: #5a7da0;
    font-size: 13px;
    margin-left: auto;
}

a.wisdom-ref-religion {
    text-decoration: none;
    color: inherit;
    background: inherit;
    transition: opacity 0.2s;
}

a.wisdom-ref-religion:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.wisdom-ref-source-link {
    color: #5a7da0;
    text-decoration: none;
}

.wisdom-ref-source-link:hover {
    color: #7dc0ff;
    text-decoration: underline;
}

.wisdom-ref-text {
    color: #8fb3d6;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

/* License badge on source refs */
.wisdom-ref-license {
    display: block;
    color: #5a7da0;
    font-size: 13px;
    margin-top: 6px;
}

/* Quota badge */
.wisdom-quota {
    color: #7ba8d9;
    font-size: 13px;
    margin-left: auto;
}

.wisdom-quota-warn {
    color: #ffaa44;
}

.wisdom-quota-exhausted {
    color: #ff6b6b;
}

/* Onboarding modal */
.onboarding-label {
    color: #c5dcf5;
    font-size: 14px;
    margin-bottom: 10px;
}

.onboarding-category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.onboarding-cat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(92, 174, 255, 0.08);
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    user-select: none;
}

.onboarding-cat-item:hover {
    background: rgba(92, 174, 255, 0.15);
}

.onboarding-cat-item:has(input:checked) {
    background: rgba(92, 174, 255, 0.2);
    border-color: #5caeff;
}

.onboarding-cat-item input[type="checkbox"] {
    display: none;
}

.onboarding-cat-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.wisdom-ref-icon {
    width: 12px;
    height: 12px;
    vertical-align: middle;
    margin-right: 2px;
}

.settings-cat-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.wiki-header-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 4px;
}

.onboarding-cat-name {
    color: #c5dcf5;
}

.onboarding-desc {
    color: #5a7da0;
    font-size: 12px;
    margin: 4px 0 12px;
}

.onboarding-char-count {
    display: block;
    text-align: right;
    color: #5a7da0;
    font-size: 11px;
    margin-top: 4px;
}

.onboarding-checkbox {
    margin: 12px 0 4px;
}

.onboarding-btns {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

#onboarding-modal textarea {
    width: 100%;
    background: #1a2a4a;
    color: #c5dcf5;
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

#onboarding-modal textarea:focus {
    border-color: #5caeff;
}

/* Page nav — used on settings, customize, history, bookmarks pages */
.page .coach-nav {
    max-width: 700px;
    margin: 0 auto;
    padding: 16px 20px 0;
}

/* Settings page */
.settings-wrap {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 20px;
    border: none;
    overflow: visible;
    position: static;
    border-radius: 0;
    width: auto;
    box-sizing: border-box;
}
.settings-wrap::before {
    display: none;
}
.settings-wrap label {
    text-align: left;
}
.settings-wrap input {
    height: auto;
}
.settings-wrap select {
    float: none;
    clear: none;
    height: auto;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    color: #5caeff;
    font-size: 16px;
    margin-bottom: 12px;
}

.settings-category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.settings-cat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(92, 174, 255, 0.08);
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.settings-cat-item:has(input:checked) {
    background: rgba(92, 174, 255, 0.2);
    border-color: #5caeff;
}

.settings-cat-item input[type="checkbox"] {
    display: none;
}

.settings-model-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-model-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(92, 174, 255, 0.06);
    border: 1px solid rgba(92, 174, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-model-item:hover {
    border-color: rgba(92, 174, 255, 0.4);
}

.settings-model-item.active {
    background: rgba(92, 174, 255, 0.15);
    border-color: #5caeff;
}

.settings-model-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.settings-model-item input[type="radio"] {
    display: none;
}

.settings-model-name {
    color: #c5dcf5;
    font-size: 14px;
    flex: 1;
}

.settings-model-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(212, 168, 67, 0.2);
    color: #d4a843;
    font-weight: 600;
}

.settings-model-badge.free {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

/* History page */
.history-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
}

.history-item {
    background: rgba(92, 174, 255, 0.05);
    border: 1px solid rgba(92, 174, 255, 0.1);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.history-item-date {
    color: #5a7da0;
    font-size: 13px;
    margin-bottom: 6px;
}

.history-item-question {
    color: #c5dcf5;
    font-weight: 600;
    margin-bottom: 8px;
}

.history-item-answer {
    color: #8fb3d6;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 100px;
    overflow: hidden;
    transition: max-height 0.3s;
}

.history-item-answer.expanded {
    max-height: none;
}

.history-item-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.history-item-actions button {
    font-size: 13px;
    padding: 4px 12px;
}

.history-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 600px) {
    .wisdom-wrap {
        padding: 15px 0;
    }

    .wisdom-header h1 {
        font-size: 24px;
    }

    .wisdom-source-item {
        padding: 6px 10px;
        font-size: 13px;
    }

    .wisdom-input-wrap {
        flex-direction: column;
    }

    #wisdom-ask-btn {
        width: 100%;
    }

    .wisdom-output {
        max-height: 400px;
    }

    .wisdom-chip {
        padding: 5px 12px;
        font-size: 13px;
    }

    .wisdom-source-desc {
        display: none !important;
    }

    .wisdom-suggestion-card {
        width: 100%;
    }
}

/* ─── Wiki Pages ─────────────────────────────────────────── */

.wiki-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
}

.wiki-breadcrumb {
    color: #5a7da0;
    font-size: 14px;
    margin-bottom: 16px;
}

.wiki-breadcrumb a {
    color: #5caeff;
    text-decoration: none;
}

.wiki-breadcrumb a:hover {
    text-decoration: underline;
}

.wiki-intro {
    color: #7ba8d9;
    font-size: 16px;
    margin-bottom: 28px;
    text-align: center;
}

.wiki-description p {
    color: #8fb3d6;
    line-height: 1.7;
    margin-bottom: 14px;
}

.wiki-section {
    margin-bottom: 28px;
}

.wiki-section h2 {
    color: #5caeff;
    font-size: 18px;
    margin-bottom: 12px;
}

.wiki-concepts {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wiki-concepts li {
    color: #c5dcf5;
    padding: 10px 16px;
    background: rgba(92, 174, 255, 0.05);
    border: 1px solid rgba(92, 174, 255, 0.1);
    border-radius: 8px;
    font-size: 15px;
}

.wiki-concepts li::before {
    content: '\2022';
    color: #5caeff;
    margin-right: 10px;
}

.wiki-texts-intro {
    color: #5a7da0;
    font-size: 14px;
    margin-bottom: 12px;
}

.wiki-texts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wiki-text-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(92, 174, 255, 0.05);
    border: 1px solid rgba(92, 174, 255, 0.1);
    border-radius: 8px;
}

.wiki-text-title {
    color: #c5dcf5;
    font-weight: 600;
    font-size: 15px;
}
a.wiki-text-title {
    color: #5caeff;
    text-decoration: none;
}
a.wiki-text-title:hover {
    text-decoration: underline;
}
.library-category {
    margin-bottom: 24px;
}
.library-category h2 {
    margin-bottom: 8px;
}
.library-category h2 a {
    color: #7ba8d9;
    text-decoration: none;
}
.library-category h2 a:hover {
    color: #5caeff;
}

.wiki-text-source {
    color: #5a7da0;
    font-size: 13px;
    text-align: right;
    flex-shrink: 0;
    margin-left: 12px;
}

.wiki-further {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wiki-further li {
    margin-bottom: 8px;
}

.wiki-further a {
    color: #5caeff;
    text-decoration: none;
    font-size: 15px;
}

.wiki-further a:hover {
    text-decoration: underline;
}

.wiki-cta {
    margin-top: 32px;
    text-align: center;
}

.wiki-cta-btn {
    display: inline-block;
    padding: 12px 28px;
    background: #5caeff;
    color: #0a142a;
    font-weight: 700;
    font-size: 15px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.wiki-cta-btn:hover {
    background: #7dc0ff;
}

/* Wiki index grid */
.wiki-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.wiki-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: rgba(92, 174, 255, 0.05);
    border: 1px solid rgba(92, 174, 255, 0.1);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
    width: calc(33.333% - 8px);
    box-sizing: border-box;
    text-align: center;
}

.wiki-card:hover {
    background: rgba(92, 174, 255, 0.12);
    border-color: rgba(92, 174, 255, 0.3);
}

.wiki-card-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
}

.wiki-card-title {
    color: #c5dcf5;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.wiki-card-desc {
    color: #5a7da0;
    font-size: 13px;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .wiki-card {
        width: calc(50% - 6px);
    }

    .wiki-text-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .wiki-text-source {
        margin-left: 0;
        margin-top: 4px;
    }
}

@media (max-width: 400px) {
    .wiki-card {
        width: 100%;
    }
}

/* TTS Audio Player */
.wisdom-audio-player {
    margin: 16px 0 8px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.wisdom-audio-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.wisdom-audio-play-btn {
    background: rgba(218, 165, 32, 0.15);
    color: #daa520;
    border: 1px solid rgba(218, 165, 32, 0.3);
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, opacity 0.2s;
}

.wisdom-audio-play-btn:hover:not(:disabled) {
    background: rgba(218, 165, 32, 0.25);
}

.wisdom-audio-play-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wisdom-audio-progress {
    flex: 1;
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
}

.wisdom-audio-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #daa520, #f0c040);
    border-radius: 4px;
    transition: width 0.1s linear;
    width: 0%;
}

.wisdom-audio-segments {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.wisdom-audio-segment {
    position: absolute;
    top: 0;
    height: 100%;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.wisdom-audio-hover {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(218, 165, 32, 0.15);
    border-radius: 4px;
    display: none;
    pointer-events: none;
}

.wisdom-audio-status {
    font-size: 12px;
    color: #7ba8d9;
    margin-top: 6px;
}

.wisdom-listen-btn.listening {
    color: #f0c040;
}

@media (max-width: 600px) {
    .wisdom-audio-play-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* Text Viewer */
.text-viewer-passages {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.text-viewer-passage {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid rgba(218, 165, 32, 0.3);
    border-radius: 0 6px 6px 0;
}

.text-viewer-passage:hover {
    background: rgba(255, 255, 255, 0.06);
}

.text-viewer-ref {
    font-size: 12px;
    color: #daa520;
    font-weight: 600;
    margin-bottom: 4px;
}

.text-viewer-text {
    font-size: 15px;
    color: #c8ddf0;
    line-height: 1.6;
}

/* Citation links in LLM answers */
.wisdom-citation {
    display: inline;
    color: #daa520;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    vertical-align: super;
    line-height: 1;
    padding: 0 1px;
}

.wisdom-citation:hover {
    color: #f0c040;
    text-decoration: underline;
}

.wisdom-ref-item:target,
.wisdom-ref-item.wisdom-ref-highlight {
    outline: 2px solid #daa520;
    outline-offset: 2px;
    animation: refHighlight 2s ease-out;
}

@keyframes refHighlight {
    0% { background: rgba(218, 165, 32, 0.2); }
    100% { background: transparent; }
}

/* Limit card */
.wisdom-limit-card {
    text-align: center;
    padding: 32px 24px;
    background: rgba(30, 30, 40, 0.8);
    border: 1px solid rgba(218, 165, 32, 0.3);
    border-radius: 16px;
    margin: 8px 0;
}

.wisdom-limit-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.wisdom-limit-title {
    font-size: 20px;
    color: #e0e0e0;
    margin: 0 0 8px 0;
}

.wisdom-limit-text {
    color: #aaa;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 20px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.wisdom-limit-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.wisdom-limit-btn {
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 220px;
}

.wisdom-limit-btn-primary {
    background: linear-gradient(135deg, #daa520, #b8860b);
    color: #fff;
}

.wisdom-limit-btn-primary:hover {
    background: linear-gradient(135deg, #f0c040, #daa520);
    transform: translateY(-1px);
}

.wisdom-limit-btn-secondary {
    background: transparent;
    color: #7dc0ff;
    border: 1px solid rgba(125, 192, 255, 0.3);
    font-size: 13px;
    padding: 8px 20px;
}

.wisdom-limit-btn-secondary:hover {
    background: rgba(125, 192, 255, 0.1);
}

/* Quota nudge banner */
.wisdom-nudge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin-top: 12px;
    background: rgba(218, 165, 32, 0.1);
    border: 1px solid rgba(218, 165, 32, 0.25);
    border-radius: 10px;
    font-size: 13px;
    color: #ccc;
    flex-wrap: wrap;
}

.wisdom-nudge-text {
    flex: 1;
    min-width: 200px;
}

.wisdom-nudge-text strong {
    color: #daa520;
}

.wisdom-nudge-btn {
    background: linear-gradient(135deg, #daa520, #b8860b);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.wisdom-nudge-btn:hover {
    background: linear-gradient(135deg, #f0c040, #daa520);
}

.wisdom-nudge-close {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.wisdom-nudge-close:hover {
    color: #ccc;
}

/* Quota link */
.wisdom-quota-link {
    color: #daa520;
    text-decoration: none;
    font-weight: 600;
}

.wisdom-quota-link:hover {
    text-decoration: underline;
    color: #f0c040;
}

/* Wisdom Pricing Modal */
.wisdom-pricing-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wisdom-pricing-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.wisdom-pricing-modal {
    position: relative;
    background: #1a1a2e;
    border: 1px solid rgba(218, 165, 32, 0.3);
    border-radius: 20px;
    padding: 36px 28px 28px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

.wisdom-pricing-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.wisdom-pricing-close:hover {
    color: #e0e0e0;
}

.wisdom-pricing-title {
    font-size: 22px;
    color: #e0e0e0;
    margin: 0 0 4px 0;
}

.wisdom-pricing-subtitle {
    color: #888;
    font-size: 14px;
    margin: 0 0 24px 0;
}

.wisdom-pricing-tiers {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.wisdom-pricing-tier {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 24px 20px;
    flex: 1;
    min-width: 200px;
    max-width: 260px;
    text-align: left;
    position: relative;
}

.wisdom-pricing-tier-featured {
    border-color: rgba(218, 165, 32, 0.5);
    background: rgba(218, 165, 32, 0.06);
}

.wisdom-pricing-tier-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #daa520, #b8860b);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wisdom-pricing-tier-header {
    font-size: 16px;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 4px;
}

.wisdom-pricing-tier-price {
    font-size: 32px;
    font-weight: 800;
    color: #daa520;
    margin-bottom: 16px;
}

.wisdom-pricing-tier-price span {
    font-size: 14px;
    font-weight: 400;
    color: #888;
}

.wisdom-pricing-tier-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.wisdom-pricing-tier-features li {
    padding: 4px 0;
    font-size: 13px;
    color: #bbb;
    position: relative;
    padding-left: 18px;
}

.wisdom-pricing-tier-features li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: #5cae5c;
    font-weight: 700;
}

.wisdom-pricing-tier-btn {
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wisdom-pricing-tier-btn-primary {
    background: linear-gradient(135deg, #daa520, #b8860b);
    color: #fff;
}

.wisdom-pricing-tier-btn-primary:hover {
    background: linear-gradient(135deg, #f0c040, #daa520);
    transform: translateY(-1px);
}

.wisdom-pricing-tier-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.wisdom-pricing-tier-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
}

.wisdom-pricing-login {
    margin-top: 16px;
    font-size: 13px;
    color: #888;
}

.wisdom-pricing-login a {
    color: #7dc0ff;
    text-decoration: none;
}

.wisdom-pricing-login a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .wisdom-pricing-tiers {
        flex-direction: column;
        align-items: center;
    }
    .wisdom-pricing-tier {
        max-width: 100%;
    }
    .wisdom-pricing-modal {
        padding: 28px 16px 20px;
    }
}

/* Customize Darobodo link on coach page */
.wisdom-customize-link-wrap {
    text-align: center;
    margin-bottom: 16px;
}

.wisdom-customize-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #7ba8d9;
    font-size: 14px;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 8px;
    transition: all 0.2s;
}

.wisdom-customize-link:hover {
    color: #5caeff;
    border-color: #5caeff;
    background: rgba(92, 174, 255, 0.06);
}

/* Customize page */
.customize-wrap {
    max-width: 700px;
}

.customize-section {
    margin-bottom: 30px;
}

.customize-section h3 {
    color: #5caeff;
    font-size: 16px;
    margin-bottom: 12px;
}

/* Memory panel — curriculum section */
.memory-curriculum-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.memory-curriculum-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(92,174,255,0.06);
    border-radius: 8px;
    border: 1px solid rgba(92,174,255,0.1);
}
.memory-curriculum-title {
    color: #c5dcf5;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.memory-curriculum-meta {
    color: #5a7da0;
    font-size: 12px;
    white-space: nowrap;
}
.memory-curriculum-link {
    display: inline-block;
    color: #5caeff;
    font-size: 13px;
    text-decoration: none;
}
.memory-curriculum-link:hover {
    text-decoration: underline;
}

/* Curriculum upload */
.curriculum-field {
    margin-bottom: 12px;
}

.curriculum-field label {
    display: block;
    color: #7ba8d9;
    font-size: 13px;
    margin-bottom: 4px;
}

.curriculum-input {
    width: 100%;
    background: #1a2a4a;
    color: #c5dcf5;
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.curriculum-input:focus {
    border-color: #5caeff;
}

.curriculum-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
}

.curriculum-tab {
    background: #1a2a4a;
    border: 1px solid rgba(92, 174, 255, 0.2);
    color: #7ba8d9;
    padding: 8px 16px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.curriculum-tab:first-child {
    border-radius: 8px 0 0 0;
}

.curriculum-tab:last-child {
    border-radius: 0 8px 0 0;
    border-left: none;
}

.curriculum-tab.active {
    background: rgba(92, 174, 255, 0.1);
    color: #5caeff;
    border-bottom-color: transparent;
}

.curriculum-tab-content {
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 12px;
    background: #1a2a4a;
}

.curriculum-textarea {
    width: 100%;
    background: transparent;
    color: #c5dcf5;
    border: none;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
}

.curriculum-file-input {
    color: #7ba8d9;
    font-size: 13px;
}

.curriculum-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(92, 174, 255, 0.05);
    border: 1px solid rgba(92, 174, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
}

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

.curriculum-item-title {
    color: #c5dcf5;
    display: block;
    font-size: 14px;
}

.curriculum-item-meta {
    color: #5a7da0;
    font-size: 12px;
    margin-top: 2px;
    display: block;
}

.curriculum-delete-btn {
    margin-left: 12px;
    flex-shrink: 0;
}

.curriculum-upgrade {
    background: rgba(92, 174, 255, 0.05);
    border: 1px solid rgba(92, 174, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    color: #7ba8d9;
    font-size: 14px;
}

/* ========== Timeline Page ========== */

.timeline-page-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 20px 40px;
}

.timeline-page-wrap h1 {
    color: #c5dcf5;
    font-size: 22px;
    margin-bottom: 20px;
}

.timeline-goal-form {
    margin-bottom: 28px;
    padding: 18px 20px;
    background: rgba(92, 174, 255, 0.05);
    border: 1px solid rgba(92, 174, 255, 0.1);
    border-radius: 12px;
}

.timeline-goal-form h3 {
    color: #5caeff;
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 600;
}

.timeline-goal-fields {
    display: flex;
    gap: 10px;
    align-items: center;
}

.timeline-goal-input {
    flex: 1;
    background: #1a2a4a;
    color: #c5dcf5;
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.timeline-goal-input:focus {
    border-color: #5caeff;
}

.timeline-goal-input::placeholder {
    color: #5a7da0;
}

.timeline-goal-date {
    background: #1a2a4a;
    color: #c5dcf5;
    border: 1px solid rgba(92, 174, 255, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    color-scheme: dark;
}

.timeline-goal-date:focus {
    border-color: #5caeff;
}

/* Timeline layout */
.timeline-wrap {
    position: relative;
    min-height: 200px;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(92, 174, 255, 0.15);
    transform: translateX(-50%);
}

.timeline-items {
    position: relative;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
    width: 100%;
}

/* Left side = goals */
.timeline-left {
    justify-content: flex-start;
    padding-right: calc(50% + 24px);
}

.timeline-left .timeline-card {
    margin-left: auto;
}

/* Right side = interactions */
.timeline-right {
    justify-content: flex-end;
    padding-left: calc(50% + 24px);
}

/* Timeline dots */
.timeline-dot {
    position: absolute;
    left: 50%;
    top: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 1;
    border: 2px solid #0a142a;
}

.timeline-dot-goal {
    background: #daa520;
}

.timeline-dot-interaction {
    background: #5caeff;
}

/* Cards */
.timeline-card {
    background: rgba(92, 174, 255, 0.05);
    border: 1px solid rgba(92, 174, 255, 0.1);
    border-radius: 10px;
    padding: 14px 16px;
    max-width: 100%;
    transition: border-color 0.2s;
}

.timeline-card:hover {
    border-color: rgba(92, 174, 255, 0.3);
}

.timeline-card-goal {
    border-left: 3px solid #daa520;
}

.timeline-card-interaction {
    border-left: 3px solid #5caeff;
}

.timeline-card-date {
    color: #5a7da0;
    font-size: 12px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.timeline-card-title {
    color: #c5dcf5;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.timeline-card-desc {
    color: #8fb3d6;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 6px;
}

.timeline-card-preview {
    color: #8fb3d6;
    font-size: 13px;
    font-style: italic;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
}

/* Goal-specific styles */
.timeline-goal-target {
    display: block;
    color: #daa520;
    font-size: 12px;
    margin-bottom: 6px;
}

.timeline-goal-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(218, 165, 32, 0.2);
    color: #daa520;
}

.timeline-goal-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.timeline-goal-actions .default-btn {
    font-size: 12px;
    padding: 3px 10px;
}

.timeline-goal-done {
    color: #4caf50;
    font-size: 12px;
    font-weight: 600;
}

.timeline-goal-abandoned {
    color: #5a7da0;
    font-size: 12px;
}

.timeline-goal-status-completed .timeline-card-title {
    text-decoration: line-through;
    opacity: 0.7;
}

.timeline-goal-status-abandoned .timeline-card-title {
    opacity: 0.5;
}

/* Mobile: stack timeline vertically */
@media (max-width: 700px) {
    .timeline-line {
        left: 16px;
    }

    .timeline-left,
    .timeline-right {
        padding-left: 36px;
        padding-right: 0;
    }

    .timeline-left .timeline-card {
        margin-left: 0;
    }

    .timeline-dot {
        left: 16px;
    }

    .timeline-goal-fields {
        flex-direction: column;
    }

    .timeline-goal-input,
    .timeline-goal-date {
        width: 100%;
        box-sizing: border-box;
    }

    .timeline-goal-form .default-btn {
        width: 100%;
    }
}
