:root {
  --bg: #0b1117;
  --panel: #111922;
  --muted: #1b2530;
  --text: #e6edf3;
  --subtext: #9fb0c0;
  --accent: #10b981;
  --accent2: #059669;
  --btn-accent-text: #ffffff;
  --danger: #ff6b6b;
  --danger2: #e24a4a;
  --btn-danger-text: #ffffff;
  --warn: #ffd166;
  --ok: #8ecae6;
  --card: #0f141a;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.theme-light:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --muted: #e9eef3;
  --text: #0c1116;
  --subtext: #4a5a6a;
  --danger: #d83a3a;
  --danger2: #b92424;
  --btn-danger-text: #ffffff;
  --ok: #0ea5e9;
  --card: #ffffff;
  --shadow: 0 10px 24px rgba(7, 14, 22, 0.08);
}

.color-emerald:root {
  --accent: #10b981;
  --accent2: #059669;
}

.color-sky:root {
  --accent: #0ea5e9;
  --accent2: #0284c7;
}

.color-rose:root {
  --accent: #f472b6;
  --accent2: #ec4899;
}

.color-amber:root {
  --accent: #f59e0b;
  --accent2: #d97706;
}

.color-violet:root {
  --accent: #a78bfa;
  --accent2: #7c3aed;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    'Apple Color Emoji',
    'Segoe UI Emoji';
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
header {
  position: sticky;
  top: 0;
  z-index: 3;
  backdrop-filter: saturate(180%) blur(10px);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0)), var(--bg);
  padding: 14px clamp(12px, 2vw, 24px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}
.title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.title h1 {
  margin: 0;
  font-size: clamp(18px, 3.5vw, 24px);
  letter-spacing: 0.2px;
}

/* Placeholder and focus style for editable page title */
.title h1[contenteditable='true']:empty::before {
  content: 'Įveskite pavadinimą';
  color: var(--subtext);
}

.title h1[contenteditable='true']:focus {
  outline: 1px dashed var(--muted);
  padding: 2px 4px;
}
.page-icon {
  width: 28px;
  height: 28px;
  font-size: 28px;
  line-height: 1;
}
.title .badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--subtext);
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#addMenu {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#addMenu .menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 13, 18, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 4;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 8px;
  gap: 4px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
  opacity: 0;
  transform: scale(0.95);
  transform-origin: top left;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 140ms ease,
    transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 5;
}

#addMenu[data-open='1'] .menu-backdrop {
  opacity: 1;
  pointer-events: auto;
  animation: menu-fade 160ms ease;
}

#addMenu[data-open='1'] .menu-panel {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  visibility: visible;
  animation: menu-pop 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-panel button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  transition: background 140ms ease, color 140ms ease;
}

.menu-panel button:hover,
.menu-panel button:focus-visible {
  background: var(--muted);
  color: var(--text);
}

.menu-panel button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button,
.btn {
  border: 1px solid transparent;
  background: var(--panel);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-weight: 600;
  letter-spacing: 0.2px;
  transition:
    0.2s ease background,
    0.2s ease transform;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
button:hover,
.btn:hover {
  transform: translateY(-1px);
  background: var(--muted);
}
.btn-accent {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  color: var(--btn-accent-text);
}
.btn-danger {
  background: linear-gradient(180deg, var(--danger), var(--danger2));
  color: var(--btn-danger-text);
}
.btn-outline {
  background: transparent;
  border-color: var(--muted);
}
.icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn .icon {
  margin-right: 4px;
}

.btn .icon:last-child {
  margin-right: 0;
}
.search {
  position: relative;
}
.search input {
  border-radius: 12px;
  min-width: 240px;
  box-shadow: var(--shadow);
}
.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
  pointer-events: none;
}
/* Expand layout to use full screen width */
main {
  padding: 20px clamp(10px, 2.2vw, 24px);
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-content: flex-start;
}
.group {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: max-content;
  overflow: visible;
  resize: both;
  transition:
    0.2s ease background,
    0.2s ease transform;
}

.group.selected {
  outline: 2px solid var(--accent);
}
.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
}
.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.group-header h2 {
  margin: 0;
  font-size: 16px;
}
.group-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.group-actions button {
  padding: 4px;
}

.group-header .toggle {
  padding: 4px;
}

.group.collapsed .items,
.group.collapsed .embed {
  display: none;
}
.items {
  overflow: visible;
}
.items-scroll {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 8px;
  overflow: visible;
}
.note-card .items {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.note-card .items-scroll {
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
}
.note-card .items-scroll p {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.reminder-highlight {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  transition: outline-color 0.3s ease;
}
.item {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  box-shadow: var(--shadow);
  transition:
    0.2s ease background,
    0.2s ease transform;
}
a.item {
  display: flex;
  gap: 8px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.item.dragging {
  opacity: 0.45;
}
.group:hover,
.item:hover {
  background: var(--muted);
  transform: translateY(-2px);
}
.item .meta {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  display: block;
}
.item .title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.item .meta .title {
  font-weight: 700;
  font-size: 1rem; /* keep size consistent after leaving edit mode */
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.item .meta .sub {
  font-size: 0.875rem; /* match default input size */
  color: var(--subtext);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reminder-flag {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  line-height: 1;
  color: var(--warn);
}

  .reminders-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    flex: 1;
  }

@keyframes menu-pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes menu-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #addMenu .menu-backdrop,
  .menu-panel {
    transition: none !important;
    animation: none !important;
  }
}

  .reminder-controls {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: stretch;
  }

  @media (min-width: 768px) {
    .reminder-controls {
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
  }

  .reminder-quick-start,
  .reminder-form,
  .reminder-list-section {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow);
  }

  .reminder-quick-start {
    padding: 0;
  }

  .reminder-quick-details {
    display: grid;
    gap: 6px;
    padding: 8px;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .reminder-quick-summary {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    list-style: none;
    padding: 4px 0;
  }

  .reminder-quick-summary::-webkit-details-marker,
  .reminder-quick-summary::marker {
    display: none;
  }

  .reminder-quick-summary::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }

  .reminder-quick-details[open] .reminder-quick-summary::after {
    transform: rotate(225deg);
  }

  .reminder-quick-summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 8px;
  }

  .reminder-quick-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    grid-column: 1;
  }

@media (min-width: 768px) {
  .reminder-quick-text {
    max-width: 260px;
  }
}

  .reminder-quick-text h3 {
    margin: 0;
    font-size: 0.875rem;
  }

  .reminder-quick-text p {
    margin: 0;
    color: var(--subtext);
    font-size: 0.75rem;
  }

  .reminder-quick-buttons,
  .reminder-quick-fill {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
  }

  .reminder-quick-fill {
    justify-content: flex-start;
  }

  .reminder-quick-buttons button,
  .reminder-quick-fill button {
    padding: 4px 6px;
    border-radius: 8px;
    background: var(--muted);
    border: 1px solid transparent;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 3px;
  }

  .reminder-quick-buttons button svg {
    width: 16px;
    height: 16px;
  }

  .reminder-quick-fill button {
    font-size: 0.7rem;
  }

  .reminder-quick-buttons button:hover,
  .reminder-quick-fill button:hover {
    background: var(--accent);
    color: var(--btn-accent-text);
  }

  .reminder-quick-buttons {
    justify-content: flex-start;
    min-width: 0;
    grid-column: 1;
  }

  @media (min-width: 640px) {
    .reminder-quick-details[open] {
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
    }

    .reminder-quick-details[open] .reminder-quick-buttons {
      grid-column: 2;
    }

    .reminder-quick-buttons {
      justify-content: flex-end;
    }
  }

  .reminder-form {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
  }

  .reminder-form label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.8125rem;
    min-width: 0;
  }

  .reminder-form input,
  .reminder-form select {
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--panel);
    color: var(--text);
    font-size: 0.8125rem;
  }

.theme-light .reminder-form input,
.theme-light .reminder-form select {
  border-color: rgba(0, 0, 0, 0.08);
}

  .reminder-form-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .reminder-form-actions {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    grid-column: 1 / -1;
  }

  .reminder-form-actions > button {
    padding: 6px 10px;
    font-size: 0.75rem;
    line-height: 1.1;
    white-space: nowrap;
  }

  .reminder-form-actions > button .icon {
    width: 14px;
    height: 14px;
  }

  .reminder-form .error {
    margin: 0;
    min-height: 1em;
    font-size: 0.75rem;
    color: var(--danger);
    grid-column: 1 / -1;
  }

.reminder-form.is-editing {
  border: 1px solid var(--accent);
}

  .reminder-list-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .reminder-list-section h3 {
    margin: 0;
    font-size: 0.95rem;
  }

  .reminder-empty {
    font-size: 0.8125rem;
    color: var(--subtext);
  }

  .reminder-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
    max-height: none;
    overflow: visible;
  }

  .reminder-items li {
    display: flex;
    gap: 6px;
    align-items: center;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 6px 8px;
    box-shadow: var(--shadow);
  }

.theme-light .reminder-items li {
  border-color: rgba(0, 0, 0, 0.06);
}

.reminder-items li.overdue {
  border-color: var(--danger);
}

  .reminder-progress {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background:
      conic-gradient(
        var(--accent) calc(var(--ratio, 0) * 360deg),
        rgba(255, 255, 255, 0.08) 0
      );
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6875rem;
    color: var(--text);
    flex-shrink: 0;
  }

.reminder-items li.overdue .reminder-progress {
  background:
    conic-gradient(
      var(--danger) calc(var(--ratio, 0) * 360deg),
      rgba(255, 255, 255, 0.08) 0
    );
  color: var(--btn-danger-text);
}

.theme-light .reminder-progress {
  background:
    conic-gradient(
      var(--accent) calc(var(--ratio, 0) * 360deg),
      rgba(0, 0, 0, 0.06) 0
    );
}

.theme-light .reminder-items li.overdue .reminder-progress {
  background:
    conic-gradient(
      var(--danger) calc(var(--ratio, 0) * 360deg),
      rgba(0, 0, 0, 0.08) 0
    );
}

.reminder-progress span {
  pointer-events: none;
}

  .reminder-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .reminder-title {
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .reminder-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.65rem;
    color: var(--subtext);
  }

  .reminder-tag {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 1px 5px;
  }

  .reminder-actions {
    display: flex;
    gap: 4px;
  }

  .reminder-actions button {
    padding: 3px 5px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .reminders-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
    max-height: none;
    overflow: visible;
  }

  .reminders-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
  }

  .reminders-list .time {
    font-size: 0.8125rem;
    color: var(--subtext);
  }
.item .actions {
  margin-left: auto;
  position: relative;
}
.item .actions > button {
  padding: 4px;
}
.item .actions .menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 4px;
  box-shadow: var(--shadow);
  z-index: 10;
}
.item .actions .menu button {
  width: 100%;
  justify-content: flex-start;
  padding: 6px 8px;
  box-shadow: none;
}
.item .actions .menu[hidden] {
  display: none;
}
.floating-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 4px;
  box-shadow: var(--shadow);
  position: fixed;
  z-index: 1000;
}
.floating-menu button {
  width: 100%;
  justify-content: flex-start;
  padding: 6px 8px;
  box-shadow: none;
}
.favicon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--muted);
  flex: 0 0 16px;
  display: grid;
  place-items: center;
  color: var(--subtext);
}
.favicon svg {
  width: 100%;
  height: 100%;
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
  margin-top: 4px;
  max-width: 280px;
}
.icon-picker button {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--muted);
  border-radius: 6px;
  cursor: pointer;
}
.icon-picker button.selected {
  border-color: var(--accent);
}
.icon-picker svg {
  width: 32px;
  height: 32px;
}
.embed {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  resize: vertical;
  min-height: 120px;
}
.embed iframe {
  aspect-ratio: 16/9;
  width: 100%;
  height: auto;
  border: 0;
  background: white;
}
.empty {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  color: var(--subtext);
  font-size: 14px;
}
.handle {
  cursor: grab;
  opacity: 0.7;
}
body:not(.editing) .handle {
  cursor: default;
}
dialog {
  border: none;
  border-radius: 12px;
  padding: 20px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
dialog form {
  display: grid;
  gap: 12px;
}

#itemForm {
  min-width: 320px;
}

#itemForm label {
  display: block;
}

#itemForm input[name='title'],
#itemForm input[name='url'] {
  width: 100%;
}

#itemForm textarea {
  width: 100%;
}
dialog menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
}
dialog .error {
  color: var(--danger);
  font-size: 13px;
}

/* Form controls */
input:not([type='color']),
textarea,
select {
  background: var(--panel);
  border: 1px solid var(--muted);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

input:not([type='color']):focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

input::placeholder,
textarea::placeholder {
  color: var(--subtext);
  opacity: 0.8;
}
.search input {
  padding: 12px 14px 12px 40px;
}
@media (max-width: 620px) {
  .controls {
    gap: 6px;
  }
  .search input {
    min-width: 170px;
  }
}

@media (max-width: 720px) {
  header {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 8px;
  }

  .title {
    align-items: flex-start;
    gap: 8px;
  }

  .controls {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: stretch;
    gap: 6px;
  }

  .controls > * {
    width: auto;
  }

  .controls button,
  .controls .btn {
    justify-content: center;
  }

  .search {
    width: 100%;
  }

  .search input {
    width: 100%;
    min-width: 0;
  }

  #editBtn,
  #themeBtn {
    align-self: stretch;
  }

  #themeBtn {
    justify-self: end;
  }

  .controls > *:not(.search):not(#editBtn):not(#themeBtn) {
    grid-column: 1 / -1;
  }

  #syncStatus {
    justify-self: start;
  }

  #addMenu {
    width: 100%;
  }

  #addMenuList {
    position: static;
    width: 100%;
    margin-top: 4px;
  }

  main {
    padding: 12px;
  }

  .grid {
    flex-direction: column;
    gap: 12px;
  }

  .group {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    height: auto !important;
  }

  .items-scroll {
    padding: 10px;
  }

  .item {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
  }

  .item .actions {
    display: flex;
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes card-leave {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}

.group[data-anim='enter'],
.item[data-anim='enter'] {
  animation: card-enter 200ms ease-out forwards;
}

.group[data-anim='leave'],
.item[data-anim='leave'] {
  pointer-events: none;
  animation: card-leave 200ms ease-in forwards;
}

@media (prefers-reduced-motion: reduce) {
  .group[data-anim],
  .item[data-anim] {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

@media (max-width: 480px) {
  button,
  .btn {
    padding: 9px 10px;
  }

  .title h1 {
    font-size: clamp(18px, 5vw, 22px);
  }

  .group-header {
    padding: 10px;
  }

  .items-scroll {
    padding: 8px;
  }
}
