:root{
  --bg:#161616;
  --card:#1f1f1f;
  --muted:#999;
  --accent:#e2423f;
  --accent-dark:#c73732;
  --green:#19a66a;
  --glass: rgba(255,255,255,0.03);
  --radius:12px;
  --ring-size:180px;
}
*{box-sizing:border-box}
html,body{height:100%}
html{
  -webkit-text-size-adjust:100%;
  -ms-text-size-adjust:100%;
  scroll-behavior:smooth;
}
body{
  margin:0;
  font-family:Inter,Segoe UI,Helvetica,Arial,sans-serif;
  background: linear-gradient(180deg,#141414 0%, #1a1a1a 100%);
  color:#e6e6e6;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding-bottom:40px;
  overflow-x:hidden;
  -webkit-tap-highlight-color:rgba(226,66,63,0.2);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  background: #1a1a1a;
}
::-webkit-scrollbar-track {
  background: #1a1a1a; 
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 5px;
  border: 2px solid #1a1a1a;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dark);
}

/* topbar */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 28px;
}
.brand{
  font-weight:700;
  font-size:18px;
  color:white;
}
.brand-flow{
  color:var(--accent);
}
.top-actions .btn-square{
  background:var(--card);
  border:1px solid rgba(255,255,255,0.04);
  color:var(--muted);
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease;
  touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(226,66,63,0.2);
  min-height:44px;
}
.top-actions .btn-square:active{ transform:scale(.98) }

/* Reset All Data button - red styling */
#resetAll {
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  border: 1px solid rgba(226, 66, 63, 0.3);
  color: white;
  transition: all .2s ease;
}
#resetAll:hover {
  background: linear-gradient(180deg, #ff5250, var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(226, 66, 63, 0.4);
  border-color: rgba(226, 66, 63, 0.5);
}
#resetAll:active {
  transform: scale(.98);
  box-shadow: 0 2px 10px rgba(226, 66, 63, 0.3);
}

/* container */
.container{
  max-width:1200px;
  margin:10px auto;
  padding:12px;
}
.subtitle{color:var(--muted); margin:6px 12px 18px}

/* tabs */
.tabs{
  display:flex; 
  gap:10px; 
  padding:10px 12px; 
  margin-bottom:18px;
  -webkit-overflow-scrolling:touch;
}
.tab{
  border-radius:12px;
  padding:10px 14px;
  background:var(--glass);
  border:1px solid rgba(255,255,255,0.03);
  color:var(--muted);
  cursor:pointer;
  transition:all .18s ease;
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(226,66,63,0.2);
}
.tab:hover{ transform:translateY(-2px) }
.tab:active{ transform:scale(0.98) }
.tab.active{background:var(--accent); color:white; box-shadow:0 6px 18px rgba(226,66,63,0.12)}
.tab i{
  margin-right:8px;
  font-size:14px;
}

/* cards */
.card{
  background:var(--card);
  border-radius:var(--radius);
  padding:18px;
  margin-bottom:18px;
  border:1px solid rgba(255,255,255,0.03);
  transition:transform .18s ease, box-shadow .18s ease;
  position: relative;
}
.card:hover{ transform:translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.6) }
.card.big{padding:22px}
.grid-2{display:flex; gap:22px; align-items:center}

/* Animated gradient border on calculation */
.card.calculating {
  border-color: rgba(226,66,63,0.2);
}

/* ring */
.progress-ring{width:var(--ring-size); height:var(--ring-size); position:relative; display:inline-block}
.ring-svg{width:100%; height:100%}
.ring-bg{fill:none; stroke:rgba(255,255,255,0.06); stroke-width:10}
.ring-fg{
  fill:none; stroke-width:8; stroke-linecap:round;
  transform:rotate(-90deg); transform-origin:center;
  /* we animate with JS; also add a tiny transition for stroke-dasharray */
  transition: filter .5s ease;
  filter: drop-shadow(0 6px 14px rgba(226,66,63,0.08));
}
.ring-center{
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  transition: transform .4s cubic-bezier(.2,.9,.2,1);
}
.ring-center .count{
  font-size:28px; 
  font-weight:800; 
  letter-spacing:0.6px; 
  transition: transform .3s ease, color .3s ease;
  display: inline-block;
}

/* subtle hover/pulse for ring when updated */
.progress-ring.animate { animation: ring-pulse .9s cubic-bezier(.2,.9,.2,1); }
@keyframes ring-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); filter: drop-shadow(0 10px 18px rgba(226,66,63,0.12)); }
  100% { transform: scale(1); }
}

/* Ring center pulse animation */
.ring-center.ring-pulse {
  animation: ring-center-pulse 0.6s cubic-bezier(.2,.9,.2,1);
}
@keyframes ring-center-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Number bounce animation */
.number-bounce {
  animation: number-bounce 0.3s cubic-bezier(.2,.9,.2,1);
}
@keyframes number-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Card calculating animation */
.card.calculating {
  animation: calculating-shimmer 0.8s ease-in-out;
  position: relative;
  overflow: hidden;
}
.card.calculating::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}
@keyframes calculating-shimmer {
  0%, 100% { box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
  50% { box-shadow: 0 10px 30px rgba(226,66,63,0.15); }
}

/* Pill glow animation */
.pill.pill-glow {
  animation: pill-glow 0.4s cubic-bezier(.2,.9,.2,1);
}
@keyframes pill-glow {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 0 rgba(226,66,63,0);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(226,66,63,0.3);
  }
}

/* Card slide animation */
.small.card-slide {
  animation: card-slide 0.4s cubic-bezier(.2,.9,.2,1);
}
@keyframes card-slide {
  0% { 
    transform: translateY(10px);
    opacity: 0.7;
  }
  100% { 
    transform: translateY(0);
    opacity: 1;
  }
}

/* Entry animations */
.entry-animate {
  transition: all 0.4s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.entry {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.entry:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Ring foreground smooth transition */
.ring-fg {
  transition: stroke-dasharray 1.2s cubic-bezier(.2,.9,.2,1), filter 0.5s ease;
}

/* Steps ring specific styling */
.steps-ring-fg {
  transition: stroke-dasharray 1.2s cubic-bezier(.2,.9,.2,1), filter 0.5s ease;
  filter: drop-shadow(0 6px 14px rgba(25,166,106,0.15));
}

.steps-ring:hover .steps-ring-fg {
  filter: drop-shadow(0 8px 18px rgba(25,166,106,0.3));
}

.steps-ring.animate {
  animation: steps-ring-pulse .9s cubic-bezier(.2,.9,.2,1);
}

@keyframes steps-ring-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); filter: drop-shadow(0 10px 18px rgba(25,166,106,0.2)); }
  100% { transform: scale(1); }
}

/* Additional smooth transitions for all numeric displays */
#currentIntake, #currentIntakeBig, #currentGoal, #remaining, 
#progressPercent, #currentProgress, #percentText,
#totalWorkouts, #totalMinutes, #totalCalories {
  transition: color 0.3s ease;
  display: inline-block;
}

/* Color transitions based on progress */
.progress-ring[data-percent] {
  --progress-color: var(--accent);
}
.progress-ring[data-percent="high"] .ring-fg {
  filter: drop-shadow(0 6px 14px rgba(226,66,63,0.2));
}

/* Smooth fade-in for lists */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulse effect for important numbers */
@keyframes pulse-glow {
  0%, 100% {
    text-shadow: 0 0 0 rgba(226,66,63,0);
  }
  50% {
    text-shadow: 0 0 10px rgba(226,66,63,0.5);
  }
}

/* Milestone animations */
.progress-ring.milestone-mid {
  animation: milestone-pulse 0.8s cubic-bezier(.2,.9,.2,1);
}
.progress-ring.milestone-high {
  animation: milestone-pulse 1s cubic-bezier(.2,.9,.2,1);
}
.progress-ring.milestone-complete {
  animation: milestone-complete 1.5s cubic-bezier(.2,.9,.2,1);
}

@keyframes milestone-pulse {
  0%, 100% { 
    transform: scale(1);
    filter: drop-shadow(0 6px 14px rgba(226,66,63,0.08));
  }
  50% { 
    transform: scale(1.05);
    filter: drop-shadow(0 10px 20px rgba(226,66,63,0.25));
  }
}

@keyframes milestone-complete {
  0%, 100% { 
    transform: scale(1);
    filter: drop-shadow(0 6px 14px rgba(226,66,63,0.08));
  }
  25% { 
    transform: scale(1.08);
    filter: drop-shadow(0 12px 24px rgba(226,66,63,0.4));
  }
  50% { 
    transform: scale(1.05);
    filter: drop-shadow(0 10px 20px rgba(226,66,63,0.3));
  }
  75% { 
    transform: scale(1.08);
    filter: drop-shadow(0 12px 24px rgba(226,66,63,0.4));
  }
}

/* Steps milestone animations */
.steps-ring.milestone-mid {
  animation: steps-milestone-pulse 0.8s cubic-bezier(.2,.9,.2,1);
}
.steps-ring.milestone-high {
  animation: steps-milestone-pulse 1s cubic-bezier(.2,.9,.2,1);
}
.steps-ring.milestone-complete {
  animation: steps-milestone-complete 1.5s cubic-bezier(.2,.9,.2,1);
}

@keyframes steps-milestone-pulse {
  0%, 100% { 
    transform: scale(1);
    filter: drop-shadow(0 6px 14px rgba(25,166,106,0.15));
  }
  50% { 
    transform: scale(1.05);
    filter: drop-shadow(0 10px 20px rgba(25,166,106,0.35));
  }
}

@keyframes steps-milestone-complete {
  0%, 100% { 
    transform: scale(1);
    filter: drop-shadow(0 6px 14px rgba(25,166,106,0.15));
  }
  25% { 
    transform: scale(1.08);
    filter: drop-shadow(0 12px 24px rgba(25,166,106,0.5));
  }
  50% { 
    transform: scale(1.05);
    filter: drop-shadow(0 10px 20px rgba(25,166,106,0.4));
  }
  75% { 
    transform: scale(1.08);
    filter: drop-shadow(0 12px 24px rgba(25,166,106,0.5));
  }
}

/* pills */
.pill-row{display:flex; gap:12px; margin-top:18px}
.pill{
  padding:12px 18px; 
  border-radius:10px; 
  min-width:120px; 
  text-align:center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pill strong {
  display: inline-block;
  transition: transform 0.2s ease;
}
.pill.green{background:linear-gradient(180deg, rgba(25,166,106,0.11), rgba(25,166,106,0.06)); color:var(--green)}
.pill.red{background:linear-gradient(180deg, rgba(226,66,63,0.07), rgba(226,66,63,0.03)); color:var(--accent)}

/* Steps pill hover effects */
.steps-pill {
  transition: all 0.3s ease;
  cursor: pointer;
}
.steps-pill:hover {
  background: linear-gradient(180deg, rgba(25,166,106,0.2), rgba(25,166,106,0.12));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(25,166,106,0.3);
  border: 1px solid rgba(25,166,106,0.3);
}
.steps-pill:hover strong {
  color: #1fb877;
  transform: scale(1.05);
}

/* small cards */
.small-cards{display:flex; gap:12px}
.small{
  background:transparent; 
  border:1px solid rgba(255,255,255,0.03); 
  border-radius:10px; 
  padding:14px; 
  flex:1; 
  display:flex; 
  gap:12px; 
  align-items:center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.small:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.small .icon{
  font-size:22px; 
  width:44px; 
  height:44px; 
  background:rgba(255,255,255,0.03); 
  display:flex; 
  align-items:center; 
  justify-content:center; 
  border-radius:8px;
  transition: transform 0.3s ease, background 0.3s ease;
}
.small .icon i{
  font-size:22px;
  color:inherit;
}
.small:hover .icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(255,255,255,0.06);
}
.small div strong {
  display: inline-block;
  transition: transform 0.2s ease;
}

/* Steps small cards hover effects */
.steps-small {
  transition: all 0.3s ease;
}
.steps-small:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(25,166,106,0.25);
  border-color: rgba(25,166,106,0.3);
  background: rgba(25,166,106,0.05);
}
.steps-small:hover .icon {
  background: rgba(25,166,106,0.15);
  transform: scale(1.15) rotate(10deg);
}
.steps-small:hover div strong {
  color: var(--green);
  transform: scale(1.1);
}

/* forms */
.form-row{display:flex; gap:10px; margin-top:10px}
.form-row input, .form-row select{background:transparent; border:1px solid rgba(255,255,255,0.04); padding:10px 12px; border-radius:8px; color:#e6e6e6; outline:none; min-width:0}
.form-row input:focus, .form-row select:focus{ box-shadow: 0 6px 18px rgba(0,0,0,0.6) inset; border-color: rgba(255,255,255,0.06) }
.btn-red{
  background:linear-gradient(180deg,var(--accent),var(--accent-dark)); 
  border:none; 
  color:white; 
  padding:12px 16px; 
  border-radius:10px; 
  cursor:pointer; 
  transition:all .2s ease;
  position: relative;
  overflow: hidden;
  touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(255,255,255,0.2);
}
.btn-red::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}
.btn-red:hover::before {
  width: 300px;
  height: 300px;
}
.btn-red:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(226,66,63,0.4);
}
.btn-red:active{ 
  transform:scale(.98);
  box-shadow: 0 2px 10px rgba(226,66,63,0.3);
}

/* Green button for steps */
.btn-green{
  background:linear-gradient(180deg, var(--green), #0d8a52); 
  border:none; 
  color:white; 
  padding:12px 16px; 
  border-radius:10px; 
  cursor:pointer; 
  transition:all .2s ease;
  position: relative;
  overflow: hidden;
  touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(255,255,255,0.2);
}
.btn-green::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}
.btn-green:hover::before {
  width: 300px;
  height: 300px;
}
.btn-green:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(25,166,106,0.4);
  background:linear-gradient(180deg, #1fb877, #0d8a52);
}
.btn-green:active{ 
  transform:scale(.98);
  box-shadow: 0 2px 10px rgba(25,166,106,0.3);
}
.btn-outline{
  background:transparent; 
  border:1px solid rgba(255,255,255,0.06); 
  color:var(--muted); 
  padding:10px 12px; 
  border-radius:8px;
  touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(255,255,255,0.1);
}
.btn-block{width:100%}
.btn-red.btn-block{margin-top:8px}

/* lists */
.history .list-empty{padding:40px; text-align:center; color:var(--muted); border-radius:10px; border:1px dashed rgba(255,255,255,0.03)}
.entry{
  display:flex; 
  justify-content:space-between; 
  align-items:center; 
  padding:10px; 
  border-radius:8px; 
  border:1px solid rgba(255,255,255,0.03); 
  margin-bottom:8px;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.entry .meta{display:flex; gap:12px; align-items:center}
.entry button{
  background:transparent; 
  border:none; 
  color:var(--muted); 
  cursor:pointer; 
  transition: all .2s ease;
  transform: scale(1);
  min-width:44px;
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:8px;
  -webkit-tap-highlight-color:rgba(255,255,255,0.1);
}
.entry button:hover{ 
  color: #fff;
  transform: scale(1.15);
}
.entry button:active {
  transform: scale(0.95);
}

/* Steps entry hover effects */
#stepsList .entry {
  transition: all 0.3s ease;
}
#stepsList .entry:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(25,166,106,0.2);
  border-color: rgba(25,166,106,0.3);
  background: rgba(25,166,106,0.03);
}
#stepsList .entry:hover strong {
  color: var(--green);
}

/* tips */
.tips .tip-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-top:12px}
.tips p{color:var(--muted); margin:6px 0 0}

/* footer */
.footer{
  text-align:center; 
  color:var(--muted); 
  margin-top:20px;
}
.footer a{
  color:var(--accent);
  text-decoration:none;
  transition:all .2s ease;
  font-weight:500;
}
.footer a:hover{
  color:#ff5250;
  text-decoration:underline;
}
.footer a:active{
  color:var(--accent-dark);
}
.footer-made{
  margin-top:8px;
  font-size:13px;
  color:var(--muted);
  text-align:center;
}
.footer-made .code-icon{
  color:#93C572;
  font-weight:600;
  font-family:'Courier New', monospace;
}

/* utility */
.hidden{display:none}
.center{text-align:center}

/* responsive */
/* Large tablets and small desktops (769px - 1024px) */
@media (max-width:1024px){
  .container{
    max-width:100%;
    padding:10px;
  }
  .topbar{
    padding:16px 20px;
  }
  .card{
    padding:16px;
  }
  .card.big{
    padding:20px;
  }
}

/* Tablets (481px - 768px) */
@media (max-width:768px){
  .topbar{
    padding:14px 16px;
    flex-wrap:wrap;
    gap:12px;
  }
  .brand{
    font-size:16px;
  }
  #resetAll{
    font-size:13px;
    padding:6px 10px;
    white-space:nowrap;
  }
  .container{
    padding:8px;
    margin:0;
  }
  .subtitle{
    margin:6px 8px 14px;
    font-size:14px;
  }
  
  /* Tabs - make scrollable */
  .tabs{
    display:flex;
    gap:8px;
    padding:8px;
    margin-bottom:14px;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
  }
  .tabs::-webkit-scrollbar{
    height:4px;
  }
  .tabs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
  }
  .tabs::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
  }
  .tab{
    padding:8px 12px;
    font-size:13px;
    white-space:nowrap;
    flex-shrink:0;
  }
  .tab i{
    margin-right:6px;
    font-size:13px;
  }
  
  /* Cards */
  .card{
    padding:14px;
    margin-bottom:14px;
  }
  .card.big{
    padding:16px;
  }
  .card:hover{
    transform:none;
  }
  
  /* Grid layouts */
  .grid-2{
    flex-direction:column;
    gap:18px;
  }
  
  /* Progress rings */
  .progress-ring{
    --ring-size:160px;
    margin:0 auto;
  }
  .ring-center .count{
    font-size:24px;
  }
  
  /* Pills */
  .pill-row{
    flex-direction:column;
    gap:10px;
    margin-top:14px;
  }
  .pill{
    min-width:auto;
    width:100%;
    padding:10px 14px;
  }
  
  /* Small cards */
  .small-cards{
    flex-direction:column;
    gap:10px;
  }
  .small{
    padding:12px;
  }
  
  /* Forms */
  .form-row{
    flex-direction:column;
    gap:8px;
  }
  .form-row input,
  .form-row select{
    width:100%;
    padding:10px;
  }
  
  /* Buttons */
  .btn-red,
  .btn-green,
  .btn-outline{
    padding:10px 14px;
    font-size:14px;
    min-height:44px;
    touch-action:manipulation;
  }
  .entry button{
    min-width:44px;
    min-height:44px;
    font-size:18px;
  }
  
  /* Tips grid */
  .tips .tip-grid{
    grid-template-columns:1fr;
    gap:10px;
  }
  
  /* Entry lists */
  .entry{
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
    padding:12px;
  }
  .entry .meta{
    width:100%;
  }
  .entry button{
    align-self:flex-end;
  }
  
  /* Footer */
  .footer{
    padding:0 16px;
    font-size:12px;
  }
  .footer-made{
    font-size:12px;
    margin-top:6px;
  }
}

/* Mobile phones (320px - 480px) */
@media (max-width:480px){
  body{
    padding-bottom:20px;
  }
  
  .topbar{
    padding:12px;
    flex-direction:column;
    align-items:flex-start;
  }
  .top-actions{
    width:100%;
    margin-top:8px;
  }
  #resetAll{
    width:100%;
    text-align:center;
    font-size:12px;
    padding:8px;
  }
  .brand{
    font-size:15px;
  }
  
  .container{
    padding:6px;
  }
  .subtitle{
    margin:4px 6px 12px;
    font-size:13px;
  }
  
  /* Tabs */
  .tabs{
    padding:6px;
    gap:6px;
    margin-bottom:12px;
  }
  .tab{
    padding:8px 10px;
    font-size:12px;
    border-radius:8px;
  }
  .tab i{
    margin-right:5px;
    font-size:12px;
  }
  
  /* Cards */
  .card{
    padding:12px;
    margin-bottom:12px;
    border-radius:10px;
  }
  .card.big{
    padding:14px;
  }
  .card h3{
    font-size:18px;
    margin-bottom:12px;
  }
  .card h4{
    font-size:16px;
    margin-bottom:10px;
  }
  
  /* Progress rings */
  .progress-ring{
    --ring-size:140px;
  }
  .ring-center .count{
    font-size:22px;
  }
  .ring-center small{
    font-size:11px;
  }
  
  /* Pills */
  .pill{
    padding:8px 12px;
    font-size:13px;
  }
  .pill small{
    font-size:11px;
  }
  .pill strong{
    font-size:16px;
  }
  
  /* Small cards */
  .small{
    padding:10px;
    gap:10px;
  }
  .small .icon{
    width:36px;
    height:36px;
    font-size:18px;
  }
  .small .icon i{
    font-size:18px;
  }
  .small div{
    font-size:13px;
  }
  .small div small{
    font-size:11px;
  }
  
  /* Forms */
  .form-row{
    gap:6px;
  }
  .form-row input,
  .form-row select{
    padding:9px;
    font-size:14px;
  }
  
  /* Buttons */
  .btn-red,
  .btn-green,
  .btn-outline{
    padding:10px 12px;
    font-size:13px;
    border-radius:8px;
    min-height:44px;
    touch-action:manipulation;
  }
  .entry button{
    min-width:44px;
    min-height:44px;
    font-size:18px;
    padding:6px;
  }
  
  /* Entry lists */
  .entry{
    padding:10px;
    font-size:13px;
  }
  .entry .meta{
    font-size:13px;
  }
  .entry button{
    font-size:16px;
    padding:4px 8px;
  }
  
  /* History lists */
  .history .list-empty{
    padding:30px 20px;
    font-size:13px;
  }
  
  /* Footer */
  .footer{
    padding:0 12px;
    font-size:11px;
    margin-top:16px;
  }
  .footer-made{
    font-size:11px;
    margin-top:6px;
  }
  
  /* Tips */
  .tips p{
    font-size:12px;
  }
  
  /* HR */
  hr{
    margin:12px 0;
  }
}

/* Extra small phones (max-width: 360px) */
@media (max-width:360px){
  .topbar{
    padding:10px;
  }
  .brand{
    font-size:14px;
  }
  
  .container{
    padding:4px;
  }
  
  .tabs{
    padding:4px;
  }
  .tab{
    padding:6px 8px;
    font-size:11px;
  }
  .tab i{
    margin-right:4px;
    font-size:11px;
  }
  
  .card{
    padding:10px;
  }
  .card h3{
    font-size:16px;
  }
  .card h4{
    font-size:14px;
  }
  
  .progress-ring{
    --ring-size:120px;
  }
  .ring-center .count{
    font-size:20px;
  }
  
  .pill{
    padding:6px 10px;
  }
  .pill strong{
    font-size:14px;
  }
  
  .small .icon{
    width:32px;
    height:32px;
    font-size:16px;
  }
  .small .icon i{
    font-size:16px;
  }
  
  .btn-red,
  .btn-green,
  .btn-outline{
    padding:9px 10px;
    font-size:12px;
  }
}

/* Landscape orientation adjustments */
@media (max-width:768px) and (orientation:landscape){
  .topbar{
    flex-direction:row;
    justify-content:space-between;
  }
  .top-actions{
    width:auto;
    margin-top:0;
  }
  #resetAll{
    width:auto;
  }
  
  .progress-ring{
    --ring-size:120px;
  }
  
  .grid-2{
    flex-direction:row;
    gap:16px;
  }
}

/* Print styles */
@media print{
  .topbar,
  .tabs,
  .btn-red,
  .btn-green,
  .btn-outline,
  #resetAll,
  .entry button,
  .footer{
    display:none;
  }
  .card{
    break-inside:avoid;
    page-break-inside:avoid;
  }
}

/* Sleep Input Styling */
#sleepStart, #sleepEnd {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  border-radius: 8px;
  padding: 12px;
  width: 100%;
  transition: all 0.3s ease;
  cursor: pointer;
}

#sleepStart:hover, #sleepEnd:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

#sleepStart:focus, #sleepEnd:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(226, 66, 63, 0.2);
  outline: none;
}

/* Custom Calendar Icon for Dark Mode */
#sleepStart::-webkit-calendar-picker-indicator,
#sleepEnd::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

#sleepStart::-webkit-calendar-picker-indicator:hover,
#sleepEnd::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

