:root {
    color-scheme: light only;
    --paper-bg: #FAF6F0;
    --paper-surface: #FFFFFF;
    --terracotta: #C2734B;
    --accent-text: #FFF8F0;
    --ink: #2E2A26;
    --serif: 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Times New Roman', serif;
    --sans: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html, body {
    font-family: var(--sans);
    background-color: var(--paper-bg);
    color: var(--ink);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

h1:focus {
    outline: none;
}

/* App shell: full height, room for the fixed bottom bar + safe areas. */
.app-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: var(--paper-bg);
}

.app-content {
    flex: 1 1 auto;
    padding: calc(env(safe-area-inset-top) + 0.5rem) 0
             calc(env(safe-area-inset-bottom) + 5.5rem) 0;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.page-pad {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Serif body for journal entry text. */
.entry-body {
    font-family: var(--serif);
    font-size: 1.12rem;
    line-height: 1.72;
    white-space: pre-wrap;
    word-break: break-word;
}

.greeting {
    font-family: var(--serif);
}

/* Bottom navigation bar. */
.bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    background: var(--paper-surface);
    border-top: 1px solid rgba(46, 42, 38, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 12px rgba(46, 42, 38, 0.06);
}

.bottom-bar-inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 4rem;
    position: relative;
}

.bottom-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: none;
    border: none;
    color: rgba(46, 42, 38, 0.72);
    font-size: 0.7rem;
    gap: 2px;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.bottom-tab .tab-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.bottom-tab.active {
    color: var(--terracotta);
}

/* Primary mic FAB — Today screen only. Terracotta, floats above the nav,
   thumb-reachable, safe-area aware. Real mic glyph, never the old center dot. */
.dock-record-slot {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Raised central Record button in the 5-slot dock — the one global capture action. */
.dock-record {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    background: var(--terracotta);
    color: var(--accent-text);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translateY(-14px);
    box-shadow: 0 6px 18px rgba(194, 115, 75, 0.45);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.dock-record:active {
    transform: translateY(-14px) scale(0.95);
}

.dock-record .mud-icon-root {
    font-size: 1.7rem;
}

.mic-fab {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(4rem + env(safe-area-inset-bottom) + 12px);
    z-index: 1300;
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 50%;
    background: var(--terracotta);
    color: var(--accent-text);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(194, 115, 75, 0.45);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.mic-fab:hover {
    box-shadow: 0 10px 26px rgba(194, 115, 75, 0.55);
}

.mic-fab:active {
    transform: translateX(-50%) scale(0.96);
}

.mic-fab .mud-icon-root {
    font-size: 2rem;
}

/* First-run caption beside/below the mic FAB ("Tap to talk"). */
.mic-fab-caption {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(4rem + env(safe-area-inset-bottom) + 12px + 4.25rem + 6px);
    z-index: 1300;
    color: var(--terracotta);
    font-family: var(--serif);
    font-size: 0.95rem;
    pointer-events: none;
    white-space: nowrap;
}

/* Big pulsing record button on the record page. */
.big-record {
    width: 8.5rem;
    height: 8.5rem;
    border-radius: 50%;
    border: none;
    background: var(--terracotta);
    color: #fff;
    font-size: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(194, 115, 75, 0.35);
}

.big-record.listening {
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(194, 115, 75, 0.45); }
    70% { box-shadow: 0 0 0 22px rgba(194, 115, 75, 0); }
    100% { box-shadow: 0 0 0 0 rgba(194, 115, 75, 0); }
}

.partial-text {
    color: rgba(46, 42, 38, 0.66);
    font-style: italic;
}

/* ---- Make interactive things obviously clickable on desktop ---- */
.mud-button-root,
.mud-icon-button,
.mud-nav-link,
.mud-list-item-clickable,
.mud-checkbox,
.mud-checkbox *,
.mud-select,
.mud-tab,
[role="button"],
a {
    cursor: pointer;
}

/* Helper for clickable cards / rows: pointer + gentle hover feedback. */
.clickable {
    cursor: pointer;
    transition: background-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.clickable:hover {
    background-color: rgba(194, 115, 75, 0.05);
}

.mud-card.clickable:hover {
    box-shadow: 0 4px 16px rgba(46, 42, 38, 0.12);
}

.mud-card.clickable:active {
    transform: scale(0.995);
}

/* ---- Blazor framework UI (kept from template) ---- */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid red; }
.validation-message { color: red; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 3000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e6ddd2;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #C2734B;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--ink);
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

/* ---- Appearance / personalization (#294) ---- */
.theme-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.theme-swatch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.7rem 0.4rem 0.45rem;
    background: var(--paper-surface);
    border: 1px solid rgba(46, 42, 38, 0.14);
    border-radius: 999px;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 0.85rem;
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-swatch:hover {
    border-color: var(--terracotta);
}

.theme-swatch.selected {
    border-color: var(--terracotta);
    box-shadow: 0 0 0 2px var(--terracotta) inset;
    font-weight: 600;
}

.theme-swatch-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 0 1px rgba(46, 42, 38, 0.18);
    flex: 0 0 auto;
}

.theme-preview {
    background: var(--paper-surface);
    border: 1px solid rgba(46, 42, 38, 0.10);
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.theme-preview-title {
    font-family: var(--serif);
    color: var(--terracotta);
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.theme-preview-body {
    font-family: var(--serif);
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.6;
}
