/* LifePages — Memoir Builder Styles */
/* Mobile-first, warm memoir aesthetic */

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

:root {
    --cream: #faf7f2;
    --cream-dark: #f0ebe3;
    --text: #2c2420;
    --text-light: #6b5e54;
    --accent: #8b6f4e;
    --accent-light: #c4a97d;
    --border: #e0d6ca;
    --white: #ffffff;
    --shadow: rgba(44, 36, 32, 0.08);
    --shadow-md: rgba(44, 36, 32, 0.12);

    /* Status colors */
    --draft-bg: #e8e8e8;
    --draft-text: #666;
    --submitted-bg: #dbeafe;
    --submitted-text: #1e40af;
    --approved-bg: #dcfce7;
    --approved-text: #166534;

    /* Prompt category accents */
    --highlight-border: #86c49a;
    --highlight-bg: #f0faf3;
    --real-talk-border: #e0a56a;
    --real-talk-bg: #fef7ef;

    --danger: #dc3545;
    --danger-hover: #c82333;

    --radius: 8px;
    --radius-sm: 4px;
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--cream);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === Header === */
.site-header {
    background: var(--white);
    border-bottom: 2px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    color: var(--accent);
    margin: 0;
}

.header-tagline {
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
}

/* === Layout === */
.admin-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* === Panels === */
.panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.panel h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    min-height: 40px;
    min-width: 44px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background: #7a6043;
}

.btn-small {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    min-height: 32px;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--cream);
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    font-size: 1.1rem;
    color: var(--text-light);
    min-height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.btn-icon:hover {
    background: var(--cream-dark);
}

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

/* === Forms === */
.inline-form {
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.form-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

input[type="text"],
input[type="email"],
select,
textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
    transition: border-color var(--transition);
    min-height: 40px;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(139, 111, 78, 0.15);
}

input[type="text"],
input[type="email"] {
    flex: 1;
    min-width: 120px;
}

select {
    min-width: 140px;
}

/* === Tabs === */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
    min-height: 44px;
}

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

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* === Book Header === */
.book-create {
    text-align: center;
    padding: 2rem 1rem;
}

.book-create h2 {
    margin-bottom: 1.5rem;
}

.book-create .inline-form {
    max-width: 400px;
    margin: 0 auto;
}

.book-header {
    text-align: center;
}

.book-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.editable-title {
    font-size: 1.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    transition: border-color var(--transition);
    outline: none;
    min-width: 100px;
}

.editable-title:focus,
.editable-title:hover {
    border-color: var(--border);
}

.book-owner {
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.25rem;
}

/* === Table === */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
}

tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--cream-dark);
    font-size: 0.9rem;
    vertical-align: middle;
}

tbody tr:hover {
    background: var(--cream);
}

.actions-cell {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* === Groups List === */
.groups-list {
    list-style: none;
}

.groups-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--cream-dark);
    font-size: 0.95rem;
}

.groups-list li:last-child {
    border-bottom: none;
}

.group-name {
    font-weight: 500;
    text-transform: capitalize;
}

/* === Status Badges === */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-draft {
    background: var(--draft-bg);
    color: var(--draft-text);
}

.status-submitted {
    background: var(--submitted-bg);
    color: var(--submitted-text);
}

.status-approved {
    background: var(--approved-bg);
    color: var(--approved-text);
}

/* === Source Icons === */
.source-icon {
    font-size: 1rem;
    margin-right: 0.25rem;
}

/* === Stories Grid === */
.stories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.story-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: box-shadow var(--transition), transform var(--transition);
    border-left: 4px solid var(--border);
}

.story-card:hover {
    box-shadow: 0 4px 12px var(--shadow-md);
    transform: translateY(-1px);
}

.story-card.cat-highlight {
    border-left-color: var(--highlight-border);
    background: var(--highlight-bg);
}

.story-card.cat-real_talk {
    border-left-color: var(--real-talk-border);
    background: var(--real-talk-bg);
}

.story-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.story-card-contributor {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
}

.story-card-prompt {
    font-family: Georgia, serif;
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.story-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Filter Row === */
.filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.section-hint {
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 1rem;
}

/* === Modal === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(44, 36, 32, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(44, 36, 32, 0.2);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--cream);
}

.modal-prompt {
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    padding-right: 2rem;
}

.modal-meta {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.modal-body-editor {
    width: 100%;
    min-height: 200px;
    padding: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    resize: vertical;
    font-family: inherit;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--cream-dark);
}

.modal-actions label {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* === Email Compose Modal === */
.email-modal-content {
    max-width: 600px;
}

.email-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
    min-height: 40px;
}

.email-input[readonly] {
    background: var(--cream);
    color: var(--text-light);
}

.email-body-editor {
    width: 100%;
    min-height: 260px;
    padding: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    resize: vertical;
    font-family: inherit;
}

.email-note {
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.5rem;
}

/* === Chapter Arranger === */
.chapter-list {
    list-style: none;
    counter-reset: chapter;
}

.chapter-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    background: var(--white);
    transition: box-shadow var(--transition);
    counter-increment: chapter;
}

.chapter-item::before {
    content: counter(chapter);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cream-dark);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    flex-shrink: 0;
}

.chapter-item.dragging {
    opacity: 0.5;
    box-shadow: 0 4px 12px var(--shadow-md);
}

.chapter-item.drag-over {
    border-color: var(--accent);
    background: var(--cream);
}

.drag-handle {
    cursor: grab;
    font-size: 1.1rem;
    color: var(--text-light);
    user-select: none;
    flex-shrink: 0;
}

.drag-handle:active {
    cursor: grabbing;
}

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

.chapter-title {
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-author {
    font-size: 0.8rem;
    color: var(--text-light);
}

.chapter-arrows {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex-shrink: 0;
}

.chapter-arrows button {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    color: var(--text-light);
    line-height: 1;
}

.chapter-arrows button:hover {
    background: var(--cream);
}

/* === Export === */
.export-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: var(--cream);
    border: 1px solid var(--border);
}

.export-status a {
    font-weight: 600;
}

/* === Toast Notifications === */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white);
    box-shadow: 0 4px 12px var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    animation: toastIn 0.3s forwards, toastOut 0.3s 2.7s forwards;
    pointer-events: auto;
}

.toast-success {
    background: #166534;
}

.toast-error {
    background: var(--danger);
}

.toast-info {
    background: #1e40af;
}

@keyframes toastIn {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* === Empty State === */
.empty-msg {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 2rem 1rem;
}

/* === Responsive === */
@media (min-width: 600px) {
    .stories-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-container {
        padding: 2rem 1.5rem;
    }
}

@media (min-width: 900px) {
    .stories-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 599px) {
    .form-row {
        flex-direction: column;
    }

    .form-row input,
    .form-row select {
        width: 100%;
    }

    .tab-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }

    .modal-content {
        padding: 1.25rem;
    }

    .site-header {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ============================================================
   Contributor Portal
   ============================================================ */

.contribute-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}

/* ---- Welcome Header ---- */

.contribute-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.contribute-header h1 {
    font-size: 1.6rem;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.contribute-intro {
    font-size: 1.05rem;
    color: var(--text-light);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ---- Conversation CTA ---- */

.conversation-cta {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.conversation-cta-card {
    background: var(--white);
    border: 2px solid var(--accent-light);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    text-align: center;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 4px 16px var(--shadow);
}

.conversation-cta-title {
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.conversation-cta-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.btn-conversation {
    display: inline-block;
    background: #00BFFF;
    color: var(--white);
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition), transform var(--transition);
    min-height: 48px;
    line-height: 1.4;
}

.btn-conversation:hover {
    background: #009ad6;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-conversation:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .conversation-cta-card {
        padding: 1.5rem 1.25rem;
    }
}

/* ---- Audio fallback notice ---- */

.audio-notice {
    background: #fff3cd;
    color: #856404;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* ---- Prompt Picker ---- */

.prompt-picker {
    margin-bottom: 2rem;
}

.prompt-section {
    margin-bottom: 2rem;
}

.prompt-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-left: 0.25rem;
}

.prompt-section-highlight {
    color: #2d7a4f;
}

.prompt-section-realtalk {
    color: #b8621b;
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

/* ---- Prompt Cards ---- */

.prompt-card {
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.15s, box-shadow var(--transition), border-color var(--transition);
    border: 2px solid transparent;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.prompt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-md);
}

.prompt-card:active {
    transform: translateY(0);
}

.prompt-card p {
    font-size: 0.95rem;
    line-height: 1.45;
}

.prompt-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 111, 78, 0.2);
}

/* Highlight (green) cards */
.prompt-highlight {
    background: var(--highlight-bg);
    border-color: var(--highlight-border);
}

.prompt-highlight:hover {
    border-color: #5eaa76;
}

.prompt-highlight.selected {
    border-color: #2d7a4f;
    box-shadow: 0 0 0 3px rgba(45, 122, 79, 0.2);
}

/* Real Talk (orange) cards */
.prompt-realtalk {
    background: var(--real-talk-bg);
    border-color: var(--real-talk-border);
}

.prompt-realtalk:hover {
    border-color: #d4914a;
}

.prompt-realtalk.selected {
    border-color: #b8621b;
    box-shadow: 0 0 0 3px rgba(184, 98, 27, 0.2);
}

/* Custom prompt card */
.prompt-custom {
    gap: 0.5rem;
}

.custom-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-light);
}

.custom-prompt-row {
    display: flex;
    gap: 0.5rem;
}

.custom-prompt-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    min-height: 42px;
    background: var(--white);
    font-family: inherit;
}

.custom-prompt-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(139, 111, 78, 0.15);
}

.custom-prompt-go {
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0 0.85rem;
    font-size: 1.2rem;
    cursor: pointer;
    min-width: 42px;
    min-height: 42px;
    transition: background var(--transition);
}

.custom-prompt-go:hover {
    background: #7a6043;
}

/* ============================================================
   Story Editor (Contributor)
   ============================================================ */

.story-editor {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border);
    animation: editorIn 0.3s ease;
}

@keyframes editorIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.editor-prompt {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    color: var(--accent);
    margin-bottom: 1rem;
    font-style: italic;
}

.story-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 160px;
    background: var(--cream);
    transition: border-color var(--transition), background var(--transition);
    color: var(--text);
}

.story-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 2px rgba(139, 111, 78, 0.15);
}

/* ---- Editor Toolbar ---- */

.editor-toolbar {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-outline:hover {
    background: var(--cream);
}

.btn-outline.active {
    background: var(--accent);
    color: var(--white);
}

.photo-upload-label {
    cursor: pointer;
}

.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.photo-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn {
    margin-top: 1.25rem;
    width: 100%;
    font-size: 1.1rem;
    padding: 0.85rem;
    min-height: 52px;
}

/* ============================================================
   Audio Recording (Contributor)
   ============================================================ */

.recorder-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.record-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--danger);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.record-btn:hover {
    background: #fef0f0;
}

.record-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.record-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--danger);
    display: block;
    transition: transform 0.2s;
}

/* Pulsing animation while recording */
.record-btn.recording {
    background: #fef0f0;
}

.record-btn.recording .record-dot {
    animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.3); opacity: 0.7; }
}

.record-timer {
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-light);
    min-width: 4.5rem;
}

.stop-btn {
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 0.65rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    transition: background var(--transition);
}

.stop-btn:hover {
    background: var(--danger-hover);
}

.live-transcript {
    min-height: 2rem;
    padding: 0.75rem;
    background: var(--cream-dark);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.live-transcript:empty {
    display: none;
}

/* ============================================================
   My Stories (Contributor)
   ============================================================ */

.my-stories {
    margin-top: 1rem;
}

.my-stories h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.my-stories-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.my-story-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px var(--shadow);
}

.my-story-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.my-story-prompt {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.my-story-status {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.my-story-preview {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.no-stories {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    padding: 1.5rem 0;
}

/* ---- Utility ---- */

.hidden {
    display: none !important;
}

/* ---- Contributor Portal responsive ---- */

@media (max-width: 480px) {
    .contribute-header h1 {
        font-size: 1.35rem;
    }

    .prompt-grid {
        grid-template-columns: 1fr;
    }

    .recorder-controls {
        flex-wrap: wrap;
    }

    .record-btn {
        width: 56px;
        height: 56px;
    }

    .record-dot {
        width: 24px;
        height: 24px;
    }

    .story-editor {
        padding: 1rem;
    }

    .contribute-page {
        padding: 1rem 0.75rem 3rem;
    }
}
