/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #141937;
    --bg-card: rgba(20, 25, 55, 0.6);
    --bg-card-hover: rgba(30, 35, 65, 0.8);

    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-orange: #f97316;
    --accent-red: #ef4444;

    --status-optimal: #064e3b;
    --status-good: #1e3a8a;
    --status-fair: #451a03;
    --status-poor: #450a0a;

    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: rgba(148, 163, 184, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

    --gradient-purple: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(at 0% 0%, rgba(168, 85, 247, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(59, 130, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ===== Header & Brand ===== */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand-link h1 {
    margin: 0;
    padding: 0;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-link h1 a {
    color: #ffffff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: 1.5px solid rgba(192, 132, 252, 0.4);
    background: rgba(192, 132, 252, 0.05);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all var(--transition-normal);
    box-shadow: 0 0 20px rgba(192, 132, 252, 0.2), inset 0 0 20px rgba(192, 132, 252, 0.05);
}

.brand-link h1 a:hover {
    border-color: rgba(192, 132, 252, 0.6);
    box-shadow: 0 0 30px rgba(192, 132, 252, 0.3), inset 0 0 20px rgba(192, 132, 252, 0.1);
    transform: translateY(-2px);
}

.brand-link .moon-icon {
    font-size: 1.25rem;
    display: inline-block;
    line-height: 1;
}

.brand-link a {
    color: var(--accent-purple);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-bottom: 1.5rem;
    transition: var(--transition-fast);
}

.brand-link a:hover {
    filter: brightness(1.2);
}

.logo {
    color: #c084fc;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: 1.5px solid rgba(192, 132, 252, 0.4);
    background: rgba(192, 132, 252, 0.05);
    box-shadow: 0 0 20px rgba(192, 132, 252, 0.2), inset 0 0 20px rgba(192, 132, 252, 0.05);
}

.main-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    color: #fff;
}

.highlight {
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 2rem;
    line-height: 1.5;
}

.present-time-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.present-time-display .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.current-time {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Calculator UI ===== */
.calculator-section {
    margin-bottom: 2.5rem;
}

.mode-toggle {
    display: flex;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.toggle-btn {
    flex: 1;
    padding: 0.625rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.toggle-btn.active {
    background: var(--bg-card);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.calculator-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 1.75rem;
    border: 1px solid var(--border-color);
}

.time-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    margin-bottom: 1rem;
}

.time-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    width: 60%;
}

.time-input:focus {
    outline: none;
}

.clock-icon {
    font-size: 1.5rem;
    margin: 0 1rem;
    color: var(--text-secondary);
}

.calculate-btn {
    background: var(--gradient-purple);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calculate-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ===== Results Styling (Matching Image Colors) ===== */
/* ===== Results Styling (Reference Match) ===== */
.results-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.results-icon {
    font-size: 1.25rem;
    color: var(--accent-gold);
}

.results-intro {
    font-size: 1rem;
    color: #fff;
    font-weight: 700;
}

.sleep-times {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sleep-time-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.sleep-time-card:hover {
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.time-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-time {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.cycle-info {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.status-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    /* "Optimal" not "OPTIMAL" */
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-description {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

/* Specific Gradients from Image */
.sleep-time-card.optimal {
    background: linear-gradient(135deg, #0f3d3e 0%, #102a2b 100%);
    border-color: rgba(20, 184, 166, 0.3);
}

.sleep-time-card.optimal .icon-box {
    color: #2dd4bf;
    /* Teal/Green icon */
    background: rgba(45, 212, 191, 0.15);
}

.sleep-time-card.optimal .status-badge {
    background: rgba(20, 184, 166, 0.2);
    color: #5eead4;
}

.sleep-time-card.good {
    background: linear-gradient(135deg, #452c10 0%, #2b1c0a 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.sleep-time-card.good .icon-box {
    color: #fbbf24;
    /* Amber/Gold icon */
    background: rgba(251, 191, 36, 0.15);
}

.sleep-time-card.good .status-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.sleep-time-card.fair {
    /* Matches "Okay" */
    background: linear-gradient(135deg, #3f2218 0%, #351a14 100%);
    border-color: rgba(234, 88, 12, 0.3);
}

.sleep-time-card.fair .icon-box {
    color: #fdba74;
    /* Orange icon */
    background: rgba(253, 186, 116, 0.15);
}

.sleep-time-card.fair .status-badge {
    background: rgba(234, 88, 12, 0.2);
    color: #fdba74;
}

.sleep-time-card.poor {
    background: linear-gradient(135deg, #38181f 0%, #250e12 100%);
    border-color: rgba(225, 29, 72, 0.3);
}

.sleep-time-card.poor .icon-box {
    color: #fca5a5;
    /* Red/Pink icon */
    background: rgba(252, 165, 165, 0.15);
}

.sleep-time-card.poor .status-badge {
    background: rgba(225, 29, 72, 0.2);
    color: #fda4af;
}

/* ===== Stats Summary Row ===== */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1rem 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

/* ===== Tips Section ===== */
.tips-section {
    margin-bottom: 2.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
}

.tip-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.tip-card.highlighted {
    border-left: 4px solid var(--accent-pink);
}

.tip-icon-bg {
    width: 48px;
    height: 48px;
    background: var(--gradient-purple);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.tip-content h3 {
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.tip-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===== Sleep Tracker Layout ===== */
.tracker-section {
    margin-bottom: 2.5rem;
}

.tracker-header {
    justify-content: space-between;
}

.new-entry-btn {
    background: var(--gradient-purple);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.tracker-card {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 1.75rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.form-group input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: var(--transition-normal);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: rgba(255, 255, 255, 0.05);
}

.quality-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin: 0.5rem 0 1.5rem;
}

.quality-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.quality-btn:hover {
    border-color: var(--accent-purple);
    color: #fff;
}

.quality-btn.selected {
    background: var(--gradient-purple);
    border-color: transparent;
    color: #fff;
}

.submit-btn {
    width: 100%;
    background: var(--gradient-purple);
    border: none;
    border-radius: 10px;
    padding: 0.875rem;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.history-item:last-child {
    border: none;
}

.history-info .history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-info .history-times {
    font-size: 0.875rem;
    color: #fff;
    font-weight: 600;
}

.history-duration {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent-orange);
}

/* ===== Educational Grid ===== */
.education-section {
    margin-bottom: 2.5rem;
}

.education-card {
    margin-bottom: 1.5rem;
}

.card-icon-main {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--accent-purple);
}

.education-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.education-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.tips-list li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    list-style: none;
    display: flex;
    gap: 0.75rem;
}

.tips-list li::before {
    content: '•';
    color: var(--accent-purple);
    font-weight: bold;
}

/* ===== FAQ Section ===== */
.faq-section {
    margin-bottom: 2.5rem;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.faq-item:hover {
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: var(--shadow-sm);
}

.faq-item.active {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.15);
}

.faq-question {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition-normal);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.02);
}

.faq-question span:first-child {
    flex: 1;
    line-height: 1.5;
}

.faq-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-purple);
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    background: rgba(168, 85, 247, 0.25);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 1.5rem 1.5rem;
}

.faq-answer p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin: 0;
    padding-top: 0.5rem;
}

/* ===== Ad Spaces ===== */
.ad-space {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.ad-space:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(168, 85, 247, 0.2);
}

.ad-space.faq-ad {
    margin: 1rem 0;
    min-height: 80px;
    padding: 1.25rem;
}

.ad-space.result-ad {
    margin: 1rem 0;
    min-height: 80px;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.ad-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ===== Footer ===== */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-links {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* ===== Time Picker Refinement ===== */
.time-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    touch-action: none;
}

.time-picker-modal.active {
    display: flex;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.time-picker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

.time-picker-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    width: 90%;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
    z-index: 10001;
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    touch-action: pan-y;
}

.drag-handle {
    display: none;
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin: -0.5rem auto 1.5rem;
}

.time-picker-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #fff;
}

.time-picker-selectors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
    position: relative;
}

/* Center Selection Highlight */
.time-picker-selectors::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -5px;
    right: -5px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
    pointer-events: none;
    border-radius: 8px;
}

.selector-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.selector-group label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.selector-scroll {
    height: 225px;
    /* 5 items visible */
    width: 100%;
    overflow-y: auto;
    background: transparent;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.selector-scroll::-webkit-scrollbar {
    display: none;
}

.selector-item {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    scroll-snap-align: center;
    transition: all 0.2s ease;
    font-size: 1.125rem;
    min-height: 44px; /* Minimum touch target size */
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
    user-select: none;
}

.selector-item.selected {
    color: #fff;
    font-weight: 700;
    font-size: 1.35rem;
}

.selector-item.padding {
    pointer-events: none;
    opacity: 0;
    user-select: none;
    cursor: default;
}

.time-picker-actions {
    display: flex;
    gap: 1rem;
}

.picker-btn {
    flex: 1;
    padding: 1rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-normal);
    min-height: 44px; /* Minimum touch target size */
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
    user-select: none;
}

.picker-btn:active {
    transform: scale(0.98);
}

.picker-btn.cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.picker-btn.set {
    background: var(--gradient-purple);
    color: #fff;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

/* Tablet & Mobile Adjustments (Bottom Sheet) */
@media screen and (max-width: 480px) {
    .time-picker-modal {
        align-items: flex-end;
    }

    .time-picker-content {
        max-width: 100%;
        width: 100%;
        border-radius: 32px 32px 0 0;
        padding: 1rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
        transform: translateY(100%);
        border-left: none;
        border-right: none;
        border-bottom: none;
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .time-picker-modal.active .time-picker-content {
        transform: translateY(0);
    }

    .drag-handle {
        display: block;
        cursor: grab;
        touch-action: none;
    }

    .drag-handle:active {
        cursor: grabbing;
    }

    .time-picker-title {
        font-size: 1.125rem;
        margin-bottom: 1.25rem;
    }

    .time-picker-selectors {
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .selector-group {
        gap: 0.5rem;
    }

    .selector-group label {
        font-size: 0.65rem;
    }

    .selector-scroll {
        height: 200px;
    }

    .selector-item {
        height: 50px;
        min-height: 50px;
        font-size: 1.125rem;
    }

    .selector-item.selected {
        font-size: 1.5rem;
    }

    /* Center Selection Highlight - adjust for mobile */
    .time-picker-selectors::before {
        height: 50px;
    }

    .time-picker-actions {
        gap: 0.75rem;
        padding-top: 0.5rem;
    }

    .picker-btn {
        padding: 1rem 0.75rem;
        font-size: 0.9375rem;
        min-height: 48px;
    }

    .brand-link h1 a {
        font-size: 1rem;
        padding: 0.625rem 1.25rem;
        gap: 0.5rem;
    }

    .brand-link .moon-icon {
        font-size: 1.125rem;
    }

    .main-title {
        font-size: 1.75rem;
    }

    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 0.75rem 0.25rem;
    }

    .time-input {
        font-size: 1.5rem;
    }

    .faq-question {
        padding: 1rem 1.25rem;
        font-size: 0.9375rem;
    }

    .faq-answer {
        padding: 0 1.25rem;
    }

    .faq-item.active .faq-answer {
        padding: 0 1.25rem 1.25rem;
    }

    .faq-answer p {
        font-size: 0.875rem;
    }

    .faq-icon {
        width: 24px;
        height: 24px;
        font-size: 1.125rem;
    }

    .ad-space.faq-ad {
        min-height: 70px;
        padding: 1rem;
        margin: 0.875rem 0;
    }
}

/* Extra small mobile devices */
@media screen and (max-width: 360px) {
    .brand-link h1 a {
        font-size: 0.9375rem;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }

    .brand-link .moon-icon {
        font-size: 1rem;
    }

    .time-picker-content {
        padding: 0.875rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    }

    .time-picker-selectors {
        gap: 0.5rem;
    }

    .selector-scroll {
        height: 180px;
    }

    .selector-item {
        height: 45px;
        min-height: 45px;
        font-size: 1rem;
    }

    .selector-item.selected {
        font-size: 1.375rem;
    }

    .time-picker-selectors::before {
        height: 45px;
    }

    .picker-btn {
        padding: 0.875rem 0.5rem;
        font-size: 0.875rem;
    }

    .faq-question {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .faq-answer {
        padding: 0 1rem;
    }

    .faq-item.active .faq-answer {
        padding: 0 1rem 1rem;
    }

    .faq-answer p {
        font-size: 0.8125rem;
    }

    .ad-space.faq-ad {
        min-height: 60px;
        padding: 0.875rem;
        margin: 0.75rem 0;
    }
}

/* Landscape mobile orientation */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .time-picker-content {
        max-height: 90vh;
        border-radius: 24px;
        padding: 1rem 1.5rem;
    }

    .selector-scroll {
        height: 150px;
    }

    .time-picker-title {
        margin-bottom: 1rem;
    }

    .time-picker-selectors {
        margin-bottom: 1rem;
    }
}

.hidden {
    display: none !important;
}