 * {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
     -webkit-tap-highlight-color: transparent;
 }

 :root {
     --primary-purple: #D946EF;
     --light-purple: #F3E5F5;
     --bg-gradient-top: #FBF7FC;
     --bg-gradient-bottom: #FAF5FB;
     --text-primary: #1C1B1F;
     --text-secondary: #79747E;
     --text-light: #9E9AA3;
     --surface: #FFFFFF;
     --divider: #F0EBF1;
     --water-blue: #2196F3;
     --water-bg: #E3F2FD;
     --warning-bg: #FFF3E0;
     --warning-text: #F57C00;
 }

 body {
     font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
     background: linear-gradient(180deg, var(--bg-gradient-top) 0%, var(--bg-gradient-bottom) 100%);
     color: var(--text-primary);
     min-height: 100vh;
     display: flex;
     flex-direction: column;
     overflow-x: hidden;
 }

 /* Header */
 .header {
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 0.75rem 1rem;
     background: white;
     position: sticky;
     top: 0;
     z-index: 100;
     border-bottom: 1px solid var(--divider);
 }

 .header-title {
     font-size: 1.125rem;
     font-weight: 600;
     color: var(--text-primary);
     flex: 1;
     text-align: center;
 }

 .icon-btn {
     background: none;
     border: none;
     padding: 0.5rem;
     cursor: pointer;
     color: var(--primary-purple);
     border-radius: 50%;
     transition: background 0.2s;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .icon-btn:hover {
     background: var(--light-purple);
 }

 /* Main Container */
 .main-container {
     flex: 1;
     display: flex;
     flex-direction: column;
     max-width: 600px;
     width: 100%;
     margin: 0 auto;
     padding: 1rem 1rem 8rem;
 }

 /* Stats Row */
 .stats-row {
     display: flex;
     justify-content: space-between;
     margin-bottom: 2rem;
     padding: 0 1rem;
 }

 .stat-item {
     text-align: center;
     flex: 1;
 }

 .stat-value {
     font-size: 2.25rem;
     font-weight: 300;
     color: var(--text-primary);
     line-height: 1;
 }

 .stat-label {
     font-size: 0.75rem;
     color: var(--text-secondary);
     margin-top: 0.25rem;
 }

 .stat-divider {
     width: 1px;
     background: var(--divider);
     margin: 0 1rem;
 }

 /* Timeline */
 .timeline-container {
     position: relative;
     height: 400px;
     max-height: 50vh;
     margin: 2rem 0 6rem;
     padding: 1rem 2rem;
     overflow-y: auto;
     overflow-x: hidden;
 }

 .timeline-container::-webkit-scrollbar {
     width: 6px;
 }

 .timeline-container::-webkit-scrollbar-track {
     background: var(--divider);
     border-radius: 3px;
 }

 .timeline-container::-webkit-scrollbar-thumb {
     background: var(--primary-purple);
     border-radius: 3px;
     opacity: 0.5;
 }

 .timeline-line {
     position: absolute;
     left: 50%;
     top: 0;
     bottom: 0;
     width: 2px;
     background: var(--divider);
     transform: translateX(-50%);
     height: calc(100% + 100px);
 }

 .timeline-item {
     position: absolute;
     left: 50%;
     transform: translateX(-50%);
     display: flex;
     align-items: center;
     gap: 1rem;
     width: 100%;
     justify-content: space-between;
     padding: 0 1rem;
 }

 .timeline-number {
     width: 40px;
     height: 40px;
     border-radius: 50%;
     background: var(--primary-purple);
     color: white;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 1.125rem;
     font-weight: 500;
     position: absolute;
     left: 50%;
     transform: translateX(-50%);
     z-index: 2;
 }

 .timeline-time-left {
     position: absolute;
     left: 0;
     font-size: 1.125rem;
     font-weight: 600;
     color: var(--text-primary);
 }

 .timeline-duration-left {
     position: absolute;
     left: 0;
     top: 1.5rem;
     font-size: 0.75rem;
     color: var(--text-secondary);
 }

 .timeline-time-right {
     position: absolute;
     right: 0;
     font-size: 1.125rem;
     font-weight: 600;
     color: var(--text-primary);
 }

 .timeline-interval-right {
     position: absolute;
     right: 0;
     top: 1.5rem;
     font-size: 0.75rem;
     color: var(--text-secondary);
 }

 /* Timer Display */
 .timer-section {
     text-align: center;
     margin: 3rem 0;
     flex: 1;
     display: flex;
     flex-direction: column;
     justify-content: center;
 }

 .timer-circle {
     width: 200px;
     height: 200px;
     margin: 0 auto 2rem;
     position: relative;
 }

 .timer-circle-bg {
     width: 100%;
     height: 100%;
     border-radius: 50%;
     border: 3px solid var(--divider);
     position: absolute;
 }

 .timer-circle-progress {
     width: 100%;
     height: 100%;
     border-radius: 50%;
     border: 3px solid var(--primary-purple);
     position: absolute;
     transform: rotate(-90deg);
     stroke-dasharray: 628;
     stroke-dashoffset: 628;
     transition: stroke-dashoffset 0.1s linear;
 }

 .timer-display {
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     text-align: center;
 }

 .timer-value {
     font-size: 3rem;
     font-weight: 300;
     color: var(--primary-purple);
     font-variant-numeric: tabular-nums;
 }

 .timer-status {
     font-size: 0.875rem;
     color: var(--text-secondary);
     margin-top: 0.5rem;
 }

 /* Bottom Button Area */
 .bottom-action {
     padding: 2rem 0;
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 1rem;
 }

 /* Main Timer Button - Fixed Position */
 .main-timer-btn {
     width: 100px;
     height: 100px;
     border-radius: 50%;
     background: var(--primary-purple);
     border: none;
     color: white;
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     box-shadow: 0 4px 12px rgba(217, 70, 239, 0.3);
     transition: all 0.3s;
     position: fixed;
     bottom: 2rem;
     left: 50%;
     transform: translateX(-50%);
     z-index: 100;
 }

 .main-timer-btn:hover {
     transform: translateX(-50%) scale(1.05);
     box-shadow: 0 6px 20px rgba(217, 70, 239, 0.4);
 }

 .main-timer-btn.stop {
     background: #EF5350;
 }

 .main-timer-btn .material-symbols-outlined {
     font-size: 2rem;
 }
 
 .main-timer-btn.stop .material-symbols-outlined {
    font-size: 24px;
    line-height: normal;
 }

 .main-timer-btn-text {
     font-size: 0.75rem;
     margin-top: 0.25rem;
 }

 /* Water Drop Icon - Fixed Position */
 .water-drop-btn {
     position: fixed;
     left: 2rem;
     bottom: 2.5rem;
     background: none;
     border: none;
     cursor: pointer;
     padding: 0.5rem;
     z-index: 100;
     backdrop-filter: blur(20px) saturate(180%);
     border-radius: 50%;
     background-color: rgb(203 203 203 / 13%);
 }

 .water-drop-icon {
     font-size: 2rem;
     color: var(--water-blue);
 }

 /* Water Break Modal */
 .modal {
     display: none;
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     background: rgba(0, 0, 0, 0.5);
     z-index: 1000;
     align-items: center;
     justify-content: center;
 }

 .modal.active {
     display: flex;
 }

 .modal-card {
     background: white;
     border-radius: 20px;
     padding: 2rem;
     max-width: 350px;
     width: 90%;
     text-align: center;
 }

 .modal-icon {
     width: 80px;
     height: 80px;
     margin: 0 auto 1rem;
     background: var(--water-bg);
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     position: relative;
 }

 .modal-icon .material-symbols-outlined {
     font-size: 3rem;
     color: var(--water-blue);
 }

 .modal-icon .warning-dot {
     position: absolute;
     top: 0;
     right: 10px;
     width: 20px;
     height: 20px;
     background: #FF9800;
     border-radius: 50%;
     border: 3px solid white;
 }

 .modal-title {
     font-size: 1.5rem;
     font-weight: 600;
     margin-bottom: 0.5rem;
     color: var(--text-primary);
 }

 .modal-text {
     color: var(--text-secondary);
     margin-bottom: 2rem;
     line-height: 1.5;
 }

 .modal-btn {
     width: 100%;
     padding: 1rem;
     border: none;
     border-radius: 100px;
     font-size: 1rem;
     font-weight: 500;
     cursor: pointer;
     margin-bottom: 0.75rem;
     transition: all 0.3s;
 }

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

 .modal-btn-secondary {
     background: transparent;
     color: var(--text-secondary);
 }

 /* Hospital Alert */
 .hospital-alert {
     background: white;
     border-radius: 12px;
     padding: 1.5rem;
     margin: 1rem 0;
     text-align: center;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
 }

 .hospital-icon {
     width: 60px;
     height: 60px;
     background: var(--light-purple);
     border-radius: 12px;
     display: flex;
     align-items: center;
     justify-content: center;
     margin: 0 auto 1rem;
 }

 .hospital-icon .material-symbols-outlined {
     font-size: 2rem;
     color: var(--primary-purple);
 }

 .hospital-title {
     font-size: 1.25rem;
     font-weight: 600;
     margin-bottom: 0.5rem;
 }

 .hospital-text {
     color: var(--text-secondary);
     line-height: 1.5;
     font-size: 0.9rem;
 }

 /* iOS Badge */
 .ios-badge-container {
     text-align: center;
     padding: 1.5rem 0;
 }

 .ios-badge {
     display: inline-block;
 }

 .ios-badge img {
     height: 44px;
 }

 /* Info Content */
 .info-section {
     background: white;
     border-radius: 12px;
     padding: 1.5rem;
     margin: 1rem 0;
 }

 .info-section h2 {
     font-size: 1.25rem;
     font-weight: 600;
     margin-bottom: 1rem;
     color: var(--text-primary);
 }

 .info-section h3 {
     font-size: 1rem;
     font-weight: 600;
     margin: 1.5rem 0 0.5rem;
     color: var(--text-primary);
 }

 .info-section p {
     line-height: 1.6;
     color: var(--text-secondary);
     margin-bottom: 0.75rem;
 }

 /* Footer */
 footer {
     background: white;
     border-top: 1px solid var(--divider);
     padding: 1.5rem;
     margin-top: 2rem;
 }

 .footer-links {
     display: flex;
     justify-content: center;
     gap: 2rem;
     margin-bottom: 1rem;
     flex-wrap: wrap;
 }

 .footer-links a {
     color: var(--text-secondary);
     text-decoration: none;
     font-size: 0.875rem;
     transition: color 0.3s;
 }

 .footer-links a:hover {
     color: var(--primary-purple);
 }

 .footer-copyright {
     text-align: center;
     color: var(--text-light);
     font-size: 0.75rem;
     margin-top: 1rem;
 }

 /* Settings Menu */
 .settings-menu {
     position: absolute;
     top: 100%;
     left: 0;
     background: white;
     border-radius: 12px;
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
     padding: 0.5rem;
     min-width: 200px;
     display: none;
     z-index: 101;
 }

 .settings-menu.active {
     display: block;
 }

 .settings-item {
     padding: 0.75rem 1rem;
     cursor: pointer;
     border-radius: 8px;
     display: flex;
     align-items: center;
     gap: 0.75rem;
     transition: background 0.2s;
     color: var(--text-primary);
     font-size: 0.9rem;
 }

 .settings-item:hover {
     background: var(--light-purple);
 }

 .settings-container {
     position: relative;
 }

 /* Empty State */
 .empty-state {
     text-align: center;
     padding: 3rem 1rem;
     color: var(--text-secondary);
 }

 .empty-state .material-symbols-outlined {
     font-size: 4rem;
     opacity: 0.3;
     margin-bottom: 1rem;
 }

 /* Responsive */
 @media (max-width: 480px) {
     .stats-row {
         padding: 0 0.5rem;
     }

     .stat-value {
         font-size: 1.75rem;
     }

     .timer-value {
         font-size: 2.5rem;
     }
 }

 @media print {

     .header,
     footer,
     .water-drop-btn,
     .main-timer-btn,
     .ios-badge-container,
     .info-section,
     .settings-container {
         display: none !important;
     }

     body {
         background: white;
     }

     .main-container {
         padding: 1rem;
         max-width: 100%;
     }

     .timeline-container {
         max-height: none !important;
         height: auto !important;
         overflow: visible !important;
         page-break-inside: avoid;
     }

     .timeline-item {
         page-break-inside: avoid;
     }

     .log-list {
         page-break-inside: avoid;
     }

     .log-item {
         page-break-inside: avoid;
     }

     .stats-row {
         page-break-after: avoid;
         margin-bottom: 1rem;
     }
 }

 /* Log List */
 .log-list {
     background: white;
     border-radius: 12px;
     padding: 1rem;
     margin: 1rem 0;
 }

 .log-item {
     display: flex;
     justify-content: space-between;
     padding: 1rem 0;
     border-bottom: 1px solid var(--divider);
 }

 .log-item:last-child {
     border-bottom: none;
 }

 .log-time {
     font-weight: 600;
     color: var(--text-primary);
 }

 .log-details {
     text-align: right;
     font-size: 0.875rem;
     color: var(--text-secondary);
 }

 .water-indicator {
     background: var(--water-bg);
     color: var(--water-blue);
     padding: 0.75rem 1rem;
     border-radius: 8px;
     margin: 1rem 0;
     display: flex;
     align-items: center;
     gap: 0.5rem;
     font-weight: 500;
 }