/* --- Typography & Resets --- */
h1.logo {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
}

button {
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
}

/* Focus Accessibility */
:focus-visible {
    outline: 1px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* --- Buttons --- */
.btn-icon {
    font-size: 16px;
    color: var(--text-muted);
    padding: 4px 8px;
    transition: color var(--duration-fast) var(--ease-standard);
}

.btn-icon:hover {
    color: var(--text-main);
}

/* --- Dimension Tabs --- */
.dimension-tabs {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 24px 0;
    border-bottom: 1px solid transparent;
}

.dim-tab {
    font-size: 14px;
    color: var(--text-muted);
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    transition: all var(--duration-fast) var(--ease-standard);
}

.dim-tab:hover {
    color: var(--text-main);
}

.dim-tab.active {
    color: var(--text-main);
    font-weight: 500;
    border-bottom-color: var(--text-main);
}

/* --- Reading Stream Items (No Cards) --- */
.stream-item {
    display: flex;
    gap: 24px;
    margin-bottom: 48px;
    opacity: 0.4;
    transition: opacity var(--duration-normal) var(--ease-standard);
    cursor: pointer;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.stream-item.active {
    opacity: 1;
}

.stream-item:hover {
    opacity: 0.8;
}

.stream-time {
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 48px;
    padding-top: 4px;
}

.stream-text {
    font-family: var(--font-editorial);
    font-size: 16px;
    line-height: 1.8;
    color: inherit;
    margin: 0;
}

.stream-item.active .stream-text {
    font-weight: 500;
}

/* --- Chat Stream (Flat Text) --- */
.chat-stream {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chat-message {
    font-size: 14px;
    line-height: 1.6;
}

.user-msg {
    color: var(--text-muted);
    text-align: right;
}

.ai-msg {
    color: var(--text-main);
    text-align: left;
}

.system-msg {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    font-style: italic;
}

/* Inline Command Links */
.chat-cmd-link {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-color: var(--border-color);
    text-underline-offset: 4px;
    font-weight: 500;
    transition: text-decoration-color var(--duration-fast);
}

.chat-cmd-link:hover {
    text-decoration-color: var(--text-main);
}

/* --- Chat Input --- */
.chat-input-wrapper {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

#chatInput {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 14px;
    outline: none;
    transition: border-color var(--duration-fast);
}

#chatInput:focus {
    border-bottom-color: var(--text-main);
}

/* --- Player Controls --- */
.player-progress-container {
    height: 4px;
    width: 100%;
    cursor: pointer;
    position: relative;
}

.progress-track {
    height: 100%;
    background-color: var(--border-color);
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: var(--accent-color);
    width: 0%;
    pointer-events: none;
}

.player-controls {
    display: flex;
    align-items: center;
    padding: 0 24px;
    flex: 1;
    gap: 24px;
}

.track-meta {
    flex: 1;
    min-width: 0;
}

.track-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.time-display {
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: var(--text-muted);
}

/* --- Resume Sync Button --- */
.resume-sync-btn {
    position: absolute;
    bottom: calc(var(--player-height) + 24px);
    right: 24px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    z-index: 20;
    transition: opacity var(--duration-normal), transform var(--duration-normal);
}

.resume-sync-btn.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

/* --- Global Loading --- */
.global-loading {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-main);
    z-index: 1000;
    animation: pulseOpacity 2s infinite;
}

@keyframes pulseOpacity {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hidden { display: none !important; }

.empty-state {
    text-align: center;
    margin-top: 100px;
    color: var(--text-muted);
    font-size: 14px;
}
