/* ===============================
   DESIGN SYSTEM — SWISS / EDITORIAL
================================ */

:root {
  --paper: #f4f4f2;
  --ink: #0a0a0a;
  --muted: #6b6b6b;
  --accent: #0e1cff;
  --grid: rgba(0, 0, 0, 0.06);

  --frame: 3px;
  --gap: 32px;
}

/* ===============================
   RESET
================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #0e1cff;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
}

/* ===============================
   FRAME
================================ */

.frame {
  min-height: 100vh;
  background: var(--paper);
  border: var(--frame) solid var(--ink);
  margin: 18px;
  display: flex;
  flex-direction: column;

  /* grid texture */
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ===============================
   TOP STRIP
================================ */

.top-strip {
  position: sticky;
  top: 0;
  z-index: 10;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 28px;
  border-bottom: var(--frame) solid var(--ink);
  background: var(--paper);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-self: start;
}

.sidebar-trigger {
  color: var(--ink);
  opacity: 1;
  padding: 0;
  margin-right: 4px;
  /* Subtle spacing from brand text */
}

.sidebar-trigger:hover {
  opacity: 0.7;
}

.brand {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 42px;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  grid-column: 2;
}

.top-nav span {
  cursor: pointer;
  opacity: 0.5;
}

.top-nav span.active {
  opacity: 1;
  color: #1f4cff;
  font-weight: 700;
}

.meta {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-self: end;
}

.icon-trigger {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s;
  opacity: 0.6;
}

.icon-trigger:hover {
  opacity: 1;
}

#settingsBtn:hover {
  transform: rotate(45deg);
}

#fullscreenBtn:hover {
  transform: scale(1.2);
}

/* ===============================
   SECTIONS
================================ */

.section {
  padding: 80px 72px;
}

.section+.section {
  border-top: var(--frame) solid var(--ink);
}

/* ===============================
   HERO SECTION
================================ */

.hero {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 80px;
  align-items: center;
}

/* HERO TYPOGRAPHY */

.hero-text {
  display: flex;
  flex-direction: column;
}

.kicker {
  font-size: 12px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero-text h1 {
  font-family: "Space Mono", monospace;
  font-size: clamp(88px, 10vw, 160px);
  line-height: 0.92;
  margin: 0 0 32px;
}

.subtitle {
  max-width: 420px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* TIMER */

.timer-block {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.timer-frame {
  border: var(--frame) solid var(--ink);
  padding: 64px 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 500px;
  height: 340px;
}

.time {
  font-family: "Space Mono", monospace;
  font-size: clamp(72px, 7vw, 120px);
  letter-spacing: 0.1em;
  margin-right: -0.1em;
  /* Compensate for letter-spacing to ensure absolute center */
}

.status {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.4em;
  margin-right: -0.4em;
  /* Compensate for letter-spacing to ensure absolute center */
  color: var(--muted);
}

/* CONTROLS */

.controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.controls button {
  border: var(--frame) solid var(--ink);
  background: transparent;
  padding: 14px 10px;
  font-size: 12px;
  letter-spacing: 0.28em;
  cursor: pointer;
}

.controls .primary {
  background: var(--ink);
  color: white;
}

/* SCROLL INDICATOR */

.scroll-indicator {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.4em;
  opacity: 0.6;
  animation: float 1.6s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(6px);
  }
}

/* ===============================
   INSIGHTS — RIBBON LAYOUT
================================ */

.stats {
  background: #ffffff;
}

.section-title {
  display: none;
}

.stats-ribbon {
  display: grid;
  /* Requirement: "STREAK, TASKS, and FOCUS boxes must... Be exactly the same height and width." */
  /* Layout: Streak(1) | Tasks(1) | Focus(1.2? No, same width) | Goal(2) | Set(1) */
  /* Let's try 1fr for the first 3. Goal fill needs breathing room? */
  /* User: "Align perfectly... Use identical padding... Feel like a unified data ribbon." */
  /* Ribbon: Streak | Tasks | Focus | Goal | Set */
  /* Proportions: 1fr 1fr 1.2fr 1.5fr 1fr */
  /* Actually, "exactly the same width" usually implies 1fr. Let's start with 1fr for boxes 1,2,3. */
  /* Goal box usually wider? User didn't specify Goal width, but said "ALL boxes must... Align perfectly".
       But Reqs 1 says "STREAK, TASKS, and FOCUS boxes must Be exactly the same height and width." (Subset) 
       Implies Goal might be different? "Feel like a unified data ribbon" implies visual consistency. */
  grid-template-columns: 1fr 1fr 1.2fr 1.8fr 1fr;
  gap: 12px;
}

.stat-box {
  border: var(--frame) solid var(--ink);
  height: 64px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  background: transparent;
  min-width: 0;
  /* Flex fix */
}

.stat-box.btn {
  cursor: pointer;
  font-family: "Space Mono", monospace;
  font-size: 14px;
  letter-spacing: 0.1em;
  align-items: center;
  transition: background 0.1s;
  text-align: center;
}

.stat-box.btn:hover {
  background: var(--ink);
  color: white;
}

.stat-box.btn:active {
  background: var(--ink);
  color: white;
}

/* LABELS & VALUES */

.stat-box .label {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  z-index: 2;
  position: relative;
  white-space: nowrap;
}

.stat-box strong {
  font-family: "Space Mono", monospace;
  font-size: 18px;
  line-height: 1.2;
  z-index: 2;
  position: relative;
  white-space: nowrap;
}

/* GOAL BOX SPECIALS */

.goal-box {
  display: block;
  overflow: hidden;
  padding: 0;
}

.goal-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: #beef00;
  z-index: 0;
  transition: width 0.3s linear;
}

.goal-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 16px;
}

.goal-input-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 12px;
}

#goalInput {
  width: 100%;
  border: none;
  background: transparent;
  font-family: "Space Mono", monospace;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  padding: 0;
}

#goalInput::placeholder {
  color: var(--muted);
  font-size: 12px;
}

.goal-msg {
  font-size: 9px;
  color: #ff0028;
  height: 12px;
  margin-top: 2px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.goal-msg.visible {
  opacity: 1;
}

.shake {
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

/* ===============================
   FOCUS SECTION
================================ */

.focus-hero {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 80px 72px !important;
}

.focus-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 60px;
  width: 100%;
}

.focus-tasks {
  width: 100%;
}

/* Focus page layout adjustments based on task list state */
.focus-hero-content.tasks-empty {
  justify-content: center;
  gap: 0;
}

.focus-hero-content.tasks-present {
  justify-content: center;
  gap: 60px;
}

/* ===============================
   TASKS SECTION
================================ */

.tasks {
  background: transparent;
  padding-top: 64px;
  /* Reduced breathing room */
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.tasks .task-list {
  flex: 1;
}

.tasks-header {
  border-bottom: none;
  padding-bottom: 8px;
  margin-bottom: 24px;
  display: block;
}

.tasks-header h2 {
  margin: 0 0 8px 0;
  /* Reduced space below header */
  letter-spacing: 0.2em;
  font-size: 60px;
  /* Significantly larger */
  font-weight: 1000;
  font-family: "Space Mono", monospace;
}

.tasks-subheader h3 {
  display: none;
}

.task-helper {
  margin: 0;
  font-size: 13px;
  /* Enhanced readability */
  color: var(--muted);
  font-family: "Inter", sans-serif;
  font-weight: 400;
  line-height: 1.5;
  opacity: 1;
  /* High visibility */
  max-width: 100%;
}

.task-helper-example {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--muted);
  font-family: "Inter", sans-serif;
  font-weight: 400;
  line-height: 1.5;
  opacity: 0.7;
}



.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0px;
  /* Tighter list */
  width: 100%;
  /* Full width to match input */
  /* Align with general input feel/eye-line */
}

.task-list li {
  padding: 12px 0;
  cursor: default;
  font-size: 14px;
  /* Flexbox for Left/Right alignment */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  /* Spacing between name and controls */

  padding: 12px 0;
  cursor: default;
  font-size: 14px;
  transition: all 0.2s;
  border-bottom: none;
  /* Removed divider */
  font-family: "Space Mono", monospace;
  white-space: nowrap;
}

.task-list li.completed {
  opacity: 0.4;
}

.task-list li.completed .task-name {
  text-decoration: line-through;
}

.task-list li.active-task {
  background: transparent;
  border-bottom: none;
  /* No underline/border */
  color: #1400c6;
  /* Active text color */
}

.task-list li.active-task .task-name {
  color: #1400c6;
  font-weight: 700;
}

.task-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  /* Increased spacing */
  justify-content: flex-end;
}

/* Updated Task Layout Elements */

.task-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "Space Mono", monospace;
  cursor: pointer;
  /* Completion toggle */
}

.timer-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-time {
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0.1em;
  min-width: 48px;
  text-align: right;
}

.task-btn {
  border: 1px solid var(--ink);
  background: transparent;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 0.1em;
  opacity: 1;
  transition: all 0.2s;
  white-space: nowrap;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  /* Clear padding for squares */
}

/* Square Buttons (+, -, x) */
.icon-btn,
.remove-btn {
  width: 28px;
}

/* Text Buttons (ADD, REMOVE) */
.action-btn {
  width: auto;
  padding: 0 12px;
}

.task-btn:hover {
  opacity: 1;
  background: var(--ink);
  color: white;
}

.task-btn.remove-btn {
  border-color: #ff0028;
  color: #ff0028;
  opacity: 1;
}

.task-btn.remove-btn:hover {
  background: #ff0028;
  color: white;
}

.current-task {
  margin-top: 18px;
  font-family: "Space Mono", monospace;
  /* Match others */
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  min-height: 20px;
  text-align: center;
  letter-spacing: 0.05em;
  margin-right: -0.05em;
  /* Offset for centering */
  text-transform: uppercase;
}

/* ===============================
   TASK INPUT
================================ */

.task-input {
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
}

.task-input input {
  flex: 1;
  padding: 16px 18px;
  border: var(--frame) solid var(--ink);
  background: #ffffff;
  /* Make input stand out on transparent bg */
  width: 100%;
  /* Ensure full width relative to flexing */
  font-family: "Space Mono", monospace;
  font-size: 14px;
}

/* Removed #setTimeBtn styles as it is deleted */

.task-input input::placeholder {
  color: var(--muted);
  font-family: "Inter", sans-serif;
  /* Keep placeholder simple if wanted, or mono */
}

.task-input input:focus {
  outline: none;
  background: #ffffff;
  box-shadow: none;
  /* Removed shadow */
}

#addTaskBtn {
  border: var(--frame) solid var(--ink);
  background: transparent;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  padding: 0 20px;
  cursor: pointer;
  letter-spacing: 0.1em;
  font-weight: 700;
  transition: all 0.2s;
}

#addTaskBtn:hover {
  background: var(--ink);
  color: white;
}

/* ===============================
   CONTROLS (Restored if needed)
================================ */

.controls.single {
  grid-template-columns: 1fr;
}

/* ===============================
   SIDEBAR
 ================================ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 360px;
  height: 100vh;
  background: #f4f4f2;
  border-right: var(--frame) solid var(--ink);
  z-index: 2000;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  padding: 0;
}

.sidebar.active {
  transform: translateX(0);
}

/* ===============================
   SIDEBAR LAYOUT
================================ */

.sidebar-left-strip {
  width: 40px;
  background: #0a0a0a;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  height: 100vh;
  padding-top: 20px;
}

.sidebar-left-strip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 86px;
  background: #070e80;
  z-index: 1;
}

.rotated-text {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 14px;
  color: #f4f4f2;
  transform: rotate(-90deg);
  white-space: nowrap;
  letter-spacing: 0.1em;
  position: absolute;
  top: 150px;
  left: 70%;
  transform-origin: top left;
  margin-left: -20px;
}

.sidebar-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.sidebar-header-blue {
  background: #0e1cff;
  height: 86px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sidebar-header-blue:hover {
  background: #0d18e6;
}

.user-name {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #f4f4f2;
  margin: 0;
}

/* ===============================
   AUTHENTICATION STATUS
================================ */

.auth-status {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  position: relative;
}

/* Google Sign-in Button Component */
.auth-status .sign-in-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: none;
  outline: none;
  color: #f4f4f2;
  padding: 0;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 0;
  width: 100%;
  height: 86px;
  text-decoration: none;
  user-select: none;
  box-sizing: border-box;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  padding: 4px 0;
  cursor: pointer;
  min-height: 44px;
}

.user-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  max-height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(244, 244, 242, 0.15);
  transition: all 0.2s ease;
  display: block;
  flex-shrink: 0;
}

.user-avatar:hover {
  border-color: rgba(244, 244, 242, 0.3);
  transform: scale(1.05);
}

.user-profile .avatar-fallback {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  max-height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(244, 244, 242, 0.15);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.user-profile .avatar-initial {
  color: white;
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
}

.user-profile .avatar-fallback:hover {
  border-color: rgba(244, 244, 242, 0.3);
  transform: scale(1.05);
}

.user-name-text {
  font-family: "Inter", sans-serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #f4f4f2;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.user-email-text {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #f4f4f2;
  opacity: 0.6;
  text-align: left;
  margin: 0;
}

.user-profile:hover .user-name-text {
  opacity: 1;
}

/* ===============================
   PROFILE MODAL (Legacy - Use profile-modal-overlay)
================================ */

.profile-modal {
  /* Deprecated - use profile-modal-overlay instead */
  display: none;
}

.profile-modal.active {
  /* Deprecated - use profile-modal-overlay.active instead */
  display: none;
}

.profile-modal-content {
  display: flex;
  flex-direction: column;
}

.profile-modal.active .profile-modal-content {
  transform: scale(1) translateY(0);
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

/* Deprecated modal-avatar styles - moved to profile section */

/* Deprecated avatar-container styles - moved to profile section */

.change-avatar-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--ink);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0;
  transform: scale(0.8);
}

.avatar-container:hover .change-avatar-btn {
  opacity: 1;
  transform: scale(1);
}

.change-avatar-btn:hover {
  background: var(--accent-dark);
  transform: scale(1.1);
}

.remove-avatar-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #dc3545;
  border: 2px solid var(--ink);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0;
  transform: scale(0.8);
}

.avatar-container:hover .remove-avatar-btn {
  opacity: 1;
  transform: scale(1);
}

.remove-avatar-btn:hover {
  background: #c82333;
  transform: scale(1.1);
}

.change-avatar-color-btn {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
  border: 2px solid var(--ink);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0;
  transform: scale(0.8);
}

.avatar-container:hover .change-avatar-color-btn {
  opacity: 1;
  transform: scale(1);
}

.change-avatar-color-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.modal-avatar:hover {
  border-color: var(--accent);
  transform: scale(1.02);
}

/* Deprecated modal-avatar+avatar-fallback styles - moved to profile section */

.modal-user-info {
  text-align: center;
}

.username-edit-container,
.email-edit-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* Stacked layout starts here */
  width: 100%;
}

.username-error {
  font-family: "Inter", sans-serif;
  font-size: 10px;
  color: #ff0028;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 2px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.username-error.show {
  opacity: 1;
}

.modal-user-name {
  font-family: "Space Mono", monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  cursor: default;
  line-height: 1.2;
  transition: all 0.2s ease;
  outline: none;
  border: none;
  background: transparent;
  padding: 0;
  display: inline;
  letter-spacing: -0.01em;
}

.modal-user-name[contenteditable="true"] {
  cursor: text;
  background: transparent;
  /* Removed blue highlight */
  padding: 2px 4px;
  /* Slightly tighter */
  margin: -2px -4px;
  outline: none;
}

.modal-user-email {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: px;
  /* Tightened from 12px */
  width: 100%;
}

.sidebar-header {
  padding: 24px 28px;
  border-bottom: var(--frame) solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0a0a0a;
  color: #f4f4f2;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.sidebar-item {
  padding: 10px 28px;
  font-family: "Space Mono", monospace;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.02em;
  transition: background 0.2s, color 0.2s;
  border-bottom: 1px solid var(--ink);
  height: 48px;
  display: flex;
  align-items: center;
}

.sidebar-item:hover {
  background: #D6E6F2;
  color: var(--ink);
}

.sidebar-item.active {
  color: var(--accent);
}

.sidebar .close-btn {
  position: static;
  font-size: 32px;
  padding: 0;
  opacity: 1;
  color: #f4f4f2;
  background: none;
  border: none;
  cursor: pointer;
}

/* ===============================
   SIDEBAR CONTACT & FOOTER
================================ */

.sidebar-donate {
  padding: 28px;
  border-top: var(--frame) solid var(--ink);
  flex-shrink: 0;
  background: #D6E6F2;
}

.donate-title {
  font-family: "Space Mono", monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
  font-weight: 700;
  opacity: 0.9;
}

.donate-subtitle {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 14px;
  opacity: 0.8;
  letter-spacing: 0.01em;
}

.donate-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.donate-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border: var(--frame) solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  background: #ffffff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  overflow: hidden;
}

.donate-link:hover {
  background: #228B22;
  border-color: #ffffff;
  color: var(--paper);
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(34, 139, 34, 0.3);
  filter: brightness(1.05);
}

.donate-link:active {
  transform: translateY(0);
  box-shadow: none;
  transition-duration: 0.1s;
}

.donate-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
}

.donate-text {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

.sidebar-footer {
  padding: 18px 28px;
  border-top: var(--frame) solid var(--ink);
  flex-shrink: 0;
}

.social-icons {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.social-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-icon:hover {
  background: var(--ink);
  color: var(--paper);
}

.copyright {
  font-family: "Inter", sans-serif;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
  letter-spacing: 0.05em;
}

/* OVERLAY FOR SIDEBAR */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ===============================
   MODAL — SETTINGS
================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--paper);
  border: var(--frame) solid var(--ink);
  width: fit-content;
  min-width: 360px;
  max-width: 90vw;
  padding: 56px 48px 40px;
  /* Symmetrical but breathing room for hero title */
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: flex-start;
  /* Title on left */
  align-items: center;
  margin-bottom: 42px;
}

.modal-header h3 {
  margin: 0;
  font-family: "Space Mono", monospace;
  font-size: 48px;
  line-height: 0.9;
  font-weight: 1000;
  letter-spacing: -0.02em;
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  opacity: 0.4;
  line-height: 1;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.close-btn:hover {
  opacity: 1;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-row label {
  font-size: 12px;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.stepper {
  display: flex;
  align-items: center;
  border: 2px solid var(--ink);
  background: white;
}

.step-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-family: "Space Mono", monospace;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-btn:hover {
  background: var(--ink);
  color: white;
}

.stepper input {
  width: 50px;
  border: none;
  border-left: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  text-align: center;
  font-family: "Space Mono", monospace;
  font-size: 14px;
  padding: 6px 0;
  height: 32px;
  appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.settings-hint {
  margin-top: 32px;
  font-size: 10px;
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ===============================
   FOOTER
================================ */

.bottom-credit {
  padding: 42px;
  text-align: center;
  font-size: 12px;
  margin-top: auto;
  letter-spacing: 0.05em;
  color: var(--muted);
  opacity: 0.7;
  font-family: "Inter", sans-serif;
  border-top: var(--frame) solid var(--ink);
  background: #ffffff;
}

/* ===============================
   FULL SCREEN MODE
================================ */

body.fullscreen-active {
  background: var(--paper);
  /* Keep the paper theme */
  overflow: hidden;
}

body.fullscreen-active .frame {
  margin: 0;
  border: none;
  height: 100vh;
  justify-content: center;
  align-items: center;
}

body.fullscreen-active .top-strip,
body.fullscreen-active .hero-text,
body.fullscreen-active .scroll-indicator,
body.fullscreen-active .stats,
body.fullscreen-active .tasks,
body.fullscreen-active .bottom-credit {
  display: none !important;
}

body.fullscreen-active .hero {
  min-height: 0;
  height: auto;
  width: 100%;
  display: flex;
  justify-content: center;
}

body.fullscreen-active .hero-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 600px;
  gap: 0;
}

body.fullscreen-active .timer-block {
  width: 100%;
  max-width: 600px;
  transform: scale(1.2);
  transition: transform 0.3s ease;
}

/* Full Screen Mode specific visibility adjustments */
body.fullscreen-active .v-tag,
body.fullscreen-active #settingsBtn,
body.fullscreen-active .top-nav {
  display: none !important;
}

body.fullscreen-active .meta {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
}

body.fullscreen-active #fullscreenBtn {
  opacity: 0.3;
}

body.fullscreen-active #fullscreenBtn:hover {
  opacity: 1;
}

/* ===============================
   AUTHENTICATION MODAL
================================ */

/* ===============================
   SHARED MODAL
================================ */

.modal-panel {
  background: var(--paper);
  border: var(--frame) solid var(--ink);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  transform: scale(0.92) translateY(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  border-radius: 12px;

  /* Grid texture */
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-color: var(--paper);
}

.modal-overlay.active .modal-panel,
.auth-modal-overlay.active .modal-panel,
.profile-modal.active .modal-panel {
  transform: scale(1) translateY(0);
}

/* ===============================
   AUTHENTICATION MODAL
================================ */

.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 10, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 4000;
  cursor: default;
}

.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}




.auth-modal-overlay.active .auth-modal-content {
  /* Handled by global .modal-panel active state if used, 
       but keeping this just in case specific overrides needed 
       or if we fully switch HTML classes */
  transform: scale(1) translateY(0);
}

/* Override .modal-panel styles for Auth to match Settings/Flat look */
.auth-modal-content {
  border-radius: 0;
  box-shadow: none;
  background-image: none;
  padding: 40px 32px 32px;
  /* More compact padding */
  max-width: 380px;
  /* Slightly narrower */
}

.auth-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--ink);
  opacity: 0.4;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.auth-close-btn:hover {
  opacity: 1;
}

/* Auth Heading */
.auth-modal-header {
  margin-bottom: 28px;
  /* Reduced from 42px */
  display: flex;
  justify-content: flex-start;
  align-items: center;
  /* Removed position: relative so button positions relative to content */
}

.auth-modal-title {
  margin: 0;
  font-family: "Space Mono", monospace;
  font-size: 40px;
  /* Slightly smaller for compact feel */
  line-height: 0.9;
  font-weight: 1000;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: left;
  text-transform: uppercase;
  /* ALL CAPS */
}

/* ===============================
   PROFILE MODAL (Matching Auth Theme)
================================ */

.profile-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 10, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 4000;
  cursor: default;
}

.profile-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.profile-modal-content {
  position: relative;
  border-radius: 0;
  box-shadow: none;
  background-image: none;
  background: var(--paper);
  border: var(--frame) solid var(--ink);
  padding: 32px;
  max-width: 380px;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-modal-overlay.active .profile-modal-content {
  transform: scale(1) translateY(0);
}

.profile-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--ink);
  opacity: 0.4;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.profile-close-btn:hover {
  opacity: 1;
}

.profile-modal-header {
  margin-bottom: 30px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-right: 40px;
}

.profile-modal-title {
  margin: 0;
  font-family: "Space Mono", monospace;
  font-size: 40px;
  line-height: 0.9;
  font-weight: 1000;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: left;
  text-transform: uppercase;
}

/* Profile Body */
.profile-body {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 0;
}

/* Avatar Section */
.profile-avatar-section {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  padding: 0;
  width: 100%;
}

/* Profile avatar container - moved to profile section */

.profile-avatar-section .avatar-edit-hint {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: 50%;
}

.profile-avatar-section .avatar-container:hover .avatar-edit-hint {
  opacity: 1;
}

.modal-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
}

.profile-avatar-section .avatar-container {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  box-sizing: border-box;
}

/* Profile Info Section */
.profile-info-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.profile-info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.profile-info-item.username-centered {
  gap: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 20px;
  margin-top: 6px;
  padding: 0;
}

.profile-info-item.username-centered .profile-info-value {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.profile-info-label {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-info-value-container {
  position: relative;
}

.profile-info-value {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  word-break: break-word;
  font-weight: 500;
}

.profile-error {
  display: none;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  color: #d32f2f;
  margin-top: 4px;
}

.profile-error.show {
  display: block;
}

/* Profile Divider */
.profile-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.5;
}

.profile-divider::before,
.profile-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--grid);
}

/* Profile Actions */
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.profile-action-btn {
  width: 100%;
  height: 48px;
  padding: 12px 16px;
  border: var(--frame) solid var(--ink);
  border-radius: 8px;
  background: transparent;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.profile-action-btn:hover {
  background: var(--ink);
  color: white;
}

.profile-action-btn:active {
  transform: scale(0.98);
}

.profile-action-btn.primary {
  background: transparent;
  color: var(--ink);
}

.profile-action-btn.primary:hover {
  background: var(--ink);
  color: white;
}

.profile-action-btn.secondary {
  background: transparent;
}

.profile-action-btn.secondary svg {
  width: 16px;
  height: 16px;
}

.profile-action-btn.secondary:hover {
  background: var(--ink);
  color: white;
}

.profile-action-btn.danger {
  color: #d32f2f;
  border-color: #d32f2f;
}

.profile-action-btn.danger:hover {
  background: #d32f2f;
  border-color: #d32f2f;
  color: white;
}

/* Avatar settings as a formal modal */
#avatarSettingsModal {
  z-index: 5000;
}

.avatar-settings-content {
  border-radius: 0;
  box-shadow: none;
  background-image: none;
  padding: 32px;
  max-width: 380px;
  /* Consistent with Profile/Auth */
}

.avatar-settings-content .avatar-controls-group {
  max-width: 100%;
  margin-bottom: 16px;
}

.avatar-settings-content .profile-body {
  padding: 0;
  margin-bottom: 0;
}

.extension-content {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Stack controls and palette */
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 0 4px;
}

.avatar-controls-group {
  display: flex;
  gap: 1px;
  /* Segmented feel */
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 100%;
}

.avatar-extension-btn {
  flex: 1;
  background: white;
  border: none;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: "Space Mono", monospace;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.avatar-extension-btn svg {
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.avatar-extension-btn:hover {
  background: #f8f8f8;
  z-index: 1;
}

.avatar-extension-btn:hover svg {
  opacity: 1;
  transform: scale(1.1);
}

.avatar-extension-btn:active {
  background: #eee;
}

.avatar-extension-btn.delete {
  color: #ff0028;
}

.avatar-extension-btn.delete:hover {
  background: #fff0f1;
}

/* Color Palette Grid */
.avatar-color-grid {
  display: grid;
  grid-template-columns: repeat(6, 24px);
  justify-content: center;
  gap: 20px;
  padding: 24px;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.02);
  border: var(--frame) solid var(--ink);
  border-radius: 8px;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.color-swatch:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.color-swatch.active {
  border-color: var(--ink);
  transform: scale(1.1);
}

.color-swatch.active::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  opacity: 0.3;
}

/* ===============================
   DONATE MODAL (QR Code)
================================ */

.donate-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 10, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 4500;
}

.donate-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  visibility: visible;
}

.donate-modal-panel {
  position: relative;
  border-radius: 0;
  box-shadow: none;
  background-image: none;
  background: var(--paper);
  border: var(--frame) solid var(--ink);
  padding: 32px;
  max-width: 400px;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.donate-modal-overlay.active .donate-modal-panel {
  transform: scale(1) translateY(0);
}

.donate-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--ink);
  opacity: 0.4;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.donate-close-btn:hover {
  opacity: 1;
}

.donate-modal-header {
  margin-bottom: 24px;
  padding-right: 40px;
}

.donate-modal-header h3 {
  margin: 0;
  font-family: "Space Mono", monospace;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink);
  text-transform: uppercase;
}

.donate-modal-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 20px;
  background: #ffffff;
  border: var(--frame) solid var(--ink);
  border-radius: 8px;
  box-sizing: border-box;
}

#upiQrCode {
  display: block;
  max-width: 100%;
  width: 280px;
  height: 280px;
  height: auto;
  image-rendering: crisp-edges;
}

.qr-instruction {
  text-align: center;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--ink);
  margin: 0;
  line-height: 1.5;
}

.upi-id-display {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#upiIdText {
  font-family: "Space Mono", monospace;
  font-size: 13px;
  color: var(--ink);
  background: #ffffff;
  border: var(--frame) solid var(--ink);
  border-radius: 8px;
  padding: 12px 16px;
  height: 48px;
  flex: 1;
  line-height: 1.4;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

#upiIdText:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: none;
}

.copy-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--frame) solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.copy-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.copy-btn:active {
  transform: scale(0.95);
}

.copy-feedback {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  color: #28a745;
  font-weight: 600;
  text-align: center;
  margin-top: 8px;
  animation: fadeInOut 1.5s ease-in-out;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.qr-note {
  display: none;
}


/* Old profile action styles - replaced by new profile-action-btn */

/* Success Feedback Styling */
.success-feedback {
  background: #e6f7e9 !important;
  border-color: #2e7d32 !important;
  color: #2e7d32 !important;
}



/* Auth Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-input-group {
  position: relative;
}

.auth-input {
  width: 100%;
  height: 48px;
  /* Match Social Buttons */
  /* Match Social Buttons */
  padding: 0 16px;
  background: #ffffff;
  border: var(--frame) solid var(--ink);
  /* 3px solid ink */
  border-radius: 8px;
  /* Matching site feel but cleaner */
  font-family: "Space Mono", monospace;
  font-size: 14px;
  color: var(--ink);
  transition: all 0.2s ease;
  box-sizing: border-box;
  box-shadow: none;
}

.auth-input::placeholder {
  color: var(--muted);
  font-family: "Inter", sans-serif;
}

.auth-input:focus {
  outline: none !important;
  background: #ffffff;
  border-color: var(--accent);
  /* Clean focus, no shadow/double border */
  box-shadow: none !important;
}

.auth-primary-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--ink);
  border: var(--frame) solid var(--ink);
  border-radius: 8px;
  /* Consistent radius */
  font-family: "Space Mono",
    monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: white;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 8px;
  box-shadow: none;
  /* Removed shadow for cleaner look matching social buttons */
}

.auth-primary-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.auth-primary-btn:active {
  transform: scale(0.98);
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ink);
  opacity: 0.15;
}

.auth-divider span {
  padding: 0 20px;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* OAuth Providers */
.auth-providers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* 2x2 Grid */
  gap: 12px;
}

.auth-provider-btn {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: transparent;
  background: transparent;
  border: var(--frame) solid var(--ink);
  border-radius: 8px;
  /* Standardized Radius */
  font-family: "Space Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-provider-btn:hover {
  background: transparent;
  color: var(--ink);
}

.auth-provider-btn:hover svg {
  fill: currentColor;
}

.auth-provider-btn:active {
  transform: scale(0.98);
}

.auth-provider-btn.google:hover {
  background: transparent;
  border-color: var(--ink);
}

.auth-provider-btn.facebook:hover {
  background: transparent;
  border-color: var(--ink);
}

.auth-provider-btn.apple:hover {
  background: transparent;
  border-color: var(--ink);
}

.auth-provider-btn.github:hover {
  background: transparent;
  border-color: var(--ink);
}

/* Auth Views */
.auth-view {
  display: flex;
  flex-direction: column;
}

/* Auth Labels */
.auth-label {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.auth-label-row .auth-label {
  margin-bottom: 0;
}

.auth-forgot-link {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.auth-forgot-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Password Wrapper */
.auth-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-password-wrapper .auth-input {
  padding-right: 48px;
}

.auth-password-toggle {
  position: absolute;
  right: 14px;
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--muted);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-password-toggle:hover {
  opacity: 1;
}

/* Auth Checkbox */
.auth-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  cursor: pointer;
}

.auth-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--ink);
  cursor: pointer;
  margin-top: 2px;
  border-radius: 8px;
  border: var(--frame) solid var(--ink);
}

.auth-checkbox-text {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

/* Footer Switch */
.auth-footer-switch {
  margin: 28px 0 0 0;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.auth-footer-switch a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.profile-body>* {
  margin-top: 0;
  margin-bottom: 0;
}

/* ===============================
   AUTH BUTTON RESETS & STATES
================================ */

/* Universal button reset for auth/profile modals */
.auth-modal-content button,
.profile-modal-content button {
  -webkit-appearance: none;
  appearance: none;
}

/* Focus-visible states for keyboard accessibility */
.auth-tab:focus-visible,
.auth-input:focus-visible,
.auth-primary-btn:focus-visible,
.auth-provider-btn:focus-visible,
.auth-close-btn:focus-visible,
.edit-username-btn:focus-visible,
.sign-out-btn:focus-visible,
.sign-in-google-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Disabled button states */
.auth-primary-btn:disabled,
.auth-provider-btn:disabled,
.sign-in-google-btn:disabled,
.edit-username-btn:disabled,
.sign-out-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Loading states */
.auth-primary-btn.loading,
.auth-provider-btn.loading,
.sign-in-google-btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.auth-primary-btn.loading svg,
.auth-provider-btn.loading svg,
.sign-in-google-btn.loading svg {
  visibility: hidden;
}

.auth-primary-btn.loading::after,
.auth-provider-btn.loading::after,
.sign-in-google-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
}

.auth-provider-btn.loading::after {
  border: 2px solid rgba(10, 10, 10, 0.2);
  border-top-color: var(--ink);
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error message styles */
.auth-error {
  background: rgba(255, 0, 40, 0.06);
  border: 1px solid rgba(255, 0, 40, 0.3);
  color: #ff0028;
  padding: 12px 16px;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 16px;
  display: none;
  text-align: center;
}

.auth-error.show {
  display: block;
}

/* Info message variant (for non-error messages) */
.auth-error.info {
  background: rgba(14, 28, 255, 0.06);
  border-color: rgba(14, 28, 255, 0.3);
  color: var(--accent);
}

/* === PROFILE AVATAR — SINGLE SOURCE OF TRUTH === */

.profile-avatar-section .avatar-container {
  width: 80px;
  height: 80px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  position: relative;
}

.profile-avatar-section .avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent);
  color: white;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 800;
  font-size: 36px;
}

/* =================================
   INSIGHTS SPECIFIC STYLES
================================= */

.insights-hero {
  padding-bottom: 40px;
}

.insights-ribbon {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 48px;
}

/* CALENDAR */

.calendar-section {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.calendar-header h2 {
  font-family: "Space Mono", monospace;
  font-size: 24px;
  margin: 0;
  letter-spacing: 0.1em;
}

.calendar-nav {
  display: flex;
  gap: 12px;
}

.nav-btn {
  background: transparent;
  border: var(--frame) solid var(--ink);
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
}

.nav-btn:hover {
  background: var(--ink);
  color: white;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--ink);
  border: var(--frame) solid var(--ink);
  border-bottom: none;
}

.calendar-weekdays span {
  background: var(--paper);
  padding: 12px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--ink);
  border: var(--frame) solid var(--ink);
}

.calendar-day {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--paper);
  padding: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.calendar-day:hover {
  background: #e0e0de;
}

.calendar-day.empty {
  cursor: default;
  background: #ebebe9;
}

.calendar-day.empty:hover {
  background: #ebebe9;
}

.calendar-day .day-num {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  font-weight: 700;
}

.calendar-day.today {
  background: #D6E6F2;
  color: #0a0a0a;
}

.calendar-day.today.completed {
  background: var(--accent);
  /* blue still wins */
}

/* HEATMAP INTENSITY */

.calendar-day.completed {
  background: var(--accent);
  /* #0e1cff */
  color: white;
}

.calendar-day.completed.level-1 {
  background: #b0b6ff;
  color: var(--ink);
}

.calendar-day.completed.level-2 {
  background: #7a85ff;
  color: var(--ink);
}

.calendar-day.completed.level-3 {
  background: #4554ff;
  color: white;
}

.calendar-day.completed.level-4 {
  background: #0e1cff;
  color: white;
}

.calendar-day.completed.level-5 {
  background: #000bbd;
  color: white;
}

/* DETAIL PANEL */

.detail-panel {
  border: var(--frame) solid var(--ink);
  padding: 32px;
  background: white;
  position: sticky;
  top: 100px;
}

.detail-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--grid);
  padding-bottom: 16px;
}

.detail-header h3 {
  margin: 0 0 8px 0;
  font-family: "Space Mono", monospace;
  font-size: 18px;
}

.goal-label {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  font-weight: 700;
}

.goal-label.not-completed {
  opacity: 0.5;
  border-style: dashed;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-item .label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.2em;
  margin-bottom: 4px;
}

.detail-item strong {
  font-family: "Space Mono", monospace;
  font-size: 16px;
}

.detail-hint {
  margin-top: 32px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

/* MILESTONE BADGES */

.milestone-badge {
  position: absolute;
  bottom: 4px;
  right: 8px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
}

.stat-box {
  position: relative;
}

#streakBadge {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.1em;
  font-weight: 700;
}

/* RESPONSIVE */

@media (max-width: 1024px) {
  .calendar-section {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    margin-top: 32px;
  }
}

/* Fade transition for route changes */
#app-content {
  animation: fadeIn 0.3s ease-in-out;
  flex: 1;
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from {
    opacity: 0.8;
  }

  to {
    opacity: 1;
  }
}

/* Ensure modals remain on top */
.modal-overlay,
.auth-modal-overlay,
.profile-modal-overlay {
  z-index: 1000;
}


/* Ensure sidebar overlay stays below modals but above content */
.sidebar-overlay {
  z-index: 5;
}

/* Prevent horizontal scroll during route transitions */
body.loading {
  overflow-x: hidden;
}

/* Ensure top strip remains sticky across route changes */
.top-strip {
  z-index: 10;
}

/* Sidebar z-index hierarchy */
.sidebar {
  z-index: 15;
}

.sidebar.active {
  z-index: 20;
}

/* Prevent horizontal scroll during route transitions */
body.loading {
  overflow-x: hidden;
}

/* Ensure top strip remains sticky across route changes */
.top-strip {
  z-index: 10;
}

/* Sidebar z-index hierarchy */
.sidebar {
  z-index: 15;
}

.sidebar.active {
  z-index: 20;
}

/* ===============================
   ABOUT PAGE STYLES
================================ */

.about-hero {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 80px 72px !important;
}

.about-content {
  width: 100%;
  max-width: 800px;
}

.about-content h1 {
  font-family: "Space Mono", monospace;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 0.92;
  margin: 0 0 48px;
  font-weight: 1000;
  letter-spacing: -0.02em;
}

.about-section {
  margin-bottom: 48px;
}

.about-section h2 {
  font-family: "Space Mono", monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0 0 16px;
  text-transform: uppercase;
}

.about-section p {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.features-list li {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  padding: 0;
  margin: 0;
}

.features-list strong {
  font-weight: 700;
  color: var(--ink);
}

/* ===============================
   MOBILE RESPONSIVE DESIGN
   Breakpoint: ≤768px (phones & tablets)
   Optimized for 360px-414px widths
================================ */

/* ========================================
   MOBILE LAYOUT (max-width: 768px)
   
   Rules:
   - Structure stacking: Header > Hero > Timer > Buttons > Stats > Tasks
   - Use flexbox/grid cleanly
   - No horizontal scroll, no overlaps
   - Desktop CSS never modified
   
======================================== */

@media (max-width: 768px) {
  :root {
    --frame: 2px;
    --gap: 16px;
  }

  /* ---- ROOT / VIEWPORT ---- */
  html,
  body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  /* ---- FRAME (Main container) ---- */
  .frame {
    margin: 8px;
    width: calc(100% - 16px);
    overflow-x: hidden;
    box-sizing: border-box;
    flex-direction: column;
  }

  /* ---- MAIN CONTENT AREA ---- */
  #app-content {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    flex: 1;
  }

  /* ---- HEADER (TOP STRIP) ---- */
  .top-strip {
    display: flex;
    flex-wrap: nowrap;
    padding: 10px 12px;
    gap: 8px;
    align-items: center;
    border-bottom: var(--frame) solid var(--ink);
    min-height: 56px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overflow-y: hidden;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .brand-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .sidebar-trigger {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-trigger:active {
    background: rgba(0, 0, 0, 0.08);
  }

  .brand {
    font-size: 14px;
    letter-spacing: 0.08em;
    font-weight: 700;
    white-space: nowrap;
  }

  .top-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 9px;
    letter-spacing: 0.1em;
    flex-shrink: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overflow-y: hidden;
    user-select: none;
    -webkit-user-select: none;
    padding: 0;
    margin: 0;
  }

  .top-nav span {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 8px;
    flex-shrink: 0;
  }

  .v-tag {
    display: none !important;
  }

  .icon-trigger {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .icon-trigger:active {
    background: rgba(0, 0, 0, 0.08);
  }

  /* ---- SECTIONS (Base styling) ---- */
  .section {
    width: 100%;
    padding: 20px 16px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .section+.section {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

  /* ---- HERO SECTION ---- */
  .hero {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: auto;
    padding: 16px !important;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }

  .hero-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    width: 100%;
  }

  .hero-text h1 {
    font-size: clamp(32px, 10vw, 52px);
    line-height: 1;
    margin: 0;
    letter-spacing: -0.01em;
    font-weight: 1000;
    word-break: break-word;
  }

  .kicker {
    font-size: 9px;
    letter-spacing: 0.3em;
    margin: 0;
    text-transform: uppercase;
    color: var(--muted);
  }

  .subtitle {
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    color: var(--muted);
  }

  /* ---- TIMER SECTION ---- */
  .timer-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .timer-frame {
    width: 100%;
    height: auto;
    min-height: 160px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--ink);
    background: #ffffff;
    box-sizing: border-box;
  }

  .time {
    font-family: "Space Mono", monospace;
    font-size: clamp(36px, 12vw, 64px);
    line-height: 1;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.05em;
  }

  .status {
    font-size: 8px;
    letter-spacing: 0.25em;
    margin: 2px 0 0 0;
    text-transform: uppercase;
    color: var(--muted);
  }

  .current-task {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.04em;
    word-break: break-word;
  }

  /* ---- CONTROLS (Action buttons) ---- */
  .controls {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .controls.single {
    flex-direction: column;
  }

  .controls button {
    padding: 14px 16px;
    min-height: 48px;
    width: 100%;
    font-size: 14px;
    letter-spacing: 0.1em;
    font-weight: 600;
    border: 1px solid var(--ink);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
  }

  .controls button+button {
    margin-top: 8px;
  }

  .controls .primary {
    background: var(--ink);
    color: white;
  }

  .controls .secondary {
    background: transparent;
    color: var(--ink);
  }

  .controls button:active {
    opacity: 0.8;
  }

  .scroll-indicator {
    display: none !important;
  }

  /* ---- STATS SECTION ---- */
  .stats {
    background: #ffffff;
    padding: 16px !important;
  }

  .stats-ribbon {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
  }

  .stats-ribbon.insights-ribbon {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 72px;
    padding: 14px;
    border: 1px solid var(--ink);
    background: #ffffff;
    box-sizing: border-box;
  }

  .stat-box .label {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 600;
  }

  .stat-box strong {
    font-family: "Space Mono", monospace;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
  }

  .stat-box.btn {
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .stat-box.btn:active {
    background: var(--ink);
    color: white;
  }

  .goal-box {
    overflow: hidden;
    position: relative;
  }

  .goal-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: #beef00;
    z-index: 0;
    transition: width 0.3s linear;
  }

  .goal-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px;
  }

  .goal-input-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px;
  }

  #goalInput {
    width: 100%;
    border: none;
    background: transparent;
    font-family: "Space Mono", monospace;
    font-size: 12px;
    color: var(--ink);
    outline: none;
    padding: 0;
    margin: 0;
  }

  #goalInput::placeholder {
    color: var(--muted);
    font-size: 10px;
  }

  .goal-msg {
    font-size: 8px;
    color: #ff0028;
    margin-top: 2px;
    height: 12px;
    opacity: 0;
    transition: opacity 0.2s;
  }

  .goal-msg.visible {
    opacity: 1;
  }

  /* ---- TASKS SECTION ---- */
  .tasks {
    padding: 16px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .tasks-header {
    margin-bottom: 12px;
    border-bottom: none;
    padding-bottom: 0;
  }

  .tasks-header h2 {
    font-size: 24px;
    margin: 0 0 8px 0;
    line-height: 1;
    letter-spacing: -0.01em;
    font-weight: 700;
  }

  .tasks-subheader {
    display: none;
  }

  .task-helper {
    font-size: 11px;
    line-height: 1.4;
    margin: 0;
    color: var(--muted);
  }

  .task-helper-example {
    font-size: 10px;
    line-height: 1.3;
    margin: 4px 0 0 0;
    color: var(--muted);
    opacity: 0.6;
  }

  /* ---- TASK INPUT ---- */
  .task-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
  }

  .task-input input {
    width: 100%;
    padding: 14px;
    min-height: 48px;
    font-size: 15px;
    border: 1px solid var(--ink);
    background: #ffffff;
    box-sizing: border-box;
    font-family: "Space Mono", monospace;
    -webkit-appearance: none;
    appearance: none;
  }

  .task-input input:focus {
    outline: none;
    background: #ffffff;
  }

  .task-input input::placeholder {
    color: var(--muted);
  }

  #addTaskBtn {
    width: 100%;
    padding: 14px;
    min-height: 48px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    border: 1px solid var(--ink);
    background: transparent;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  #addTaskBtn:active {
    background: var(--ink);
    color: white;
  }

  /* ---- TASK LIST ---- */
  .task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .task-list li {
    padding: 14px 0;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
  }

  .task-list li.completed {
    opacity: 0.5;
  }

  .task-list li.completed .task-name {
    text-decoration: line-through;
  }

  .task-list li.active-task {
    color: var(--accent);
    font-weight: 700;
  }

  .task-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "Space Mono", monospace;
  }

  .task-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .task-time {
    font-size: 13px;
    min-width: 44px;
    text-align: right;
    font-family: "Space Mono", monospace;
  }

  .task-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 1px solid var(--ink);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    font-family: "Space Mono", monospace;
  }

  .task-btn:active {
    background: var(--ink);
    color: white;
  }

  .task-btn.remove-btn {
    border-color: #ff0028;
    color: #ff0028;
  }

  .task-btn.remove-btn:active {
    background: #ff0028;
    color: white;
  }

  /* ---- FOCUS SECTION ---- */
  .focus-hero {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: auto;
    padding: 16px !important;
  }

  .focus-hero-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    align-items: stretch;
  }

  .focus-hero-content.tasks-empty {
    justify-content: center;
    align-items: center;
  }

  .focus-hero-content.tasks-present {
    justify-content: flex-start;
  }

  .focus-tasks {
    width: 100%;
  }

  /* ---- INSIGHTS SECTION ---- */
  .insights-hero {
    padding: 16px !important;
    min-height: auto;
  }

  .insights-hero .hero-text {
    margin-bottom: 12px;
  }

  .insights-hero .hero-text h1 {
    font-size: clamp(28px, 9vw, 48px);
    margin: 0;
  }

  .insights-ribbon {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
  }

  /* ---- CALENDAR SECTION ---- */
  .calendar-section {
    padding: 16px !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }

  .calendar-container {
    width: 100%;
  }

  .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
  }

  .calendar-header h2 {
    font-size: 16px;
    margin: 0;
    letter-spacing: 0.1em;
    flex-shrink: 1;
    min-width: 0;
  }

  .calendar-nav {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
  }

  .nav-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--ink);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-btn:active {
    background: var(--ink);
    color: white;
  }

  .calendar-grid-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--ink);
    border: 1px solid var(--ink);
    width: 100%;
  }

  .calendar-weekdays span {
    background: var(--paper);
    padding: 10px 4px;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--muted);
    min-width: 36px;
    font-weight: 600;
  }

  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--ink);
    border: 1px solid var(--ink);
    width: 100%;
  }

  .calendar-day {
    aspect-ratio: 1 / 1;
    background: var(--paper);
    padding: 6px 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    min-width: 32px;
    min-height: 32px;
    border: none;
  }

  .calendar-day .day-num {
    font-size: 10px;
    font-weight: 700;
  }

  .detail-panel {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--ink);
    background: #ffffff;
    box-sizing: border-box;
  }

  .detail-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--grid);
  }

  .detail-header h3 {
    font-size: 14px;
    margin: 0 0 6px 0;
  }

  .goal-label {
    font-size: 8px;
    padding: 3px 6px;
  }

  .detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .detail-item .label {
    font-size: 11px;
    margin-bottom: 2px;
    text-transform: uppercase;
    font-weight: 600;
  }

  .detail-item strong {
    font-size: 14px;
    font-weight: 700;
  }

  .detail-hint {
    margin-top: 16px;
    font-size: 12px;
    color: var(--muted);
  }

  /* ---- ABOUT SECTION ---- */
  .about-hero {
    padding: 16px !important;
    min-height: auto;
  }

  .about-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .about-content h1 {
    font-size: clamp(24px, 8vw, 44px);
    margin: 0 0 8px 0;
    line-height: 1;
    letter-spacing: -0.01em;
  }

  .about-section {
    margin-bottom: 8px;
  }

  .about-section h2 {
    font-size: 14px;
    margin: 0 0 6px 0;
    letter-spacing: 0.05em;
    font-weight: 700;
  }

  .about-section p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
  }

  .features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .features-list li {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
  }

  /* ---- FOOTER ---- */
  .bottom-credit {
    padding: 16px 16px;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    color: var(--muted);
  }

  /* ---- MODALS ---- */
  .modal-overlay {
    z-index: 1000;
  }

  .modal-content {
    width: 85vw;
    max-width: 85vw;
    min-width: 85vw;
    max-height: 85vh;
    padding: 20px 16px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-header {
    margin-bottom: 16px;
  }

  .modal-header h3 {
    font-size: 20px;
    line-height: 1;
    margin: 0;
  }

  .close-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .settings-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .setting-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .setting-row label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
  }

  .stepper {
    display: flex;
    width: 100%;
    align-items: stretch;
    gap: 0;
  }

  .step-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 1px solid var(--ink);
    background: transparent;
    cursor: pointer;
  }

  .stepper input {
    flex: 1;
    padding: 8px;
    min-height: 40px;
    font-size: 12px;
    border: 1px solid var(--ink);
    border-left: none;
    border-right: none;
    box-sizing: border-box;
    text-align: center;
  }

  .settings-hint {
    margin-top: 16px;
    font-size: 12px;
    color: var(--muted);
  }

  /* ---- AUTH/PROFILE MODALS ---- */
  .modal-panel {
    width: 85vw;
    max-width: 85vw;
    min-width: 85vw;
    max-height: 85vh;
    padding: 20px 16px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-modal-overlay,
  .profile-modal-overlay {
    z-index: 1000;
  }

  .auth-modal-content {
    width: 85vw;
    max-width: 85vw;
    min-width: 85vw;
    max-height: 85vh;
    padding: 20px 16px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-modal-header {
    margin-bottom: 16px;
  }

  .auth-modal-title {
    font-size: 20px;
    line-height: 1;
    margin: 0;
  }

  .auth-close-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .auth-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
  }

  .auth-input {
    padding: 14px;
    min-height: 48px;
    font-size: 15px;
    border: 1px solid var(--ink);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
  }

  .auth-primary-btn {
    padding: 14px;
    min-height: 48px;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  .auth-provider-btn {
    min-height: 48px;
    font-size: 12px;
    padding: 12px 14px;
    -webkit-tap-highlight-color: transparent;
  }

  .profile-modal-content {
    width: 85vw;
    max-width: 85vw;
    min-width: 85vw;
    max-height: 85vh;
    padding: 20px 16px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .profile-modal-header {
    margin-bottom: 16px;
  }

  .profile-modal-title {
    font-size: 20px;
    line-height: 1;
    margin: 0;
  }

  .profile-close-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .profile-avatar-section {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
  }

  .avatar-container {
    width: 64px;
    height: 64px;
    position: relative;
  }

  .profile-action-btn {
    width: 100%;
    min-height: 44px;
    font-size: 10px;
    padding: 10px 12px;
  }

  /* ---- AVATAR SETTINGS MODAL ---- */
  .avatar-settings-content {
    width: 85vw;
    max-width: 85vw;
    min-width: 85vw;
    padding: 20px 16px;
    box-sizing: border-box;
  }

  .avatar-color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .color-swatch {
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  /* ---- DONATE MODAL (Mobile) ---- */
  .donate-modal-panel {
    width: 90vw;
    max-width: 90vw;
    min-width: 90vw;
    padding: 20px 16px;
    box-sizing: border-box;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .donate-modal-header {
    margin-bottom: 16px;
  }

  .donate-modal-header h3 {
    font-size: 18px;
  }

  .donate-modal-content {
    gap: 14px;
  }

  .qr-container {
    padding: 14px;
  }

  #upiQrCode {
    width: 100%;
    max-width: 260px;
  }

  .qr-instruction {
    font-size: 13px;
  }

  #upiIdText {
    font-size: 12px;
  }

  .copy-btn {
    width: 40px;
    height: 40px;
  }

  .copy-feedback {
    font-size: 10px;
  }

  .qr-note {
    font-size: 11px;
  }

  /* ---- FOOTER ---- */
  .bottom-credit {
    padding: 12px 16px;
    font-size: 10px;
    line-height: 1.4;
    text-align: center;
    color: var(--muted);
  }

  /* ---- SIDEBAR (Mobile First) ---- */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 75vw;
    max-width: 280px;
    height: 100vh;
    background: #f4f4f2;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-left-strip {
    display: none;
  }

  .sidebar-main {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .sidebar-header-blue {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .sidebar-item {
    padding: 10px 16px;
    height: 40px;
    display: flex;
    align-items: center;
    font-size: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-item:active {
    background: rgba(0, 0, 0, 0.08);
  }

  .sidebar-donate {
    padding: 16px;
    border-top: 1px solid var(--ink);
  }

  .donate-title {
    font-size: 9px;
    margin-bottom: 8px;
  }

  .donate-links {
    gap: 6px;
  }

  .donate-link {
    padding: 10px 12px;
    font-size: 12px;
  }

  .donate-icon {
    font-size: 14px;
  }

  .sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--ink);
    margin-top: auto;
  }

  .social-icons {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
  }

  .social-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .social-icon:active {
    background: var(--ink);
    color: white;
  }

  .copyright {
    font-size: 9px;
    line-height: 1.3;
    color: var(--muted);
  }

  /* ---- SIDEBAR OVERLAY ---- */
  .sidebar-overlay {
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1500;
  }

  /* ---- Safe area support (notch handling) ---- */
  @supports (padding: max(0px)) {
    .frame {
      margin-left: max(8px, env(safe-area-inset-left));
      margin-right: max(8px, env(safe-area-inset-right));
      margin-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .section {
      padding-left: max(16px, env(safe-area-inset-left));
      padding-right: max(16px, env(safe-area-inset-right));
    }
  }
}

/* ===============================
   EXTREME SMALL SCREENS (360px-390px)
   Breakpoint: ≤480px
================================ */

@media (max-width: 480px) {
  :root {
    --frame: 1px;
    --gap: 12px;
  }

  /* Safe area support for notches */
  @supports (padding: max(0px)) {
    .frame {
      margin: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom));
    }

    .section {
      padding: 18px max(12px, env(safe-area-inset-left)) 18px max(12px, env(safe-area-inset-right));
    }
  }

  /* Extreme small screen optimizations */
  .section {
    padding: 18px 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }

  .section:first-of-type {
    border-top: none;
  }

  .top-strip {
    padding: 8px 10px;
    gap: 6px;
    min-height: 50px;
  }

  .brand {
    font-size: 12px;
    letter-spacing: 0.06em;
  }

  .sidebar-trigger,
  .icon-trigger {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .icon-trigger svg {
    width: 18px;
    height: 18px;
  }

  .meta {
    font-size: 7px;
    gap: 4px;
  }

  /* ---- HERO ---- */
  .hero {
    padding: 16px 12px !important;
    gap: 16px;
  }

  .hero-text h1 {
    font-size: clamp(28px, 9vw, 44px);
    margin-bottom: 0;
  }

  .subtitle {
    font-size: 12px;
    line-height: 1.4;
  }

  .kicker {
    font-size: 8px;
    letter-spacing: 0.3em;
  }

  .timer-block {
    gap: 10px;
  }

  .timer-frame {
    min-height: 160px;
    padding: 16px 12px;
    gap: 4px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .time {
    font-size: clamp(36px, 12vw, 56px);
  }

  .status {
    font-size: 7px;
    letter-spacing: 0.2em;
    margin-top: 2px;
  }

  .current-task {
    font-size: 10px;
    margin-top: 4px;
  }

  .controls button {
    font-size: 10px;
    min-height: 40px;
    padding: 11px 14px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .controls button+button {
    margin-top: 6px;
  }

  .scroll-indicator {
    display: none !important;
  }

  /* ---- STATS ---- */
  .stats {
    padding: 16px 12px !important;
  }

  .stats-ribbon {
    gap: 4px;
  }

  .stat-box {
    min-height: 52px;
    padding: 10px 10px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .stat-box .label {
    font-size: 8px;
    margin-bottom: 3px;
    letter-spacing: 0.1em;
  }

  .stat-box strong {
    font-size: 14px;
  }

  /* ---- TASKS ---- */
  .tasks-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .task-helper {
    font-size: 10px;
  }

  .task-helper-example {
    font-size: 9px;
  }

  .task-input {
    gap: 4px;
    margin-bottom: 12px;
  }

  .task-input input {
    font-size: 12px;
    min-height: 40px;
    padding: 10px 10px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  #addTaskBtn {
    min-height: 40px;
    font-size: 10px;
    padding: 10px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .task-list li {
    padding: 8px 0;
    font-size: 11px;
    gap: 6px;
  }

  .task-btn {
    min-height: 36px;
    min-width: 36px;
    font-size: 8px;
    width: 36px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .task-time {
    font-size: 10px;
    min-width: 36px;
  }

  /* ---- FOCUS ---- */
  .focus-hero {
    padding: 16px 12px !important;
  }

  /* ---- INSIGHTS ---- */
  .insights-hero {
    padding: 16px 12px !important;
  }

  .insights-hero .hero-text h1 {
    font-size: clamp(24px, 8vw, 36px);
    margin-bottom: 0;
  }

  .insights-ribbon {
    gap: 4px;
  }

  .calendar-section {
    padding: 16px 12px !important;
    gap: 12px;
  }

  .calendar-header {
    gap: 6px;
    margin-bottom: 8px;
  }

  .calendar-header h2 {
    font-size: 14px;
    letter-spacing: 0.08em;
  }

  .calendar-nav {
    gap: 2px;
  }

  .nav-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 10px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .calendar-weekdays span {
    font-size: 7px;
    padding: 6px 2px;
    min-width: 28px;
    letter-spacing: 0.05em;
  }

  .calendar-day {
    min-width: 28px;
    min-height: 28px;
    padding: 2px;
  }

  .calendar-day .day-num {
    font-size: 8px;
  }

  .detail-panel {
    padding: 12px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .detail-header h3 {
    font-size: 12px;
  }

  .detail-item {
    padding: 6px;
    gap: 2px;
  }

  .detail-item .label {
    font-size: 7px;
  }

  .detail-item strong {
    font-size: 11px;
  }

  .detail-hint {
    font-size: 9px;
    margin-top: 8px;
  }

  /* ---- ABOUT ---- */
  .about-hero {
    padding: 16px 12px !important;
  }

  .about-content h1 {
    font-size: clamp(24px, 7vw, 36px);
    margin-bottom: 12px;
  }

  .about-section {
    margin-bottom: 12px;
  }

  .about-section h2 {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .about-section p {
    font-size: 12px;
    line-height: 1.4;
  }

  .features-list li {
    font-size: 11px;
    line-height: 1.3;
  }

  /* ---- MODALS ---- */
  .modal-content {
    min-width: 90vw;
    max-width: 90vw;
    padding: 20px 14px 14px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .modal-header h3 {
    font-size: 20px;
  }

  .close-btn {
    width: 36px;
    height: 36px;
  }

  .settings-body {
    gap: 10px;
  }

  .setting-row {
    gap: 6px;
  }

  .setting-row label {
    font-size: 9px;
  }

  .step-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .stepper input {
    min-height: 36px;
    font-size: 12px;
  }

  .settings-hint {
    font-size: 7px;
    margin-top: 12px;
  }

  /* ---- AUTH/PROFILE MODALS ---- */
  .modal-panel,
  .auth-modal-content,
  .profile-modal-content {
    max-width: 90vw;
    min-width: 90vw;
    padding: 20px 14px 14px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .auth-modal-title,
  .profile-modal-title {
    font-size: 20px;
  }

  .auth-close-btn,
  .profile-close-btn {
    width: 36px;
    height: 36px;
  }

  .auth-input {
    font-size: 13px;
    min-height: 40px;
    padding: 10px 10px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .auth-primary-btn,
  .auth-provider-btn {
    min-height: 40px;
    font-size: 11px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .auth-form {
    gap: 10px;
  }

  .profile-avatar-section .avatar-container {
    width: 56px;
    height: 56px;
  }

  .profile-action-btn {
    min-height: 40px;
    font-size: 9px;
    padding: 8px 10px;
  }

  .avatar-settings-content {
    max-width: 90vw;
    min-width: 90vw;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .avatar-color-grid {
    gap: 10px;
    padding: 12px;
    grid-template-columns: repeat(5, 20px);
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .color-swatch {
    width: 18px;
    height: 18px;
  }

  /* ---- DONATE MODAL (Extra Small) ---- */
  .donate-modal-panel {
    max-width: 90vw;
    min-width: 90vw;
    padding: 16px 12px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .donate-modal-header h3 {
    font-size: 16px;
  }

  .donate-close-btn {
    width: 28px;
    height: 28px;
    font-size: 20px;
  }

  .qr-container {
    padding: 10px;
  }

  #upiQrCode {
    max-width: 200px;
  }

  .qr-instruction {
    font-size: 12px;
  }

  #upiIdText {
    font-size: 11px;
  }

  .copy-btn {
    width: 24px;
    height: 24px;
  }

  .copy-feedback {
    font-size: 9px;
  }

  .qr-note {
    font-size: 10px;
  }

  /* ---- FOOTER ---- */
  .bottom-credit {
    padding: 12px;
    font-size: 9px;
    line-height: 1.3;
  }

  /* ---- SIDEBAR ---- */
  .sidebar {
    max-width: 280px;
  }

  .sidebar-item {
    font-size: 11px;
    padding: 8px 12px;
    height: 36px;
    border-radius: 2px;
  }

  .sidebar-donate,
  .sidebar-footer {
    padding: 12px;
  }

  .donate-title {
    font-size: 8px;
    margin-bottom: 6px;
  }

  .donate-link {
    font-size: 11px;
    padding: 8px 10px;
  }

  .donate-icon {
    font-size: 12px;
  }

  .social-icons {
    gap: 6px;
    margin-bottom: 8px;
  }

  .social-icon {
    width: 32px;
    height: 32px;
    border-radius: 2px;
    border: 1px solid var(--ink);
  }

  .social-icon svg {
    width: 13px;
    height: 13px;
  }

  .copyright {
    font-size: 8px;
  }
}

/* ===============================
   TOUCH-FRIENDLY INTERACTIONS
================================ */

/* Ensure all interactive elements meet 44px touch target */
@media (hover: none) and (pointer: coarse) {

  button,
  a,
  input[type="button"],
  input[type="submit"],
  input[type="checkbox"],
  input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
    padding: 12px;
  }

  .icon-trigger,
  .close-btn,
  .profile-close-btn,
  .auth-close-btn {
    min-height: 44px;
    min-width: 44px;
  }

  .stat-box.btn {
    min-height: 44px;
  }

  .task-btn {
    min-height: 44px;
  }

  /* Remove hover effects on touch devices */
  button:hover {
    opacity: inherit;
  }

  .icon-trigger:hover {
    opacity: inherit;
  }

  .sidebar-item:hover {
    background: transparent;
  }

  .social-icon:hover {
    background: transparent;
  }

  /* Add focus/active states for touch */
  button:active,
  a:active {
    opacity: 0.7;
  }

  .task-btn:active {
    background: var(--ink);
    color: white;
  }
}

/* ===============================
   LANDSCAPE MODE OPTIMIZATION
================================ */

@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
  }

  .hero-grid {
    gap: 16px;
  }

  .timer-frame {
    padding: 20px 24px;
    height: auto;
  }

  .time {
    font-size: clamp(36px, 8vw, 60px);
  }

  .scroll-indicator {
    display: none;
  }

  .section {
    padding: 24px 16px;
  }
}

/* ===============================
   REDUCED MOTION FOR ACCESSIBILITY
================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===============================
   UTILITY CLASSES FOR RESPONSIVE
================================ */

.responsive-hide-mobile {
  display: none !important;
}

@media (min-width: 769px) {
  .responsive-hide-desktop {
    display: none !important;
  }

  .responsive-hide-mobile {
    display: inherit !important;
  }
}

/* Touch-friendly padding helpers */
.touch-target {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* ===============================
   MOBILE CONSTRUCTION OVERLAY
================================ */

#mobileConstructionOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #0d0d0d;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  color: #f4f4f2;
  padding: 24px;
  box-sizing: border-box;
}

.construction-content h2 {
  font-family: "Space Mono", monospace;
  font-size: 24px;
  margin: 0 0 16px 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.construction-content p {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  opacity: 0.7;
  margin: 0;
  line-height: 1.5;
}

@media screen and (max-width: 767px) {
  #mobileConstructionOverlay {
    display: flex;
  }
  
  body {
    overflow: hidden;
  }
}
