*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --anthracite: #141416;
  --anthracite-mid: #1e1e22;
  --anthracite-light: #2a2a30;
  --neon-red: #ff2d55;
  --neon-red-light: #ff5c7a;
  --neon-red-glow: rgba(255, 45, 85, 0.55);
  --neon-red-soft: rgba(255, 45, 85, 0.24);
  --neon-red-faint: rgba(255, 45, 85, 0.1);
  --accent-border: rgba(255, 90, 115, 0.58);
  --accent-border-strong: rgba(255, 120, 140, 0.72);
  --surface: rgba(20, 20, 24, 0.16);
  --surface-input: rgba(14, 14, 18, 0.48);
  --surface-elevated: rgba(28, 28, 34, 0.28);
  --field-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background-color: var(--anthracite);
  color: #f1f1f3;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

.site-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 45% at 50% -8%, rgba(255, 45, 85, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(255, 45, 85, 0.025) 0%, transparent 65%),
    linear-gradient(180deg, #0d0d0f 0%, #141416 48%, #101012 100%);
}

.site-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.035) 0.5px,
    transparent 0.5px
  );
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

.site-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  will-change: transform;
}

.site-bg-orb-1 {
  width: min(36rem, 55vw);
  height: min(36rem, 55vw);
  top: -12%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 45, 85, 0.35) 0%, transparent 70%);
  animation: orb-float-1 32s ease-in-out infinite;
}

.site-bg-orb-2 {
  width: min(24rem, 38vw);
  height: min(24rem, 38vw);
  bottom: -6%;
  right: -4%;
  background: radial-gradient(circle, rgba(255, 92, 122, 0.2) 0%, transparent 72%);
  animation: orb-float-2 38s ease-in-out infinite;
}

.site-bg-orb-3,
.site-bg-orb-4 {
  display: none;
}

.site-bg-logo-pattern {
  display: none;
}

.site-bg-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  user-select: none;
  opacity: 0.28;
}

.site-bg-logo::before {
  display: none;
}

.site-bg-logo-mark {
  width: clamp(5rem, 18vw, 9rem);
  height: clamp(5rem, 18vw, 9rem);
  opacity: 0.85;
  filter: none;
}

.site-bg-logo-wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.9;
  text-align: center;
}

.site-bg-logo-name {
  font-size: clamp(2rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.04) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.site-bg-logo-name-accent {
  background: linear-gradient(
    180deg,
    rgba(255, 92, 122, 0.1) 0%,
    rgba(255, 45, 85, 0.06) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 0;
}

.site-bg-grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: soft-light;
}

@keyframes orb-float-1 {
  0%, 100% { transform: translateX(-50%) translate(0, 0) scale(1); }
  50% { transform: translateX(-50%) translate(0, 3%) scale(1.03); }
}

@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-2%, -2%) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .site-bg-orb {
    animation: none;
  }
}

.header,
.main,
.footer {
  position: relative;
  z-index: 1;
}

.header {
  padding: 1.5rem 1.25rem 0.5rem;
  text-align: center;
}

.header h1 {
  margin: 0;
  font-weight: 700;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  min-width: 0;
  min-height: calc(100dvh - 4.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

.layout {
  --nav-width: 20rem;
  --toggle-width: 2.25rem;
  --panel-width: 36rem;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  gap: 0;
  transition: transform 0.35s ease;
}

.layout:not(.is-panel-open) {
  align-items: center;
  align-self: center;
}

.layout.is-panel-open {
  transform: translateX(calc(-1 * (var(--nav-width) + var(--toggle-width)) / 2));
}

.layout.is-transition-disabled {
  transition: none !important;
}

.layout-nav {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex-shrink: 0;
  width: calc(var(--nav-width) + var(--toggle-width));
}

.layout-nav .sidebar {
  flex: 1;
  min-width: 0;
}

.layout-nav .content-toggle {
  align-self: center;
  flex-shrink: 0;
}

.mobile-folder-toggle {
  display: none;
}

.mobile-folder-backdrop {
  display: none;
}

.content-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: var(--toggle-width);
  min-height: 4.5rem;
  margin-left: -1px;
  padding: 0;
  border: 1px solid var(--accent-border);
  border-left: none;
  border-radius: 0 0.65rem 0.65rem 0;
  background-color: var(--surface-elevated);
  color: #f8fafc;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--field-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.content-toggle:hover,
.content-toggle:focus {
  outline: none;
  background-color: rgba(255, 45, 85, 0.35);
  border-color: rgba(255, 45, 85, 0.5);
}

.content-toggle-icon {
  display: block;
  transform: translateX(1px);
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.content-panel {
  flex-shrink: 0;
  width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-0.75rem);
  transition:
    width 0.35s ease,
    max-width 0.35s ease,
    opacity 0.3s ease,
    transform 0.35s ease;
}

.content-panel.is-transition-disabled {
  transition: none !important;
}

.content-panel.is-collapsed {
  margin: 0;
  padding: 0;
  border: none;
  height: 0;
  min-height: 0;
  max-height: 0;
  align-self: center;
}

.content-panel.is-open {
  width: var(--panel-width);
  max-width: var(--panel-width);
  height: auto;
  max-height: none;
  margin-left: 0.65rem;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  overflow: visible;
  align-self: flex-start;
}

.content-panel.is-hidden {
  display: none;
}

.card {
  background: var(--surface);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 90, 115, 0.32);
  overflow: visible;
  width: 100%;
  text-align: center;
}

.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  border-color: var(--accent-border-strong);
  width: var(--nav-width);
  min-width: var(--nav-width);
  max-width: var(--nav-width);
}

.group-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 1.6rem 0.55rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 90, 115, 0.28);
  color: #e8e8ec;
  text-decoration: none;
  font-size: 0.92rem;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-align: center;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  width: 100%;
}

.page-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  text-align: center;
  width: 100%;
}

.page-header .section-title {
  margin: 0;
}

.group-link-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-count {
  position: absolute;
  top: 0.2rem;
  right: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background-color: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(254, 202, 202, 0.85);
  box-shadow: 0 0 0 2px rgba(28, 28, 32, 0.35);
}

.subgroup-count,
.folder-card-count {
  flex-shrink: 0;
  min-width: 1.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background-color: transparent;
  color: #ffc9d4;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
}

.overview-hint {
  margin: 0 0 1rem;
  color: #94a3b8;
  font-size: 0.9rem;
  text-align: center;
}

.folder-overview {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.75rem;
  justify-items: center;
  width: 100%;
}

.folder-overview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  max-width: 18rem;
}

.name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
}

.title-row .section-title {
  margin: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.45rem;
  border: 1px solid var(--accent-border-strong);
  background-color: var(--surface-elevated);
  color: #f3f4f6;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  list-style: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
}

.icon-btn-edit:hover {
  background-color: rgba(255, 45, 85, 0.28);
  color: #f8fafc;
  border-color: rgba(255, 45, 85, 0.5);
}

.icon-btn-delete {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background-color: rgba(127, 29, 29, 0.35);
  color: #fca5a5;
  font-size: 1rem;
}

.icon-btn-delete:hover {
  background-color: rgba(248, 113, 113, 0.28);
  color: #fff;
}

.folder-view-card {
  position: relative;
  padding-bottom: 3rem;
}

.folder-delete-form {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  margin: 0;
}

.folder-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  padding: 0.9rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid var(--accent-border-strong);
  background-color: var(--surface-elevated);
  color: #f3f4f6;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--field-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.folder-card:hover {
  background-color: rgba(255, 45, 85, 0.28);
  border-color: rgba(255, 45, 85, 0.45);
}

.folder-card-name {
  font-weight: 600;
  word-break: break-word;
}

.folder-card-count {
  align-self: flex-start;
}

.folder-card-depth-1,
.folder-card-depth-2,
.folder-card-depth-3,
.folder-card-depth-4,
.folder-card-depth-5,
.folder-overview-item.folder-card-depth-1,
.folder-overview-item.folder-card-depth-2,
.folder-overview-item.folder-card-depth-3,
.folder-overview-item.folder-card-depth-4,
.folder-overview-item.folder-card-depth-5 {
  margin-left: 0;
}

.page-header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
}

.subgroup-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.subgroup-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.edit-panel {
  width: auto;
  flex-shrink: 0;
}

.edit-panel summary {
  list-style: none;
  cursor: pointer;
}

.edit-panel summary::-webkit-details-marker {
  display: none;
}

.edit-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.65rem 0;
  border-radius: 0;
  border: none;
  background-color: transparent;
  width: 100%;
}

.edit-form input[type="text"] {
  flex: 1 1 10rem;
  min-width: 8rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  border: 1px solid var(--accent-border-strong);
  background-color: var(--surface-input);
  color: #f3f4f6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 16px rgba(0, 0, 0, 0.35);
}

.edit-form button,
.todo-edit-form button {
  padding: 0.55rem 0.85rem;
  border: none;
  border-radius: 0.45rem;
  background: linear-gradient(135deg, #ff2d55, #ff5c7a);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(255, 45, 85, 0.35);
}

.todo-edit-panel {
  position: relative;
}

.todo-content .name-row {
  align-items: center;
  justify-content: center;
}

.todo-content .todo-title {
  flex: 1;
  min-width: 0;
  word-break: normal;
  overflow-wrap: break-word;
}

.todo-content .edit-form {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 15;
  min-width: min(100%, 18rem);
  box-shadow: none;
}

.folder-edit-panel,
.subgroup-edit-panel {
  position: relative;
}

.folder-edit-panel .edit-form,
.subgroup-edit-panel .edit-form {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 15;
  min-width: 14rem;
  box-shadow: none;
}

.inline-edit-panel {
  position: relative;
}

.inline-edit-panel .edit-form {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 15;
  min-width: 14rem;
  box-shadow: none;
}

.todo-edit-form {
  flex-direction: column;
  align-items: stretch;
}

.todo-edit-form .due-picker {
  width: 100%;
}

.subgroup-link {
  flex: 1;
  min-width: 0;
}

.group-link:hover,
.group-link.active {
  background-color: rgba(255, 45, 85, 0.22);
  border-color: var(--accent-border);
  color: #fff;
}

.group-link-depth-0,
.group-link-depth-1,
.group-link-depth-2,
.group-link-depth-3,
.group-link-depth-4,
.group-link-depth-5,
.group-link-depth-6,
.group-link-depth-7,
.group-link-depth-8 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.group-form {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  width: 100%;
}

.group-form input[type="text"],
.todo-form input[type="text"] {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--accent-border-strong);
  background-color: var(--surface-input);
  color: #f3f4f6;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 16px rgba(0, 0, 0, 0.35);
}

.group-form input[type="text"]::placeholder,
.todo-form input[type="text"]::placeholder {
  color: #6b7280;
}

.group-form input[type="text"]:focus,
.todo-form input[type="text"]:focus {
  outline: none;
  border-color: #ff2d55;
  box-shadow: 0 0 0 1px rgba(255, 45, 85, 0.7);
}

.group-form button,
.todo-form button {
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  border: none;
  background: linear-gradient(135deg, #ff2d55, #ff5c7a);
  color: white;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(255, 45, 85, 0.35);
}

.group-form button:hover,
.todo-form button:hover {
  filter: brightness(1.05);
}

.todo-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.todo-form input[type="text"] {
  flex: 2 1 12rem;
  min-width: 10rem;
}

.due-picker {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.due-picker-compact {
  gap: 0.35rem;
}

.due-form {
  display: flex;
  align-items: center;
}

.due-field {
  position: relative;
  z-index: 1;
}

.due-field:has(.due-popover.is-open) {
  z-index: 1200;
}

.picker-backdrop {
  position: fixed;
  inset: 0;
  border: none;
  background: rgba(10, 10, 12, 0.82);
  z-index: 1100;
  pointer-events: auto;
}

.due-popover {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 1200;
  padding: 0.5rem;
  border-radius: 0.65rem;
  border: 1px solid var(--accent-border);
  background-color: var(--surface-input);
  box-shadow: 0 16px 32px rgba(10, 10, 12, 0.75);
  pointer-events: auto;
}

body > .due-popover.is-open {
  position: fixed;
  z-index: 1200;
}

.due-popover-calendar.is-open {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: stretch;
  width: min(18.5rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
}

.picker-backdrop[hidden] {
  display: none;
}

body.calendar-overlay-open {
  overflow: hidden;
}

.due-trigger {
  width: 7.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--accent-border-strong);
  background-color: var(--surface-input);
  color: #f3f4f6;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 16px rgba(0, 0, 0, 0.35);
}

.due-date-input {
  cursor: pointer;
}

.due-time-input {
  cursor: pointer;
}

.due-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.due-trigger.due-trigger-error {
  border-color: #f87171;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.6);
}

.due-trigger::placeholder {
  color: #6b7280;
}

.due-picker-compact .due-trigger {
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
}

.todo-form .due-picker {
  flex: 1 1 auto;
}

.todo-form .due-trigger {
  flex: 1 1 8rem;
  min-width: 7rem;
}

.due-trigger.has-value {
  color: #e5e7eb;
}

.due-trigger:hover,
.due-trigger:focus {
  outline: none;
  border-color: #ff2d55;
  box-shadow: 0 0 0 1px rgba(255, 45, 85, 0.7);
}

.due-popover.is-open {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
}

.due-popover-time.is-open {
  flex-direction: column;
  align-items: stretch;
  width: min(16.5rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
}

.time-picker {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

.time-picker-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.time-picker-label {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.3rem;
}

.time-grid-minutes {
  max-height: 8.5rem;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.time-grid-btn {
  min-height: 2rem;
  border: 1px solid var(--accent-border);
  border-radius: 0.45rem;
  background-color: var(--surface-elevated);
  color: #e5e7eb;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem;
}

.time-grid-btn:hover:not(:disabled) {
  background-color: rgba(255, 45, 85, 0.35);
}

.time-grid-btn.is-selected {
  background: linear-gradient(135deg, #ff2d55, #ff5c7a);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.time-grid-btn.is-disabled,
.time-grid-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.time-picker-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.confirm-time-btn {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #ff2d55, #ff5c7a);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.confirm-time-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.confirm-time-btn:not(:disabled):hover {
  filter: brightness(1.05);
}

.calendar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.calendar-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  flex: 1;
}

.calendar-nav {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.45rem;
  background-color: rgba(255, 45, 85, 0.2);
  color: #ffc9d4;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.calendar-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
}

.calendar-day {
  aspect-ratio: 1;
  min-height: 2rem;
  border: none;
  border-radius: 0.45rem;
  background-color: var(--surface-elevated);
  color: #e5e7eb;
  font-size: 0.8rem;
  cursor: pointer;
}

.calendar-day.is-empty {
  background: transparent;
  pointer-events: none;
}

.calendar-day.is-today {
  border: 1px solid rgba(255, 45, 85, 0.8);
}

.calendar-day.is-selected {
  background: linear-gradient(135deg, #ff2d55, #ff5c7a);
  color: #fff;
  font-weight: 600;
}

.calendar-day.is-disabled,
.calendar-day:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.calendar-day:not(.is-disabled):not(:disabled):hover {
  background-color: rgba(255, 45, 85, 0.35);
}

.scroll-picker-columns {
  display: flex;
  gap: 0.25rem;
}

.scroll-column {
  width: 3rem;
  height: 6.5rem;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  border-radius: 0.5rem;
  border: 1px solid var(--accent-border);
  background-color: var(--surface-input);
  scrollbar-width: thin;
  scrollbar-color: #ff2d55 rgba(28, 28, 32, 0.5);
}

.scroll-column::-webkit-scrollbar {
  width: 6px;
}

.scroll-column::-webkit-scrollbar-thumb {
  background-color: #ff2d55;
  border-radius: 999px;
}

.scroll-picker-spacer {
  height: 2.4rem;
}

.scroll-picker-item {
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}

.due-picker-compact .scroll-picker-item {
  height: 1.7rem;
  font-size: 0.75rem;
}

.scroll-picker-item.is-selected {
  color: #f8fafc;
  font-weight: 600;
}

.scroll-picker-item.is-disabled {
  opacity: 0.25;
  pointer-events: none;
}

.clear-due-btn,
.clear-time-btn {
  width: 1.8rem;
  height: 1.8rem;
  border: none;
  border-radius: 999px;
  background-color: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.clear-due-btn:hover,
.clear-time-btn:hover {
  background-color: rgba(248, 113, 113, 0.28);
}

.subgroup-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.subgroup-link {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 45, 85, 0.45);
  background-color: rgba(255, 45, 85, 0.35);
  color: #ffc9d4;
  text-decoration: none;
  font-size: 0.85rem;
}

.subgroup-link:hover {
  background-color: rgba(255, 45, 85, 0.32);
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  overflow: visible;
  width: 100%;
}

.todo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.35rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
  flex-wrap: wrap;
  overflow: visible;
  position: relative;
  z-index: 0;
  width: 100%;
  text-align: center;
}

.todo-item:has(.due-popover.is-open) {
  z-index: 5;
}

.todo-item:hover {
  background-color: transparent;
}

.todo-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  text-align: center;
}

.todo-title {
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
}

.todo-group-label {
  font-size: 0.75rem;
  color: #ff9db0;
}

.todo-due-label {
  font-size: 0.75rem;
  color: #fcd34d;
}

.todo-overdue .todo-due-label {
  color: #fca5a5;
}

.todo-overdue {
  border: none;
  background-color: transparent;
}

.todo-done .todo-title {
  text-decoration: line-through;
  color: #9ca3af;
}

.inline-form {
  margin: 0;
}

.move-form select {
  max-width: 9rem;
  margin: 0 auto;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
  border: 1px solid var(--accent-border-strong);
  background-color: var(--surface-input);
  color: #e5e7eb;
  font-size: 0.8rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toggle-btn,
.delete-btn,
.text-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #e5e7eb;
  font-size: 0.95rem;
}

.toggle-btn {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-input);
  border: 1px solid var(--accent-border-strong);
}

.todo-done .toggle-btn {
  background: linear-gradient(135deg, #22c55e, #4ade80);
  border-color: transparent;
}

.delete-btn {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f97373;
}

.delete-btn:hover {
  background-color: rgba(248, 113, 113, 0.15);
}

.text-btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.4rem;
  border: 1px solid var(--accent-border);
  background-color: var(--surface-input);
  color: #f8fafc;
  font-size: 0.8rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.text-btn.danger {
  color: #fca5a5;
}

.text-btn.danger:hover {
  background-color: rgba(248, 113, 113, 0.15);
}

.empty-state {
  margin: 0.3rem 0;
  color: #9ca3af;
  text-align: center;
}

.footer {
  text-align: center;
  padding: 0.75rem 1rem 1.25rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

@media (max-width: 900px) {
  .group-link {
    font-size: 0.88rem;
  }
}

@media (max-width: 768px) {
  .layout {
    --nav-width: min(20rem, calc(100vw - 3rem));
    --panel-width: min(36rem, calc(100vw - 3rem));
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
  }

  .layout.is-panel-open {
    transform: none;
  }

  .layout-nav {
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: calc(var(--nav-width) + var(--toggle-width));
  }

  .layout:not(.is-mobile-todos-open) .layout-nav .content-toggle {
    width: 100%;
    max-width: var(--nav-width);
    min-height: 2.25rem;
    margin-top: 0.5rem;
    margin-left: 0;
    border-left: 1px solid rgba(255, 77, 109, 0.38);
    border-top: none;
    border-radius: 0 0 0.65rem 0.65rem;
  }

  .layout.is-mobile-todos-open:not(.is-folder-menu-open) .layout-nav {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(var(--nav-width), calc(100vw - 2rem));
    max-width: none;
    height: auto;
    z-index: 1100;
    padding: 0;
  }

  .layout.is-mobile-todos-open:not(.is-folder-menu-open) .sidebar {
    display: none;
  }

  .layout.is-mobile-todos-open.is-folder-menu-open .layout-nav {
    display: flex;
    flex-direction: row;
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    width: min(20rem, 92vw);
    max-width: none;
    height: 100dvh;
    z-index: 1200;
    padding: 0;
    overflow: hidden;
  }

  .layout.is-mobile-todos-open.is-folder-menu-open .sidebar {
    display: flex;
    flex: 1;
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 100%;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
  }

  .layout.is-mobile-todos-open .content-toggle {
    display: none;
  }

  .mobile-folder-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: var(--nav-width);
    min-height: 2.75rem;
    padding: 0;
    border: 1px solid rgba(255, 77, 109, 0.45);
    border-radius: 0.65rem 0 0 0.65rem;
    background-color: var(--surface-elevated);
    color: #e5e7eb;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .layout.is-mobile-todos-open .mobile-folder-toggle:not([hidden]) {
    display: flex;
  }

  .layout.is-mobile-todos-open:not(.is-folder-menu-open) .mobile-folder-toggle:not([hidden]) {
    width: 100%;
    border-radius: 0.65rem;
  }

  .layout.is-mobile-todos-open.is-folder-menu-open .mobile-folder-toggle:not([hidden]) {
    width: var(--toggle-width);
    min-height: 100%;
    flex-shrink: 0;
    border-radius: 0;
    border-right: none;
  }

  .mobile-folder-toggle-bar {
    display: block;
    width: 1.2rem;
    height: 2px;
    border-radius: 999px;
    background-color: currentColor;
  }

  .mobile-folder-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1150;
    border: none;
    background: rgba(10, 10, 12, 0.82);
  }

  .mobile-folder-backdrop[hidden] {
    display: none;
  }

  .content-toggle-icon {
    transform: rotate(90deg) translateX(1px);
  }

  .content-panel {
    width: 100%;
    max-width: var(--panel-width);
    transform: translateY(-0.5rem);
    transition:
      max-height 0.35s ease,
      opacity 0.3s ease,
      transform 0.35s ease;
  }

  .layout.is-mobile-todos-open .content-panel.is-open {
    padding-top: 3.75rem;
  }

  .content-panel.is-collapsed {
    max-height: 0;
    width: 100%;
    max-width: var(--panel-width);
  }

  .content-panel.is-open {
    width: 100%;
    max-width: var(--panel-width);
    max-height: 5000px;
    margin-left: 0;
    margin-top: 0.65rem;
    transform: translateY(0);
    align-self: center;
  }

  .main {
    padding: 0.75rem;
  }

  .header {
    padding: 1rem 0.75rem 0.25rem;
  }

  .header h1 {
    font-size: 1.35rem;
  }

  .card {
    padding: 0.85rem;
  }

  .page-header {
    flex-direction: column;
    align-items: center;
  }

  .todo-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .todo-form input[type="text"] {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }

  .todo-form .due-picker {
    grid-column: 1 / -1;
    width: 100%;
  }

  .todo-form .due-trigger {
    flex: 1;
    min-width: 0;
    width: auto;
  }

  .todo-form button[type="submit"] {
    grid-column: 1 / -1;
    width: 100%;
  }

  .todo-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "toggle content delete"
      "move move move";
    align-items: center;
    justify-items: center;
    gap: 0.55rem 0.5rem;
    text-align: center;
  }

  .todo-action-toggle {
    grid-area: toggle;
  }

  .todo-content {
    grid-area: content;
  }

  .todo-action-delete {
    grid-area: delete;
    justify-self: end;
  }

  .todo-action-move {
    grid-area: move;
    width: 100%;
    justify-self: center;
    display: flex;
    justify-content: center;
  }

  .due-form,
  .due-picker {
    width: 100%;
  }

  .due-picker {
    flex-wrap: wrap;
  }

  .due-field {
    flex: 1;
    min-width: 7rem;
  }

  .due-trigger {
    width: 100%;
  }

  .due-popover {
    left: 0;
    right: auto;
    max-width: calc(100vw - 2rem);
  }

  .due-popover-time.is-open {
    width: min(12rem, calc(100vw - 2rem));
  }

  .due-popover-calendar.is-open {
    width: min(calc(100vw - 1.5rem), 20rem);
  }

  .move-form select {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .todo-form,
  .group-form,
  .due-picker {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }

  .todo-form button,
  .group-form button {
    width: 100%;
  }

  .due-field {
    width: 100%;
  }

  .calendar-day {
    min-height: 1.8rem;
    font-size: 0.75rem;
  }
}
