:root {
    /* Color palette - warm neutrals */
    --bg-primary: #FAF9F7;
    --bg-card: #FFFFFF;
    --bg-hover: #F5F2EE;

    --text-primary: #2C2C2C;
    --text-secondary: #6B6B6B;
    --text-muted: #9B9B9B;

    --accent: #8B9A7D;
    --accent-hover: #7A8A6D;

    --border: #E8E5E1;
    --border-light: #F0EDE9;

    --danger: #C4756E;
    --warning: #E8975A;
    --success: #6B9A6B;

    /* TODO(safari-15): Replace these pre-computed values with color-mix() when studio iPad upgrades past iOS 15.3 */
    --accent-8: #F6F7F5;
    --accent-20-trans: rgba(139, 154, 125, 0.2);
    --accent-22: #E5E9E2;
    --accent-30-trans: rgba(139, 154, 125, 0.3);
    --accent-40-white: #D1D6CB;
    --accent-50-white: #C5CDBE;
    --accent-85-white: #9CA991;
    --accent-93-bg: #F7F8F6;
    --danger-75-white: #D39892;
    --danger-85-white: #CD8A84;
    --warning-75-white: #EEB183;
    --warning-85-white: #ECA773;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-sm: 13px;
    --font-size-base: 15px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;

    /* Touch targets */
    --touch-min: 44px;

    /* Layout */
    --row-control-height: 34px;

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}



/* Header */
.header {
    flex-shrink: 0;
    margin-bottom: var(--space-sm);
    padding-bottom: calc(var(--space-sm) + 4px);
    border-bottom: 1px solid var(--border-light);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.header-left {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.header-right {
    display: flex;
    align-items: center;
    align-self: flex-start;
    gap: var(--space-xs);
}

.app-title-row {
    display: flex;
    align-items: center;
}

.app-title-part {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    text-transform: lowercase;
    line-height: 1;
    transition: transform 1.2s ease-out;
}

.app-title-a {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    text-transform: lowercase;
    line-height: 1;
    opacity: 1;
    width: auto;
    transition: opacity 0.6s ease-out, width 0.6s ease-out;
}

.title-expanded .app-title-a {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.app-title-logo {
    width: 0;
    height: 48px;
    margin: 0 0 -6px 0;
    vertical-align: middle;
    background: url('/assets/img/yogahhh-logo.png') center/contain no-repeat;
    cursor: pointer;
    pointer-events: auto;
    transition: width 1.2s ease-out, margin 1.2s ease-out;
}

/* Expanded state after intro animation */
.title-expanded .app-title-logo {
    width: 48px;
    margin: 0 0 -6px -4px;
}

.app-title-logo.logo-fade-in {
    animation: logo-fade-in 0.5s ease-in forwards;
    transition: none;  /* Prevent width/margin transition from triggering subtitle reflow */
}

@keyframes logo-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.app-title-logo.logo-spinning {
    width: 58px;
    height: 58px;
    margin: -5px -5px -11px -9px;
    background: url('/assets/img/lotus_sprite_white_sat.png') 0 0 no-repeat;
    background-size: 800% 400%;
    animation: lotus-bloom 2s steps(1) infinite;
}

.app-subtitle-row {
    display: flex;
    justify-content: center;
    gap: 0.25em;
    margin-top: -4px;
    transition: gap 1.2s ease-out;
}

.title-expanded .app-subtitle-row {
    gap: 52px;
}

.app-subtitle-left,
.app-subtitle-right {
    font-size: 11px;
    font-weight: 300;
    font-style: italic;
    color: var(--text-muted);
    opacity: 0.6;
    white-space: nowrap;
}

.logo {
    font-size: var(--font-size-xl);
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.studio-logo {
    height: 38px;
    width: auto;
    margin-bottom: -10px;
}


/* Header Buttons */
.header-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 4px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

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

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

/* Header utility buttons - match hamburger style */
.header-btn.help-btn,
.header-btn.feedback-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: var(--font-size-sm);
    font-weight: 600;
    height: 30px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
}

.header-btn.help-btn:hover,
.header-btn.feedback-btn:hover {
    background: rgba(79, 109, 122, 0.1);
}

.header-btn .btn-symbol {
    font-size: 1.3em;
    vertical-align: middle;
}

/* Dropdown menu */
.hamburger-menu {
    position: relative;
}

.hamburger-btn {
    position: relative;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 5px 6px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}


.hamburger-btn:hover {
    background: rgba(79, 109, 122, 0.1);
}

.hamburger-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
}

.hamburger-dropdown button,
.hamburger-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.hamburger-dropdown button:hover,
.hamburger-dropdown a:hover {
    background: var(--bg-secondary);
}

.hamburger-dropdown .menu-icon {
    width: 16px;
    text-align: center;
    font-weight: 600;
    color: var(--accent);
}

.hamburger-dropdown svg.menu-icon {
    flex-shrink: 0;
}


.btn-primary,
.btn-secondary {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: wait;
}


.app, .app-shell { max-width: 984px; margin: 0 auto; padding: var(--space-sm) var(--space-md) 0; }

/* Shared desktop/iPad inset; do not override only one role's shell. */
@media (min-width: 768px) {
    .app, .app-shell { padding: var(--space-md) var(--space-xl); }
}

.hamburger-dropdown a { text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
    .app-title-part, .app-title-a, .app-title-logo, .app-subtitle-row { transition: none; }
}
