/* ── Floating Action Button (pebble) ──────────────────── */
.pebble-fab {
  position: fixed;
  bottom: 76px;
  left: 20px;
  z-index: 260;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  padding: 0;
}

.pebble-fab:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.08);
}

.pebble-fab__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ── Quick-Add Overlay ────────────────────────────────── */
.pebble-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 600;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.pebble-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.pebble-overlay__panel {
  width: 420px;
  max-width: 90vw;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
  transform: translateY(-12px) scale(0.97);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.pebble-overlay--visible .pebble-overlay__panel {
  transform: translateY(0) scale(1);
}

.pebble-overlay__row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.pebble-overlay__icon {
  flex-shrink: 0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.pebble-overlay__input {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  background: none;
  border: none;
  outline: none;
  padding: 0;
  caret-color: var(--accent);
  font-family: inherit;
}

.pebble-overlay__input::placeholder {
  color: var(--text-muted);
}

.pebble-overlay__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
}

.pebble-overlay__checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.pebble-overlay__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.pebble-overlay__footer kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.625rem;
  font-family: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: var(--text-secondary);
  margin: 0 2px;
}

/* ── Overlay Pending List ──────────────────────────────── */
.pebble-overlay__pending-list {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}

.pebble-overlay__pending-list::-webkit-scrollbar {
  width: 6px;
}

.pebble-overlay__pending-list::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}

.pebble-overlay__list-header {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-xs) var(--space-lg) 0;
}

.pebble-overlay__list-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-lg);
  transition: background var(--transition-fast);
}

.pebble-overlay__list-item:hover {
  background: var(--bg-surface);
}

.pebble-overlay__list-item-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* ── Quarry Pebbles Section ───────────────────────────── */
.pebbles-section {
  margin-bottom: var(--space-md);
}

.pebble-done-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  margin-bottom: var(--space-xs);
}

/* ── Pebble List View ─────────────────────────────────── */
.pebble-section-header {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
  margin-top: var(--space-lg);
}

.pebble-section-header--done {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.pebble-section-header--done h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.pebble-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xs);
  transition: background var(--transition-fast);
}

.pebble-row:hover {
  background: var(--bg-elevated);
}

.pebble-row--done .pebble-row__text {
  text-decoration: line-through;
  opacity: 0.5;
}

.pebble-row__checkbox {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.pebble-row__text {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pebble-row__date {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pebble-row__menu-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  transition: all var(--transition-fast);
  position: relative;
}

.pebble-row__menu-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ── Pebble Subitems ──────────────────────────────────── */
.pebble-wrapper {
  margin-bottom: var(--space-xs);
}

.pebble-wrapper .pebble-row {
  margin-bottom: 0;
}

.pebble-subitems {
  margin-left: 28px;
  border-left: 2px solid var(--border-subtle);
  padding-left: var(--space-sm);
}

.pebble-subitem {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 2px var(--space-xs);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: background var(--transition-fast);
  border-radius: var(--radius-sm);
}

.pebble-subitem:hover {
  background: var(--bg-elevated);
}

.pebble-subitem--done .pebble-subitem__text {
  text-decoration: line-through;
  opacity: 0.5;
}

.pebble-subitem__checkbox {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--accent);
}

.pebble-subitem__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pebble-subitem__delete {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  opacity: 0;
  transition: all var(--transition-fast);
}

.pebble-subitem:hover .pebble-subitem__delete {
  opacity: 1;
}

.pebble-subitem__delete:hover {
  color: var(--danger);
  background: var(--bg-surface);
}

.pebble-subitem-add {
  padding: 2px var(--space-xs);
}

.pebble-subitem-add__input {
  width: 100%;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background: none;
  border: none;
  outline: none;
  padding: 2px 0;
  font-family: inherit;
  caret-color: var(--accent);
}

.pebble-subitem-add__input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* ── Actions Menu ─────────────────────────────────────── */
.pebble-actions-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  min-width: 160px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xs) 0;
  overflow: hidden;
}

.pebble-actions-menu__item {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-family: inherit;
}

.pebble-actions-menu__item:hover {
  background: var(--bg-elevated);
}

.pebble-actions-menu__item--danger:hover {
  background: var(--danger);
  color: white;
}

/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .pebble-fab {
    bottom: 72px;
    left: 16px;
  }

  .pebble-overlay__panel {
    width: calc(100vw - 32px);
  }
}
