/* Main view container */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

/* Task list wrapper */
.task-list-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Task list */
.task-list {
  list-style: none;
  flex: 1;
  padding: 0;
  margin: 0;
  position: relative;
  overflow: hidden;
  overscroll-behavior: none;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.task-list::-webkit-scrollbar {
  display: none; /* Chrome, Safari, iOS, Android */
}

/* Empty ruled lines to maintain notebook page feel even when no items */
.task-empty-line {
  height: var(--ruled-line-height);
  min-height: var(--ruled-line-height);
  border-bottom: 1px solid var(--paper-line);
  box-sizing: border-box;
  list-style: none;
  background: transparent;
  pointer-events: none; /* purely visual, pull-down to add remains on sheet */
}

/* Floating Empty State Notice (centered over empty ruled lines) */
.empty-state-notice {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 360px;
  padding: 18px 24px;
  text-align: center;
  background: rgba(250, 244, 235, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(85, 60, 35, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(45, 30, 15, 0.05);
  pointer-events: none;
  z-index: 3;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  animation: fadeInNotice 0.28s ease;
}

@keyframes fadeInNotice {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.empty-state-text {
  font-size: 16px;
  font-style: italic;
  color: var(--ink-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}

.empty-state-sub {
  font-size: 12.5px;
  color: var(--ink-faded);
  letter-spacing: 0.01em;
}

/* Task Item row */
.task-item-wrapper {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--paper-line);
  background: transparent;
  min-height: var(--ruled-line-height);
  box-sizing: border-box;
}

/* Swipe Action Backgrounds */
.swipe-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 13px;
  font-family: var(--font-zen);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}

.swipe-bg-complete {
  justify-content: flex-start;
  background-color: #E2ECE1;
  color: #245826;
}

.swipe-bg-delete {
  justify-content: flex-end;
  background-color: var(--delete-bg);
  color: var(--delete-tint);
}

/* Task Card Foreground */
.task-card {
  position: relative;
  min-height: calc(var(--ruled-line-height) - 1px);
  padding: 16px 88px 16px 72px;
  background: var(--sheet-bg);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  touch-action: pan-x;
  transition: background-color 0.25s, transform 0.15s ease-out;
  will-change: transform;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.task-card.swiping {
  transition: none;
}

/* Pinned task styling (tactile gray paper clip) */
.pin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8E887E;
  margin-bottom: 2px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.paperclip-svg {
  display: block;
  color: #8E887E;
  transform: rotate(-15deg);
}
.task-card.pinned {
  background-color: var(--sheet-pinned);
}
.task-card.pinned .task-bullet {
  background: #8E887E;
}
.swipe-bg-delete.is-pinned-locked {
  background-color: #E2E4E8;
  color: #384252;
  font-size: 11px;
}

/* Red Zone state (>6 hrs) */
.task-card.urgent {
  background-color: var(--urgent-tint);
}
.task-card.urgent .task-text {
  color: var(--urgent-ink);
}
.task-card.urgent .age-indicator {
  color: var(--urgent-ink);
  font-weight: bold;
}
.task-card.urgent::before {
  content: '';
  position: absolute;
  left: 56px;
  top: 0;
  bottom: 0;
  width: 2.5px;
  background-color: var(--urgent-ink);
}

/* Left margin metadata */
.margin-meta {
  position: absolute;
  left: 12px;
  top: 20px;
  width: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.age-badge {
  font-size: 12px;
  font-family: var(--font-zen);
  color: var(--ink-faded);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.task-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-secondary);
  margin-top: 5px;
}

.task-card.urgent .task-bullet {
  background: var(--urgent-ink);
  box-shadow: 0 0 6px rgba(163, 40, 23, 0.4);
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-text {
  font-size: 17.5px;
  font-weight: 450;
  line-height: 1.55;
  color: var(--ink-primary);
  word-break: break-word;
  transition: color 0.2s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Inline editing */
.task-edit-input {
  width: 100%;
  font-family: var(--active-font);
  font-size: 17.5px;
  line-height: 1.55;
  color: var(--ink-primary);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--ink-primary);
  outline: none;
  padding: 0 0 2px 0;
  margin: 0;
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* Ripple / ink tap feedback */
.tap-flash {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(163, 40, 23, 0.08);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.tap-flash.flash-active {
  opacity: 1;
  transition: none;
}
