:root {
  color-scheme: dark;
}

html, body {
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(165, 243, 94, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.05), transparent 22%),
    linear-gradient(180deg, #13141b 0%, #101116 100%);
}

.page-shell {
  position: relative;
  overflow: hidden;
}

.page-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 78%);
}

.filter-btn,
.mode-btn,
.modal-close {
  transition: all 160ms ease;
}

.filter-btn {
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #f8f9fa;
}

.category-filter-btn {
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.45rem 0.8rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f8f9fa;
  text-transform: uppercase;
}

.filter-btn:hover,
.mode-btn:hover,
.modal-close:hover {
  transform: translateY(-1px);
}

.dashboard-action-btn {
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 800;
  text-align: center;
  transition: all 160ms ease;
}

.dashboard-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8f9fa;
  transition: all 160ms ease;
}

.dashboard-icon-btn span {
  display: inline-flex;
  align-items: center;
}

.dashboard-icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(165, 243, 94, 0.3);
  background: rgba(165, 243, 94, 0.12);
  color: #a5f35e;
}

.app-update-banner {
  display: flex;
}

#iosInstallHint {
  line-height: 1.35;
}

.active-filter,
.active-category-filter,
.mode-btn-active {
  border-color: rgba(165, 243, 94, 0.72);
  background: #a5f35e;
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(165, 243, 94, 0.18);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.72);
  backdrop-filter: blur(12px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 34rem);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  background: rgba(19, 20, 27, 0.96);
  padding: 1.25rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.modal-panel-task {
  width: min(100%, 31rem);
}

.modal-panel-wide {
  width: min(100%, 52rem);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-close {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #f8f9fa;
  font-size: 1.2rem;
  line-height: 1;
}

.mode-btn {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.9rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #f8f9fa;
}

.mode-btn:not(.mode-btn-active) {
  opacity: 0.82;
}

.field {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.field span {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e5e7eb;
}

.required-mark {
  color: #a5f35e;
}

.task-form-feedback {
  border-radius: 1rem;
  border: 1px solid rgba(248, 113, 113, 0.22);
  background: rgba(127, 29, 29, 0.2);
  padding: 0.8rem 0.95rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #fecaca;
}

.field input,
.task-select,
.field textarea {
  min-width: 0;
  width: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.95rem 1rem;
  color: #f8f9fa;
  font: inherit;
  line-height: 1.4;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
}

.task-duration-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-duration-grid input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.task-date-input {
  display: block;
  max-width: 100%;
  min-height: 3.35rem;
  padding-right: 2.75rem;
  appearance: none;
  -webkit-appearance: none;
}

.task-date-input::-webkit-date-and-time-value {
  min-height: 1.35em;
  text-align: left;
}

.task-date-input::-webkit-calendar-picker-indicator {
  opacity: 0.92;
  cursor: pointer;
}

.task-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: rgba(255, 255, 255, 0.04);
  color: #f8f9fa;
}

.task-select option {
  background: #13141b;
  color: #f8f9fa;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(165, 243, 94, 0.45);
  box-shadow: 0 0 0 3px rgba(165, 243, 94, 0.12);
}

.task-card {
  width: 100%;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1f2937;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}

.task-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 24%);
  pointer-events: none;
}

.task-title-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.9rem;
  padding: 0.1rem 0.2rem;
  text-align: left;
  transition: color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.task-title-button:hover {
  color: #a5f35e;
  transform: translateY(-1px);
}

.play-btn-locked {
  opacity: 0.68;
  filter: blur(0.6px) saturate(0.82);
}

.play-btn-locked:hover {
  transform: none;
}

.task-category-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.3rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f8f9fa;
}

.detail-stat {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.035);
  padding: 0.95rem 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.detail-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9ca3af;
}

.detail-stat-value {
  margin-top: 0.45rem;
  font-size: 1rem;
  font-weight: 800;
  color: #f8f9fa;
}

.detail-stat-wide {
  grid-column: 1 / -1;
}

.task-details-section {
  border-radius: 1.35rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.task-history-summary-card {
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.9rem 1rem;
}

.task-log-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.8rem 0.95rem;
}

.task-log-content {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.task-log-hours {
  font-size: 0.95rem;
  font-weight: 800;
  color: #a5f35e;
}

.task-log-date {
  font-size: 0.8rem;
  color: #9ca3af;
}

.task-log-actions {
  flex: 0 0 auto;
}

.task-log-delete-btn {
  min-height: 2rem;
  line-height: 1;
}

@media (max-width: 640px) {
  .page-shell::before {
    background-size: 32px 32px;
  }

  .modal {
    padding: 0.75rem;
  }

  .modal-panel {
    width: min(100%, 30rem);
    max-height: calc(100vh - 1rem);
    padding: 0.95rem;
    border-radius: 1.25rem;
  }

  .modal-panel-wide {
    width: 100%;
  }

  .modal-panel-task {
    width: min(100%, 28.5rem);
  }

  .modal-header {
    flex-direction: column;
  }

  .modal-close {
    align-self: flex-end;
  }

  .field input {
    padding: 0.85rem 0.95rem;
  }

  .task-date-input {
    padding-right: 2.35rem;
  }

  .task-select,
  .field textarea {
    padding: 0.85rem 0.95rem;
  }

  .task-duration-grid {
    gap: 0.65rem;
  }

  .task-form-feedback {
    padding: 0.72rem 0.85rem;
    font-size: 0.82rem;
  }

  .task-log-item {
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
  }

  .task-log-delete-btn {
    padding: 0.55rem 0.85rem;
  }
}

.progress-track {
  height: 0.45rem;
  overflow: hidden;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: #a5f35e;
}
