* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #111118;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

/* Login screen */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.8rem;
    border: 1px solid rgba(180, 160, 120, 0.2);
    border-radius: 2rem;
    background: transparent;
    color: #e0e0e0;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    background: rgba(180, 160, 120, 0.06);
    border-color: rgba(180, 160, 120, 0.35);
}

.dev-login-btn {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: #999;
    border-color: #333;
}


.logout-link {
    color: #666;
    text-decoration: none;
    font-size: 0.75rem;
}

.logout-link:hover {
    color: #aaa;
}

/* Start screen */
#start-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
}

.start-profile {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    right: 1rem;
    cursor: pointer;
}

.start-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #444;
    transition: border-color 0.2s;
}

.start-profile img:hover {
    border-color: #888;
}

.start-profile .profile-menu {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background: #1e1e36;
    border: 1px solid #333;
    border-radius: 0.5rem;
    overflow: hidden;
    min-width: 120px;
}

.start-profile .profile-menu.open {
    display: block;
}

.start-content {
    text-align: center;
}

.start-content h1 {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 0.4em;
    margin-bottom: 1rem;
    color: #f0f0f0;
    font-family: 'Garamond', 'Georgia', 'Times New Roman', serif;
}

.start-content p {
    font-size: 0.9rem;
    color: #9a8e7e;
    margin-bottom: 1.5rem;
    letter-spacing: 0.03em;
}

.start-settings {
    text-align: left;
    max-width: 340px;
    margin: 0 auto 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(180, 160, 120, 0.15);
    border-radius: 1rem;
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.start-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.start-row:last-child {
    border-bottom: none;
}

.start-row label {
    font-size: 0.8rem;
    color: #777;
    flex-shrink: 0;
}

.start-row select {
    padding: 0.3rem 0.5rem;
    border: none;
    border-radius: 0.4rem;
    background: #2a2a4e;
    color: #ddd;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    text-align: right;
    max-width: 200px;
}

.start-row select option,
.start-row select optgroup {
    background: #2a2a4e;
    color: #e0e0e0;
}

.start-row select:hover,
.start-row select:focus {
    background: #333360;
}

.start-row input[type="text"] {
    padding: 0.3rem 0.5rem;
    border: none;
    border-radius: 0.4rem;
    background: #2a2a4e;
    color: #ddd;
    font-size: 0.85rem;
    width: 140px;
    text-align: right;
}
.start-row input[type="text"]:focus {
    background: #333360;
    outline: none;
}

.start-sub {
    padding: 0 0 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.start-sub input,
.start-sub select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #333;
    border-radius: 0.5rem;
    background: #22223a;
    color: #ddd;
    font-size: 0.8rem;
    outline: none;
}

.start-sub select option,
.start-sub select optgroup {
    background: #22223a;
    color: #e0e0e0;
}

.start-sub input:focus,
.start-sub select:focus {
    border-color: #556;
}

.start-sub select {
    cursor: pointer;
}

.start-content button {
    padding: 0.8rem 3rem;
    border: 1px solid rgba(180, 160, 120, 0.3);
    border-radius: 2rem;
    background: transparent;
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.15em;
    font-family: 'Garamond', 'Georgia', 'Times New Roman', serif;
}

.start-content button:hover {
    background: rgba(180, 160, 120, 0.08);
    border-color: rgba(180, 160, 120, 0.5);
}

#admin-panel {
    margin-top: 2rem;
    width: 100%;
    max-width: 400px;
}

.admin-toggle {
    background: transparent !important;
    border: 1px solid #555 !important;
    color: #888 !important;
    font-size: 0.8rem !important;
    padding: 0.4rem 1rem !important;
    border-radius: 1rem !important;
}

#admin-settings {
    margin-top: 0.8rem;
    padding: 1rem;
    border: 1px solid #333;
    border-radius: 12px;
    background: #16213e;
}

#admin-settings input[type="text"],
#admin-settings input[type="password"] {
    width: 100%;
    padding: 0.5rem;
    background: #111118;
    border: 1px solid #444;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.quota-alert {
    background: #d32f2f;
    color: #fff;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.4;
}
.quota-alert a { color: #ffcdd2; text-decoration: underline; }

#admin-settings button {
    margin-top: 0.5rem;
    background: #4a90d9 !important;
    border: none !important;
    color: #fff !important;
    padding: 0.5rem 1.5rem !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
}

.admin-status {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #4caf50;
    min-height: 1.2rem;
}

.admin-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    color: #aaa;
}
.admin-stats strong { color: #e0e0e0; }

#admin-users {
    margin-top: 0.8rem;
    padding: 1rem;
    border: 1px solid #333;
    border-radius: 12px;
    background: #16213e;
    max-height: 300px;
    overflow-y: auto;
}

.admin-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #2a2a4a;
}
.admin-user-row:last-child { border-bottom: none; }

.admin-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.admin-user-info strong { font-size: 0.85rem; color: #e0e0e0; }
.admin-user-email { font-size: 0.75rem; color: #888; }
.admin-user-meta { font-size: 0.7rem; color: #666; }

.admin-user-admin {
    font-size: 0.75rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}

#admin-usage {
    margin-top: 0.8rem;
    padding: 1rem;
    border: 1px solid #333;
    border-radius: 12px;
    background: #16213e;
}

.admin-usage-row {
    display: flex;
    gap: 1rem;
    padding: 0.3rem 0;
    font-size: 0.8rem;
    color: #aaa;
    border-bottom: 1px solid #2a2a4a;
}
.admin-usage-row:last-child { border-bottom: none; }
.admin-usage-day { color: #e0e0e0; min-width: 80px; }

/* Plans screen */
#plans-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.plans-content {
    text-align: center;
    max-width: 900px;
    padding: 2rem;
}

.plans-content h1 {
    font-size: 2.2rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    margin-bottom: 0.8rem;
    color: #f0f0f0;
    font-family: 'Garamond', 'Georgia', 'Times New Roman', serif;
}

.plans-subtitle {
    font-size: 0.9rem;
    color: #9a8e7e;
    margin-bottom: 3rem;
    line-height: 1.6;
    letter-spacing: 0.02em;
}

.plans-grid {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.plans-card {
    flex: 1;
    max-width: 200px;
    padding: 2rem 1.4rem;
    border: 1px solid rgba(180, 160, 120, 0.12);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.015);
    text-align: center;
    transition: border-color 0.3s, background 0.3s;
}

.plans-card:hover {
    border-color: rgba(180, 160, 120, 0.25);
}

.plans-card.featured {
    border-color: rgba(200, 170, 100, 0.35);
    background: rgba(200, 170, 100, 0.04);
}

.plans-card.current {
    border-color: rgba(180, 160, 120, 0.4);
}

.plans-card-name {
    font-size: 0.75rem;
    font-weight: 400;
    color: #b4a078;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.8rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.plans-card-price {
    font-size: 2.2rem;
    font-weight: 300;
    color: #f0f0f0;
    margin-bottom: 0.8rem;
    font-family: 'Garamond', 'Georgia', 'Times New Roman', serif;
}

.plans-card-price span {
    font-size: 0.8rem;
    color: #777;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.plans-card-desc {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.plans-card-status {
    font-size: 0.75rem;
    color: #b4a078;
}

.plans-card-btn {
    padding: 0.55rem 1.8rem;
    border: 1px solid rgba(180, 160, 120, 0.25);
    border-radius: 2rem;
    background: transparent;
    color: #d4c4a0;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.1em;
}

.plans-card-btn:hover {
    background: rgba(180, 160, 120, 0.1);
    border-color: rgba(180, 160, 120, 0.45);
}

.plans-card-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.plans-back-btn {
    padding: 0.6rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    background: transparent;
    color: #666;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.05em;
}

.plans-back-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: #999;
}

/* Plans CTA (sign-in prompt on plans page) */
#plans-cta {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.plans-cta-text {
    font-size: 0.95rem;
    color: #b4a078;
    margin-bottom: 0.5rem;
    letter-spacing: 0.03em;
}

.plans-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border: 1px solid rgba(180, 160, 120, 0.25);
    border-radius: 2rem;
    background: transparent;
    color: #e0e0e0;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s;
}

.plans-cta-btn:hover {
    background: rgba(180, 160, 120, 0.08);
    border-color: rgba(180, 160, 120, 0.4);
}

/* Login screen plans link */
.plans-link {
    display: block;
    margin-top: 1.5rem;
    color: #b4a078;
    font-size: 0.85rem;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

.plans-link:hover {
    color: #d4c4a0;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

/* Main layout */
#main {
    height: 100vh;
    display: flex;
}

/* Spatial view */
.spatial-view {
    flex: 1;
    position: relative;
}

.spatial-view.drag-over {
    outline: 2px dashed #7eb8da;
    outline-offset: -8px;
    background: rgba(126, 184, 218, 0.05);
}

.character {
    position: absolute;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.character.dragging {
    cursor: grabbing;
    z-index: 10;
    transition: none;
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #2a2a4e;
    border: 2px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 auto 0.4rem;
    transition: all 0.3s;
}

.avatar.you {
    border-color: #556;
    background: #333355;
}

.name {
    font-size: 0.75rem;
    color: #777;
}

/* Character colors */
#char-Alice .avatar  { border-color: #7eb8da; color: #7eb8da; }
#char-Bob .avatar    { border-color: #d4a574; color: #d4a574; }
#char-Carlos .avatar { border-color: #8bc49e; color: #8bc49e; }
#char-Dolly .avatar  { border-color: #c9a0dc; color: #c9a0dc; }

/* You speech feedback */
.you-speech {
    position: absolute;
    top: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: 280px;
    padding: 0.4rem 0.8rem;
    background: #333355;
    border: 1px solid #556;
    border-radius: 0.75rem;
    font-size: 0.8rem;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.you-speech.visible {
    opacity: 1;
}

.you-speech.final {
    color: #e0e0e0;
    border-color: #8bc49e;
}

/* Speaking state */
.character.speaking .avatar {
    transform: scale(1.5);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

#char-Alice.speaking .avatar  { box-shadow: 0 0 24px rgba(126, 184, 218, 0.4); }
#char-Bob.speaking .avatar    { box-shadow: 0 0 24px rgba(212, 165, 116, 0.4); }
#char-Carlos.speaking .avatar { box-shadow: 0 0 24px rgba(139, 196, 158, 0.4); }
#char-Dolly.speaking .avatar  { box-shadow: 0 0 24px rgba(201, 160, 220, 0.4); }
#char-You.speaking .avatar    { box-shadow: 0 0 24px rgba(100, 100, 160, 0.4); }

/* Profile button */
.profile-btn {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    right: 1rem;
    z-index: 10;
    cursor: pointer;
}

.profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #444;
    transition: border-color 0.2s;
}

.profile-img:hover {
    border-color: #888;
}

.profile-menu {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background: #1e1e36;
    border: 1px solid #333;
    border-radius: 0.5rem;
    overflow: hidden;
    min-width: 120px;
}

.profile-menu.open {
    display: block;
}

.profile-menu a {
    display: block;
    padding: 0.6rem 1rem;
    color: #ccc;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background 0.15s;
}

.profile-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Current topic header */
.current-topic {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    color: #888;
    font-size: 0.8rem;
    z-index: 10;
    max-width: 50%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

/* Settings button */
.mode-btn {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    left: 3.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #333;
    background: transparent;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.mode-btn:hover {
    border-color: #556;
    color: #aaa;
}

.desk-speaker-select {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    left: 6rem;
    height: 36px;
    border-radius: 18px;
    border: 1px solid #333;
    background: transparent;
    color: #888;
    padding: 0 12px;
    font-size: 13px;
    cursor: pointer;
    z-index: 10;
    appearance: none;
    -webkit-appearance: none;
}

.desk-speaker-select:hover {
    border-color: #556;
    color: #aaa;
}

.settings-btn {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    left: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #333;
    background: transparent;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.settings-btn:hover {
    border-color: #556;
    color: #aaa;
}

/* Settings panel */
.settings-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 100vw;
    height: 100vh;
    background: #1e1e36;
    border-right: 1px solid #333;
    z-index: 20;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s;
}

.settings-panel.open {
    transform: translateX(0);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #333;
}

.settings-header h2 {
    font-size: 1rem;
    font-weight: 500;
    color: #ccc;
}

.settings-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.settings-close:hover {
    color: #ccc;
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem;
}

.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    margin-bottom: 0.75rem;
}

.settings-section label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 0.75rem;
}

.settings-section select,
.settings-section input[type="text"],
.settings-section input[type="password"] {
    padding: 0.5rem 0.7rem;
    border: 1px solid #333;
    border-radius: 0.5rem;
    background: #111118;
    color: #e0e0e0;
    font-size: 0.8rem;
    outline: none;
}

.settings-section select:focus,
.settings-section input:focus {
    border-color: #556;
}

.settings-section select {
    cursor: pointer;
}

.settings-section .hidden {
    display: none;
}

/* Topics list */
#topics-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: #111118;
    border: 1px solid #333;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    color: #aaa;
}

.topic-item span {
    min-width: 80px;
}

.topic-item input[type="range"] {
    flex: 1;
    min-width: 0;
}

.topic-item .topic-weight {
    min-width: 30px;
    text-align: right;
    color: #666;
    font-size: 0.7rem;
}

.topic-item button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.3rem;
    flex-shrink: 0;
}

.topic-item button:hover {
    color: #e05555;
}

.topic-add {
    display: flex;
    gap: 0.4rem;
}

.topic-add input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid #333;
    border-radius: 0.4rem;
    background: #111118;
    color: #e0e0e0;
    font-size: 0.75rem;
    outline: none;
    min-width: 0;
}

.topic-add button {
    padding: 0.4rem 0.8rem;
    border: 1px solid #444;
    border-radius: 0.4rem;
    background: transparent;
    color: #aaa;
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
}

.topic-add button:hover {
    border-color: #666;
    color: #e0e0e0;
}

/* Character popup dialog */
.char-dialog {
    position: absolute;
    z-index: 20;
    background: #1e1e3a;
    border: 1px solid #444;
    border-radius: 0.75rem;
    padding: 1rem;
    min-width: 180px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.char-dialog-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 0.75rem;
}

.char-dialog label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

.char-dialog input,
.char-dialog select {
    flex: 1;
    padding: 0.4rem 0.5rem;
    border: 1px solid #333;
    border-radius: 0.4rem;
    background: #12122a;
    color: #e0e0e0;
    font-size: 0.8rem;
    outline: none;
}

.char-dialog input:focus,
.char-dialog select:focus {
    border-color: #556;
}

.char-dialog input[type="number"] {
    width: 60px;
    text-align: center;
    flex: none;
}

.char-dialog-actions {
    margin-top: 0.75rem;
    text-align: right;
}

.char-dialog-actions button {
    padding: 0.35rem 1.2rem;
    border: none;
    border-radius: 0.4rem;
    background: #3a3a6a;
    color: #e0e0e0;
    font-size: 0.8rem;
    cursor: pointer;
}

.char-dialog-actions button:hover {
    background: #4a4a8a;
}

/* Range controls */
.range-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: #666;
}

.range-row input[type="range"] {
    flex: 1;
    accent-color: #7eb8da;
}

.range-value {
    text-align: center;
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.2rem;
}

/* Feeds list */
#feeds-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.feed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    background: #111118;
    border: 1px solid #333;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    color: #aaa;
}

.feed-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.feed-item button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.3rem;
    flex-shrink: 0;
}

.feed-item button:hover {
    color: #e05555;
}

.passkey-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    background: #111118;
    border: 1px solid #333;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 0.3rem;
}

.passkey-item small { color: #666; }

.passkey-delete {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.3rem;
}

.passkey-delete:hover { color: #e05555; }

.passkey-login-btn {
    border-color: rgba(120, 160, 180, 0.3) !important;
}

.feed-add {
    display: flex;
    gap: 0.4rem;
}

.feed-add input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid #333;
    border-radius: 0.4rem;
    background: #111118;
    color: #e0e0e0;
    font-size: 0.75rem;
    outline: none;
    min-width: 0;
}

.feed-add button {
    padding: 0.4rem 0.8rem;
    border: 1px solid #444;
    border-radius: 0.4rem;
    background: transparent;
    color: #aaa;
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
}

.feed-add button:hover {
    border-color: #666;
    color: #e0e0e0;
}

/* Settings footer */
.settings-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid #333;
}

.settings-footer button {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #444;
    border-radius: 0.5rem;
    background: #2a2a4e;
    color: #e0e0e0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-footer button:hover {
    background: #3a3a5e;
    border-color: #666;
}

/* Voice enrollment */
.settings-desc {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.5rem;
}
.settings-desc.enrolled {
    color: #8bc49e;
}
.enroll-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #444;
    border-radius: 0.5rem;
    background: #2a2a4e;
    color: #e0e0e0;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.enroll-btn:hover {
    background: #3a3a5e;
    border-color: #666;
}
.enroll-btn.recording {
    background: #4a2a2e;
    border-color: #c44;
    animation: pulse 1s ease-in-out infinite;
}
.enroll-progress {
    margin-top: 0.5rem;
}
.enroll-recording {
    font-size: 0.75rem;
    color: #e88;
    margin-bottom: 0.3rem;
}
.enroll-bar {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}
.enroll-bar-fill {
    height: 100%;
    width: 0%;
    background: #8bc49e;
    transition: width 0.1s linear;
}

/* Topic link */
.topic-link {
    position: absolute;
    top: max(1.5rem, calc(env(safe-area-inset-top) + 0.5rem));
    right: 1.5rem;
    font-size: 0.75rem;
    color: #7eb8da;
    text-decoration: none;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.topic-link.visible {
    opacity: 1;
    pointer-events: auto;
}

.topic-link:hover {
    text-decoration: underline;
}

/* Status indicator */
.status {
    position: absolute;
    bottom: 4.5rem;
    left: 1.5rem;
    font-size: 0.75rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #555;
}

.status-dot.connected {
    background: #8bc49e;
}

.status-dot.loading {
    background: #d4a574;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Bottom bar */
.bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(transparent, #111118 40%);
}

.bottom-bar-inputs {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    width: 100%;
}

.bottom-bar input {
    padding: 0.6rem 1rem;
    border: 1px solid #333;
    border-radius: 1.5rem;
    background: #111118;
    color: #e0e0e0;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    width: 220px;
    min-width: 0;
}

.bottom-bar input:focus {
    border-color: #556;
}

.bottom-bar input::placeholder {
    color: #555;
}

.bottom-bar input:disabled {
    opacity: 0.5;
}

/* Pause button */
.pause-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #333;
    background: #111118;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.pause-btn:hover {
    border-color: #556;
    color: #ccc;
}

/* Mic button */
.mic-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #333;
    background: #111118;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.mic-btn:hover {
    border-color: #556;
    color: #ccc;
}

.mic-btn.active {
    border-color: #e05555;
    color: #e05555;
    background: #2e1a1a;
    animation: pulse-mic 1.5s ease-in-out infinite;
}

@keyframes pulse-mic {
    0%, 100% { box-shadow: 0 0 0 0 rgba(224, 85, 85, 0.3); }
    50% { box-shadow: 0 0 12px 4px rgba(224, 85, 85, 0.2); }
}

/* Hint */
.hint {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.hint.visible {
    opacity: 1;
}

/* Mobile */
@media (max-width: 480px) {
    .avatar {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }

    .bottom-bar input {
        width: 0;
        flex: 1;
        font-size: 16px;
    }


    .status {
        left: 1rem;
    }

    .you-speech {
        max-width: 200px;
        font-size: 0.75rem;
    }

    .start-content h1 {
        font-size: 2rem;
    }

    .settings-panel {
        width: 100vw;
    }

    .topic-link {
        max-width: 60vw;
        right: 1rem;
        top: 1rem;
    }

    .plans-grid {
        flex-direction: column;
        align-items: center;
    }

    .plans-card {
        max-width: 280px;
        width: 100%;
    }
}
