:root {
  /* Цвета фона */
  --bg-0: #D4CDB8;
  --bg-1: #E5DFD0;
  --card: #F2EFE7;
  --card-inner: #FDFCFA;
  
  /* Текст */
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --text-light: #8E8E8E;
  
  /* Линии и границы */
  --line: rgba(0, 0, 0, 0.08);
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-card: rgba(0, 0, 0, 0.12);
  
  /* Акценты */
  --accent-blue: #4A90E2;
  --accent-green: #5B8C7D;
  --accent-red: #D97056;
  --accent-cyan: #4FA5B8;
  --accent-violet: #8B8FD8;
  --accent-brown: #A0826D;
  --accent-teal: #4D8B8B;
  
  /* UI элементы */
  --white: #FFFFFF;
  --checkbox-checked: #4A90E2;
  --fab-bg: #1A1A1A;
  
  /* Шрифты */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, var(--bg-0) 0%, var(--bg-1) 100%);
  min-height: 100vh;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 20px;
}

.app {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

.screen {
  width: 100%;
  max-width: 820px;
  background: var(--card);
  border-radius: 40px;
  padding: 32px;
  box-shadow: 0 8px 32px var(--shadow-card);
  position: relative;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
}

.menu-btn {
  width: 48px;
  height: 48px;
  background: var(--white);
  border: none;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.menu-btn:hover {
  background: #f8f8f8;
  transform: translateY(-1px);
}

.menu-btn span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.search {
  flex: 1;
}

.search input {
  width: 100%;
  padding: 14px 24px;
  background: var(--white);
  border: none;
  border-radius: 24px;
  font-size: 16px;
  color: var(--text);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.search input::placeholder {
  color: var(--text-light);
}

.search input:focus {
  outline: none;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.tab {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 12px 4px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: var(--text);
  font-weight: 600;
}

.tab.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
  border-radius: 2px 2px 0 0;
}

/* Section Head */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.section-head__left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.section-subtitle {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.btn-new-list {
  padding: 10px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-new-list:hover {
  background: #f8f8f8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Filters */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: #f8f8f8;
  transform: translateY(-1px);
}

.filter-btn.is-active {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}

.filter-label {
  font-size: 15px;
  font-weight: 500;
  color: inherit;
}

.filter-btn.is-active .filter-label {
  color: var(--white);
}

.filter-count {
  font-size: 14px;
  font-weight: 600;
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 0 8px;
}

.filter-btn.is-active .filter-count {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

/* Lists Container */
#lists-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* List Card */
.list-card {
  background: var(--card-inner);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.list-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.list-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.list-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.toggle-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.list-card.is-expanded .toggle-btn {
  transform: rotate(180deg);
}

/* Tasks */
.tasks {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task {
  display: flex;
  gap: 16px;
  padding: 16px 0;
}

.task__left {
  flex-shrink: 0;
  padding-top: 4px;
}

.checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  transition: all 0.2s ease;
  position: relative;
}

.checkbox:hover {
  border-color: var(--accent-blue);
}

.checkbox:checked {
  background: var(--checkbox-checked);
  border-color: var(--checkbox-checked);
}

.checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.task__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-menu {
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: auto;
}

.task-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  line-height: 1.4;
}

.task.is-completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-link-ref {
  font-size: 16px;
  color: var(--accent-blue);
  text-decoration: underline;
  cursor: pointer;
}

.task-link-ref:hover {
  color: #3a7bc8;
}

.description-toggle {
  background: none;
  border: none;
  font-size: 15px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
}

.description-toggle:hover {
  color: var(--text);
}

/* Pills (Tags) */
.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.pill--blue { background: var(--accent-blue); }
.pill--green { background: var(--accent-green); }
.pill--red { background: var(--accent-red); }
.pill--cyan { background: var(--accent-cyan); }
.pill--violet { background: var(--accent-violet); }
.pill--brown { background: var(--accent-brown); }
.pill--teal { background: var(--accent-teal); }

.task-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* FAB */
.fab {
  position: fixed;
  bottom: 32px;
  left: 32px;
  width: 80px;
  height: 80px;
  background: var(--fab-bg);
  border: none;
  border-radius: 50%;
  font-size: 40px;
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.fab:active {
  transform: scale(1.05) rotate(90deg);
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 12px;
  }
  
  .screen {
    border-radius: 32px;
    padding: 24px;
  }
  
  .tabs {
    gap: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .tab {
    font-size: 16px;
    white-space: nowrap;
  }
  
  .section-subtitle {
    font-size: 24px;
  }
  
  .filters {
    gap: 8px;
  }
  
  .fab {
    width: 64px;
    height: 64px;
    bottom: 24px;
    left: 24px;
    font-size: 32px;
  }
}
